Subversion Repositories DevTools

Rev

Rev 2106 | Rev 2132 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2106 Rev 2116
Line 66... Line 66...
66
            s.NoProofing = 0;
66
            s.NoProofing = 0;
67
         }
67
         }
68
         return s;
68
         return s;
69
      }
69
      }
70
 
70
 
-
 
71
      public static void fixupNumParaStyles()
-
 
72
      {
-
 
73
         // Remove all NumPara styles, some of which are known to be faulty.
-
 
74
         Word.Style np = getStyle(EA_Constants.styleName_NumPara1);
-
 
75
         if (np != null) np.Delete();
-
 
76
         np = getStyle(EA_Constants.styleName_NumPara2);
-
 
77
         if (np != null) np.Delete();
-
 
78
         np = getStyle(EA_Constants.styleName_NumPara3);
-
 
79
         if (np != null) np.Delete();
-
 
80
         np = getStyle(EA_Constants.styleName_NumPara4);
-
 
81
         if (np != null) np.Delete();
-
 
82
         np = getStyle(EA_Constants.styleName_NumPara5);
-
 
83
         if (np != null) np.Delete();
-
 
84
         np = getStyle(EA_Constants.styleName_NumPara6);
-
 
85
         if (np != null) np.Delete();
-
 
86
         np = getStyle(EA_Constants.styleName_NumPara7);
-
 
87
         if (np != null) np.Delete();
-
 
88
         np = getStyle(EA_Constants.styleName_NumPara8);
-
 
89
         if (np != null) np.Delete();
-
 
90
         np = getStyle(EA_Constants.styleName_NumPara9);
-
 
91
         if (np != null) np.Delete();
-
 
92
         np = getStyle("Numpara 6");   // ERG template has this one too - Note the lower case p
-
 
93
         if (np != null) np.Delete();
-
 
94
 
-
 
95
         // Re-Create Good Num Para styles based on the now good Heading styles
-
 
96
         Word.Style baseStyle;
-
 
97
         baseStyle = getStyle(EA_Constants.styleName_Heading1);
-
 
98
         if (baseStyle != null)
-
 
99
         {
-
 
100
            np = createParagrapghStyle(EA_Constants.styleName_NumPara1, EA_Constants.styleName_Body1, baseStyle);
-
 
101
            np.Font.Size = 10;
-
 
102
            np.Font.Bold = 0;
-
 
103
         }
-
 
104
         baseStyle = getStyle(EA_Constants.styleName_Heading2);
-
 
105
         if (baseStyle != null)
-
 
106
         {
-
 
107
            np = createParagrapghStyle(EA_Constants.styleName_NumPara2, EA_Constants.styleName_Body1, baseStyle);
-
 
108
            np.Font.Size = 10;
-
 
109
            np.Font.Bold = 0;
-
 
110
         }
-
 
111
         baseStyle = getStyle(EA_Constants.styleName_Heading3);
-
 
112
         if (baseStyle != null)
-
 
113
         {
-
 
114
            np = createParagrapghStyle(EA_Constants.styleName_NumPara3, EA_Constants.styleName_Body1, baseStyle);
-
 
115
            np.Font.Size = 10;
-
 
116
            np.Font.Bold = 0;
-
 
117
         }
-
 
118
         baseStyle = getStyle(EA_Constants.styleName_Heading4);
-
 
119
         if (baseStyle != null)
-
 
120
         {
-
 
121
            np = createParagrapghStyle(EA_Constants.styleName_NumPara4, EA_Constants.styleName_Body1, baseStyle);
-
 
122
            np.Font.Size = 10;
-
 
123
            np.Font.Bold = 0;
-
 
124
         }
-
 
125
         baseStyle = getStyle(EA_Constants.styleName_Heading5);
-
 
126
         if (baseStyle != null)
-
 
127
         {
-
 
128
            np = createParagrapghStyle(EA_Constants.styleName_NumPara5, EA_Constants.styleName_Body1, baseStyle);
-
 
129
            np.Font.Size = 10;
-
 
130
            np.Font.Bold = 0;
-
 
131
         }
-
 
132
         baseStyle = getStyle(EA_Constants.styleName_Heading6);
-
 
133
         if (baseStyle != null)
-
 
134
         {
-
 
135
            np = createParagrapghStyle(EA_Constants.styleName_NumPara6, EA_Constants.styleName_Body1, baseStyle);
-
 
136
            np.Font.Size = 10;
-
 
137
            np.Font.Bold = 0;
-
 
138
         }
-
 
139
         baseStyle = getStyle(EA_Constants.styleName_Heading7);
-
 
140
         if (baseStyle != null)
-
 
141
         {
-
 
142
            np = createParagrapghStyle(EA_Constants.styleName_NumPara7, EA_Constants.styleName_Body1, baseStyle);
-
 
143
            np.Font.Size = 10;
-
 
144
            np.Font.Bold = 0;
-
 
145
         }
-
 
146
         baseStyle = getStyle(EA_Constants.styleName_Heading8);
-
 
147
         if (baseStyle != null)
-
 
148
         {
-
 
149
            np = createParagrapghStyle(EA_Constants.styleName_NumPara8, EA_Constants.styleName_Body1, baseStyle);
-
 
150
            np.Font.Size = 10;
-
 
151
            np.Font.Bold = 0;
-
 
152
         }
-
 
153
         baseStyle = getStyle(EA_Constants.styleName_Heading9);
-
 
154
         if (baseStyle != null)
-
 
155
         {
-
 
156
            np = createParagrapghStyle(EA_Constants.styleName_NumPara9, EA_Constants.styleName_Body1, baseStyle);
-
 
157
            np.Font.Size = 10;
-
 
158
            np.Font.Bold = 0;
-
 
159
         }
-
 
160
      }
-
 
161
 
71
      /// <summary>
162
      /// <summary>
72
      /// This method is designed to correct problems that have been reported in the styles
163
      /// This method is designed to correct problems that have been reported in the styles
73
      /// contained in the input templates being used. These can be corrected programmatically
164
      /// contained in the input templates being used. These can be corrected programmatically
74
      /// much quicker than waiting for a fix to be done to the templates and having them re-deployed
165
      /// much quicker than waiting for a fix to be done to the templates and having them re-deployed
75
      /// to the shared drive where MS-Word templates are retrieved from by most users.
166
      /// to the shared drive where MS-Word templates are retrieved from by most users.
Line 107... Line 198...
107
         Word.Style h9 = getStyle(EA_Constants.styleName_Heading9);
198
         Word.Style h9 = getStyle(EA_Constants.styleName_Heading9);
108
         if (h9 != null)
199
         if (h9 != null)
109
         {
200
         {
110
            h9.Font.Bold = 1;
201
            h9.Font.Bold = 1;
111
         }
202
         }
-
 
203
 
-
 
204
         fixupNumParaStyles();
112
      }
205
      }
113
 
206
 
114
      /// <summary>
207
      /// <summary>
115
      /// This method creates a heading level style for heading levels 10 or above. Although MS-Word 
208
      /// This method creates a heading level style for heading levels 10 or above. Although MS-Word 
116
      /// does not support level numbering above 9, EA_DocGen can fake the heading number and use the
209
      /// does not support level numbering above 9, EA_DocGen can fake the heading number and use the
Line 119... Line 212...
119
      public static void createAdditionalHeadingLevelStyles()
212
      public static void createAdditionalHeadingLevelStyles()
120
      {
213
      {
121
         Word.Style s_Body1 = getStyle(EA_Constants.styleName_Body1);
214
         Word.Style s_Body1 = getStyle(EA_Constants.styleName_Body1);
122
         if (s_Body1 != null)
215
         if (s_Body1 != null)
123
         {
216
         {
-
 
217
            // Heading 10 or above
124
            Word.Style h10 = createParagrapghStyle(EA_Constants.styleName_Heading10OrAbove, EA_Constants.styleName_Body1, s_Body1);
218
            Word.Style h10 = createParagrapghStyle(EA_Constants.styleName_Heading10OrAbove, EA_Constants.styleName_Body1, s_Body1);
125
            h10.Font.Size = 10;
219
            h10.Font.Size = 10;
126
            h10.Font.Bold = 1;
220
            h10.Font.Bold = 1;
127
            h10.ParagraphFormat.LeftIndent  = createWordDoc.WordApp.CentimetersToPoints((float)0.0);
221
            h10.ParagraphFormat.LeftIndent  = createWordDoc.WordApp.CentimetersToPoints((float)0.0);
128
            h10.ParagraphFormat.SpaceAfter  = 6;
222
            h10.ParagraphFormat.SpaceAfter  = 6;
129
            h10.ParagraphFormat.SpaceBefore = 12;
223
            h10.ParagraphFormat.SpaceBefore = 12;
-
 
224
 
-
 
225
            // NumPara 10 or above
-
 
226
            Word.Style np10 = createParagrapghStyle(EA_Constants.styleName_NumPara10OrAbove, EA_Constants.styleName_Body1, s_Body1);
-
 
227
            h10.Font.Size = 10;
-
 
228
            h10.Font.Bold = 0;
-
 
229
            h10.ParagraphFormat.LeftIndent  = createWordDoc.WordApp.CentimetersToPoints((float)0.0);
-
 
230
            h10.ParagraphFormat.SpaceAfter  = 6;
-
 
231
            h10.ParagraphFormat.SpaceBefore = 12;
130
         }
232
         }
131
      }
233
      }
132
 
234
 
133
      /// <summary>
235
      /// <summary>
134
      /// Create the styles used to display class element details
236
      /// Create the styles used to display class element details