summaryrefslogtreecommitdiff
path: root/sw/qa/extras/rtfimport/rtfimport.cxx
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2023-01-13 17:49:58 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2023-01-13 19:31:53 +0000
commita25eda715591cfa96136bcfd95360156516239d1 (patch)
tree57cad5de90207a655e46f96541a95272449d4126 /sw/qa/extras/rtfimport/rtfimport.cxx
parentf2918ed9add416e16396965a4b6c7a5e8865a07f (diff)
tdf#131386 writerfilter: RTF import paragraph mark formatting
One obstacle was remove in commit 02f53bd61222d7999b847a22fd24d65195f129e5 To fix it, when \par is handled, runProps() just has to be called unconditionally. Now one test fails with: rtfexport5.cxx:438:Assertion Test name: testTdf107413::Load_Verify_Reload_Verify equality assertion failed - Expected: 14578 - Actual : 14698 The spacing above the first paragraph in the table in the footer is not imported - because this is recorded in a buffer, and when replaying, getProperties() is called with Id 0, and not LN_Value_ST_StyleType_character as when it's called immediately without buffering. Change-Id: If86ed2fa88eb2ac0eafd7a8be411bbfa341619b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145490 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw/qa/extras/rtfimport/rtfimport.cxx')
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx37
1 files changed, 37 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index eb8107f2f270..eb2596e44c44 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -45,6 +45,7 @@
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/text/XTextDocument.hpp>
#include <com/sun/star/text/XTextSectionsSupplier.hpp>
+#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/beans/XPropertyState.hpp>
#include <com/sun/star/document/XDocumentInsertable.hpp>
@@ -55,6 +56,12 @@
#include <comphelper/sequenceashashmap.hxx>
#include <comphelper/configuration.hxx>
+#include <editeng/charhiddenitem.hxx>
+
+#include <ndindex.hxx>
+#include <ndtxt.hxx>
+#include <fmtautofmt.hxx>
+
class Test : public SwModelTestBase
{
public:
@@ -995,6 +1002,36 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo44984)
"TextPortionType"));
}
+CPPUNIT_TEST_FIXTURE(Test, testTdf131386)
+{
+ createSwDoc("hidden-para-separator.rtf");
+ SwDoc const* const pDoc = getSwDoc();
+ SwNodeIndex ix(pDoc->GetNodes().GetEndOfContent(), -1);
+ CPPUNIT_ASSERT(!ix.GetNode().GetTextNode()->GetAttr(RES_PARATR_LIST_AUTOFMT).GetStyleHandle());
+ --ix;
+ --ix;
+ CPPUNIT_ASSERT(ix.GetNode()
+ .GetTextNode()
+ ->GetAttr(RES_PARATR_LIST_AUTOFMT)
+ .GetStyleHandle()
+ ->Get(RES_CHRATR_HIDDEN)
+ .GetValue());
+ --ix;
+ CPPUNIT_ASSERT(ix.GetNode()
+ .GetTextNode()
+ ->GetAttr(RES_PARATR_LIST_AUTOFMT)
+ .GetStyleHandle()
+ ->Get(RES_CHRATR_HIDDEN)
+ .GetValue());
+ --ix;
+ CPPUNIT_ASSERT(ix.GetNode()
+ .GetTextNode()
+ ->GetAttr(RES_PARATR_LIST_AUTOFMT)
+ .GetStyleHandle()
+ ->Get(RES_CHRATR_HIDDEN)
+ .GetValue());
+}
+
CPPUNIT_TEST_FIXTURE(Test, testFdo82071)
{
createSwDoc("fdo82071.rtf");