summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-06-18 16:22:32 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-06-18 17:13:39 +0200
commit2af60e2eff4e952fff8cac0228b89f16ce3a436e (patch)
tree767f42bb9675e671a9f7cc149d0e6b3bb32b7dbe /sw
parentf8d1dcc621b04fd17577905e9b1bdf71f33c7b57 (diff)
bnc#825305 RTF import of fFilled shape property
Change-Id: Iaa2ff9d5d1a28aec046f885acecbd1a44c734ec0
Diffstat (limited to 'sw')
-rwxr-xr-xsw/qa/extras/rtfimport/data/n825305.rtf76
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx14
2 files changed, 90 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/n825305.rtf b/sw/qa/extras/rtfimport/data/n825305.rtf
new file mode 100755
index 000000000000..72a6b52a4016
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/n825305.rtf
@@ -0,0 +1,76 @@
+{\rtf
+\viewkind1\margl360\margr360
+\margt360\margb360\paperw12240\paperh15840\pard
+{\shp
+{\*\shpinst\shpleft555\shpright1185\shptop5715\shpbottom5970\shpbxpage
+\shpbypage\shpwr3\shpz1
+{\sp
+{\sn shapeType}
+{\sv 1}
+}
+{\sp
+{\sn fLine}
+{\sv 1}
+}
+{\sp
+
+{\sn lineWidth}
+{\sv 0}
+}
+{\sp
+{\sn lineColor}
+{\sv 10485760}
+}
+{\sp
+{\sn lineDashing
+}
+{\sv 0}
+}
+{\sp
+{\sn fFilled}
+{\sv 1}
+}
+{\sp
+{\sn fillColor}
+{\sv 10485760}
+}
+}
+}
+{\shp
+{\*\shpinst\shpleft780\shpright1425\shptop5790\shpbottom6030\shpbxpage
+\shpbypage\shpwr3\shpz2
+{\sp
+{\sn shapeType}
+{\sv 202}
+}
+{\sp
+{\sn dxTextLeft}
+{\sv
+0}
+}
+{\sp
+{\sn dxTextRight}
+{\sv 0}
+}
+{\sp
+{\sn dyTextTop}
+{\sv 0}
+}
+{\sp
+{\sn
+dyTextBottom}
+{\sv 0}
+}
+{\sp
+{\sn fLine}
+{\sv 0}
+}
+{\shptxt\plain\pard\f29\fs20 Ln #
+\par}
+{\sp
+{\sn fFilled}
+{\sv 0}
+}
+}
+}
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 165a4f92dd07..23fdf54c9099 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -142,6 +142,7 @@ public:
void testPageBackground();
void testFdo62044();
void testPoshPosv();
+ void testN825305();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -271,6 +272,7 @@ void Test::run()
{"page-background.rtf", &Test::testPageBackground},
{"fdo62044.rtf", &Test::testFdo62044},
{"posh-posv.rtf", &Test::testPoshPosv},
+ {"n825305.rtf", &Test::testN825305},
};
header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -1284,6 +1286,18 @@ void Test::testPoshPosv()
CPPUNIT_ASSERT_EQUAL(true, getProperty<bool>(xDraws->getByIndex(0), "FrameIsAutomaticHeight"));
}
+void Test::testN825305()
+{
+ // The problem was that the textbox wasn't transparent, due to unimplemented fFilled == 0.
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertyState> xPropertyState(xDraws->getByIndex(1), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(100), getProperty<sal_Int32>(xDraws->getByIndex(1), "BackColorTransparency"));
+ beans::PropertyState ePropertyState = xPropertyState->getPropertyState("BackColorTransparency");
+ // Was beans::PropertyState_DEFAULT_VALUE.
+ CPPUNIT_ASSERT_EQUAL(beans::PropertyState_DIRECT_VALUE, ePropertyState);
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();