[Libreoffice-commits] core.git: include/xmloff xmloff/source

Samuel Mehrbrodt Samuel.Mehrbrodt at cib.de
Tue Mar 20 06:42:36 UTC 2018


 include/xmloff/xmltoken.hxx        |    7 +++++++
 xmloff/source/core/xmltoken.cxx    |    7 +++++++
 xmloff/source/draw/shapeexport.cxx |   20 ++++++++++----------
 xmloff/source/token/tokens.txt     |    7 +++++++
 4 files changed, 31 insertions(+), 10 deletions(-)

New commits:
commit ecb20d71ff6bd6e6230c06a2c50ee71d35c88949
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Date:   Mon Mar 19 11:33:53 2018 +0100

    Signatureline ODF export: Use tokens instead of plain strings
    
    Change-Id: I80eca35b03be2a7f288705295a355f08fbc757be
    Reviewed-on: https://gerrit.libreoffice.org/51542
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index ddd50ab9e6a0..bb76cbf48678 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -368,6 +368,7 @@ namespace xmloff { namespace token {
         XML_CALCULATION_SETTINGS,
         XML_CALENDAR,
         XML_CAPITALIZE_ENTRIES,
+        XML_CAN_ADD_COMMENT,
         XML_CAPTION,
         XML_CAPTION_POINT_X,
         XML_CAPTION_POINT_Y,
@@ -1942,8 +1943,14 @@ namespace xmloff { namespace token {
         XML_DOT_DASH,
         XML_DOT_DOT_DASH,
         XML_LONG_DASH,
+        XML_SHOW_SIGN_DATE,
+        XML_SIGNATURELINE,
+        XML_SIGNING_INSTRUCTIONS,
         XML_SINGLE,
         XML_SMALL_WAVE,
+        XML_SUGGESTED_SIGNER_EMAIL,
+        XML_SUGGESTED_SIGNER_NAME,
+        XML_SUGGESTED_SIGNER_TITLE,
         XML_WAVE,
         XML_UNFORMATTED_TEXT,
         XML_UNION,
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 4893fade61ab..1475d4f99b19 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -368,6 +368,7 @@ namespace xmloff { namespace token {
         TOKEN( "calculation-settings",            XML_CALCULATION_SETTINGS ),
         TOKEN( "calendar",                        XML_CALENDAR ),
         TOKEN( "capitalize-entries",              XML_CAPITALIZE_ENTRIES ),
+        TOKEN( "can-add-comment",                 XML_CAN_ADD_COMMENT ),
         TOKEN( "caption",                         XML_CAPTION ),
         TOKEN( "caption-point-x",                 XML_CAPTION_POINT_X ),
         TOKEN( "caption-point-y",                 XML_CAPTION_POINT_Y ),
@@ -1943,8 +1944,14 @@ namespace xmloff { namespace token {
         TOKEN( "dot-dash",                        XML_DOT_DASH ),
         TOKEN( "dot-dot-dash",                    XML_DOT_DOT_DASH ),
         TOKEN( "long-dash",                       XML_LONG_DASH ),
+        TOKEN( "show-sign-date",                  XML_SHOW_SIGN_DATE ),
+        TOKEN( "signatureline",                   XML_SIGNATURELINE ),
+        TOKEN( "signing-instructions",            XML_SIGNING_INSTRUCTIONS ),
         TOKEN( "single",                          XML_SINGLE ),
         TOKEN( "small-wave",                      XML_SMALL_WAVE ),
+        TOKEN( "suggested-signer-email",          XML_SUGGESTED_SIGNER_EMAIL ),
+        TOKEN( "suggested-signer-name",           XML_SUGGESTED_SIGNER_NAME ),
+        TOKEN( "suggested-signer-title",          XML_SUGGESTED_SIGNER_TITLE ),
         TOKEN( "wave",                            XML_WAVE ),
         TOKEN( "unformatted-text",                XML_UNFORMATTED_TEXT ),
         TOKEN( "union",                           XML_UNION ),
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index 3a685ac3697a..a670d6dad8ec 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -1269,39 +1269,39 @@ void XMLShapeExport::ImpExportSignatureLine(const uno::Reference<drawing::XShape
 
     OUString aSignatureLineId;
     xPropSet->getPropertyValue("SignatureLineId") >>= aSignatureLineId;
-    mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, "id", aSignatureLineId);
+    mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, XML_ID, aSignatureLineId);
 
     OUString aSuggestedSignerName;
     xPropSet->getPropertyValue("SignatureLineSuggestedSignerName") >>= aSuggestedSignerName;
     if (!aSuggestedSignerName.isEmpty())
-        mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, "suggested-signer-name", aSuggestedSignerName);
+        mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, XML_SUGGESTED_SIGNER_NAME, aSuggestedSignerName);
 
     OUString aSuggestedSignerTitle;
     xPropSet->getPropertyValue("SignatureLineSuggestedSignerTitle") >>= aSuggestedSignerTitle;
     if (!aSuggestedSignerTitle.isEmpty())
-        mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, "suggested-signer-title", aSuggestedSignerTitle);
+        mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, XML_SUGGESTED_SIGNER_TITLE, aSuggestedSignerTitle);
 
     OUString aSuggestedSignerEmail;
     xPropSet->getPropertyValue("SignatureLineSuggestedSignerEmail") >>= aSuggestedSignerEmail;
     if (!aSuggestedSignerEmail.isEmpty())
-        mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, "suggested-signer-email", aSuggestedSignerEmail);
+        mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, XML_SUGGESTED_SIGNER_EMAIL, aSuggestedSignerEmail);
 
     OUString aSigningInstructions;
     xPropSet->getPropertyValue("SignatureLineSigningInstructions") >>= aSigningInstructions;
     if (!aSigningInstructions.isEmpty())
-        mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, "signing-instructions", aSigningInstructions);
+        mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, XML_SIGNING_INSTRUCTIONS, aSigningInstructions);
 
     bool bShowSignDate = false;
     xPropSet->getPropertyValue("SignatureLineShowSignDate") >>= bShowSignDate;
-    mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, "show-sign-date",
-                          bShowSignDate ? OUString("true") : OUString("false"));
+    mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, XML_SHOW_SIGN_DATE,
+                          bShowSignDate ? XML_TRUE : XML_FALSE);
 
     bool bCanAddComment = false;
     xPropSet->getPropertyValue("SignatureLineCanAddComment") >>= bCanAddComment;
-    mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, "can-add-comment",
-                          bCanAddComment ? OUString("true") : OUString("false"));
+    mrExport.AddAttribute(XML_NAMESPACE_LO_EXT, XML_CAN_ADD_COMMENT,
+                          bCanAddComment ? XML_TRUE : XML_FALSE);
 
-    SvXMLElementExport aSignatureLineElement(mrExport, XML_NAMESPACE_LO_EXT, "signatureline", true,
+    SvXMLElementExport aSignatureLineElement(mrExport, XML_NAMESPACE_LO_EXT, XML_SIGNATURELINE, true,
                                              true);
 }
 
diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt
index d977e96c4016..6c68ea0c339b 100644
--- a/xmloff/source/token/tokens.txt
+++ b/xmloff/source/token/tokens.txt
@@ -291,6 +291,7 @@ c
 calculation-settings
 calendar
 capitalize-entries
+can-add-comment
 caption
 caption-point-x
 caption-point-y
@@ -1861,8 +1862,14 @@ type
 dot-dash
 dot-dot-dash
 long-dash
+show-sign-date
+signatureline
+signing-instructions
 single
 small-wave
+suggested-signer-email
+suggested-signer-name
+suggested-signer-title
 wave
 unformatted-text
 union


More information about the Libreoffice-commits mailing list