diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2017-08-13 18:39:32 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-08-17 21:26:50 +0200 |
commit | ceb23063726a938caa691aa73a9dd9c773e35134 (patch) | |
tree | 21a9299652dafaf93019dcdf7b667931cf59afac /sd | |
parent | 6e8c6f08cfc34ab59ef359152725aeae940f2654 (diff) |
tdf#111548: PPTX: ActiveX checkbox control appear as picture
Make ActiveX controls import working again (PPTX / XLSX)
It used to work earlier, but there were an issue with the
shape id and so controls were not find. Also in PPTX import
the persistStorage attribute was handled only for parent
controls and not for other kind of controls.
Reviewed-on: https://gerrit.libreoffice.org/40751
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
(cherry picked from commit c8e3633a352c2fda3aebb9781288a926e7a88c42)
tdf#111548: Better fix for PPTX / XLSX import of ActiveX controls
Follow up fix for:
c8e3633a352c2fda3aebb9781288a926e7a88c42
Revert part of it and fix the real issue: shapid was
messed up.
Reviewed-on: https://gerrit.libreoffice.org/40929
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
(cherry picked from commit 286c27e805c4501451857abff19c23b3719146a3)
Change-Id: I9784166b65407b79b6dfed8a38087b55b1b69835
Reviewed-on: https://gerrit.libreoffice.org/41117
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sd')
-rwxr-xr-x | sd/qa/unit/data/pptx/activex_checkbox.pptx | bin | 0 -> 36245 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 37 |
2 files changed, 37 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/activex_checkbox.pptx b/sd/qa/unit/data/pptx/activex_checkbox.pptx Binary files differnew file mode 100755 index 000000000000..66eac985b203 --- /dev/null +++ b/sd/qa/unit/data/pptx/activex_checkbox.pptx diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 896f8b74ac84..42f35b845a88 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -70,6 +70,7 @@ #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> #include <com/sun/star/table/XTableRows.hpp> #include <com/sun/star/style/NumberingType.hpp> +#include <com/sun/star/drawing/XControlShape.hpp> #include <stlpool.hxx> #include <comphelper/processfactory.hxx> @@ -162,6 +163,7 @@ public: void testTdf89064(); void testTdf108925(); void testTdf109223(); + void testActiveXCheckbox(); bool checkPattern(sd::DrawDocShellRef& rDocRef, int nShapeNumber, std::vector<sal_uInt8>& rExpected); void testPatternImport(); @@ -232,6 +234,7 @@ public: CPPUNIT_TEST(testTdf89064); CPPUNIT_TEST(testTdf108925); CPPUNIT_TEST(testTdf109223); + CPPUNIT_TEST(testActiveXCheckbox); CPPUNIT_TEST_SUITE_END(); }; @@ -2250,6 +2253,40 @@ void SdImportTest::testTdf109223() xDocShRef->DoClose(); } +void SdImportTest::testActiveXCheckbox() +{ + // ActiveX controls were imported as images + sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/activex_checkbox.pptx"), PPTX); + uno::Reference< drawing::XControlShape > xControlShape(getShapeFromPage(0, 0, xDocShRef), uno::UNO_QUERY_THROW); + CPPUNIT_ASSERT(xControlShape.is()); + + // Check control type + uno::Reference<beans::XPropertySet> xPropertySet(xControlShape->getControl(), uno::UNO_QUERY); + uno::Reference<lang::XServiceInfo> xServiceInfo(xPropertySet, uno::UNO_QUERY); + CPPUNIT_ASSERT_EQUAL(true, bool(xServiceInfo->supportsService("com.sun.star.form.component.CheckBox"))); + + // Check custom label + OUString sLabel; + xPropertySet->getPropertyValue("Label") >>= sLabel; + CPPUNIT_ASSERT_EQUAL(OUString("Custom Caption"), sLabel); + + // Check background color (highlight system color) + sal_Int32 nColor; + xPropertySet->getPropertyValue("BackgroundColor") >>= nColor; + CPPUNIT_ASSERT_EQUAL(sal_Int32(0x316AC5), nColor); + + // Check Text color (active border system color) + xPropertySet->getPropertyValue("TextColor") >>= nColor; + CPPUNIT_ASSERT_EQUAL(sal_Int32(0xD4D0C8), nColor); + + // Check state of the checkbox + sal_Int16 nState; + xPropertySet->getPropertyValue("State") >>= nState; + CPPUNIT_ASSERT_EQUAL(sal_Int16(1), nState); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); |