Kaydet (Commit) 04ab7b8e authored tarafından Miklos Vajna's avatar Miklos Vajna

sw: fix indentation in rtf{export,import} test

Change-Id: Ie777de47dc70da136b145028a08ea17a0de7a87d
üst 17ed8c53
...@@ -30,9 +30,11 @@ class Test : public SwModelTestBase ...@@ -30,9 +30,11 @@ class Test : public SwModelTestBase
public: public:
Test() : SwModelTestBase("/sw/qa/extras/rtfexport/data/", "Rich Text Format") {} Test() : SwModelTestBase("/sw/qa/extras/rtfexport/data/", "Rich Text Format") {}
bool mustTestImportOf(const char* filename) const SAL_OVERRIDE { bool mustTestImportOf(const char* filename) const SAL_OVERRIDE
{
// Don't test the first import of these, for some reason those tests fail // Don't test the first import of these, for some reason those tests fail
const char* aBlacklist[] = { const char* aBlacklist[] =
{
"math-eqarray.rtf", "math-eqarray.rtf",
"math-escaping.rtf", "math-escaping.rtf",
"math-lim.rtf", "math-lim.rtf",
......
...@@ -127,9 +127,9 @@ DECLARE_RTFIMPORT_TEST(testFdo45553, "fdo45553.rtf") ...@@ -127,9 +127,9 @@ DECLARE_RTFIMPORT_TEST(testFdo45553, "fdo45553.rtf")
{ {
uno::Reference<text::XTextRange> xRange(xRangeEnum->nextElement(), uno::UNO_QUERY); uno::Reference<text::XTextRange> xRange(xRangeEnum->nextElement(), uno::UNO_QUERY);
OUString aStr = xRange->getString(); OUString aStr = xRange->getString();
if ( aStr == "space-before" ) if (aStr == "space-before")
CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(120)), getProperty<sal_Int32>(xRange, "ParaTopMargin")); CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(120)), getProperty<sal_Int32>(xRange, "ParaTopMargin"));
else if ( aStr == "space-after" ) else if (aStr == "space-after")
CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(240)), getProperty<sal_Int32>(xRange, "ParaBottomMargin")); CPPUNIT_ASSERT_EQUAL(sal_Int32(convertTwipToMm100(240)), getProperty<sal_Int32>(xRange, "ParaBottomMargin"));
} }
} }
...@@ -140,7 +140,7 @@ DECLARE_RTFIMPORT_TEST(testN192129, "n192129.rtf") ...@@ -140,7 +140,7 @@ DECLARE_RTFIMPORT_TEST(testN192129, "n192129.rtf")
// We expect that the result will be 16x16px. // We expect that the result will be 16x16px.
Size aExpectedSize(16, 16); Size aExpectedSize(16, 16);
MapMode aMap(MAP_100TH_MM); MapMode aMap(MAP_100TH_MM);
aExpectedSize = Application::GetDefaultDevice()->PixelToLogic( aExpectedSize, aMap ); aExpectedSize = Application::GetDefaultDevice()->PixelToLogic(aExpectedSize, aMap);
uno::Reference<text::XTextGraphicObjectsSupplier> xTextGraphicObjectsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<text::XTextGraphicObjectsSupplier> xTextGraphicObjectsSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xIndexAccess(xTextGraphicObjectsSupplier->getGraphicObjects(), uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xIndexAccess(xTextGraphicObjectsSupplier->getGraphicObjects(), uno::UNO_QUERY);
...@@ -230,9 +230,9 @@ DECLARE_RTFIMPORT_TEST(testFdo46662, "fdo46662.rtf") ...@@ -230,9 +230,9 @@ DECLARE_RTFIMPORT_TEST(testFdo46662, "fdo46662.rtf")
{ {
const beans::PropertyValue& rProp = aProps[i]; const beans::PropertyValue& rProp = aProps[i];
if ( rProp.Name == "ParentNumbering" ) if (rProp.Name == "ParentNumbering")
CPPUNIT_ASSERT_EQUAL(sal_Int16(2), rProp.Value.get<sal_Int16>()); CPPUNIT_ASSERT_EQUAL(sal_Int16(2), rProp.Value.get<sal_Int16>());
else if ( rProp.Name == "Suffix" ) else if (rProp.Name == "Suffix")
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), rProp.Value.get<OUString>().getLength()); CPPUNIT_ASSERT_EQUAL(sal_Int32(0), rProp.Value.get<OUString>().getLength());
} }
} }
...@@ -922,7 +922,7 @@ DECLARE_RTFIMPORT_TEST(testFdo58933, "fdo58933.rtf") ...@@ -922,7 +922,7 @@ DECLARE_RTFIMPORT_TEST(testFdo58933, "fdo58933.rtf")
DECLARE_RTFIMPORT_TEST(testFdo44053, "fdo44053.rtf") DECLARE_RTFIMPORT_TEST(testFdo44053, "fdo44053.rtf")
{ {
uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY);
uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY);
uno::Reference<table::XTableRows> xTableRows(xTextTable->getRows(), uno::UNO_QUERY); uno::Reference<table::XTableRows> xTableRows(xTextTable->getRows(), uno::UNO_QUERY);
// The with of the table's A1 and A2 cell should equal. // The with of the table's A1 and A2 cell should equal.
...@@ -1409,8 +1409,7 @@ DECLARE_RTFIMPORT_TEST(testNestedTable, "rhbz1065629.rtf") ...@@ -1409,8 +1409,7 @@ DECLARE_RTFIMPORT_TEST(testNestedTable, "rhbz1065629.rtf")
xTable.set(xTables->getByIndex(2), uno::UNO_QUERY); xTable.set(xTables->getByIndex(2), uno::UNO_QUERY);
xCell.set(xTable->getCellByName("A1"), uno::UNO_QUERY); xCell.set(xTable->getCellByName("A1"), uno::UNO_QUERY);
CPPUNIT_ASSERT(xCell.is()); CPPUNIT_ASSERT(xCell.is());
table::BorderLine2 fullPtSolid( table::BorderLine2 fullPtSolid(1, 0, 35, 0, table::BorderLineStyle::SOLID, 35);
1, 0, 35, 0, table::BorderLineStyle::SOLID, 35);
CPPUNIT_ASSERT_BORDER_EQUAL(fullPtSolid, CPPUNIT_ASSERT_BORDER_EQUAL(fullPtSolid,
getProperty<table::BorderLine2>(xCell, "LeftBorder")); getProperty<table::BorderLine2>(xCell, "LeftBorder"));
CPPUNIT_ASSERT_BORDER_EQUAL(fullPtSolid, CPPUNIT_ASSERT_BORDER_EQUAL(fullPtSolid,
...@@ -1422,8 +1421,7 @@ DECLARE_RTFIMPORT_TEST(testNestedTable, "rhbz1065629.rtf") ...@@ -1422,8 +1421,7 @@ DECLARE_RTFIMPORT_TEST(testNestedTable, "rhbz1065629.rtf")
CPPUNIT_ASSERT_EQUAL(sal_Int32(0xCC0000), getProperty<sal_Int32>(xCell, "BackColor")); CPPUNIT_ASSERT_EQUAL(sal_Int32(0xCC0000), getProperty<sal_Int32>(xCell, "BackColor"));
xCell.set(xTable->getCellByName("A2"), uno::UNO_QUERY); xCell.set(xTable->getCellByName("A2"), uno::UNO_QUERY);
CPPUNIT_ASSERT(xCell.is()); CPPUNIT_ASSERT(xCell.is());
table::BorderLine2 halfPtSolid( table::BorderLine2 halfPtSolid(/*0*/1, 0, 18, 0, table::BorderLineStyle::SOLID, 18);
/*0*/1, 0, 18, 0, table::BorderLineStyle::SOLID, 18);
CPPUNIT_ASSERT_BORDER_EQUAL(halfPtSolid, CPPUNIT_ASSERT_BORDER_EQUAL(halfPtSolid,
getProperty<table::BorderLine2>(xCell, "LeftBorder")); getProperty<table::BorderLine2>(xCell, "LeftBorder"));
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xffffffff), CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(0xffffffff),
...@@ -1469,8 +1467,7 @@ DECLARE_RTFIMPORT_TEST(testFooterPara, "footer-para.rtf") ...@@ -1469,8 +1467,7 @@ DECLARE_RTFIMPORT_TEST(testFooterPara, "footer-para.rtf")
{ {
// check that paragraph properties in footer are imported // check that paragraph properties in footer are imported
uno::Reference<text::XText> xFooterText = uno::Reference<text::XText> xFooterText =
getProperty< uno::Reference<text::XText> >( getProperty< uno::Reference<text::XText> >(getStyles("PageStyles")->getByName("First Page"), "FooterText");
getStyles("PageStyles")->getByName("First Page"), "FooterText");
uno::Reference<text::XTextContent> xParagraph = uno::Reference<text::XTextContent> xParagraph =
getParagraphOrTable(1, xFooterText); getParagraphOrTable(1, xFooterText);
CPPUNIT_ASSERT_EQUAL(OUString("All Rights Reserved."), CPPUNIT_ASSERT_EQUAL(OUString("All Rights Reserved."),
...@@ -1497,7 +1494,7 @@ DECLARE_RTFIMPORT_TEST(testCp1000016, "hello.rtf") ...@@ -1497,7 +1494,7 @@ DECLARE_RTFIMPORT_TEST(testCp1000016, "hello.rtf")
DECLARE_RTFIMPORT_TEST(testFdo65090, "fdo65090.rtf") DECLARE_RTFIMPORT_TEST(testFdo65090, "fdo65090.rtf")
{ {
uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY);
uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables(), uno::UNO_QUERY);
uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY); uno::Reference<text::XTextTable> xTextTable(xTables->getByIndex(0), uno::UNO_QUERY);
uno::Reference<table::XTableRows> xTableRows(xTextTable->getRows(), uno::UNO_QUERY); uno::Reference<table::XTableRows> xTableRows(xTextTable->getRows(), uno::UNO_QUERY);
// The first row had 3 cells, instead of a horizontally merged one and a normal one (2 -> 1 separator). // The first row had 3 cells, instead of a horizontally merged one and a normal one (2 -> 1 separator).
...@@ -1512,8 +1509,7 @@ DECLARE_RTFIMPORT_TEST(testTableBorderDefaults, "fdo68779.rtf") ...@@ -1512,8 +1509,7 @@ DECLARE_RTFIMPORT_TEST(testTableBorderDefaults, "fdo68779.rtf")
uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY); uno::Reference<text::XTextTable> xTable(xTables->getByIndex(0), uno::UNO_QUERY);
uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY); uno::Reference<text::XTextRange> xCell(xTable->getCellByName("A1"), uno::UNO_QUERY);
CPPUNIT_ASSERT(xCell.is()); CPPUNIT_ASSERT(xCell.is());
table::BorderLine2 solid( table::BorderLine2 solid(1, 0, 26, 0, table::BorderLineStyle::SOLID, 26);
1, 0, 26, 0, table::BorderLineStyle::SOLID, 26);
CPPUNIT_ASSERT_BORDER_EQUAL(solid, CPPUNIT_ASSERT_BORDER_EQUAL(solid,
getProperty<table::BorderLine2>(xCell, "LeftBorder")); getProperty<table::BorderLine2>(xCell, "LeftBorder"));
CPPUNIT_ASSERT_BORDER_EQUAL(solid, CPPUNIT_ASSERT_BORDER_EQUAL(solid,
...@@ -1526,8 +1522,7 @@ DECLARE_RTFIMPORT_TEST(testTableBorderDefaults, "fdo68779.rtf") ...@@ -1526,8 +1522,7 @@ DECLARE_RTFIMPORT_TEST(testTableBorderDefaults, "fdo68779.rtf")
xTable.set(xTables->getByIndex(1), uno::UNO_QUERY); xTable.set(xTables->getByIndex(1), uno::UNO_QUERY);
xCell.set(xTable->getCellByName("A1"), uno::UNO_QUERY); xCell.set(xTable->getCellByName("A1"), uno::UNO_QUERY);
CPPUNIT_ASSERT(xCell.is()); CPPUNIT_ASSERT(xCell.is());
table::BorderLine2 dotted( table::BorderLine2 dotted(1, 0, 26, 0, table::BorderLineStyle::DOTTED, 26);
1, 0, 26, 0, table::BorderLineStyle::DOTTED, 26);
CPPUNIT_ASSERT_BORDER_EQUAL(dotted, CPPUNIT_ASSERT_BORDER_EQUAL(dotted,
getProperty<table::BorderLine2>(xCell, "LeftBorder")); getProperty<table::BorderLine2>(xCell, "LeftBorder"));
CPPUNIT_ASSERT_BORDER_EQUAL(dotted, CPPUNIT_ASSERT_BORDER_EQUAL(dotted,
...@@ -1540,8 +1535,7 @@ DECLARE_RTFIMPORT_TEST(testTableBorderDefaults, "fdo68779.rtf") ...@@ -1540,8 +1535,7 @@ DECLARE_RTFIMPORT_TEST(testTableBorderDefaults, "fdo68779.rtf")
xTable.set(xTables->getByIndex(2), uno::UNO_QUERY); xTable.set(xTables->getByIndex(2), uno::UNO_QUERY);
xCell.set(xTable->getCellByName("A1"), uno::UNO_QUERY); xCell.set(xTable->getCellByName("A1"), uno::UNO_QUERY);
CPPUNIT_ASSERT(xCell.is()); CPPUNIT_ASSERT(xCell.is());
table::BorderLine2 doubled( table::BorderLine2 doubled(1, 26, 26, 26, table::BorderLineStyle::DOUBLE, 79);
1, 26, 26, 26, table::BorderLineStyle::DOUBLE, 79);
CPPUNIT_ASSERT_BORDER_EQUAL(doubled, CPPUNIT_ASSERT_BORDER_EQUAL(doubled,
getProperty<table::BorderLine2>(xCell, "LeftBorder")); getProperty<table::BorderLine2>(xCell, "LeftBorder"));
CPPUNIT_ASSERT_BORDER_EQUAL(doubled, CPPUNIT_ASSERT_BORDER_EQUAL(doubled,
...@@ -1554,8 +1548,7 @@ DECLARE_RTFIMPORT_TEST(testTableBorderDefaults, "fdo68779.rtf") ...@@ -1554,8 +1548,7 @@ DECLARE_RTFIMPORT_TEST(testTableBorderDefaults, "fdo68779.rtf")
xTable.set(xTables->getByIndex(3), uno::UNO_QUERY); xTable.set(xTables->getByIndex(3), uno::UNO_QUERY);
xCell.set(xTable->getCellByName("A1"), uno::UNO_QUERY); xCell.set(xTable->getCellByName("A1"), uno::UNO_QUERY);
CPPUNIT_ASSERT(xCell.is()); CPPUNIT_ASSERT(xCell.is());
table::BorderLine2 thinThickMG( table::BorderLine2 thinThickMG(1, 14, 26, 14, table::BorderLineStyle::THINTHICK_MEDIUMGAP, 53);
1, 14, 26, 14, table::BorderLineStyle::THINTHICK_MEDIUMGAP, 53);
CPPUNIT_ASSERT_BORDER_EQUAL(thinThickMG, CPPUNIT_ASSERT_BORDER_EQUAL(thinThickMG,
getProperty<table::BorderLine2>(xCell, "LeftBorder")); getProperty<table::BorderLine2>(xCell, "LeftBorder"));
CPPUNIT_ASSERT_BORDER_EQUAL(thinThickMG, CPPUNIT_ASSERT_BORDER_EQUAL(thinThickMG,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment