PageRenderTime 42ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/AODL/Document/TextDocuments/TextDocument.cs

https://bitbucket.org/chrisc/aodl
C# | 853 lines | 443 code | 94 blank | 316 comment | 47 complexity | 050c518f2d8fc1c42ea90d143b6a38a7 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 System.Collections.Generic;
  24. using System.IO;
  25. using System.Linq;
  26. using System.Reflection;
  27. using System.Xml;
  28. using System.Xml.Linq;
  29. using AODL.Document.Content;
  30. using AODL.Document.Content.Draw;
  31. using AODL.Document.Content.EmbedObjects;
  32. using AODL.Document.Content.Fields;
  33. using AODL.Document.Content.Tables;
  34. using AODL.Document.Custom;
  35. using AODL.Document.Exceptions;
  36. using AODL.Document.Export;
  37. using AODL.Document.Forms;
  38. using AODL.Document.Forms.Controls;
  39. using AODL.Document.Import;
  40. using AODL.Document.Import.OpenDocument;
  41. using AODL.Document.Import.OpenDocument.NodeProcessors;
  42. using AODL.Document.Styles;
  43. using AODL.Document.Styles.MasterStyles;
  44. namespace AODL.Document.TextDocuments
  45. {
  46. /// <summary>
  47. /// Represent a opendocument text document.
  48. /// </summary>
  49. /// <example>
  50. /// <code>
  51. /// TextDocument td = new TextDocument();
  52. /// td.New();
  53. /// Paragraph p = new Paragraph(td, "P1");
  54. /// //add text
  55. /// p.TextContent.Add(new SimpleText(p, "Hello"));
  56. /// //Add the Paragraph
  57. /// td.Content.Add((IContent)p);
  58. /// //Blank para
  59. /// td.Content.Add(new Paragraph(td, ParentStyles.Standard.ToString()));
  60. /// // new para
  61. /// p = new Paragraph(td, "P2");
  62. /// p.TextContent.Add(new SimpleText(p, "Hello again"));
  63. /// td.Content.Add(p);
  64. /// td.Save("parablank.odt");
  65. /// </code>
  66. /// </example>
  67. public class TextDocument : IDisposable, IDocument //AODL.Document.TextDocuments.Content.IContentContainer,
  68. {
  69. private const string _mimeTyp = "application/vnd.oasis.opendocument.text";
  70. private const int _tableCount = 0;
  71. private const int _tableOfContentsCount = 0;
  72. private readonly IList<Graphic> _graphics;
  73. private readonly StyleFactory m_styleFactory;
  74. private FieldsCollection _fields;
  75. private ODFFormCollection _formCollection;
  76. private bool _isLoadedFile;
  77. private VariableDeclCollection _varDecls;
  78. private readonly CustomFileCollection _customFiles;
  79. private XDocument _xmldoc;
  80. private IImporter _importer;
  81. /// <summary>
  82. /// Create a new TextDocument object.
  83. /// </summary>
  84. public TextDocument()
  85. {
  86. _fields = new FieldsCollection();
  87. Content = new ContentCollection();
  88. Styles = new StyleCollection();
  89. m_styleFactory = new StyleFactory(this);
  90. CommonStyles = new StyleCollection();
  91. FontList = new List<string>();
  92. _graphics = new List<Graphic>();
  93. _formCollection = new ODFFormCollection();
  94. _formCollection.Clearing += FormsCollection_Clear;
  95. _formCollection.Removed += FormsCollection_Removed;
  96. VariableDeclarations = new VariableDeclCollection();
  97. _customFiles = new CustomFileCollection();
  98. _customFiles.Clearing += CustomFiles_Clearing;
  99. _customFiles.Inserting += CustomFiles_Inserting;
  100. _customFiles.Removing += CustomFiles_Removing;
  101. }
  102. /// <summary>
  103. /// Gets the tableof contents count.
  104. /// </summary>
  105. /// <value>The tableof contents count.</value>
  106. public int TableofContentsCount
  107. {
  108. get { return _tableOfContentsCount; }
  109. }
  110. /// <summary>
  111. /// Gets the tableof contents count.
  112. /// </summary>
  113. /// <value>The tableof contents count.</value>
  114. public int TableCount
  115. {
  116. get { return _tableCount; }
  117. }
  118. /// <summary>
  119. /// Gets or sets the document styes.
  120. /// </summary>
  121. /// <value>The document styes.</value>
  122. public DocumentStyles DocumentStyles { get; set; }
  123. /// <summary>
  124. /// Gets or sets the document setting.
  125. /// </summary>
  126. /// <value>The document setting.</value>
  127. public DocumentSetting DocumentSetting { get; set; }
  128. public ODFFormCollection Forms
  129. {
  130. get { return _formCollection; }
  131. set { _formCollection = value; }
  132. }
  133. /// <summary>
  134. /// Gets or sets the document manifest.
  135. /// </summary>
  136. /// <value>The document manifest.</value>
  137. public DocumentManifest DocumentManifest { get; set; }
  138. /// <summary>
  139. /// Gets the MIME typ.
  140. /// </summary>
  141. /// <value>The MIME typ.</value>
  142. public string MimeTyp
  143. {
  144. get { return _mimeTyp; }
  145. }
  146. /// <summary>
  147. /// Gets or sets the text master page collection.
  148. /// </summary>
  149. /// <value>The text master page collection.</value>
  150. public TextMasterPageCollection TextMasterPageCollection { get; set; }
  151. public FieldsCollection Fields
  152. {
  153. get { return _fields; }
  154. set
  155. {
  156. if (value != _fields)
  157. {
  158. throw new Exception("Cannot assign a new value to Fields property!");
  159. }
  160. }
  161. }
  162. public VariableDeclCollection VariableDeclarations
  163. {
  164. get { return _varDecls; }
  165. set { _varDecls = value; }
  166. }
  167. #region IDocument Members
  168. public IImporter Importer
  169. {
  170. get { return _importer; }
  171. }
  172. public StyleFactory StyleFactory
  173. {
  174. get { return m_styleFactory; }
  175. }
  176. /// <summary>
  177. /// The xmldocument the textdocument based on.
  178. /// </summary>
  179. public XDocument XmlDoc
  180. {
  181. get { return _xmldoc; }
  182. set { _xmldoc = value; }
  183. }
  184. /// <summary>
  185. /// If this file was loaded
  186. /// </summary>
  187. /// <value></value>
  188. public bool IsLoadedFile
  189. {
  190. get { return _isLoadedFile; }
  191. }
  192. /// <summary>
  193. /// Gets the graphics.
  194. /// </summary>
  195. /// <value>The graphics.</value>
  196. public IList<Graphic> Graphics
  197. {
  198. get { return _graphics; }
  199. }
  200. /// <summary>
  201. /// Gets or sets the document metadata.
  202. /// </summary>
  203. /// <value>The document metadata.</value>
  204. public DocumentMetadata DocumentMetadata { get; set; }
  205. /// <summary>
  206. /// Gets or sets the document configurations2.
  207. /// </summary>
  208. /// <value>The document configurations2.</value>
  209. public DocumentConfiguration2 DocumentConfigurations2 { get; set; }
  210. /// <summary>
  211. /// Gets or sets the document pictures.
  212. /// </summary>
  213. /// <value>The document pictures.</value>
  214. public DocumentPictureCollection DocumentPictures { get; set; }
  215. /// <summary>
  216. /// Gets or sets the document thumbnails.
  217. /// </summary>
  218. /// <value>The document thumbnails.</value>
  219. public DocumentPictureCollection DocumentThumbnails { get; set; }
  220. /// <summary>
  221. /// Gets the graphics.
  222. /// </summary>
  223. /// <value>The graphics.</value>
  224. public IList<EmbedObject> EmbedObjects { get; set; }
  225. /// <summary>
  226. /// Collection of contents used by this document.
  227. /// </summary>
  228. /// <value></value>
  229. public ContentCollection Content { get; set; }
  230. /// <summary>
  231. /// Collection of custom files to include in package
  232. /// </summary>
  233. public CustomFileCollection CustomFiles
  234. {
  235. get { return _customFiles; }
  236. }
  237. /// <summary>
  238. /// Collection of local styles used with this document.
  239. /// </summary>
  240. /// <value></value>
  241. public StyleCollection Styles { get; set; }
  242. /// <summary>
  243. /// Collection of common styles used with this document.
  244. /// </summary>
  245. /// <value></value>
  246. public StyleCollection CommonStyles { get; set; }
  247. /// <summary>
  248. /// Gets or sets the font list.
  249. /// </summary>
  250. /// <value>The font list.</value>
  251. public IList<String> FontList { get; set; }
  252. /// <summary>
  253. /// Loads the document by using the specified importer.
  254. /// </summary>
  255. /// <param name="file">The the file.</param>
  256. /// <param name="importer"></param>
  257. public void Load(string file, IImporter importer)
  258. {
  259. _importer = importer;
  260. _isLoadedFile = true;
  261. Styles = new StyleCollection();
  262. _fields = new FieldsCollection();
  263. Content = new ContentCollection();
  264. _xmldoc = XDocument.Parse(TextDocumentHelper.GetBlankDocument());
  265. if (_importer != null)
  266. {
  267. if (_importer.NeedNewOpenDocument)
  268. New();
  269. _importer.Import(this, file);
  270. if (_importer.ImportError != null)
  271. if (_importer.ImportError.Count > 0)
  272. foreach (AODLWarning ob in _importer.ImportError)
  273. {
  274. if (ob.Message != null)
  275. Console.WriteLine("Err: {0}", ob.Message);
  276. if (ob.Node != null)
  277. {
  278. using (XmlWriter writer = XmlWriter.Create(Console.Out, new XmlWriterSettings { Indent = true }))
  279. {
  280. ob.Node.WriteTo(writer);
  281. }
  282. }
  283. }
  284. }
  285. _formCollection.Clearing += FormsCollection_Clear;
  286. _formCollection.Removed += FormsCollection_Removed;
  287. }
  288. /// <summary>
  289. /// Save the document by using the passed IExporter
  290. /// with the passed file name.
  291. /// </summary>
  292. /// <param name="filename">The name of the new file.</param>
  293. /// <param name="exporter"></param>
  294. public void Save(string filename, IExporter exporter)
  295. {
  296. //Build document first
  297. foreach (string font in FontList)
  298. AddFont(font);
  299. CreateContentBody();
  300. exporter.Export(this, filename);
  301. }
  302. #endregion
  303. /// <summary>
  304. /// Create a blank new document.
  305. /// </summary>
  306. public TextDocument New()
  307. {
  308. _xmldoc = XDocument.Parse(TextDocumentHelper.GetBlankDocument());
  309. Styles = new StyleCollection();
  310. DocumentConfigurations2 = new DocumentConfiguration2();
  311. DocumentManifest = new DocumentManifest();
  312. DocumentManifest.New();
  313. DocumentMetadata = new DocumentMetadata(this);
  314. DocumentMetadata.New();
  315. DocumentPictures = new DocumentPictureCollection();
  316. DocumentSetting = new DocumentSetting();
  317. DocumentSetting.New();
  318. DocumentStyles = new DocumentStyles();
  319. DocumentStyles.New(this);
  320. ReadCommonStyles();
  321. Forms = new ODFFormCollection();
  322. _formCollection.Clearing += FormsCollection_Clear;
  323. _formCollection.Removed += FormsCollection_Removed;
  324. Fields.Clear();
  325. Content.Clear();
  326. VariableDeclarations = new VariableDeclCollection();
  327. DocumentThumbnails = new DocumentPictureCollection();
  328. MasterPageFactory.RenameMasterStyles(
  329. DocumentStyles.Styles,
  330. XmlDoc);
  331. // Read the moved and renamed styles
  332. LocalStyleProcessor lsp = new LocalStyleProcessor(this, false);
  333. lsp.ReReadKnownAutomaticStyles();
  334. new MasterPageFactory().FillFromXMLDocument(this);
  335. return this;
  336. }
  337. /// <summary>
  338. /// Reads the common styles.
  339. /// </summary>
  340. private void ReadCommonStyles()
  341. {
  342. OpenDocumentImporter odImporter = new OpenDocumentImporter(null) {Document = this};
  343. odImporter.ImportCommonStyles();
  344. LocalStyleProcessor lsp = new LocalStyleProcessor(this, true);
  345. lsp.ReadStyles();
  346. }
  347. /// <summary>
  348. /// Adds a font to the document. All fonts that you use
  349. /// within your text must be added to the document.
  350. /// The class FontFamilies represent all available fonts.
  351. /// </summary>
  352. /// <param name="fontname">The fontname take it from class FontFamilies.</param>
  353. private void AddFont(string fontname)
  354. {
  355. try
  356. {
  357. Assembly ass = Assembly.GetExecutingAssembly();
  358. Stream stream = ass.GetManifestResourceStream("AODL.Resources.OD.fonts.xml");
  359. XDocument fontdoc;
  360. using (XmlReader reader = XmlReader.Create(stream))
  361. {
  362. fontdoc = XDocument.Load(reader);
  363. }
  364. XElement exfontnode = XmlDoc.Elements(Ns.Office + "document-content")
  365. .Elements(Ns.Office + "font-face-decls")
  366. .Elements(Ns.Style + "font-face")
  367. .Where(e => string.Equals((string) e.Attribute(Ns.Style + "name"), fontname)).FirstOrDefault();
  368. if (exfontnode != null)
  369. return; //Font exist;
  370. XElement newfontnode = fontdoc.Elements(Ns.Office + "document-content")
  371. .Elements(Ns.Office + "font-face-decls")
  372. .Elements(Ns.Style + "font-face")
  373. .Where(e => string.Equals((string) e.Attribute(Ns.Style + "name"), fontname)).FirstOrDefault();
  374. if (newfontnode != null)
  375. {
  376. XElement fontsnode = XmlDoc.Element(Ns.Office + "document-content");
  377. if (fontsnode != null)
  378. {
  379. foreach (XElement xn in fontsnode.Elements())
  380. if (xn.Name == Ns.Office + "font-face-decls")
  381. {
  382. XElement node = new XElement(Ns.Style + "font-face");
  383. foreach (XAttribute xa in newfontnode.Attributes())
  384. {
  385. node.Add(new XAttribute(xa));
  386. }
  387. xn.Add(node);
  388. break;
  389. }
  390. }
  391. }
  392. }
  393. catch (Exception)
  394. {
  395. //Should never happen
  396. throw;
  397. }
  398. }
  399. /// <summary>
  400. /// Creates the content body.
  401. /// </summary>
  402. private void CreateContentBody()
  403. {
  404. XElement nodeText = XmlDoc.Elements(Ns.Office + "document-content")
  405. .Elements(Ns.Office + "body")
  406. .Elements(Ns.Office + "text").First();
  407. if (Forms.Count != 0)
  408. {
  409. XElement nodeForms = nodeText.Element(Ns.Office + "forms");
  410. if (nodeForms == null)
  411. {
  412. nodeForms = new XElement(Ns.Office + "forms");
  413. }
  414. foreach (ODFForm f in Forms)
  415. {
  416. nodeForms.Add(f.Node);
  417. }
  418. nodeText.Add(nodeForms);
  419. }
  420. if (_varDecls.Count != 0)
  421. {
  422. XElement nodeVarDecls = nodeText.Element(Ns.Text + "variable-decls");
  423. if (nodeVarDecls == null)
  424. {
  425. nodeVarDecls = new XElement(Ns.Text + "variable-decls");
  426. }
  427. foreach (VariableDecl vd in _varDecls)
  428. {
  429. nodeVarDecls.Add(new XElement(vd.Node));
  430. }
  431. nodeText.Add(nodeVarDecls);
  432. }
  433. foreach (IContent content in Content)
  434. {
  435. if (content is Table)
  436. ((Table) content).BuildNode();
  437. nodeText.Add(content.Node);
  438. }
  439. CreateLocalStyleContent();
  440. CreateCommonStyleContent();
  441. }
  442. /// <summary>
  443. /// Creates the content of the local style.
  444. /// </summary>
  445. private void CreateLocalStyleContent()
  446. {
  447. XElement nodeAutomaticStyles = XmlDoc.Elements(Ns.Office + "document-content")
  448. .Elements(Ns.Office + "automatic-styles").First();
  449. foreach (IStyle style in Styles.ToValueList())
  450. {
  451. bool exist = false;
  452. if (style.StyleName != null)
  453. {
  454. string styleName = style.StyleName;
  455. XElement node = nodeAutomaticStyles.Elements(Ns.Style + "style")
  456. .Where(e => string.Equals((string) e.Attribute(Ns.Style + "name"), styleName)).FirstOrDefault();
  457. if (node != null)
  458. exist = true;
  459. }
  460. if (!exist)
  461. nodeAutomaticStyles.Add(style.Node);
  462. }
  463. }
  464. /// <summary>
  465. /// Creates the content of the common style.
  466. /// </summary>
  467. private void CreateCommonStyleContent()
  468. {
  469. XElement nodeCommonStyles = DocumentStyles.Styles.Elements(Ns.Office + "document-styles")
  470. .Elements(Ns.Office + "styles").First();
  471. nodeCommonStyles.Value = "";
  472. foreach (IStyle style in CommonStyles.ToValueList())
  473. {
  474. nodeCommonStyles.Add(new XElement(style.Node));
  475. }
  476. //Remove styles node
  477. nodeCommonStyles =
  478. XmlDoc.Elements(Ns.Office + "document-content").Elements(Ns.Office + "styles").FirstOrDefault();
  479. if (nodeCommonStyles != null)
  480. nodeCommonStyles.Remove();
  481. }
  482. /// <summary>
  483. /// Looks for a specific control through all the forms by its ID
  484. /// </summary>
  485. /// <param name="id">Control ID</param>
  486. /// <returns>The control</returns>
  487. public ODFFormControl FindControlById(string id)
  488. {
  489. foreach (ODFForm f in Forms)
  490. {
  491. ODFFormControl fc = f.FindControlById(id, true);
  492. if (fc != null)
  493. return fc;
  494. }
  495. return null;
  496. }
  497. /// <summary>
  498. /// Looks for a specific control through all the forms by its name
  499. /// </summary>
  500. /// <param name="name">Control name</param>
  501. /// <returns>The control</returns>
  502. public ODFFormControl FindControlByName(string name)
  503. {
  504. foreach (ODFForm f in Forms)
  505. {
  506. ODFFormControl fc = f.FindControlByName(name, true);
  507. if (fc != null)
  508. return fc;
  509. }
  510. return null;
  511. }
  512. /// <summary>
  513. /// Adds new form to the forms collection
  514. /// </summary>
  515. /// <param name="name">Form name</param>
  516. /// <returns></returns>
  517. public ODFForm AddNewForm(string name)
  518. {
  519. ODFForm f = new ODFForm(this, name);
  520. Forms.Add(f);
  521. return f;
  522. }
  523. private void FormsCollection_Clear()
  524. {
  525. for (int i = 0; i < _formCollection.Count; i++)
  526. {
  527. ODFForm f = _formCollection[i];
  528. f.Controls.Clear();
  529. }
  530. }
  531. private static void FormsCollection_Removed(int index, object value)
  532. {
  533. ((ODFForm)value).Controls.Clear();
  534. }
  535. public EmbedObject GetObjectByName(string objectName)
  536. {
  537. for (int i = 0; i < EmbedObjects.Count; i++)
  538. {
  539. if (EmbedObjects[i].ObjectName == objectName)
  540. return EmbedObjects[i];
  541. }
  542. return null;
  543. }
  544. private void CustomFiles_Clearing()
  545. {
  546. XElement root = DocumentManifest.Manifest.Element(Ns.Manifest + "manifest");
  547. foreach (ICustomFile customFile in _customFiles)
  548. {
  549. IEnumerable<XElement> fileEntries =
  550. root.Elements(Ns.Manifest + "file-entry").Where(
  551. e =>
  552. ((string) e.Attribute(Ns.Manifest + "media-type")).Equals(customFile.MediaType ?? string.Empty,
  553. StringComparison.InvariantCulture) &&
  554. ((string) e.Attribute(Ns.Manifest + "full-path")).Equals(customFile.FullPath,
  555. StringComparison.InvariantCulture));
  556. foreach (XElement fileEntry in fileEntries)
  557. {
  558. fileEntry.Remove();
  559. }
  560. }
  561. }
  562. private void CustomFiles_Inserting(int index, ICustomFile value)
  563. {
  564. XElement root = DocumentManifest.Manifest.Element(Ns.Manifest + "manifest");
  565. IEnumerable<XElement> fileEntries =
  566. root.Elements(Ns.Manifest + "file-entry").Where(
  567. e =>
  568. ((string)e.Attribute(Ns.Manifest + "media-type")).Equals(value.MediaType ?? string.Empty,
  569. StringComparison.InvariantCulture) &&
  570. ((string)e.Attribute(Ns.Manifest + "full-path")).Equals(value.FullPath,
  571. StringComparison.InvariantCulture));
  572. if (fileEntries.Count() > 0)
  573. return;
  574. XElement fileEntry = new XElement(Ns.Manifest + "file-entry");
  575. fileEntry.SetAttributeValue(Ns.Manifest + "media-type", value.MediaType ?? string.Empty);
  576. fileEntry.SetAttributeValue(Ns.Manifest + "full-path", value.FullPath);
  577. root.Add(fileEntry);
  578. }
  579. private void CustomFiles_Removing(int index, ICustomFile value)
  580. {
  581. XElement root = DocumentManifest.Manifest.Element(Ns.Manifest + "manifest");
  582. IEnumerable<XElement> fileEntries =
  583. root.Elements(Ns.Manifest + "file-entry").Where(
  584. e =>
  585. ((string) e.Attribute(Ns.Manifest + "media-type")).Equals(value.MediaType ?? string.Empty,
  586. StringComparison.InvariantCulture) &&
  587. ((string) e.Attribute(Ns.Manifest + "full-path")).Equals(value.FullPath,
  588. StringComparison.InvariantCulture));
  589. foreach (XElement fileEntry in fileEntries)
  590. {
  591. fileEntry.Remove();
  592. }
  593. }
  594. #region IDisposable Member
  595. private bool _disposed;
  596. /// <summary>
  597. /// Releases unmanaged resources and performs other cleanup operations before the
  598. /// is reclaimed by garbage collection.
  599. /// </summary>
  600. public void Dispose()
  601. {
  602. Dispose(true);
  603. GC.SuppressFinalize(this);
  604. }
  605. /// <summary>
  606. /// Disposes the specified disposing.
  607. /// </summary>
  608. /// <param name="disposing">if set to <c>true</c> [disposing].</param>
  609. private void Dispose(bool disposing)
  610. {
  611. if (!_disposed)
  612. {
  613. if (disposing)
  614. {
  615. //DeleteUnpackedFiles();
  616. }
  617. }
  618. _disposed = true;
  619. }
  620. /// <summary>
  621. /// Releases unmanaged resources and performs other cleanup operations before the
  622. /// <see cref="AODL.Document.TextDocuments.TextDocument"/> is reclaimed by garbage collection.
  623. /// </summary>
  624. ~TextDocument()
  625. {
  626. Dispose();
  627. }
  628. #endregion
  629. }
  630. }
  631. /*
  632. * $Log: TextDocument.cs,v $
  633. * Revision 1.10 2008/04/29 15:39:57 mt
  634. * new copyright header
  635. *
  636. * Revision 1.9 2008/02/08 07:12:21 larsbehr
  637. * - added initial chart support
  638. * - several bug fixes
  639. *
  640. * Revision 1.8 2007/07/15 09:30:28 yegorov
  641. * Issue number:
  642. * Submitted by:
  643. * Reviewed by:
  644. *
  645. * Revision 1.5 2007/06/20 17:37:19 yegorov
  646. * Issue number:
  647. * Submitted by:
  648. * Reviewed by:
  649. *
  650. * Revision 1.2 2007/04/08 16:51:24 larsbehr
  651. * - finished master pages and styles for text documents
  652. * - several bug fixes
  653. *
  654. * Revision 1.1 2007/02/25 08:58:59 larsbehr
  655. * initial checkin, import from Sourceforge.net to OpenOffice.org
  656. *
  657. * Revision 1.7 2007/02/13 17:58:49 larsbm
  658. * - add first part of implementation of master style pages
  659. * - pdf exporter conversations for tables and images and added measurement helper
  660. *
  661. * Revision 1.6 2007/02/04 22:52:58 larsbm
  662. * - fixed bug in resize algorithm for rows and cells
  663. * - extending IDocument, overload SaveTo to accept external exporter impl.
  664. * - initial version of AODL PDF exporter add on
  665. *
  666. * Revision 1.5 2006/02/21 19:34:56 larsbm
  667. * - Fixed Bug text that contains a xml tag will be imported as UnknowText and not correct displayed if document is exported as HTML.
  668. * - Fixed Bug [ 1436080 ] Common styles
  669. *
  670. * Revision 1.4 2006/02/05 20:03:32 larsbm
  671. * - Fixed several bugs
  672. * - clean up some messy code
  673. *
  674. * Revision 1.3 2006/02/02 21:55:59 larsbm
  675. * - Added Clone object support for many AODL object types
  676. * - New Importer implementation PlainTextImporter and CsvImporter
  677. * - New tests
  678. *
  679. * Revision 1.2 2006/01/29 18:52:51 larsbm
  680. * - Added support for common styles (style templates in OpenOffice)
  681. * - Draw TextBox import and export
  682. * - DrawTextBox html export
  683. *
  684. * Revision 1.1 2006/01/29 11:28:30 larsbm
  685. * - Changes for the new version. 1.2. see next changelog for details
  686. *
  687. * Revision 1.18 2006/01/05 10:31:10 larsbm
  688. * - AODL merged cells
  689. * - AODL toc
  690. * - AODC batch mode, splash screen
  691. *
  692. * Revision 1.17 2005/12/18 18:29:46 larsbm
  693. * - AODC Gui redesign
  694. * - AODC HTML exporter refecatored
  695. * - Full Meta Data Support
  696. * - Increase textprocessing performance
  697. *
  698. * Revision 1.16 2005/12/12 19:39:17 larsbm
  699. * - Added Paragraph Header
  700. * - Added Table Row Header
  701. * - Fixed some bugs
  702. * - better whitespace handling
  703. * - Implmemenation of HTML Exporter
  704. *
  705. * Revision 1.15 2005/11/23 19:18:17 larsbm
  706. * - New Textproperties
  707. * - New Paragraphproperties
  708. * - New Border Helper
  709. * - Textproprtie helper
  710. *
  711. * Revision 1.14 2005/11/22 21:09:19 larsbm
  712. * - Add simple header and footer support
  713. *
  714. * Revision 1.13 2005/11/20 17:31:20 larsbm
  715. * - added suport for XLinks, TabStopStyles
  716. * - First experimental of loading dcuments
  717. * - load and save via importer and exporter interfaces
  718. *
  719. * Revision 1.12 2005/11/06 14:55:25 larsbm
  720. * - Interfaces for Import and Export
  721. * - First implementation of IExport OpenDocumentTextExporter
  722. *
  723. * Revision 1.11 2005/10/23 16:47:48 larsbm
  724. * - Bugfix ListItem throws IStyleInterface not implemented exeption
  725. * - now. build the document after call saveto instead prepare the do at runtime
  726. * - add remove support for IText objects in the paragraph class
  727. *
  728. * Revision 1.10 2005/10/23 09:17:20 larsbm
  729. * - Release 1.0.3.0
  730. *
  731. * Revision 1.9 2005/10/22 15:52:10 larsbm
  732. * - Changed some styles from Enum to Class with statics
  733. * - Add full support for available OpenOffice fonts
  734. *
  735. * Revision 1.8 2005/10/22 10:47:41 larsbm
  736. * - add graphic support
  737. *
  738. * Revision 1.7 2005/10/16 08:36:29 larsbm
  739. * - Fixed bug [ 1327809 ] Invalid Cast Exception while insert table with cells that contains lists
  740. * - Fixed bug [ 1327820 ] Cell styles run into loop
  741. *
  742. * Revision 1.6 2005/10/15 12:13:20 larsbm
  743. * - fixed bug in add pargraph to cell
  744. *
  745. * Revision 1.5 2005/10/15 11:40:31 larsbm
  746. * - finished first step for table support
  747. *
  748. * Revision 1.4 2005/10/09 15:52:47 larsbm
  749. * - Changed some design at the paragraph usage
  750. * - add list support
  751. *
  752. * Revision 1.3 2005/10/08 12:31:33 larsbm
  753. * - better usabilty of paragraph handling
  754. * - create paragraphs with text and blank paragraphs with one line of code
  755. *
  756. * Revision 1.2 2005/10/08 07:50:15 larsbm
  757. * - added cvs tags
  758. *
  759. */