summaryrefslogtreecommitdiff
path: root/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-06-05 11:44:10 +0200
committerMiklos Vajna <vmiklos@suse.cz>2013-06-05 13:03:04 +0200
commit01508a6172617659d74175d512bb29181a54a336 (patch)
tree4d26077fcf80311b85736af9952b35372ce26891 /sw/qa/extras/ooxmlimport/ooxmlimport.cxx
parent3ab23b633f540f690622a097334b669c85aee89f (diff)
bnc#820509 testcase
Change-Id: Iee9909e9c42014ab10ceaa2f8f8e554c25e89157 (cherry picked from commit a9e0ec2b87a99c93b77a210a916b4df44ece454a) Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx
Diffstat (limited to 'sw/qa/extras/ooxmlimport/ooxmlimport.cxx')
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 8f24b406256a..bd85ca23334e 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -29,6 +29,7 @@
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/document/XEmbeddedObjectSupplier2.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
+#include <com/sun/star/drawing/XControlShape.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/text/HoriOrientation.hpp>
@@ -49,6 +50,7 @@
#include <com/sun/star/style/ParagraphAdjust.hpp>
#include <com/sun/star/table/ShadowFormat.hpp>
#include <com/sun/star/view/XSelectionSupplier.hpp>
+#include <com/sun/star/view/XFormLayerAccess.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
#include <com/sun/star/table/TableBorder2.hpp>
@@ -121,6 +123,7 @@ public:
void testPageBackground();
void testWatermark();
void testPageBorderShadow();
+ void testN820509();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -194,6 +197,7 @@ void Test::run()
{"page-background.docx", &Test::testPageBackground},
{"watermark.docx", &Test::testWatermark},
{"page-border-shadow.docx", &Test::testPageBorderShadow},
+ {"n820509.docx", &Test::testN820509},
};
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
{
@@ -1226,6 +1230,22 @@ void Test::testPageBorderShadow()
CPPUNIT_ASSERT_EQUAL(sal_Int16(TWIP_TO_MM100(48/8*20)), aShadow.ShadowWidth);
}
+void Test::testN820509()
+{
+ // Design mode was enabled.
+ uno::Reference<frame::XModel> xModel(mxComponent, uno::UNO_QUERY);
+ uno::Reference<view::XFormLayerAccess> xFormLayerAccess(xModel->getCurrentController(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(false, bool(xFormLayerAccess->isFormDesignMode()));
+
+ // M.d.yyyy date format was unhandled.
+ uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xDraws(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY);
+ uno::Reference<drawing::XControlShape> xControlShape(xDraws->getByIndex(0), uno::UNO_QUERY);
+ uno::Reference<beans::XPropertySet> xPropertySet(xControlShape->getControl(), uno::UNO_QUERY);
+ uno::Reference<lang::XServiceInfo> xServiceInfo(xPropertySet, uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(8), getProperty<sal_Int16>(xPropertySet, "DateFormat"));
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
CPPUNIT_PLUGIN_IMPLEMENT();