summaryrefslogtreecommitdiff
path: root/sw
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 12:26:35 +0200
commitc9445b1924d0dffd410dcb35ad4f108960d41c40 (patch)
treeda46d3d16d67b1d5cf15d4dc7ba08df675cced8a /sw
parent664e6bf7433a97eea8c0a5127d5ce9014d0ab6e0 (diff)
bnc#820509 testcase
(cherry picked from commit a9e0ec2b87a99c93b77a210a916b4df44ece454a) Conflicts: sw/qa/extras/ooxmlimport/ooxmlimport.cxx Change-Id: Iee9909e9c42014ab10ceaa2f8f8e554c25e89157
Diffstat (limited to 'sw')
-rwxr-xr-xsw/qa/extras/ooxmlimport/data/n820509.docxbin0 -> 10414 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx19
2 files changed, 19 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/n820509.docx b/sw/qa/extras/ooxmlimport/data/n820509.docx
new file mode 100755
index 000000000000..a6da1e16842c
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/n820509.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index b38f7cbf1c38..aaf9cc9aecd1 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -32,6 +32,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>
#include <com/sun/star/text/SizeType.hpp>
@@ -116,6 +117,7 @@ public:
void testPageBackground();
void testWatermark();
void testPageBorderShadow();
+ void testN820509();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -200,6 +202,7 @@ void Test::run()
{"page-background.docx", &Test::testPageBackground},
{"watermark.docx", &Test::testWatermark},
{"page-border-shadow.docx", &Test::testPageBorderShadow},
+ {"n820509.docx", &Test::testN820509},
};
header();
for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i)
@@ -1426,6 +1429,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();