oox/source/vml/vmlshape.cxx              |    3 +++
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx |    5 +++--
 2 files changed, 6 insertions(+), 2 deletions(-)

New commits:
commit b92293b3943423324064a8513c2e114d18817179
Author:     Miklos Vajna <[email protected]>
AuthorDate: Mon Jan 20 21:21:17 2020 +0100
Commit:     Miklos Vajna <[email protected]>
CommitDate: Tue Jan 21 08:41:42 2020 +0100

    tdf#103983 VML import: handle <v:textbox style="mso-fit-shape-to-text:t">
    
    We used to always always set TextAutoGrowHeight to true, only do that
    when the matching VML attribute is detected, default to false.
    
    This helps the exporter, so it writes the correct markup on save of the
    bugdoc.
    
    Also adapt testGroupshapeChildRotation, which in practice tested the
    automatic height of the shape. The point of "auto" is that it changes as
    needed, hardcoding that value in a test is not a great idea. Rather test
    that the height is no longer automatic (there is no explicit markup in
    the file, and the default is false).
    
    Change-Id: Ie39408b7da53f4923a2ade503e520c704a86bcf4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87104
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 15972cd0ff08..70b673258dc6 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -792,6 +792,9 @@ Reference< XShape > SimpleShape::implConvertAndInsert( 
const Reference< XShapes
                 xShape->setSize(aSize);
             }
         }
+
+        PropertySet(xShape).setAnyProperty(PROP_TextAutoGrowHeight,
+                                           makeAny(maTypeModel.mbAutoHeight));
     }
 
     // Import Legacy Fragments (if any)
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx 
b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 956f75414488..a9edd2b66eb1 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -569,8 +569,9 @@ DECLARE_OOXMLIMPORT_TEST(testGroupshapeChildRotation, 
"groupshape-child-rotation
 
 #if HAVE_MORE_FONTS
     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(661), xShape->getSize().Height);
+    // This was true, a VML textbox without <v:textbox 
style="mso-fit-shape-to-text:t"> had
+    // auto-grow on.
+    CPPUNIT_ASSERT(!getProperty<bool>(xShape, "TextAutoGrowHeight"));
     // Paragraph Style Normal should provide the font name - which slightly 
affects the shape's height (was 686)
     uno::Reference<text::XText> xText = 
uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY_THROW)->getText();
     CPPUNIT_ASSERT_EQUAL_MESSAGE("Font", OUString("Times New Roman"), 
getProperty<OUString>(getRun(xText, 1), "CharFontName"));
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to