sw/qa/extras/odfexport/data/tdf151100.docx |binary
 sw/qa/extras/odfexport/odfexport.cxx       |   15 +++++++++++++++
 xmloff/source/draw/shapeexport.cxx         |   15 ---------------
 3 files changed, 15 insertions(+), 15 deletions(-)

New commits:
commit df61e75834048d77a3e0bbbf1e465fc822256578
Author:     Mike Kaganski <[email protected]>
AuthorDate: Wed Sep 21 11:11:47 2022 +0300
Commit:     Michael Stahl <[email protected]>
CommitDate: Tue Oct 4 20:48:16 2022 +0200

    tdf#151100: xText->getString() may be empty for content needing export
    
    The check that is removed prevents collecting the table data.
    Assume that it's the performance optimization, and that processing
    empty text objects would be fast anyway.
    
    This basically reverts commit 73fcb052edf1a21d785583bc53e8b4323b577bb1
      Author Christian Lippka <[email protected]>
      Date   Thu Nov 22 12:26:35 2001 +0000
        #90330# only export text autostyles for shapes with text
    
    and commit 7661bbbaef31adfdb298b1447301b24a70f85834
      Author Michael Stahl <[email protected]>
      Date   Fri Nov 25 22:46:34 2016 +0100
        tdf#102479 ODF export: ignore exceptions when checking shape text
    
    that becomes unnecessary after the former change is reverted.
    
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140313
    Tested-by: Mike Kaganski <[email protected]>
    Reviewed-by: Mike Kaganski <[email protected]>
    Signed-off-by: Xisco Fauli <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140352
    Tested-by: Jenkins
    (cherry picked from commit 226b1c2006e936e4b32748b810624c5d655c4a98)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140378
    Reviewed-by: Michael Stahl <[email protected]>
    (cherry picked from commit d194474aabd699806cb3631bc8641dd0548b8026)
    
    Change-Id: I709a7b4c5ac1cc0621d3a1b18f2eb74feb987efb

diff --git a/sw/qa/extras/odfexport/data/tdf151100.docx 
b/sw/qa/extras/odfexport/data/tdf151100.docx
new file mode 100644
index 000000000000..e0341bdb9c8c
Binary files /dev/null and b/sw/qa/extras/odfexport/data/tdf151100.docx differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx 
b/sw/qa/extras/odfexport/odfexport.cxx
index 0be421765b51..e686e9d46a46 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -99,6 +99,21 @@ public:
     }
 };
 
+CPPUNIT_TEST_FIXTURE(Test, tdf151100)
+{
+    // Similar to tdf135942
+
+    load(mpTestDocumentPath, "tdf151100.docx");
+    reload(mpFilter, "tdf151100.docx");
+    // All table autostyles should be collected, including nested, and must 
not crash.
+
+    CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+    xmlDocPtr pXmlDoc = parseExport("styles.xml");
+
+    assertXPath(pXmlDoc, 
"/office:document-styles/office:automatic-styles/style:style[@style:family='table']",
 1);
+}
+
 DECLARE_ODFEXPORT_TEST(testMathObjectFlatExport, "2_MathType3.docx")
 {
     uno::Reference<util::XModifiable> xModifiable(mxComponent, uno::UNO_QUERY);
diff --git a/xmloff/source/draw/shapeexport.cxx 
b/xmloff/source/draw/shapeexport.cxx
index ddd128d1d8b0..61193072f84e 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -302,22 +302,7 @@ void XMLShapeExport::collectShapeAutoStyles(const 
uno::Reference< drawing::XShap
     if( xPropSet.is() && bObjSupportsText )
     {
         uno::Reference< text::XText > xText(xShape, uno::UNO_QUERY);
-        bool bSkip = false;
         if (xText.is())
-        {
-            try
-            {
-                bSkip = xText->getString().isEmpty();
-            }
-            catch (uno::RuntimeException const&)
-            {
-                // tdf#102479: SwXTextFrame that contains only a table will
-                // throw, but the table must be iterated so that
-                // SwXMLExport::ExportTableLines() can find its auto styles
-                // so do not skip it!
-            }
-        }
-        if (!bSkip)
         {
             uno::Reference< beans::XPropertySetInfo > xPropSetInfo( 
xPropSet->getPropertySetInfo() );
 

Reply via email to