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

Miklos Vajna vmiklos at collabora.co.uk
Fri Jan 17 08:39:27 PST 2014


 oox/source/vml/vmlshapecontext.cxx                           |    2 ++
 sw/qa/extras/ooxmlimport/data/groupshape-child-rotation.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx                     |    4 ++++
 3 files changed, 6 insertions(+)

New commits:
commit 75934fc178ed90b56d77eb1efebed5bdac8427b6
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Jan 17 17:25:08 2014 +0100

    VML import: handle shape with text inside groupshape as TextShape
    
    This matches the behavior of the WW8 import and gives us the required
    text wrapping when the shape text doesn't fit in a single line.
    
    Change-Id: I32a13516503620344d313593834be29a3dc9f726

diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx
index 9e51e2a..d8d39eb 100644
--- a/oox/source/vml/vmlshapecontext.cxx
+++ b/oox/source/vml/vmlshapecontext.cxx
@@ -459,6 +459,8 @@ ContextHandlerRef ShapeContext::onCreateContext( sal_Int32 nElement, const Attri
                 dynamic_cast<SimpleShape&>( mrShape ).setService(
                         "com.sun.star.text.TextFrame");
             }
+            else
+                dynamic_cast<SimpleShape&>(mrShape).setService("com.sun.star.drawing.TextShape");
             return new TextBoxContext( *this, mrShapeModel.createTextBox(mrShape.getTypeModel()), rAttribs,
                 mrShape.getDrawing().getFilter().getGraphicHelper());
         case VMLX_TOKEN( ClientData ):
diff --git a/sw/qa/extras/ooxmlimport/data/groupshape-child-rotation.docx b/sw/qa/extras/ooxmlimport/data/groupshape-child-rotation.docx
index 74dd72a..d401c18 100644
Binary files a/sw/qa/extras/ooxmlimport/data/groupshape-child-rotation.docx and b/sw/qa/extras/ooxmlimport/data/groupshape-child-rotation.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 2e9ff53..0f5de74 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -975,6 +975,10 @@ DECLARE_OOXMLIMPORT_TEST(testGroupshapeChildRotation, "groupshape-child-rotation
     xShape.set(xGroupShape->getByIndex(4), uno::UNO_QUERY);
     // This was 887, i.e. border distances were included in the height.
     CPPUNIT_ASSERT_EQUAL(sal_Int32(686), xShape->getSize().Height);
+
+    uno::Reference<drawing::XShapeDescriptor> xShapeDescriptor(xGroupShape->getByIndex(5), uno::UNO_QUERY);
+    // This was com.sun.star.drawing.RectangleShape, all shape text in a single line.
+    CPPUNIT_ASSERT_EQUAL(OUString("com.sun.star.drawing.TextShape"), xShapeDescriptor->getShapeType());
 }
 
 DECLARE_OOXMLIMPORT_TEST(testN793262, "n793262.docx")


More information about the Libreoffice-commits mailing list