[aodl~developer:12] Fix: margins were not set properly in TextPageLayout and TextPageHeaderFo
- From: darius.damalakas@odftoolkit.org
- To: commits@aodl.odftoolkit.org
- Subject: [aodl~developer:12] Fix: margins were not set properly in TextPageLayout and TextPageHeaderFo
- Date: Wed, 9 Jun 2010 08:35:36 +0000
Project: aodl
Repository: developer
Revision: 12
Author: darius.damalakas
Date: 2010-06-03 11:39:11 UTC
Link:
Log Message:
------------
Fix: export of the mimetype file was causing corrupted files with OOo 3.2.
Fix: margins were not set properly in TextPageLayout and
TextPageHeaderFooterBase.
Revisions:
----------
11
12
Modified Paths:
---------------
AODL/Document/Export/OpenDocument/OpenDocumentTextExporter.cs
AODL/Document/Styles/MasterStyles/TextPageHeaderFooterBase.cs
AODL/Document/Styles/MasterStyles/TextPageLayout.cs
Diffs:
------
diff -r eaf2b60c9242 -r 1552072b81df
AODL/Document/Export/OpenDocument/OpenDocumentTextExporter.cs
--- a/AODL/Document/Export/OpenDocument/OpenDocumentTextExporter.cs Thu
Oct 22 09:02:48 2009 +0300
+++ b/AODL/Document/Export/OpenDocument/OpenDocumentTextExporter.cs Thu
Jun 03 13:03:24 2010 +0200
@@ -151,7 +151,7 @@
//
this.SaveExistingGraphics(document.DocumentPictures, dir+"Pictures\\");
//
this.SaveExistingGraphics(document.DocumentThumbnails, dir+"Thumbnails\\");
//Don't know why VS couldn't read a textfile
resource without file prefix
- WriteMimetypeFile(exportDir+@"\mimetyp");
+ WriteMimetypeFile(exportDir+@"\mimetype");
//Now create the document
CreateOpenDocument(filename, exportDir);
@@ -272,11 +272,11 @@
StreamWriter sw = File.CreateText(file);
if (this._document is
AODL.Document.TextDocuments.TextDocument)
{
-
sw.WriteLine("application/vnd.oasis.opendocument.text");
+
sw.Write("application/vnd.oasis.opendocument.text");
}
else if (this._document is
AODL.Document.SpreadsheetDocuments.SpreadsheetDocument)
{
-
sw.WriteLine("application/vnd.oasis.opendocument.spreadsheet");
+
sw.Write("application/vnd.oasis.opendocument.spreadsheet");
}
sw.Close();
}
diff -r 1552072b81df -r b9c200efae05
AODL/Document/Styles/MasterStyles/TextPageHeaderFooterBase.cs
--- a/AODL/Document/Styles/MasterStyles/TextPageHeaderFooterBase.cs Thu
Jun 03 13:03:24 2010 +0200
+++ b/AODL/Document/Styles/MasterStyles/TextPageHeaderFooterBase.cs Thu
Jun 03 13:39:11 2010 +0200
@@ -128,6 +128,8 @@
XmlAttribute xmlAttr =
this._propertyNode.Attributes["min-height", "fo"];
if (xmlAttr == null)
this.CreateAttribute("min-height",
value, "fo");
+
this._propertyNode.SelectSingleNode("@fo:min-height",
+
this.TextDocument.NamespaceManager).InnerText = value;
}
}
@@ -149,6 +151,8 @@
XmlAttribute xmlAttr =
this._propertyNode.Attributes["margin-right", "fo"];
if (xmlAttr == null)
this.CreateAttribute("margin-right",
value, "fo");
+
this._propertyNode.SelectSingleNode("@fo:margin-right",
+
this.TextDocument.NamespaceManager).InnerText = value;
}
}
@@ -170,13 +174,15 @@
XmlAttribute xmlAttr =
this._propertyNode.Attributes["margin-bottom", "fo"];
if (xmlAttr == null)
this.CreateAttribute("margin-bottom",
value, "fo");
+
this._propertyNode.SelectSingleNode("@fo:margin-bottom",
+
this.TextDocument.NamespaceManager).InnerText = value;
}
}
/// <summary>
/// Gets or sets the margin top. e.g. 0.499cm
/// </summary>
- /// <value>The margin bottom.</value>
+ /// <value>The margin top.</value>
public string MarginTop
{
get
@@ -191,6 +197,8 @@
XmlAttribute xmlAttr =
this._propertyNode.Attributes["margin-top", "fo"];
if (xmlAttr == null)
this.CreateAttribute("margin-top",
value, "fo");
+
this._propertyNode.SelectSingleNode("@fo:margin-top",
+
this.TextDocument.NamespaceManager).InnerText = value;
}
}
@@ -202,7 +210,7 @@
{
get
{
- XmlAttribute xmlAttr =
this._propertyNode.Attributes["margin-top", "fo"];
+ XmlAttribute xmlAttr =
this._propertyNode.Attributes["margin-left", "fo"];
if (xmlAttr != null)
return xmlAttr.InnerText;
return null;
@@ -212,6 +220,8 @@
XmlAttribute xmlAttr =
this._propertyNode.Attributes["margin-left", "fo"];
if (xmlAttr == null)
this.CreateAttribute("margin-left",
value, "fo");
+
this._propertyNode.SelectSingleNode("@fo:margin-left",
+
this.TextDocument.NamespaceManager).InnerText = value;
}
}
diff -r 1552072b81df -r b9c200efae05
AODL/Document/Styles/MasterStyles/TextPageLayout.cs
--- a/AODL/Document/Styles/MasterStyles/TextPageLayout.cs Thu Jun 03
13:03:24 2010 +0200
+++ b/AODL/Document/Styles/MasterStyles/TextPageLayout.cs Thu Jun 03
13:39:11 2010 +0200
@@ -207,6 +207,8 @@
XmlAttribute xmlAttr =
this._propertyNode.Attributes["margin-top", "fo"];
if (xmlAttr == null)
this.CreateAttribute("margin-top",
value, "fo");
+
this._propertyNode.SelectSingleNode("@fo:margin-top",
+
this.TextDocument.NamespaceManager).InnerText = value;
}
}
@@ -228,6 +230,8 @@
XmlAttribute xmlAttr =
this._propertyNode.Attributes["margin-bottom", "fo"];
if (xmlAttr == null)
this.CreateAttribute("margin-bottom",
value, "fo");
+
this._propertyNode.SelectSingleNode("@fo:margin-bottom",
+
this.TextDocument.NamespaceManager).InnerText = value;
}
}
@@ -249,6 +253,8 @@
XmlAttribute xmlAttr =
this._propertyNode.Attributes["margin-left", "fo"];
if (xmlAttr == null)
this.CreateAttribute("margin-left",
value, "fo");
+
this._propertyNode.SelectSingleNode("@fo:margin-left",
+
this.TextDocument.NamespaceManager).InnerText = value;
}
}
@@ -270,6 +276,8 @@
XmlAttribute xmlAttr =
this._propertyNode.Attributes["margin-right", "fo"];
if (xmlAttr == null)
this.CreateAttribute("margin-right",
value, "fo");
+
this._propertyNode.SelectSingleNode("@fo:margin-right",
+
this.TextDocument.NamespaceManager).InnerText = value;
}
}
|
[aodl~developer:12] Fix: margins were not set properly in TextPageLayout and TextPageHeaderFo |
darius . damalakas | 06/09/2010 |

