diff options
author | Michael Stahl <mstahl@redhat.com> | 2016-02-01 12:58:44 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-02-01 13:07:14 +0100 |
commit | 27b623d9743667d123532f0e5aac6f6f14fbc0a2 (patch) | |
tree | 0f86daaeaad9ab8bbe87ffce7ea112027c143dfd | |
parent | 57def64bec0853de7d6f4243e31e8e9650491914 (diff) |
sw: for better or worse getParagraph() is 1-based
Change-Id: I2bc99b4cbb86a368b6218b3c1a7dfc693858d1c9
-rw-r--r-- | sw/qa/extras/htmlimport/htmlimport.cxx | 2 | ||||
-rw-r--r-- | sw/qa/extras/inc/swmodeltestbase.hxx | 1 | ||||
-rw-r--r-- | sw/qa/extras/odfexport/odfexport.cxx | 2 | ||||
-rw-r--r-- | sw/qa/extras/odfimport/odfimport.cxx | 4 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport2.cxx | 4 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 10 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport.cxx | 4 |
7 files changed, 14 insertions, 13 deletions
diff --git a/sw/qa/extras/htmlimport/htmlimport.cxx b/sw/qa/extras/htmlimport/htmlimport.cxx index afd62edeed24..e6d9c92752a0 100644 --- a/sw/qa/extras/htmlimport/htmlimport.cxx +++ b/sw/qa/extras/htmlimport/htmlimport.cxx @@ -116,7 +116,7 @@ DECLARE_HTMLIMPORT_TEST(testInlinedImagesPageAndParagraph, "PageAndParagraphFill if(nParagraphs) { // get the paragraph - uno::Reference< text::XTextRange > xPara = getParagraph( 0 ); + uno::Reference<text::XTextRange> xPara = getParagraph(1); uno::Reference< beans::XPropertySet > xParagraphProperties( xPara, uno::UNO_QUERY); // check for Bitmap FillStyle, name empty, repeat diff --git a/sw/qa/extras/inc/swmodeltestbase.hxx b/sw/qa/extras/inc/swmodeltestbase.hxx index e9f974ad6f99..b154efebef6d 100644 --- a/sw/qa/extras/inc/swmodeltestbase.hxx +++ b/sw/qa/extras/inc/swmodeltestbase.hxx @@ -464,6 +464,7 @@ protected: uno::Reference<text::XTextContent> getParagraphOrTable(int number, uno::Reference<text::XText> xText = uno::Reference<text::XText>()) const { + assert(number != 0); // this thing is 1-based uno::Reference<container::XEnumerationAccess> paraEnumAccess; if (xText.is()) paraEnumAccess.set(xText, uno::UNO_QUERY); diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 6333b9214ba2..a5b18472d055 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -770,7 +770,7 @@ DECLARE_ODFEXPORT_TEST(testOdtBorderTypes, "border_types.odt") DECLARE_ODFEXPORT_TEST(testCellUserDefineAttr, "userdefattr-tablecell.odt") { - uno::Reference<text::XTextTable> xTable(getParagraphOrTable(0), uno::UNO_QUERY); + uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY); uno::Reference<table::XCell> const xCellA1(xTable->getCellByName("A1"), uno::UNO_SET_THROW); uno::Reference<table::XCell> const xCellB1(xTable->getCellByName("B1"), uno::UNO_SET_THROW); uno::Reference<table::XCell> const xCellC1(xTable->getCellByName("C1"), uno::UNO_SET_THROW); diff --git a/sw/qa/extras/odfimport/odfimport.cxx b/sw/qa/extras/odfimport/odfimport.cxx index c944d443eeef..c26a45d6d81f 100644 --- a/sw/qa/extras/odfimport/odfimport.cxx +++ b/sw/qa/extras/odfimport/odfimport.cxx @@ -282,7 +282,7 @@ DECLARE_ODFIMPORT_TEST(testPageStyleLayoutRight, "hello.odt") DECLARE_ODFIMPORT_TEST(testFdo61952, "hello.odt") { - uno::Reference<beans::XPropertySet> xPara(getParagraph(0), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY); xPara->setPropertyValue("PageDescName", uno::makeAny(OUString("Left Page"))); xPara->setPropertyValue("PageDescName", uno::makeAny(OUString("Right Page"))); xPara->setPropertyValue("PageDescName", uno::makeAny(OUString("Left Page"))); @@ -291,7 +291,7 @@ DECLARE_ODFIMPORT_TEST(testFdo61952, "hello.odt") DECLARE_ODFIMPORT_TEST(testFdo60842, "fdo60842.odt") { - uno::Reference<text::XTextContent> const xTable(getParagraphOrTable(0)); + uno::Reference<text::XTextContent> const xTable(getParagraphOrTable(1)); getCell(xTable, "A1", ""); getCell(xTable, "B1", "18/02/2012"); getCell(xTable, "C1", "USD"); // this is the cell with office:string-value diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx index a850c811fb21..f3cb5bc55df8 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx @@ -1091,14 +1091,14 @@ DECLARE_OOXMLEXPORT_TEST(testTableFloating, "table-floating.docx") DECLARE_OOXMLEXPORT_TEST(testFdo44689_start_page_0, "fdo44689_start_page_0.docx") { // The problem was that the import & export process did not analyze the 'start from page' attribute of a section - uno::Reference<beans::XPropertySet> xPara(getParagraph(0), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int16(0), getProperty<sal_Int16>(xPara, "PageNumberOffset")); } DECLARE_OOXMLEXPORT_TEST(testFdo44689_start_page_7, "fdo44689_start_page_7.docx") { // The problem was that the import & export process did not analyze the 'start from page' attribute of a section - uno::Reference<beans::XPropertySet> xPara(getParagraph(0), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xPara(getParagraph(1), uno::UNO_QUERY); CPPUNIT_ASSERT_EQUAL(sal_Int16(7), getProperty<sal_Int16>(xPara, "PageNumberOffset")); } diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 55853f196917..2e43da1c9a56 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -799,9 +799,9 @@ DECLARE_OOXMLIMPORT_TEST(testN778836, "n778836.docx") * The problem was that the paragraph inherited margins from the numbering * and parent paragraph styles and the result was incorrect. */ - CPPUNIT_ASSERT_EQUAL(sal_Int32(1270), getProperty<sal_Int32>(getParagraph(0), "ParaRightMargin")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(3810), getProperty<sal_Int32>(getParagraph(0), "ParaLeftMargin")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(-635), getProperty<sal_Int32>(getParagraph(0), "ParaFirstLineIndent")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(1270), getProperty<sal_Int32>(getParagraph(1), "ParaRightMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(3810), getProperty<sal_Int32>(getParagraph(1), "ParaLeftMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(-635), getProperty<sal_Int32>(getParagraph(1), "ParaFirstLineIndent")); } DECLARE_OOXMLIMPORT_TEST(testN778140, "n778140.docx") @@ -810,8 +810,8 @@ DECLARE_OOXMLIMPORT_TEST(testN778140, "n778140.docx") * The problem was that the paragraph top/bottom margins were incorrect due * to unhandled w:doNotUseHTMLParagraphAutoSpacing. */ - CPPUNIT_ASSERT_EQUAL(sal_Int32(176), getProperty<sal_Int32>(getParagraph(0), "ParaTopMargin")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(176), getProperty<sal_Int32>(getParagraph(0), "ParaBottomMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(176), getProperty<sal_Int32>(getParagraph(1), "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(176), getProperty<sal_Int32>(getParagraph(1), "ParaBottomMargin")); } DECLARE_OOXMLIMPORT_TEST(testN778828, "n778828.docx") diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 4a90271091a5..235ec8e3b822 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -876,8 +876,8 @@ DECLARE_RTFEXPORT_TEST(testNumOverrideStart, "num-override-start.rtf") DECLARE_RTFEXPORT_TEST(testFdo82006, "fdo82006.rtf") { // These were 176 (100 twips), as \sbauto and \sbbefore were ignored. - CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(280)), getProperty<sal_Int32>(getParagraph(0), "ParaTopMargin")); - CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(280)), getProperty<sal_Int32>(getParagraph(0), "ParaBottomMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(280)), getProperty<sal_Int32>(getParagraph(1), "ParaTopMargin")); + CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(280)), getProperty<sal_Int32>(getParagraph(1), "ParaBottomMargin")); } DECLARE_RTFEXPORT_TEST(testTdf88583, "tdf88583.odt") |