[Libreoffice-commits] .: sw/qa

Miklos Vajna vmiklos at kemper.freedesktop.org
Fri Jun 22 02:00:59 PDT 2012


 sw/qa/extras/ooxmltok/data/n758883.docx |binary
 sw/qa/extras/ooxmltok/ooxmltok.cxx      |   45 +++++++++++++++++++++++++++++---
 2 files changed, 42 insertions(+), 3 deletions(-)

New commits:
commit c18ce7120e23924abf09e08d4c4092895c6ac232
Author: Miklos Vajna <vmiklos at suse.cz>
Date:   Fri Jun 22 09:58:17 2012 +0200

    n#758883 test remaining issues
    
    Change-Id: I0ec2570aab2fdc645638875b632d8a854fc00b94

diff --git a/sw/qa/extras/ooxmltok/data/n758883.docx b/sw/qa/extras/ooxmltok/data/n758883.docx
index fed398f..1562496 100644
Binary files a/sw/qa/extras/ooxmltok/data/n758883.docx and b/sw/qa/extras/ooxmltok/data/n758883.docx differ
diff --git a/sw/qa/extras/ooxmltok/ooxmltok.cxx b/sw/qa/extras/ooxmltok/ooxmltok.cxx
index 59e3aab..4cd2aa3 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);


More information about the Libreoffice-commits mailing list