summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorTibor Nagy <nagy.tibor2@nisz.hu>2022-05-13 08:12:17 +0200
committerLászló Németh <nemeth@numbertext.org>2022-05-27 18:32:38 +0200
commit855a56fea4561135a63cb729d7a625a950b210e7 (patch)
tree96dd057f2ab6917041ee43e943c321880e57a5bf /sd
parentb3c965ccaa896b12b33ff5b7ccea0eb20d560116 (diff)
tdf#148965 PPTX import: fix internal hyperlinks on shapes
Locale dependent code path resulted broken hyperlinks on shapes in a non-English build. Change-Id: I045bbe4246ab5336e2b967bf252b5fbca5b17706 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134266 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/tdf148965.pptxbin0 -> 19068 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx37
2 files changed, 37 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf148965.pptx b/sd/qa/unit/data/pptx/tdf148965.pptx
new file mode 100644
index 000000000000..5b7b9f098d0b
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf148965.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 9e60c8886dec..aa329dfddec6 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -55,6 +55,8 @@
#include <com/sun/star/drawing/ConnectorType.hpp>
#include <stlpool.hxx>
+#include <unotools/syslocaleoptions.hxx>
+#include <comphelper/scopeguard.hxx>
#include <comphelper/sequenceashashmap.hxx>
#include <comphelper/lok.hxx>
#include <svx/svdograf.hxx>
@@ -82,6 +84,7 @@ public:
void testDocumentLayout();
void testTdf149124();
+ void testTdf148965();
void testTdf89449();
void testTdf147459();
void testTdf146223();
@@ -151,6 +154,7 @@ public:
CPPUNIT_TEST(testDocumentLayout);
CPPUNIT_TEST(testTdf149124);
+ CPPUNIT_TEST(testTdf148965);
CPPUNIT_TEST(testTdf89449);
CPPUNIT_TEST(testTdf147459);
CPPUNIT_TEST(testTdf146223);
@@ -309,7 +313,40 @@ void SdImportTest::testTdf149124()
CPPUNIT_ASSERT_EQUAL(sal_Int32(2), nStartGlueId);
sal_Int32 nEndGlueId = xStandardConnector->getPropertyValue("EndGluePointIndex").get<sal_Int32>();
CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nEndGlueId);
+}
+
+void SdImportTest::testTdf148965()
+{
+ // Set the system user interface to Hungarian
+ SvtSysLocaleOptions aOptions;
+ OUString sUIConfigString = aOptions.GetLanguageTag().getBcp47();
+ aOptions.SetUILocaleConfigString("hu-HU");
+ aOptions.Commit();
+ comphelper::ScopeGuard g([&aOptions, &sUIConfigString] {
+ aOptions.SetUILocaleConfigString(sUIConfigString);
+ aOptions.Commit();
+ });
+
+ sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"sd/qa/unit/data/pptx/tdf148965.pptx"), PPTX);
+ uno::Reference<beans::XPropertySet> xShape1(getShapeFromPage(0, 1, xDocShRef));
+ uno::Reference<document::XEventsSupplier> xEventsSupplier1(xShape1, uno::UNO_QUERY);
+ uno::Reference<container::XNameAccess> xEvents1(xEventsSupplier1->getEvents());
+ uno::Sequence<beans::PropertyValue> props1;
+ xEvents1->getByName("OnClick") >>= props1;
+ comphelper::SequenceAsHashMap map1(props1);
+ auto iter1(map1.find("Bookmark"));
+ CPPUNIT_ASSERT_EQUAL(OUString("page1"), iter1->second.get<OUString>());
+
+ uno::Reference<beans::XPropertySet> xShape2(getShapeFromPage(1, 1, xDocShRef));
+ uno::Reference<document::XEventsSupplier> xEventsSupplier2(xShape2, uno::UNO_QUERY);
+ uno::Reference<container::XNameAccess> xEvents2(xEventsSupplier2->getEvents());
+ uno::Sequence<beans::PropertyValue> props2;
+ xEvents2->getByName("OnClick") >>= props2;
+ comphelper::SequenceAsHashMap map2(props2);
+ auto iter2(map2.find("Bookmark"));
+ CPPUNIT_ASSERT_EQUAL(OUString("page3"), iter2->second.get<OUString>());
xDocShRef->DoClose();
}