[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - sw/qa writerfilter/source
Miklos Vajna
vmiklos at collabora.co.uk
Tue Apr 15 13:31:12 PDT 2014
sw/qa/extras/rtfimport/data/fdo77267.rtf | 12 ++++++++++++
sw/qa/extras/rtfimport/rtfimport.cxx | 6 ++++++
writerfilter/source/rtftok/rtfdocumentimpl.cxx | 3 +++
3 files changed, 21 insertions(+)
New commits:
commit b84fed9967cb3364c5f9eb1064ab04336cf4e822
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Apr 14 08:52:59 2014 +0200
fdo#77267 RTF import: pard should reset current paragraph style
Change-Id: I8d78ce262a4e57161325231a78e48750909b1bad
(cherry picked from commit 904630a2272ac4dd540939f8a462bff5d636f066)
Reviewed-on: https://gerrit.libreoffice.org/9055
Tested-by: Michael Stahl <mstahl at redhat.com>
Reviewed-by: Michael Stahl <mstahl at redhat.com>
diff --git a/sw/qa/extras/rtfimport/data/fdo77267.rtf b/sw/qa/extras/rtfimport/data/fdo77267.rtf
new file mode 100644
index 0000000..f9b9060
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo77267.rtf
@@ -0,0 +1,12 @@
+{\rtf1\ansi\ansicpg1250\uc1 \deff0\deflang1045\deflangfe1045
+{\stylesheet
+{
+\li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1045\langfe1045\cgrid\langnp1045\langfenp1045 \snext0 Normal;}
+{\s4\qc \li0\ri0\sl360\slmult1
+\keepn\nowidctlpar\faauto\outlinelevel3\rin0\lin0\itap0 \b\fs52\lang1045\langfe1045\cgrid\langnp1045\langfenp1045 \sbasedon0 \snext0 heading 4;}
+}
+\pard\plain \s4\qc \li0\ri0\sl360\slmult1\keepn\nowidctlpar\faauto\outlinelevel3\rin0\lin0\itap0
+\pard \qc
+l
+\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 5bcdcb4..4d61147 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1622,6 +1622,12 @@ DECLARE_RTFIMPORT_TEST(testFdo74599, "fdo74599.rtf")
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-1), getProperty<sal_Int32>(xPropertySet, "CharColor"));
}
+DECLARE_RTFIMPORT_TEST(testFdo77267, "fdo77267.rtf")
+{
+ // Paragraph was aligned to left, should be center.
+ CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, static_cast<style::ParagraphAdjust>(getProperty<sal_Int16>(getParagraph(1), "ParaAdjust")));
+}
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 4bf522f..b5a5f13 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -2522,6 +2522,9 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
m_aStates.top().aParagraphSprms.set(NS_sprm::LN_PFInTable, RTFValue::Pointer_t(new RTFValue(1)));
}
m_aStates.top().resetFrame();
+
+ // Reset currently selected paragraph style as well.
+ m_aStates.top().nCurrentStyleIndex = -1;
break;
case RTF_SECTD:
{
More information about the Libreoffice-commits
mailing list