PageRenderTime 56ms CodeModel.GetById 27ms RepoModel.GetById 1ms app.codeStats 0ms

/AODLTest/TestClass.cs

https://bitbucket.org/chrisc/aodl
C# | 586 lines | 338 code | 51 blank | 197 comment | 8 complexity | f0d6b2220c7a1537a925bc719027cbc2 MD5 | raw file
  1. /*************************************************************************
  2. *
  3. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
  4. *
  5. * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
  6. *
  7. * Use is subject to license terms.
  8. *
  9. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  10. * use this file except in compliance with the License. You may obtain a copy
  11. * of the License at http://www.apache.org/licenses/LICENSE-2.0. You can also
  12. * obtain a copy of the License at http://odftoolkit.org/docs/license.txt
  13. *
  14. * Unless required by applicable law or agreed to in writing, software
  15. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  16. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  17. *
  18. * See the License for the specific language governing permissions and
  19. * limitations under the License.
  20. *
  21. ************************************************************************/
  22. using System;
  23. using NUnit.Framework;
  24. using AODL.TextDocument.Style;
  25. using AODL.TextDocument.Style.Properties;
  26. using AODL.TextDocument;
  27. using AODL.TextDocument.Content;
  28. using AODL.Publish;
  29. using System.Xml;
  30. using System.IO;
  31. using System.Reflection;
  32. namespace AODLTest
  33. {
  34. /// <summary>
  35. /// Zusammenfassung für Class1.
  36. /// </summary>
  37. [TestFixture]
  38. public class TestClass
  39. {
  40. [SetUp]
  41. public void SetUp()
  42. {
  43. }
  44. [Test]
  45. public void NewTextDocument()
  46. {
  47. TextDocument td = new TextDocument();
  48. td.New();
  49. Assert.IsNotNull(td.XmlDoc, "Must exist!");
  50. //Console.WriteLine("Doc: {0}", td.XmlDoc.OuterXml);
  51. }
  52. [Test]
  53. public void ParagraphTest()
  54. {
  55. TextDocument td = new TextDocument();
  56. td.New();
  57. Paragraph p = new Paragraph(td, "P1");
  58. Assert.IsNotNull(p.Style, "Style object must exist!");
  59. Assert.AreEqual(p.Style.GetType().Name, "ParagraphStyle", "IStyle object must be type of ParagraphStyle");
  60. Assert.IsNotNull(((ParagraphStyle)p.Style).Properties, "Properties object must exist!");
  61. //add text
  62. p.TextContent.Add(new SimpleText(p, "HallO"));
  63. //Add the Paragraph
  64. td.Content.Add((IContent)p);
  65. //Blank para
  66. td.Content.Add(new Paragraph(td, ParentStyles.Standard.ToString()));
  67. // new para
  68. p = new Paragraph(td, "P2");
  69. p.TextContent.Add(new SimpleText(p, "Hallo"));
  70. td.Content.Add(p);
  71. td.SaveTo("parablank.odt");
  72. //Console.WriteLine("Document: {0}", td.XmlDoc.OuterXml);
  73. }
  74. [Test]
  75. public void ParagraphAddRemoveTest()
  76. {
  77. TextDocument td = new TextDocument();
  78. td.New();
  79. Paragraph p = new Paragraph(td, "P1");
  80. Assert.IsNotNull(p.Style, "Style object must exist!");
  81. Assert.AreEqual(p.Style.GetType().Name, "ParagraphStyle", "IStyle object must be type of ParagraphStyle");
  82. Assert.IsNotNull(((ParagraphStyle)p.Style).Properties, "Properties object must exist!");
  83. //add text
  84. p.TextContent.Add(new SimpleText(p, "Hello"));
  85. IText itext = p.TextContent[0];
  86. p.TextContent.Remove(itext);
  87. //Console.Write(p.Node.Value);
  88. Assert.IsTrue(p.Node.InnerXml.IndexOf("Hello") == -1, "Must be removed!");
  89. //Add the Paragraph
  90. td.Content.Add((IContent)p);
  91. //Blank para
  92. td.Content.Add(new Paragraph(td, ParentStyles.Standard.ToString()));
  93. // new para
  94. p = new Paragraph(td, "P2");
  95. p.TextContent.Add(new SimpleText(p, "Hello i'm still here"));
  96. td.Content.Add(p);
  97. td.SaveTo("pararemoved.odt");
  98. //Console.WriteLine("Document: {0}", td.XmlDoc.OuterXml);
  99. }
  100. [Test]
  101. public void ParagraphContentTest()
  102. {
  103. TextDocument td = new TextDocument();
  104. td.New();
  105. Paragraph p = new Paragraph(td, "P1");
  106. ((ParagraphStyle)p.Style).Properties.Alignment = TextAlignments.end.ToString();
  107. //Add some content
  108. p.TextContent.Add( new SimpleText((IContent)p, "Hallo i'm simple text!"));
  109. Assert.IsTrue(p.TextContent.Count > 0, "Must be greater than zero!");
  110. FormatedText ft = new FormatedText((IContent)p, "T1", " \"And < > & i'm formated text!");
  111. ((TextStyle)ft.Style).Properties.Bold = "bold";
  112. ((TextStyle)ft.Style).Properties.Italic = "italic";
  113. ((TextStyle)ft.Style).Properties.SetUnderlineStyles(
  114. LineStyles.wave, LineWidths.bold.ToString(), "#A1B1C2");
  115. // ((TextStyle)ft.Style).Properties.Underline = LineStyles.dotted;
  116. // ((TextStyle)ft.Style).Properties.UnderlineColor = "font-color";
  117. // ((TextStyle)ft.Style).Properties.UnderlineWidth = LineWidths.auto.ToString();
  118. p.TextContent.Add(ft);
  119. Assert.IsTrue(p.TextContent.Count == 2, "Must be two!");
  120. //Add as document content
  121. td.Content.Add(p);
  122. //Console.WriteLine(td.XmlDoc.OuterXml);
  123. //Generate and save
  124. td.SaveTo("ParagraphTest.odt");
  125. }
  126. [Test]
  127. public void ParagraphTextPropertiesTest()
  128. {
  129. TextDocument td = new TextDocument();
  130. td.New();
  131. Paragraph p = new Paragraph(td, "P1");
  132. //justify
  133. ((ParagraphStyle)p.Style).Properties.Alignment = TextAlignments.justify.ToString();
  134. //Set complet paragraph to italic
  135. ((ParagraphStyle)p.Style).Textproperties.Italic = "italic";
  136. ((ParagraphStyle)p.Style).Textproperties.FontName = FontFamilies.BroadwayBT;
  137. ((ParagraphStyle)p.Style).Textproperties.FontSize = "18pt";
  138. //add simple text
  139. // use \n to insert a linebreak !!
  140. p.TextContent.Add( new SimpleText(p, @"A \nloooooooooooooooooooooooooooooooooooooooong texxxxxxxxxxxxxxxt. A reaaaaaaaaaaalllly looooooooong teeeeeeeeeexxxxxxt"));
  141. //add paragraph
  142. td.Content.Add(p);
  143. //Blank paragraph
  144. Paragraph p2 = new Paragraph(td, "P2");
  145. p2.TextContent.Add(new SimpleText(p2, ""));
  146. td.Content.Add(p2);
  147. Paragraph p3 = new Paragraph(td, "P3");
  148. p3.TextContent.Add(new SimpleText(p3, "Hello"));
  149. td.Content.Add(p3);
  150. td.SaveTo("ParagraphTextProp.odt");
  151. }
  152. [Test]
  153. public void ColorTest()
  154. {
  155. Assert.AreEqual("#0000ff", Colors.GetColor(System.Drawing.Color.Blue),
  156. "Must be equal");
  157. //Console.WriteLine("Blue : {0}", Colors.GetColor(System.Drawing.Color.Blue));
  158. }
  159. [Test]
  160. public void LetterTestLongVersion()
  161. {
  162. string[] address = new string[] {"Max Mustermann","Mustermann Str. 300","22222 Hamburg"};
  163. string[] recipient = new string[] {"Heinz Willi", "Dorfstr. 1", @"22225 Hamburg\n\n"};
  164. string betreff = @"Offer for 200 Intel Pentium 4 CPU's\n\n";
  165. string bodyheader = "Dear Mr. Willi,";
  166. string[] bodytext = new string[] {
  167. @"thank you for your request. We can offer you the 200 Intel Pentium IV 3 Ghz CPU's for a price of 79,80 € per unit.",
  168. @"This special offer < & >; is valid to 31.10.2005. If you accept, we can deliver within 24 hours.\n\n\n"
  169. };
  170. string regards = @"Best regards \nMax Mustermann";
  171. TextDocument td = new TextDocument();
  172. td.New();
  173. for(int i=0; i < address.Length; i++)
  174. {
  175. Paragraph p = new Paragraph(td, "Pa"+i.ToString());
  176. p.TextContent.Add(new SimpleText(p, address[i]));
  177. td.Content.Add(p);
  178. }
  179. td.Content.Add(new Paragraph(td, ParentStyles.Standard.ToString()));
  180. for(int i=0; i < recipient.Length; i++)
  181. {
  182. Paragraph p = new Paragraph(td, "Pr"+i.ToString());
  183. p.TextContent.Add(new SimpleText(p, recipient[i]));
  184. td.Content.Add(p);
  185. }
  186. td.Content.Add(new Paragraph(td, ParentStyles.Standard.ToString()));
  187. Paragraph pb = new Paragraph(td, "Pb");
  188. pb.TextContent.Add(new SimpleText(pb, betreff));
  189. td.Content.Add(pb);
  190. pb = new Paragraph(td, "Pan");
  191. pb.TextContent.Add(new SimpleText(pb, bodyheader));
  192. td.Content.Add(pb);
  193. for(int i=0; i < bodytext.Length; i++)
  194. {
  195. Paragraph p = new Paragraph(td, "Pr"+i.ToString());
  196. ((ParagraphStyle)p.Style).Properties.Alignment = TextAlignments.justify.ToString();
  197. p.TextContent.Add(new SimpleText(p, bodytext[i]));
  198. td.Content.Add(p);
  199. }
  200. td.Content.Add(new Paragraph(td, ParentStyles.Standard.ToString()));
  201. pb = new Paragraph(td, "PReg");
  202. pb.TextContent.Add(new SimpleText(pb, regards));
  203. td.Content.Add(pb);
  204. td.SaveTo("OfferLongVersion.odt");
  205. MetaData metaData = new MetaData();
  206. metaData.DisplyMetaData(td);
  207. }
  208. [Test]
  209. public void LetterTestShortVersion()
  210. {
  211. string[] address = new string[] {"Max Mustermann","Mustermann Str. 300","22222 Hamburg"};
  212. string[] recipient = new string[] {"Heinz Willi", "Dorfstr. 1", @"22225 Hamburg\n\n"};
  213. string betreff = @"Offer for 200 Intel Pentium 4 CPU's\n\n";
  214. string bodyheader = "Dear Mr. Willi,";
  215. string[] bodytext = new string[] {
  216. @"thank you for your request. We can offer you the 200 Intel Pentium IV 3 Ghz CPU's for a price of 79,80 € per unit.",
  217. @"This special offer is valid to 31.10.2005. If you accept, we can deliver within 24 hours.\n\n\n"
  218. };
  219. string regards = @"Best regards \nMax Mustermann";
  220. TextDocument td = new TextDocument();
  221. td.New();
  222. for(int i=0; i < address.Length; i++)
  223. td.Content.Add(new Paragraph(td, ParentStyles.Standard, address[i]));
  224. td.Content.Add(new Paragraph(td, ParentStyles.Standard.ToString()));
  225. for(int i=0; i < recipient.Length; i++)
  226. td.Content.Add(new Paragraph(td, ParentStyles.Standard, recipient[i]));
  227. td.Content.Add(new Paragraph(td, ParentStyles.Standard.ToString()));
  228. td.Content.Add(new Paragraph(td, ParentStyles.Standard, betreff));
  229. td.Content.Add(new Paragraph(td, ParentStyles.Standard, bodyheader));
  230. for(int i=0; i < bodytext.Length; i++)
  231. {
  232. Paragraph p = new Paragraph(td, "Pb"+i.ToString());
  233. ((ParagraphStyle)p.Style).Properties.Alignment = TextAlignments.justify.ToString();
  234. p.TextContent.Add(new SimpleText(p, bodytext[i]));
  235. td.Content.Add(p);
  236. }
  237. td.Content.Add(new Paragraph(td, ParentStyles.Standard.ToString()));
  238. td.Content.Add(new Paragraph(td, ParentStyles.Standard, regards));
  239. td.SaveTo("OfferShortVersion.odt");
  240. }
  241. [Test]
  242. public void AllFonts()
  243. {
  244. Type fontfamiliestype = typeof(FontFamilies);
  245. foreach(MemberInfo mi in fontfamiliestype.GetMembers())
  246. Console.WriteLine(mi.Name+"<br>");
  247. }
  248. [Test]
  249. public void TabstopTest()
  250. {
  251. //Create new document
  252. TextDocument document = new TextDocument();
  253. document.New();
  254. //Create new paragraph
  255. Paragraph par = new Paragraph(document, "P1");
  256. //Create a new TabStopStyle collection
  257. TabStopStyleCollection tsc = new TabStopStyleCollection(document);
  258. //Create TabStopStyles
  259. TabStopStyle ts = new TabStopStyle(document, 4.98);
  260. ts.LeaderStyle = TabStopLeaderStyles.Dotted;
  261. ts.LeaderText = ".";
  262. ts.Type = TabStopTypes.Center;
  263. //Add the tabstop
  264. tsc.Add(ts);
  265. //Append the TabStopStyleCollection
  266. ((ParagraphStyle)par.Style).Properties.TabStopStyleCollection = tsc;
  267. //Add some text, use @ qualifier when ever you use control chars!
  268. string mytebstoptext = @"Hello\tHello again";
  269. SimpleText stext = new SimpleText(par, mytebstoptext);
  270. //the simple text
  271. par.TextContent.Add(stext);
  272. //Add the paragraph to the content container
  273. document.Content.Add(par);
  274. //Save
  275. document.SaveTo("tabstop.odt");
  276. }
  277. [Test]
  278. public void BookmarkTest()
  279. {
  280. //Create a new TextDocument
  281. TextDocument document = new TextDocument();
  282. document.New();
  283. //Create a new Paragraph
  284. Paragraph para = new Paragraph(document, "P1");
  285. //Create simple text
  286. SimpleText stext = new SimpleText(para, "Some text here");
  287. //add the simple text
  288. para.TextContent.Add(stext);
  289. //add the paragraph
  290. document.Content.Add(para);
  291. //add a blank paragraph
  292. document.Content.Add(new Paragraph(document, ParentStyles.Standard.ToString()));
  293. //Create a new Paragraph
  294. para = new Paragraph(document, "P2");
  295. //add some simple text
  296. para.TextContent.Add(new SimpleText(para, "some simple text"));
  297. //create a new standard bookmark
  298. Bookmark bookmark = new Bookmark(para, BookmarkType.Standard, "address");
  299. //add bookmark to the paragraph
  300. para.TextContent.Add(bookmark);
  301. //add the paragraph to the document
  302. document.Content.Add(para);
  303. //create a paragraph, with a bookmark range Start -> End
  304. para = new Paragraph(document, "P3");
  305. bookmark = new Bookmark(para, BookmarkType.Start, "address2");
  306. //add bookmark to the paragraph
  307. para.TextContent.Add(bookmark);
  308. //add some simple text
  309. para.TextContent.Add(new SimpleText(para, "more text"));
  310. //create a new end bookmark
  311. bookmark = new Bookmark(para, BookmarkType.End, "address2");
  312. //add bookmark to the paragraph, so the encapsulated bookmark text is "more text"
  313. para.TextContent.Add(bookmark);
  314. //add the paragraph to the document content
  315. document.Content.Add(para);
  316. //save
  317. document.SaveTo("bookmark.odt");
  318. }
  319. [Test]
  320. public void XLinkTest()
  321. {
  322. //Create new TextDocument
  323. TextDocument document = new TextDocument();
  324. document.New();
  325. //Create a new Paragraph
  326. Paragraph para = new Paragraph(document, "P1");
  327. //Create some simple text
  328. SimpleText stext = new SimpleText(para, "Some simple text");
  329. //Create a XLink
  330. XLink xlink = new XLink(para, "http://www.sourceforge.net", "Sourceforge");
  331. //Add the textcontent
  332. para.TextContent.Add(stext);
  333. para.TextContent.Add(xlink);
  334. //Add paragraph to the document content
  335. document.Content.Add(para);
  336. //Save
  337. document.SaveTo("XLink.odt");
  338. }
  339. [Test]
  340. public void FootnoteText()
  341. {
  342. //Create new TextDocument
  343. TextDocument document = new TextDocument();
  344. document.New();
  345. //Create a new Paragph
  346. Paragraph para = new Paragraph(document, "P1");
  347. //Create some simple Text
  348. SimpleText stext = new SimpleText(para, "Some simple text. And I have a footnode");
  349. //Create a Footnote
  350. Footnote fnote = new Footnote(para, "Footer \" Text", "1", FootnoteType.footnode);
  351. //Add the text content
  352. para.TextContent.Add(stext);
  353. para.TextContent.Add(fnote);
  354. //Add the paragraph
  355. document.Content.Add(para);
  356. //Save
  357. document.SaveTo("footnote.odt");
  358. }
  359. [Test]
  360. public void FooterAndHeader()
  361. {
  362. //Create a new document
  363. TextDocument td = new TextDocument();
  364. td.New();
  365. //Create a new paragraph
  366. Paragraph p = new Paragraph(td, "P1");
  367. //Create some formated text
  368. FormatedText ftext = new FormatedText(p, "F1", "Im the Header");
  369. ((TextStyle)ftext.Style).Properties.Italic = "italic";
  370. //add the text
  371. p.TextContent.Add(ftext);
  372. //Insert paragraph as header
  373. td.InsertHeader(p);
  374. //New paragraph
  375. p = new Paragraph(td, ParentStyles.Standard,
  376. "I'm the Footer");
  377. //Insert paragraph as footer
  378. td.InsertFooter(p);
  379. //Save
  380. td.SaveTo("Header_Footer.odt");
  381. }
  382. [Test]
  383. public void NewTextAndParagraphProps()
  384. {
  385. //Create a new TextDocument
  386. TextDocument document = new TextDocument();
  387. document.New();
  388. //Create new Paragraph
  389. Paragraph paragraph = new Paragraph(document, "P1");
  390. //Create paragraph border
  391. ((ParagraphStyle)paragraph.Style).Properties.Border =
  392. Border.MiddleSolid;
  393. //Set line spacing to double
  394. ((ParagraphStyle)paragraph.Style).Properties.LineSpacing =
  395. ParagraphHelper.LineDouble;
  396. //Create some formated text
  397. FormatedText ftext = new FormatedText(paragraph, "T1", @"Outline\n");
  398. //Set text as Outline
  399. ((TextStyle)ftext.Style).Properties.Outline = "true";
  400. //Add to paragraph
  401. paragraph.TextContent.Add(ftext);
  402. //Create some formated text
  403. ftext = new FormatedText(paragraph, "T2", @"Colored\n");
  404. //Set font color
  405. ((TextStyle)ftext.Style).Properties.FontColor = Colors.GetColor(System.Drawing.Color.Cyan);
  406. //Add to paragraph
  407. paragraph.TextContent.Add(ftext);
  408. //Create some formated text
  409. ftext = new FormatedText(paragraph, "T3", @"Backcolor\n");
  410. //Set background color
  411. ((TextStyle)ftext.Style).Properties.BackgroundColor = Colors.GetColor(System.Drawing.Color.Cyan);
  412. //Add to paragraph
  413. paragraph.TextContent.Add(ftext);
  414. //Create some formated text
  415. ftext = new FormatedText(paragraph, "T4", @"Shadow\n");
  416. //Set shadow
  417. ((TextStyle)ftext.Style).Properties.Shadow = TextPropertieHelper.Shadowmidlle;
  418. //Add to paragraph
  419. paragraph.TextContent.Add(ftext);
  420. //Create some formated text
  421. ftext = new FormatedText(paragraph, "T5", @"Subscript\n");
  422. //Set subscript
  423. ((TextStyle)ftext.Style).Properties.Position = TextPropertieHelper.Subscript;
  424. //Add to paragraph
  425. paragraph.TextContent.Add(ftext);
  426. //Create some formated text
  427. ftext = new FormatedText(paragraph, "T6", @"Superscript\n");
  428. //Set superscript
  429. ((TextStyle)ftext.Style).Properties.Position = TextPropertieHelper.Superscript;
  430. //Add to paragraph
  431. paragraph.TextContent.Add(ftext);
  432. //Create some formated text
  433. ftext = new FormatedText(paragraph, "T7", @"Strice through\n");
  434. //Set superscript
  435. ((TextStyle)ftext.Style).Properties.TextLineThrough = LineStyles.solid;
  436. //Add to paragraph
  437. paragraph.TextContent.Add(ftext);
  438. //finally add paragraph to the document
  439. document.Content.Add(paragraph);
  440. //Save the document
  441. document.SaveTo("NewProperties.odt");
  442. }
  443. [Test]
  444. public void HeadingsTest()
  445. {
  446. //Create a new text document
  447. TextDocument document = new TextDocument();
  448. document.New();
  449. //Create a new Heading
  450. Header header = new Header(document, Headings.Heading, "\"I'm the\n first Headline!\"");
  451. //Add header
  452. document.Content.Add(header);
  453. document.SaveTo("Heading.odt");
  454. }
  455. [Test]
  456. public void WhiteSpaceTest()
  457. {
  458. //Create new TextDocument
  459. TextDocument document = new TextDocument();
  460. document.New();
  461. //Create a new Paragraph
  462. Paragraph para = new Paragraph(document, "P1");
  463. //Create some simple text with whitespaces
  464. SimpleText stext = new SimpleText(para, "Some simple text add 12 whitespace \"and go on.");
  465. //Add the textcontent
  466. para.TextContent.Add(stext);
  467. //Add paragraph to the document content
  468. document.Content.Add(para);
  469. //Save
  470. document.SaveTo("Whitespaces.odt");
  471. }
  472. }
  473. }
  474. /*
  475. * $Log: TestClass.cs,v $
  476. * Revision 1.2 2008/04/29 15:39:59 mt
  477. * new copyright header
  478. *
  479. * Revision 1.1 2007/02/25 09:01:28 larsbehr
  480. * initial checkin, import from Sourceforge.net to OpenOffice.org
  481. *
  482. * Revision 1.13 2005/12/18 18:29:46 larsbm
  483. * - AODC Gui redesign
  484. * - AODC HTML exporter refecatored
  485. * - Full Meta Data Support
  486. * - Increase textprocessing performance
  487. *
  488. * Revision 1.12 2005/12/12 19:39:16 larsbm
  489. * - Added Paragraph Header
  490. * - Added Table Row Header
  491. * - Fixed some bugs
  492. * - better whitespace handling
  493. * - Implmemenation of HTML Exporter
  494. *
  495. * Revision 1.11 2005/11/23 19:18:17 larsbm
  496. * - New Textproperties
  497. * - New Paragraphproperties
  498. * - New Border Helper
  499. * - Textproprtie helper
  500. *
  501. * Revision 1.10 2005/11/22 21:09:19 larsbm
  502. * - Add simple header and footer support
  503. *
  504. * Revision 1.9 2005/11/20 19:30:23 larsbm
  505. * - Added Foot- and Endnote support
  506. *
  507. * Revision 1.8 2005/11/20 17:31:20 larsbm
  508. * - added suport for XLinks, TabStopStyles
  509. * - First experimental of loading dcuments
  510. * - load and save via importer and exporter interfaces
  511. *
  512. * Revision 1.7 2005/10/23 16:47:48 larsbm
  513. * - Bugfix ListItem throws IStyleInterface not implemented exeption
  514. * - now. build the document after call saveto instead prepare the do at runtime
  515. * - add remove support for IText objects in the paragraph class
  516. *
  517. * Revision 1.6 2005/10/23 09:17:20 larsbm
  518. * - Release 1.0.3.0
  519. *
  520. * Revision 1.5 2005/10/22 15:52:10 larsbm
  521. * - Changed some styles from Enum to Class with statics
  522. * - Add full support for available OpenOffice fonts
  523. *
  524. * Revision 1.4 2005/10/09 15:52:47 larsbm
  525. * - Changed some design at the paragraph usage
  526. * - add list support
  527. *
  528. * Revision 1.3 2005/10/08 12:31:33 larsbm
  529. * - better usabilty of paragraph handling
  530. * - create paragraphs with text and blank paragraphs with one line of code
  531. *
  532. * Revision 1.2 2005/10/08 07:50:15 larsbm
  533. * - added cvs tags
  534. *
  535. */