summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-09-19 15:45:12 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-09-19 15:47:41 +0200
commit045227f10568d3ef64d8e1066c027fc86d576733 (patch)
tree4fa622dd27a668d4a6f5ee41c4dea82614da030c /sw
parent558476135865d9ae7b8801a82c177fd1098386ff (diff)
RTF ink testcase
Change-Id: I88ab87525945f81ad6e11756f43bc211f8d2b70a
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/rtfimport/data/ink.rtf157
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx37
2 files changed, 194 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/ink.rtf b/sw/qa/extras/rtfimport/data/ink.rtf
new file mode 100644
index 000000000000..df51b12872ac
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/ink.rtf
@@ -0,0 +1,157 @@
+{\rtf1\adeflang1025\ansi\ansicpg1252\uc1\adeff31507\deff0\stshfdbch31506\stshfloch31506\stshfhich31506\stshfbi31507\deflang1033\deflangfe1033\themelang1033\themelangfe0\themelangcs0
+\paperw12240\paperh15840\margl1440\margr1440\margt1440\margb1440\gutter0\ltrsect
+\widowctrl\ftnbj\aenddoc\trackmoves1\trackformatting1\donotembedsysfont1\relyonvml0\donotembedlingdata0\grfdocevents0\validatexml1\showplaceholdtext0\ignoremixedcontent0\saveinvalidxml0\showxmlerrors1\noxlattoyen
+\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1440\dgvorigin1440\dghshow1\dgvshow1
+\jexpand\viewkind1\viewscale120\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\snaptogridincell\allowfieldendsel\wrppunct
+\asianbrkrule\rsidroot12529134\newtblstyruls\nogrowautofit\usenormstyforlist\noindnmbrts\felnbrelev\nocxsptable\indrlsweleven\noafcnsttbl\afelev\utinl\hwelev\spltpgpar\notcvasp\notbrkcnstfrctbl\notvatxbx\krnprsnet\cachedcolbal \nouicompat \fet0
+\pard\plain \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0
+\f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid10318952
+{\shp
+{\*\shpinst\shpleft5039\shptop76\shpright7617\shpbottom3235\shpfhdr0\shpbxcolumn\shpbxignore\shpbypara\shpbyignore\shpwr3\shpwrk0\shpfblwtxt0\shpz0\shplid1027
+{\sp
+{\sn shapeType}
+{\sv 0}
+}
+{\sp
+{\sn fFlipH}
+{\sv 0}
+}
+{\sp
+{\sn fFlipV}
+{\sv 0}
+}
+{\sp
+{\sn fLockRotation}
+{\sv 1}
+}
+{\sp
+{\sn fLockAspectRatio}
+{\sv 1}
+}
+{\sp
+{\sn fLockVerticies}
+{\sv 1}
+}
+{\sp
+{\sn fLockText}
+{\sv 1}
+}
+{\sp
+{\sn geoLeft}
+{\sv 11429}
+}
+{\sp
+{\sn geoTop}
+{\sv 2674}
+}
+{\sp
+{\sn geoRight}
+{\sv 15975}
+}
+{\sp
+{\sn geoBottom}
+{\sv 8247}
+}
+{\sp
+{\sn pVerticies}
+{\sv 8;96;(13663,2734);(13652,2757);(13641,2778);(13632,2802);(13622,2829);(13614,2856);(13607,2884);(13597,2922);(13589,2960);(13581,2999);(13572,3044);(13565,3089);(13558,3135)
+;(13534,3286);(13523,3440);(13508,3592);(13495,3722);(13483,3852);(13468,3982);(13457,4080);(13449,4183);(13422,4278);(13403,4344);(13397,4390);(13396,4459);(13396,4484);(13393,4509);(13388,4534)
+;(13379,4578);(13379,4525);(13374,4513);(14782,2674);(14787,2699);(14799,2721);(14799,2749);(14799,2788);(14788,2836);(14777,2873);(14760,2929);(14734,2984);(14708,3037);(14624,3207);(14551,3366)
+;(14507,3552);(14448,3801);(14427,4052);(14413,4306);(14404,4467);(14387,4607);(14328,4756);(14314,4790);(14285,4901);(14278,4898);(14279,4884);(14279,4879);(14279,4869);(11429,5930);(11441,5919)
+;(11441,5883);(11462,5871);(11566,5809);(11664,5830);(11782,5840);(12708,5917);(13630,5991);(14557,6055);(14898,6079);(15231,6127);(15574,6131);(15618,6131);(15881,6118);(15882,6119);(15886,6122)
+;(15891,6169);(15896,6177);(16259,6808);(15718,7774);(15158,8070);(14816,8251);(14369,8275);(13992,8231);(13526,8177);(13093,8007);(12727,7712);(12458,7496);(12229,7209);(12042,6920);(11891,6687)
+;(11746,6421);(11653,6159);(11614,6049);(11569,5939);(11531,5830);(11532,5824);(11532,5817);(11533,5811)}
+}
+{\sp
+{\sn pSegmentInfo}
+{\sv 2;9;16384;8202;32768;16384;8200;32768;16384;8205;32768}
+}
+{\sp
+{\sn fShadowOK}
+{\sv 0}
+}
+{\sp
+{\sn f3DOK}
+{\sv 0}
+}
+{\sp
+{\sn fFillOK}
+{\sv 0}
+}
+{\sp
+{\sn fFilled}
+{\sv 0}
+}
+{\sp
+{\sn fHitTestFill}
+{\sv 0}
+}
+{\sp
+{\sn lineColor}
+{\sv 255}
+}
+{\sp
+{\sn lineOpacity}
+{\sv 65536}
+}
+{\sp
+{\sn lineWidth}
+{\sv 19050}
+}
+{\sp
+{\sn lineEndCapStyle}
+{\sv 0}
+}
+{\sp
+{\sn fInsetPenOK}
+{\sv 0}
+}
+{\sp
+{\sn fArrowheadsOK}
+{\sv 0}
+}
+{\sp
+{\sn fLockShapeType}
+{\sv 1}
+}
+{\sp
+{\sn dhgt}
+{\sv 251659264}
+}
+{\sp
+{\sn fLeftInsetPenOK}
+{\sv 0}
+}
+{\sp
+{\sn fTopInsetPenOK}
+{\sv 0}
+}
+{\sp
+{\sn fRightInsetPenOK}
+{\sv 0}
+}
+{\sp
+{\sn fBottomInsetPenOK}
+{\sv 0}
+}
+{\sp
+{\sn fColumnInsetPenOK}
+{\sv 0}
+}
+{\sp
+{\sn fColumnHitTestLine}
+{\sv 0}
+}
+{\sp
+{\sn fRenderInk}
+{\sv 1}
+}
+{\sp
+{\sn fLayoutInCell}
+{\sv 1}
+}
+}
+}
+}
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index ac4169305ee3..43783533c4ba 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -28,6 +28,7 @@
#include "../swmodeltestbase.hxx"
#include "bordertest.hxx"
+#include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/graphic/GraphicType.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -47,6 +48,7 @@
#include <com/sun/star/text/XTextTablesSupplier.hpp>
#include <com/sun/star/text/XTextTable.hpp>
#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
+#include <com/sun/star/text/WrapTextMode.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <rtl/ustring.hxx>
@@ -107,6 +109,7 @@ public:
void testFdo47495();
void testAllGapsWord();
void testFdo52052();
+ void testInk();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -155,6 +158,7 @@ public:
CPPUNIT_TEST(testFdo47495);
CPPUNIT_TEST(testAllGapsWord);
CPPUNIT_TEST(testFdo52052);
+ CPPUNIT_TEST(testInk);
#endif
CPPUNIT_TEST_SUITE_END();
@@ -924,6 +928,39 @@ void Test::testFdo52052()
CPPUNIT_ASSERT_EQUAL(OUString("third"), parseDump("/root/page[3]/body/txt/anchored/fly/txt/text()"));
}
+void Test::testInk()
+{
+ /*
+ * The problem was that the second segment had wrong command count and wrap type.
+ *
+ * oShape = ThisComponent.DrawPage(0)
+ * oPathPropVec = oShape.CustomShapeGeometry(1).Value
+ * oSegments = oPathPropVec(1).Value
+ * msgbox oSegments(1).Count ' was 0x2000 | 10, should be 10
+ * msgbox oShape.Surround ' was 2, should be 1
+ */
+ load("ink.rtf");
+
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+ uno::Sequence<beans::PropertyValue> aProps = getProperty< uno::Sequence<beans::PropertyValue> >(xDraws->getByIndex(0), "CustomShapeGeometry");
+ for (int i = 0; i < aProps.getLength(); ++i)
+ {
+ const beans::PropertyValue& rProp = aProps[i];
+ if (rProp.Name == "Path")
+ rProp.Value >>= aProps;
+ }
+ uno::Sequence<drawing::EnhancedCustomShapeSegment> aSegments;
+ for (int i = 0; i < aProps.getLength(); ++i)
+ {
+ const beans::PropertyValue& rProp = aProps[i];
+ if (rProp.Name == "Segments")
+ rProp.Value >>= aSegments;
+ }
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(10), aSegments[1].Count);
+ CPPUNIT_ASSERT_EQUAL(text::WrapTextMode_THROUGHT, getProperty<text::WrapTextMode>(xDraws->getByIndex(0), "Surround"));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();