summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2012-06-22 09:58:17 +0200
committerMiklos Vajna <vmiklos@suse.cz>2012-06-22 11:02:12 +0200
commitc18ce7120e23924abf09e08d4c4092895c6ac232 (patch)
tree0c065dea0020344e726c16ce4bc02a99de9a891d
parent281a43d7e18bd034e7462ddc99f671aed56b45a2 (diff)
n#758883 test remaining issues
Change-Id: I0ec2570aab2fdc645638875b632d8a854fc00b94
-rw-r--r--sw/qa/extras/ooxmltok/data/n758883.docxbin11362 -> 11896 bytes
-rw-r--r--sw/qa/extras/ooxmltok/ooxmltok.cxx45
2 files changed, 42 insertions, 3 deletions
diff --git a/sw/qa/extras/ooxmltok/data/n758883.docx b/sw/qa/extras/ooxmltok/data/n758883.docx
index fed398fd29b8..1562496e45bf 100644
--- a/sw/qa/extras/ooxmltok/data/n758883.docx
+++ b/sw/qa/extras/ooxmltok/data/n758883.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmltok/ooxmltok.cxx b/sw/qa/extras/ooxmltok/ooxmltok.cxx
index 59e3aab1327e..4cd2aa3a7252 100644
--- a/sw/qa/extras/ooxmltok/ooxmltok.cxx
+++ b/sw/qa/extras/ooxmltok/ooxmltok.cxx
@@ -35,6 +35,7 @@
#include <com/sun/star/text/HoriOrientation.hpp>
#include <com/sun/star/text/SetVariableType.hpp>
#include <com/sun/star/text/TextContentAnchorType.hpp>
+#include <com/sun/star/text/WrapTextMode.hpp>
#include <com/sun/star/text/XDependentTextField.hpp>
#include <com/sun/star/text/XFormField.hpp>
#include <com/sun/star/text/XPageCursor.hpp>
@@ -555,15 +556,53 @@ void Test::testN766477()
void Test::testN758883()
{
+ load("n758883.docx");
+
/*
* The problem was that direct formatting of the paragraph was not applied
* to the numbering. This is easier to test using a layout dump.
*/
-
- load("n758883.docx");
-
OUString aHeight = parseDump("/root/page/body/txt/Special", "nHeight");
CPPUNIT_ASSERT_EQUAL(sal_Int32(220), aHeight.toInt32()); // It was 280
+
+ /*
+ * Next problem was that the page margin contained the width of the page border as well.
+ *
+ * xray ThisComponent.StyleFamilies.PageStyles.Default.LeftMargin
+ */
+ uno::Reference<beans::XPropertySet> xPropertySet(getStyles("PageStyles")->getByName("Default"), uno::UNO_QUERY);
+ sal_Int32 nValue = 0;
+ xPropertySet->getPropertyValue("LeftMargin") >>= nValue;
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(820), nValue);
+
+ // No assert for the 3rd problem: see the comment in the test doc.
+
+ /*
+ * 4th problem: Wrap type of the textwrape was not 'through'.
+ *
+ * xray ThisComponent.DrawPage(0).Surround ' was 2, should be 1
+ */
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+ xPropertySet.set(xDraws->getByIndex(0), uno::UNO_QUERY);
+ text::WrapTextMode eValue;
+ xPropertySet->getPropertyValue("Surround") >>= eValue;
+ CPPUNIT_ASSERT_EQUAL(eValue, text::WrapTextMode_THROUGHT);
+
+ /*
+ * 5th problem: anchor type of the second textbox was wrong.
+ *
+ * xray ThisComponent.DrawPage(1).AnchorType ' was 1, should be 4
+ */
+ xPropertySet.set(xDraws->getByIndex(1), uno::UNO_QUERY);
+ text::TextContentAnchorType eAnchorType;
+ xPropertySet->getPropertyValue("AnchorType") >>= eAnchorType;
+ CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, eAnchorType);
+
+ // 6th problem: xray ThisComponent.DrawPage(2).AnchorType ' was 2, should be 4
+ xPropertySet.set(xDraws->getByIndex(2), uno::UNO_QUERY);
+ xPropertySet->getPropertyValue("AnchorType") >>= eAnchorType;
+ CPPUNIT_ASSERT_EQUAL(text::TextContentAnchorType_AT_CHARACTER, eAnchorType);
}
CPPUNIT_TEST_SUITE_REGISTRATION(Test);