Blob Blame History Raw
From c062276a068a14df530fa21e9099a489a26b2096 Mon Sep 17 00:00:00 2001
From: Eike Rathke <erack@redhat.com>
Date: Fri, 13 Dec 2013 23:30:34 +0100
Subject: [PATCH 067/109] fdo#72697 actually write this only in ODF 1.2
 extended

(cherry picked from commit 49f9694e34d07468cff4a7e4de332f11be3e0dd8)

Conflicts:
	xmloff/source/text/txtflde.cxx

Change-Id: I32097cc4b8a67615b0b6d6172cafd0edad7469b6
(cherry picked from commit 4031765b004dded31f04c54f9a055b7a3d0053f2)
Reviewed-on: https://gerrit.libreoffice.org/7078
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
---
 xmloff/source/text/txtflde.cxx | 38 +++++++++++++++++++++++++++-----------
 1 file changed, 27 insertions(+), 11 deletions(-)

diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx
index 0ad8fcb..6855a3b 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -1752,14 +1752,17 @@ void XMLTextFieldExport::ExportFieldHelper(
             GetExport().Characters(aBuffer.makeStringAndClear());
         }
 
-        // initials
-        OUString aInitials( GetStringProperty(sPropertyInitials, rPropSet) );
-        if( !aInitials.isEmpty() )
+        if (SvtSaveOptions().GetODFDefaultVersion() > SvtSaveOptions::ODFVER_012)
         {
-            SvXMLElementExport aCreatorElem( GetExport(), XML_NAMESPACE_TEXT,
-                                              XML_SENDER_INITIALS, sal_True,
-                                              sal_False );
-            GetExport().Characters(aInitials);
+            // initials
+            OUString aInitials( GetStringProperty(sPropertyInitials, rPropSet) );
+            if( !aInitials.isEmpty() )
+            {
+                SvXMLElementExport aCreatorElem( GetExport(), XML_NAMESPACE_TEXT,
+                        XML_SENDER_INITIALS, sal_True,
+                        sal_False );
+                GetExport().Characters(aInitials);
+            }
         }
 
         com::sun::star::uno::Reference < com::sun::star::text::XText > xText;
@@ -2226,10 +2229,23 @@ void XMLTextFieldExport::ExportElement(enum XMLTokenEnum eElementName,
     if (eElementName != XML_TOKEN_INVALID)
     {
         // Element
-        SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT,
-                                  eElementName, bAddSpace, bAddSpace );
-        // export content
-        GetExport().Characters(sContent);
+        if (eElementName == XML_SENDER_INITIALS)
+        {
+            if (SvtSaveOptions().GetODFDefaultVersion() > SvtSaveOptions::ODFVER_012)
+            {
+                SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT,
+                        eElementName, bAddSpace, bAddSpace );
+                // export content
+                GetExport().Characters(sContent);
+            }
+        }
+        else
+        {
+            SvXMLElementExport aElem( GetExport(), XML_NAMESPACE_TEXT,
+                                      eElementName, bAddSpace, bAddSpace );
+            // export content
+            GetExport().Characters(sContent);
+        }
     } else {
         // always export content
         GetExport().Characters(sContent);
-- 
1.8.4.2