summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-07-31 22:43:51 +0200
committerCaolán McNamara <caolanm@redhat.com>2017-08-02 10:18:21 +0200
commit44befa2b6c447fcf9f4b13dbb3c5ffd62a5bdbac (patch)
tree92b5b4bbe105bfa7c50cf134e4a070140725afe0 /sw
parent2af9630349011a192b21b65c49c91d64a5562fdf (diff)
tdf#109790 RTF import: keep remembering paragraph style between \cell and \row
This is the opposite situation as tdf#44715, where the problem was that style was not reset between in-cell paragraphs. Here we don't want to reset the paragraph style too early, so that direct (character) formatting isn't lost just because the theoretical end-of-row character would not have the same direct formatting. (cherry picked from commit aaa6a5202a447fb4e86d5f016d8e79fbc34a3ed7) Conflicts: writerfilter/source/rtftok/rtfdocumentimpl.cxx writerfilter/source/rtftok/rtfdocumentimpl.hxx Change-Id: I9bb54f37804f5889fb10504ae890362a2e42122c Reviewed-on: https://gerrit.libreoffice.org/40625 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfexport/data/tdf109790.rtf16
-rw-r--r--sw/qa/extras/rtfexport/rtfexport.cxx8
2 files changed, 24 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/tdf109790.rtf b/sw/qa/extras/rtfexport/data/tdf109790.rtf
new file mode 100644
index 000000000000..c25c11622812
--- /dev/null
+++ b/sw/qa/extras/rtfexport/data/tdf109790.rtf
@@ -0,0 +1,16 @@
+{\rtf1\adeflang1037\ansi\ansicpg1252\uc1\adeff0\deff0
+\noqfpromote
+{\stylesheet
+{\ql \li0\ri0\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \afs20\alang1037 \ltrch\fcs0
+\fs20\lang1033\langfe1033\loch\f0\hich\dbch\cgrid\langnp1033\langfenp1033 \snext0 \sqformat \spriority0 Normal;}
+{\s26\fs44 \sbasedon0 \snext26 \slink27 \sqformat Subtitle;}
+}
+\paperw12240\paperh15840
+\pard\plain Start.\par
+\trowd\cellx2310\pard\plain\s26\intbl
+{\fs20 XXXX}
+{\fs20 \cell }
+\pard
+{\row }
+\pard\plain End.\par
+}
diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx
index 85f1c83a988b..bfa59514ff59 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -1232,6 +1232,14 @@ DECLARE_RTFEXPORT_TEST(testWatermark, "watermark.rtf")
CPPUNIT_ASSERT_EQUAL((float)66, nFontSize);
}
+DECLARE_RTFEXPORT_TEST(testTdf109790, "tdf109790.rtf")
+{
+ uno::Reference<text::XTextTable> xTable(getParagraphOrTable(2), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY);
+ // Style information was reset, which caused character height to be 22.
+ CPPUNIT_ASSERT_EQUAL(10.f, getProperty<float>(getRun(getParagraphOfText(1, xCell->getText()), 1), "CharHeight"));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */