[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sd/qa sd/source
sd/qa/unit/data/pptx/deftabstop.pptx |binary sd/qa/unit/import-tests2.cxx | 14 ++ sd/source/ui/docshell/docshel4.cxx | 12 3 files changed, 26 insertions(+) New commits: commit 0d65d4c6b7272f4ca8e413e025db234e5c8c7722 Author: Gülşah Köse AuthorDate: Thu Mar 24 11:19:03 2022 +0300 Commit: Gülşah Köse CommitDate: Fri Mar 25 12:57:46 2022 +0100 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 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132103 diff --git a/sd/qa/unit/data/pptx/deftabstop.pptx b/sd/qa/unit/data/pptx/deftabstop.pptx new file mode 100644 index ..5cfe71794446 Binary files /dev/null and b/sd/qa/unit/data/pptx/deftabstop.pptx 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 , 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();
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sd/qa sd/source
sd/qa/unit/uiimpress.cxx | 31 +++ sd/source/ui/view/drviewse.cxx |4 ++-- 2 files changed, 33 insertions(+), 2 deletions(-) New commits: commit 7c81ce180ddb48cc031be28ef57581d1955d9f1b Author: Andreas Heinisch AuthorDate: Mon Feb 28 18:40:30 2022 +0100 Commit: Xisco Fauli CommitDate: Mon Mar 7 11:27:47 2022 +0100 tdf#38669 - Create the key event using a Unicode character Instead of using a plain char, create a key event using a Unicode character, otherwise the key event creates texts including rectangles or wrong characters. Change-Id: I9ec0d64998927d54eb3ae90a192c3b28e235f56d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130721 Tested-by: Jenkins Reviewed-by: Andreas Heinisch (cherry picked from commit 9d25f86236885c40662bcd24517f231688361e8c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131018 Reviewed-by: Xisco Fauli diff --git a/sd/qa/unit/uiimpress.cxx b/sd/qa/unit/uiimpress.cxx index 68786fac3698..286672341a3b 100644 --- a/sd/qa/unit/uiimpress.cxx +++ b/sd/qa/unit/uiimpress.cxx @@ -745,6 +745,37 @@ CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testSpellOnlineParameter) CPPUNIT_ASSERT_EQUAL(!bSet, pImpressDocument->GetDoc()->GetOnlineSpell()); } +CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf38669) +{ +mxComponent = loadFromDesktop("private:factory/simpress", + "com.sun.star.presentation.PresentationDocument"); +auto pImpressDocument = dynamic_cast(mxComponent.get()); +CPPUNIT_ASSERT(pImpressDocument); + +// Insert shape with ctrl key +uno::Sequence aArgs( +comphelper::InitPropertySequence({ { "KeyModifier", uno::makeAny(KEY_MOD1) } })); +dispatchCommand(mxComponent, ".uno:BasicShapes.rectangle", aArgs); +Scheduler::ProcessEventsToIdle(); + +uno::Reference xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); +uno::Reference xDraws = xDrawPagesSupplier->getDrawPages(); +CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xDraws->getCount()); + +// Insert an UTF-8 character (176 is the code of the degree sign, i.e., '°') +pImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 176, 0); +pImpressDocument->postKeyEvent(LOK_KEYEVENT_KEYUP, 176, 0); +Scheduler::ProcessEventsToIdle(); + +uno::Reference xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), + uno::UNO_QUERY); +uno::Reference xShape(xDrawPage->getByIndex(2), uno::UNO_QUERY); +// Without the fix in place, this test would have failed with: +// - Expected: ° +// - Actual : ㅀ +CPPUNIT_ASSERT_EQUAL(OUString(u"°"), xShape->getString()); +} + CPPUNIT_TEST_FIXTURE(SdUiImpressTest, testTdf123841) { // To check if selecting unfilled rectangle produces unfilled rectangle diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx index f0e76ec6a32f..429ae789856f 100644 --- a/sd/source/ui/view/drviewse.cxx +++ b/sd/source/ui/view/drviewse.cxx @@ -125,9 +125,9 @@ static void ImpAddPrintableCharactersToTextEdit(SfxRequest const & rReq, ::sd::V { for(sal_Int32 a(0); a < aInputString.getLength(); a++) { -char aChar = static_cast(aInputString[a]); vcl::KeyCode aKeyCode; -KeyEvent aKeyEvent(aChar, aKeyCode); +// tdf#38669 - create the key event using a Unicode character +KeyEvent aKeyEvent(aInputString[a], aKeyCode); // add actual character pOLV->PostKeyEvent(aKeyEvent);
[Libreoffice-commits] core.git: Branch 'libreoffice-7-3' - sd/qa sd/source
sd/qa/unit/export-tests-ooxml1.cxx | 14 ++ sd/source/filter/eppt/pptx-epptooxml.cxx | 10 +- 2 files changed, 23 insertions(+), 1 deletion(-) New commits: commit 554b01c9f91fcc6d8c188ef3dc511b4d9c18b7e7 Author: Tibor Nagy AuthorDate: Mon Jan 3 17:18:57 2022 +0100 Commit: Xisco Fauli CommitDate: Tue Feb 1 10:58:21 2022 +0100 tdf#130165 PPTX export: fix master objects visible property Follow-up to commit 4574a1ea408c2ac30042dca32d02207ec7add4da "tdf#146223 PPTX import: fix master objects visible property". Change-Id: I34e6132837d6c84974f8446978c59226a9a7d2d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127908 Tested-by: Jenkins Tested-by: László Németh Reviewed-by: László Németh (cherry picked from commit b1865ecd67a4ea791ac24e3234d4ad3d2be9d1e3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129247 Reviewed-by: Xisco Fauli diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx index 9efb79ae9cf1..3b50dcf0b793 100644 --- a/sd/qa/unit/export-tests-ooxml1.cxx +++ b/sd/qa/unit/export-tests-ooxml1.cxx @@ -61,6 +61,7 @@ using namespace css; class SdOOXMLExportTest1 : public SdModelTestBaseXML { public: +void testTdf130165(); void testTdf124781(); void testTdf144914(); void testTdf124232(); @@ -128,6 +129,7 @@ public: CPPUNIT_TEST_SUITE(SdOOXMLExportTest1); +CPPUNIT_TEST(testTdf130165); CPPUNIT_TEST(testTdf124781); CPPUNIT_TEST(testTdf144914); CPPUNIT_TEST(testTdf124232); @@ -222,6 +224,18 @@ void checkFontAttributes( const SdrTextObj* pObj, ItemValue nVal, sal_uInt32 nId } +void SdOOXMLExportTest1::testTdf130165() +{ +sd::DrawDocShellRef xDocShRef += loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/tdf146223.pptx"), PPTX); +utl::TempFile tempFile; +xDocShRef = saveAndReload(xDocShRef.get(), PPTX, ); +xDocShRef->DoClose(); + +xmlDocUniquePtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml"); +assertXPath(pXmlDoc, "/p:sld", "showMasterSp", "0"); +} + void SdOOXMLExportTest1::testTdf124781() { sd::DrawDocShellRef xDocShRef diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index 1e175d8bc564..0bc49e4a63ac 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -1361,6 +1361,7 @@ void PowerPointExport::ImplWriteSlide(sal_uInt32 nPageNum, sal_uInt32 nMasterNum mpSlidesFSArray[ nPageNum ] = pFS; const char* pShow = nullptr; +const char* pShowMasterShape = nullptr; if (ImplGetPropertyValue(mXPagePropSet, "Visible")) { @@ -1369,7 +1370,14 @@ void PowerPointExport::ImplWriteSlide(sal_uInt32 nPageNum, sal_uInt32 nMasterNum pShow = "0"; } -pFS->startElementNS(XML_p, XML_sld, PNMSS, XML_show, pShow); +if (ImplGetPropertyValue(mXPagePropSet, "IsBackgroundObjectsVisible")) +{ +bool bShowMasterShape(false); +if ((mAny >>= bShowMasterShape) && !bShowMasterShape) +pShowMasterShape = "0"; +} + +pFS->startElementNS(XML_p, XML_sld, PNMSS, XML_show, pShow, XML_showMasterSp, pShowMasterShape); pFS->startElementNS(XML_p, XML_cSld);