[Libreoffice-commits] core.git: oox/source

sushil_shinde sushilshinde at libreoffice.org
Tue Sep 23 17:45:20 PDT 2014


 oox/source/export/drawingml.cxx |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

New commits:
commit 0a32edcdc2bda75a7536ce7f88c91cbc56e7afb1
Author: sushil_shinde <sushilshinde at libreoffice.org>
Date:   Sun Sep 21 11:55:14 2014 +0530

    fdo#84028 : Preserved all caps property for text.
    
       1. All capital letters were exported as small letters.
       2. Problem was 'cap' property was not exported for 'rPr'
          in drawingml.
    
    Change-Id: I81bfb418f773aa88118b22550eea2b3ec2833ea9
    Reviewed-on: https://gerrit.libreoffice.org/11563
    Reviewed-by: Kohei Yoshida <libreoffice at kohei.us>
    Tested-by: Kohei Yoshida <libreoffice at kohei.us>

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 8436c9b..0ca3054 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -62,6 +62,7 @@
 #include <com/sun/star/text/XTextContent.hpp>
 #include <com/sun/star/text/XTextField.hpp>
 #include <com/sun/star/text/XTextRange.hpp>
+#include <com/sun/star/style/CaseMap.hpp>
 #include <tools/stream.hxx>
 #include <unotools/fontdefs.hxx>
 #include <vcl/cvtgrf.hxx>
@@ -1188,6 +1189,7 @@ void DrawingML::WriteRunProperties( Reference< XPropertySet > rRun, bool bIsFiel
     const char* italic = NULL;
     const char* underline = NULL;
     const char* strikeout = NULL;
+    const char* cap = NULL;
     sal_Int32 nSize = 1800;
     sal_Int32 nCharEscapement = 0;
 
@@ -1313,6 +1315,19 @@ void DrawingML::WriteRunProperties( Reference< XPropertySet > rRun, bool bIsFiel
         nSize = (nSize / 0.58);
     }
 
+    if( GETA( CharCaseMap ) )
+    {
+        switch ( *((sal_Int16*) mAny.getValue()) )
+        {
+            case CaseMap::UPPERCASE :
+                cap = "all";
+                break;
+            case CaseMap::SMALLCAPS :
+                cap = "small";
+                break;
+        }
+    }
+
     mpFS->startElementNS( XML_a, XML_rPr,
                           XML_b, bold,
                           XML_i, italic,
@@ -1321,6 +1336,7 @@ void DrawingML::WriteRunProperties( Reference< XPropertySet > rRun, bool bIsFiel
                           XML_strike, strikeout,
                           XML_u, underline,
                           XML_baseline, nCharEscapement == 0 ? NULL : IS( nCharEscapement*1000 ),
+                          XML_cap, cap,
                           FSEND );
 
     // mso doesn't like text color to be placed after typeface


More information about the Libreoffice-commits mailing list