sw/qa/extras/rtfimport/data/tdf167710.rtf         |    6 ++++++
 sw/qa/extras/rtfimport/rtfimport.cxx              |    7 +++++++
 sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx |    3 +++
 3 files changed, 16 insertions(+)

New commits:
commit 68f259e7cfade882da4dfc4f0449c6db8abed4fc
Author:     Michael Stahl <michael.st...@collabora.com>
AuthorDate: Thu Jul 31 18:18:52 2025 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu Aug 7 19:40:03 2025 +0200

    tdf#167710 writerfilter: RTF import: ignore text in  evtbl
    
    Only text in groups in  evtbl is relevant. Same goes for \stylesheet.
    
    (regression from commit 82e17dbb2a16c7653a163139f0eea51faa4d46b8)
    
    Change-Id: I70a97f7815e1f83b10be7cf12ee5abcd6b662a92
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188705
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@collabora.com>
    (cherry picked from commit b45ba94bf2d927d0306cdd0e885017735ae4b21e)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188767
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189116

diff --git a/sw/qa/extras/rtfimport/data/tdf167710.rtf 
b/sw/qa/extras/rtfimport/data/tdf167710.rtf
new file mode 100644
index 000000000000..02842a50fe37
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/tdf167710.rtf
@@ -0,0 +1,6 @@
+{ tf1
+{\* evtbl Unknown;}
+\sectd
+\pard\plain
+\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx 
b/sw/qa/extras/rtfimport/rtfimport.cxx
index 1e4da747f081..38155e09e44e 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -499,6 +499,13 @@ CPPUNIT_TEST_FIXTURE(Test, testInk)
                          getProperty<text::WrapTextMode>(getShape(1), 
u"Surround"_ustr));
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testTdf167710)
+{
+    createSwDoc("tdf167710.rtf");
+    // problem was that text was erroneously imported
+    CPPUNIT_ASSERT(getParagraph(1)->getString().isEmpty());
+}
+
 CPPUNIT_TEST_FIXTURE(Test, testFdo79319)
 {
     createSwDoc("fdo79319.rtf");
diff --git a/sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx 
b/sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx
index 820535395ff3..f4eb331ddb13 100644
--- a/sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx
+++ b/sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx
@@ -1535,6 +1535,9 @@ void RTFDocumentImpl::text(OUString& rString)
     switch (m_aStates.top().getDestination())
     {
         // Note: in stylesheet and revtbl groups are mandatory
+        case Destination::STYLESHEET:
+        case Destination::REVISIONTABLE:
+            break; // no text allowed here - ignore it
         case Destination::STYLEENTRY:
         case Destination::LISTNAME:
         case Destination::REVISIONENTRY:

Reply via email to