summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorGülşah Köse <gulsah.kose@collabora.com>2022-03-24 11:19:03 +0300
committerAndras Timar <andras.timar@collabora.com>2022-03-25 15:55:12 +0100
commit2f595bed2f77d373078fece3bced49a5ed0ee526 (patch)
tree6d3132ac1c1b373847f1f9a0046cd29a405e2613 /sd
parent797fe4c388683524ee496647590ab1861d3d1877 (diff)
tdf#96389 Use default tab stop value of MSO for pptx import.
Change-Id: Ib3dde68c672b44d8b60f121fb0e637942b5986b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131698 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132103
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/pptx/deftabstop.pptxbin0 -> 26783 bytes
-rw-r--r--sd/qa/unit/import-tests2.cxx14
-rw-r--r--sd/source/ui/docshell/docshel4.cxx12
3 files changed, 26 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/deftabstop.pptx b/sd/qa/unit/data/pptx/deftabstop.pptx
new file mode 100644
index 000000000000..5cfe71794446
--- /dev/null
+++ b/sd/qa/unit/data/pptx/deftabstop.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index b62573ec354b..3ecbec200c6e 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -172,6 +172,7 @@ public:
void testTdf103347();
void testHyperlinksOnShapes();
void testTdf112209();
+ void testDefaultTabStop();
CPPUNIT_TEST_SUITE(SdImportTest2);
@@ -236,6 +237,7 @@ public:
CPPUNIT_TEST(testTdf103347);
CPPUNIT_TEST(testHyperlinksOnShapes);
CPPUNIT_TEST(testTdf112209);
+ CPPUNIT_TEST(testDefaultTabStop);
CPPUNIT_TEST_SUITE_END();
};
@@ -1934,6 +1936,18 @@ void SdImportTest2::testTdf112209()
xDocShRef->DoClose();
}
+void SdImportTest2::testDefaultTabStop()
+{
+ sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/deftabstop.pptx"), PPTX);
+ SdDrawDocument* pDoc = xDocShRef->GetDoc();
+ sal_Int32 nDefTab = pDoc->GetDefaultTabulator();
+
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2540), nDefTab);
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest2);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index 622d35c7f1eb..b57b06bce617 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -399,6 +399,18 @@ bool DrawDocShell::ImportFrom(SfxMedium &rMedium,
mpDoc->SetSummationOfParagraphs();
}
+ if (aFilterName == "Impress MS PowerPoint 2007 XML" ||
+ aFilterName == "Impress MS PowerPoint 2007 XML AutoPlay" ||
+ aFilterName == "Impress MS PowerPoint 2007 XML VBA" ||
+ aFilterName == "Impress Office Open XML")
+ {
+ // We need to be able to set the default tab size for each text object.
+ // This is possible at the moment only for the whole document. See
+ // TextParagraphPropertiesContext constructor. So default tab width
+ // of the LibreOffice is 1270 but MSO is 2540 on general settings.
+ mpDoc->SetDefaultTabulator( 2540 );
+ }
+
const bool bRet = SfxObjectShell::ImportFrom(rMedium, xInsertPosition);
SfxItemSet* pSet = rMedium.GetItemSet();