Blame SOURCES/0067-fdo-72697-actually-write-this-only-in-ODF-1.2-extend.patch

f0633d
From c062276a068a14df530fa21e9099a489a26b2096 Mon Sep 17 00:00:00 2001
f0633d
From: Eike Rathke <erack@redhat.com>
f0633d
Date: Fri, 13 Dec 2013 23:30:34 +0100
f0633d
Subject: [PATCH 067/109] fdo#72697 actually write this only in ODF 1.2
f0633d
 extended
f0633d
f0633d
(cherry picked from commit 49f9694e34d07468cff4a7e4de332f11be3e0dd8)
f0633d
f0633d
Conflicts:
f0633d
	xmloff/source/text/txtflde.cxx
f0633d
f0633d
Change-Id: I32097cc4b8a67615b0b6d6172cafd0edad7469b6
f0633d
(cherry picked from commit 4031765b004dded31f04c54f9a055b7a3d0053f2)
f0633d
Reviewed-on: https://gerrit.libreoffice.org/7078
f0633d
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
f0633d
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
f0633d
---
f0633d
 xmloff/source/text/txtflde.cxx | 38 +++++++++++++++++++++++++++-----------
f0633d
 1 file changed, 27 insertions(+), 11 deletions(-)
f0633d
f0633d
diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx
f0633d
index 0ad8fcb..6855a3b 100644
f0633d
--- a/xmloff/source/text/txtflde.cxx
f0633d
+++ b/xmloff/source/text/txtflde.cxx
f0633d
@@ -1752,14 +1752,17 @@ void XMLTextFieldExport::ExportFieldHelper(
f0633d
             GetExport().Characters(aBuffer.makeStringAndClear());
f0633d
         }
f0633d
 
f0633d
-        // initials
f0633d
-        OUString aInitials( GetStringProperty(sPropertyInitials, rPropSet) );
f0633d
-        if( !aInitials.isEmpty() )
f0633d
+        if (SvtSaveOptions().GetODFDefaultVersion() > SvtSaveOptions::ODFVER_012)
f0633d
         {
f0633d
-            SvXMLElementExport aCreatorElem( GetExport(), XML_NAMESPACE_TEXT,
f0633d
-                                              XML_SENDER_INITIALS, sal_True,
f0633d
-                                              sal_False );
f0633d
-            GetExport().Characters(aInitials);
f0633d
+            // initials
f0633d
+            OUString aInitials( GetStringProperty(sPropertyInitials, rPropSet) );
f0633d
+            if( !aInitials.isEmpty() )
f0633d
+            {
f0633d
+                SvXMLElementExport aCreatorElem( GetExport(), XML_NAMESPACE_TEXT,
f0633d
+                        XML_SENDER_INITIALS, sal_True,
f0633d
+                        sal_False );
f0633d
+                GetExport().Characters(aInitials);
f0633d
+            }
f0633d
         }
f0633d
 
f0633d
         com::sun::star::uno::Reference < com::sun::star::text::XText > xText;
f0633d
@@ -2226,10 +2229,23 @@ void XMLTextFieldExport::ExportElement(enum XMLTokenEnum eElementName,
f0633d
     if (eElementName != XML_TOKEN_INVALID)
f0633d
     {
f0633d
         // Element
f0633d
-        SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT,
f0633d
-                                  eElementName, bAddSpace, bAddSpace );
f0633d
-        // export content
f0633d
-        GetExport().Characters(sContent);
f0633d
+        if (eElementName == XML_SENDER_INITIALS)
f0633d
+        {
f0633d
+            if (SvtSaveOptions().GetODFDefaultVersion() > SvtSaveOptions::ODFVER_012)
f0633d
+            {
f0633d
+                SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT,
f0633d
+                        eElementName, bAddSpace, bAddSpace );
f0633d
+                // export content
f0633d
+                GetExport().Characters(sContent);
f0633d
+            }
f0633d
+        }
f0633d
+        else
f0633d
+        {
f0633d
+            SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT,
f0633d
+                                      eElementName, bAddSpace, bAddSpace );
f0633d
+            // export content
f0633d
+            GetExport().Characters(sContent);
f0633d
+        }
f0633d
     } else {
f0633d
         // always export content
f0633d
         GetExport().Characters(sContent);
f0633d
-- 
f0633d
1.8.4.2
f0633d