diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-10-21 18:39:00 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-10-22 09:30:40 +0200 |
commit | f82ee5f4cfbb0c6999de6b4a600af029296b609c (patch) | |
tree | c548f14b07e16a5420062adb4590496e3f4436c4 /sw/qa | |
parent | 743e279933624d248bdd855d9be7070ad875685f (diff) |
sw: remove duplicated test
Now that the import/export tests are reworked, this duplication can be
dropped. Also rename the test file, n<number>.docx is for test files
from bugzilla.novell.com.
Change-Id: I48cf5619fc44341c2e468f756939dc676564da53
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/table-position.docx (renamed from sw/qa/extras/ooxmlimport/data/n779957.docx) | bin | 13789 -> 13789 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 6 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 42 |
3 files changed, 1 insertions, 47 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/n779957.docx b/sw/qa/extras/ooxmlexport/data/table-position.docx Binary files differindex 4347854442c9..4347854442c9 100644 --- a/sw/qa/extras/ooxmlimport/data/n779957.docx +++ b/sw/qa/extras/ooxmlexport/data/table-position.docx diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index e5da60bfc07f..d45bb00103d3 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -97,7 +97,7 @@ void Test::run() {"math-rad.docx", &Test::testMathRad}, {"math-subscripts.docx", &Test::testMathSubscripts}, {"math-vertical_stacks.docx", &Test::testMathVerticalStacks}, - {"../../ooxmlimport/data/n779957.docx", &Test::testTablePosition}, + {"table-position.docx", &Test::testTablePosition}, {"fdo47669.docx", &Test::testFdo47669}, }; // Don't test the first import of these, for some reason those tests fail @@ -357,10 +357,6 @@ void Test::testMathVerticalStacks() void Test::testTablePosition() { - // This is the reverse test of n779957 from ooxmlimport - // We want to verify that a full round-trip does not break formatting - // Of course if import code is wrong, this tests will fail regardless of export code. - sal_Int32 xCoordsFromOffice[] = { 2500, -1000, 0, 0 }; sal_Int32 cellLeftMarginFromOffice[] = { 250, 100, 0, 0 }; diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 7a1a4c709a5a..d0cbc71a9f50 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -96,7 +96,6 @@ public: void testN779834(); void testN779627(); void testN779941(); - void testN779957(); void testFdo55187(); void testN780563(); void testN780853(); @@ -155,7 +154,6 @@ void Test::run() {"n779834.docx", &Test::testN779834}, {"n779627.docx", &Test::testN779627}, {"n779941.docx", &Test::testN779941}, - {"n779957.docx", &Test::testN779957}, {"fdo55187.docx", &Test::testFdo55187}, {"n780563.docx", &Test::testN780563}, {"n780853.docx", &Test::testN780853}, @@ -986,46 +984,6 @@ void Test::testN779941() } } -void Test::testN779957() -{ - /* - * n779957.docx contains 4 tables. This test verifies their X position. - * We compare cursor position in LibreOffice to table indentation in Office, because it's - * where text starts in tables. - */ - sal_Int32 xCoordsFromOffice[] = { 2500, -1000, 0, 0 }; - sal_Int32 cellLeftMarginFromOffice[] = { 250, 100, 0, 0 }; - - uno::Reference<text::XTextTablesSupplier> xTablesSupplier(mxComponent, uno::UNO_QUERY); - uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY); - uno::Reference<container::XIndexAccess> xTables(xTablesSupplier->getTextTables( ), uno::UNO_QUERY); - - for (int i=0; i<4; i++) { - uno::Reference<text::XTextTable> xTable1 (xTables->getByIndex(i), uno::UNO_QUERY); - // Verify X coord - uno::Reference<view::XSelectionSupplier> xCtrl(xModel->getCurrentController(), uno::UNO_QUERY); - xCtrl->select(uno::makeAny(xTable1)); - uno::Reference<text::XTextViewCursorSupplier> xTextViewCursorSupplier(xCtrl, uno::UNO_QUERY); - uno::Reference<text::XTextViewCursor> xCursor(xTextViewCursorSupplier->getViewCursor(), uno::UNO_QUERY); - awt::Point pos = xCursor->getPosition(); - CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Incorrect X coord computed from docx", - xCoordsFromOffice[i], pos.X, 1); - - // Verify left margin of 1st cell : - // * Office left margins are measured relative to the right of the border - // * LO left spacing is measured from the center of the border - uno::Reference<table::XCell> xCell = xTable1->getCellByName("A1"); - uno::Reference< beans::XPropertySet > xPropSet(xCell, uno::UNO_QUERY_THROW); - sal_Int32 aLeftMargin = -1; - xPropSet->getPropertyValue("LeftBorderDistance") >>= aLeftMargin; - uno::Any aLeftBorder = xPropSet->getPropertyValue("LeftBorder"); - table::BorderLine2 aLeftBorderLine; - aLeftBorder >>= aLeftBorderLine; - CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("Incorrect left spacing computed from docx cell margin", - cellLeftMarginFromOffice[i], aLeftMargin - 0.5 * aLeftBorderLine.LineWidth, 1); - } -} - void Test::testN783638() { // The problem was that the margins of inline images were not zero. |