summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-05-11 18:03:57 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-05-11 18:10:16 +0200
commitb4a74af711b9645533f1c98476667fcec9d84bdc (patch)
tree786e1c7ecf7af2e53db463fb1d65fa0a8957236b
parent3c60431fff066cb65ac3a89ece8c455d8b013564 (diff)
Change-Id: Ibdb06d50ca79b2882ad7bd984e30beb09e7c7b95
-rw-r--r--sw/qa/extras/rtfimport/data/fdo42109.rtf29
-rw-r--r--sw/qa/extras/rtfimport/rtfimport.cxx12
2 files changed, 41 insertions, 0 deletions
diff --git a/sw/qa/extras/rtfimport/data/fdo42109.rtf b/sw/qa/extras/rtfimport/data/fdo42109.rtf
new file mode 100644
index 000000000000..fae63ac1933f
--- /dev/null
+++ b/sw/qa/extras/rtfimport/data/fdo42109.rtf
@@ -0,0 +1,29 @@
+{\rtf1
+\ltrrow\trowd \irow0\irowband0\lastrow \ltrrow\ts15\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\tblrsid15622382\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10\brdrcf17
+\clbrdrl\brdrs\brdrw10\brdrcf17 \clbrdrb\brdrs\brdrw10\brdrcf17 \clbrdrr\brdrs\brdrw10\brdrcf17 \cltxlrtb\clftsWidth3\clwWidth4811\clshdrawnil \cellx4703\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf17 \clbrdrl\brdrs\brdrw10\brdrcf17 \clbrdrb
+\brdrs\brdrw10\brdrcf17 \clbrdrr\brdrs\brdrw10\brdrcf17 \cltxlrtb\clftsWidth3\clwWidth4811\clshdrawnil \cellx9514\pard\plain \ltrpar\ql \li0\ri0\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\yts15 \rtlch\fcs1
+\af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid15622382 \cell }
+{\field
+{\*\fldinst
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid15622382 PAGE \\* MERGEFORMAT }
+}
+{\fldrslt
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 \lang1024\langfe1024\noproof\insrsid15622382 1}
+}
+}
+\sectd \ltrsect\linex0\endnhere\sectlinegrid360\sectdefaultcl\sectrsid418597\sftnbj
+{\rtlch\fcs1 \af31507 \ltrch\fcs0 \insrsid15622382 \cell }
+\pard\plain \ltrpar
+\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\intbl\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0 \rtlch\fcs1 \af31507\afs22\alang1025 \ltrch\fcs0 \f31506\fs22\lang1033\langfe1033\cgrid\langnp1033\langfenp1033
+{\rtlch\fcs1 \af31507 \ltrch\fcs0
+\insrsid15622382 \trowd \irow0\irowband0\lastrow \ltrrow\ts15\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\tblrsid15622382\tbllkhdrrows\tbllkhdrcols\tbllknocolband\tblind0\tblindtype3 \clvertalt\clbrdrt\brdrs\brdrw10\brdrcf17 \clbrdrl
+\brdrs\brdrw10\brdrcf17 \clbrdrb\brdrs\brdrw10\brdrcf17 \clbrdrr\brdrs\brdrw10\brdrcf17 \cltxlrtb\clftsWidth3\clwWidth4811\clshdrawnil \cellx4703\clvertalt\clbrdrt\brdrs\brdrw10\brdrcf17 \clbrdrl\brdrs\brdrw10\brdrcf17 \clbrdrb\brdrs\brdrw10\brdrcf17
+\clbrdrr\brdrs\brdrw10\brdrcf17 \cltxlrtb\clftsWidth3\clwWidth4811\clshdrawnil \cellx9514\row }
+\pard \ltrpar\ql \li0\ri0\sa200\sl276\slmult1\widctlpar\wrapdefault\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0
+{\rtlch\fcs1 \af31507 \ltrch\fcs0
+\insrsid418597
+\par }
+}
diff --git a/sw/qa/extras/rtfimport/rtfimport.cxx b/sw/qa/extras/rtfimport/rtfimport.cxx
index 5f81a1f44697..8f3e113fbb90 100644
--- a/sw/qa/extras/rtfimport/rtfimport.cxx
+++ b/sw/qa/extras/rtfimport/rtfimport.cxx
@@ -133,6 +133,7 @@ public:
void testFdo51916();
void testFdo61193();
void testFdo63023();
+ void testFdo42109();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -257,6 +258,7 @@ void Test::run()
{"fdo51916.rtf", &Test::testFdo51916},
{"hello.rtf", &Test::testFdo61193},
{"fdo63023.rtf", &Test::testFdo63023},
+ {"fdo42109.rtf", &Test::testFdo42109},
};
header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -1223,6 +1225,16 @@ void Test::testFdo63023()
CPPUNIT_ASSERT_EQUAL(sal_Int32(0xFFFF99), getProperty<sal_Int32>(getRun(getParagraphOfText(1, xHeaderText), 1), "CharBackColor"));
}
+void Test::testFdo42109()
+{
+ uno::Reference<text::XTextTablesSupplier> xTextTablesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xTables(xTextTablesSupplier->getTextTables(), uno::UNO_QUERY);
+ uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<text::XTextRange> xCell(xTable->getCellByName("B1"), uno::UNO_QUERY);
+ // Make sure the page number is imported as a field in the B1 cell.
+ CPPUNIT_ASSERT_EQUAL(OUString("TextField"), getProperty<OUString>(getRun(getParagraphOfText(1, xCell->getText()), 1), "TextPortionType"));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();