diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-02-07 09:08:51 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-02-07 09:20:11 +0000 |
commit | dd2837ac654cbebac44dee7558232629bff6f49a (patch) | |
tree | 7a151a220c633991f5448357edfed7a4145c175e /sw | |
parent | b5e3f8a5fa98a249ecd50021c33cf2a5c7a3b4fc (diff) |
sw RTF filter: add \leveljc1 testcase
lcov pointed out this had no coverage previously (unlike the 0 and the 2
case).
Change-Id: Iaa480015d1ddfe7c489a3cbbf079a38d20e6d45c
Reviewed-on: https://gerrit.libreoffice.org/33987
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/qa/extras/rtfexport/data/leveljc-center.rtf | 22 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport.cxx | 22 |
2 files changed, 44 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfexport/data/leveljc-center.rtf b/sw/qa/extras/rtfexport/data/leveljc-center.rtf new file mode 100644 index 000000000000..f559f068efdb --- /dev/null +++ b/sw/qa/extras/rtfexport/data/leveljc-center.rtf @@ -0,0 +1,22 @@ +{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch31506\stshfloch31506\stshfhich31506\stshfbi31507\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0 +\noqfpromote +{\*\listtable +{\list\listtemplateid139628226\listhybrid +{\listlevel\levelnfc0\levelnfcn0\leveljc1\leveljcn1\levelfollow0\levelstartat1\levelspace360\levelindent0 +{\leveltext +\leveltemplateid2049739134\'02\'00.;} +{\levelnumbers\'01;} +\rtlch\fcs1 \af0 \ltrch\fcs0 \fbias0\hres0\chhres0 \fi-360\li720\lin720 } +{\listname ;} +\listid1549801677} +} +{\*\listoverridetable +{\listoverride\listid1549801677\listoverridecount0\ls1} +} +{\listtext\pard\plain\ltrpar \s15 \rtlch\fcs1 \af31507\afs22 \ltrch\fcs0 \f31506\fs22\insrsid10952771 \hich\af31506\dbch\af31506\loch\f31506 1.\tab} +\pard\plain \ltrpar\s15\ql \fi-360\li720\ri0\sa200\sl276\slmult1 +\widctlpar\wrapdefault\aspalpha\aspnum\faauto\ls1\adjustright\rin0\lin720\itap0\pararsid10952771\contextualspace \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 +{\rtlch\fcs1 \af31507 +\ltrch\fcs0 \insrsid10952771 X +\par } +} diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 710b7853804b..cf097699d9e2 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -29,6 +29,7 @@ #include <com/sun/star/view/XViewSettingsSupplier.hpp> #include <com/sun/star/text/RubyAdjust.hpp> #include <com/sun/star/text/XTextColumns.hpp> +#include <com/sun/star/text/HoriOrientation.hpp> #include <vcl/svapp.hxx> @@ -1158,6 +1159,27 @@ DECLARE_RTFEXPORT_TEST(testTdf104085, "tdf104085.rtf") CPPUNIT_FAIL("no BulletChar property"); } +DECLARE_RTFEXPORT_TEST(testLeveljcCenter, "leveljc-center.rtf") +{ + // Tests that \leveljc1 is mapped to Adjust=Center for a numbering rule. + uno::Reference<text::XTextRange> xPara(getParagraph(1)); + uno::Reference<beans::XPropertySet> properties(xPara, uno::UNO_QUERY); + uno::Reference<container::XIndexAccess> xLevels(properties->getPropertyValue("NumberingRules"), uno::UNO_QUERY); + uno::Sequence<beans::PropertyValue> aProps; + xLevels->getByIndex(0) >>= aProps; + for (int i = 0; i < aProps.getLength(); ++i) + { + if (aProps[i].Name == "Adjust") + { + sal_Int16 nValue = 0; + CPPUNIT_ASSERT(aProps[i].Value >>= nValue); + CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, nValue); + return; + } + } + CPPUNIT_FAIL("no Adjust property"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |