oox/source/export/shapes.cxx | 10 ++++++ sc/qa/uitest/autofilter2/tdf151152.py | 52 ++++++++++++++++++++++++++++++++++ sc/source/ui/view/gridwin.cxx | 14 +++++++-- sd/qa/unit/data/pptx/ole-emf_min.pptx |binary sd/qa/unit/export-tests-ooxml3.cxx | 11 +++++++ 5 files changed, 84 insertions(+), 3 deletions(-)
New commits: commit b3ed83265c1ba0c6d15be0bafd6d16b9a87cc64a Author: Tünde Tóth <toth.tu...@nisz.hu> AuthorDate: Tue Dec 13 11:08:52 2022 +0100 Commit: László Németh <nem...@numbertext.org> CommitDate: Tue Dec 20 07:50:25 2022 +0000 tdf#152436 PPTX export regression: fix lost shape at missing object If the object is missing, it's still possible to keep its shape by exporting its preview graphic, as before the regression. Regression from commit adc042f95d3dbd65b778260025d59283146916e5 "tdf#124333 PPTX import: fix Z-order of embedded OLE objects". Change-Id: Ib2fd00f53a80572cfc9acaefea55015780c57da8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144040 Tested-by: László Németh <nem...@numbertext.org> Reviewed-by: László Németh <nem...@numbertext.org> (cherry picked from commit 907da02bf8b33c080538731864225b3c44251328) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144486 Tested-by: Jenkins diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 70466d17fdb1..4b41f56d79cd 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -2537,6 +2537,16 @@ ShapeExport& ShapeExport::WriteOLE2Shape( const Reference< XShape >& xShape ) if (!xObj.is()) { SAL_WARN("oox.shape", "ShapeExport::WriteOLE2Shape: no object"); + + // tdf#152436 Export the preview graphic of the object if the object is missing. + SdrObject* pSdrOLE2(SdrObject::getSdrObjectFromXShape(xShape)); + if (auto pOle2Obj = dynamic_cast<SdrOle2Obj*>(pSdrOLE2)) + { + const Graphic* pGraphic = pOle2Obj->GetGraphic(); + if (pGraphic) + WriteGraphicObjectShapePart(xShape, pGraphic); + } + return *this; } diff --git a/sd/qa/unit/data/pptx/ole-emf_min.pptx b/sd/qa/unit/data/pptx/ole-emf_min.pptx new file mode 100644 index 000000000000..0f97208fbebc Binary files /dev/null and b/sd/qa/unit/data/pptx/ole-emf_min.pptx differ diff --git a/sd/qa/unit/export-tests-ooxml3.cxx b/sd/qa/unit/export-tests-ooxml3.cxx index 2e6a600ec686..309709317821 100644 --- a/sd/qa/unit/export-tests-ooxml3.cxx +++ b/sd/qa/unit/export-tests-ooxml3.cxx @@ -130,6 +130,7 @@ public: void testTdf124333(); void testAutofittedTextboxIndent(); void testTdf151622_oleIcon(); + void testTdf152436(); CPPUNIT_TEST_SUITE(SdOOXMLExportTest3); @@ -221,6 +222,7 @@ public: CPPUNIT_TEST(testTdf124333); CPPUNIT_TEST(testAutofittedTextboxIndent); CPPUNIT_TEST(testTdf151622_oleIcon); + CPPUNIT_TEST(testTdf152436); CPPUNIT_TEST_SUITE_END(); virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override @@ -2105,6 +2107,15 @@ void SdOOXMLExportTest3::testTdf151622_oleIcon() assertXPath(pXml, "//p:oleObj", "showAsIcon", "1"); } +void SdOOXMLExportTest3::testTdf152436() +{ + createSdImpressDoc("pptx/ole-emf_min.pptx"); + saveAndReload("Impress Office Open XML"); + + // Check number of shapes after export. + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), getPage(0)->getCount()); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdOOXMLExportTest3); CPPUNIT_PLUGIN_IMPLEMENT(); commit 438192f4947669e6c514bc25ce95d9eba38ce39c Author: Tünde Tóth <toth.tu...@nisz.hu> AuthorDate: Wed Dec 7 13:34:37 2022 +0100 Commit: László Németh <nem...@numbertext.org> CommitDate: Tue Dec 20 07:50:12 2022 +0000 tdf#151152 sc filter: fix string entry checking When a column was filtered for values that included 0, the all string entries were always checked in the Autofilter dropdown (because their conversion to number, i.e. value 0 was used to check their existence in the filtered values instead of their string value). Regression from commit f6b143a57d9bd8f5d7b29febcb4e01ee1eb2ff1d "tdf#142910 sc filter: fix "greater than" or "smaller than" etc". Change-Id: Ib659aba9d6f3d6bc3557547b1a27963f51e3eca3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143777 Tested-by: László Németh <nem...@numbertext.org> Reviewed-by: László Németh <nem...@numbertext.org> (cherry picked from commit 2298087db28ee1b4251cac6e12c1d4806b395a1e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144479 Tested-by: Jenkins diff --git a/sc/qa/uitest/autofilter2/tdf151152.py b/sc/qa/uitest/autofilter2/tdf151152.py new file mode 100644 index 000000000000..6971096e9844 --- /dev/null +++ b/sc/qa/uitest/autofilter2/tdf151152.py @@ -0,0 +1,52 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +from uitest.framework import UITestCase +from uitest.uihelper.calc import enter_text_to_cell +from uitest.uihelper.common import get_state_as_dict +from libreoffice.uno.propertyvalue import mkPropertyValues + +#Bug 151152 - Autofilter checkbox status is wrong when I deselect one item, click OK, then click on the dropdown again (2nd case) + +class tdf151152(UITestCase): + def test_tdf151152(self): + with self.ui_test.create_doc_in_start_center("calc"): + calcDoc = self.xUITest.getTopFocusWindow() + gridwin = calcDoc.getChild("grid_window") + + enter_text_to_cell(gridwin, "A1", "A") + enter_text_to_cell(gridwin, "A2", "0") + enter_text_to_cell(gridwin, "A3", "a") + enter_text_to_cell(gridwin, "A4", "b") + + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"})) + + self.xUITest.executeCommand(".uno:DataFilterAutoFilter") + + gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"})) + xFloatWindow = self.xUITest.getFloatWindow() + xCheckListMenu = xFloatWindow.getChild("FilterDropDown") + xList = xCheckListMenu.getChild("check_list_box") + xEntry = xList.getChild("1") + xEntry.executeAction("CLICK", tuple()) + + xOkButton = xFloatWindow.getChild("ok") + xOkButton.executeAction("CLICK", tuple()) + + gridwin.executeAction("LAUNCH", mkPropertyValues({"AUTOFILTER": "", "COL": "0", "ROW": "0"})) + xFloatWindow = self.xUITest.getFloatWindow() + xCheckListMenu = xFloatWindow.getChild("FilterDropDown") + xList = xCheckListMenu.getChild("check_list_box") + self.assertEqual(3, len(xList.getChildren())) + self.assertEqual('true', get_state_as_dict(xList.getChild('0'))['IsChecked']) + self.assertEqual('false', get_state_as_dict(xList.getChild('1'))['IsChecked']) + self.assertEqual('true', get_state_as_dict(xList.getChild('2'))['IsChecked']) + xCloseBtn = xFloatWindow.getChild("cancel") + xCloseBtn.executeAction("CLICK", tuple()) + +# vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 3316afdf95e4..547338589298 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -963,10 +963,18 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW nRow) if (!aSelectedValue.empty() || !aSelectedString.empty()) { - if (aDoubleVal == aRDoubleVal) - bSelected = aSelectedValue.count(aDoubleVal) > 0 || aSelectedString.count(aStringVal) > 0; + if (rEntry.GetStringType() == ScTypedStrData::Value) + { + if (aDoubleVal == aRDoubleVal) + bSelected = aSelectedValue.count(aDoubleVal) > 0 + || aSelectedString.count(aStringVal) > 0; + else + bSelected = aSelectedValue.count(aDoubleVal) > 0 + || aSelectedValue.count(aRDoubleVal) > 0 + || aSelectedString.count(aStringVal) > 0; + } else - bSelected = aSelectedValue.count(aDoubleVal) > 0 || aSelectedValue.count(aRDoubleVal) > 0 || aSelectedString.count(aStringVal) > 0; + bSelected = aSelectedString.count(aStringVal) > 0; } if ( rEntry.IsDate() )