summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-06-16 01:21:20 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-06-16 01:29:01 +0200
commit843735fca973f2a456521a6a6ac324f27af7254b (patch)
tree2e9de50041c8f49e9decf69c692c9ce5f3185642
parent4ab658b56f5c6ff0082d38d8ace1924d11e30e96 (diff)
Change-Id: Ic36463f127eb266e74e7ea4445fc1c8a3126bfe0
-rw-r--r--sw/qa/extras/rtfimport/data/textframe-table.rtf41
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx15
2 files changed, 56 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/textframe-table.rtf b/sw/qa/extras/rtfimport/data/textframe-table.rtf
new file mode 100644
index 000000000000..8e07ea34fc0c
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/textframe-table.rtf
@@ -0,0 +1,41 @@
+{\rtf1
+{\shp
+{\*\shpinst\shpleft0\shptop0\shpright3727\shpbottom2212\shpfhdr0\shpbxcolumn\shpbxignore\shpbypara\shpbyignore\shpwr3\shpwrk0\shpfblwtxt0\shpz0\shplid1026
+{\sp
+{\sn shapeType}
+{\sv 202}
+}
+{\shptxt \ltrpar \pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\aspalpha\faauto\rin0\lin0\itap0 \rtlch\fcs1 \af37\afs24\alang1081 \ltrch\fcs0
+\fs24\lang1038\langfe2052\kerning1\loch\af37\hich\af37\dbch\af31505\cgrid\langnp1038\langfenp2052
+{\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid14568770 \hich\af37\dbch\af31505\loch\f37 First para.
+\par \ltrrow}
+\trowd \irow0\irowband0\lastrow \ltrrow\ts32\trgaph108\trleft-108\trbrdrt\brdrs\brdrw10\brdrcf17 \trbrdrl\brdrs\brdrw10\brdrcf17 \trbrdrb\brdrs\brdrw10\brdrcf17 \trbrdrr\brdrs\brdrw10\brdrcf17 \trbrdrh\brdrs\brdrw10\brdrcf17 \trbrdrv
+\brdrs\brdrw10\brdrcf17 \trftsWidth1\trftsWidthB3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid14568770\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10\brdrcf17 \clbrdrl
+\brdrs\brdrw10\brdrcf17 \clbrdrb\brdrs\brdrw10\brdrcf17 \clbrdrr\brdrs\brdrw10\brdrcf17 \cltxlrtb\clftsWidth3\clwWidth1783\clshdrawnil \cellx1675\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf17 \clbrdrl\brdrs\brdrw10\brdrcf17 \clbrdrb\brdrs\brdrw10\brdrcf17
+\clbrdrr\brdrs\brdrw10\brdrcf17 \cltxlrtb\clftsWidth3\clwWidth1784\clshdrawnil \cellx3459\pard\plain \ltrpar\ql \li0\ri0\nowidctlpar\intbl\wrapdefault\aspalpha\faauto\rin0\lin0\yts32 \rtlch\fcs1 \af37\afs22\alang1081 \ltrch\fcs0
+\fs22\lang1038\langfe2052\kerning1\loch\af37\hich\af37\dbch\af31505\cgrid\langnp1038\langfenp2052
+{\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid14568770 \hich\af37\dbch\af31505\loch\f37 A\cell \hich\af37\dbch\af31505\loch\f37 B\cell }
+\pard\plain \ltrpar
+\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af37\afs24\alang1081 \ltrch\fcs0 \fs24\lang1038\langfe2052\kerning1\loch\af37\hich\af37\dbch\af31505\cgrid\langnp1038\langfenp2052
+{
+\rtlch\fcs1 \af37 \ltrch\fcs0 \insrsid14568770 \trowd \irow0\irowband0\lastrow \ltrrow\ts32\trgaph108\trleft-108\trbrdrt\brdrs\brdrw10\brdrcf17 \trbrdrl\brdrs\brdrw10\brdrcf17 \trbrdrb\brdrs\brdrw10\brdrcf17 \trbrdrr\brdrs\brdrw10\brdrcf17 \trbrdrh
+\brdrs\brdrw10\brdrcf17 \trbrdrv\brdrs\brdrw10\brdrcf17 \trftsWidth1\trftsWidthB3\trautofit1\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\tblrsid14568770\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt
+\brdrs\brdrw10\brdrcf17 \clbrdrl\brdrs\brdrw10\brdrcf17 \clbrdrb\brdrs\brdrw10\brdrcf17 \clbrdrr\brdrs\brdrw10\brdrcf17 \cltxlrtb\clftsWidth3\clwWidth1783\clshdrawnil \cellx1675\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf17 \clbrdrl\brdrs\brdrw10\brdrcf17
+\clbrdrb\brdrs\brdrw10\brdrcf17 \clbrdrr\brdrs\brdrw10\brdrcf17 \cltxlrtb\clftsWidth3\clwWidth1784\clshdrawnil \cellx3459\row }
+\pard \ltrpar\ql \li0\ri0\nowidctlpar\wrapdefault\aspalpha\faauto\rin0\lin0\itap0
+{\rtlch\fcs1 \af37 \ltrch\fcs0
+\insrsid14568770 \hich\af37\dbch\af31505\loch\f37 Last para.
+\par }
+}
+{\sp
+{\sn fFitShapeToText}
+{\sv 1}
+}
+{\sp
+{\sn posh}
+{\sv 2}
+}
+}
+}
+\par
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 8247284c3a95..19f956eadc14 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 testTextframeTable();
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},
+ {"textframe-table.rtf", &Test::testTextframeTable},
};
header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -1283,6 +1285,19 @@ void Test::testPoshPosv()
CPPUNIT_ASSERT_EQUAL(text::VertOrientation::CENTER, getProperty<sal_Int16>(xDraws->getByIndex(0), "VertOrient"));
}
+void Test::testTextframeTable()
+{
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xTextRange(xDraws->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<text::XText> xText = xTextRange->getText();
+ CPPUNIT_ASSERT_EQUAL(OUString("First para."), getParagraphOfText(1, xText)->getString());
+ uno::Reference<text::XTextTable> xTable(getParagraphOrTable(2, xText), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("A"), uno::Reference<text::XTextRange>(xTable->getCellByName("A1"), uno::UNO_QUERY)->getString());
+ CPPUNIT_ASSERT_EQUAL(OUString("B"), uno::Reference<text::XTextRange>(xTable->getCellByName("B1"), uno::UNO_QUERY)->getString());
+ CPPUNIT_ASSERT_EQUAL(OUString("Last para."), getParagraphOfText(3, xText)->getString());
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();