[Libreoffice-commits] .: sw/qa

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Sep 26 12:33:18 PDT 2012


 sw/qa/extras/ooxmlimport/data/imgshadow.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx     |   20 +++++++++++++++++++-
 2 files changed, 19 insertions(+), 1 deletion(-)

New commits:
commit 63a7550931c88ce06e4ab6f258121061c1f2dcf2
Author: Eilidh McAdam <eilidh at lanedo.com>
Date:   Wed Sep 26 18:07:31 2012 +0100

    DOCX image drop shadow testcase.
    
    Change-Id: Ibbbb27fdf0abff997d31ae8814812f7af1ec15af
    Reviewed-on: https://gerrit.libreoffice.org/704
    Reviewed-by: Noel Power <noel.power at suse.com>
    Tested-by: Noel Power <noel.power at suse.com>

diff --git a/sw/qa/extras/ooxmlimport/data/imgshadow.docx b/sw/qa/extras/ooxmlimport/data/imgshadow.docx
new file mode 100644
index 0000000..efe0e95
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/imgshadow.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index fa388f3..92452dd 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -46,7 +46,7 @@
 #include <com/sun/star/text/XTextFramesSupplier.hpp>
 #include <com/sun/star/text/XTextViewCursorSupplier.hpp>
 #include <com/sun/star/style/ParagraphAdjust.hpp>
-
+#include <com/sun/star/table/ShadowFormat.hpp>
 
 #include <vcl/svapp.hxx>
 
@@ -93,6 +93,7 @@ public:
     void testN780563();
     void testN780853();
     void testN780843();
+    void testShadow();
 
     CPPUNIT_TEST_SUITE(Test);
 #if !defined(MACOSX) && !defined(WNT)
@@ -134,6 +135,7 @@ public:
     CPPUNIT_TEST(testN780563);
     CPPUNIT_TEST(testN780853);
     CPPUNIT_TEST(testN780843);
+    CPPUNIT_TEST(testShadow);
 #endif
     CPPUNIT_TEST_SUITE_END();
 
@@ -943,6 +945,22 @@ void Test::testN780843()
     CPPUNIT_ASSERT_EQUAL(OUString("shown footer"), xFooter->getString());
 }
 
+void Test::testShadow()
+{
+    /*
+     * The problem was that drop shadows on inline images were not being
+     * imported and applied.
+     */
+    load("imgshadow.docx");
+    uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+    uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+    uno::Reference<beans::XPropertySet> xPropertySet(xDraws->getByIndex(1), uno::UNO_QUERY);
+
+    table::ShadowFormat aShadow;
+    xPropertySet->getPropertyValue("ShadowFormat") >>= aShadow;
+    CPPUNIT_ASSERT_EQUAL(sal_Int32(273), sal_Int32(aShadow.ShadowWidth));
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(Test);
 
 CPPUNIT_PLUGIN_IMPLEMENT();


More information about the Libreoffice-commits mailing list