summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-06-13 23:49:59 +0200
committerMichael Stahl <mstahl@redhat.com>2014-06-17 18:44:31 +0200
commit051e6fefda2411d93cb4bbe4cb3bbbd60861d8fc (patch)
tree77d12f2bf458bcfb87c963ced600a132a85f7371 /sw
parentc8921d9ef99b46761a630711ab17b3022d018db5 (diff)
fdo#70578: writerfilter RTF import: by default style is para style 0
quoth the spec: "For <style>, both <styledef> and <stylename> are optional; the default is paragraph style 0." Of course in order to do that we need to add support for at least recognizing the \dsN and \tsN keywords to override the default, so that table styles don't become paragraph styles. Change-Id: Ic100768581f9e8c327063ff776fbd61ac4242483 (cherry picked from commit 6c0e1270889deb513f961f864dfc1c02ee8705f4)
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfimport/data/fdo70578.rtf11
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx11
2 files changed, 22 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/fdo70578.rtf b/sw/qa/extras/rtfimport/data/fdo70578.rtf
new file mode 100644
index 000000000000..b2a4ea826a7d
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo70578.rtf
@@ -0,0 +1,11 @@
+{\rtf1\ansi
+{\fonttbl
+{\f30\fswiss\fcharset0\fprq2{\*\panose 020b0706040902060204}Haettenschweiler;}
+}
+{\stylesheet
+{\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 Normal;}
+{\s16\qc \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
+\f30\fs44\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext16 Subtitle;}
+}
+\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 8c8f0381a3ef..2e4c9335e8f9 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -1138,6 +1138,17 @@ DECLARE_RTFIMPORT_TEST(testFdo62044, "fdo62044.rtf")
CPPUNIT_ASSERT_EQUAL(10.f, getProperty<float>(xPropertySet, "CharHeight")); // Was 18, i.e. reset back to original value.
}
+DECLARE_RTFIMPORT_TEST(testFdo70578, "fdo70578.rtf")
+{
+ // Style without explicit \s0 was not imported as the default style
+ uno::Reference<beans::XPropertySet> xPropertySet(
+ getStyles("ParagraphStyles")->getByName("Subtitle"), uno::UNO_QUERY);
+ uno::Reference<style::XStyle> xStyle(xPropertySet, uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("Standard"), xStyle->getParentStyle());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPropertySet, "ParaTopMargin"));
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPropertySet, "ParaBottomMargin"));
+}
+
DECLARE_RTFIMPORT_TEST(testPoshPosv, "posh-posv.rtf")
{
CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, getProperty<sal_Int16>(getShape(1), "HoriOrient"));