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

Rohit Deshmukh rohit.deshmukh at synerzip.com
Wed Apr 23 00:51:05 PDT 2014


 oox/source/drawingml/shapegroupcontext.cxx              |    5 ++++-
 oox/source/drawingml/textcharacterpropertiescontext.cxx |    3 +++
 sw/qa/extras/ooxmlexport/data/fdo77117.docx             |binary
 sw/qa/extras/ooxmlexport/ooxmlexport.cxx                |    7 +++++++
 4 files changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 3d1046cfcd9594c2cd88b704f0425789d4a6da48
Author: Rohit Deshmukh <rohit.deshmukh at synerzip.com>
Date:   Fri Apr 18 11:42:40 2014 +0530

    Fix of run properties of text box in nested group shape
    
    	- Textbox run character properties are change after roundtrip
    	- Italic case was not handled in textcharacter properties
    
    Reviewed on:
    	https://gerrit.libreoffice.org/9096
    
    Change-Id: Ia38fcadce489ef0bfffb9bda402d13058cf6129a

diff --git a/oox/source/drawingml/shapegroupcontext.cxx b/oox/source/drawingml/shapegroupcontext.cxx
index d795c39..f4e0454 100644
--- a/oox/source/drawingml/shapegroupcontext.cxx
+++ b/oox/source/drawingml/shapegroupcontext.cxx
@@ -93,7 +93,10 @@ ContextHandlerRef ShapeGroupContext::onCreateContext( sal_Int32 aElementToken, c
         return new ShapeGroupContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.GroupShape" ) ) );
     case XML_sp:            // shape
     case XML_wsp:
-        return new ShapeContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.CustomShape" ) ) );
+        // Don't set default character height for WPS shapes, Writer has its
+        // own way to set the default, and if we don't set it here, editing
+        // properly inherits it.
+        return new ShapeContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.CustomShape", getBaseToken(aElementToken) == XML_sp ) ) );
     case XML_pic:           // CT_Picture
         return new GraphicShapeContext( *this, mpGroupShapePtr, ShapePtr( new Shape( "com.sun.star.drawing.GraphicObjectShape" ) ) );
     case XML_graphicFrame:  // CT_GraphicalObjectFrame
diff --git a/oox/source/drawingml/textcharacterpropertiescontext.cxx b/oox/source/drawingml/textcharacterpropertiescontext.cxx
index 7bedd8e..600f472 100644
--- a/oox/source/drawingml/textcharacterpropertiescontext.cxx
+++ b/oox/source/drawingml/textcharacterpropertiescontext.cxx
@@ -165,6 +165,9 @@ ContextHandlerRef TextCharacterPropertiesContext::onCreateContext( sal_Int32 aEl
         case OOX_TOKEN( doc, b ):
             mrTextCharacterProperties.moBold = rAttribs.getBool(OOX_TOKEN( doc, val ), true);
             break;
+        case OOX_TOKEN( doc, i ):
+            mrTextCharacterProperties.moItalic = rAttribs.getBool(OOX_TOKEN( doc, val ), true);
+            break;
         case OOX_TOKEN( doc, bCs ):
             break;
         case OOX_TOKEN( doc, color ):
diff --git a/sw/qa/extras/ooxmlexport/data/fdo77117.docx b/sw/qa/extras/ooxmlexport/data/fdo77117.docx
new file mode 100644
index 0000000..f2a1d44
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo77117.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 00122ea..ebc6500 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3174,6 +3174,13 @@ DECLARE_OOXMLEXPORT_TEST(testContentTypeTIF, "fdo77476.docx")
     assertXPath(pXmlDoc, "/ContentType:Types/ContentType:Override[@ContentType='image/tif']", "PartName", "/word/media/image1.tif");
 }
 
+DECLARE_OOXMLEXPORT_TEST(testFDO77117, "fdo77117.docx")
+{
+    uno::Reference<drawing::XShapes> xGroup(getShape(1), uno::UNO_QUERY);
+    uno::Reference<text::XTextRange> xShape(xGroup->getByIndex(0), uno::UNO_QUERY);
+    // This checks textbox textrun size of font which is in group shape.
+    CPPUNIT_ASSERT_EQUAL(11.f, getProperty<float>(xShape, "CharHeight"));
+}
 #endif
 
 CPPUNIT_PLUGIN_IMPLEMENT();


More information about the Libreoffice-commits mailing list