| Line 34... |
Line 34... |
| 34 |
|
34 |
|
| 35 |
if (wordText != null && wordText.Length > 0)
|
35 |
if (wordText != null && wordText.Length > 0)
|
| 36 |
{
|
36 |
{
|
| 37 |
wr = appendAndSelectText(wordText, styleName, continuation);
|
37 |
wr = appendAndSelectText(wordText, styleName, continuation);
|
| 38 |
}
|
38 |
}
|
| 39 |
else if (!EA_DocGenOptions.opt_SuppressElementDescriptionMissingWarnings)
|
39 |
else if (!EA_DocGenOptions.optionValue(EA_DocGenOptions.boolean_options_e.SUPPRESS_ELEMENT_DESC_MISSING_WARNINGS))
|
| 40 |
{
|
40 |
{
|
| 41 |
wr = appendAndSelectText("Description missing!", styleName, continuation);
|
41 |
wr = appendAndSelectText("Description missing!", styleName, continuation);
|
| 42 |
// For some wierd reason, if continuing on same paragraph, we have to decrement the range start by 1
|
42 |
// For some wierd reason, if continuing on same paragraph, we have to decrement the range start by 1
|
| 43 |
// otherwise the D of Description, does not get the red color or italic style
|
43 |
// otherwise the D of Description, does not get the red color or italic style
|
| 44 |
if (continuation)
|
44 |
if (continuation)
|
| Line 142... |
Line 142... |
| 142 |
}
|
142 |
}
|
| 143 |
// append the text as a heading
|
143 |
// append the text as a heading
|
| 144 |
appendAndSelectText(wordText, styleText);
|
144 |
appendAndSelectText(wordText, styleText);
|
| 145 |
}
|
145 |
}
|
| 146 |
|
146 |
|
| - |
|
147 |
/// <summary>
|
| - |
|
148 |
/// Appends a specified text string to the word document, selects the new text, and applies
|
| - |
|
149 |
/// a numpara level style to it.
|
| - |
|
150 |
/// </summary>
|
| - |
|
151 |
/// <param name="wordText"></param>
|
| - |
|
152 |
/// <param name="level"></param>
|
| - |
|
153 |
public static void appendAndSelectNumParaText(string wordText, int level)
|
| - |
|
154 |
{
|
| - |
|
155 |
// A caller is requesting a new heading level so pass the level to the tracking
|
| - |
|
156 |
// object so that we can predict exactly what the level numbering should be for
|
| - |
|
157 |
// diagnostics and fake heading generation (see below in the switch statement).
|
| - |
|
158 |
DocSectionTracking.trackDocSection(level);
|
| - |
|
159 |
|
| - |
|
160 |
// Convert level to heading style
|
| - |
|
161 |
string styleText;
|
| - |
|
162 |
switch(level)
|
| - |
|
163 |
{
|
| - |
|
164 |
case 1: styleText = EA_Constants.styleName_NumPara1; break;
|
| - |
|
165 |
case 2: styleText = EA_Constants.styleName_NumPara2; break;
|
| - |
|
166 |
case 3: styleText = EA_Constants.styleName_NumPara3; break;
|
| - |
|
167 |
case 4: styleText = EA_Constants.styleName_NumPara4; break;
|
| - |
|
168 |
case 5: styleText = EA_Constants.styleName_NumPara5; break;
|
| - |
|
169 |
case 6: styleText = EA_Constants.styleName_NumPara6; break;
|
| - |
|
170 |
case 7: styleText = EA_Constants.styleName_NumPara7; break;
|
| - |
|
171 |
case 8: styleText = EA_Constants.styleName_NumPara8; break;
|
| - |
|
172 |
case 9: styleText = EA_Constants.styleName_NumPara9; break;
|
| - |
|
173 |
|
| - |
|
174 |
default:
|
| - |
|
175 |
// MS-Word cannot produce headings above level 9 and so we have to
|
| - |
|
176 |
// fake a heading by constructing it from our document section tracking data.
|
| - |
|
177 |
styleText = EA_Constants.styleName_NumPara10OrAbove;
|
| - |
|
178 |
wordText = DocSectionTracking.formHeadingString(wordText);
|
| - |
|
179 |
break;
|
| - |
|
180 |
}
|
| - |
|
181 |
// append the text as a heading
|
| - |
|
182 |
appendAndSelectText(wordText, styleText);
|
| - |
|
183 |
}
|
| - |
|
184 |
|
| - |
|
185 |
|
| 147 |
public static string trimTrailingReturns(string s)
|
186 |
public static string trimTrailingReturns(string s)
|
| 148 |
{
|
187 |
{
|
| 149 |
return s.TrimEnd(trim_newlines);
|
188 |
return s.TrimEnd(trim_newlines);
|
| 150 |
}
|
189 |
}
|
| 151 |
|
190 |
|
| Line 177... |
Line 216... |
| 177 |
|
216 |
|
| 178 |
foreach(EA.Test theTest in theElement.Tests)
|
217 |
foreach(EA.Test theTest in theElement.Tests)
|
| 179 |
{
|
218 |
{
|
| 180 |
appendAndSelectHeadingText("Test Case - " + theTest.Name, recurse_level+2);
|
219 |
appendAndSelectHeadingText("Test Case - " + theTest.Name, recurse_level+2);
|
| 181 |
|
220 |
|
| - |
|
221 |
if (EA_DocGenOptions.optionValue(EA_DocGenOptions.boolean_options_e.USE_NUM_PARA_FOR_GENERATED_TEST_CASES) == true)
|
| - |
|
222 |
appendAndSelectNumParaText("Description", recurse_level+3);
|
| - |
|
223 |
else
|
| 182 |
appendAndSelectHeadingText("Description", recurse_level+3);
|
224 |
appendAndSelectHeadingText("Description", recurse_level+3);
|
| 183 |
appendAndSelectText(theTest.Notes, EA_Constants.styleName_Body1);
|
225 |
appendAndSelectText(theTest.Notes, EA_Constants.styleName_Body1);
|
| 184 |
|
226 |
|
| - |
|
227 |
if (EA_DocGenOptions.optionValue(EA_DocGenOptions.boolean_options_e.USE_NUM_PARA_FOR_GENERATED_TEST_CASES) == true)
|
| - |
|
228 |
appendAndSelectNumParaText("Inputs", recurse_level+3);
|
| - |
|
229 |
else
|
| 185 |
appendAndSelectHeadingText("Inputs", recurse_level+3);
|
230 |
appendAndSelectHeadingText("Inputs", recurse_level+3);
|
| 186 |
appendAndSelectText(theTest.Input, EA_Constants.styleName_Body1);
|
231 |
appendAndSelectText(theTest.Input, EA_Constants.styleName_Body1);
|
| 187 |
|
232 |
|
| - |
|
233 |
if (EA_DocGenOptions.optionValue(EA_DocGenOptions.boolean_options_e.USE_NUM_PARA_FOR_GENERATED_TEST_CASES) == true)
|
| - |
|
234 |
appendAndSelectNumParaText("Expected Results", recurse_level+3);
|
| - |
|
235 |
else
|
| 188 |
appendAndSelectHeadingText("Expected Results", recurse_level+3);
|
236 |
appendAndSelectHeadingText("Expected Results", recurse_level+3);
|
| 189 |
appendAndSelectText(theTest.AcceptanceCriteria, EA_Constants.styleName_Body1);
|
237 |
appendAndSelectText(theTest.AcceptanceCriteria, EA_Constants.styleName_Body1);
|
| 190 |
}
|
238 |
}
|
| 191 |
}
|
239 |
}
|
| 192 |
else
|
240 |
else
|
| 193 |
{
|
241 |
{
|