diff --git a/sw/qa/extras/rtfimport/data/fdo49892.rtf b/sw/qa/extras/rtfimport/data/fdo49892.rtf new file mode 100644 index 000000000000..29cd4f0141d7 --- /dev/null +++ b/sw/qa/extras/rtfimport/data/fdo49892.rtf @@ -0,0 +1,238 @@ +{\rtf1\ansi\ansicpg1251\deff0\deflang1033 +{\fonttbl +{\f0\froman\fcharset204 Times New Roman;} +} +{\colortbl;\red0\green0\blue0;} +\landscape\paperw16836\paperh11904\margl360\margr360\margt360\margb360\gutter0\windowctrl\ftnbj\viewkind1\viewscale100\sectd\linex0\sbknone +{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid14249094 +{\shp +{\*\shpinst\shpleft1275\shptop-135\shpright3045\shpbottom720\shpfhdr0\shpbxcolumn\shpbxignore\shpbypara\shpbyignore\shpwr3\shpwrk0\shpfblwtxt0\shpz2\shplid1026 +{\sp{\sn wzDescription}{\sv blue}} +{\sp +{\sn shapeType} +{\sv 1} +} +{\sp +{\sn fFlipH} +{\sv 0} +} +{\sp +{\sn fFlipV} +{\sv 0} +} +{\sp +{\sn fillColor} +{\sv 12419407} +} +{\sp +{\sn lineColor} +{\sv 15921906} +} +{\sp +{\sn lineWidth} +{\sv 38100} +} +{\sp +{\sn shadowType} +{\sv 2} +} +{\sp +{\sn shadowColor} +{\sv 6307620} +} +{\sp +{\sn shadowOpacity} +{\sv 32768} +} +{\sp +{\sn shadowOffsetX} +{\sv 12700} +} +{\sp +{\sn shadowSecondOffsetX} +{\sv -12700} +} +{\sp +{\sn fShadow} +{\sv 1} +} +{\sp +{\sn dhgt} +{\sv 251658240} +} +{\sp +{\sn fLayoutInCell} +{\sv 1} +} +} +} +} +{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid12526335 +{\shp +{\*\shpinst\shpleft2475\shptop150\shpright4500\shpbottom1230\shpfhdr0\shpbxcolumn\shpbxignore\shpbypara\shpbyignore\shpwr3\shpwrk0\shpfblwtxt0\shpz1\shplid1028 +{\sp{\sn wzDescription}{\sv green}} +{\sp +{\sn shapeType} +{\sv 1} +} +{\sp +{\sn fFlipH} +{\sv 0} +} +{\sp +{\sn fFlipV} +{\sv 0} +} +{\sp +{\sn fillColor} +{\sv 5880731} +} +{\sp +{\sn lineColor} +{\sv 15921906} +} +{\sp +{\sn lineWidth} +{\sv 38100} +} +{\sp +{\sn shadowType} +{\sv 2} +} +{\sp +{\sn shadowColor} +{\sv 2646350} +} +{\sp +{\sn shadowOpacity} +{\sv 32768} +} +{\sp +{\sn shadowOffsetX} +{\sv 12700} +} +{\sp +{\sn shadowSecondOffsetX} +{\sv -12700} +} +{\sp +{\sn fShadow} +{\sv 1} +} +{\sp +{\sn dhgt} +{\sv 251657727} +} +{\sp +{\sn fLayoutInCell} +{\sv 1} +} +} +} +{\shp +{\*\shpinst\shpleft1560\shptop420\shpright3885\shpbottom1785\shpfhdr0\shpbxcolumn\shpbxignore\shpbypara\shpbyignore\shpwr3\shpwrk0\shpfblwtxt0\shpz0\shplid1027 +{\sp{\sn wzDescription}{\sv red}} +{\sp +{\sn shapeType} +{\sv 1} +} +{\sp +{\sn fFlipH} +{\sv 0} +} +{\sp +{\sn fFlipV} +{\sv 0} +} +{\sp +{\sn fillColor} +{\sv 5066944} +} +{\sp +{\sn lineColor} +{\sv 15921906} +} +{\sp +{\sn lineWidth} +{\sv 38100} +} +{\sp +{\sn shadowType} +{\sv 2} +} +{\sp +{\sn shadowColor} +{\sv 2303074} +} +{\sp +{\sn shadowOpacity} +{\sv 32768} +} +{\sp +{\sn shadowOffsetX} +{\sv 12700} +} +{\sp +{\sn shadowSecondOffsetX} +{\sv -12700} +} +{\sp +{\sn fShadow} +{\sv 1} +} +{\sp +{\sn dhgt} +{\sv 251657215} +} +{\sp +{\sn fLayoutInCell} +{\sv 1} +} +} +} +} +{\shp +{\*\shpinst\shpleft644\shptop2916\shpright5188\shpbottom3481\shpfhdr0\shpbxpage\shpbypage\shpwr3\shpwrk0\shpfblwtxt1 +{\sp{\sn wzDescription}{\sv rect}} +{\sp +{\sn txflTextFlow} +{\sv 0} +} +{\sp +{\sn shapeType} +{\sv 1} +} +{\sp +{\sn fBehindDocument} +{\sv 1} +} +{\sp +{\sn fLine} +{\sv 1} +} +{\sp +{\sn lineColor} +{\sv 0} +} +{\sp +{\sn lineWidth} +{\sv 12700} +} +{\sp +{\sn lineDashing} +{\sv 0} +} +{\sp +{\sn lineStyle} +{\sv 0} +} +{\sp +{\sn fFilled} +{\sv 0} +} +} +} +{\pard \pvpg\phpg\posx644\posy2916\absw4544\absh-284\fi0 \qc\tx360\tx720\tx1080\tx1440\tx1800\tx2160\tx2520\tx2880\tx3240\tx3600\tx3960\tx4320 +{\f0 \b0\i0\ul0\strike0\fs20 \cf1 hello} +\par } +} diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx index 753505e514c8..b185635af31b 100644 --- a/sw/qa/extras/rtfimport/rtfimport.cxx +++ b/sw/qa/extras/rtfimport/rtfimport.cxx @@ -101,6 +101,7 @@ public: void testFdo52066(); void testFdo48033(); void testFdo36089(); + void testFdo49892(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -144,6 +145,7 @@ public: CPPUNIT_TEST(testFdo52066); CPPUNIT_TEST(testFdo48033); CPPUNIT_TEST(testFdo36089); + CPPUNIT_TEST(testFdo49892); #endif CPPUNIT_TEST_SUITE_END(); @@ -862,6 +864,28 @@ void Test::testFdo36089() CPPUNIT_ASSERT_EQUAL(sal_Int16(-50), getProperty(getRun(getParagraph(1), 2), "CharEscapement")); } +void Test::testFdo49892() +{ + load("fdo49892.rtf"); + uno::Reference xDrawPageSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY); + for (int i = 0; i < xDraws->getCount(); ++i) + { + OUString aDescription = getProperty(xDraws->getByIndex(i), "Description"); + if (aDescription == "red") + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty(xDraws->getByIndex(i), "ZOrder")); + else if (aDescription == "green") + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getProperty(xDraws->getByIndex(i), "ZOrder")); + else if (aDescription == "blue") + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), getProperty(xDraws->getByIndex(i), "ZOrder")); + else if (aDescription == "rect") + { + CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty(xDraws->getByIndex(i), "HoriOrientRelation")); + CPPUNIT_ASSERT_EQUAL(text::RelOrientation::PAGE_FRAME, getProperty(xDraws->getByIndex(i), "VertOrientRelation")); + } + } +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT();