summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2014-10-10 16:21:29 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2014-10-10 17:01:56 +0200
commite34906d20c9febc420b115fa2a8b171826dea0be (patch)
treeacce1476c870326c21105d4d6345b3131e5a4464 /sw
parent2862dcf7dd8a6f9cde9df2cc2b785df65e814f0c (diff)
fdo#84679 RTF import: fix paragraph spacing handling in tables
Regression from commit 1be0a3fa9ebb22b607c54b47739d4467acfed259 (n#825305: writerfilter RTF import: override style properties like Word, 2014-06-17), we failed to do the proper deduplication in buffered content, like tables. Fix this by adapting RTFDocumentImpl::replayBuffer() to RTFDocumentImpl::checkNeedPap(), which already did the proper deduplication. To be fair, the inconsistency was there earlier since 9f5263c477b82fef5aa9c3e79fb6af92aa049e24 (fdo#44736 RTF import: ignore direct formatting which equals to style, 2012-11-25), but it caused no real harm earlier. Change-Id: I0673408088d9d83768f0780ea92ece87913d03f3
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfimport/data/fdo84679.rtf12
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx11
2 files changed, 23 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/fdo84679.rtf b/sw/qa/extras/rtfimport/data/fdo84679.rtf
new file mode 100644
index 000000000000..64611be9878f
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo84679.rtf
@@ -0,0 +1,12 @@
+{\rtf1
+{\stylesheet
+{\ql \sa160\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1
+\af31507\afs28\alang1054 \ltrch\fcs0 \fs22\lang1033\langfe2052\loch\f31506\hich\af31506\dbch\af31505\cgrid\langnp1033\langfenp2052 \snext0 \sqformat \spriority0 Normal;}
+}
+\pard\plain\par
+\trowd
+\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10\cellx3121
+\clvertalt\clbrdrt\brdrs\brdrw10 \clbrdrl\brdrs\brdrw10 \clbrdrb\brdrs\brdrw10 \clbrdrr\brdrs\brdrw10\cellx6238
+A1\cell A2\cell \row
+\pard\plain\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index a61d62f8fc71..57717b7d9d93 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1952,6 +1952,17 @@ DECLARE_RTFIMPORT_TEST(testFdo44984, "fdo44984.rtf")
CPPUNIT_ASSERT_EQUAL(OUString("TextFieldStartEnd"), getProperty<OUString>(getRun(getParagraphOfText(1, xCell->getText()), 1), "TextPortionType"));
}
+DECLARE_RTFIMPORT_TEST(testFdo84679, "fdo84679.rtf")
+{
+ // The problem was that the paragraph in A1 had some bottom margin, but it should not.
+ uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
+ uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY);
+ // This was 282.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0), getProperty<sal_Int32>(getParagraphOfText(1, xCell->getText()), "ParaBottomMargin"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */