From 83733601124f611938c365426485d0001e1fe454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20N=C3=A9meth?= Date: Mon, 1 Jul 2024 17:08:36 +0200 Subject: [PATCH 001/232] tdf#160170 sw: test for fix overshrank lines with hyphenation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to commit ca540209a8c20a2734f180d4706d5153bdf64523 "tdf#160170 sw: fix overshrunk justified lines at hyphenation". Change-Id: Ia983e7f560b996f9b11b679d346186ad39e85598 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169840 Tested-by: Jenkins Reviewed-by: László Németh --- sw/qa/uitest/data/tdf160170.fodt | 205 ++++++++++++++++++++++++ sw/qa/uitest/writer_tests8/tdf160170.py | 85 ++++++++++ 2 files changed, 290 insertions(+) create mode 100644 sw/qa/uitest/data/tdf160170.fodt create mode 100644 sw/qa/uitest/writer_tests8/tdf160170.py diff --git a/sw/qa/uitest/data/tdf160170.fodt b/sw/qa/uitest/data/tdf160170.fodt new file mode 100644 index 000000000000..7b0a06d76f7b --- /dev/null +++ b/sw/qa/uitest/data/tdf160170.fodt @@ -0,0 +1,205 @@ + + + + 2024-07-01T14:21:09hu-HU2024-07-01T16:51:14.3614127733PT10M3SLibreOfficeDev/25.2.0.0.alpha0$Linux_X86_64 LibreOffice_project/0e3394f7123b6d63b91c1c55f227253f21cba34315.0000 + + + 0 + 0 + 23481 + 10659 + true + false + + + view2 + 7895 + 2988 + 0 + 0 + 23479 + 10657 + 0 + 1 + false + 214 + false + false + false + false + false + false + + + + + false + true + true + + false + 0 + false + true + true + true + true + false + 0 + true + false + true + true + false + true + true + true + true + true + false + true + true + false + true + false + false + true + true + true + true + true + false + false + false + true + true + high-resolution + true + 1327917 + false + true + false + + + true + + true + false + true + true + true + false + false + 0 + true + false + false + true + true + true + true + true + true + false + true + false + true + true + true + false + true + HP-LaserJet-P1005 + true + false + false + 0 + false + true + 4gH+/0hQLUxhc2VySmV0LVAxMDA1AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQ1VQUzpIUC1MYXNlckpldC1QMTAwNQAAAAAAAAAAAAAWAAMAvQAAAAAAAQAEAAhSAAAEdAAASm9iRGF0YSAxCnByaW50ZXI9SFAtTGFzZXJKZXQtUDEwMDUKb3JpZW50YXRpb249UG9ydHJhaXQKY29waWVzPTEKY29sbGF0ZT1mYWxzZQptYXJnaW5hZGp1c3RtZW50PTAsMCwnMCwwCmNvbG9yZGVwdGg9MjQKY29sb3JkZXZpY2U9MApQUERDb250ZXh0RGF0YQpQYWdlU2l6ZTpBNABJbnB1dFNsb3Q6QXV0bwBEdXBsZXg6Tm9uZQAAEgBDT01QQVRfRFVQTEVYX01PREUPAER1cGxleE1vZGU6Ok9mZgwAUFJJTlRFUl9OQU1FEQBIUC1MYXNlckpldC1QMTAwNQsARFJJVkVSX05BTUUWAENVUFM6SFAtTGFzZXJKZXQtUDEwMDU= + false + false + true + true + true + false + true + 1 + false + false + false + true + false + false + true + true + false + true + false + true + false + + false + 1400376 + true + false + false + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + placerat mauris enim, nec rutrum purus semper vel. Praesent tincidunt neque eu pellentesque pharetra. Fusce pellentesque est orci. + + + diff --git a/sw/qa/uitest/writer_tests8/tdf160170.py b/sw/qa/uitest/writer_tests8/tdf160170.py new file mode 100644 index 000000000000..69ead0d5b52e --- /dev/null +++ b/sw/qa/uitest/writer_tests8/tdf160170.py @@ -0,0 +1,85 @@ +# -*- 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.common import get_state_as_dict, get_url_for_data_file +from libreoffice.uno.propertyvalue import mkPropertyValues +from libreoffice.linguistic.linguservice import get_lingu_service_manager + +# handle tdf#160170 overshrank lines with smart justify and hyphenation + +class tdf160170(UITestCase): + def is_supported_locale(self, language, country): + xLinguServiceManager = get_lingu_service_manager(self.ui_test._xContext) + xHyphenator = xLinguServiceManager.getHyphenator() + locales = xHyphenator.getLocales() + for locale in locales: + if language != None: + if locale.Language != language: + continue + + if country != None: + if locale.Country != country: + continue + + # we found the correct combination + return True + + def set_custom_hyphenation(self): + with self.ui_test.execute_dialog_through_command(".uno:OptionsTreeDialog") as xDialog: + + xPages = xDialog.getChild("pages") + xLanguageEntry = xPages.getChild('2') # Language Settings + xLanguageEntry.executeAction("EXPAND", tuple()) + xxLanguageEntryWritingAidsEntry = xLanguageEntry.getChild('1') + xxLanguageEntryWritingAidsEntry.executeAction("SELECT", tuple()) # Writing Aids + + # add hyphenation "phare=tra" to the custom dictionary + # to solve the non-accessible hyphenation patterns for the test + + # Select an editable dictionary (list of Ignored words) + dictionaries = xDialog.getChild("lingudicts") + hasEditableDictionary = False + for i in dictionaries.getChildren(): + entry = dictionaries.getChild(i) + entry_label = get_state_as_dict(entry)["Text"] + if entry_label == "List of Ignored Words [All]": + hasEditableDictionary = True + entry.executeAction("SELECT", tuple()) # an editable user dictionary + break + + self.assertEqual(True, hasEditableDictionary) + + # open Edit dialog window + edit = xDialog.getChild("lingudictsedit") + with self.ui_test.execute_blocking_action(edit.executeAction, args=('CLICK', ()), close_button="close") as xEdit: + # write phare=tra into the input box + inputbox = xEdit.getChild("word") + inputbox.executeAction("TYPE", mkPropertyValues({"TEXT": "phare=tra"})) + add = xEdit.getChild("newreplace") + add.executeAction("CLICK", tuple()) + + def test_tdf160170(self): + supported_locale = self.is_supported_locale("en", "US") + if not supported_locale: + self.skipTest("no hyphenation patterns for en_US available") + + xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit') + with self.ui_test.load_file(get_url_for_data_file("tdf160170.fodt")) as writer_doc: + # we must not depend on the installed hyphenation patterns, + # so extend user dictionary temporarily with the hyphenation phare=tra + self.set_custom_hyphenation() + xToolkit.processEventsToIdle() + # delete the text of the first line + self.xUITest.executeCommand(".uno:GoToEndOfLine") + self.xUITest.executeCommand('.uno:StartOfDocumentSel') + self.xUITest.executeCommand('.uno:Delete') + paragraphs = writer_doc.Text.createEnumeration() + para1 = paragraphs.nextElement() + # This was " pellentesque est orvi.", i.e. too much shrinking + self.assertEqual(" Fusce pellentesque est orci.", para1.String) From c6d7b7fa686b742c6ffef42aa6cc280358babe0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20N=C3=A9meth?= Date: Mon, 1 Jul 2024 17:54:40 +0200 Subject: [PATCH 002/232] tdf#159102 sw: enable unit test again with extended test document MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It seems, incomplete document settings resulted broken unit testing on some platforms, so complete the test document with the removed document settings, and enable the test again. This reverts also commit 1b83ebf42c535528b73baac2407b347f19070d07 "disabling UITest tdf159102". Change-Id: I53f008a096aa209fb2c634e7e2464a1a4acbab71 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169842 Tested-by: Jenkins Reviewed-by: László Németh --- sw/qa/uitest/data/tdf159102.fodt | 157 +++++++++++++++++++++--- sw/qa/uitest/writer_tests8/tdf159102.py | 47 ++++--- 2 files changed, 166 insertions(+), 38 deletions(-) diff --git a/sw/qa/uitest/data/tdf159102.fodt b/sw/qa/uitest/data/tdf159102.fodt index dfe9fc18872b..7ef0765170bb 100644 --- a/sw/qa/uitest/data/tdf159102.fodt +++ b/sw/qa/uitest/data/tdf159102.fodt @@ -1,20 +1,149 @@ + LibreOfficeDev/25.2.0.0.alpha0$Linux_X86_64 LibreOffice_project/0e3394f7123b6d63b91c1c55f227253f21cba343 + + 0 + 0 + 0 + 0 + true + false + - true + false + true + true + + false + 0 + false + true + false + true + false + true + 0 + true + false + false + false + true + false + true + false + false + false + false + true + true + false + false + false + false + false + false + false + true + false + false + false + false + false + false high-resolution + true + 1428728 + false + false + false + + + true + + false + false + false + true + true + true + false + 0 + true + false + true + false + true + false + false + true + true + false + false + false + false + true + true + true + + false + false + true + 0 + false + true + + false + false + true + true + false + false + false + 1 + true + true + true + false + false + true + false + false + true + false + true + false + false + + true + 1428728 + true + false + false + true + + + + + + + + + + + + - - + + @@ -23,8 +152,8 @@ - - + + @@ -33,29 +162,29 @@ - + - - - - + - - + + + + + - venenatis, quis commodo dolor posuere. Curabitur dignissim sapien quis cursus egestas. - venenatis, quis commodo dolor posuere. Curabitur dignissim sapien quis cursus egestas. + venenatis, quis commodo dolor posuere. Curabitur dignissim sapien quis cursus egestas. + venenatis, quis commodo dolor posuere. Curabitur dignissim sapien quis cursus egestas. diff --git a/sw/qa/uitest/writer_tests8/tdf159102.py b/sw/qa/uitest/writer_tests8/tdf159102.py index aee1a0cc405c..104f2c9928c0 100644 --- a/sw/qa/uitest/writer_tests8/tdf159102.py +++ b/sw/qa/uitest/writer_tests8/tdf159102.py @@ -71,27 +71,26 @@ class tdf159102(UITestCase): if not supported_locale: self.skipTest("no hyphenation patterns for en_US available") -# disabling this because it fails on some machines -# xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit') -# with self.ui_test.load_file(get_url_for_data_file("tdf159102.fodt")) as writer_doc: -# # we must not depend on the installed hyphenation patterns, -# # so extend user dictionary temporarily with the hyphenation cur=sus and ege=stas -# self.set_custom_hyphenation() -# xToolkit.processEventsToIdle() -# # delete the text of the first line -# self.xUITest.executeCommand(".uno:GoToEndOfLine") -# self.xUITest.executeCommand('.uno:StartOfDocumentSel') -# self.xUITest.executeCommand('.uno:Delete') -# paragraphs = writer_doc.Text.createEnumeration() -# para1 = paragraphs.nextElement() -# # This was "stas.", i.e. too much shrinking -# self.assertEqual("sus egestas.", para1.String) -# -# # check next paragraph (containing different text portions) -# self.xUITest.executeCommand(".uno:GoDown") -# self.xUITest.executeCommand(".uno:GoToEndOfLine") -# self.xUITest.executeCommand('.uno:StartOfDocumentSel') -# self.xUITest.executeCommand('.uno:Delete') -# paragraphs = writer_doc.Text.createEnumeration() -# para1 = paragraphs.nextElement() -# self.assertEqual("sus egestas.", para1.String) + xToolkit = self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit') + with self.ui_test.load_file(get_url_for_data_file("tdf159102.fodt")) as writer_doc: + # we must not depend on the installed hyphenation patterns, + # so extend user dictionary temporarily with the hyphenation cur=sus and ege=stas + self.set_custom_hyphenation() + xToolkit.processEventsToIdle() + # delete the text of the first line + self.xUITest.executeCommand(".uno:GoToEndOfLine") + self.xUITest.executeCommand('.uno:StartOfDocumentSel') + self.xUITest.executeCommand('.uno:Delete') + paragraphs = writer_doc.Text.createEnumeration() + para1 = paragraphs.nextElement() + # This was "stas.", i.e. too much shrinking + self.assertEqual("sus egestas.", para1.String) + + # check next paragraph (containing different text portions) + self.xUITest.executeCommand(".uno:GoDown") + self.xUITest.executeCommand(".uno:GoToEndOfLine") + self.xUITest.executeCommand('.uno:StartOfDocumentSel') + self.xUITest.executeCommand('.uno:Delete') + paragraphs = writer_doc.Text.createEnumeration() + para1 = paragraphs.nextElement() + self.assertEqual("sus egestas.", para1.String) From 05041641da82fc0382503195ae9bdeb5182f764b Mon Sep 17 00:00:00 2001 From: Tibor Nagy Date: Mon, 1 Jul 2024 13:59:52 +0200 Subject: [PATCH 003/232] tdf#157172 tdf#157460 PPTX import: fix connectors adjustment values Change-Id: Ie95ccd5bcd4d5c3f9c45c7dcc4f88acc0c9438aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169830 Tested-by: Jenkins Reviewed-by: Nagy Tibor --- include/oox/ppt/slidepersist.hxx | 4 +- oox/qa/unit/data/curvedConnectors.pptx | Bin 0 -> 35029 bytes oox/qa/unit/data/elbowConnectors.pptx | Bin 0 -> 34608 bytes .../qa/unit/data}/standardConnectors.pptx | Bin oox/qa/unit/shape.cxx | 81 ++++ oox/source/ppt/slidepersist.cxx | 403 +++++++----------- sd/qa/unit/import-tests.cxx | 30 +- 7 files changed, 228 insertions(+), 290 deletions(-) create mode 100644 oox/qa/unit/data/curvedConnectors.pptx create mode 100644 oox/qa/unit/data/elbowConnectors.pptx rename {sd/qa/unit/data/pptx => oox/qa/unit/data}/standardConnectors.pptx (100%) diff --git a/include/oox/ppt/slidepersist.hxx b/include/oox/ppt/slidepersist.hxx index 0112a67913e7..88d73d0da3ba 100644 --- a/include/oox/ppt/slidepersist.hxx +++ b/include/oox/ppt/slidepersist.hxx @@ -125,7 +125,7 @@ public: CommentList& getCommentsList() { return maCommentsList; } CommentAuthorList& getCommentAuthors() { return maCommentAuthors; } - void createConnectorShapeConnection(); + void createConnectorShapeConnection(oox::drawingml::ShapePtr& pConnector); private: OUString maPath; @@ -158,8 +158,6 @@ private: // slide comments CommentList maCommentsList; CommentAuthorList maCommentAuthors; - - std::vector maConnectorShapeId; }; } diff --git a/oox/qa/unit/data/curvedConnectors.pptx b/oox/qa/unit/data/curvedConnectors.pptx new file mode 100644 index 0000000000000000000000000000000000000000..a961aed034448c8ba6d52526e721f75dacac35d9 GIT binary patch literal 35029 zcmeFYQ*@0?3jqFJ|Noxn>Db2pbX$TI;rXD*RPox%NCcaX%e(P%%~$t(L!`p2>_!iR7zl2=Mz4a z46^!&QGd{H#CS^edGnm?Mh_)8R{o|&BrMJnTZ*PTL`4&!A_0Tq8tHM|5EFiuNWL|I zS(m2uthxlmyo&a*z9uZApI0(Y0Eyt zV|uv}Mh)VML}enX2W+mx^=$pVba)LD??A$DqoZ8X}%Yi9b zYI&8O8AEYpZb=1X+VrA*G0ftqi8aFIK6QV#oK$D_r$~XTStFQjE`}uLk-b&XIP-Q< zbI+*PvFH}0C=M^YU_G18=-xdp*dgaHiBaoj7o!_s-7V$bKCv#nu7z_?BPAAxBW#+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::com::sun::star; @@ -91,6 +92,86 @@ uno::Reference OoxShapeTest::getShapeByName(std::u16string_view return xRet; } +CPPUNIT_TEST_FIXTURE(OoxShapeTest, testElbowConnectors) +{ + loadFromFile(u"elbowConnectors.pptx"); + + sal_Int32 nEdgeLineDelta; + uno::Reference xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), + uno::UNO_QUERY); + + uno::Reference xShape1(xDrawPage->getByIndex(2), uno::UNO_QUERY); + uno::Reference xShapeProps1(xShape1, uno::UNO_QUERY); + xShapeProps1->getPropertyValue(UNO_NAME_EDGELINE1DELTA) >>= nEdgeLineDelta; + CPPUNIT_ASSERT_EQUAL(sal_Int32(-2756), nEdgeLineDelta); + + uno::Reference xShape2(xDrawPage->getByIndex(5), uno::UNO_QUERY); + uno::Reference xShapeProps2(xShape2, uno::UNO_QUERY); + xShapeProps2->getPropertyValue(UNO_NAME_EDGELINE1DELTA) >>= nEdgeLineDelta; + CPPUNIT_ASSERT_EQUAL(sal_Int32(-805), nEdgeLineDelta); +} + +CPPUNIT_TEST_FIXTURE(OoxShapeTest, testCurvedConnectors) +{ + loadFromFile(u"curvedConnectors.pptx"); + + sal_Int32 nEdgeLineDelta; + uno::Reference xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), + uno::UNO_QUERY); + + uno::Reference xShape1(xDrawPage->getByIndex(2), uno::UNO_QUERY); + uno::Reference xShapeProps1(xShape1, uno::UNO_QUERY); + xShapeProps1->getPropertyValue(UNO_NAME_EDGELINE1DELTA) >>= nEdgeLineDelta; + CPPUNIT_ASSERT_EQUAL(sal_Int32(-2364), nEdgeLineDelta); + xShapeProps1->getPropertyValue(UNO_NAME_EDGELINE2DELTA) >>= nEdgeLineDelta; + CPPUNIT_ASSERT_EQUAL(sal_Int32(4250), nEdgeLineDelta); + xShapeProps1->getPropertyValue(UNO_NAME_EDGELINE3DELTA) >>= nEdgeLineDelta; + CPPUNIT_ASSERT_EQUAL(sal_Int32(2051), nEdgeLineDelta); + + uno::Reference xShape2(xDrawPage->getByIndex(5), uno::UNO_QUERY); + uno::Reference xShapeProps2(xShape2, uno::UNO_QUERY); + xShapeProps2->getPropertyValue(UNO_NAME_EDGELINE1DELTA) >>= nEdgeLineDelta; + CPPUNIT_ASSERT_EQUAL(sal_Int32(3019), nEdgeLineDelta); +} + +CPPUNIT_TEST_FIXTURE(OoxShapeTest, testStandardConnectors) +{ + loadFromFile(u"standardConnectors.pptx"); + + uno::Reference xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), + uno::UNO_QUERY); + + sal_Int32 aEdgeValue[] = { -1352, -2457, 2402, // bentConnector5 + 3977, 0, 0, // bentConnector3 + -2899, 0, 0, // bentConnector3 + -1260, 4612, 0, // bentConnector4 + -1431, -2642, 0, // bentConnector4 + 3831, 3438, -1578 }; // bentConnector5 + sal_Int32 nCount = 0; + sal_Int32 nEdgeLineDelta; + for (size_t i = 0; i < 10; i++) + { + uno::Reference xShape(xDrawPage->getByIndex(i), uno::UNO_QUERY); + uno::Reference xShapeProps(xShape, uno::UNO_QUERY); + bool bConnector = xShapeProps->getPropertySetInfo()->hasPropertyByName(u"EdgeKind"_ustr); + if (bConnector) + { + xShapeProps->getPropertyValue(UNO_NAME_EDGELINE1DELTA) >>= nEdgeLineDelta; + CPPUNIT_ASSERT_EQUAL(aEdgeValue[nCount], nEdgeLineDelta); + nCount++; + xShapeProps->getPropertyValue(UNO_NAME_EDGELINE2DELTA) >>= nEdgeLineDelta; + CPPUNIT_ASSERT_EQUAL(aEdgeValue[nCount], nEdgeLineDelta); + nCount++; + xShapeProps->getPropertyValue(UNO_NAME_EDGELINE3DELTA) >>= nEdgeLineDelta; + CPPUNIT_ASSERT_EQUAL(aEdgeValue[nCount], nEdgeLineDelta); + nCount++; + } + } +} + CPPUNIT_TEST_FIXTURE(OoxShapeTest, testGroupTransform) { loadFromFile(u"tdf141463_GroupTransform.pptx"); diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx index bc7fc3514a68..2164311a0bfb 100644 --- a/oox/source/ppt/slidepersist.cxx +++ b/oox/source/ppt/slidepersist.cxx @@ -34,6 +34,7 @@ #include #include #include +#include #include @@ -47,6 +48,7 @@ #include #include #include +#include using namespace ::com::sun::star; using namespace ::oox::core; @@ -134,6 +136,28 @@ sal_Int16 SlidePersist::getLayoutFromValueToken() const return nLayout; } +static void lcl_createShapeMap(oox::drawingml::ShapePtr rShapePtr, + oox::drawingml::ShapeIdMap& rShapeMap) +{ + std::vector& rChildren = rShapePtr->getChildren(); + if (!rChildren.empty()) + { + for (const auto& pIt : rChildren) + { + if (pIt->isConnectorShape()) + { + rShapeMap[pIt->getId()] = pIt; // add child itself + lcl_createShapeMap(pIt, rShapeMap); // and all its descendants + } + } + } + else + { + if(rShapePtr->isConnectorShape()) + rShapeMap[rShapePtr->getId()] = rShapePtr; + } +} + void SlidePersist::createXShapes( XmlFilterBase& rFilterBase ) { applyTextStyles( rFilterBase ); @@ -151,14 +175,36 @@ void SlidePersist::createXShapes( XmlFilterBase& rFilterBase ) if ( pPPTShape ) { pPPTShape->addShape( rFilterBase, *this, getTheme().get(), xShapes, aTransformation, &getShapeMap() ); - if (pPPTShape->isConnectorShape()) - maConnectorShapeId.push_back(pPPTShape->getId()); - if (!pPPTShape->getChildren().empty()) + + oox::drawingml::ShapeIdMap aConnectorShapeMap; + const auto& pIter = maShapeMap.find(pPPTShape->getId()); + if (pIter != maShapeMap.end()) + lcl_createShapeMap(pIter->second, aConnectorShapeMap); + + if(!aConnectorShapeMap.empty()) { - for (size_t i = 0; i < pPPTShape->getChildren().size(); i++) + for (auto& pIt : aConnectorShapeMap) { - if (pPPTShape->getChildren()[i]->isConnectorShape()) - maConnectorShapeId.push_back(pPPTShape->getChildren()[i]->getId()); + SdrObject* pObj = SdrObject::getSdrObjectFromXShape(pIt.second->getXShape()); + SdrModel& rModel(pObj->getSdrModelFromSdrObject()); + rModel.setLock(false); + + ConnectorHelper::applyConnections(pIt.second, getShapeMap()); + + if (pIt.second->getConnectorName() == u"bentConnector3"_ustr + || pIt.second->getConnectorName() == u"bentConnector4"_ustr + || pIt.second->getConnectorName() == u"bentConnector5"_ustr) + { + ConnectorHelper::applyBentHandleAdjustments(pIt.second); + } + else if (pIt.second->getConnectorName() == u"curvedConnector3"_ustr + || pIt.second->getConnectorName() == u"curvedConnector4"_ustr + || pIt.second->getConnectorName() == u"curvedConnector5"_ustr) + { + ConnectorHelper::applyCurvedHandleAdjustments(pIt.second); + } + else // bentConnector2 + createConnectorShapeConnection(pIt.second); } } } @@ -167,9 +213,6 @@ void SlidePersist::createXShapes( XmlFilterBase& rFilterBase ) } } - if (!maConnectorShapeId.empty()) - createConnectorShapeConnection(); - Reference< XAnimationNodeSupplier > xNodeSupplier( getPage(), UNO_QUERY); if( !xNodeSupplier.is() ) return; @@ -419,282 +462,126 @@ static void lcl_SetEdgeLineValue(uno::Reference& rXConnector, nEndA = lcl_GetAngle(xEndSp, aEndPt); } - // bentConnector3, bentConnector4, bentConnector5 - if (!rShapePtr->getConnectorAdjustments().empty()) + const OUString sConnectorName = rShapePtr->getConnectorName(); + if (sConnectorName == "bentConnector2") { - sal_Int32 nAdjustValue = 0; - for (size_t i = 0; i < rShapePtr->getConnectorAdjustments().size(); i++) + awt::Size aConnSize = rXConnector->getSize(); + if (xStartSp.is() || xEndSp.is()) { - bool bVertical = false; - if (xStartSp.is() || xEndSp.is()) - bVertical = xStartSp.is() ? ((nStartA == 90 || nStartA == 270) ? true : false) - : ((nEndA == 90 || nEndA == 270) ? true : false); - else + if (nStartA >= 0) { - sal_Int32 nAng = rShapePtr->getRotation() / 60000; - bVertical = (nAng == 90 || nAng == 270) ? true : false; - } - - if (i % 2 == 1) - bVertical = !bVertical; - - nAdjustValue = rShapePtr->getConnectorAdjustments()[i].toInt32(); - if (bVertical) - { - sal_Int32 nY = aStartPt.Y + ((nAdjustValue * (aEndPt.Y - aStartPt.Y)) / 100000); - if (xStartSp.is() && xEndSp.is()) + switch (nStartA) { - if (aS.Top() <= aE.Top()) - { - if (nStartA == 270 && i != 2) - nEdge = nY - aS.Top(); - else - { - if (aS.Bottom() < aE.Top() && nEndA != 90) - { - nEdge = nY - (aS.Bottom() + ((aE.Top() - aS.Bottom()) / 2)); - } - else - nEdge = nY - aE.Bottom(); - } - } - else - { - if (nStartA == 90 && i != 2) - nEdge = nY - aS.Bottom(); - else - { - if (aE.Bottom() < aS.Top() && nEndA != 270) - nEdge = nY - (aS.Top() + ((aE.Bottom() - aS.Top()) / 2)); - else - nEdge = nY - aE.Top(); - } - } - } - else if ((xStartSp.is() && !xEndSp.is()) || (!xStartSp.is() && xEndSp.is())) - { - if (aStartPt.Y < aEndPt.Y) - { - if (xStartSp.is()) - nEdge = (nStartA == 90) - ? nY - (aEndPt.Y - ((aEndPt.Y - aS.Bottom()) / 2)) - : nY - aS.Top(); - else - nEdge = (nEndA == 90) - ? nY - aE.Bottom() - : nY - (aStartPt.Y + ((aE.Top() - aStartPt.Y) / 2)); - } - else - { - if (xStartSp.is()) - nEdge = (nStartA == 90) ? nY - aS.Bottom() - : nY - (aEndPt.Y + ((aS.Top() - aEndPt.Y) / 2)); - else - nEdge = (nEndA == 90) - ? nY - (aStartPt.Y - ((aStartPt.Y - aE.Bottom()) / 2)) - : nY - aE.Top(); - } - } - else - { - nEdge = (aStartPt.Y < aEndPt.Y) - ? nY - (aStartPt.Y + (rXConnector->getSize().Height / 2)) - : nY - (aStartPt.Y - (rXConnector->getSize().Height / 2)); - } - } - else // Horizontal - { - sal_Int32 nX = aStartPt.X + ((nAdjustValue * (aEndPt.X - aStartPt.X)) / 100000); - if (xStartSp.is() && xEndSp.is()) - { - if (aS.Left() <= aE.Left()) - { - if (nStartA == 180 && i != 2) - nEdge = nX - aS.Left(); - else - { - if (aS.Right() < aE.Left() && nEndA != 0) - nEdge = nX - (aS.Right() + ((aE.Left() - aS.Right()) / 2)); - else - nEdge = nX - aE.Right(); - } - } - else - { - if (nStartA == 0 && i != 2) - nEdge = nX - aS.Right(); - else - { - if (aE.Right() < aS.Left() && nEndA != 180) - nEdge = nX - (aS.Left() + ((aE.Right() - aS.Left()) / 2)); - else - nEdge = nX - aE.Left(); - } - } - } - else if ((xStartSp.is() && !xEndSp.is()) || (!xStartSp.is() && xEndSp.is())) - { - if (aStartPt.X < aEndPt.X) - { - if (xStartSp.is()) - nEdge = (nStartA == 0) - ? nX - (aS.Right() + ((aEndPt.X - aS.Right()) / 2)) - : nX - aS.Left(); - else - nEdge = (nEndA == 0) - ? nX - aE.Right() - : nX - (aStartPt.X + ((aE.Left() - aStartPt.X) / 2)); - } - else - { - if (xStartSp.is()) - nEdge = (nStartA == 0) ? nX - aS.Right() - : nX - (aEndPt.X + ((aS.Left() - aEndPt.X) / 2)); - else - nEdge = (nEndA == 0) - ? nX - (aE.Right() + ((aStartPt.X - aE.Right()) / 2)) - : nX - aE.Left(); - } - } - else - { - nEdge = (aStartPt.X < aEndPt.X) - ? nX - (aStartPt.X + (rXConnector->getSize().Width / 2)) - : nX - (aStartPt.X - (rXConnector->getSize().Width / 2)); - } - } - xPropSet->setPropertyValue("EdgeLine" + OUString::number(i + 1) + "Delta", Any(nEdge)); - } - } - else - { - const OUString sConnectorName = rShapePtr->getConnectorName(); - if (sConnectorName == "bentConnector2") - { - awt::Size aConnSize = rXConnector->getSize(); - if (xStartSp.is() || xEndSp.is()) - { - if (nStartA >= 0) - { - switch (nStartA) - { - case 0: nEdge = aEndPt.X - aS.Right(); break; - case 180: nEdge = aEndPt.X - aS.Left(); break; - case 90: nEdge = aEndPt.Y - aS.Bottom(); break; - case 270: nEdge = aEndPt.Y - aS.Top(); break; - } - } else { - switch (nEndA) - { - case 0: nEdge = aStartPt.X - aE.Right(); break; - case 180: nEdge = aStartPt.X - aE.Left(); break; - case 90: nEdge = aStartPt.Y - aE.Bottom(); break; - case 270: nEdge = aStartPt.Y - aE.Top(); break; - } + case 0: nEdge = aEndPt.X - aS.Right(); break; + case 180: nEdge = aEndPt.X - aS.Left(); break; + case 90: nEdge = aEndPt.Y - aS.Bottom(); break; + case 270: nEdge = aEndPt.Y - aS.Top(); break; } } else { - bool bFlipH = rShapePtr->getFlipH(); - bool bFlipV = rShapePtr->getFlipV(); - sal_Int32 nConnectorAngle = rShapePtr->getRotation() / 60000; - if (aConnSize.Height < aConnSize.Width) + switch (nEndA) { - if ((nConnectorAngle == 90 && bFlipH && bFlipV) || (nConnectorAngle == 180) - || (nConnectorAngle == 270 && bFlipH)) - nEdge -= aConnSize.Width; - else - nEdge += aConnSize.Width; - } - else - { - if ((nConnectorAngle == 180 && bFlipV) || (nConnectorAngle == 270 && bFlipV) - || (nConnectorAngle == 90 && bFlipH && bFlipV) - || (nConnectorAngle == 0 && !bFlipV)) - nEdge -= aConnSize.Height; - else - nEdge += aConnSize.Height; + case 0: nEdge = aStartPt.X - aE.Right(); break; + case 180: nEdge = aStartPt.X - aE.Left(); break; + case 90: nEdge = aStartPt.Y - aE.Bottom(); break; + case 270: nEdge = aStartPt.Y - aE.Top(); break; } } - xPropSet->setPropertyValue(u"EdgeLine1Delta"_ustr, Any(nEdge / 2)); } + else + { + bool bFlipH = rShapePtr->getFlipH(); + bool bFlipV = rShapePtr->getFlipV(); + sal_Int32 nConnectorAngle = rShapePtr->getRotation() / 60000; + if (aConnSize.Height < aConnSize.Width) + { + if ((nConnectorAngle == 90 && bFlipH && bFlipV) || (nConnectorAngle == 180) + || (nConnectorAngle == 270 && bFlipH)) + nEdge -= aConnSize.Width; + else + nEdge += aConnSize.Width; + } + else + { + if ((nConnectorAngle == 180 && bFlipV) || (nConnectorAngle == 270 && bFlipV) + || (nConnectorAngle == 90 && bFlipH && bFlipV) + || (nConnectorAngle == 0 && !bFlipV)) + nEdge -= aConnSize.Height; + else + nEdge += aConnSize.Height; + } + } + xPropSet->setPropertyValue(u"EdgeLine1Delta"_ustr, Any(nEdge / 2)); } } // create connection between two shape with a connector shape. -void SlidePersist::createConnectorShapeConnection() +void SlidePersist::createConnectorShapeConnection(oox::drawingml::ShapePtr& pConnector) { - sal_Int32 nConnectorShapeCount = maConnectorShapeId.size(); - for (sal_Int32 i = 0; i < nConnectorShapeCount; i++) + oox::drawingml::ConnectorShapePropertiesList aConnectorShapeProperties + = pConnector->getConnectorShapeProperties(); + uno::Reference xConnector(pConnector->getXShape(), uno::UNO_QUERY); + uno::Reference xPropertySet(xConnector, uno::UNO_QUERY); + + if (xConnector.is()) { - const auto& pIt = maShapeMap.find(maConnectorShapeId[i]); - if (pIt == maShapeMap.end()) - continue; - oox::drawingml::ConnectorShapePropertiesList aConnectorShapeProperties - = pIt->second->getConnectorShapeProperties(); - uno::Reference xConnector(pIt->second->getXShape(), uno::UNO_QUERY); - uno::Reference xPropertySet(xConnector, uno::UNO_QUERY); - - if (xConnector.is()) + sal_Int32 nCount = aConnectorShapeProperties.size(); + for (sal_Int32 j = 0; j < nCount; j++) { - sal_Int32 nCount = aConnectorShapeProperties.size(); - for (sal_Int32 j = 0; j < nCount; j++) + OUString aDestShapeId = aConnectorShapeProperties[j].maDestShapeId; + const auto& pShape = maShapeMap.find(aDestShapeId); + if (pShape == maShapeMap.end()) + continue; + uno::Reference xShape(pShape->second->getXShape(), uno::UNO_QUERY); + if (xShape.is()) { - OUString aDestShapeId = aConnectorShapeProperties[j].maDestShapeId; - const auto& pShape = maShapeMap.find(aDestShapeId); - if (pShape == maShapeMap.end()) - continue; - uno::Reference xShape(pShape->second->getXShape(), uno::UNO_QUERY); - if (xShape.is()) + uno::Reference xSupplier(xShape, uno::UNO_QUERY); + css::uno::Reference xGluePoints( + xSupplier->getGluePoints(), uno::UNO_QUERY); + + sal_Int32 nCountGluePoints = xGluePoints->getIdentifiers().getLength(); + sal_Int32 nGlueId = aConnectorShapeProperties[j].mnDestGlueId; + + // The first 4 glue points belong to the bounding box. + if (nCountGluePoints > 4) + nGlueId += 4; + else { - uno::Reference xSupplier(xShape, uno::UNO_QUERY); - css::uno::Reference xGluePoints( - xSupplier->getGluePoints(), uno::UNO_QUERY); - - sal_Int32 nCountGluePoints = xGluePoints->getIdentifiers().getLength(); - sal_Int32 nGlueId = aConnectorShapeProperties[j].mnDestGlueId; - - // The first 4 glue points belong to the bounding box. - if (nCountGluePoints > 4) - nGlueId += 4; - else + bool bFlipH = pShape->second->getFlipH(); + bool bFlipV = pShape->second->getFlipV(); + if ((!bFlipH && !bFlipV) || (bFlipH && bFlipV)) { - bool bFlipH = pShape->second->getFlipH(); - bool bFlipV = pShape->second->getFlipV(); - if ((!bFlipH && !bFlipV) || (bFlipH && bFlipV)) - { - // change id of the left and right glue points of the bounding box (1 <-> 3) - if (nGlueId == 1) - nGlueId = 3; // Right - else if (nGlueId == 3) - nGlueId = 1; // Left - } - } - - bool bStart = aConnectorShapeProperties[j].mbStartShape; - if (bStart) - { - xPropertySet->setPropertyValue(u"StartShape"_ustr, uno::Any(xShape)); - xPropertySet->setPropertyValue(u"StartGluePointIndex"_ustr, uno::Any(nGlueId)); - } - else - { - xPropertySet->setPropertyValue(u"EndShape"_ustr, uno::Any(xShape)); - xPropertySet->setPropertyValue(u"EndGluePointIndex"_ustr, uno::Any(nGlueId)); + // change id of the left and right glue points of the bounding box (1 <-> 3) + if (nGlueId == 1) + nGlueId = 3; // Right + else if (nGlueId == 3) + nGlueId = 1; // Left } } - } - uno::Reference xPropInfo = xPropertySet->getPropertySetInfo(); - if (xPropInfo->hasPropertyByName(u"EdgeKind"_ustr)) - { - ConnectorType aConnectorType; - xPropertySet->getPropertyValue(u"EdgeKind"_ustr) >>= aConnectorType; - if (aConnectorType == ConnectorType_STANDARD) - lcl_SetEdgeLineValue(xConnector, pIt->second); + + bool bStart = aConnectorShapeProperties[j].mbStartShape; + if (bStart) + { + xPropertySet->setPropertyValue(u"StartShape"_ustr, uno::Any(xShape)); + xPropertySet->setPropertyValue(u"StartGluePointIndex"_ustr, uno::Any(nGlueId)); + } + else + { + xPropertySet->setPropertyValue(u"EndShape"_ustr, uno::Any(xShape)); + xPropertySet->setPropertyValue(u"EndGluePointIndex"_ustr, uno::Any(nGlueId)); + } } } + uno::Reference xPropInfo = xPropertySet->getPropertySetInfo(); + if (xPropInfo->hasPropertyByName(u"EdgeKind"_ustr)) + { + ConnectorType aConnectorType; + xPropertySet->getPropertyValue(u"EdgeKind"_ustr) >>= aConnectorType; + if (aConnectorType == ConnectorType_STANDARD) + lcl_SetEdgeLineValue(xConnector, pConnector); + } } - maConnectorShapeId.clear(); } } diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index d2ae920a0071..fd11a02fc24a 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -385,40 +385,12 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testTdf152434) CPPUNIT_ASSERT_EQUAL(size_t(1), pPage->GetObjCount()); } -CPPUNIT_TEST_FIXTURE(SdImportTest, testStandardConnectors) -{ - createSdImpressDoc("pptx/standardConnectors.pptx"); - - sal_Int32 aEdgeValue[] = { -1352, -2457, 3977, -2900, -1261, 4611, -1431, -2643, 3830, 3438 }; - - sal_Int32 nCount = 0; - sal_Int32 nEdgeLine = 0; - for (size_t i = 0; i < 10; i++) - { - uno::Reference xConnector(getShapeFromPage(i, 0)); - bool bConnector = xConnector->getPropertySetInfo()->hasPropertyByName(u"EdgeKind"_ustr); - if (bConnector) - { - nEdgeLine = xConnector->getPropertyValue(u"EdgeLine1Delta"_ustr).get(); - CPPUNIT_ASSERT_EQUAL(aEdgeValue[nCount], nEdgeLine); - nCount++; - - nEdgeLine = xConnector->getPropertyValue(u"EdgeLine2Delta"_ustr).get(); - if (nEdgeLine != 0) - { - CPPUNIT_ASSERT_EQUAL(aEdgeValue[nCount], nEdgeLine); - nCount++; - } - } - } -} - CPPUNIT_TEST_FIXTURE(SdImportTest, testConnectors) { createSdImpressDoc("pptx/connectors.pptx"); sal_Int32 aEdgeValue[] = { -1167, -1167, -1591, 1476, 1356, -1357, 1604, -1540, - 607, 1296, -1638, -1060, -522, 1578, -1291, 333 }; + 607, 1296, -1638, -1060, 2402, 3313, -1834, 333 }; sal_Int32 nCount = 0; for (size_t i = 0; i < 18; i++) From bff48f885e3aad560776a42e451a735ed6c72c57 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Mon, 1 Jul 2024 21:35:32 +0200 Subject: [PATCH 004/232] Revert "libxml2: upgrade to 2.13.1" This reverts commit 2b27f0eb5858a4fd296170fb7e4533e5fc7aa3e9. Reason for revert: JunitTest_unordf_complex fails Change-Id: I5c9b6ec454c46a737a7052cc8dd450044dd48495 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169817 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- download.lst | 6 +++--- external/libxml2/ExternalPackage_libxml2.mk | 2 +- external/libxml2/libxml2-XMLCALL-redefine.patch.0 | 8 ++++---- external/libxml2/libxml2-icu-sym.patch.0 | 8 ++++---- external/libxml2/libxml2-icu.patch.0 | 8 ++++---- external/redland/ExternalProject_raptor.mk | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/download.lst b/download.lst index 87ced0ddd036..9eb88235ade9 100644 --- a/download.lst +++ b/download.lst @@ -424,9 +424,9 @@ XMLSEC_TARBALL := xmlsec1-1.3.4.tar.gz # three static lines # so that git cherry-pick # will not run into conflicts -LIBXML_SHA256SUM := 25239263dc37f5f55a5393eff27b35f0b7d9ea4b2a7653310598ea8299e3b741 -LIBXML_VERSION_MICRO := 1 -LIBXML_TARBALL := libxml2-2.13.$(LIBXML_VERSION_MICRO).tar.xz +LIBXML_SHA256SUM := 43ad877b018bc63deb2468d71f95219c2fac196876ef36d1bee51d226173ec93 +LIBXML_VERSION_MICRO := 8 +LIBXML_TARBALL := libxml2-2.12.$(LIBXML_VERSION_MICRO).tar.xz # three static lines # so that git cherry-pick # will not run into conflicts diff --git a/external/libxml2/ExternalPackage_libxml2.mk b/external/libxml2/ExternalPackage_libxml2.mk index 17190c77fd18..799044575f9a 100644 --- a/external/libxml2/ExternalPackage_libxml2.mk +++ b/external/libxml2/ExternalPackage_libxml2.mk @@ -21,7 +21,7 @@ else # COM=MSC $(eval $(call gb_ExternalPackage_add_file,libxml2,$(LIBO_URE_LIB_FOLDER)/libxml2.dll,win32/bin.msvc/libxml2.dll)) endif else # OS!=WNT -$(eval $(call gb_ExternalPackage_add_file,libxml2,$(LIBO_URE_LIB_FOLDER)/libxml2.so.2,.libs/libxml2.so.2.13.$(LIBXML_VERSION_MICRO))) +$(eval $(call gb_ExternalPackage_add_file,libxml2,$(LIBO_URE_LIB_FOLDER)/libxml2.so.2,.libs/libxml2.so.2.12.$(LIBXML_VERSION_MICRO))) endif endif # DISABLE_DYNLOADING diff --git a/external/libxml2/libxml2-XMLCALL-redefine.patch.0 b/external/libxml2/libxml2-XMLCALL-redefine.patch.0 index 57d23d885943..d9ca23be7ce4 100644 --- a/external/libxml2/libxml2-XMLCALL-redefine.patch.0 +++ b/external/libxml2/libxml2-XMLCALL-redefine.patch.0 @@ -1,11 +1,11 @@ --- include/libxml/xmlexports.h 2023-05-24 12:48:46.179570708 +0100 +++ include/libxml/xmlexports.h 2023-05-24 12:48:56.563577488 +0100 -@@ -31,8 +31,6 @@ - #define XMLPUBVAR XMLPUBLIC extern +@@ -38,8 +38,6 @@ + /** DOC_DISABLE */ /* Compatibility */ -#define XMLCALL -#define XMLCDECL - #ifndef LIBXML_DLL_IMPORT - #define LIBXML_DLL_IMPORT XMLPUBVAR + #if !defined(LIBXML_DLL_IMPORT) + #define LIBXML_DLL_IMPORT XMLPUBVAR #endif diff --git a/external/libxml2/libxml2-icu-sym.patch.0 b/external/libxml2/libxml2-icu-sym.patch.0 index d89a1c4c544b..07676228da19 100644 --- a/external/libxml2/libxml2-icu-sym.patch.0 +++ b/external/libxml2/libxml2-icu-sym.patch.0 @@ -3,14 +3,14 @@ Find bundled ICU in workdir and use debug .libs when needed diff -up win32/Makefile.msvc.dt win32/Makefile.msvc --- win32/Makefile.msvc.dt 2014-07-18 19:00:23.372103963 +0200 +++ win32/Makefile.msvc 2014-07-18 19:01:39.347982929 +0200 -@@ -42,6 +42,7 @@ +@@ -46,6 +46,7 @@ CPPFLAGS = $(CPPFLAGS) /D "_REENTRANT" CC = cl.exe CFLAGS = /nologo /D "_WINDOWS" /D "_MBCS" /D "NOLIBTOOL" /W3 /wd4244 /wd4267 $(CRUNTIME) CFLAGS = $(CFLAGS) /I$(XML_SRCDIR) /I$(XML_SRCDIR)\include /I$(INCPREFIX) +CFLAGS = $(CFLAGS) /I$(WORKDIR)/UnpackedTarball/icu/source/i18n /I$(WORKDIR)/UnpackedTarball/icu/source/common - !if "$(WITH_THREADS)" == "ctls" - CFLAGS = $(CFLAGS) /D "XML_THREAD_LOCAL=__declspec(thread)" - !else if "$(WITH_THREADS)" == "posix" + !if "$(WITH_THREADS)" != "no" + CFLAGS = $(CFLAGS) /D "_REENTRANT" + !endif @@ -62,7 +63,9 @@ # The linker and its options. LD = link.exe diff --git a/external/libxml2/libxml2-icu.patch.0 b/external/libxml2/libxml2-icu.patch.0 index 85ce8b3aba2b..84197763f878 100644 --- a/external/libxml2/libxml2-icu.patch.0 +++ b/external/libxml2/libxml2-icu.patch.0 @@ -3,14 +3,14 @@ Find bundled ICU in workdir and use debug .libs when needed diff -up win32/Makefile.msvc.dt win32/Makefile.msvc --- win32/Makefile.msvc.dt 2014-07-18 19:00:23.372103963 +0200 +++ win32/Makefile.msvc 2014-07-18 19:01:39.347982929 +0200 -@@ -42,6 +42,7 @@ +@@ -45,6 +45,7 @@ CPPFLAGS = $(CPPFLAGS) /D "_REENTRANT" CC = cl.exe CFLAGS = /nologo /D "_WINDOWS" /D "_MBCS" /D "NOLIBTOOL" /W3 /wd4244 /wd4267 $(CRUNTIME) CFLAGS = $(CFLAGS) /I$(XML_SRCDIR) /I$(XML_SRCDIR)\include /I$(INCPREFIX) +CFLAGS = $(CFLAGS) /I$(WORKDIR)/UnpackedTarball/icu/source/i18n /I$(WORKDIR)/UnpackedTarball/icu/source/common - !if "$(WITH_THREADS)" == "ctls" - CFLAGS = $(CFLAGS) /D "XML_THREAD_LOCAL=__declspec(thread)" - !else if "$(WITH_THREADS)" == "posix" + !if "$(WITH_THREADS)" != "no" + CFLAGS = $(CFLAGS) /D "_REENTRANT" + !endif @@ -67,6 +68,7 @@ CFLAGS = $(CFLAGS) $(SOLARINC) # The linker and its options. LD = link.exe diff --git a/external/redland/ExternalProject_raptor.mk b/external/redland/ExternalProject_raptor.mk index 5bfab78deba8..8ac05880766b 100644 --- a/external/redland/ExternalProject_raptor.mk +++ b/external/redland/ExternalProject_raptor.mk @@ -30,7 +30,7 @@ $(call gb_ExternalProject_get_state_target,raptor,build): CPPFLAGS="$(if $(SYSBASE),-I$(SYSBASE)/usr/include) $(gb_EMSCRIPTEN_CPPFLAGS)" \ $(gb_RUN_CONFIGURE) ./configure --disable-gtk-doc \ --enable-parsers="rdfxml ntriples turtle trig guess rss-tag-soup" \ - --without-www \ + --with-www=xml \ --without-xslt-config \ $(gb_CONFIGURE_PLATFORMS) \ $(if $(CROSS_COMPILING),$(if $(filter INTEL ARM,$(CPUNAME)),ac_cv_c_bigendian=no)) \ From 6eee182e46bb568a58620a02e5827532d15c8220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20N=C3=A9meth?= Date: Tue, 2 Jul 2024 02:44:58 +0200 Subject: [PATCH 005/232] tdf#159102 sw: add missing get_url_for_data_file to the unit test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Partial revert of commit 5fa3abd3b28b7c30d015dc058f7719112003f51e "tdf#158803 Remove unused imports from uitest". Follow-up to commit c6d7b7fa686b742c6ffef42aa6cc280358babe0d "tdf#159102 sw: enable unit test again with extended test document". Change-Id: Id6397d322f25f1b3e981d8e206a54bb79a54b831 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169848 Tested-by: Jenkins Reviewed-by: László Németh --- sw/qa/uitest/writer_tests8/tdf159102.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/qa/uitest/writer_tests8/tdf159102.py b/sw/qa/uitest/writer_tests8/tdf159102.py index 104f2c9928c0..d52fdcb11318 100644 --- a/sw/qa/uitest/writer_tests8/tdf159102.py +++ b/sw/qa/uitest/writer_tests8/tdf159102.py @@ -7,7 +7,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # from uitest.framework import UITestCase -from uitest.uihelper.common import get_state_as_dict +from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file from libreoffice.uno.propertyvalue import mkPropertyValues from libreoffice.linguistic.linguservice import get_lingu_service_manager From 216d1ba73281fe7098dc115e64ff288cc781a770 Mon Sep 17 00:00:00 2001 From: Heiko Tietze Date: Mon, 1 Jul 2024 14:12:41 +0200 Subject: [PATCH 006/232] Related tdf#161796 - Update donate icon Based on artwork by Ravi Poovaiah / ITT Bombay free to use for any purpose taken from https://commons.wikimedia.org/wiki/File:Heart-hand-shake.svg Change-Id: Ib9716b5ca18727eb50e637decc008a80089875cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169829 Reviewed-by: Mike Kaganski Tested-by: Jenkins --- icon-themes/colibre/res/donate.png | Bin 6393 -> 5800 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/icon-themes/colibre/res/donate.png b/icon-themes/colibre/res/donate.png index 6c93e5eeb78866dce28b5a681710e84fc637933c..570309eb85c81eed892e7a37e027aacd9467e840 100644 GIT binary patch delta 2632 zcmZ8ido?u+=ivxckJ0czdgVAJcR5wIeyB;s2l1f@d&)^^Ba5w@4)-@8>60FH=G|FR9`CkHqdg+ZfmBvAkwi#I|O zjnEi425*GH7~x5x20$hMYiT=a7<5-r)L?3mrKJPK(h?pP!DIxTqys=qVd6y-TfT!* zn!QuGqn;cqN1w0==0A7v@QD4W?Bo;e?N>W*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Va3I0{8>RaaokoUr!`H>0EG^ zHx>f;TT54STbHYA=_w zhyd^gV{HD~w^kbl1iL&#ZuGuXbik=qYefL-0NkdO`X9<@HUUHqfGe%mmfKC%rj!EX z^5Jl4I03MNQri4bXT$s1_3PJ(AP8Fk><6F)a1lTSrL^s#52urOLJlB|G3GUyOalI2 a?LQ_Q%TKZxbxi;O002n`MNUMnLSTaK-_AV% From 57de44900938ce13cfd1aa0c6fd0c841ba7e6b23 Mon Sep 17 00:00:00 2001 From: Adam Seskunas Date: Wed, 26 Jun 2024 07:53:28 -0700 Subject: [PATCH 007/232] Port CRMDatabase from Java to C++ --Port createTables and createQueries --Add a general test for the CRMDatabase --Edit Make file Change-Id: Ifbbb9010c8d8b8a4a199af73539b1f6a9ec45a0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169573 Reviewed-by: Xisco Fauli Tested-by: Jenkins --- .../CppunitTest_dbaccess_CRMDatabase_test.mk | 52 +++++++++ dbaccess/Module_dbaccess.mk | 1 + dbaccess/qa/unit/CRMDatabase_test.cxx | 80 ++++++++++++++ dbaccess/qa/unit/dbtest_base.cxx | 104 ++++++++++++++++++ 4 files changed, 237 insertions(+) create mode 100644 dbaccess/CppunitTest_dbaccess_CRMDatabase_test.mk create mode 100644 dbaccess/qa/unit/CRMDatabase_test.cxx diff --git a/dbaccess/CppunitTest_dbaccess_CRMDatabase_test.mk b/dbaccess/CppunitTest_dbaccess_CRMDatabase_test.mk new file mode 100644 index 000000000000..6c008bc130fe --- /dev/null +++ b/dbaccess/CppunitTest_dbaccess_CRMDatabase_test.mk @@ -0,0 +1,52 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_CppunitTest_CppunitTest,dbaccess_CRMDatabase_test)) + +$(eval $(call gb_CppunitTest_use_external,dbaccess_CRMDatabase_test,boost_headers)) + +$(eval $(call gb_CppunitTest_add_exception_objects,dbaccess_CRMDatabase_test, \ + dbaccess/qa/unit/CRMDatabase_test \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,dbaccess_CRMDatabase_test, \ + comphelper \ + cppu \ + cppuhelper \ + dbaxml \ + dbtools \ + firebird_sdbc \ + sal \ + subsequenttest \ + utl \ + test \ + tk \ + tl \ + unotest \ + xo \ +)) + +$(eval $(call gb_CppunitTest_use_api,dbaccess_CRMDatabase_test,\ + offapi \ + oovbaapi \ + udkapi \ +)) + +$(eval $(call gb_CppunitTest_use_ure,dbaccess_CRMDatabase_test)) +$(eval $(call gb_CppunitTest_use_vcl,dbaccess_CRMDatabase_test)) + +$(eval $(call gb_CppunitTest_use_rdb,dbaccess_CRMDatabase_test,services)) + +$(eval $(call gb_CppunitTest_use_configuration,dbaccess_CRMDatabase_test)) + +$(eval $(call gb_CppunitTest_use_uiconfigs,dbaccess_CRMDatabase_test, \ + dbaccess \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/dbaccess/Module_dbaccess.mk b/dbaccess/Module_dbaccess.mk index e3df5dc33dc2..8cc146b8d8f3 100644 --- a/dbaccess/Module_dbaccess.mk +++ b/dbaccess/Module_dbaccess.mk @@ -53,6 +53,7 @@ $(eval $(call gb_Module_add_check_targets,dbaccess,\ CppunitTest_dbaccess_empty_stdlib_save \ CppunitTest_dbaccess_nolib_save \ CppunitTest_dbaccess_hsqlschema_import \ + CppunitTest_dbaccess_CRMDatabase_test \ )) endif diff --git a/dbaccess/qa/unit/CRMDatabase_test.cxx b/dbaccess/qa/unit/CRMDatabase_test.cxx new file mode 100644 index 000000000000..0f0cae5e67ef --- /dev/null +++ b/dbaccess/qa/unit/CRMDatabase_test.cxx @@ -0,0 +1,80 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-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/. + */ + +#include "dbtest_base.cxx" + +#include +#include +#include +#include +#include +#include +#include + +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; + +class CRMDBTest : public DBTestBase +{ +public: + void testCRMDatabase(); + + CPPUNIT_TEST_SUITE(CRMDBTest); + CPPUNIT_TEST(testCRMDatabase); + CPPUNIT_TEST_SUITE_END(); +}; + +void CRMDBTest::testCRMDatabase() +{ + createDBDocument(u"sdbc:embedded:hsqldb"_ustr); + uno::Reference xDocument(mxComponent, UNO_QUERY_THROW); + uno::Reference xDataSource = xDocument->getDataSource(); + CPPUNIT_ASSERT(xDataSource.is()); + + // create queries before establishing connection to database + createQueries(xDataSource); + + uno::Reference xConnection = getConnectionForDocument(xDocument); + createTables(xConnection); + + // test selection + Reference xStatement = xConnection->createStatement(); + Reference xResults + = xStatement->executeQuery(u"SELECT \"NAME\" FROM \"CATEGORIES\" ORDER BY \"ID\""_ustr); + CPPUNIT_ASSERT(xResults.is()); + + Reference xRow(xResults, UNO_QUERY_THROW); + CPPUNIT_ASSERT(xResults->next()); + CPPUNIT_ASSERT_EQUAL(u"Food"_ustr, xRow->getString(1)); + CPPUNIT_ASSERT(xResults->next()); + CPPUNIT_ASSERT_EQUAL(u"Furniture"_ustr, xRow->getString(1)); + + // test if the queries have been created and can be used + uno::Reference xQuerySupplier(xConnection, UNO_QUERY_THROW); + uno::Reference xQueryAccess = xQuerySupplier->getQueries(); + CPPUNIT_ASSERT(xQueryAccess->hasElements()); + + // the unshipped orders query depends on the all orders query, so we'll test + // to see if both work + uno::Reference xColumns( + xQueryAccess->getByName(u"unshipped orders"_ustr), UNO_QUERY); + uno::Reference xColumnAccess(xColumns->getColumns()); + CPPUNIT_ASSERT(xColumnAccess->hasElements()); + + Sequence ColumnNames = xColumnAccess->getElementNames(); + CPPUNIT_ASSERT(ColumnNames.hasElements()); + // first column returned should be from the all orders query + CPPUNIT_ASSERT_EQUAL(ColumnNames[0], u"Order No."_ustr); +} + +CPPUNIT_TEST_SUITE_REGISTRATION(CRMDBTest); + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/qa/unit/dbtest_base.cxx b/dbaccess/qa/unit/dbtest_base.cxx index 63a3951ad7b4..9c1dd32973eb 100644 --- a/dbaccess/qa/unit/dbtest_base.cxx +++ b/dbaccess/qa/unit/dbtest_base.cxx @@ -13,10 +13,14 @@ #include #include +#include #include +#include #include +#include #include #include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::beans; @@ -37,6 +41,10 @@ public: uno::Reference< XOfficeDatabaseDocument > const & xDocument); void createDBDocument(const OUString& rDriverURL); + void createTables(Reference< XConnection > xConnection); + void createQueries(Reference< XDataSource > xDataSource); + void createQuery(OUString sQuery, bool bEscapeProcessing, + OUString sQueryName, Reference xDataSource); }; uno::Reference DBTestBase::getDocumentForUrl(OUString const & url) { @@ -74,4 +82,100 @@ void DBTestBase::createDBDocument(const OUString& rDriverURL) CPPUNIT_ASSERT(mxComponent); } +void DBTestBase::createTables(Reference xConnection) +{ + uno::Reference xStatement = xConnection->createStatement(); + + xStatement->execute( + u"CREATE TABLE \"CATEGORIES\" ( \"ID\" INTEGER NOT NULL PRIMARY KEY " + ", \"NAME\" VARCHAR (50) , \"DESCRIPTION\" VARCHAR (1024), \"IMAGE\" LONGVARBINARY" + ")"_ustr); + + xStatement->execute(u"INSERT INTO \"CATEGORIES\" (\"ID\", \"NAME\") VALUES ( 1, 'Food' )"_ustr); + xStatement->execute(u"INSERT INTO \"CATEGORIES\" (\"ID\", \"NAME\") VALUES ( 2, 'Furniture' )"_ustr); + + xStatement->execute( + u"CREATE TABLE \"PRODUCTS\" ( \"ID\" INTEGER NOT NULL PRIMARY KEY " + ", \"NAME\" VARCHAR (50) , \"CATEGORYID\" INTEGER NOT NULL, FOREIGN KEY (\"CATEGORYID\")" + "REFERENCES \"CATEGORIES\" (\"ID\") )"_ustr); + + xStatement->execute(u"INSERT INTO \"PRODUCTS\" VALUES ( 1, 'Orange', 1 )"_ustr); + xStatement->execute(u"INSERT INTO \"PRODUCTS\" VALUES ( 2, 'Apples', 1 )"_ustr); + xStatement->execute(u"INSERT INTO \"PRODUCTS\" VALUES ( 3, 'Pears', 1 )"_ustr); + xStatement->execute(u"INSERT INTO \"PRODUCTS\" VALUES ( 4, 'Strawberries', 1 )"_ustr); + + xStatement->execute( + u"CREATE TABLE \"CUSTOMERS\" ( \"ID\" INTEGER NOT NULL PRIMARY KEY " + ", \"NAME\" VARCHAR (50) , \"ADDRESS\" VARCHAR (50), \"CITY\" VARCHAR (50), \"POSTAL\" VARCHAR (50)" + ", \"COMMENT\" LONGVARCHAR )"_ustr); + + xStatement->execute(u"INSERT INTO \"CUSTOMERS\" VALUES(1,'Food, Inc.','Down Under','Melbourne','509','Preferred')"_ustr); + xStatement->execute(u"INSERT INTO \"CUSTOMERS\" VALUES(2,'Simply Delicious','Down Under','Melbourne','518',null)"_ustr); + xStatement->execute(u"INSERT INTO \"CUSTOMERS\" VALUES(3,'Pure Health','10 Fish St.','San Francisco','94107',null)"_ustr); + xStatement->execute(u"INSERT INTO \"CUSTOMERS\" VALUES(4,'Milk And More','Arlington Road 21','Dublin','31021','Good one.')"_ustr); + + xStatement->execute( + u"CREATE TABLE \"ORDERS\" ( \"ID\" INTEGER NOT NULL PRIMARY KEY, \"CUSTOMERID\" INTEGER NOT NULL " + ", \"ORDERDATE\" DATE, \"SHIPDATE\" DATE, FOREIGN KEY (\"CUSTOMERID\")" + "REFERENCES \"CUSTOMERS\" (\"ID\") )"_ustr); + + xStatement->execute(u"INSERT INTO \"ORDERS\" (\"ID\", \"CUSTOMERID\", \"ORDERDATE\") VALUES(1, 1, {D '2009-01-01'})"_ustr); + xStatement->execute(u"INSERT INTO \"ORDERS\" VALUES(2, 2, {D '2009-01-01'}, {D '2009-01-23'})"_ustr); + + xStatement->execute( + u"CREATE TABLE \"ORDERS_DETAILS\" ( \"ORDERID\" INTEGER NOT NULL, \"PRODUCTID\" INTEGER NOT NULL, \"QUANTITY\" INTEGER" + ", FOREIGN KEY (\"ORDERID\") REFERENCES \"ORDERS\" (\"ID\") " + ", FOREIGN KEY (\"PRODUCTID\") REFERENCES \"PRODUCTS\" (\"ID\"), PRIMARY KEY(\"ORDERID\", \"PRODUCTID\") )"_ustr); + + xStatement->execute(u"INSERT INTO \"ORDERS_DETAILS\" VALUES(1, 1, 100)"_ustr); + xStatement->execute(u"INSERT INTO \"ORDERS_DETAILS\" VALUES(1, 2, 100)"_ustr); + xStatement->execute(u"INSERT INTO \"ORDERS_DETAILS\" VALUES(2, 2, 2000)"_ustr); + xStatement->execute(u"INSERT INTO \"ORDERS_DETAILS\" VALUES(2, 3, 2000)"_ustr); + xStatement->execute(u"INSERT INTO \"ORDERS_DETAILS\" VALUES(2, 4, 2000)"_ustr); + xConnection->commit(); +} + +void DBTestBase::createQueries(Reference xDataSource) +{ + createQuery( + u"SELECT \"ORDERS\".\"ID\" AS \"Order No.\", " + "\"CUSTOMERS\".\"NAME\" AS \"Customer Name\", " + "\"ORDERS\".\"ORDERDATE\" AS \"Order Date\", " + "\"ORDERS\".\"SHIPDATE\" AS \"Ship Date\", " + "\"ORDERS_DETAILS\".\"QUANTITY\", " + "\"PRODUCTS\".\"NAME\" AS \"Product Name\" " + "FROM \"ORDERS_DETAILS\" AS \"ORDERS_DETAILS\", " + "\"ORDERS\" AS \"ORDERS\", " + "\"PRODUCTS\" AS \"PRODUCTS\", " + "\"CUSTOMERS\" AS \"CUSTOMERS\" " + "WHERE ( \"ORDERS_DETAILS\".\"ORDERID\" = \"ORDERS\".\"ID\" " + "AND \"ORDERS_DETAILS\".\"PRODUCTID\" = \"PRODUCTS\".\"ID\" " + "AND \"ORDERS\".\"CUSTOMERID\" = \"CUSTOMERS\".\"ID\" )"_ustr, + true, u"all orders"_ustr, xDataSource); + + createQuery( + u"SELECT *" + "FROM \"all orders\"" + "WHERE ( \"SHIPDATE\" IS NULL )"_ustr, true, u"unshipped orders"_ustr, xDataSource); + + createQuery(u"SELECT * FROM \"CUSTOMERS\""_ustr, true, u"parseable"_ustr, xDataSource); + createQuery(u"SELECT * FROM INFORMATION_SCHEMA.SYSTEM_VIEWS"_ustr, false, u"parseable native"_ustr, xDataSource); +} + +void DBTestBase::createQuery(OUString sQuery, bool bEscapeProcessing, OUString sQueryName, Reference xDataSource) +{ + Reference xQuerySupplier(xDataSource, UNO_QUERY_THROW); + Reference xQueryAccess = xQuerySupplier->getQueryDefinitions(); + CPPUNIT_ASSERT(xQueryAccess.is()); + + Reference xSingleServiceFactory(xQueryAccess, UNO_QUERY_THROW); + Reference xQueryProp(xSingleServiceFactory->createInstance(), UNO_QUERY_THROW); + + xQueryProp->setPropertyValue(u"Command"_ustr, Any(sQuery)); + xQueryProp->setPropertyValue(u"EscapeProcessing"_ustr, Any(bEscapeProcessing)); + + Reference xNameContainer(xQueryAccess, UNO_QUERY_THROW); + xNameContainer->insertByName(sQueryName, Any(xQueryProp)); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ From dc5adb7ca805186763e23c365192e2a379d25eb6 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Mon, 1 Jul 2024 10:46:45 +0200 Subject: [PATCH 008/232] Use more getters/setters instead of direct member access Change-Id: I8e0077f9040f0036f16e97da65c93c3fd6a87747 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169744 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- include/tools/color.hxx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/include/tools/color.hxx b/include/tools/color.hxx index 0520df6d3c68..f95ef582f1d6 100644 --- a/include/tools/color.hxx +++ b/include/tools/color.hxx @@ -177,7 +177,7 @@ public: */ bool IsFullyTransparent() const { - return T == 255; + return GetAlpha() == 0; } /** Sets the red value. @@ -217,7 +217,7 @@ public: */ Color GetRGBColor() const { - return {R, G, B}; + return { GetRed(), GetGreen(), GetBlue() }; } /* Comparison and operators */ @@ -279,7 +279,7 @@ public: */ sal_uInt8 GetLuminance() const { - return sal_uInt8((B * 29UL + G * 151UL + R * 76UL) >> 8); + return sal_uInt8((GetBlue() * 29UL + GetGreen() * 151UL + GetRed() * 76UL) >> 8); } /** Increases the color luminance by cLumInc. @@ -343,9 +343,9 @@ public: */ void Invert() { - R = ~R; - G = ~G; - B = ~B; + SetRed(~GetRed()); + SetGreen(~GetGreen()); + SetBlue(~GetBlue()); } /** Merges color with rMergeColor. @@ -355,9 +355,9 @@ public: */ void Merge(const Color& rMergeColor, sal_uInt8 cTransparency) { - R = color::ColorChannelMerge(R, rMergeColor.R, cTransparency); - G = color::ColorChannelMerge(G, rMergeColor.G, cTransparency); - B = color::ColorChannelMerge(B, rMergeColor.B, cTransparency); + SetRed(color::ColorChannelMerge(GetRed(), rMergeColor.GetRed(), cTransparency)); + SetGreen(color::ColorChannelMerge(GetGreen(), rMergeColor.GetGreen(), cTransparency)); + SetBlue(color::ColorChannelMerge(GetBlue(), rMergeColor.GetBlue(), cTransparency)); } /* Change of format */ @@ -411,7 +411,7 @@ public: */ basegfx::BColor getBColor() const { - basegfx::BColor aColor(R / 255.0, G / 255.0, B / 255.0); + basegfx::BColor aColor(GetRed() / 255.0, GetGreen() / 255.0, GetBlue() / 255.0); if (mValue == Color(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF).mValue) aColor.setAutomatic(true); return aColor; From 7153b25d4da845bfb309c75df48f9ea00ec70c47 Mon Sep 17 00:00:00 2001 From: HakimOttey Date: Thu, 25 Apr 2024 14:04:40 -0400 Subject: [PATCH 009/232] tdf#42982 Use IllegalTypeException Error with message within impl_initValues_throw Change-Id: I03942ac2e3478e57b7d94b77b6f100367a53f7ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166648 Tested-by: Ilmari Lauhakangas Reviewed-by: Ilmari Lauhakangas Tested-by: Jenkins --- comphelper/source/container/enumerablemap.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/comphelper/source/container/enumerablemap.cxx b/comphelper/source/container/enumerablemap.cxx index 87192678fc20..cc827822d57d 100644 --- a/comphelper/source/container/enumerablemap.cxx +++ b/comphelper/source/container/enumerablemap.cxx @@ -369,9 +369,9 @@ namespace comphelper void EnumerableMap::impl_initValues_throw( const Sequence< Pair< Any, Any > >& _initialValues ) { OSL_PRECOND( m_aData.m_pValues && m_aData.m_pValues->empty(), "EnumerableMap::impl_initValues_throw: illegal call!" ); - if (!m_aData.m_pValues || !m_aData.m_pValues->empty()) - throw RuntimeException(); - + if (!m_aData.m_pValues || !m_aData.m_pValues->empty()){ + throw IllegalTypeException("EnumerableMap m_aData container is invalid or not empty.", *this); + } for (auto& mapping : _initialValues) { impl_checkValue_throw(mapping.Second); From 23a5be4d6d04944dcbbb06912c434eedd3719b3b Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 1 Jul 2024 11:21:23 +0200 Subject: [PATCH 010/232] tdf#161853 vcl: Drop SvxIconChoiceCtrl_Impl::HideDDIcon It's superfluous, as the only place calling it already calls `pView->PaintImmediately();` manually right after that, which is the same that `SvxIconChoiceCtrl_Impl::HideDDIcon` does. Change-Id: I8bf6e27e598fc5070dd551e3152dcc4cad91f1f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169792 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- vcl/source/control/imivctl.hxx | 2 -- vcl/source/control/imivctl1.cxx | 7 ------- 2 files changed, 9 deletions(-) diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index c29068442728..f79e0100b1d2 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -357,8 +357,6 @@ public: void Scroll( tools::Long nDeltaX, tools::Long nDeltaY ); const Size& GetItemSize( IcnViewFieldType ) const; - void HideDDIcon(); - static bool IsOver( std::vector* pSelectedRectList, const tools::Rectangle& rEntryBoundRect diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index a52a8634ff4b..3b26c6b7ff81 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -1793,12 +1793,6 @@ void SvxIconChoiceCtrl_Impl::ShowCursor( bool bShow ) /*pView->*/ShowFocus( aRect ); } - -void SvxIconChoiceCtrl_Impl::HideDDIcon() -{ - pView->PaintImmediately(); -} - bool SvxIconChoiceCtrl_Impl::HandleScrollCommand( const CommandEvent& rCmd ) { tools::Rectangle aDocRect( Point(), aVirtOutputSize ); @@ -1966,7 +1960,6 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const tools::Rectangle& rRect, bool bS aOutputArea.SetPos( aOrigin ); if( GetUpdateMode() ) { - HideDDIcon(); pView->PaintImmediately(); ShowCursor( false ); } From 1582d803e1de1fb8863a9d8eaea959fd2ea588ec Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 1 Jul 2024 11:25:00 +0200 Subject: [PATCH 011/232] tdf#161853 vcl: Move logic into SvxIconChoiceCtrl_Impl::DrawFocusRect Move calculating the focus rect from `SvxIconChoiceCtrl_Impl::PaintItem` to `SvxIconChoiceCtrl_Impl::DrawFocusRect`. The former is currently the only caller of the latter, so behavior should remain unchanged. Change-Id: I1c3dd73acb3a1a6b8bb61034c06a79d75c5ed3f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169793 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- vcl/source/control/imivctl.hxx | 2 +- vcl/source/control/imivctl1.cxx | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index f79e0100b1d2..95435c7c4d9e 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -237,7 +237,7 @@ class SvxIconChoiceCtrl_Impl void SetOrigin( const Point& ); void ShowFocus ( tools::Rectangle const & rRect ); - void DrawFocusRect(vcl::RenderContext& rRenderContext); + void DrawFocusRect(vcl::RenderContext& rRenderContext, SvxIconChoiceCtrlEntry* pEntry); bool IsMnemonicChar( sal_Unicode cChar, sal_uLong& rPos ) const; diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 3b26c6b7ff81..bb4d9a48c12e 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -1368,11 +1368,7 @@ void SvxIconChoiceCtrl_Impl::PaintItem(const tools::Rectangle& rRect, rRenderContext.DrawText(rRect, aText, nCurTextDrawFlags); if (pEntry->IsFocused()) - { - tools::Rectangle aRect (CalcFocusRect(pEntry)); - ShowFocus(aRect); - DrawFocusRect(rRenderContext); - } + DrawFocusRect(rRenderContext, pEntry); } else { @@ -2465,8 +2461,11 @@ void SvxIconChoiceCtrl_Impl::ShowFocus ( tools::Rectangle const & rRect ) aFocus.aRect = rRect; } -void SvxIconChoiceCtrl_Impl::DrawFocusRect(vcl::RenderContext& rRenderContext) +void SvxIconChoiceCtrl_Impl::DrawFocusRect(vcl::RenderContext& rRenderContext, SvxIconChoiceCtrlEntry* pEntry) { + tools::Rectangle aRect (CalcFocusRect(pEntry)); + ShowFocus(aRect); + rRenderContext.SetLineColor(aFocus.aPenColor); rRenderContext.SetFillColor(); tools::Polygon aPolygon (aFocus.aRect); From c08ea5efd1a67ff63881fa830c37c1f4da24bbb8 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 1 Jul 2024 11:43:55 +0200 Subject: [PATCH 012/232] tdf#161853 Translate rest of German comment Somehow, these 2 words previously remained in German when the comments were translated. Change-Id: I9d40b7df14d9328f52ba3d9ee8217f9ec1128272 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169794 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- include/vcl/toolkit/ivctrl.hxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/vcl/toolkit/ivctrl.hxx b/include/vcl/toolkit/ivctrl.hxx index 9441f46a7a30..eb0513d44626 100644 --- a/include/vcl/toolkit/ivctrl.hxx +++ b/include/vcl/toolkit/ivctrl.hxx @@ -80,8 +80,8 @@ class SvxIconChoiceCtrlEntry (-> Order of the anchors in the anchors-list!). In "AutoArrange" mode the visible order can differ. The entries will be linked because of this. */ - SvxIconChoiceCtrlEntry* pblink; // backward (linker neighbour) - SvxIconChoiceCtrlEntry* pflink; // forward (rechter neighbour) + SvxIconChoiceCtrlEntry* pblink; // backward (left neighbour) + SvxIconChoiceCtrlEntry* pflink; // forward (right neighbour) SvxIconChoiceCtrlTextMode eTextMode; sal_uInt16 nX,nY; // for keyboard control From 99d45ab7275af130485e52f71abaf7f72fd1239a Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 1 Jul 2024 12:03:28 +0200 Subject: [PATCH 013/232] tdf#161853 vcl: Use const ref instead of pointer Pass a const reference instead of a pointer to `SvxIconChoiceCtrl_Impl::IsOver` and dereference in caller instead of (unconditionally) in the method itself. Change-Id: Ib530c33ccaffd794116f0acc042c96e4c29dee1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169795 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- vcl/source/control/imivctl.hxx | 2 +- vcl/source/control/imivctl1.cxx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index 95435c7c4d9e..569e8e456320 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -358,7 +358,7 @@ public: const Size& GetItemSize( IcnViewFieldType ) const; static bool IsOver( - std::vector* pSelectedRectList, + const std::vector& rRects, const tools::Rectangle& rEntryBoundRect ); diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index bb4d9a48c12e..58236ff35e29 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -2264,7 +2264,7 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const tools::Rectangle& rRect, bool bAd bool bOverlaps; if( bCalcOverlap ) - bOverlaps = IsOver( pOtherRects, aBoundRect ); + bOverlaps = IsOver(*pOtherRects, aBoundRect); else bOverlaps = false; bool bOver = aRect.Overlaps( aBoundRect ); @@ -2370,12 +2370,12 @@ void SvxIconChoiceCtrl_Impl::SelectRange( } } -bool SvxIconChoiceCtrl_Impl::IsOver( std::vector* pRectList, const tools::Rectangle& rBoundRect ) +bool SvxIconChoiceCtrl_Impl::IsOver(const std::vector& rRects, const tools::Rectangle& rBoundRect) { - const sal_uInt16 nCount = pRectList->size(); + const sal_uInt16 nCount = rRects.size(); for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) { - tools::Rectangle& rRect = (*pRectList)[ nCur ]; + const tools::Rectangle& rRect = rRects[ nCur ]; if( rBoundRect.Overlaps( rRect )) return true; } From 72ef986133be94fd872ceaef57f3e0ffd7a538d8 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 1 Jul 2024 12:05:27 +0200 Subject: [PATCH 014/232] tdf#161853 vcl: Use range-based for Change-Id: I69824a42b74071678c2c8f102fff78453e1718de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169796 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- vcl/source/control/imivctl1.cxx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 58236ff35e29..bb811e187d1a 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -2372,10 +2372,8 @@ void SvxIconChoiceCtrl_Impl::SelectRange( bool SvxIconChoiceCtrl_Impl::IsOver(const std::vector& rRects, const tools::Rectangle& rBoundRect) { - const sal_uInt16 nCount = rRects.size(); - for( sal_uInt16 nCur = 0; nCur < nCount; nCur++ ) + for (const tools::Rectangle& rRect : rRects) { - const tools::Rectangle& rRect = rRects[ nCur ]; if( rBoundRect.Overlaps( rRect )) return true; } From 7c467736fd3b08ec7ea0bd930bfd96add9f77a2d Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 1 Jul 2024 12:12:03 +0200 Subject: [PATCH 015/232] tdf#161853 vcl: Pass vector by const ref instead of pointer Pass the vector of rectangles by const ref instead of as pointer for both variants of `SvxIconChoiceCtrl_Impl::SelectRect`, which also makes it clearer that this is never nullptr. Change-Id: I10c9ff27602128eb878d03125d966e1fbf198237 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169797 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- vcl/source/control/imivctl.hxx | 4 ++-- vcl/source/control/imivctl1.cxx | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index 569e8e456320..a13952904cc8 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -194,7 +194,7 @@ class SvxIconChoiceCtrl_Impl SvxIconChoiceCtrlEntry* pEntry1, SvxIconChoiceCtrlEntry* pEntry2, bool bAdd, - std::vector* pOtherRects + const std::vector& rOtherRects ); void SelectRange( @@ -365,7 +365,7 @@ public: void SelectRect( const tools::Rectangle&, bool bAdd, - std::vector* pOtherRects + const std::vector& rOtherRects ); void MakeVisible( diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index bb811e187d1a..f8aaf425fd08 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -633,7 +633,7 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) aRect.Union( aTempRect ); } aCurSelectionRect = aRect; - SelectRect( aRect, bool(nFlags & IconChoiceFlags::AddMode), &aSelectedRectList ); + SelectRect(aRect, bool(nFlags & IconChoiceFlags::AddMode), aSelectedRectList); } else if( rMEvt.IsMod1() ) { @@ -828,7 +828,7 @@ void SvxIconChoiceCtrl_Impl::SetCursor_Impl( SvxIconChoiceCtrlEntry* pOldCursor, if ( nWinBits & WB_ALIGN_LEFT ) SelectRange( pAnchor, pNewCursor, bool(nFlags & IconChoiceFlags::AddMode) ); else - SelectRect(pAnchor,pNewCursor, bool(nFlags & IconChoiceFlags::AddMode), &aSelectedRectList); + SelectRect(pAnchor,pNewCursor, bool(nFlags & IconChoiceFlags::AddMode), aSelectedRectList); } else { @@ -2219,16 +2219,16 @@ static tools::Rectangle GetHotSpot( const tools::Rectangle& rRect ) } void SvxIconChoiceCtrl_Impl::SelectRect( SvxIconChoiceCtrlEntry* pEntry1, SvxIconChoiceCtrlEntry* pEntry2, - bool bAdd, std::vector* pOtherRects ) + bool bAdd, const std::vector& rOtherRects) { DBG_ASSERT(pEntry1 && pEntry2,"SelectEntry: Invalid Entry-Ptr"); tools::Rectangle aRect( GetEntryBoundRect( pEntry1 ) ); aRect.Union( GetEntryBoundRect( pEntry2 ) ); - SelectRect( aRect, bAdd, pOtherRects ); + SelectRect(aRect, bAdd, rOtherRects); } void SvxIconChoiceCtrl_Impl::SelectRect( const tools::Rectangle& rRect, bool bAdd, - std::vector* pOtherRects ) + const std::vector& rOtherRects) { aCurSelectionRect = rRect; if( maZOrderList.empty() ) @@ -2244,7 +2244,7 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const tools::Rectangle& rRect, bool bAd tools::Rectangle aRect( rRect ); aRect.Normalize(); - bool bCalcOverlap = (bAdd && pOtherRects && !pOtherRects->empty()); + bool bCalcOverlap = (bAdd && !rOtherRects.empty()); bool bResetClipRegion = false; if( !pView->GetOutDev()->IsClipRegion() ) @@ -2264,7 +2264,7 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const tools::Rectangle& rRect, bool bAd bool bOverlaps; if( bCalcOverlap ) - bOverlaps = IsOver(*pOtherRects, aBoundRect); + bOverlaps = IsOver(rOtherRects, aBoundRect); else bOverlaps = false; bool bOver = aRect.Overlaps( aBoundRect ); From d3c82ab9255a019229ac9f3bc9429a63fc9d89a6 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 1 Jul 2024 12:58:14 +0200 Subject: [PATCH 016/232] tdf#161853 vcl: Simplify SvxIconChoiceCtrl_Impl::CalcTextRect Drop the `OUString* pStr` param and always use the entry text instead. This is the default, and all callers explicitly passing a string were passing the entry text anyway. Change-Id: I0ef46ca001fe568febb02e132df379c360d8282a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169802 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- vcl/source/control/imivctl.hxx | 3 +-- vcl/source/control/imivctl1.cxx | 14 ++++---------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index a13952904cc8..6154c02d7e28 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -317,8 +317,7 @@ public: tools::Rectangle CalcBmpRect( SvxIconChoiceCtrlEntry*, const Point* pPos = nullptr ); tools::Rectangle CalcTextRect( SvxIconChoiceCtrlEntry*, - const Point* pPos = nullptr, - const OUString* pStr = nullptr + const Point* pPos = nullptr ); tools::Long CalcBoundingWidth() const; diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index f8aaf425fd08..9ba600881597 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -1390,8 +1390,7 @@ void SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po rRenderContext.Push(vcl::PushFlags::FONT | vcl::PushFlags::TEXTCOLOR); - OUString aEntryText(SvtIconChoiceCtrl::GetEntryText(pEntry)); - tools::Rectangle aTextRect(CalcTextRect(pEntry, &rPos, &aEntryText)); + tools::Rectangle aTextRect(CalcTextRect(pEntry, &rPos)); tools::Rectangle aBmpRect(CalcBmpRect(pEntry, &rPos)); bool bShowSelection = (bSelected && (eSelectionMode != SelectionMode::NONE)); @@ -1577,19 +1576,14 @@ tools::Rectangle SvxIconChoiceCtrl_Impl::CalcBmpRect( SvxIconChoiceCtrlEntry* pE } tools::Rectangle SvxIconChoiceCtrl_Impl::CalcTextRect( SvxIconChoiceCtrlEntry* pEntry, - const Point* pEntryPos, const OUString* pStr ) + const Point* pEntryPos) { - OUString aEntryText; - if( !pStr ) - aEntryText = SvtIconChoiceCtrl::GetEntryText( pEntry ); - else - aEntryText = *pStr; - const tools::Rectangle aMaxTextRect( CalcMaxTextRect( pEntry ) ); tools::Rectangle aBound( GetEntryBoundRect( pEntry ) ); if( pEntryPos ) aBound.SetPos( *pEntryPos ); + const OUString aEntryText = SvtIconChoiceCtrl::GetEntryText(pEntry); tools::Rectangle aTextRect = pView->GetTextRect( aMaxTextRect, aEntryText, nCurTextDrawFlags ); Size aTextSize( aTextRect.GetSize() ); @@ -2772,8 +2766,8 @@ bool SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt ) return false; OUString sQuickHelpText = pEntry->GetQuickHelpText(); + tools::Rectangle aTextRect(CalcTextRect(pEntry, nullptr)); OUString aEntryText( SvtIconChoiceCtrl::GetEntryText( pEntry ) ); - tools::Rectangle aTextRect( CalcTextRect( pEntry, nullptr, &aEntryText ) ); if ( ( !aTextRect.Contains( aPos ) || aEntryText.isEmpty() ) && sQuickHelpText.isEmpty() ) return false; From 3c9822d36e1f03be604491961be9f7c3981c2704 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 1 Jul 2024 13:19:18 +0200 Subject: [PATCH 017/232] tdf#161853 vcl: Drop unused SvxIconChoiceCtrl_Impl::SetColumn It's unused since commit b64751ba28fd69fb2a93a21b10a92b68f4dd2097 Date: Fri Apr 26 10:47:00 2024 +0200 tdf#99528 Properly layout vertical tabs without icons Change-Id: I06a877d5ebffef95495cc3e57be088cdc08d71fe Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169803 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- vcl/source/control/imivctl.hxx | 1 - vcl/source/control/imivctl1.cxx | 17 ----------------- 2 files changed, 18 deletions(-) diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index 6154c02d7e28..aedc238cccab 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -398,7 +398,6 @@ public: void SetPositionMode( SvxIconChoiceCtrlPositionMode ); - void SetColumn( sal_uInt16 nIndex, const SvxIconChoiceCtrlColumnInfo& ); const SvxIconChoiceCtrlColumnInfo* GetColumn( sal_uInt16 nIndex ) const; void SetEntryHighlightFrame( diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 9ba600881597..9579784ea818 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -2797,23 +2797,6 @@ bool SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt ) return true; } -void SvxIconChoiceCtrl_Impl::SetColumn( sal_uInt16 nIndex, const SvxIconChoiceCtrlColumnInfo& rInfo) -{ - if (!m_pColumns) - m_pColumns.reset(new SvxIconChoiceCtrlColumnInfoMap); - - SvxIconChoiceCtrlColumnInfo* pInfo = new SvxIconChoiceCtrlColumnInfo( rInfo ); - m_pColumns->insert(std::make_pair(nIndex, std::unique_ptr(pInfo))); - - // HACK: Detail mode is not yet fully implemented, this workaround makes it - // fly with a single column - if( !nIndex && (nWinBits & WB_DETAILS) ) - nGridDX = pInfo->GetWidth(); - - if( GetUpdateMode() ) - Arrange( IsAutoArrange(), 0, 0 ); -} - const SvxIconChoiceCtrlColumnInfo* SvxIconChoiceCtrl_Impl::GetColumn( sal_uInt16 nIndex ) const { if (!m_pColumns) From 25d1c2f7f7451e6be1b172ae1f97f3c0ad052276 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 1 Jul 2024 13:24:56 +0200 Subject: [PATCH 018/232] tdf#161853 vcl: Drop SvxIconChoiceCtrl_Impl::GetColumn Since no column is ever set, see Change-Id: I06a877d5ebffef95495cc3e57be088cdc08d71fe Author: Michael Weghorn Date: Mon Jul 1 13:19:18 2024 +0200 tdf#161853 vcl: Drop unused SvxIconChoiceCtrl_Impl::SetColumn , there are also no columns to get, so drop `SvxIconChoiceCtrl_Impl::GetColumn` and `SvxIconChoiceCtrl_Impl::m_pColumns` altogether. Change-Id: I113a00d41a40b10df9d4d6dbb71565d462d9f8ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169804 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- vcl/source/control/imivctl.hxx | 4 ---- vcl/source/control/imivctl1.cxx | 19 ------------------- 2 files changed, 23 deletions(-) diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index aedc238cccab..1ff043def5f5 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -105,7 +105,6 @@ typedef sal_uLong GridId; // Implementation-class of IconChoiceCtrl -typedef std::map> SvxIconChoiceCtrlColumnInfoMap; typedef std::vector SvxIconChoiceCtrlEntryPtrVec; class SvxIconChoiceCtrl_Impl @@ -133,7 +132,6 @@ class SvxIconChoiceCtrl_Impl tools::Long nMaxVirtWidth; // max. width aVirtOutputSize for ALIGN_TOP tools::Long nMaxVirtHeight; // max. height aVirtOutputSize for ALIGN_LEFT std::vector< SvxIconChoiceCtrlEntry* > maZOrderList; - std::unique_ptr m_pColumns; WinBits nWinBits; tools::Long nMaxBoundHeight; // height of highest BoundRects IconChoiceFlags nFlags; @@ -398,8 +396,6 @@ public: void SetPositionMode( SvxIconChoiceCtrlPositionMode ); - const SvxIconChoiceCtrlColumnInfo* GetColumn( sal_uInt16 nIndex ) const; - void SetEntryHighlightFrame( SvxIconChoiceCtrlEntry* pEntry, bool bKeepHighlightFlags diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 9579784ea818..71404180eb0d 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -107,7 +107,6 @@ SvxIconChoiceCtrl_Impl::~SvxIconChoiceCtrl_Impl() pImpCursor.reset(); pGridMap.reset(); ClearSelectedRectList(); - m_pColumns.reset(); aVerSBar.disposeAndClear(); aHorSBar.disposeAndClear(); aScrBarBox.disposeAndClear(); @@ -2060,14 +2059,6 @@ void SvxIconChoiceCtrl_Impl::SetGrid( const Size& rSize ) aSize.setHeight( aMinSize.Height() ); nGridDX = aSize.Width(); - // HACK: Detail mode is not yet fully implemented, this workaround makes it - // fly with a single column - if( nWinBits & WB_DETAILS ) - { - const SvxIconChoiceCtrlColumnInfo* pCol = GetColumn( 0 ); - if( pCol ) - const_cast(pCol)->SetWidth( nGridDX ); - } nGridDY = aSize.Height(); SetDefaultTextSize(); } @@ -2797,16 +2788,6 @@ bool SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt ) return true; } -const SvxIconChoiceCtrlColumnInfo* SvxIconChoiceCtrl_Impl::GetColumn( sal_uInt16 nIndex ) const -{ - if (!m_pColumns) - return nullptr; - auto const it = m_pColumns->find( nIndex ); - if (it == m_pColumns->end()) - return nullptr; - return it->second.get(); -} - void SvxIconChoiceCtrl_Impl::DrawHighlightFrame(vcl::RenderContext& rRenderContext, const tools::Rectangle& rBmpRect) { tools::Rectangle aBmpRect(rBmpRect); From 9fb6ebd42bc5e2c416ffbc222261cc781c9cc3bc Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 1 Jul 2024 13:30:15 +0200 Subject: [PATCH 019/232] tdf#161853 vcl: Drop unused SvxIconChoiceCtrlColumnInfo Unused since: Change-Id: I113a00d41a40b10df9d4d6dbb71565d462d9f8ae Author: Michael Weghorn Date: Mon Jul 1 13:24:56 2024 +0200 tdf#161853 vcl: Drop unused SvxIconChoiceCtrl_Impl::GetColumn Change-Id: Ie32fcc443323bd2840aa14edefc533b743e1ed75 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169825 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- include/vcl/toolkit/ivctrl.hxx | 13 ------------- vcl/source/control/ivctrl.cxx | 6 ------ 2 files changed, 19 deletions(-) diff --git a/include/vcl/toolkit/ivctrl.hxx b/include/vcl/toolkit/ivctrl.hxx index eb0513d44626..dca72871d724 100644 --- a/include/vcl/toolkit/ivctrl.hxx +++ b/include/vcl/toolkit/ivctrl.hxx @@ -125,19 +125,6 @@ public: bool IsPosLocked() const { return bool(nFlags & SvxIconViewFlags::POS_LOCKED); } }; -class SvxIconChoiceCtrlColumnInfo -{ - tools::Long nWidth; - -public: - SvxIconChoiceCtrlColumnInfo() : - nWidth( 100 ) {} - SvxIconChoiceCtrlColumnInfo( const SvxIconChoiceCtrlColumnInfo& ); - - void SetWidth( tools::Long nWd ) { nWidth = nWd; } - tools::Long GetWidth() const { return nWidth; } -}; - /* Window-Bits: diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx index c17a0caf359d..c20ce459487a 100644 --- a/vcl/source/control/ivctrl.cxx +++ b/vcl/source/control/ivctrl.cxx @@ -73,12 +73,6 @@ OUString SvxIconChoiceCtrlEntry::GetDisplayText() const return MnemonicGenerator::EraseAllMnemonicChars( aText ); } - -SvxIconChoiceCtrlColumnInfo::SvxIconChoiceCtrlColumnInfo( const SvxIconChoiceCtrlColumnInfo& rInfo ) -{ - nWidth = rInfo.nWidth; -} - /***************************************************************************** | | class : SvtIconChoiceCtrl From 9780e0843f5ee6165b8d8bc4c01071e7a2be9742 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 1 Jul 2024 14:51:02 +0200 Subject: [PATCH 020/232] tdf#161853 vcl: Drop outdated icon choice control comment The `sal_uLong` out param that the outdated comment refers to was dropped in commit 497c589802a788de78af28ea88cec947b25355b3 Date: Tue Jun 16 14:36:06 2015 +0200 sal_uLong->sal_Int32 in SvtIconChoiceCtrl and drop the pass-by-reference param from GetSelected, nothing uses it Change-Id: I95334361b8d91ffd9497317a066718d466457c2b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169832 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- include/vcl/toolkit/ivctrl.hxx | 1 - 1 file changed, 1 deletion(-) diff --git a/include/vcl/toolkit/ivctrl.hxx b/include/vcl/toolkit/ivctrl.hxx index dca72871d724..318be744c757 100644 --- a/include/vcl/toolkit/ivctrl.hxx +++ b/include/vcl/toolkit/ivctrl.hxx @@ -226,7 +226,6 @@ public: void SetCursor( SvxIconChoiceCtrlEntry* pEntry ); SvxIconChoiceCtrlEntry* GetCursor() const; - // sal_uLong is the position of the selected element in the list SvxIconChoiceCtrlEntry* GetSelectedEntry() const; #ifdef DBG_UTIL From 212196344c99982aa42ec1eecb36006c9a12655f Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 1 Jul 2024 15:36:41 +0200 Subject: [PATCH 021/232] tdf#161853 vcl: Drop SvtIconChoiceCtrl::DrawEntryImage Just draw the image using the render context right in `SvxIconChoiceCtrl_Impl::PaintItem` instead of having a very specialized static method that's only used from there. Change-Id: Idf8967f6df3823742445906e558fcd7f532271af Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169833 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- include/vcl/toolkit/ivctrl.hxx | 4 ---- vcl/source/control/imivctl1.cxx | 2 +- vcl/source/control/ivctrl.cxx | 5 ----- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/include/vcl/toolkit/ivctrl.hxx b/include/vcl/toolkit/ivctrl.hxx index 318be744c757..0f331a887e9c 100644 --- a/include/vcl/toolkit/ivctrl.hxx +++ b/include/vcl/toolkit/ivctrl.hxx @@ -181,10 +181,6 @@ class UNLESS_MERGELIBS_MORE(VCL_DLLPUBLIC) SvtIconChoiceCtrl final : public Cont void ClickIcon(); virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; virtual void RequestHelp( const HelpEvent& rHEvt ) override; - static void DrawEntryImage( - SvxIconChoiceCtrlEntry const * pEntry, - const Point& rPos, - OutputDevice& rDev ); static OUString GetEntryText( SvxIconChoiceCtrlEntry const * pEntry ); diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 71404180eb0d..9d0cedf2b022 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -1376,7 +1376,7 @@ void SvxIconChoiceCtrl_Impl::PaintItem(const tools::Rectangle& rRect, aPos.AdjustX((rRect.GetWidth() - aImageSize.Width()) / 2 ); if (nPaintFlags & PAINTFLAG_VER_CENTERED) aPos.AdjustY((rRect.GetHeight() - aImageSize.Height()) / 2 ); - SvtIconChoiceCtrl::DrawEntryImage(pEntry, aPos, rRenderContext); + rRenderContext.DrawImage(aPos, pEntry->GetImage()); } } diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx index c20ce459487a..bf3cb1c89725 100644 --- a/vcl/source/control/ivctrl.cxx +++ b/vcl/source/control/ivctrl.cxx @@ -125,11 +125,6 @@ void SvtIconChoiceCtrl::RemoveEntry(sal_Int32 nIndex) _pImpl->RemoveEntry(nIndex); } -void SvtIconChoiceCtrl::DrawEntryImage( SvxIconChoiceCtrlEntry const * pEntry, const Point& rPos, OutputDevice& rDev ) -{ - rDev.DrawImage( rPos, pEntry->GetImage() ); -} - OUString SvtIconChoiceCtrl::GetEntryText( SvxIconChoiceCtrlEntry const * pEntry ) { return pEntry->GetText(); From f9f0bf9b47a627e13477ac893bcb9436c72a49d5 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 1 Jul 2024 15:41:55 +0200 Subject: [PATCH 022/232] tdf#161853 vcl: Drop SvtIconChoiceCtrl::GetEntryText Just call `SvxIconChoiceCtrlEntry::GetText` directly instead of having an extra level of indirection to get the same result. Change-Id: I6a299f5de4e7979044ade11e5441260383ce0b87 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169834 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- include/vcl/toolkit/ivctrl.hxx | 2 -- vcl/source/control/imivctl1.cxx | 8 +++----- vcl/source/control/ivctrl.cxx | 5 ----- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/include/vcl/toolkit/ivctrl.hxx b/include/vcl/toolkit/ivctrl.hxx index 0f331a887e9c..29ea93dd2fd3 100644 --- a/include/vcl/toolkit/ivctrl.hxx +++ b/include/vcl/toolkit/ivctrl.hxx @@ -182,8 +182,6 @@ class UNLESS_MERGELIBS_MORE(VCL_DLLPUBLIC) SvtIconChoiceCtrl final : public Cont virtual void DataChanged( const DataChangedEvent& rDCEvt ) override; virtual void RequestHelp( const HelpEvent& rHEvt ) override; - static OUString GetEntryText( SvxIconChoiceCtrlEntry const * pEntry ); - virtual void FillLayoutData() const override; void CallImplEventListeners(VclEventId nEvent, void* pData); diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 9d0cedf2b022..97d38a3c50df 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -1362,9 +1362,7 @@ void SvxIconChoiceCtrl_Impl::PaintItem(const tools::Rectangle& rRect, { if (eItem == IcnViewFieldType::Text) { - OUString aText = SvtIconChoiceCtrl::GetEntryText(pEntry); - - rRenderContext.DrawText(rRect, aText, nCurTextDrawFlags); + rRenderContext.DrawText(rRect, pEntry->GetText(), nCurTextDrawFlags); if (pEntry->IsFocused()) DrawFocusRect(rRenderContext, pEntry); @@ -1582,7 +1580,7 @@ tools::Rectangle SvxIconChoiceCtrl_Impl::CalcTextRect( SvxIconChoiceCtrlEntry* p if( pEntryPos ) aBound.SetPos( *pEntryPos ); - const OUString aEntryText = SvtIconChoiceCtrl::GetEntryText(pEntry); + const OUString aEntryText = pEntry->GetText(); tools::Rectangle aTextRect = pView->GetTextRect( aMaxTextRect, aEntryText, nCurTextDrawFlags ); Size aTextSize( aTextRect.GetSize() ); @@ -2758,7 +2756,7 @@ bool SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt ) OUString sQuickHelpText = pEntry->GetQuickHelpText(); tools::Rectangle aTextRect(CalcTextRect(pEntry, nullptr)); - OUString aEntryText( SvtIconChoiceCtrl::GetEntryText( pEntry ) ); + const OUString aEntryText = pEntry->GetText(); if ( ( !aTextRect.Contains( aPos ) || aEntryText.isEmpty() ) && sQuickHelpText.isEmpty() ) return false; diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx index bf3cb1c89725..f8e09856c92c 100644 --- a/vcl/source/control/ivctrl.cxx +++ b/vcl/source/control/ivctrl.cxx @@ -125,11 +125,6 @@ void SvtIconChoiceCtrl::RemoveEntry(sal_Int32 nIndex) _pImpl->RemoveEntry(nIndex); } -OUString SvtIconChoiceCtrl::GetEntryText( SvxIconChoiceCtrlEntry const * pEntry ) -{ - return pEntry->GetText(); -} - void SvtIconChoiceCtrl::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) { _pImpl->Paint(rRenderContext, rRect); From 01fa9762bcf761e5a1fd9eac6740e6829f21b5b1 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 1 Jul 2024 16:24:59 +0200 Subject: [PATCH 023/232] tdf#161853 vcl: Simplify SvxIconChoiceCtrl_Impl::SetEntryTextMode It never gets called with a null SvxIconChoiceCtrlEntry, so change the param from pointer to reference (also in `SvtIconChoiceCtrl::SetEntryTextMode`), and drop the handling for the never-reached null case. This also makes SvtIconChoiceCtrl::eTextMode become unused, so drop it. Change-Id: I428c47dcbc85568009be3454ffa7a8b977c6d095 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169836 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- include/vcl/toolkit/ivctrl.hxx | 2 +- vcl/source/control/imivctl.hxx | 3 +-- vcl/source/control/imivctl1.cxx | 29 +++++++++-------------------- vcl/source/control/ivctrl.cxx | 4 ++-- 4 files changed, 13 insertions(+), 25 deletions(-) diff --git a/include/vcl/toolkit/ivctrl.hxx b/include/vcl/toolkit/ivctrl.hxx index 29ea93dd2fd3..ad7aa626ca5a 100644 --- a/include/vcl/toolkit/ivctrl.hxx +++ b/include/vcl/toolkit/ivctrl.hxx @@ -223,7 +223,7 @@ public: SvxIconChoiceCtrlEntry* GetSelectedEntry() const; #ifdef DBG_UTIL - void SetEntryTextMode( SvxIconChoiceCtrlTextMode eMode, SvxIconChoiceCtrlEntry* pEntry ); + void SetEntryTextMode(SvxIconChoiceCtrlTextMode eMode, SvxIconChoiceCtrlEntry& rEntry); #endif tools::Rectangle GetBoundingBox( SvxIconChoiceCtrlEntry* pEntry ) const; diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index 1ff043def5f5..6f6030bab271 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -146,7 +146,6 @@ class SvxIconChoiceCtrl_Impl LocalFocus aFocus; // Data for focusrect ::vcl::AccessibleFactoryAccess aAccFactory; - SvxIconChoiceCtrlTextMode eTextMode; SelectionMode eSelectionMode; sal_Int32 nSelectionCount; SvxIconChoiceCtrlPositionMode ePositionMode; @@ -373,7 +372,7 @@ public: #ifdef DBG_UTIL void SetEntryTextMode( SvxIconChoiceCtrlTextMode, - SvxIconChoiceCtrlEntry* pEntry + SvxIconChoiceCtrlEntry& rEntry ); #endif size_t GetEntryCount() const { return maEntries.size(); } diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 97d38a3c50df..ed52e38a39a4 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -65,7 +65,7 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( nFlags(IconChoiceFlags::NONE), nUserEventAdjustScrBars(nullptr), pCurHighlightFrame(nullptr), bHighlightFramePressed(false), pHead(nullptr), pCursor(nullptr), pHdlEntry(nullptr), - pAnchor(nullptr), eTextMode(SvxIconChoiceCtrlTextMode::Short), + pAnchor(nullptr), eSelectionMode(SelectionMode::Multiple), ePositionMode(SvxIconChoiceCtrlPositionMode::Free), bUpdateMode(true) { @@ -979,12 +979,12 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) if( rKEvt.GetKeyCode().IsShift() ) { if( pCursor ) - pView->SetEntryTextMode( SvxIconChoiceCtrlTextMode::Full, pCursor ); + pView->SetEntryTextMode(SvxIconChoiceCtrlTextMode::Full, *pCursor); } if( rKEvt.GetKeyCode().IsMod1() ) { if( pCursor ) - pView->SetEntryTextMode( SvxIconChoiceCtrlTextMode::Short, pCursor ); + pView->SetEntryTextMode(SvxIconChoiceCtrlTextMode::Short, *pCursor); } break; #endif @@ -2401,25 +2401,14 @@ IMPL_LINK_NOARG(SvxIconChoiceCtrl_Impl, DocRectChangedHdl, Timer *, void) } #ifdef DBG_UTIL -void SvxIconChoiceCtrl_Impl::SetEntryTextMode( SvxIconChoiceCtrlTextMode eMode, SvxIconChoiceCtrlEntry* pEntry ) +void SvxIconChoiceCtrl_Impl::SetEntryTextMode(SvxIconChoiceCtrlTextMode eMode, SvxIconChoiceCtrlEntry& rEntry) { - if( !pEntry ) + if (rEntry.eTextMode != eMode) { - if( eTextMode != eMode ) - { - eTextMode = eMode; - Arrange( true, 0, 0 ); - } - } - else - { - if( pEntry->eTextMode != eMode ) - { - pEntry->eTextMode = eMode; - InvalidateEntry( pEntry ); - pView->Invalidate( GetEntryBoundRect( pEntry ) ); - AdjustVirtSize( pEntry->aRect ); - } + rEntry.eTextMode = eMode; + InvalidateEntry(&rEntry ); + pView->Invalidate(GetEntryBoundRect(&rEntry)); + AdjustVirtSize(rEntry.aRect); } } #endif diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx index f8e09856c92c..2afe55a21258 100644 --- a/vcl/source/control/ivctrl.cxx +++ b/vcl/source/control/ivctrl.cxx @@ -239,9 +239,9 @@ void SvtIconChoiceCtrl::Command(const CommandEvent& rCEvt) } #ifdef DBG_UTIL -void SvtIconChoiceCtrl::SetEntryTextMode( SvxIconChoiceCtrlTextMode eMode, SvxIconChoiceCtrlEntry* pEntry ) +void SvtIconChoiceCtrl::SetEntryTextMode( SvxIconChoiceCtrlTextMode eMode, SvxIconChoiceCtrlEntry& rEntry ) { - _pImpl->SetEntryTextMode( eMode, pEntry ); + _pImpl->SetEntryTextMode(eMode, rEntry); } #endif From 9877ab0b5ebadf70a138db582f298bf0e5d1cd9e Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 1 Jul 2024 16:29:56 +0200 Subject: [PATCH 024/232] tdf#161853 vcl: Drop unnecessary indirection for icon choice control Just call `SvxIconChoiceCtrl_Impl::SetEntryTextMode` directly, instead of doing so via the `pView`, and drop the now unused `SvtIconChoiceCtrl::SetEntryTextMode`. Change-Id: I9b42f1bee6984e2c34814addd998cefd56dbe7f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169837 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- include/vcl/toolkit/ivctrl.hxx | 4 ---- vcl/source/control/imivctl1.cxx | 4 ++-- vcl/source/control/ivctrl.cxx | 7 ------- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/include/vcl/toolkit/ivctrl.hxx b/include/vcl/toolkit/ivctrl.hxx index ad7aa626ca5a..7b593d04ba8d 100644 --- a/include/vcl/toolkit/ivctrl.hxx +++ b/include/vcl/toolkit/ivctrl.hxx @@ -222,10 +222,6 @@ public: SvxIconChoiceCtrlEntry* GetSelectedEntry() const; -#ifdef DBG_UTIL - void SetEntryTextMode(SvxIconChoiceCtrlTextMode eMode, SvxIconChoiceCtrlEntry& rEntry); -#endif - tools::Rectangle GetBoundingBox( SvxIconChoiceCtrlEntry* pEntry ) const; tools::Rectangle GetEntryCharacterBounds( const sal_Int32 _nEntryPos, const sal_Int32 _nCharacterIndex ) const; diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index ed52e38a39a4..e9dbc5690a56 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -979,12 +979,12 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) if( rKEvt.GetKeyCode().IsShift() ) { if( pCursor ) - pView->SetEntryTextMode(SvxIconChoiceCtrlTextMode::Full, *pCursor); + SetEntryTextMode(SvxIconChoiceCtrlTextMode::Full, *pCursor); } if( rKEvt.GetKeyCode().IsMod1() ) { if( pCursor ) - pView->SetEntryTextMode(SvxIconChoiceCtrlTextMode::Short, *pCursor); + SetEntryTextMode(SvxIconChoiceCtrlTextMode::Short, *pCursor); } break; #endif diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx index 2afe55a21258..61fa316bd796 100644 --- a/vcl/source/control/ivctrl.cxx +++ b/vcl/source/control/ivctrl.cxx @@ -238,13 +238,6 @@ void SvtIconChoiceCtrl::Command(const CommandEvent& rCEvt) Control::Command(rCEvt); } -#ifdef DBG_UTIL -void SvtIconChoiceCtrl::SetEntryTextMode( SvxIconChoiceCtrlTextMode eMode, SvxIconChoiceCtrlEntry& rEntry ) -{ - _pImpl->SetEntryTextMode(eMode, rEntry); -} -#endif - sal_Int32 SvtIconChoiceCtrl::GetEntryCount() const { return _pImpl ? _pImpl->GetEntryCount() : 0; From 2d581a8a2236b13a84ba9fbc5c1837bee3f7b7a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Tue, 2 Jul 2024 08:57:05 +0100 Subject: [PATCH 025/232] cid#1607340 Use of auto that causes a copy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I46bd4bf5cf6df3dba8518b40a8a9ace7dfef2e62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169853 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- cui/source/dialogs/SpellDialog.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index a0c9819f0485..3851a01e596e 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -1248,9 +1248,9 @@ namespace void ExtractErrorDescription(const EECharAttrib& rEECharAttrib, SpellErrorDescription& rSpellErrorDescription) { css::uno::Sequence aSequence; - const auto pGrabBag = static_cast(rEECharAttrib.pAttr)->GetGrabBag(); - const auto iter = pGrabBag.find(u"SpellErrorDescription"_ustr); - assert(iter != pGrabBag.end()); + const auto& rGrabBag = static_cast(rEECharAttrib.pAttr)->GetGrabBag(); + const auto iter = rGrabBag.find(u"SpellErrorDescription"_ustr); + assert(iter != rGrabBag.end()); iter->second >>= aSequence; rSpellErrorDescription.fromSequence(aSequence); } From 6a0d4d45d9e5933028f437ebd6756946a127e4a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Tue, 2 Jul 2024 08:58:45 +0100 Subject: [PATCH 026/232] cid#1554879 Use of auto that causes a copy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I5989905a2efeff23cf803832a5d65857c64b036e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169854 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- svx/source/tbxctrls/linectrl.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/svx/source/tbxctrls/linectrl.cxx b/svx/source/tbxctrls/linectrl.cxx index a47665d1bde5..617bdb8f8fbc 100644 --- a/svx/source/tbxctrls/linectrl.cxx +++ b/svx/source/tbxctrls/linectrl.cxx @@ -543,9 +543,9 @@ void SvxLineBox::Fill( const XDashListRef &pList ) mxLineStyleSet->InsertItem(1, Image(), pList->GetStringForUiNoLine()); // entry for solid line - auto aBmp = pList->GetBitmapForUISolidLine(); - Size aBmpSize = aBmp.GetSizePixel(); - mxLineStyleSet->InsertItem(2, Image(aBmp), pList->GetStringForUiSolidLine()); + const auto& rBmp = pList->GetBitmapForUISolidLine(); + Size aBmpSize = rBmp.GetSizePixel(); + mxLineStyleSet->InsertItem(2, Image(rBmp), pList->GetStringForUiSolidLine()); // entries for dashed lines tools::Long nCount = pList->Count(); From b7a5d0e5669863033156ef15190c9fd509c45fa3 Mon Sep 17 00:00:00 2001 From: Hossein Date: Thu, 27 Jun 2024 09:55:06 +0100 Subject: [PATCH 027/232] tdf#149256 Ship LibreOfficeKit headers in packages Add LibreOfficeKitGtk.h Change-Id: Ia575b9b9cb46ce4225d9030bf01453c5b3359325 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169623 Tested-by: Jenkins Reviewed-by: Hossein Tested-by: Hossein --- odk/CppunitTest_odk_checkapi.mk | 1 + odk/Package_odk_headers.mk | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/odk/CppunitTest_odk_checkapi.mk b/odk/CppunitTest_odk_checkapi.mk index 1c93be6a2473..e27879d91e1f 100644 --- a/odk/CppunitTest_odk_checkapi.mk +++ b/odk/CppunitTest_odk_checkapi.mk @@ -15,6 +15,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,odk_checkapi,\ $(eval $(call gb_CppunitTest_add_cxxflags,odk_checkapi,\ $(gb_CXX03FLAGS) \ + $(if $(ENABLE_GTK3),$(GTK3_CFLAGS)) \ )) $(eval $(call gb_CppunitTest_set_external_code,odk_checkapi)) diff --git a/odk/Package_odk_headers.mk b/odk/Package_odk_headers.mk index f4f7d9ba3a73..c103c23d4b27 100644 --- a/odk/Package_odk_headers.mk +++ b/odk/Package_odk_headers.mk @@ -1,4 +1,3 @@ - # -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- # # This file is part of the LibreOffice project. @@ -185,6 +184,7 @@ $(eval $(call gb_Package_add_files_with_dir,odk_headers,$(SDKDIRNAME)/include,\ uno/mapping.hxx \ uno/sequence2.h \ uno/threadpool.h \ + $(if $(ENABLE_GTK3),LibreOfficeKit/LibreOfficeKitGtk.h) \ LibreOfficeKit/LibreOfficeKit.hxx \ LibreOfficeKit/LibreOfficeKitEnums.h \ LibreOfficeKit/LibreOfficeKit.h \ From 458f5a7e8c2cd2e38eb744f6046f27874f0a0fa0 Mon Sep 17 00:00:00 2001 From: Beeram_12 Date: Wed, 1 May 2024 22:33:06 +0530 Subject: [PATCH 028/232] tdf#42982 Improve UNO API error reporting Change-Id: Ia581b91ce0b08ff1117daba691197be555951992 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166971 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas Reviewed-by: Ilmari Lauhakangas --- comphelper/source/container/embeddedobjectcontainer.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx index 0f831db3d6c5..561548ebc364 100644 --- a/comphelper/source/container/embeddedobjectcontainer.cxx +++ b/comphelper/source/container/embeddedobjectcontainer.cxx @@ -712,7 +712,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CopyAndGetEmb // this is an OOo link, it has no persistence OUString aURL = xOrigLinkage->getLinkURL(); if ( aURL.isEmpty() ) - throw uno::RuntimeException(); + throw uno::RuntimeException("URL of the linked object is empty"); // create new linked object from the URL the link is based on uno::Reference < embed::XEmbeddedObjectCreator > xCreator = @@ -760,7 +760,7 @@ uno::Reference < embed::XEmbeddedObject > EmbeddedObjectContainer::CopyAndGetEmb // copy all the properties from xOrigProps to xTargetProps uno::Reference< beans::XPropertySetInfo > xOrigInfo = xOrigProps->getPropertySetInfo(); if ( !xOrigInfo.is() ) - throw uno::RuntimeException(); + throw uno::RuntimeException("Object has no properties"); const uno::Sequence< beans::Property > aPropertiesList = xOrigInfo->getProperties(); for ( const auto & p : aPropertiesList ) From 4eb077f3216c5516a45d1a6951339e8fc5686f3e Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Tue, 2 Jul 2024 09:17:12 +0200 Subject: [PATCH 029/232] tdf#161859: Typo in AutoText (Polish) Change-Id: I66c5c2b12abdc0aa71e4c6afaa8520024874a230 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169851 Tested-by: Jenkins Reviewed-by: Julien Nabet --- extras/source/autotext/lang/pl/standard/PODDOK/PODDOK.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/source/autotext/lang/pl/standard/PODDOK/PODDOK.xml b/extras/source/autotext/lang/pl/standard/PODDOK/PODDOK.xml index bdf815bddfa0..e1ebe73869f4 100644 --- a/extras/source/autotext/lang/pl/standard/PODDOK/PODDOK.xml +++ b/extras/source/autotext/lang/pl/standard/PODDOK/PODDOK.xml @@ -1,2 +1,2 @@ -sedecznie dziękujemy za ofertę podjęcia pracy w <field:company>.Niestety nie dysponujemy w tej chwili stanowiskiem pracy odpowiadającym Pańskim życzeniom i kwalifikacjom. Ta sytuacja może się oczywiście w każdej chwili zmienić.Jeśli wyrazi Pani/Pan zgodę, to zatrzymamy Pański list motywacyjny do naszej dyspozycji. W tej sytuacji skontaktujemy się ewentualnie z Panią/z Panem w późniejszym terminie. \ No newline at end of file +serdecznie dziękujemy za ofertę podjęcia pracy w <field:company>.Niestety nie dysponujemy w tej chwili stanowiskiem pracy odpowiadającym Pańskim życzeniom i kwalifikacjom. Ta sytuacja może się oczywiście w każdej chwili zmienić.Jeśli wyrazi Pani/Pan zgodę, to zatrzymamy Pański list motywacyjny do naszej dyspozycji. W tej sytuacji skontaktujemy się ewentualnie z Panią/z Panem w późniejszym terminie. From 544524820715c659c05524aae68b69bfa0422898 Mon Sep 17 00:00:00 2001 From: Heiko Tietze Date: Tue, 2 Jul 2024 08:08:10 +0200 Subject: [PATCH 030/232] Related tdf#161796 - Label change on gtk3 together with icon Sequence matters Change-Id: I0a591cc1ec8c3c506ece47dc89f368096f6c8e51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169850 Tested-by: Jenkins Reviewed-by: Heiko Tietze --- sfx2/source/dialog/backingwindow.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx index 4d166d61f424..ee2e4459cf63 100644 --- a/sfx2/source/dialog/backingwindow.cxx +++ b/sfx2/source/dialog/backingwindow.cxx @@ -196,8 +196,9 @@ BackingWindow::BackingWindow(vcl::Window* i_pParent) // tdf#161796 make the extension button show the donation page if (officecfg::Office::Common::Misc::ShowDonation::get()) { - mxExtensionsButton->set_label(SfxResId(STR_DONATE_BUTTON)); - mxExtensionsButton->set_from_icon_name(BMP_DONATE); + OUString test = SfxResId(STR_DONATE_BUTTON); + mxExtensionsButton->set_from_icon_name(BMP_DONATE); // icon first needed on gtk3 to apply the label + mxExtensionsButton->set_label(test); } mxDropTarget = mxAllRecentThumbnails->GetDropTarget(); From 62077cdf444dabe512e65abef7fa832c82f78c41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Tue, 2 Jul 2024 09:02:57 +0100 Subject: [PATCH 031/232] cid#1608155 Argument cannot be negative MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I60ca191631f3874e2c7f1d037272189db140f25b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169855 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- sw/source/uibase/sidebar/QuickFindPanel.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/source/uibase/sidebar/QuickFindPanel.cxx b/sw/source/uibase/sidebar/QuickFindPanel.cxx index cdf7afa68947..4da7639ca8c2 100644 --- a/sw/source/uibase/sidebar/QuickFindPanel.cxx +++ b/sw/source/uibase/sidebar/QuickFindPanel.cxx @@ -335,7 +335,7 @@ IMPL_LINK_NOARG(QuickFindPanel, SearchFindsListSelectionChangedHandler, weld::Tr if (sId[0] == '-') return; - std::unique_ptr& rxPaM = m_vPaMs[sId.toInt64()]; + std::unique_ptr& rxPaM = m_vPaMs[sId.toUInt64()]; m_pWrtShell->StartAction(); bool bFound = false; From a0fe67b2456f5ffb66b6eb0b27c1a19c1347e25e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Tue, 2 Jul 2024 09:09:08 +0100 Subject: [PATCH 032/232] cid#1606744 Dereference after null check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ifbb6417903a2751068597815ad91e90ce6d8f35a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169856 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- svx/source/svdraw/svdmrkv.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index 6400f9748d91..b94721c85e24 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -1260,7 +1260,7 @@ void SdrMarkView::SetMarkHandlesForLOKit(tools::Rectangle const & rRect, const S if (pViewShell != pOtherShell) SfxLokHelper::notifyOtherView(pViewShell, pOtherShell, LOK_CALLBACK_GRAPHIC_VIEW_SELECTION, "selection", sSelectionTextView); } - else + else if (pViewShell) { // We have a new selection, so both pViewShell and the // other views want to know about it. From 9661b8694c46b8c3a4856e50e2c1f3b82108a973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Tue, 2 Jul 2024 09:12:51 +0100 Subject: [PATCH 033/232] cid#1606605 Logically dead code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I54d6445efb3e63cd5c74dc0da115a75fea66edef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169857 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sc/source/ui/attrdlg/scdlgfact.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc/source/ui/attrdlg/scdlgfact.cxx b/sc/source/ui/attrdlg/scdlgfact.cxx index 1dba14884dbc..79f725011804 100644 --- a/sc/source/ui/attrdlg/scdlgfact.cxx +++ b/sc/source/ui/attrdlg/scdlgfact.cxx @@ -1354,7 +1354,7 @@ VclPtr ScAbstractDialogFactory_Impl::CreateScHFEditDlg( we break; } - return xDlg ? VclPtr::Create(std::move(xDlg)) : nullptr; + return VclPtr::Create(std::move(xDlg)); } VclPtr ScAbstractDialogFactory_Impl::CreateScStyleDlg(weld::Window* pParent, From 21f58d0411deb3962de0270e3adbdabf2027a7ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Tue, 2 Jul 2024 09:32:00 +0100 Subject: [PATCH 034/232] cid#1545929 Using invalid iterator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7d798b233eae9906f9caff9da411b27d3e26ebb9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169858 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- editeng/source/misc/svxacorr.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/editeng/source/misc/svxacorr.cxx b/editeng/source/misc/svxacorr.cxx index 677919211c88..fb69464d2110 100644 --- a/editeng/source/misc/svxacorr.cxx +++ b/editeng/source/misc/svxacorr.cxx @@ -2072,7 +2072,9 @@ SvxAutoCorrect::SearchWordsInList( CreateLanguageFile(aLanguageTag, false))) { //the language is available - so bring it on - SvxAutoCorrectLanguageLists& rList = m_aLangTable.find(aLanguageTag)->second; + const auto iter = m_aLangTable.find(aLanguageTag); + assert(iter != m_aLangTable.end()); + SvxAutoCorrectLanguageLists& rList = iter->second; auto pRet = lcl_SearchWordsInList( &rList, rTxt, rStt, nEndPos ); if( pRet ) { From 4d8ba2f283435553184e7ef67b8b09b85905ee6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Tue, 2 Jul 2024 09:33:42 +0100 Subject: [PATCH 035/232] cid#1545549 silence Using invalid iterator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I6374cdc5230f46c8064ca34d57ff1abc4f3d84aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169859 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- xmloff/source/text/txtflde.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index 80a98f3dc5c6..ad6cf90b3be9 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -779,6 +779,8 @@ void XMLTextFieldExport::ExportFieldAutoStyle( aMapIter = moUsedMasters->find(xOurText); } + assert(aMapIter != moUsedMasters->end()); + // insert this text field master OUString sFieldMasterName = GetStringProperty( gsPropertyInstanceName, xDepField->getTextFieldMaster()); From 52dc33d76ff990ca7a264583dc1c22f474ee3290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Tue, 2 Jul 2024 09:35:49 +0100 Subject: [PATCH 036/232] cid#1608558 Use of auto that causes a copy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie09084cdd9060db28905cb693c5b010a760876d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169860 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sw/source/uibase/uiview/viewtab.cxx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx index a454b7fd87a6..fb1cec99c40c 100644 --- a/sw/source/uibase/uiview/viewtab.cxx +++ b/sw/source/uibase/uiview/viewtab.cxx @@ -653,14 +653,9 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) case SID_TABSTOP_ADD_OR_CHANGE: if (pReqArgs) { - const auto aIndexItem = static_cast(pReqArgs->Get(SID_TABSTOP_ATTR_INDEX)); - const auto aPositionItem = static_cast(pReqArgs->Get(SID_TABSTOP_ATTR_POSITION)); - const auto aRemoveItem = static_cast(pReqArgs->Get(SID_TABSTOP_ATTR_REMOVE)); - const sal_Int32 nIndex = aIndexItem.GetValue(); - const sal_Int32 nPosition = aPositionItem.GetValue(); - const bool bRemove = aRemoveItem.GetValue(); - - + const sal_Int32 nIndex = static_cast(pReqArgs->Get(SID_TABSTOP_ATTR_INDEX)).GetValue(); + const sal_Int32 nPosition = static_cast(pReqArgs->Get(SID_TABSTOP_ATTR_POSITION)).GetValue(); + const bool bRemove = static_cast(pReqArgs->Get(SID_TABSTOP_ATTR_REMOVE)).GetValue(); SfxItemSetFixed aItemSet(GetPool()); rSh.GetCurAttr(aItemSet); From a3fe1c6fa79c00dad9c62c8f45a084a938083a01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Tue, 2 Jul 2024 09:38:23 +0100 Subject: [PATCH 037/232] cid#1557889 Use of auto that causes a copy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I6c510fa69e8db6ddc6ca6b9a169f4181ef62adab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169861 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- ucb/source/ucp/cmis/cmis_content.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index 6bd5146bb7bc..2fc413b913bd 100644 --- a/ucb/source/ucp/cmis/cmis_content.cxx +++ b/ucb/source/ucp/cmis/cmis_content.cxx @@ -1130,8 +1130,7 @@ namespace cmis std::vector< std::string > aPaths = pPwc->getPaths( ); if ( !aPaths.empty() ) { - auto sPath = aPaths.front( ); - aCmisUrl.setObjectPath( STD_TO_OUSTR( sPath ) ); + aCmisUrl.setObjectPath(STD_TO_OUSTR(aPaths.front())); } else { From f457046fa40af781a518a4962571c1056a2c326d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Tue, 2 Jul 2024 09:41:05 +0100 Subject: [PATCH 038/232] cid#1556572 Use of auto that causes a copy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Id6b1c25a12e43ee60dc01293e96c02d4f027c7f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169862 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sfx2/source/doc/objstor.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index efc60481c7e5..2dc0825e990e 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -3392,17 +3392,17 @@ bool SfxObjectShell::PreDoSaveAs_Impl(const OUString& rFileName, const OUString& for(int i = 0 ; i< rArgs.getLength() ; ++i) { - auto aProp = rArgs[i]; - if(aProp.Name == "EncryptFile") + const auto& rProp = rArgs[i]; + if (rProp.Name == "EncryptFile") { - pSaveToFilterDataOptions[0].Name = aProp.Name; - pSaveToFilterDataOptions[0].Value = aProp.Value; + pSaveToFilterDataOptions[0].Name = rProp.Name; + pSaveToFilterDataOptions[0].Value = rProp.Value; bRet = true; } - if(aProp.Name == "DocumentOpenPassword") + else if (rProp.Name == "DocumentOpenPassword") { - pSaveToFilterDataOptions[1].Name = aProp.Name; - pSaveToFilterDataOptions[1].Value = aProp.Value; + pSaveToFilterDataOptions[1].Name = rProp.Name; + pSaveToFilterDataOptions[1].Value = rProp.Value; bRet = true; } } From 49e3ebcaa1ff06e9ae35ba4117e2465e447cee78 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Tue, 2 Jul 2024 11:09:38 +0200 Subject: [PATCH 039/232] CppunitTest_toolkit: simplify code Change-Id: Id5fd9d1ebe11551b73b44b6d12414d5418dd4de1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169863 Tested-by: Xisco Fauli Reviewed-by: Xisco Fauli --- toolkit/qa/cppunit/Dialog.cxx | 19 ++++--------------- toolkit/qa/cppunit/EventContainer.cxx | 17 +++-------------- 2 files changed, 7 insertions(+), 29 deletions(-) diff --git a/toolkit/qa/cppunit/Dialog.cxx b/toolkit/qa/cppunit/Dialog.cxx index c6f6f5699a8e..607a1863fc0b 100644 --- a/toolkit/qa/cppunit/Dialog.cxx +++ b/toolkit/qa/cppunit/Dialog.cxx @@ -28,34 +28,23 @@ namespace /// Test dialogs constructed via UNO class DialogTest : public test::BootstrapFixture, public unotest::MacrosTest { -protected: - uno::Reference mxContext; - -public: - virtual void setUp() override; }; -void DialogTest::setUp() -{ - test::BootstrapFixture::setUp(); - - mxContext.set(comphelper::getComponentContext(getMultiServiceFactory())); -} - CPPUNIT_TEST_FIXTURE(DialogTest, testDialogSizeable) { uno::Reference xDialog; - uno::Reference xFactory(mxContext->getServiceManager(), + uno::Reference xFactory(mxComponentContext->getServiceManager(), uno::UNO_SET_THROW); uno::Reference xControlModel( xFactory->createInstanceWithContext(u"com.sun.star.awt.UnoControlDialogModel"_ustr, - mxContext), + mxComponentContext), uno::UNO_QUERY_THROW); uno::Reference xPropSet(xControlModel, uno::UNO_QUERY_THROW); xPropSet->setPropertyValue(u"Sizeable"_ustr, uno::Any(true)); - uno::Reference xControl = awt::UnoControlDialog::create(mxContext); + uno::Reference xControl + = awt::UnoControlDialog::create(mxComponentContext); xControl->setModel(xControlModel); xControl->setVisible(true); xDialog.set(xControl, uno::UNO_QUERY_THROW); diff --git a/toolkit/qa/cppunit/EventContainer.cxx b/toolkit/qa/cppunit/EventContainer.cxx index ab13e9fdf4f7..1551f0584a25 100644 --- a/toolkit/qa/cppunit/EventContainer.cxx +++ b/toolkit/qa/cppunit/EventContainer.cxx @@ -32,28 +32,17 @@ namespace /// Test EventContainer class class EventContainerTest : public test::BootstrapFixture { -protected: - Reference mxContext; - -public: - virtual void setUp() override; }; -void EventContainerTest::setUp() -{ - test::BootstrapFixture::setUp(); - - mxContext.set(comphelper::getComponentContext(getMultiServiceFactory())); -} - // Make sure that EventContainer keeps insertion order, and does not reorder its elements. // Otherwise this would break macro signatures. CPPUNIT_TEST_FIXTURE(EventContainerTest, testInsertOrder) { - Reference xFactory(mxContext->getServiceManager(), UNO_SET_THROW); + Reference xFactory(mxComponentContext->getServiceManager(), + UNO_SET_THROW); Reference xControlModel( xFactory->createInstanceWithContext(u"com.sun.star.awt.UnoControlDialogModel"_ustr, - mxContext), + mxComponentContext), UNO_QUERY_THROW); Reference xPropSet(xControlModel, UNO_QUERY_THROW); From 83a8d5a275e9ba636a133ff25bdb53974aae87ae Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Tue, 2 Jul 2024 11:18:04 +0200 Subject: [PATCH 040/232] BootstrapFixture: get rid of mxComponentContext Change-Id: I0318485c3c0159277e47096e0c7e0df8ed109ea4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169865 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- extensions/qa/bibliography/bibliography.cxx | 3 +- filter/qa/pdf.cxx | 2 +- framework/qa/cppunit/CheckXTitle.cxx | 4 +-- framework/qa/cppunit/dispatchtest.cxx | 2 +- framework/qa/cppunit/services.cxx | 2 +- .../cppunit/test_defaultnumberingprovider.cxx | 18 ++++++------ include/test/bootstrapfixture.hxx | 2 -- sd/qa/unit/export-tests-ooxml3.cxx | 4 +-- svx/qa/unit/unodraw.cxx | 2 +- sw/qa/api/SwXAutoTextContainer.cxx | 2 +- sw/qa/api/SwXBookmark.cxx | 2 +- sw/qa/api/SwXBookmarks.cxx | 2 +- sw/qa/api/SwXChapterNumbering.cxx | 2 +- sw/qa/api/SwXDocumentIndex.cxx | 2 +- sw/qa/api/SwXDocumentIndexMark.cxx | 2 +- sw/qa/api/SwXDocumentIndexes.cxx | 2 +- sw/qa/api/SwXDocumentSettings.cxx | 2 +- sw/qa/api/SwXFieldEnumeration.cxx | 2 +- sw/qa/api/SwXFootnote.cxx | 2 +- sw/qa/api/SwXFootnotes.cxx | 2 +- sw/qa/api/SwXFrames.cxx | 2 +- sw/qa/api/SwXNumberingRules.cxx | 2 +- sw/qa/api/SwXParagraphEnumeration.cxx | 2 +- sw/qa/api/SwXReferenceMark.cxx | 2 +- sw/qa/api/SwXReferenceMarks.cxx | 2 +- sw/qa/api/SwXStyleFamilies.cxx | 2 +- sw/qa/api/SwXTableCellText.cxx | 2 +- sw/qa/api/SwXTextEmbeddedObjects.cxx | 2 +- sw/qa/api/SwXTextField.cxx | 2 +- sw/qa/api/SwXTextFieldMasters.cxx | 2 +- sw/qa/api/SwXTextFieldTypes.cxx | 2 +- sw/qa/api/SwXTextFrame.cxx | 2 +- sw/qa/api/SwXTextSections.cxx | 2 +- sw/qa/api/SwXTextTables.cxx | 2 +- sw/qa/extras/uiwriter/uiwriter8.cxx | 2 +- test/source/a11y/accessibletestbase.cxx | 2 +- test/source/bootstrapfixture.cxx | 2 -- toolkit/qa/cppunit/Dialog.cxx | 7 ++--- toolkit/qa/cppunit/EventContainer.cxx | 5 ++-- vcl/qa/cppunit/filter/ipdf/ipdf.cxx | 2 +- writerperfect/qa/unit/EPUBExportTest.cxx | 5 ++-- xmlscript/qa/cppunit/test.cxx | 10 +++---- xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx | 24 ++++++++-------- xmlsecurity/qa/unit/signing/signing.cxx | 28 +++++++++---------- xmlsecurity/qa/unit/signing/signing2.cxx | 2 +- 45 files changed, 85 insertions(+), 93 deletions(-) diff --git a/extensions/qa/bibliography/bibliography.cxx b/extensions/qa/bibliography/bibliography.cxx index 1657fec35db9..6c716269ad9b 100644 --- a/extensions/qa/bibliography/bibliography.cxx +++ b/extensions/qa/bibliography/bibliography.cxx @@ -26,8 +26,7 @@ class Test : public test::BootstrapFixture, public unotest::MacrosTest CPPUNIT_TEST_FIXTURE(Test, testBibliographyLoader) { // Given a bibliography provider: - uno::Reference xBibAccess - = frame::Bibliography::create(mxComponentContext); + uno::Reference xBibAccess = frame::Bibliography::create(m_xContext); uno::Reference xPropSet(xBibAccess, uno::UNO_QUERY); uno::Sequence aSeq; diff --git a/filter/qa/pdf.cxx b/filter/qa/pdf.cxx index 01a77ff56ff3..d9dfc4ef17dd 100644 --- a/filter/qa/pdf.cxx +++ b/filter/qa/pdf.cxx @@ -53,7 +53,7 @@ CPPUNIT_TEST_FIXTURE(Test, testSignCertificateSubjectName) return; uno::Reference xSEInitializer - = xml::crypto::SEInitializer::create(mxComponentContext); + = xml::crypto::SEInitializer::create(m_xContext); uno::Reference xSecurityContext = xSEInitializer->createSecurityContext(OUString()); uno::Reference xSecurityEnvironment diff --git a/framework/qa/cppunit/CheckXTitle.cxx b/framework/qa/cppunit/CheckXTitle.cxx index 175e473fdd91..ce66c7379f02 100644 --- a/framework/qa/cppunit/CheckXTitle.cxx +++ b/framework/qa/cppunit/CheckXTitle.cxx @@ -51,7 +51,7 @@ CPPUNIT_TEST_FIXTURE(Test, checkDefaultTitle) uno::Reference xTitle(xFrame, css::uno::UNO_QUERY); OUString defaultTitle = xTitle->getTitle(); - uno::Reference xParser(util::URLTransformer::create(mxComponentContext)); + uno::Reference xParser(util::URLTransformer::create(m_xContext)); // Open print preview window and get title. util::URL printPreviewURL; @@ -113,7 +113,7 @@ CPPUNIT_TEST_FIXTURE(Test, setTitleAndCheck) uno::Reference xDispatchProvider(xModel->getCurrentController(), uno::UNO_QUERY); - uno::Reference xParser(util::URLTransformer::create(mxComponentContext)); + uno::Reference xParser(util::URLTransformer::create(m_xContext)); util::URL printPreviewURL; printPreviewURL.Complete = u".uno::PrintPreview"_ustr; diff --git a/framework/qa/cppunit/dispatchtest.cxx b/framework/qa/cppunit/dispatchtest.cxx index 42cf7ceed0a4..a6c7ccd20a69 100644 --- a/framework/qa/cppunit/dispatchtest.cxx +++ b/framework/qa/cppunit/dispatchtest.cxx @@ -182,7 +182,7 @@ CPPUNIT_TEST_FIXTURE(DispatchTest, testSfxOfficeDispatchDispose) uno::Reference xFrame(xController->getFrame(), uno::UNO_QUERY); CPPUNIT_ASSERT(xFrame.is()); - uno::Reference xParser(util::URLTransformer::create(mxComponentContext)); + uno::Reference xParser(util::URLTransformer::create(m_xContext)); util::URL url; url.Complete = xModel->getURL() + "#dummy"; xParser->parseStrict(url); diff --git a/framework/qa/cppunit/services.cxx b/framework/qa/cppunit/services.cxx index baf39ffa6a3f..ccc8ae255267 100644 --- a/framework/qa/cppunit/services.cxx +++ b/framework/qa/cppunit/services.cxx @@ -118,7 +118,7 @@ CPPUNIT_TEST_FIXTURE(Test, testURLTransformer_parseSmart) css::util::URL aURL; aURL.Complete = "www.example.com:8080/foo/bar?q=baz#F"; - css::uno::Reference xParser(css::util::URLTransformer::create(mxComponentContext)); + css::uno::Reference xParser(css::util::URLTransformer::create(m_xContext)); CPPUNIT_ASSERT(xParser->parseSmart(aURL, u"http:"_ustr)); CPPUNIT_ASSERT_EQUAL(u"http://www.example.com:8080/foo/bar?q=baz#F"_ustr, aURL.Complete); CPPUNIT_ASSERT_EQUAL(u"http://www.example.com:8080/foo/bar"_ustr, aURL.Main); diff --git a/i18npool/qa/cppunit/test_defaultnumberingprovider.cxx b/i18npool/qa/cppunit/test_defaultnumberingprovider.cxx index 209fb47684f6..d18bd4984814 100644 --- a/i18npool/qa/cppunit/test_defaultnumberingprovider.cxx +++ b/i18npool/qa/cppunit/test_defaultnumberingprovider.cxx @@ -32,7 +32,7 @@ CPPUNIT_TEST_FIXTURE(I18npoolDefaultnumberingproviderTest, testNumberingIdentifi std::vector aFail; uno::Reference xFormatter( - text::DefaultNumberingProvider::create(mxComponentContext), uno::UNO_QUERY); + text::DefaultNumberingProvider::create(m_xContext), uno::UNO_QUERY); // Do not use getSupportedNumberingTypes() because it depends on // configuration whether CTL and CJK numberings are included or not. @@ -83,7 +83,7 @@ CPPUNIT_TEST_FIXTURE(I18npoolDefaultnumberingproviderTest, testArabicZero) { // 1 -> "01" uno::Reference xFormatter( - text::DefaultNumberingProvider::create(mxComponentContext), uno::UNO_QUERY); + text::DefaultNumberingProvider::create(m_xContext), uno::UNO_QUERY); uno::Sequence aProperties = { comphelper::makePropertyValue(u"NumberingType"_ustr, static_cast(style::NumberingType::ARABIC_ZERO)), @@ -109,7 +109,7 @@ CPPUNIT_TEST_FIXTURE(I18npoolDefaultnumberingproviderTest, testArabicZero3) { // 10 -> "010" uno::Reference xFormatter( - text::DefaultNumberingProvider::create(mxComponentContext), uno::UNO_QUERY); + text::DefaultNumberingProvider::create(m_xContext), uno::UNO_QUERY); uno::Sequence aProperties = { comphelper::makePropertyValue(u"NumberingType"_ustr, static_cast(style::NumberingType::ARABIC_ZERO3)), @@ -135,7 +135,7 @@ CPPUNIT_TEST_FIXTURE(I18npoolDefaultnumberingproviderTest, testArabicZero4) { // 100 -> "0100" uno::Reference xFormatter( - text::DefaultNumberingProvider::create(mxComponentContext), uno::UNO_QUERY); + text::DefaultNumberingProvider::create(m_xContext), uno::UNO_QUERY); uno::Sequence aProperties = { comphelper::makePropertyValue(u"NumberingType"_ustr, static_cast(style::NumberingType::ARABIC_ZERO4)), @@ -161,7 +161,7 @@ CPPUNIT_TEST_FIXTURE(I18npoolDefaultnumberingproviderTest, testArabicZero5) { // 1000 -> "01000" uno::Reference xFormatter( - text::DefaultNumberingProvider::create(mxComponentContext), uno::UNO_QUERY); + text::DefaultNumberingProvider::create(m_xContext), uno::UNO_QUERY); uno::Sequence aProperties = { comphelper::makePropertyValue(u"NumberingType"_ustr, static_cast(style::NumberingType::ARABIC_ZERO5)), @@ -187,7 +187,7 @@ CPPUNIT_TEST_FIXTURE(I18npoolDefaultnumberingproviderTest, testKoreanCounting) { // 1 -> "일" uno::Reference xFormatter( - text::DefaultNumberingProvider::create(mxComponentContext), uno::UNO_QUERY); + text::DefaultNumberingProvider::create(m_xContext), uno::UNO_QUERY); uno::Sequence aProperties = { comphelper::makePropertyValue( u"NumberingType"_ustr, static_cast(style::NumberingType::NUMBER_HANGUL_KO)), @@ -222,7 +222,7 @@ CPPUNIT_TEST_FIXTURE(I18npoolDefaultnumberingproviderTest, testKoreanLegal) { // 1 -> "하나" uno::Reference xFormatter( - text::DefaultNumberingProvider::create(mxComponentContext), uno::UNO_QUERY); + text::DefaultNumberingProvider::create(m_xContext), uno::UNO_QUERY); uno::Sequence aProperties = { comphelper::makePropertyValue( u"NumberingType"_ustr, static_cast(style::NumberingType::NUMBER_LEGAL_KO)), @@ -399,7 +399,7 @@ CPPUNIT_TEST_FIXTURE(I18npoolDefaultnumberingproviderTest, testKoreanDigital) { // 1 -> "일" uno::Reference xFormatter( - text::DefaultNumberingProvider::create(mxComponentContext), uno::UNO_QUERY); + text::DefaultNumberingProvider::create(m_xContext), uno::UNO_QUERY); uno::Sequence aProperties = { comphelper::makePropertyValue( u"NumberingType"_ustr, @@ -437,7 +437,7 @@ CPPUNIT_TEST_FIXTURE(I18npoolDefaultnumberingproviderTest, testKoreanDigital2) { // 1 -> "一" uno::Reference xFormatter( - text::DefaultNumberingProvider::create(mxComponentContext), uno::UNO_QUERY); + text::DefaultNumberingProvider::create(m_xContext), uno::UNO_QUERY); uno::Sequence aProperties = { comphelper::makePropertyValue( u"NumberingType"_ustr, diff --git a/include/test/bootstrapfixture.hxx b/include/test/bootstrapfixture.hxx index 438bba58a431..f512cabc7784 100644 --- a/include/test/bootstrapfixture.hxx +++ b/include/test/bootstrapfixture.hxx @@ -46,8 +46,6 @@ class OOO_DLLPUBLIC_TEST BootstrapFixture : public BootstrapFixtureBase bool m_bAssertOnDialog; protected: - css::uno::Reference mxComponentContext; - // A convenience function to be used to conditionally exclude tests not behaving properly // on UI scaling other than 1:1. Using this should be considered a temporary workaround, // until a proper fix is implemented that either considers the DPI properly in the test, or diff --git a/sd/qa/unit/export-tests-ooxml3.cxx b/sd/qa/unit/export-tests-ooxml3.cxx index 7493b24d3162..6afd99813242 100644 --- a/sd/qa/unit/export-tests-ooxml3.cxx +++ b/sd/qa/unit/export-tests-ooxml3.cxx @@ -319,7 +319,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf115005) // additional checks of the output file uno::Reference xNameAccess - = packages::zip::ZipFileAccess::createWithURL(mxComponentContext, maTempFile.GetURL()); + = packages::zip::ZipFileAccess::createWithURL(m_xContext, maTempFile.GetURL()); // check that the document contains original vector images const uno::Sequence names = xNameAccess->getElementNames(); @@ -352,7 +352,7 @@ int SdOOXMLExportTest3::testTdf115005_FallBack_Images(bool bAddReplacementImages // additional checks of the output file uno::Reference xNameAccess - = packages::zip::ZipFileAccess::createWithURL(mxComponentContext, maTempFile.GetURL()); + = packages::zip::ZipFileAccess::createWithURL(m_xContext, maTempFile.GetURL()); // check that the document contains original vector images const uno::Sequence names = xNameAccess->getElementNames(); diff --git a/svx/qa/unit/unodraw.cxx b/svx/qa/unit/unodraw.cxx index e65ec6528832..8dd5fa0be530 100644 --- a/svx/qa/unit/unodraw.cxx +++ b/svx/qa/unit/unodraw.cxx @@ -60,7 +60,7 @@ CPPUNIT_TEST_FIXTURE(UnodrawTest, testWriterGraphicExport) // Export it as JPEG. uno::Reference xExportFilter - = drawing::GraphicExportFilter::create(mxComponentContext); + = drawing::GraphicExportFilter::create(m_xContext); // This resulted in a css::lang::IllegalArgumentException for a Writer // picture. xExportFilter->setSourceDocument(xShape); diff --git a/sw/qa/api/SwXAutoTextContainer.cxx b/sw/qa/api/SwXAutoTextContainer.cxx index 5812e1ec0c44..4d6031a990e4 100644 --- a/sw/qa/api/SwXAutoTextContainer.cxx +++ b/sw/qa/api/SwXAutoTextContainer.cxx @@ -45,7 +45,7 @@ public: virtual void setUp() override { UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(mxComponentContext)); + mxDesktop.set(frame::Desktop::create(m_xContext)); } Reference init() override diff --git a/sw/qa/api/SwXBookmark.cxx b/sw/qa/api/SwXBookmark.cxx index 3e6bf37eacbb..f078357f36d1 100644 --- a/sw/qa/api/SwXBookmark.cxx +++ b/sw/qa/api/SwXBookmark.cxx @@ -42,7 +42,7 @@ public: virtual void setUp() override { UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(mxComponentContext)); + mxDesktop.set(frame::Desktop::create(m_xContext)); mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); CPPUNIT_ASSERT(mxComponent.is()); } diff --git a/sw/qa/api/SwXBookmarks.cxx b/sw/qa/api/SwXBookmarks.cxx index a3162f0053b6..0f1de2033509 100644 --- a/sw/qa/api/SwXBookmarks.cxx +++ b/sw/qa/api/SwXBookmarks.cxx @@ -45,7 +45,7 @@ public: virtual void setUp() override { UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(mxComponentContext)); + mxDesktop.set(frame::Desktop::create(m_xContext)); mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); CPPUNIT_ASSERT(mxComponent.is()); } diff --git a/sw/qa/api/SwXChapterNumbering.cxx b/sw/qa/api/SwXChapterNumbering.cxx index 7b090134109b..dfa9ef6145b3 100644 --- a/sw/qa/api/SwXChapterNumbering.cxx +++ b/sw/qa/api/SwXChapterNumbering.cxx @@ -44,7 +44,7 @@ public: virtual void setUp() override { UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(mxComponentContext)); + mxDesktop.set(frame::Desktop::create(m_xContext)); mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); CPPUNIT_ASSERT(mxComponent.is()); } diff --git a/sw/qa/api/SwXDocumentIndex.cxx b/sw/qa/api/SwXDocumentIndex.cxx index 9954f5bf3955..ffe38f42eabd 100644 --- a/sw/qa/api/SwXDocumentIndex.cxx +++ b/sw/qa/api/SwXDocumentIndex.cxx @@ -58,7 +58,7 @@ public: virtual void setUp() override { UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(mxComponentContext)); + mxDesktop.set(frame::Desktop::create(m_xContext)); mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); CPPUNIT_ASSERT(mxComponent.is()); } diff --git a/sw/qa/api/SwXDocumentIndexMark.cxx b/sw/qa/api/SwXDocumentIndexMark.cxx index 5206dbe068a5..cb736f3d60cc 100644 --- a/sw/qa/api/SwXDocumentIndexMark.cxx +++ b/sw/qa/api/SwXDocumentIndexMark.cxx @@ -70,7 +70,7 @@ void SwXDocumentIndexMark::setUp() { test::BootstrapFixture::setUp(); - mxDesktop.set(frame::Desktop::create(mxComponentContext)); + mxDesktop.set(frame::Desktop::create(m_xContext)); mxTextDocument = uno::Reference( loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr), uno::UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXDocumentIndexes.cxx b/sw/qa/api/SwXDocumentIndexes.cxx index 841609df5131..08de51571932 100644 --- a/sw/qa/api/SwXDocumentIndexes.cxx +++ b/sw/qa/api/SwXDocumentIndexes.cxx @@ -46,7 +46,7 @@ public: virtual void setUp() override { UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(mxComponentContext)); + mxDesktop.set(frame::Desktop::create(m_xContext)); mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); CPPUNIT_ASSERT(mxComponent.is()); } diff --git a/sw/qa/api/SwXDocumentSettings.cxx b/sw/qa/api/SwXDocumentSettings.cxx index 509bbfc3eb22..31fbdceef06e 100644 --- a/sw/qa/api/SwXDocumentSettings.cxx +++ b/sw/qa/api/SwXDocumentSettings.cxx @@ -61,7 +61,7 @@ void SwXDocumentSettings::setUp() { test::BootstrapFixture::setUp(); - mxDesktop.set(frame::Desktop::create(mxComponentContext)); + mxDesktop.set(frame::Desktop::create(m_xContext)); } void SwXDocumentSettings::tearDown() diff --git a/sw/qa/api/SwXFieldEnumeration.cxx b/sw/qa/api/SwXFieldEnumeration.cxx index 282d0322e051..e94d43ee4a5d 100644 --- a/sw/qa/api/SwXFieldEnumeration.cxx +++ b/sw/qa/api/SwXFieldEnumeration.cxx @@ -41,7 +41,7 @@ public: virtual void setUp() override { UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(mxComponentContext)); + mxDesktop.set(frame::Desktop::create(m_xContext)); mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); CPPUNIT_ASSERT(mxComponent.is()); } diff --git a/sw/qa/api/SwXFootnote.cxx b/sw/qa/api/SwXFootnote.cxx index 9f5d1e488bcf..f0e189e0aba2 100644 --- a/sw/qa/api/SwXFootnote.cxx +++ b/sw/qa/api/SwXFootnote.cxx @@ -85,7 +85,7 @@ void SwXFootnote::setUp() { test::BootstrapFixture::setUp(); - mxDesktop.set(frame::Desktop::create(mxComponentContext)); + mxDesktop.set(frame::Desktop::create(m_xContext)); mxTextDocument = Reference( loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr), uno::UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXFootnotes.cxx b/sw/qa/api/SwXFootnotes.cxx index 2d8f99aafed8..f6ac8a7e2b53 100644 --- a/sw/qa/api/SwXFootnotes.cxx +++ b/sw/qa/api/SwXFootnotes.cxx @@ -45,7 +45,7 @@ public: virtual void setUp() override { UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(mxComponentContext)); + mxDesktop.set(frame::Desktop::create(m_xContext)); mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); CPPUNIT_ASSERT(mxComponent.is()); } diff --git a/sw/qa/api/SwXFrames.cxx b/sw/qa/api/SwXFrames.cxx index 4cf72b9d42dc..41fa1beae80c 100644 --- a/sw/qa/api/SwXFrames.cxx +++ b/sw/qa/api/SwXFrames.cxx @@ -46,7 +46,7 @@ public: virtual void setUp() override { UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(mxComponentContext)); + mxDesktop.set(frame::Desktop::create(m_xContext)); mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); CPPUNIT_ASSERT(mxComponent.is()); } diff --git a/sw/qa/api/SwXNumberingRules.cxx b/sw/qa/api/SwXNumberingRules.cxx index 67de5660e4ca..46baadfde0b6 100644 --- a/sw/qa/api/SwXNumberingRules.cxx +++ b/sw/qa/api/SwXNumberingRules.cxx @@ -52,7 +52,7 @@ public: virtual void setUp() override { UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(mxComponentContext)); + mxDesktop.set(frame::Desktop::create(m_xContext)); mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); CPPUNIT_ASSERT(mxComponent.is()); } diff --git a/sw/qa/api/SwXParagraphEnumeration.cxx b/sw/qa/api/SwXParagraphEnumeration.cxx index f1dbac6c7ea4..0a8f08a17ed3 100644 --- a/sw/qa/api/SwXParagraphEnumeration.cxx +++ b/sw/qa/api/SwXParagraphEnumeration.cxx @@ -42,7 +42,7 @@ public: virtual void setUp() override { UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(mxComponentContext)); + mxDesktop.set(frame::Desktop::create(m_xContext)); mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); CPPUNIT_ASSERT(mxComponent.is()); } diff --git a/sw/qa/api/SwXReferenceMark.cxx b/sw/qa/api/SwXReferenceMark.cxx index 7cfb8e598622..a1f0814ead7f 100644 --- a/sw/qa/api/SwXReferenceMark.cxx +++ b/sw/qa/api/SwXReferenceMark.cxx @@ -44,7 +44,7 @@ public: virtual void setUp() override { UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(mxComponentContext)); + mxDesktop.set(frame::Desktop::create(m_xContext)); mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); CPPUNIT_ASSERT(mxComponent.is()); } diff --git a/sw/qa/api/SwXReferenceMarks.cxx b/sw/qa/api/SwXReferenceMarks.cxx index 22747741c72f..f03f3e78002a 100644 --- a/sw/qa/api/SwXReferenceMarks.cxx +++ b/sw/qa/api/SwXReferenceMarks.cxx @@ -48,7 +48,7 @@ public: virtual void setUp() override { UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(mxComponentContext)); + mxDesktop.set(frame::Desktop::create(m_xContext)); mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); CPPUNIT_ASSERT(mxComponent.is()); } diff --git a/sw/qa/api/SwXStyleFamilies.cxx b/sw/qa/api/SwXStyleFamilies.cxx index f5f959cd77cc..7c30896222e6 100644 --- a/sw/qa/api/SwXStyleFamilies.cxx +++ b/sw/qa/api/SwXStyleFamilies.cxx @@ -48,7 +48,7 @@ public: virtual void setUp() override { UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(mxComponentContext)); + mxDesktop.set(frame::Desktop::create(m_xContext)); mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); CPPUNIT_ASSERT(mxComponent.is()); } diff --git a/sw/qa/api/SwXTableCellText.cxx b/sw/qa/api/SwXTableCellText.cxx index 0f698b37154a..568d809a933f 100644 --- a/sw/qa/api/SwXTableCellText.cxx +++ b/sw/qa/api/SwXTableCellText.cxx @@ -49,7 +49,7 @@ public: virtual void setUp() override { UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(mxComponentContext)); + mxDesktop.set(frame::Desktop::create(m_xContext)); mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); CPPUNIT_ASSERT(mxComponent.is()); } diff --git a/sw/qa/api/SwXTextEmbeddedObjects.cxx b/sw/qa/api/SwXTextEmbeddedObjects.cxx index 36afea6ca1dc..0ee5ed269702 100644 --- a/sw/qa/api/SwXTextEmbeddedObjects.cxx +++ b/sw/qa/api/SwXTextEmbeddedObjects.cxx @@ -51,7 +51,7 @@ public: virtual void setUp() override { UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(mxComponentContext)); + mxDesktop.set(frame::Desktop::create(m_xContext)); mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); CPPUNIT_ASSERT(mxComponent.is()); } diff --git a/sw/qa/api/SwXTextField.cxx b/sw/qa/api/SwXTextField.cxx index 2cc708380da0..fe93fc7ff141 100644 --- a/sw/qa/api/SwXTextField.cxx +++ b/sw/qa/api/SwXTextField.cxx @@ -54,7 +54,7 @@ struct SwXTextField final : public UnoApiTest, virtual void setUp() override { UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(mxComponentContext)); + mxDesktop.set(frame::Desktop::create(m_xContext)); mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); CPPUNIT_ASSERT(mxComponent.is()); } diff --git a/sw/qa/api/SwXTextFieldMasters.cxx b/sw/qa/api/SwXTextFieldMasters.cxx index ae233d595f51..27fe5aaee579 100644 --- a/sw/qa/api/SwXTextFieldMasters.cxx +++ b/sw/qa/api/SwXTextFieldMasters.cxx @@ -45,7 +45,7 @@ public: virtual void setUp() override { UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(mxComponentContext)); + mxDesktop.set(frame::Desktop::create(m_xContext)); mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); CPPUNIT_ASSERT(mxComponent.is()); } diff --git a/sw/qa/api/SwXTextFieldTypes.cxx b/sw/qa/api/SwXTextFieldTypes.cxx index d95b2ed85691..f11c6620d20f 100644 --- a/sw/qa/api/SwXTextFieldTypes.cxx +++ b/sw/qa/api/SwXTextFieldTypes.cxx @@ -45,7 +45,7 @@ public: virtual void setUp() override { UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(mxComponentContext)); + mxDesktop.set(frame::Desktop::create(m_xContext)); mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); CPPUNIT_ASSERT(mxComponent.is()); } diff --git a/sw/qa/api/SwXTextFrame.cxx b/sw/qa/api/SwXTextFrame.cxx index 44d316037f4f..b01d625604df 100644 --- a/sw/qa/api/SwXTextFrame.cxx +++ b/sw/qa/api/SwXTextFrame.cxx @@ -39,7 +39,7 @@ public: virtual void setUp() override { UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(mxComponentContext)); + mxDesktop.set(frame::Desktop::create(m_xContext)); mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); CPPUNIT_ASSERT(mxComponent.is()); } diff --git a/sw/qa/api/SwXTextSections.cxx b/sw/qa/api/SwXTextSections.cxx index b81f43866713..4bc4eb6254c9 100644 --- a/sw/qa/api/SwXTextSections.cxx +++ b/sw/qa/api/SwXTextSections.cxx @@ -49,7 +49,7 @@ public: virtual void setUp() override { UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(mxComponentContext)); + mxDesktop.set(frame::Desktop::create(m_xContext)); mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); CPPUNIT_ASSERT(mxComponent.is()); } diff --git a/sw/qa/api/SwXTextTables.cxx b/sw/qa/api/SwXTextTables.cxx index d67e376729d4..e9d3f135ccda 100644 --- a/sw/qa/api/SwXTextTables.cxx +++ b/sw/qa/api/SwXTextTables.cxx @@ -46,7 +46,7 @@ public: virtual void setUp() override { UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(mxComponentContext)); + mxDesktop.set(frame::Desktop::create(m_xContext)); mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); CPPUNIT_ASSERT(mxComponent.is()); } diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx b/sw/qa/extras/uiwriter/uiwriter8.cxx index 2cd9e7f888a5..31529eeb9b10 100644 --- a/sw/qa/extras/uiwriter/uiwriter8.cxx +++ b/sw/qa/extras/uiwriter/uiwriter8.cxx @@ -2432,7 +2432,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf133477) // Save the shape to a BMP. uno::Reference xGraphicExporter - = drawing::GraphicExportFilter::create(mxComponentContext); + = drawing::GraphicExportFilter::create(m_xContext); uno::Reference xSourceDoc(getShape(1), uno::UNO_QUERY); xGraphicExporter->setSourceDocument(xSourceDoc); diff --git a/test/source/a11y/accessibletestbase.cxx b/test/source/a11y/accessibletestbase.cxx index 62b8043917df..27bea36f6084 100644 --- a/test/source/a11y/accessibletestbase.cxx +++ b/test/source/a11y/accessibletestbase.cxx @@ -43,7 +43,7 @@ void test::AccessibleTestBase::setUp() { test::BootstrapFixture::setUp(); - mxDesktop = frame::Desktop::create(mxComponentContext); + mxDesktop = frame::Desktop::create(m_xContext); } void test::AccessibleTestBase::close() diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx index 273109496012..891af3c6f640 100644 --- a/test/source/bootstrapfixture.cxx +++ b/test/source/bootstrapfixture.cxx @@ -113,8 +113,6 @@ void test::BootstrapFixture::setUp() #if OSL_DEBUG_LEVEL > 0 Scheduler::ProcessEventsToIdle(); #endif - - mxComponentContext.set(comphelper::getComponentContext(getMultiServiceFactory())); } test::BootstrapFixture::~BootstrapFixture() diff --git a/toolkit/qa/cppunit/Dialog.cxx b/toolkit/qa/cppunit/Dialog.cxx index 607a1863fc0b..e41b0bf946f6 100644 --- a/toolkit/qa/cppunit/Dialog.cxx +++ b/toolkit/qa/cppunit/Dialog.cxx @@ -33,18 +33,17 @@ class DialogTest : public test::BootstrapFixture, public unotest::MacrosTest CPPUNIT_TEST_FIXTURE(DialogTest, testDialogSizeable) { uno::Reference xDialog; - uno::Reference xFactory(mxComponentContext->getServiceManager(), + uno::Reference xFactory(m_xContext->getServiceManager(), uno::UNO_SET_THROW); uno::Reference xControlModel( xFactory->createInstanceWithContext(u"com.sun.star.awt.UnoControlDialogModel"_ustr, - mxComponentContext), + m_xContext), uno::UNO_QUERY_THROW); uno::Reference xPropSet(xControlModel, uno::UNO_QUERY_THROW); xPropSet->setPropertyValue(u"Sizeable"_ustr, uno::Any(true)); - uno::Reference xControl - = awt::UnoControlDialog::create(mxComponentContext); + uno::Reference xControl = awt::UnoControlDialog::create(m_xContext); xControl->setModel(xControlModel); xControl->setVisible(true); xDialog.set(xControl, uno::UNO_QUERY_THROW); diff --git a/toolkit/qa/cppunit/EventContainer.cxx b/toolkit/qa/cppunit/EventContainer.cxx index 1551f0584a25..8bd4e57c631c 100644 --- a/toolkit/qa/cppunit/EventContainer.cxx +++ b/toolkit/qa/cppunit/EventContainer.cxx @@ -38,11 +38,10 @@ class EventContainerTest : public test::BootstrapFixture // Otherwise this would break macro signatures. CPPUNIT_TEST_FIXTURE(EventContainerTest, testInsertOrder) { - Reference xFactory(mxComponentContext->getServiceManager(), - UNO_SET_THROW); + Reference xFactory(m_xContext->getServiceManager(), UNO_SET_THROW); Reference xControlModel( xFactory->createInstanceWithContext(u"com.sun.star.awt.UnoControlDialogModel"_ustr, - mxComponentContext), + m_xContext), UNO_QUERY_THROW); Reference xPropSet(xControlModel, UNO_QUERY_THROW); diff --git a/vcl/qa/cppunit/filter/ipdf/ipdf.cxx b/vcl/qa/cppunit/filter/ipdf/ipdf.cxx index 92c024bd34fa..b2594058dd36 100644 --- a/vcl/qa/cppunit/filter/ipdf/ipdf.cxx +++ b/vcl/qa/cppunit/filter/ipdf/ipdf.cxx @@ -51,7 +51,7 @@ void VclFilterIpdfTest::setUp() UnoApiTest::setUp(); MacrosTest::setUpX509(m_directories, u"vcl_filter_ipdf"_ustr); - mxSEInitializer = xml::crypto::SEInitializer::create(mxComponentContext); + mxSEInitializer = xml::crypto::SEInitializer::create(m_xContext); mxSecurityContext = mxSEInitializer->createSecurityContext(OUString()); } diff --git a/writerperfect/qa/unit/EPUBExportTest.cxx b/writerperfect/qa/unit/EPUBExportTest.cxx index cb38c64e4d21..98471c607a03 100644 --- a/writerperfect/qa/unit/EPUBExportTest.cxx +++ b/writerperfect/qa/unit/EPUBExportTest.cxx @@ -77,8 +77,7 @@ void EPUBExportTest::createDoc(std::u16string_view rFile, else aMediaDescriptor[u"FilterOptions"_ustr] <<= maFilterOptions; xStorable->storeToURL(maTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); - mxZipFile - = packages::zip::ZipFileAccess::createWithURL(mxComponentContext, maTempFile.GetURL()); + mxZipFile = packages::zip::ZipFileAccess::createWithURL(m_xContext, maTempFile.GetURL()); } std::map> EPUBExportTest::parseCss(const OUString& rName) @@ -165,7 +164,7 @@ CPPUNIT_TEST_FIXTURE(EPUBExportTest, testMimetype) mpXmlDoc, "/opf:package/opf:metadata/opf:meta[@name='generator']"_ostr, "content"_ostr); CPPUNIT_ASSERT(aGenerator.startsWith(utl::DocInfoHelper::GetGeneratorString())); - uno::Reference xMSF(mxComponentContext->getServiceManager(), + uno::Reference xMSF(m_xContext->getServiceManager(), uno::UNO_QUERY); constexpr OUString aServiceName(u"com.sun.star.comp.Writer.EPUBExportFilter"_ustr); uno::Reference xFilter(xMSF->createInstance(aServiceName), uno::UNO_QUERY); diff --git a/xmlscript/qa/cppunit/test.cxx b/xmlscript/qa/cppunit/test.cxx index f09bfac589dd..8f40e4fb8269 100644 --- a/xmlscript/qa/cppunit/test.cxx +++ b/xmlscript/qa/cppunit/test.cxx @@ -70,7 +70,7 @@ void XmlScriptTest::setUp() test::BootstrapFixture::setUp(); maDataPath = "/xmlscript/qa/cppunit/data/"; - mxDesktop.set(frame::Desktop::create(mxComponentContext)); + mxDesktop.set(frame::Desktop::create(m_xContext)); } Reference XmlScriptTest::importFile(std::u16string_view sFileName) @@ -87,12 +87,12 @@ Reference XmlScriptTest::importFile(std::u16string_vi aFile.close(); Reference xDialogModel( - mxComponentContext->getServiceManager()->createInstanceWithContext( - u"com.sun.star.awt.UnoControlDialogModel"_ustr, mxComponentContext), + m_xContext->getServiceManager()->createInstanceWithContext( + u"com.sun.star.awt.UnoControlDialogModel"_ustr, m_xContext), UNO_QUERY); ::xmlscript::importDialogModel(::xmlscript::createInputStream(std::move(bytes)), xDialogModel, - mxComponentContext, nullptr); + m_xContext, nullptr); Reference xDialogModelComp(xDialogModel, UNO_QUERY); if (xDialogModelComp) @@ -105,7 +105,7 @@ void XmlScriptTest::exportToFile(std::u16string_view sURL, Reference const& xDialogModel) { Reference xProvider( - ::xmlscript::exportDialogModel(xDialogModel, mxComponentContext, nullptr)); + ::xmlscript::exportDialogModel(xDialogModel, m_xContext, nullptr)); Reference xStream(xProvider->createInputStream()); Sequence bytes; diff --git a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx index 9d774735d30c..cc688397b630 100644 --- a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx +++ b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx @@ -73,7 +73,7 @@ void PDFSigningTest::setUp() MacrosTest::setUpX509(m_directories, u"xmlsecurity_pdfsigning"_ustr); uno::Reference xSEInitializer - = xml::crypto::SEInitializer::create(mxComponentContext); + = xml::crypto::SEInitializer::create(m_xContext); uno::Reference xSecurityContext = xSEInitializer->createSecurityContext(OUString()); #if USE_CRYPTO_NSS @@ -88,7 +88,7 @@ void PDFSigningTest::setUp() std::vector PDFSigningTest::verify(const OUString& rURL, size_t nCount) { uno::Reference xSEInitializer - = xml::crypto::SEInitializer::create(mxComponentContext); + = xml::crypto::SEInitializer::create(m_xContext); uno::Reference xSecurityContext = xSEInitializer->createSecurityContext(OUString()); std::vector aRet; @@ -116,7 +116,7 @@ bool PDFSigningTest::sign(const OUString& rInURL, const OUString& rOutURL, { // Make sure that input has nOriginalSignatureCount signatures. uno::Reference xSEInitializer - = xml::crypto::SEInitializer::create(mxComponentContext); + = xml::crypto::SEInitializer::create(m_xContext); uno::Reference xSecurityContext = xSEInitializer->createSecurityContext(OUString()); vcl::filter::PDFDocument aDocument; @@ -238,7 +238,7 @@ CPPUNIT_TEST_FIXTURE(PDFSigningTest, testPDFRemove) // Make sure that good.pdf has 1 valid signature. uno::Reference xSEInitializer - = xml::crypto::SEInitializer::create(mxComponentContext); + = xml::crypto::SEInitializer::create(m_xContext); uno::Reference xSecurityContext = xSEInitializer->createSecurityContext(OUString()); vcl::filter::PDFDocument aDocument; @@ -284,7 +284,7 @@ CPPUNIT_TEST_FIXTURE(PDFSigningTest, testPDFRemoveAll) // testPDFRemove(), here intentionally test DocumentSignatureManager and // PDFSignatureHelper code as well. uno::Reference xSEInitializer - = xml::crypto::SEInitializer::create(mxComponentContext); + = xml::crypto::SEInitializer::create(m_xContext); uno::Reference xSecurityContext = xSEInitializer->createSecurityContext(OUString()); @@ -296,7 +296,7 @@ CPPUNIT_TEST_FIXTURE(PDFSigningTest, testPDFRemoveAll) osl::File::RC::E_None, osl::File::copy(m_directories.getURLFromSrc(DATA_DIRECTORY) + "2good.pdf", aOutURL)); // Load the test document as a storage and read its two signatures. - DocumentSignatureManager aManager(mxComponentContext, DocumentSignatureMode::Content); + DocumentSignatureManager aManager(m_xContext, DocumentSignatureMode::Content); std::unique_ptr pStream = utl::UcbStreamHelper::CreateStream(aOutURL, StreamMode::READ | StreamMode::WRITE); uno::Reference xStream(new utl::OStreamWrapper(std::move(pStream))); @@ -320,12 +320,12 @@ CPPUNIT_TEST_FIXTURE(PDFSigningTest, testPDFRemoveAll) CPPUNIT_TEST_FIXTURE(PDFSigningTest, testTdf107782) { uno::Reference xSEInitializer - = xml::crypto::SEInitializer::create(mxComponentContext); + = xml::crypto::SEInitializer::create(m_xContext); uno::Reference xSecurityContext = xSEInitializer->createSecurityContext(OUString()); // Load the test document as a storage and read its signatures. - DocumentSignatureManager aManager(mxComponentContext, DocumentSignatureMode::Content); + DocumentSignatureManager aManager(m_xContext, DocumentSignatureMode::Content); OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "tdf107782.pdf"; std::unique_ptr pStream = utl::UcbStreamHelper::CreateStream(aURL, StreamMode::READ | StreamMode::WRITE); @@ -590,13 +590,13 @@ CPPUNIT_TEST_FIXTURE(PDFSigningTest, testUnknownSubFilter) // Tokenize the bugdoc. uno::Reference xSEInitializer - = xml::crypto::SEInitializer::create(mxComponentContext); + = xml::crypto::SEInitializer::create(m_xContext); uno::Reference xSecurityContext = xSEInitializer->createSecurityContext(OUString()); std::unique_ptr pStream = utl::UcbStreamHelper::CreateStream( m_directories.getURLFromSrc(DATA_DIRECTORY) + "cr-comment.pdf", StreamMode::STD_READ); uno::Reference xStream(new utl::OStreamWrapper(std::move(pStream))); - DocumentSignatureManager aManager(mxComponentContext, DocumentSignatureMode::Content); + DocumentSignatureManager aManager(m_xContext, DocumentSignatureMode::Content); aManager.setSignatureStream(xStream); aManager.read(/*bUseTempStream=*/false); @@ -615,14 +615,14 @@ CPPUNIT_TEST_FIXTURE(PDFSigningTest, testGoodCustomMagic) // Tokenize the bugdoc. uno::Reference xSEInitializer - = xml::crypto::SEInitializer::create(mxComponentContext); + = xml::crypto::SEInitializer::create(m_xContext); uno::Reference xSecurityContext = xSEInitializer->createSecurityContext(OUString()); std::unique_ptr pStream = utl::UcbStreamHelper::CreateStream( m_directories.getURLFromSrc(DATA_DIRECTORY) + "good-custom-magic.pdf", StreamMode::STD_READ); uno::Reference xStream(new utl::OStreamWrapper(std::move(pStream))); - DocumentSignatureManager aManager(mxComponentContext, DocumentSignatureMode::Content); + DocumentSignatureManager aManager(m_xContext, DocumentSignatureMode::Content); aManager.setSignatureStream(xStream); aManager.read(/*bUseTempStream=*/false); diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx index 5c91c17ffb1c..0f0a4a7249f2 100644 --- a/xmlsecurity/qa/unit/signing/signing.cxx +++ b/xmlsecurity/qa/unit/signing/signing.cxx @@ -96,7 +96,7 @@ void SigningTest::setUp() MacrosTest::setUpGpg(m_directories, u"xmlsecurity_signing"_ustr); // Initialize crypto after setting up the environment variables. - mxSEInitializer = xml::crypto::SEInitializer::create(mxComponentContext); + mxSEInitializer = xml::crypto::SEInitializer::create(m_xContext); mxSecurityContext = mxSEInitializer->createSecurityContext(OUString()); #if USE_CRYPTO_NSS #ifdef NSS_USE_ALG_IN_ANY_SIGNATURE @@ -141,7 +141,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testDescription) save(u"writer8"_ustr); - DocumentSignatureManager aManager(mxComponentContext, DocumentSignatureMode::Content); + DocumentSignatureManager aManager(m_xContext, DocumentSignatureMode::Content); CPPUNIT_ASSERT(aManager.init()); uno::Reference xStorage = comphelper::OStorageHelper::GetStorageOfFormatFromURL( @@ -173,7 +173,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testECDSA) save(u"writer8"_ustr); - DocumentSignatureManager aManager(mxComponentContext, DocumentSignatureMode::Content); + DocumentSignatureManager aManager(m_xContext, DocumentSignatureMode::Content); CPPUNIT_ASSERT(aManager.init()); uno::Reference xStorage = comphelper::OStorageHelper::GetStorageOfFormatFromURL( @@ -207,7 +207,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testECDSAOOXML) save(u"MS Word 2007 XML"_ustr); - DocumentSignatureManager aManager(mxComponentContext, DocumentSignatureMode::Content); + DocumentSignatureManager aManager(m_xContext, DocumentSignatureMode::Content); CPPUNIT_ASSERT(aManager.init()); uno::Reference xStorage = comphelper::OStorageHelper::GetStorageOfFormatFromURL( @@ -243,7 +243,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testECDSAPDF) save(u"writer_pdf_Export"_ustr); - DocumentSignatureManager aManager(mxComponentContext, DocumentSignatureMode::Content); + DocumentSignatureManager aManager(m_xContext, DocumentSignatureMode::Content); CPPUNIT_ASSERT(aManager.init()); std::unique_ptr pStream(utl::UcbStreamHelper::CreateStream( maTempFile.GetURL(), StreamMode::READ | StreamMode::WRITE)); @@ -283,7 +283,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testOOXMLDescription) save(u"MS Word 2007 XML"_ustr); - DocumentSignatureManager aManager(mxComponentContext, DocumentSignatureMode::Content); + DocumentSignatureManager aManager(m_xContext, DocumentSignatureMode::Content); CPPUNIT_ASSERT(aManager.init()); uno::Reference xStorage = comphelper::OStorageHelper::GetStorageOfFormatFromURL( @@ -314,7 +314,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testOOXMLAppend) // Copy the test document to a temporary file, as it'll be modified. createTempCopy(u"partial.docx"); // Load the test document as a storage and read its single signature. - DocumentSignatureManager aManager(mxComponentContext, DocumentSignatureMode::Content); + DocumentSignatureManager aManager(m_xContext, DocumentSignatureMode::Content); CPPUNIT_ASSERT(aManager.init()); uno::Reference xStorage = comphelper::OStorageHelper::GetStorageOfFormatFromURL( @@ -344,7 +344,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testOOXMLAppend) CPPUNIT_TEST_FIXTURE(SigningTest, testOOXMLRemove) { // Load the test document as a storage and read its signatures: purpose1 and purpose2. - DocumentSignatureManager aManager(mxComponentContext, DocumentSignatureMode::Content); + DocumentSignatureManager aManager(m_xContext, DocumentSignatureMode::Content); CPPUNIT_ASSERT(aManager.init()); createTempCopy(u"multi.docx"); uno::Reference xStorage @@ -376,7 +376,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testOOXMLRemoveAll) // Copy the test document to a temporary file, as it'll be modified. createTempCopy(u"partial.docx"); // Load the test document as a storage and read its single signature. - DocumentSignatureManager aManager(mxComponentContext, DocumentSignatureMode::Content); + DocumentSignatureManager aManager(m_xContext, DocumentSignatureMode::Content); CPPUNIT_ASSERT(aManager.init()); uno::Reference xStorage = comphelper::OStorageHelper::GetStorageOfFormatFromURL( @@ -406,7 +406,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testOOXMLRemoveAll) = xStorage->openStreamElement(u"[Content_Types].xml"_ustr, embed::ElementModes::READWRITE); uno::Reference xInputStream = xStream->getInputStream(); uno::Sequence> aContentTypeInfo - = comphelper::OFOPXMLHelper::ReadContentTypeSequence(xInputStream, mxComponentContext); + = comphelper::OFOPXMLHelper::ReadContentTypeSequence(xInputStream, m_xContext); const uno::Sequence& rOverrides = aContentTypeInfo[1]; CPPUNIT_ASSERT( std::none_of(rOverrides.begin(), rOverrides.end(), [](const beans::StringPair& rPair) { @@ -841,7 +841,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testXAdESNotype) createTempCopy(u"notype-xades.odt"); // Read existing signature. - DocumentSignatureManager aManager(mxComponentContext, DocumentSignatureMode::Content); + DocumentSignatureManager aManager(m_xContext, DocumentSignatureMode::Content); CPPUNIT_ASSERT(aManager.init()); uno::Reference xStorage = comphelper::OStorageHelper::GetStorageOfFormatFromURL( @@ -897,7 +897,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testXAdES) save(u"writer8"_ustr); - DocumentSignatureManager aManager(mxComponentContext, DocumentSignatureMode::Content); + DocumentSignatureManager aManager(m_xContext, DocumentSignatureMode::Content); CPPUNIT_ASSERT(aManager.init()); uno::Reference xStorage = comphelper::OStorageHelper::GetStorageOfFormatFromURL( @@ -950,7 +950,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testSigningMultipleTimes_ODT) save(u"writer8"_ustr); { - DocumentSignatureManager aManager(mxComponentContext, DocumentSignatureMode::Content); + DocumentSignatureManager aManager(m_xContext, DocumentSignatureMode::Content); CPPUNIT_ASSERT(aManager.init()); uno::Reference xStorage = comphelper::OStorageHelper::GetStorageOfFormatFromURL( @@ -1023,7 +1023,7 @@ CPPUNIT_TEST_FIXTURE(SigningTest, testSigningMultipleTimes_OOXML) save(u"MS Word 2007 XML"_ustr); { - DocumentSignatureManager aManager(mxComponentContext, DocumentSignatureMode::Content); + DocumentSignatureManager aManager(m_xContext, DocumentSignatureMode::Content); CPPUNIT_ASSERT(aManager.init()); uno::Reference xStorage = comphelper::OStorageHelper::GetStorageOfFormatFromURL( diff --git a/xmlsecurity/qa/unit/signing/signing2.cxx b/xmlsecurity/qa/unit/signing/signing2.cxx index d59cfbec92eb..c84fa0b1051a 100644 --- a/xmlsecurity/qa/unit/signing/signing2.cxx +++ b/xmlsecurity/qa/unit/signing/signing2.cxx @@ -60,7 +60,7 @@ void SigningTest2::setUp() MacrosTest::setUpGpg(m_directories, u"xmlsecurity_signing2"_ustr); // Initialize crypto after setting up the environment variables. - mxSEInitializer = xml::crypto::SEInitializer::create(mxComponentContext); + mxSEInitializer = xml::crypto::SEInitializer::create(m_xContext); mxSecurityContext = mxSEInitializer->createSecurityContext(OUString()); #if USE_CRYPTO_NSS #ifdef NSS_USE_ALG_IN_ANY_SIGNATURE From b32aa67f17a645c1d6f2b544d315f12bad123547 Mon Sep 17 00:00:00 2001 From: Jaume Pujantell Date: Tue, 25 Jun 2024 09:49:46 +0200 Subject: [PATCH 041/232] lok calc: allow copy hyperlink outside of edit mode Right now .uno:CopyHyperlinkLocation only works on edit mode or inside a draw object, but LOK_CALLBACK_HYPERLINK_CLICKED is dispatched outside of edit mode and the copy command from the pop-up is ignored. Since there is no text cursor, the position of the hyperlink is needed to discriminate the correct field, since there could be multiple hyperlink fields inside the same cell. Change-Id: If545cf56e631adcdb914c4e799a309bc8bd0422f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169507 Tested-by: Jenkins CollaboraOffice Reviewed-by: Miklos Vajna (cherry picked from commit 0533474cb0188aede59841bf4d547106949f2760) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169729 Tested-by: Jenkins Reviewed-by: Jaume Pujantell --- sc/sdi/cellsh.sdi | 1 + sc/source/ui/view/cellsh.cxx | 1 + sc/source/ui/view/cellsh1.cxx | 24 ++++++++++++++++++++++++ sc/source/ui/view/gridwin.cxx | 11 +++++++---- svx/sdi/svx.sdi | 1 + 5 files changed, 34 insertions(+), 4 deletions(-) diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi index 6f27650509d3..233b12249917 100644 --- a/sc/sdi/cellsh.sdi +++ b/sc/sdi/cellsh.sdi @@ -183,6 +183,7 @@ interface CellSelection SID_PASTE_TEXTIMPORT_DIALOG [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ] SID_CLIPBOARD_FORMAT_ITEMS [ ExecMethod = ExecuteEdit; StateMethod = GetClipState; ] SID_EXTERNAL_SOURCE [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ] + SID_COPY_HYPERLINK_LOCATION [ ExecMethod = ExecuteEdit; StateMethod = GetBlockState; ] FID_MERGE_ON [ ExecMethod = Execute; StateMethod = GetState; ] FID_MERGE_OFF [ ExecMethod = Execute; StateMethod = GetState; ] FID_MERGE_TOGGLE [ ExecMethod = Execute; StateMethod = GetState; ] diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index 351868f3e95f..f1ff35b5a379 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -294,6 +294,7 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet ) break; case SID_COPY: // copy + case SID_COPY_HYPERLINK_LOCATION: // not editable because of matrix only? Do not damage matrix //! is not called, when protected AND matrix, we will have //! to live with this... is caught in Copy-Routine, otherwise diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 995d0cd2dfff..55b65bce1979 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -3212,6 +3213,29 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) } break; + case SID_COPY_HYPERLINK_LOCATION: + { + ScViewData& rData = GetViewData(); + ScGridWindow* pWindow = rData.GetActiveWin(); + const SfxInt32Item* pPosX = rReq.GetArg(FN_PARAM_1); + const SfxInt32Item* pPosY = rReq.GetArg(FN_PARAM_2); + if (pWindow && pPosX && pPosY) + { + const Point aPoint(pPosX->GetValue() * rData.GetPPTX(), + pPosY->GetValue() * rData.GetPPTY()); + OUString aName, aUrl; + if (pWindow->GetEditUrl(aPoint, &aName, &aUrl)) + { + uno::Reference xClipboard + = pWindow->GetClipboard(); + vcl::unohelper::TextDataObject::CopyStringTo(aUrl, xClipboard, + rData.GetViewShell()); + rReq.Done(); + } + } + } + break; + default: OSL_FAIL("incorrect slot in ExecuteEdit"); break; diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 1eed1390d9d4..23522e47b7c3 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -2616,7 +2616,9 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt ) OString aCursor = pViewShell->GetViewData().describeCellCursorAt(nPosX, nPosY); double fPPTX = pViewShell->GetViewData().GetPPTX(); int mouseX = aPos.X() / fPPTX; - OString aMsg(aUrl.toUtf8() + " coordinates: " + aCursor + ", " + OString::number(mouseX)); + int mouseY = aPos.Y() / fPPTX; + OString aMsg(aUrl.toUtf8() + " coordinates: " + aCursor + ", " + + OString::number(mouseX) + ", " + OString::number(mouseY)); pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, aMsg); } else ScGlobal::OpenURL(aUrl, aTarget); @@ -2741,9 +2743,10 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt ) if (pViewShell && nPosX == m_nDownPosX && nPosY == m_nDownPosY && GetEditUrl(aPos, &aName, &aUrl, &aTarget)) { - OString aMsg(aUrl.toUtf8() + " coordinates: " + - pViewShell->GetViewData().describeCellCursorAt(nPosX, nPosY) + ", " + - OString::number(aPos.X() / pViewShell->GetViewData().GetPPTX())); + OString aMsg(aUrl.toUtf8() + " coordinates: " + + pViewShell->GetViewData().describeCellCursorAt(nPosX, nPosY) + ", " + + OString::number(aPos.X() / pViewShell->GetViewData().GetPPTX()) + ", " + + OString::number(aPos.Y() / pViewShell->GetViewData().GetPPTY())); pViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_HYPERLINK_CLICKED, aMsg); } } diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index 59bae8338825..afb8a60717d7 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -12476,6 +12476,7 @@ SfxVoidItem RemoveHyperlink SID_REMOVE_HYPERLINK ] SfxVoidItem CopyHyperlinkLocation SID_COPY_HYPERLINK_LOCATION +(SfxInt32Item PositionX FN_PARAM_1, SfxInt32Item PositionY FN_PARAM_2) [ AutoUpdate = FALSE, FastCall = FALSE, From 67cb6af482bc5b0f4d310f0a42a85057f3db0267 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 2 Jul 2024 11:47:17 +0200 Subject: [PATCH 042/232] package: ZipFile: don't accept duplicate CEN entries Change-Id: Ice341a11346b445c555cba276bf2284e4f9b6685 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169881 Tested-by: Jenkins Reviewed-by: Michael Stahl --- package/source/zipapi/ZipFile.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index 793b5f9c40fe..b1df020ea219 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -1153,7 +1153,15 @@ sal_Int32 ZipFile::readCEN() continue; // This is a directory entry, not a stream - skip it } - aEntries[aEntry.sPath] = aEntry; + if (auto it = aEntries.find(aEntry.sPath); it == aEntries.end()) + { + aEntries[aEntry.sPath] = aEntry; + } + else + { + SAL_INFO("package", "Duplicate CEN entry: \"" << aEntry.sPath << "\""); + throw ZipException(u"Duplicate CEN entry"_ustr); + } } if (nCount != nTotal) From 67dca5a47d1be1b38edee7d0d81fa9adfce5a22e Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 2 Jul 2024 11:50:09 +0200 Subject: [PATCH 043/232] package: ZipFile: check Info-ZIP Unicode Path Extra Field Change-Id: I829eb449e8a0947341f066399be549f56b0f02da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169882 Tested-by: Jenkins Reviewed-by: Michael Stahl --- package/inc/ZipFile.hxx | 3 +- package/source/zipapi/MemoryByteGrabber.hxx | 8 +++++ package/source/zipapi/ZipFile.cxx | 37 +++++++++++++++++++-- 3 files changed, 44 insertions(+), 4 deletions(-) diff --git a/package/inc/ZipFile.hxx b/package/inc/ZipFile.hxx index 93d95f66ea97..b2f3e6ecf131 100644 --- a/package/inc/ZipFile.hxx +++ b/package/inc/ZipFile.hxx @@ -90,7 +90,8 @@ class ZipFile void recover(); static void readExtraFields(MemoryByteGrabber& aMemGrabber, sal_Int16 nExtraLen, sal_uInt64& nSize, sal_uInt64& nCompressedSize, - sal_uInt64* nOffset); + sal_uInt64* nOffset, + OUString const* pCENFilenameToCheck); public: diff --git a/package/source/zipapi/MemoryByteGrabber.hxx b/package/source/zipapi/MemoryByteGrabber.hxx index d474be40cda5..dd876d66ebfa 100644 --- a/package/source/zipapi/MemoryByteGrabber.hxx +++ b/package/source/zipapi/MemoryByteGrabber.hxx @@ -49,6 +49,14 @@ public: mnCurrent += nBytesToSkip; } + sal_Int8 ReadUInt8() + { + if (mnCurrent + 1 > mnEnd) + return 0; + sal_uInt8 nInt8 = mpBuffer[mnCurrent++]; + return nInt8; + } + // XSeekable chained... sal_Int16 ReadInt16() { diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index b1df020ea219..afb4a9283bfc 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -1132,7 +1133,7 @@ sal_Int32 ZipFile::readCEN() if (aEntry.nExtraLen>0) { - readExtraFields(aMemGrabber, aEntry.nExtraLen, nSize, nCompressedSize, &nOffset); + readExtraFields(aMemGrabber, aEntry.nExtraLen, nSize, nCompressedSize, &nOffset, &aEntry.sPath); } aEntry.nCompressedSize = nCompressedSize; aEntry.nSize = nSize; @@ -1176,7 +1177,8 @@ sal_Int32 ZipFile::readCEN() } void ZipFile::readExtraFields(MemoryByteGrabber& aMemGrabber, sal_Int16 nExtraLen, - sal_uInt64& nSize, sal_uInt64& nCompressedSize, sal_uInt64* nOffset) + sal_uInt64& nSize, sal_uInt64& nCompressedSize, + sal_uInt64* nOffset, OUString const*const pCENFilenameToCheck) { while (nExtraLen > 0) // Extensible data fields { @@ -1201,6 +1203,35 @@ void ZipFile::readExtraFields(MemoryByteGrabber& aMemGrabber, sal_Int16 nExtraLe if (dataSize > nReadSize) aMemGrabber.skipBytes(dataSize - nReadSize); } + // Info-ZIP Unicode Path Extra Field - pointless as we expect UTF-8 in CEN already + else if (nheaderID == 0x7075 && pCENFilenameToCheck) // ignore in recovery mode + { + if (aMemGrabber.remainingSize() < dataSize) + { + SAL_INFO("package", "Invalid Info-ZIP Unicode Path Extra Field: invalid TSize"); + throw ZipException(u"Invalid Info-ZIP Unicode Path Extra Field"_ustr); + } + auto const nVersion = aMemGrabber.ReadUInt8(); + if (nVersion != 1) + { + SAL_INFO("package", "Invalid Info-ZIP Unicode Path Extra Field: unexpected Version"); + throw ZipException(u"Invalid Info-ZIP Unicode Path Extra Field"_ustr); + } + // this CRC32 is actually of the pCENFilenameToCheck + // so it's pointless to check it if we require the UnicodeName + // to be equal to the CEN name anyway (and pCENFilenameToCheck + // is already converted to UTF-16 here) + (void) aMemGrabber.ReadUInt32(); + // this is required to be UTF-8 + OUString const unicodePath(reinterpret_cast(aMemGrabber.getCurrentPos()), + dataSize - 5, RTL_TEXTENCODING_UTF8); + aMemGrabber.skipBytes(dataSize - 5); + if (unicodePath != *pCENFilenameToCheck) + { + SAL_INFO("package", "Invalid Info-ZIP Unicode Path Extra Field: unexpected UnicodeName"); + throw ZipException(u"Invalid Info-ZIP Unicode Path Extra Field"_ustr); + } + } else { aMemGrabber.skipBytes(dataSize); @@ -1268,7 +1299,7 @@ void ZipFile::HandlePK34(std::span data, sal_Int64 dataOffset, s MemoryByteGrabber aMemGrabberExtra(aExtraBuffer); if (aEntry.nExtraLen > 0) { - readExtraFields(aMemGrabberExtra, aEntry.nExtraLen, nSize, nCompressedSize, nullptr); + readExtraFields(aMemGrabberExtra, aEntry.nExtraLen, nSize, nCompressedSize, nullptr, nullptr); } } From 8b333575ee680664fa3d83249ccec90881754ad7 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Tue, 2 Jul 2024 13:24:38 +0200 Subject: [PATCH 044/232] sfx2: SfxObjectShell should not trust any signature on repaired package Change-Id: I0317f80989e9dabd23e88e3caab26ede3fb5bd56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169883 Tested-by: Jenkins Reviewed-by: Michael Stahl --- sfx2/source/doc/objserv.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 428e4d2d9d0c..fcfa222bf588 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -1911,6 +1911,12 @@ SignatureState SfxObjectShell::ImplGetSignatureState( bool bScriptingContent ) { SignatureState* pState = bScriptingContent ? &pImpl->nScriptingSignatureState : &pImpl->nDocumentSignatureState; + // repaired package cannot be trusted + if (GetMedium()->IsRepairPackage()) + { + *pState = SignatureState::BROKEN; + } + if ( *pState == SignatureState::UNKNOWN ) { *pState = SignatureState::NOSIGNATURES; From 2467e7c874aea2099048fcfc0b5d7934d8b90f48 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Tue, 2 Jul 2024 14:49:50 +0500 Subject: [PATCH 045/232] Simplify a bit Change-Id: I97277866d1a81854b45ddb8403f2efaa67215f76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169868 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- include/systools/win32/comtools.hxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/include/systools/win32/comtools.hxx b/include/systools/win32/comtools.hxx index 1d618051d2c7..124759189c15 100644 --- a/include/systools/win32/comtools.hxx +++ b/include/systools/win32/comtools.hxx @@ -92,10 +92,7 @@ namespace sal::systools }; struct COM_QUERY_TAG {} constexpr COM_QUERY; - struct COM_QUERY_THROW_TAG {} constexpr COM_QUERY_THROW; - template - constexpr bool is_COM_query_tag - = std::is_same_v || std::is_same_v; + struct COM_QUERY_THROW_TAG : public COM_QUERY_TAG {} constexpr COM_QUERY_THROW; /* A simple COM smart pointer template */ template @@ -157,7 +154,8 @@ namespace sal::systools ~COMReference() { release(com_ptr_); } - template , int> = 0> + template + requires std::is_base_of_v COMReference QueryInterface(TAG) const { T2* ip = nullptr; From 3b824baa863880ada2a8e8178c35d56c1aafab8f Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Tue, 2 Jul 2024 14:47:57 +0500 Subject: [PATCH 046/232] Simplify error handling in CSysShExec::execute Change-Id: I6c9723d67eeda6deea088ac28b843628a5b3200f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169867 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- shell/source/win32/SysShExec.cxx | 46 ++++++++------------------------ 1 file changed, 11 insertions(+), 35 deletions(-) diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx index 57e59f96b6f0..fb69b9897c73 100644 --- a/shell/source/win32/SysShExec.cxx +++ b/shell/source/win32/SysShExec.cxx @@ -281,47 +281,23 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa if ((info.dwAttributes & SFGAO_LINK) == 0) { break; } - sal::systools::COMReference link; try { - link.CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER); + sal::systools::COMReference link(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER); + sal::systools::COMReference file(link, sal::systools::COM_QUERY_THROW); + sal::systools::ThrowIfFailed(file->Load(path, STGM_READ), + "IPersistFile.Load failed"); + sal::systools::ThrowIfFailed(link->Resolve(nullptr, SLR_UPDATE | SLR_NO_UI), + "IShellLink.Resolve failed"); + WIN32_FIND_DATAW wfd; + sal::systools::ThrowIfFailed(link->GetPath(path, std::size(path), &wfd, SLGP_RAWPATH), + "IShellLink.GetPath failed"); } catch (sal::systools::ComError& e) { throw css::lang::IllegalArgumentException( - ("XSystemShellExecute.execute, CoCreateInstance failed with " - + OUString::number(e.GetHresult())), - {}, 0); - } - sal::systools::COMReference file; - try { - file = link.QueryInterface(sal::systools::COM_QUERY_THROW); - } catch(sal::systools::ComError & e3) { - throw css::lang::IllegalArgumentException( - ("XSystemShellExecute.execute, QueryInterface failed with: " - + o3tl::runtimeToOUString(e3.what())), - {}, 0); - } - HRESULT e2 = file->Load(path, STGM_READ); - if (FAILED(e2)) { - throw css::lang::IllegalArgumentException( - ("XSystemShellExecute.execute, IPersistFile.Load failed with " - + OUString::number(e2)), - {}, 0); - } - e2 = link->Resolve(nullptr, SLR_UPDATE | SLR_NO_UI); - if (FAILED(e2)) { - throw css::lang::IllegalArgumentException( - ("XSystemShellExecute.execute, IShellLink.Resolve failed with " - + OUString::number(e2)), - {}, 0); - } - WIN32_FIND_DATAW wfd; - e2 = link->GetPath(path, SAL_N_ELEMENTS(path), &wfd, SLGP_RAWPATH); - if (FAILED(e2)) { - throw css::lang::IllegalArgumentException( - ("XSystemShellExecute.execute, IShellLink.GetPath failed with " - + OUString::number(e2)), + ("XSystemShellExecute.execute, " + o3tl::runtimeToOUString(e.what()) + + " with " + OUString::number(e.GetHresult())), {}, 0); } // Fail at some arbitrary nesting depth, to avoid an infinite loop: From 6144341c8ee50c5623d9352c5dbb43785a728bca Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Tue, 2 Jul 2024 16:34:52 +0500 Subject: [PATCH 047/232] Add source location to ComError And use in CSysShExec::execute to improve location reporting Change-Id: I624df0418b99a79207f5aeefa38d2bfe5ea7ffe1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169880 Reviewed-by: Mike Kaganski Tested-by: Jenkins --- include/systools/win32/comtools.hxx | 18 +++++++++++++----- shell/source/win32/SysShExec.cxx | 4 +++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/include/systools/win32/comtools.hxx b/include/systools/win32/comtools.hxx index 124759189c15..9c2f49e8be0a 100644 --- a/include/systools/win32/comtools.hxx +++ b/include/systools/win32/comtools.hxx @@ -19,6 +19,9 @@ #pragma once +#include + +#include #include #include #include @@ -35,22 +38,27 @@ namespace sal::systools class ComError : public std::runtime_error { public: - ComError(const std::string& message, HRESULT hr) : - std::runtime_error(message), - hr_(hr) + ComError(std::string_view message, HRESULT hr, + const std::source_location& loc = std::source_location::current()) + : std::runtime_error(std::string(message)) + , hr_(hr) + , loc_(loc) {} HRESULT GetHresult() const { return hr_; } + const std::source_location& GetLocation() const { return loc_; } private: HRESULT hr_; + std::source_location loc_; }; /* Convert failed HRESULT to thrown ComError */ - inline void ThrowIfFailed(HRESULT hr, std::string_view msg) + inline void ThrowIfFailed(HRESULT hr, std::string_view msg, + std::source_location loc = std::source_location::current()) { if (FAILED(hr)) - throw ComError(std::string(msg), hr); + throw ComError(msg, hr, loc); } /* A guard class to call CoInitializeEx/CoUninitialize in proper pairs diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx index fb69b9897c73..151c7b01c33e 100644 --- a/shell/source/win32/SysShExec.cxx +++ b/shell/source/win32/SysShExec.cxx @@ -297,7 +297,9 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa { throw css::lang::IllegalArgumentException( ("XSystemShellExecute.execute, " + o3tl::runtimeToOUString(e.what()) - + " with " + OUString::number(e.GetHresult())), + + " at " + o3tl::runtimeToOUString(e.GetLocation().file_name()) + ":" + + OUString::number(e.GetLocation().line()) + " error " + + OUString::number(e.GetHresult())), {}, 0); } // Fail at some arbitrary nesting depth, to avoid an infinite loop: From 8a6fb1793d98a11114322195dffc608a32216264 Mon Sep 17 00:00:00 2001 From: "Armin Le Grand (Collabora)" Date: Sat, 15 Jun 2024 17:18:03 +0200 Subject: [PATCH 048/232] SDPRCairo: enhance CairoPixelProcessor2D Added and corrected quite some stuff to this basic construct provided by Caolan (thanks again!). No detailed descriptions here, but it's getting more complete and faster. May contain errors and is primitive-complete in the sense that all gets rendered, but some basic stuff that should be directly supported is still missing, e.g. text rendering. Adding this to allow people to check it out (speed) also since it's not yet used as default in master, so it's safe and also safes the changes publically. To test it, use TEST_SYSTEM_PRIMITIVE_RENDERER as set EnvVar in linux systems. Change-Id: I25f795c9ea4ad4f3b99591304f8803dffa499436 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168911 Tested-by: Jenkins Reviewed-by: Armin Le Grand --- basegfx/source/tools/bgradient.cxx | 14 + drawinglayer/Library_drawinglayer.mk | 1 + .../processor2d/SDPRProcessor2dTools.cxx | 2 +- .../processor2d/cairopixelprocessor2d.cxx | 2220 ++++++++++++++--- .../processor2d/d2dpixelprocessor2d.cxx | 2 +- include/basegfx/utils/bgradient.hxx | 8 + .../processor2d/cairopixelprocessor2d.hxx | 23 +- include/vcl/bitmap.hxx | 2 +- include/vcl/svapp.hxx | 2 +- 9 files changed, 1945 insertions(+), 329 deletions(-) diff --git a/basegfx/source/tools/bgradient.cxx b/basegfx/source/tools/bgradient.cxx index a8bbe95c526b..e27ab160463b 100644 --- a/basegfx/source/tools/bgradient.cxx +++ b/basegfx/source/tools/bgradient.cxx @@ -9,6 +9,7 @@ #include #include +#include #include #include #include @@ -732,6 +733,19 @@ void BColorStops::doApplySteps(sal_uInt16 nStepCount) *this = aNewColorStops; } +void BColorStops::tryToApplyBColorModifierStack(const BColorModifierStack& rBColorModifierStack) +{ + if (0 == rBColorModifierStack.count()) + // no content on stack, done + return; + + for (auto& candidate : *this) + { + candidate = BColorStop(candidate.getStopOffset(), + rBColorModifierStack.getModifiedColor(candidate.getStopColor())); + } +} + std::string BGradient::GradientStyleToString(css::awt::GradientStyle eStyle) { switch (eStyle) diff --git a/drawinglayer/Library_drawinglayer.mk b/drawinglayer/Library_drawinglayer.mk index 8e5463606dd9..beef19918f7c 100644 --- a/drawinglayer/Library_drawinglayer.mk +++ b/drawinglayer/Library_drawinglayer.mk @@ -77,6 +77,7 @@ endif ifeq ($(USE_HEADLESS_CODE),TRUE) $(eval $(call gb_Library_add_exception_objects,drawinglayer,\ drawinglayer/source/processor2d/cairopixelprocessor2d \ + drawinglayer/source/processor2d/SDPRProcessor2dTools \ )) endif diff --git a/drawinglayer/source/processor2d/SDPRProcessor2dTools.cxx b/drawinglayer/source/processor2d/SDPRProcessor2dTools.cxx index 7d001cfd67fd..ae2ddfae81ad 100644 --- a/drawinglayer/source/processor2d/SDPRProcessor2dTools.cxx +++ b/drawinglayer/source/processor2d/SDPRProcessor2dTools.cxx @@ -184,7 +184,7 @@ bool prepareBitmapForDirectRender( basegfx::B2DRange aDiscreteRange(basegfx::B2DRange::getUnitB2DRange()); aDiscreteRange.transform(aLocalTransform); - if (!rDiscreteViewPort.overlaps(rDiscreteViewPort)) + if (!aDiscreteRange.overlaps(rDiscreteViewPort)) { // we have a Viewport and visible range of geometry is outside -> not visible, done return false; diff --git a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx index 89cb21ddcb74..8b15fce82d1e 100644 --- a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -32,63 +33,47 @@ #include #include #include +#include +#include #include #include #include #include +#include #include +#include +#include using namespace com::sun::star; namespace { -basegfx::B2DPoint impPixelSnap(const basegfx::B2DPolygon& rPolygon, - const drawinglayer::geometry::ViewInformation2D& rViewInformation, - sal_uInt32 nIndex) +void impl_cairo_set_hairline(cairo_t* pRT, + const drawinglayer::geometry::ViewInformation2D& rViewInformation) { - const sal_uInt32 nCount(rPolygon.count()); - - // get the data - const basegfx::B2ITuple aPrevTuple( - basegfx::fround(rViewInformation.getObjectToViewTransformation() - * rPolygon.getB2DPoint((nIndex + nCount - 1) % nCount))); - const basegfx::B2DPoint aCurrPoint(rViewInformation.getObjectToViewTransformation() - * rPolygon.getB2DPoint(nIndex)); - const basegfx::B2ITuple aCurrTuple(basegfx::fround(aCurrPoint)); - const basegfx::B2ITuple aNextTuple( - basegfx::fround(rViewInformation.getObjectToViewTransformation() - * rPolygon.getB2DPoint((nIndex + 1) % nCount))); - - // get the states - const bool bPrevVertical(aPrevTuple.getX() == aCurrTuple.getX()); - const bool bNextVertical(aNextTuple.getX() == aCurrTuple.getX()); - const bool bPrevHorizontal(aPrevTuple.getY() == aCurrTuple.getY()); - const bool bNextHorizontal(aNextTuple.getY() == aCurrTuple.getY()); - const bool bSnapX(bPrevVertical || bNextVertical); - const bool bSnapY(bPrevHorizontal || bNextHorizontal); - - if (bSnapX || bSnapY) +#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 18, 0) + void* addr(dlsym(nullptr, "cairo_set_hairline")); + if (nullptr != addr) { - basegfx::B2DPoint aSnappedPoint(bSnapX ? aCurrTuple.getX() : aCurrPoint.getX(), - bSnapY ? aCurrTuple.getY() : aCurrPoint.getY()); - - aSnappedPoint *= rViewInformation.getInverseObjectToViewTransformation(); - - return aSnappedPoint; + cairo_set_hairline(pRT, true); + return; } - - return rPolygon.getB2DPoint(nIndex); +#endif + // avoid cairo_device_to_user_distance, see note on that below + const double fPx( + (rViewInformation.getInverseObjectToViewTransformation() * basegfx::B2DVector(1.0, 0.0)) + .getLength()); + cairo_set_line_width(pRT, fPx); } -void addB2DPolygonToPathGeometry(cairo_t* cr, const basegfx::B2DPolygon& rPolygon, - const drawinglayer::geometry::ViewInformation2D* pViewInformation) +void addB2DPolygonToPathGeometry(cairo_t* pRT, const basegfx::B2DPolygon& rPolygon) { // short circuit if there is nothing to do const sal_uInt32 nPointCount(rPolygon.count()); const bool bHasCurves(rPolygon.areControlPointsUsed()); const bool bClosePath(rPolygon.isClosed()); - basegfx::B2DPoint aLast; + const basegfx::B2DPoint* pLast(nullptr); for (sal_uInt32 nPointIdx = 0, nPrevIdx = 0;; nPrevIdx = nPointIdx++) { @@ -106,15 +91,13 @@ void addB2DPolygonToPathGeometry(cairo_t* cr, const basegfx::B2DPolygon& rPolygo } } - const basegfx::B2DPoint aPoint(nullptr == pViewInformation - ? rPolygon.getB2DPoint(nClosedIdx) - : impPixelSnap(rPolygon, *pViewInformation, nClosedIdx)); + const basegfx::B2DPoint& rPoint(rPolygon.getB2DPoint(nClosedIdx)); if (!nPointIdx) { // first point => just move there - cairo_move_to(cr, aPoint.getX(), aPoint.getY()); - aLast = aPoint; + cairo_move_to(pRT, rPoint.getX(), rPoint.getY()); + pLast = &rPoint; continue; } @@ -128,7 +111,7 @@ void addB2DPolygonToPathGeometry(cairo_t* cr, const basegfx::B2DPolygon& rPolygo if (!bPendingCurve) // line segment { - cairo_line_to(cr, aPoint.getX(), aPoint.getY()); + cairo_line_to(pRT, rPoint.getX(), rPoint.getY()); } else // cubic bezier segment { @@ -139,54 +122,321 @@ void addB2DPolygonToPathGeometry(cairo_t* cr, const basegfx::B2DPolygon& rPolygo // correct replacement ones to avoid problems with the graphical sub-system // tdf#101026 The 1st attempt to create a mathematically correct replacement control // vector was wrong. Best alternative is one as close as possible which means short. - if (aCP1.equal(aLast)) + if (aCP1.equal(*pLast)) { - aCP1 = aLast + ((aCP2 - aLast) * 0.0005); + aCP1 = *pLast + ((aCP2 - *pLast) * 0.0005); } - if (aCP2.equal(aPoint)) + if (aCP2.equal(rPoint)) { - aCP2 = aPoint + ((aCP1 - aPoint) * 0.0005); + aCP2 = rPoint + ((aCP1 - rPoint) * 0.0005); } - cairo_curve_to(cr, aCP1.getX(), aCP1.getY(), aCP2.getX(), aCP2.getY(), aPoint.getX(), - aPoint.getY()); + cairo_curve_to(pRT, aCP1.getX(), aCP1.getY(), aCP2.getX(), aCP2.getY(), rPoint.getX(), + rPoint.getY()); } - aLast = aPoint; + pLast = &rPoint; } if (bClosePath) { - cairo_close_path(cr); + cairo_close_path(pRT); } } -// split alpha remains as a constant irritant -std::vector createBitmapData(const BitmapEx& rBitmapEx) +// needed as helper, see below. It guarantees clean +// construction/cleanup using destructor +// NOTE: maybe mpSurface can be costructed even simpler, +// not sure about that. It is only used to construct +// and hold path data +struct CairoContextHolder { - const Size& rSizePixel(rBitmapEx.GetSizePixel()); - const bool bAlpha(rBitmapEx.IsAlpha()); - const sal_uInt32 nStride - = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, rSizePixel.Width()); - std::vector aData(nStride * rSizePixel.Height()); + cairo_surface_t* mpSurface; + cairo_t* mpRenderContext; - if (bAlpha) + CairoContextHolder() + : mpSurface(cairo_image_surface_create(CAIRO_FORMAT_A1, 1, 1)) + , mpRenderContext(cairo_create(mpSurface)) + { + } + + ~CairoContextHolder() + { + cairo_destroy(mpRenderContext); + cairo_surface_destroy(mpSurface); + } + + cairo_t* getContext() const { return mpRenderContext; } +}; + +// global static helper instance +CairoContextHolder globalStaticCairoContext; + +// it shows that re-using and buffering path geometry data using +// cairo is more complicated than initially thought: when adding +// a path to a cairo_t render context it already *uses* the set +// transformation, also usually consumes the path when painting. +// The (only available) method cairo_copy_path to preserve that +// data *also* transforms the path - if not already created in +// transformed form - using the current transformation set at the +// cairo context. +// This is not what we want to have a re-usable path that is +// buffered at the Poly(poly)gon: we explicitely want *exactly* +// the coordinates in the polygon preserved *at* the polygon to +// be able to re-use that data independent from any set +// transformation at any cairo context. +// Thus, create paths using a helper (CairoPathHelper) using a +// helper cairo context (CairoContextHolder) that never gets +// transformed. This removes the need to feed it the cairo context, +// but also does not immediately add the path data to the target +// context, that needs to be done using cairo_append_path at the +// target cairo context. That works since all geometry is designed +// to use exactly that coordinate system the polygon is already +// designed for anyways, and it transforms as needed inside the +// target cairo context as needed (if transform is set) +class CairoPathHelper +{ + // the created CairoPath + cairo_path_t* mpCairoPath; + +public: + CairoPathHelper(const basegfx::B2DPolygon& rPolygon) + : mpCairoPath(nullptr) + { + cairo_new_path(globalStaticCairoContext.getContext()); + addB2DPolygonToPathGeometry(globalStaticCairoContext.getContext(), rPolygon); + mpCairoPath = cairo_copy_path(globalStaticCairoContext.getContext()); + cairo_new_path(globalStaticCairoContext.getContext()); + } + + CairoPathHelper(const basegfx::B2DPolyPolygon& rPolyPolygon) + : mpCairoPath(nullptr) + { + cairo_new_path(globalStaticCairoContext.getContext()); + for (const auto& rPolygon : rPolyPolygon) + addB2DPolygonToPathGeometry(globalStaticCairoContext.getContext(), rPolygon); + mpCairoPath = cairo_copy_path(globalStaticCairoContext.getContext()); + cairo_new_path(globalStaticCairoContext.getContext()); + } + + ~CairoPathHelper() + { + // need to cleanup instance + cairo_path_destroy(mpCairoPath); + } + + // read access + cairo_path_t* getCairoPath() const { return mpCairoPath; } + + sal_Int64 getEstimatedSize() const + { + if (nullptr == mpCairoPath) + return 0; + + // per node: + // - num_data incarnations of + // - sizeof(cairo_path_data_t) which is a union of defines and point data + // thus may 2 x sizeof(double) + return mpCairoPath->num_data * sizeof(cairo_path_data_t); + } +}; + +class SystemDependentData_CairoPathGeometry : public basegfx::SystemDependentData +{ + // the CairoPath holder + std::shared_ptr mpCairoPathHelper; + +public: + SystemDependentData_CairoPathGeometry(const std::shared_ptr& pCairoPathHelper) + : basegfx::SystemDependentData(Application::GetSystemDependentDataManager()) + , mpCairoPathHelper(pCairoPathHelper) + { + } + + // read access + const std::shared_ptr& getCairoPathHelper() const { return mpCairoPathHelper; } + + virtual sal_Int64 estimateUsageInBytes() const override + { + return (nullptr != mpCairoPathHelper) ? mpCairoPathHelper->getEstimatedSize() : 0; + } +}; + +constexpr unsigned long nMinimalPointsPath(4); +constexpr unsigned long nMinimalPointsFill(12); + +void checkAndDoPixelSnap(cairo_t* pRT, + const drawinglayer::geometry::ViewInformation2D& rViewInformation) +{ + const bool bPixelSnap(rViewInformation.getPixelSnapHairline() + && rViewInformation.getUseAntiAliasing()); + + if (!bPixelSnap) + { + // no pixel snap, done + return; + } + + // with the comments above at CairoPathHelper we cannot do PixelSnap + // at path construction time, so it needs to be done *after* the path + // data is added to the cairo context. ADvantage is that all general + // path data can be buffered, though, but needs view-dependent manipulation + // here after being added. + // For now, just snap all points - no real need to identify hor/ver lines + // when you think about it + + // get helper path + cairo_path_t* path(cairo_copy_path(pRT)); + + if (0 == path->num_data) + { + // path is empty, done + cairo_path_destroy(path); + return; + } + + for (int a(0); a < path->num_data; a += path->data[a].header.length) + { + cairo_path_data_t* data(&path->data[a]); + + switch (data->header.type) + { + case CAIRO_PATH_MOVE_TO: + case CAIRO_PATH_LINE_TO: + case CAIRO_PATH_CURVE_TO: + { + // NOTE: for CAIRO_PATH_CURVE_TO we would also have the control + // points, but these do not really need correction. If that may + // change a correction using the deltas in x and y could be added + + // get pointers to double data + double* pX(&data[1].point.x); + double* pY(&data[1].point.y); + + // transform to discrete pixels + cairo_user_to_device(pRT, pX, pY); + + // round them, also substract 0.5 which will be as transform in + // the paint method to move to 'inside' pixels when AA used. + // remember: this is only done when AA is active (see bPixelSnap + // above) + *pX = basegfx::fround(*pX) - 0.5; + *pY = basegfx::fround(*pY) - 0.5; + + // transform back to former transformed state + cairo_device_to_user(pRT, pX, pY); + break; + } + case CAIRO_PATH_CLOSE_PATH: + { + break; + } + } + } + + // set changed path back at cairo context + cairo_new_path(pRT); + cairo_append_path(pRT, path); + + // destroy helper path + cairo_path_destroy(path); +} + +void getOrCreatePathGeometry(cairo_t* pRT, const basegfx::B2DPolygon& rPolygon, + const drawinglayer::geometry::ViewInformation2D& rViewInformation) +{ + // try to access buffered data + std::shared_ptr pSystemDependentData_CairoPathGeometry( + rPolygon.getSystemDependentData()); + + if (pSystemDependentData_CairoPathGeometry) + { + // re-use data and do evtl. needed pixel snap after adding on cairo path data + cairo_append_path( + pRT, pSystemDependentData_CairoPathGeometry->getCairoPathHelper()->getCairoPath()); + checkAndDoPixelSnap(pRT, rViewInformation); + return; + } + + // create new data and add path data to pRT and do evtl. needed pixel snap after adding on cairo path data + std::shared_ptr pCairoPathHelper(std::make_shared(rPolygon)); + cairo_append_path(pRT, pCairoPathHelper->getCairoPath()); + checkAndDoPixelSnap(pRT, rViewInformation); + + // add to buffering mechanism if not trivial + if (rPolygon.count() > nMinimalPointsPath) + rPolygon.addOrReplaceSystemDependentData( + pCairoPathHelper); +} + +void getOrCreateFillGeometry(cairo_t* pRT, const basegfx::B2DPolyPolygon& rPolyPolygon) +{ + // try to access buffered data + std::shared_ptr pSystemDependentData_CairoPathGeometry( + rPolyPolygon.getSystemDependentData()); + + if (pSystemDependentData_CairoPathGeometry) + { + // re-use data + cairo_append_path( + pRT, pSystemDependentData_CairoPathGeometry->getCairoPathHelper()->getCairoPath()); + return; + } + + // create new data and add path data to pRT + std::shared_ptr pCairoPathHelper( + std::make_shared(rPolyPolygon)); + cairo_append_path(pRT, pCairoPathHelper->getCairoPath()); + + // get all PointCount to detect non-trivial + sal_uInt32 nAllPointCount(0); + for (const auto& rPolygon : rPolyPolygon) + nAllPointCount += rPolygon.count(); + + // add to buffering mechanism when no PixelSnapHairline (see above) and not trivial + if (nAllPointCount > nMinimalPointsFill) + rPolyPolygon.addOrReplaceSystemDependentData( + pCairoPathHelper); +} + +// check for env var that decides for using downscale pattern +const char* pDisableDownScale(getenv("SAL_DISABLE_CAIRO_DOWNSCALE")); +const bool bDisableDownScale(nullptr != pDisableDownScale); +constexpr unsigned long nMinimalDiscreteSize(15); +constexpr unsigned long nHalfMDSize((nMinimalDiscreteSize + 1) / 2); +constexpr unsigned long +nMinimalDiscreteSquareSizeToBuffer(nMinimalDiscreteSize* nMinimalDiscreteSize); + +class CairoSurfaceHelper +{ + // the buffered CairoSurface (bitmap data) + cairo_surface_t* mpCairoSurface; + + // evtl. MipMapped data (pre-scale to reduce data processing load) + mutable std::unordered_map maDownscaled; + + // create 32bit RGBA data for given BitmapEx + void createRGBA(const BitmapEx& rBitmapEx) { Bitmap aSrcAlpha(rBitmapEx.GetAlphaMask().GetBitmap()); BitmapScopedReadAccess pReadAccess(rBitmapEx.GetBitmap()); BitmapScopedReadAccess pAlphaReadAccess(aSrcAlpha); const tools::Long nHeight(pReadAccess->Height()); const tools::Long nWidth(pReadAccess->Width()); + mpCairoSurface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, nWidth, nHeight); + const sal_uInt32 nStride(cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, nWidth)); + unsigned char* surfaceData(cairo_image_surface_get_data(mpCairoSurface)); - for (tools::Long y = 0; y < nHeight; ++y) + for (tools::Long y(0); y < nHeight; ++y) { - unsigned char* pPixelData = aData.data() + (nStride * y); - for (tools::Long x = 0; x < nWidth; ++x) + unsigned char* pPixelData(surfaceData + (nStride * y)); + + for (tools::Long x(0); x < nWidth; ++x) { const BitmapColor aColor(pReadAccess->GetColor(y, x)); const BitmapColor aAlpha(pAlphaReadAccess->GetColor(y, x)); - const sal_uInt16 nAlpha(255 - aAlpha.GetRed()); + const sal_uInt16 nAlpha(aAlpha.GetRed()); pPixelData[SVP_CAIRO_RED] = vcl::bitmap::premultiply(nAlpha, aColor.GetRed()); pPixelData[SVP_CAIRO_GREEN] = vcl::bitmap::premultiply(nAlpha, aColor.GetGreen()); @@ -195,41 +445,346 @@ std::vector createBitmapData(const BitmapEx& rBitmapEx) pPixelData += 4; } } + + cairo_surface_mark_dirty(mpCairoSurface); } - else + + // create 32bit RGB data for given BitmapEx + void createRGB(const BitmapEx& rBitmapEx) { BitmapScopedReadAccess pReadAccess(rBitmapEx.GetBitmap()); const tools::Long nHeight(pReadAccess->Height()); const tools::Long nWidth(pReadAccess->Width()); + mpCairoSurface = cairo_image_surface_create(CAIRO_FORMAT_RGB24, nWidth, nHeight); + sal_uInt32 nStride(cairo_format_stride_for_width(CAIRO_FORMAT_RGB24, nWidth)); + unsigned char* surfaceData(cairo_image_surface_get_data(mpCairoSurface)); - for (tools::Long y = 0; y < nHeight; ++y) + for (tools::Long y(0); y < nHeight; ++y) { - unsigned char* pPixelData = aData.data() + (nStride * y); - for (tools::Long x = 0; x < nWidth; ++x) + unsigned char* pPixelData(surfaceData + (nStride * y)); + + for (tools::Long x(0); x < nWidth; ++x) { const BitmapColor aColor(pReadAccess->GetColor(y, x)); + pPixelData[SVP_CAIRO_RED] = aColor.GetRed(); pPixelData[SVP_CAIRO_GREEN] = aColor.GetGreen(); pPixelData[SVP_CAIRO_BLUE] = aColor.GetBlue(); - pPixelData[SVP_CAIRO_ALPHA] = 255; + pPixelData[SVP_CAIRO_ALPHA] = 255; // not really needed pPixelData += 4; } } + + cairo_surface_mark_dirty(mpCairoSurface); } - return aData; +// #define TEST_RGB16 +#ifdef TEST_RGB16 + // experimental: create 16bit RGB data for given BitmapEx + void createRGB16(const BitmapEx& rBitmapEx) + { + BitmapScopedReadAccess pReadAccess(rBitmapEx.GetBitmap()); + const tools::Long nHeight(pReadAccess->Height()); + const tools::Long nWidth(pReadAccess->Width()); + mpCairoSurface = cairo_image_surface_create(CAIRO_FORMAT_RGB16_565, nWidth, nHeight); + sal_uInt32 nStride(cairo_format_stride_for_width(CAIRO_FORMAT_RGB16_565, nWidth)); + unsigned char* surfaceData(cairo_image_surface_get_data(mpCairoSurface)); + + for (tools::Long y(0); y < nHeight; ++y) + { + unsigned char* pPixelData(surfaceData + (nStride * y)); + + for (tools::Long x(0); x < nWidth; ++x) + { + const BitmapColor aColor(pReadAccess->GetColor(y, x)); + const sal_uInt8 aLeft((aColor.GetBlue() >> 3) | ((aColor.GetGreen() << 3) & 0xe0)); + const sal_uInt8 aRight((aColor.GetRed() & 0xf8) | (aColor.GetGreen() >> 5)); +#ifdef OSL_BIGENDIAN + pPixelData[1] = aRight; + pPixelData[0] = aLeft; +#else + pPixelData[0] = aLeft; + pPixelData[1] = aRight; +#endif + pPixelData += 2; + } + } + + cairo_surface_mark_dirty(mpCairoSurface); + } +#endif + +public: + CairoSurfaceHelper(const BitmapEx& rBitmapEx) + : mpCairoSurface(nullptr) + , maDownscaled() + { + if (rBitmapEx.IsAlpha()) + createRGBA(rBitmapEx); + else +#ifdef TEST_RGB16 + createRGB16(rBitmapEx); +#else + createRGB(rBitmapEx); +#endif + } + + ~CairoSurfaceHelper() + { + // cleanup surface + cairo_surface_destroy(mpCairoSurface); + + // cleanup MipMap surfaces + for (auto& candidate : maDownscaled) + cairo_surface_destroy(candidate.second); + } + + cairo_surface_t* getCairoSurface(sal_uInt32 nTargetWidth = 0, + sal_uInt32 nTargetHeight = 0) const + { + // in simple cases just return the single created surface + if (bDisableDownScale || nullptr == mpCairoSurface || 0 == nTargetWidth + || 0 == nTargetHeight) + return mpCairoSurface; + + // get width/height of original surface + const sal_uInt32 nSourceWidth(cairo_image_surface_get_width(mpCairoSurface)); + const sal_uInt32 nSourceHeight(cairo_image_surface_get_height(mpCairoSurface)); + + // zoomed in, need to stretch at paint, no pre-scale useful + if (nTargetWidth >= nSourceWidth || nTargetHeight >= nSourceHeight) + return mpCairoSurface; + + // calculate downscale factor. Only use ONE factor to get the diagonal + // MipMap, NOT the full MipMap field in X/Y for uneven factors in both dimensions + sal_uInt32 nFactor(1); + sal_uInt32 nW((nSourceWidth + 1) / 2); + sal_uInt32 nH((nSourceHeight + 1) / 2); + + while (nW > nTargetWidth && nW > nHalfMDSize && nH > nTargetHeight && nH > nHalfMDSize) + { + nW = (nW + 1) / 2; + nH = (nH + 1) / 2; + nFactor *= 2; + } + + if (1 == nFactor) + { + // original size *is* best binary size, use it + return mpCairoSurface; + } + + // go up one scale again + nW *= 2; + nH *= 2; + + // bail out if the multiplication for the key would overflow + if (nW >= SAL_MAX_UINT32 || nH >= SAL_MAX_UINT32) + return mpCairoSurface; + + // check if we have a downscaled version of required size + const sal_uInt64 key((nW * static_cast(SAL_MAX_UINT32)) + nH); + auto isHit(maDownscaled.find(key)); + + // found -> return it + if (isHit != maDownscaled.end()) + return isHit->second; + + // create new surface in the targeted size + cairo_surface_t* pSurfaceTarget(cairo_surface_create_similar( + mpCairoSurface, cairo_surface_get_content(mpCairoSurface), nW, nH)); + + // made a version to scale self first with direct memory access. + // That worked well, but would've been hard to support + // CAIRO_FORMAT_A1 and similar (including bit shifting), so + // I decided to go with cairo itself - use CAIRO_FILTER_FAST or + // CAIRO_FILTER_GOOD though. Please modify as needed for + // performance/quality + cairo_t* cr = cairo_create(pSurfaceTarget); + const double fScaleX(static_cast(nW) / static_cast(nSourceWidth)); + const double fScaleY(static_cast(nH) / static_cast(nSourceHeight)); + + cairo_scale(cr, fScaleX, fScaleY); + cairo_set_source_surface(cr, mpCairoSurface, 0.0, 0.0); + cairo_pattern_set_filter(cairo_get_source(cr), CAIRO_FILTER_GOOD); + cairo_paint(cr); + cairo_destroy(cr); + + // NOTE: Took out, until now not really needed + // need to set device_scale for downscale surfaces to get + // them handled correctly + // cairo_surface_set_device_scale(pSurfaceTarget, fScaleX, fScaleY); + + // add entry to cached entries + maDownscaled[key] = pSurfaceTarget; + + return pSurfaceTarget; + } + + bool isTrivial() const + { + if (nullptr == mpCairoSurface) + return true; + + const sal_uInt32 nSourceWidth(cairo_image_surface_get_width(mpCairoSurface)); + const sal_uInt32 nSourceHeight(cairo_image_surface_get_height(mpCairoSurface)); + + return nSourceWidth * nSourceHeight < nMinimalDiscreteSquareSizeToBuffer; + } +}; + +class SystemDependentData_CairoSurface : public basegfx::SystemDependentData +{ + // the CairoSurface holder + std::shared_ptr mpCairoSurfaceHelper; + + // need to remember alpha source for combined BitmapEx to detect/ + // react on that changing + std::shared_ptr maAssociatedAlpha; + +public: + SystemDependentData_CairoSurface(const BitmapEx& rBitmapEx) + : basegfx::SystemDependentData(Application::GetSystemDependentDataManager()) + , mpCairoSurfaceHelper(std::make_shared(rBitmapEx)) + , maAssociatedAlpha() + { + if (rBitmapEx.IsAlpha()) + maAssociatedAlpha = rBitmapEx.GetAlphaMask().GetBitmap().ImplGetSalBitmap(); + } + + // read access + const std::shared_ptr& getCairoSurfaceHelper() const + { + return mpCairoSurfaceHelper; + } + const std::shared_ptr& getAssociatedAlpha() const { return maAssociatedAlpha; } + + virtual sal_Int64 estimateUsageInBytes() const override; +}; + +sal_Int64 SystemDependentData_CairoSurface::estimateUsageInBytes() const +{ + sal_Int64 nRetval(0); + + if (mpCairoSurfaceHelper) + { + cairo_surface_t* pSurface(mpCairoSurfaceHelper->getCairoSurface()); + const tools::Long nStride(cairo_image_surface_get_stride(pSurface)); + const tools::Long nHeight(cairo_image_surface_get_height(pSurface)); + + nRetval = nStride * nHeight; + + // if we do downscale, size will grow by 1/4 + 1/16 + 1/32 + ..., + // rough estimation just multiplies by 1.25 .. 1.33, should be good enough + // for estimation of buffer survival time + if (!bDisableDownScale) + { + nRetval = (nRetval * 5) / 4; + } + } + + return nRetval; +} + +std::shared_ptr getOrCreateCairoSurfaceHelper(const BitmapEx& rBitmapEx) +{ + const basegfx::SystemDependentDataHolder* pHolder( + rBitmapEx.GetBitmap().accessSystemDependentDataHolder()); + std::shared_ptr pSystemDependentData_CairoSurface; + + if (nullptr != pHolder) + { + // try to access SystemDependentDataHolder and buffered data + pSystemDependentData_CairoSurface + = std::static_pointer_cast( + pHolder->getSystemDependentData( + typeid(SystemDependentData_CairoSurface).hash_code())); + + // check data validity for associated Alpha + if (pSystemDependentData_CairoSurface && rBitmapEx.IsAlpha() + && pSystemDependentData_CairoSurface->getAssociatedAlpha() + != rBitmapEx.GetAlphaMask().GetBitmap().ImplGetSalBitmap()) + { + // AssociatedAlpha did change, data invalid + pSystemDependentData_CairoSurface.reset(); + } + } + + if (!pSystemDependentData_CairoSurface) + { + // create new SystemDependentData_CairoSurface + pSystemDependentData_CairoSurface + = std::make_shared(rBitmapEx); + + // only add if feasible + if (nullptr != pHolder + && !pSystemDependentData_CairoSurface->getCairoSurfaceHelper()->isTrivial() + && pSystemDependentData_CairoSurface->calculateCombinedHoldCyclesInSeconds() > 0) + { + basegfx::SystemDependentData_SharedPtr r2(pSystemDependentData_CairoSurface); + const_cast(pHolder) + ->addOrReplaceSystemDependentData(r2); + } + } + + if (pSystemDependentData_CairoSurface) + return pSystemDependentData_CairoSurface->getCairoSurfaceHelper(); + + return nullptr; +} + +// This bit-tweaking looping is unpleasant and unfortunate +void LuminanceToAlpha(cairo_surface_t* pMask) +{ + cairo_surface_flush(pMask); + + const sal_uInt32 nWidth(cairo_image_surface_get_width(pMask)); + const sal_uInt32 nHeight(cairo_image_surface_get_height(pMask)); + const sal_uInt32 nStride(cairo_image_surface_get_stride(pMask)); + + if (0 == nWidth || 0 == nHeight) + return; + + unsigned char* mask_surface_data = cairo_image_surface_get_data(pMask); + + // include/basegfx/color/bcolormodifier.hxx + constexpr double nRedMul(0.2125 / 255.0); + constexpr double nGreenMul(0.7154 / 255.0); + constexpr double nBlueMul(0.0721 / 255.0); + + // Only this alpha channel is taken into account by cairo_mask_surface + // so reuse this surface for the alpha result + for (sal_uInt32 y(0); y < nHeight; ++y) + { + unsigned char* pMaskPixelData = mask_surface_data + (nStride * y); + + for (sal_uInt32 x(0); x < nWidth; ++x) + { + // do not forget that we have pre-multiplied alpha + const sal_uInt8 nAlpha(pMaskPixelData[SVP_CAIRO_ALPHA]); + + if (0 != nAlpha) + { + const double fLuminance = pMaskPixelData[SVP_CAIRO_RED] * nRedMul + + pMaskPixelData[SVP_CAIRO_GREEN] * nGreenMul + + pMaskPixelData[SVP_CAIRO_BLUE] * nBlueMul; + + if (255 != nAlpha) + pMaskPixelData[SVP_CAIRO_ALPHA] = fLuminance / nAlpha; + else + pMaskPixelData[SVP_CAIRO_ALPHA] = 255.0 * fLuminance; + } + + pMaskPixelData += 4; + } + } + + cairo_surface_mark_dirty(pMask); } } namespace drawinglayer::processor2d { -CairoPixelProcessor2D::CairoPixelProcessor2D(const geometry::ViewInformation2D& rViewInformation) - : BaseProcessor2D(rViewInformation) - , maBColorModifierStack() - , mpRT(nullptr) -{ -} - CairoPixelProcessor2D::CairoPixelProcessor2D(const geometry::ViewInformation2D& rViewInformation, cairo_surface_t* pTarget) : BaseProcessor2D(rViewInformation) @@ -241,6 +796,7 @@ CairoPixelProcessor2D::CairoPixelProcessor2D(const geometry::ViewInformation2D& cairo_t* pRT = cairo_create(pTarget); cairo_set_antialias(pRT, rViewInformation.getUseAntiAliasing() ? CAIRO_ANTIALIAS_DEFAULT : CAIRO_ANTIALIAS_NONE); + cairo_set_fill_rule(pRT, CAIRO_FILL_RULE_EVEN_ODD); setRenderTarget(pRT); } } @@ -251,81 +807,6 @@ CairoPixelProcessor2D::~CairoPixelProcessor2D() cairo_destroy(mpRT); } -void CairoPixelProcessor2D::processPolygonHairlinePrimitive2D( - const primitive2d::PolygonHairlinePrimitive2D& rPolygonHairlinePrimitive2D) -{ - const basegfx::B2DPolygon& rPolygon(rPolygonHairlinePrimitive2D.getB2DPolygon()); - - if (!rPolygon.count()) - return; - - cairo_save(mpRT); - - cairo_matrix_t aMatrix; - const double fAAOffset(getViewInformation2D().getUseAntiAliasing() ? 0.5 : 0.0); - const basegfx::B2DHomMatrix& rObjectToView( - getViewInformation2D().getObjectToViewTransformation()); - cairo_matrix_init(&aMatrix, rObjectToView.a(), rObjectToView.b(), rObjectToView.c(), - rObjectToView.d(), rObjectToView.e() + fAAOffset, - rObjectToView.f() + fAAOffset); - - // set linear transformation - cairo_set_matrix(mpRT, &aMatrix); - - const basegfx::BColor aHairlineColor( - maBColorModifierStack.getModifiedColor(rPolygonHairlinePrimitive2D.getBColor())); - cairo_set_source_rgb(mpRT, aHairlineColor.getRed(), aHairlineColor.getGreen(), - aHairlineColor.getBlue()); - - // TODO: Unfortunately Direct2D paint of one pixel wide lines does not - // correctly and completely blend 100% over the background. Experimenting - // shows that a value around/slightly below 2.0 is needed which hints that - // alpha blending the half-shifted lines (see fAAOffset above) is involved. - // To get correct blending I try to use just wider hairlines for now. This - // may need to be improved - or balanced (trying sqrt(2) now...) - cairo_set_line_width(mpRT, 1.44f); - - addB2DPolygonToPathGeometry(mpRT, rPolygon, &getViewInformation2D()); - - cairo_stroke(mpRT); - - cairo_restore(mpRT); -} - -void CairoPixelProcessor2D::processPolyPolygonColorPrimitive2D( - const primitive2d::PolyPolygonColorPrimitive2D& rPolyPolygonColorPrimitive2D) -{ - const basegfx::B2DPolyPolygon& rPolyPolygon(rPolyPolygonColorPrimitive2D.getB2DPolyPolygon()); - const sal_uInt32 nCount(rPolyPolygon.count()); - - if (!nCount) - return; - - cairo_save(mpRT); - - cairo_matrix_t aMatrix; - const double fAAOffset(getViewInformation2D().getUseAntiAliasing() ? 0.5 : 0.0); - const basegfx::B2DHomMatrix& rObjectToView( - getViewInformation2D().getObjectToViewTransformation()); - cairo_matrix_init(&aMatrix, rObjectToView.a(), rObjectToView.b(), rObjectToView.c(), - rObjectToView.d(), rObjectToView.e() + fAAOffset, - rObjectToView.f() + fAAOffset); - - // set linear transformation - cairo_set_matrix(mpRT, &aMatrix); - - const basegfx::BColor aFillColor( - maBColorModifierStack.getModifiedColor(rPolyPolygonColorPrimitive2D.getBColor())); - cairo_set_source_rgb(mpRT, aFillColor.getRed(), aFillColor.getGreen(), aFillColor.getBlue()); - - for (const auto& rPolygon : rPolyPolygon) - addB2DPolygonToPathGeometry(mpRT, rPolygon, &getViewInformation2D()); - - cairo_fill(mpRT); - - cairo_restore(mpRT); -} - void CairoPixelProcessor2D::processBitmapPrimitive2D( const primitive2d::BitmapPrimitive2D& rBitmapCandidate) { @@ -351,11 +832,13 @@ void CairoPixelProcessor2D::processBitmapPrimitive2D( if (aBitmapEx.IsEmpty() || aBitmapEx.GetSizePixel().IsEmpty()) { + // no pixel data, done return; } if (maBColorModifierStack.count()) { + // need to apply ColorModifier to Bitmap data aBitmapEx = aBitmapEx.ModifyBitmapEx(maBColorModifierStack); if (aBitmapEx.IsEmpty()) @@ -372,183 +855,103 @@ void CairoPixelProcessor2D::processBitmapPrimitive2D( rtl::Reference xTemp( new primitive2d::PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aPolygon), aModifiedColor)); + + // draw as Polygon, done processPolyPolygonColorPrimitive2D(*xTemp); return; } } - // nasty copy of bitmap data - std::vector aPixelData(createBitmapData(aBitmapEx)); - const Size& rSizePixel(aBitmapEx.GetSizePixel()); - cairo_surface_t* pBitmapSurface = cairo_image_surface_create_for_data( - aPixelData.data(), CAIRO_FORMAT_ARGB32, rSizePixel.Width(), rSizePixel.Height(), - cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, rSizePixel.Width())); + // access or create cairo bitmap data + std::shared_ptr aCairoSurfaceHelper( + getOrCreateCairoSurfaceHelper(aBitmapEx)); + if (!aCairoSurfaceHelper) + { + SAL_WARN("drawinglayer", "SDPRCairo: No SurfaceHelper from BitmapEx (!)"); + return; + } + + // work with dimensions in discrete target pixels to use evtl. MipMap pre-scale + const tools::Long nDestWidth((aLocalTransform * basegfx::B2DVector(1.0, 0.0)).getLength()); + const tools::Long nDestHeight((aLocalTransform * basegfx::B2DVector(0.0, 1.0)).getLength()); + + cairo_surface_t* pTarget(aCairoSurfaceHelper->getCairoSurface(nDestWidth, nDestHeight)); + if (nullptr == pTarget) + { + SAL_WARN("drawinglayer", "SDPRCairo: No CairoSurface from BitmapEx SurfaceHelper (!)"); + return; + } cairo_save(mpRT); + // set linear transformation - no fAAOffset for bitmap data cairo_matrix_t aMatrix; - const double fAAOffset(getViewInformation2D().getUseAntiAliasing() ? 0.5 : 0.0); cairo_matrix_init(&aMatrix, aLocalTransform.a(), aLocalTransform.b(), aLocalTransform.c(), - aLocalTransform.d(), aLocalTransform.e() + fAAOffset, - aLocalTransform.f() + fAAOffset); - - // set linear transformation + aLocalTransform.d(), aLocalTransform.e(), aLocalTransform.f()); cairo_set_matrix(mpRT, &aMatrix); - // destinationRectangle is part of transformation above, so use UnitRange - cairo_rectangle(mpRT, 0, 0, 1, 1); - cairo_clip(mpRT); + static bool bRenderTransformationBounds(false); + if (bRenderTransformationBounds) + { + cairo_set_source_rgba(mpRT, 1, 0, 0, 0.8); + impl_cairo_set_hairline(mpRT, getViewInformation2D()); + cairo_rectangle(mpRT, 0, 0, 1, 1); + cairo_stroke(mpRT); + } - cairo_set_source_surface(mpRT, pBitmapSurface, 0, 0); - // get the pattern created by cairo_set_source_surface + const sal_uInt32 nWidth(cairo_image_surface_get_width(pTarget)); + const sal_uInt32 nHeight(cairo_image_surface_get_height(pTarget)); + + cairo_set_source_surface(mpRT, pTarget, 0, 0); + + // get the pattern created by cairo_set_source_surface and + // it's transformation cairo_pattern_t* sourcepattern = cairo_get_source(mpRT); cairo_pattern_get_matrix(sourcepattern, &aMatrix); - // scale to match the current transformation - cairo_matrix_scale(&aMatrix, rSizePixel.Width(), rSizePixel.Height()); - cairo_pattern_set_matrix(sourcepattern, &aMatrix); - cairo_paint(mpRT); - - cairo_surface_destroy(pBitmapSurface); - - cairo_restore(mpRT); -} - -namespace -{ -// This bit-tweaking looping is unpleasant and unfortunate -void LuminanceToAlpha(cairo_surface_t* pMask) -{ - cairo_surface_flush(pMask); - - int nWidth = cairo_image_surface_get_width(pMask); - int nHeight = cairo_image_surface_get_height(pMask); - int nStride = cairo_image_surface_get_stride(pMask); - unsigned char* mask_surface_data = cairo_image_surface_get_data(pMask); - - // include/basegfx/color/bcolormodifier.hxx - const double nRedMul = 0.2125 / 255.0; - const double nGreenMul = 0.7154 / 255.0; - const double nBlueMul = 0.0721 / 255.0; - for (int y = 0; y < nHeight; ++y) + // RGBA sources overlap the unit geometry range, slightly, + // to see that activate bRenderTransformationBounds and + // insert a ARGB image, zoom to the borders. Seems to be half + // a pixel. Very good to demonstrate: 8x1 pixel, some + // transparent. + // This effect is also visible in the left/right/boittom/top + // page shadows, these DO use 8x1/1x8 images which led me to + // that problem. I see two solutions: + static bool bRenderMasked(true); + if (bRenderMasked) { - unsigned char* pMaskPixelData = mask_surface_data + (nStride * y); - for (int x = 0; x < nWidth; ++x) + // Consequence is that these need clipping. That again is + // simple (we are in unit coordinates). Only do for RGBA, + // for RGB this effect does not happen + if (CAIRO_FORMAT_ARGB32 == cairo_image_surface_get_format(pTarget)) { - double fLuminance = pMaskPixelData[SVP_CAIRO_RED] * nRedMul - + pMaskPixelData[SVP_CAIRO_GREEN] * nGreenMul - + pMaskPixelData[SVP_CAIRO_BLUE] * nBlueMul; - // Only this alpha channel is taken into account by cairo_mask_surface - // so reuse this surface for the alpha result - pMaskPixelData[SVP_CAIRO_ALPHA] = 255.0 * fLuminance; - pMaskPixelData += 4; + cairo_rectangle(mpRT, 0, 0, 1, 1); + cairo_clip(mpRT); + } + + cairo_matrix_scale(&aMatrix, nWidth, nHeight); + } + else + { + // Alternative: for RGBA, resize/scale SLIGHTLY so that that + // half pixel overlap is forced to be inside the unit range. + // That makes the error disappear, so no clip needed, but + // SLIGHTLY smaller. + if (CAIRO_FORMAT_ARGB32 == cairo_image_surface_get_format(pTarget)) + { + cairo_matrix_init_scale(&aMatrix, nWidth + 1, nHeight + 1); + cairo_matrix_translate(&aMatrix, -0.5 / (nWidth + 1), -0.5 / (nHeight + 1)); + } + else + { + cairo_matrix_scale(&aMatrix, nWidth, nHeight); } } - cairo_surface_mark_dirty(pMask); -} -} + cairo_pattern_set_matrix(sourcepattern, &aMatrix); -void CairoPixelProcessor2D::processTransparencePrimitive2D( - const primitive2d::TransparencePrimitive2D& rTransCandidate) -{ - if (rTransCandidate.getChildren().empty()) - return; - - if (rTransCandidate.getTransparence().empty()) - return; - - cairo_surface_t* pTarget = cairo_get_target(mpRT); - - double clip_x1, clip_x2, clip_y1, clip_y2; - cairo_clip_extents(mpRT, &clip_x1, &clip_y1, &clip_x2, &clip_y2); - - // calculate visible range, create only for that range - basegfx::B2DRange aDiscreteRange( - rTransCandidate.getChildren().getB2DRange(getViewInformation2D())); - aDiscreteRange.transform(getViewInformation2D().getObjectToViewTransformation()); - const basegfx::B2DRange aViewRange(basegfx::B2DPoint(clip_x1, clip_y1), - basegfx::B2DPoint(clip_x2, clip_y2)); - basegfx::B2DRange aVisibleRange(aDiscreteRange); - aVisibleRange.intersect(aViewRange); - - if (aVisibleRange.isEmpty()) - { - // not visible, done - return; - } - - const basegfx::B2DHomMatrix aEmbedTransform(basegfx::utils::createTranslateB2DHomMatrix( - -aVisibleRange.getMinX(), -aVisibleRange.getMinY())); - geometry::ViewInformation2D aViewInformation2D(getViewInformation2D()); - aViewInformation2D.setViewTransformation(aEmbedTransform - * getViewInformation2D().getViewTransformation()); - // draw mask to temporary surface - cairo_surface_t* pMask = cairo_surface_create_similar_image(pTarget, CAIRO_FORMAT_ARGB32, - ceil(aVisibleRange.getWidth()), - ceil(aVisibleRange.getHeight())); - CairoPixelProcessor2D aMaskRenderer(aViewInformation2D, pMask); - aMaskRenderer.process(rTransCandidate.getTransparence()); - - // convert mask to something cairo can use - LuminanceToAlpha(pMask); - - // draw content to temporary surface - cairo_surface_t* pContent = cairo_surface_create_similar( - pTarget, cairo_surface_get_content(pTarget), ceil(aVisibleRange.getWidth()), - ceil(aVisibleRange.getHeight())); - CairoPixelProcessor2D aContent(aViewInformation2D, pContent); - aContent.process(rTransCandidate.getChildren()); - - // munge the temporary surfaces to our target surface - cairo_set_source_surface(mpRT, pContent, aVisibleRange.getMinX(), aVisibleRange.getMinY()); - cairo_mask_surface(mpRT, pMask, aVisibleRange.getMinX(), aVisibleRange.getMinY()); - - cairo_surface_destroy(pContent); - cairo_surface_destroy(pMask); -} - -void CairoPixelProcessor2D::processMaskPrimitive2DPixel( - const primitive2d::MaskPrimitive2D& rMaskCandidate) -{ - if (rMaskCandidate.getChildren().empty()) - return; - - basegfx::B2DPolyPolygon aMask(rMaskCandidate.getMask()); - - if (!aMask.count()) - return; - - double clip_x1, clip_x2, clip_y1, clip_y2; - cairo_clip_extents(mpRT, &clip_x1, &clip_y1, &clip_x2, &clip_y2); - - basegfx::B2DRange aMaskRange(aMask.getB2DRange()); - aMaskRange.transform(getViewInformation2D().getObjectToViewTransformation()); - const basegfx::B2DRange aViewRange(basegfx::B2DPoint(clip_x1, clip_y1), - basegfx::B2DPoint(clip_x2, clip_y2)); - - if (!aViewRange.overlaps(aMaskRange)) - return; - - cairo_save(mpRT); - - cairo_matrix_t aMatrix; - const basegfx::B2DHomMatrix& rObjectToView( - getViewInformation2D().getObjectToViewTransformation()); - cairo_matrix_init(&aMatrix, rObjectToView.a(), rObjectToView.b(), rObjectToView.c(), - rObjectToView.d(), rObjectToView.e(), rObjectToView.f()); - - // set linear transformation - cairo_set_matrix(mpRT, &aMatrix); - - // put mask as path - for (const auto& rPolygon : aMask) - addB2DPolygonToPathGeometry(mpRT, rPolygon, &getViewInformation2D()); - - // clip to this mask - cairo_clip(mpRT); - - process(rMaskCandidate.getChildren()); + // paint bitmap data + cairo_paint(mpRT); cairo_restore(mpRT); } @@ -557,9 +960,16 @@ void CairoPixelProcessor2D::processPointArrayPrimitive2D( const primitive2d::PointArrayPrimitive2D& rPointArrayCandidate) { const std::vector& rPositions(rPointArrayCandidate.getPositions()); - if (rPositions.empty()) - return; + if (rPositions.empty()) + { + // no geometry, done + return; + } + + cairo_save(mpRT); + + // determine & set color const basegfx::BColor aPointColor( maBColorModifierStack.getModifiedColor(rPointArrayCandidate.getRGBColor())); cairo_set_source_rgb(mpRT, aPointColor.getRed(), aPointColor.getGreen(), aPointColor.getBlue()); @@ -581,11 +991,217 @@ void CairoPixelProcessor2D::processPointArrayPrimitive2D( } cairo_set_antialias(mpRT, eOldAAMode); + cairo_restore(mpRT); +} + +void CairoPixelProcessor2D::processPolygonHairlinePrimitive2D( + const primitive2d::PolygonHairlinePrimitive2D& rPolygonHairlinePrimitive2D) +{ + const basegfx::B2DPolygon& rPolygon(rPolygonHairlinePrimitive2D.getB2DPolygon()); + + if (!rPolygon.count()) + { + // no geometry, done + return; + } + + cairo_save(mpRT); + + // set linear transformation + cairo_matrix_t aMatrix; + const double fAAOffset(getViewInformation2D().getUseAntiAliasing() ? 0.5 : 0.0); + const basegfx::B2DHomMatrix& rObjectToView( + getViewInformation2D().getObjectToViewTransformation()); + cairo_matrix_init(&aMatrix, rObjectToView.a(), rObjectToView.b(), rObjectToView.c(), + rObjectToView.d(), rObjectToView.e() + fAAOffset, + rObjectToView.f() + fAAOffset); + cairo_set_matrix(mpRT, &aMatrix); + + // determine & set color + const basegfx::BColor aHairlineColor( + maBColorModifierStack.getModifiedColor(rPolygonHairlinePrimitive2D.getBColor())); + cairo_set_source_rgb(mpRT, aHairlineColor.getRed(), aHairlineColor.getGreen(), + aHairlineColor.getBlue()); + + // set LineWidth, use cairos special cairo_set_hairline + impl_cairo_set_hairline(mpRT, getViewInformation2D()); + + // get PathGeometry & paint it + cairo_new_path(mpRT); + getOrCreatePathGeometry(mpRT, rPolygon, getViewInformation2D()); + cairo_stroke(mpRT); + + cairo_restore(mpRT); +} + +void CairoPixelProcessor2D::processPolyPolygonColorPrimitive2D( + const primitive2d::PolyPolygonColorPrimitive2D& rPolyPolygonColorPrimitive2D) +{ + const basegfx::B2DPolyPolygon& rPolyPolygon(rPolyPolygonColorPrimitive2D.getB2DPolyPolygon()); + const sal_uInt32 nCount(rPolyPolygon.count()); + + if (!nCount) + { + // no geometry, done + return; + } + + cairo_save(mpRT); + + // set linear transformation + cairo_matrix_t aMatrix; + const double fAAOffset(getViewInformation2D().getUseAntiAliasing() ? 0.5 : 0.0); + const basegfx::B2DHomMatrix& rObjectToView( + getViewInformation2D().getObjectToViewTransformation()); + cairo_matrix_init(&aMatrix, rObjectToView.a(), rObjectToView.b(), rObjectToView.c(), + rObjectToView.d(), rObjectToView.e() + fAAOffset, + rObjectToView.f() + fAAOffset); + cairo_set_matrix(mpRT, &aMatrix); + + // determine & set color + const basegfx::BColor aFillColor( + maBColorModifierStack.getModifiedColor(rPolyPolygonColorPrimitive2D.getBColor())); + cairo_set_source_rgb(mpRT, aFillColor.getRed(), aFillColor.getGreen(), aFillColor.getBlue()); + + // get PathGeometry & paint it + cairo_new_path(mpRT); + getOrCreateFillGeometry(mpRT, rPolyPolygon); + cairo_fill(mpRT); + + cairo_restore(mpRT); +} + +void CairoPixelProcessor2D::processTransparencePrimitive2D( + const primitive2d::TransparencePrimitive2D& rTransCandidate) +{ + if (rTransCandidate.getChildren().empty()) + { + // no content, done + return; + } + + if (rTransCandidate.getTransparence().empty()) + { + // no mask (so nothing visible), done + return; + } + + // calculate visible range, create only for that range + basegfx::B2DRange aDiscreteRange( + rTransCandidate.getChildren().getB2DRange(getViewInformation2D())); + aDiscreteRange.transform(getViewInformation2D().getObjectToViewTransformation()); + basegfx::B2DRange aVisibleRange(aDiscreteRange); + double clip_x1, clip_x2, clip_y1, clip_y2; + cairo_clip_extents(mpRT, &clip_x1, &clip_y1, &clip_x2, &clip_y2); + const basegfx::B2DRange aViewRange(basegfx::B2DPoint(clip_x1, clip_y1), + basegfx::B2DPoint(clip_x2, clip_y2)); + aVisibleRange.intersect(aViewRange); + + if (aVisibleRange.isEmpty()) + { + // not visible, done + return; + } + + cairo_save(mpRT); + + // create embedding transformation for sub-surface + const basegfx::B2DHomMatrix aEmbedTransform(basegfx::utils::createTranslateB2DHomMatrix( + -aVisibleRange.getMinX(), -aVisibleRange.getMinY())); + geometry::ViewInformation2D aViewInformation2D(getViewInformation2D()); + aViewInformation2D.setViewTransformation(aEmbedTransform + * getViewInformation2D().getViewTransformation()); + + // draw mask to temporary surface + cairo_surface_t* pTarget = cairo_get_target(mpRT); + const double fContainedWidth(ceil(aVisibleRange.getWidth())); + const double fContainedHeight(ceil(aVisibleRange.getHeight())); + cairo_surface_t* pMask = cairo_surface_create_similar_image(pTarget, CAIRO_FORMAT_ARGB32, + fContainedWidth, fContainedHeight); + CairoPixelProcessor2D aMaskRenderer(aViewInformation2D, pMask); + aMaskRenderer.process(rTransCandidate.getTransparence()); + + // convert mask to something cairo can use + LuminanceToAlpha(pMask); + + // draw content to temporary surface + cairo_surface_t* pContent = cairo_surface_create_similar( + pTarget, cairo_surface_get_content(pTarget), fContainedWidth, fContainedHeight); + CairoPixelProcessor2D aContent(aViewInformation2D, pContent); + aContent.process(rTransCandidate.getChildren()); + + // munge the temporary surfaces to our target surface + cairo_set_source_surface(mpRT, pContent, aVisibleRange.getMinX(), aVisibleRange.getMinY()); + cairo_mask_surface(mpRT, pMask, aVisibleRange.getMinX(), aVisibleRange.getMinY()); + + // cleanup temporary surfaces + cairo_surface_destroy(pContent); + cairo_surface_destroy(pMask); + + cairo_restore(mpRT); +} + +void CairoPixelProcessor2D::processMaskPrimitive2DPixel( + const primitive2d::MaskPrimitive2D& rMaskCandidate) +{ + if (rMaskCandidate.getChildren().empty()) + { + // no content, done + return; + } + + basegfx::B2DPolyPolygon aMask(rMaskCandidate.getMask()); + + if (!aMask.count()) + { + // no mask (so nothing inside), done + return; + } + + // calculate visible range + double clip_x1, clip_x2, clip_y1, clip_y2; + cairo_clip_extents(mpRT, &clip_x1, &clip_y1, &clip_x2, &clip_y2); + basegfx::B2DRange aMaskRange(aMask.getB2DRange()); + aMaskRange.transform(getViewInformation2D().getObjectToViewTransformation()); + const basegfx::B2DRange aViewRange(basegfx::B2DPoint(clip_x1, clip_y1), + basegfx::B2DPoint(clip_x2, clip_y2)); + + if (!aViewRange.overlaps(aMaskRange)) + { + // not visible, done + return; + } + + cairo_save(mpRT); + + // set linear transformation + cairo_matrix_t aMatrix; + const basegfx::B2DHomMatrix& rObjectToView( + getViewInformation2D().getObjectToViewTransformation()); + const double fAAOffset(getViewInformation2D().getUseAntiAliasing() ? 0.5 : 0.0); + cairo_matrix_init(&aMatrix, rObjectToView.a(), rObjectToView.b(), rObjectToView.c(), + rObjectToView.d(), rObjectToView.e() + fAAOffset, + rObjectToView.f() + fAAOffset); + cairo_set_matrix(mpRT, &aMatrix); + + // create path geometry and put mask as path + cairo_new_path(mpRT); + getOrCreateFillGeometry(mpRT, aMask); + + // clip to this mask (also reset path, cairo_clip does not consume it) + cairo_clip(mpRT); + cairo_new_path(mpRT); + + // process sub-content (that shall be masked) + process(rMaskCandidate.getChildren()); + + cairo_restore(mpRT); } void CairoPixelProcessor2D::processModifiedColorPrimitive2D( const primitive2d::ModifiedColorPrimitive2D& rModifiedCandidate) { + // standard implementation if (!rModifiedCandidate.getChildren().empty()) { maBColorModifierStack.push(rModifiedCandidate.getColorModifier()); @@ -597,6 +1213,7 @@ void CairoPixelProcessor2D::processModifiedColorPrimitive2D( void CairoPixelProcessor2D::processTransformPrimitive2D( const primitive2d::TransformPrimitive2D& rTransformCandidate) { + // standard implementation // remember current transformation and ViewInformation const geometry::ViewInformation2D aLastViewInformation2D(getViewInformation2D()); @@ -613,6 +1230,154 @@ void CairoPixelProcessor2D::processTransformPrimitive2D( updateViewInformation(aLastViewInformation2D); } +void CairoPixelProcessor2D::processUnifiedTransparencePrimitive2D( + const primitive2d::UnifiedTransparencePrimitive2D& rTransCandidate) +{ + if (rTransCandidate.getChildren().empty()) + { + // no content, done + return; + } + + if (0.0 == rTransCandidate.getTransparence()) + { + // not transparent at all, use content + process(rTransCandidate.getChildren()); + return; + } + + if (rTransCandidate.getTransparence() < 0.0 || rTransCandidate.getTransparence() > 1.0) + { + // invalid transparence, done + return; + } + + cairo_save(mpRT); + + // calculate visible range, create only for that range + basegfx::B2DRange aDiscreteRange( + rTransCandidate.getChildren().getB2DRange(getViewInformation2D())); + aDiscreteRange.transform(getViewInformation2D().getObjectToViewTransformation()); + basegfx::B2DRange aVisibleRange(aDiscreteRange); + double clip_x1, clip_x2, clip_y1, clip_y2; + cairo_clip_extents(mpRT, &clip_x1, &clip_y1, &clip_x2, &clip_y2); + const basegfx::B2DRange aViewRange(basegfx::B2DPoint(clip_x1, clip_y1), + basegfx::B2DPoint(clip_x2, clip_y2)); + aVisibleRange.intersect(aViewRange); + + if (aVisibleRange.isEmpty()) + { + // not visible, done + return; + } + + // create embedding transformation for sub-surface + const basegfx::B2DHomMatrix aEmbedTransform(basegfx::utils::createTranslateB2DHomMatrix( + -aVisibleRange.getMinX(), -aVisibleRange.getMinY())); + geometry::ViewInformation2D aViewInformation2D(getViewInformation2D()); + aViewInformation2D.setViewTransformation(aEmbedTransform + * getViewInformation2D().getViewTransformation()); + + // draw content to temporary surface + cairo_surface_t* pTarget = cairo_get_target(mpRT); + const double fContainedWidth(ceil(aVisibleRange.getWidth())); + const double fContainedHeight(ceil(aVisibleRange.getHeight())); + cairo_surface_t* pContent = cairo_surface_create_similar( + pTarget, cairo_surface_get_content(pTarget), fContainedWidth, fContainedHeight); + CairoPixelProcessor2D aContent(aViewInformation2D, pContent); + aContent.process(rTransCandidate.getChildren()); + + // paint temporary surface to target with fixed transparence + cairo_set_source_surface(mpRT, pContent, aVisibleRange.getMinX(), aVisibleRange.getMinY()); + cairo_paint_with_alpha(mpRT, 1.0 - rTransCandidate.getTransparence()); + + // cleanup temporary surface + cairo_surface_destroy(pContent); + + cairo_restore(mpRT); +} + +void CairoPixelProcessor2D::processMarkerArrayPrimitive2D( + const primitive2d::MarkerArrayPrimitive2D& rMarkerArrayCandidate) +{ + const std::vector& rPositions(rMarkerArrayCandidate.getPositions()); + + if (rPositions.empty()) + { + // no geometry, done + return; + } + + const BitmapEx& rMarker(rMarkerArrayCandidate.getMarker()); + + if (rMarker.IsEmpty()) + { + // no marker defined, done + return; + } + + // access or create cairo bitmap data + const BitmapEx& rBitmapEx(rMarkerArrayCandidate.getMarker()); + std::shared_ptr aCairoSurfaceHelper( + getOrCreateCairoSurfaceHelper(rBitmapEx)); + if (!aCairoSurfaceHelper) + { + SAL_WARN("drawinglayer", "SDPRCairo: No SurfaceHelper from BitmapEx (!)"); + return; + } + + // do not use dimensions, these are usually small instances + cairo_surface_t* pTarget(aCairoSurfaceHelper->getCairoSurface()); + if (nullptr == pTarget) + { + SAL_WARN("drawinglayer", "SDPRCairo: No CairoSurface from BitmapEx SurfaceHelper (!)"); + return; + } + + const sal_uInt32 nWidth(cairo_image_surface_get_width(pTarget)); + const sal_uInt32 nHeight(cairo_image_surface_get_height(pTarget)); + const tools::Long nMiX((nWidth / 2) + 1); + const tools::Long nMiY((nHeight / 2) + 1); + + cairo_save(mpRT); + cairo_identity_matrix(mpRT); + const cairo_antialias_t eOldAAMode(cairo_get_antialias(mpRT)); + cairo_set_antialias(mpRT, CAIRO_ANTIALIAS_NONE); + + for (auto const& pos : rPositions) + { + const basegfx::B2DPoint aDiscretePos(getViewInformation2D().getObjectToViewTransformation() + * pos); + const double fX(ceil(aDiscretePos.getX())); + const double fY(ceil(aDiscretePos.getY())); + + cairo_set_source_surface(mpRT, pTarget, fX - nMiX, fY - nMiY); + cairo_paint(mpRT); + } + + cairo_set_antialias(mpRT, eOldAAMode); + cairo_restore(mpRT); +} + +void CairoPixelProcessor2D::processBackgroundColorPrimitive2D( + const primitive2d::BackgroundColorPrimitive2D& rBackgroundColorCandidate) +{ + // check for allowed range [0.0 .. 1.0[ + if (rBackgroundColorCandidate.getTransparency() < 0.0 + || rBackgroundColorCandidate.getTransparency() >= 1.0) + return; + + cairo_save(mpRT); + const basegfx::BColor aFillColor( + maBColorModifierStack.getModifiedColor(rBackgroundColorCandidate.getBColor())); + cairo_set_source_rgba(mpRT, aFillColor.getRed(), aFillColor.getGreen(), aFillColor.getBlue(), + 1.0 - rBackgroundColorCandidate.getTransparency()); + // to also copy alpha part of color, see cairo docu. Will be reset by restore below + cairo_set_operator(mpRT, CAIRO_OPERATOR_SOURCE); + cairo_paint(mpRT); + cairo_restore(mpRT); +} + void CairoPixelProcessor2D::processPolygonStrokePrimitive2D( const primitive2d::PolygonStrokePrimitive2D& rPolygonStrokeCandidate) { @@ -670,13 +1435,12 @@ void CairoPixelProcessor2D::processPolygonStrokePrimitive2D( cairo_save(mpRT); + // set linear transformation cairo_matrix_t aMatrix; const double fAAOffset(getViewInformation2D().getUseAntiAliasing() ? 0.5 : 0.0); cairo_matrix_init(&aMatrix, rObjectToView.a(), rObjectToView.b(), rObjectToView.c(), rObjectToView.d(), rObjectToView.e() + fAAOffset, rObjectToView.f() + fAAOffset); - - // set linear transformation cairo_set_matrix(mpRT, &aMatrix); // setup line attributes @@ -694,14 +1458,15 @@ void CairoPixelProcessor2D::processPolygonStrokePrimitive2D( eCairoLineJoin = CAIRO_LINE_JOIN_MITER; break; } + cairo_set_line_join(mpRT, eCairoLineJoin); // convert miter minimum angle to miter limit double fMiterLimit = 1.0 / sin(std::max(rLineAttribute.getMiterMinimumAngle(), 0.01 * M_PI) / 2.0); + cairo_set_miter_limit(mpRT, fMiterLimit); // setup cap attribute cairo_line_cap_t eCairoLineCap(CAIRO_LINE_CAP_BUTT); - switch (rLineAttribute.getLineCap()) { default: // css::drawing::LineCap_BUTT: @@ -720,20 +1485,23 @@ void CairoPixelProcessor2D::processPolygonStrokePrimitive2D( break; } } + cairo_set_line_cap(mpRT, eCairoLineCap); + // determine & set color basegfx::BColor aLineColor(maBColorModifierStack.getModifiedColor(rLineAttribute.getColor())); if (bRenderDecomposeForCompareInRed) aLineColor.setRed(0.5); - cairo_set_source_rgb(mpRT, aLineColor.getRed(), aLineColor.getGreen(), aLineColor.getBlue()); - cairo_set_line_join(mpRT, eCairoLineJoin); - cairo_set_line_cap(mpRT, eCairoLineCap); - - // TODO: Hairline LineWidth, see comment at processPolygonHairlinePrimitive2D - cairo_set_line_width(mpRT, bHairline ? 1.44 : fDiscreteLineWidth); - cairo_set_miter_limit(mpRT, fMiterLimit); + // process/set LineWidth + const double fObjectLineWidth( + bHairline ? (getViewInformation2D().getInverseObjectToViewTransformation() + * basegfx::B2DVector(1.0, 0.0)) + .getLength() + : rLineAttribute.getWidth()); + cairo_set_line_width(mpRT, fObjectLineWidth); + // check stroke const attribute::StrokeAttribute& rStrokeAttribute( rPolygonStrokeCandidate.getStrokeAttribute()); const bool bDashUsed(!rStrokeAttribute.isDefault() @@ -745,8 +1513,11 @@ void CairoPixelProcessor2D::processPolygonStrokePrimitive2D( cairo_set_dash(mpRT, rStroke.data(), rStroke.size(), 0.0); } - addB2DPolygonToPathGeometry(mpRT, rPolygon, &getViewInformation2D()); + // create path geometry and put mask as path + cairo_new_path(mpRT); + getOrCreatePathGeometry(mpRT, rPolygon, getViewInformation2D()); + // render cairo_stroke(mpRT); cairo_restore(mpRT); @@ -780,7 +1551,7 @@ void CairoPixelProcessor2D::processLineRectanglePrimitive2D( aHairlineColor.getBlue()); const double fDiscreteLineWidth((getViewInformation2D().getInverseObjectToViewTransformation() - * basegfx::B2DVector(1.44, 0.0)) + * basegfx::B2DVector(1.0, 0.0)) .getLength()); cairo_set_line_width(mpRT, fDiscreteLineWidth); @@ -841,7 +1612,7 @@ void CairoPixelProcessor2D::processSingleLinePrimitive2D( const basegfx::B2DPoint aStart(rObjectToView * rSingleLinePrimitive2D.getStart()); const basegfx::B2DPoint aEnd(rObjectToView * rSingleLinePrimitive2D.getEnd()); - cairo_set_line_width(mpRT, 1.44f); + cairo_set_line_width(mpRT, 1.0f); cairo_move_to(mpRT, aStart.getX() + fAAOffset, aStart.getY() + fAAOffset); cairo_line_to(mpRT, aEnd.getX() + fAAOffset, aEnd.getY() + fAAOffset); @@ -850,6 +1621,801 @@ void CairoPixelProcessor2D::processSingleLinePrimitive2D( cairo_restore(mpRT); } +void CairoPixelProcessor2D::processFillGraphicPrimitive2D( + const primitive2d::FillGraphicPrimitive2D& rFillGraphicPrimitive2D) +{ + BitmapEx aPreparedBitmap; + basegfx::B2DRange aFillUnitRange(rFillGraphicPrimitive2D.getFillGraphic().getGraphicRange()); + constexpr double fBigDiscreteArea(300.0 * 300.0); + + // use tooling to do various checks and prepare tiled rendering, see + // description of method, parameters and return value there + if (!prepareBitmapForDirectRender(rFillGraphicPrimitive2D, getViewInformation2D(), + aPreparedBitmap, aFillUnitRange, fBigDiscreteArea)) + { + // no output needed, done + return; + } + + if (aPreparedBitmap.IsEmpty()) + { + // output needed and Bitmap data empty, so no bitmap data based + // tiled rendering is suggested. Use fallback for paint (decomposition) + process(rFillGraphicPrimitive2D); + return; + } + + // render tiled using the prepared Bitmap data + if (maBColorModifierStack.count()) + { + // need to apply ColorModifier to Bitmap data + aPreparedBitmap = aPreparedBitmap.ModifyBitmapEx(maBColorModifierStack); + + if (aPreparedBitmap.IsEmpty()) + { + // color gets completely replaced, get it (any input works) + const basegfx::BColor aModifiedColor( + maBColorModifierStack.getModifiedColor(basegfx::BColor())); + + // use unit geometry as fallback object geometry. Do *not* + // transform, the below used method will use the already + // correctly initialized local ViewInformation + basegfx::B2DPolygon aPolygon(basegfx::utils::createUnitPolygon()); + + // what we still need to apply is the object transform from the + // local primitive, that is not part of DisplayInfo yet + aPolygon.transform(rFillGraphicPrimitive2D.getTransformation()); + + rtl::Reference aTemp( + new primitive2d::PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aPolygon), + aModifiedColor)); + + // draw as colored Polygon, done + processPolyPolygonColorPrimitive2D(*aTemp); + return; + } + } + + // access or create cairo bitmap data + std::shared_ptr aCairoSurfaceHelper( + getOrCreateCairoSurfaceHelper(aPreparedBitmap)); + if (!aCairoSurfaceHelper) + { + SAL_WARN("drawinglayer", "SDPRCairo: No SurfaceHelper from BitmapEx (!)"); + return; + } + + // work with dimensions in discrete target pixels to use evtl. MipMap pre-scale + const basegfx::B2DHomMatrix aLocalTransform( + getViewInformation2D().getObjectToViewTransformation() + * rFillGraphicPrimitive2D.getTransformation()); + const tools::Long nDestWidth( + (aLocalTransform * basegfx::B2DVector(aFillUnitRange.getWidth(), 0.0)).getLength()); + const tools::Long nDestHeight( + (aLocalTransform * basegfx::B2DVector(0.0, aFillUnitRange.getHeight())).getLength()); + + cairo_surface_t* pTarget(aCairoSurfaceHelper->getCairoSurface(nDestWidth, nDestHeight)); + if (nullptr == pTarget) + { + SAL_WARN("drawinglayer", "SDPRCairo: No CairoSurface from BitmapEx SurfaceHelper (!)"); + return; + } + + cairo_save(mpRT); + + // set linear transformation - no fAAOffset for bitmap data + cairo_matrix_t aMatrix; + cairo_matrix_init(&aMatrix, aLocalTransform.a(), aLocalTransform.b(), aLocalTransform.c(), + aLocalTransform.d(), aLocalTransform.e(), aLocalTransform.f()); + cairo_set_matrix(mpRT, &aMatrix); + + const sal_uInt32 nWidth(cairo_image_surface_get_width(pTarget)); + const sal_uInt32 nHeight(cairo_image_surface_get_height(pTarget)); + + cairo_set_source_surface(mpRT, pTarget, 0, 0); + + // get the pattern created by cairo_set_source_surface and + // it's transformation + cairo_pattern_t* sourcepattern = cairo_get_source(mpRT); + cairo_pattern_get_matrix(sourcepattern, &aMatrix); + + // clip for RGBA (see other places) + if (CAIRO_FORMAT_ARGB32 == cairo_image_surface_get_format(pTarget)) + { + cairo_rectangle(mpRT, 0, 0, 1, 1); + cairo_clip(mpRT); + } + + // create transformation for source pattern (inverse, see + // cairo docu: uses user space to pattern space transformation) + cairo_matrix_init_scale(&aMatrix, nWidth / aFillUnitRange.getWidth(), + nHeight / aFillUnitRange.getHeight()); + cairo_matrix_translate(&aMatrix, -aFillUnitRange.getMinX(), -aFillUnitRange.getMinY()); + + // set source pattern transform & activate pattern repeat + cairo_pattern_set_matrix(sourcepattern, &aMatrix); + cairo_pattern_set_extend(sourcepattern, CAIRO_EXTEND_REPEAT); + + // paint + cairo_paint(mpRT); + + static bool bRenderTransformationBounds(false); + if (bRenderTransformationBounds) + { + cairo_set_source_rgba(mpRT, 0, 1, 0, 0.8); + impl_cairo_set_hairline(mpRT, getViewInformation2D()); + // full object + cairo_rectangle(mpRT, 0, 0, 1, 1); + // outline of pattern root image + cairo_rectangle(mpRT, aFillUnitRange.getMinX(), aFillUnitRange.getMinY(), + aFillUnitRange.getWidth(), aFillUnitRange.getHeight()); + cairo_stroke(mpRT); + } + + cairo_restore(mpRT); +} + +void CairoPixelProcessor2D::processFillGradientPrimitive2D_drawOutputRange( + const primitive2d::FillGradientPrimitive2D& rFillGradientPrimitive2D) +{ + cairo_save(mpRT); + + // fill simple rect with outer color + const basegfx::BColor aColor( + maBColorModifierStack.getModifiedColor(rFillGradientPrimitive2D.getOuterColor())); + cairo_set_source_rgb(mpRT, aColor.getRed(), aColor.getGreen(), aColor.getBlue()); + + const basegfx::B2DHomMatrix aTrans(getViewInformation2D().getObjectToViewTransformation()); + cairo_matrix_t aMatrix; + cairo_matrix_init(&aMatrix, aTrans.a(), aTrans.b(), aTrans.c(), aTrans.d(), aTrans.e(), + aTrans.f()); + cairo_set_matrix(mpRT, &aMatrix); + + const basegfx::B2DRange& rRange(rFillGradientPrimitive2D.getOutputRange()); + cairo_rectangle(mpRT, rRange.getMinX(), rRange.getMinY(), rRange.getWidth(), + rRange.getHeight()); + cairo_fill(mpRT); + + cairo_restore(mpRT); +} + +bool CairoPixelProcessor2D::processFillGradientPrimitive2D_isCompletelyBordered( + const primitive2d::FillGradientPrimitive2D& rFillGradientPrimitive2D) +{ + const attribute::FillGradientAttribute& rFillGradient( + rFillGradientPrimitive2D.getFillGradient()); + const double fBorder(rFillGradient.getBorder()); + + // check if completely 'bordered out'. This can be the case for all + // types of gradients + if (basegfx::fTools::less(fBorder, 1.0) && basegfx::fTools::moreOrEqual(fBorder, 0.0)) + { + // no, we have visible content besides border + return false; + } + + // draw all-covering polygon using getOuterColor and getOutputRange + processFillGradientPrimitive2D_drawOutputRange(rFillGradientPrimitive2D); + return true; +} + +void CairoPixelProcessor2D::processFillGradientPrimitive2D_linear_axial( + const primitive2d::FillGradientPrimitive2D& rFillGradientPrimitive2D) +{ + assert( + (css::awt::GradientStyle_LINEAR == rFillGradientPrimitive2D.getFillGradient().getStyle() + || css::awt::GradientStyle_AXIAL == rFillGradientPrimitive2D.getFillGradient().getStyle()) + && "SDPRCairo: Helper allows only SPECIFIED types (!)"); + cairo_save(mpRT); + + // need to do 'antique' stuff adaptions for rotate/transitionStart in object coordinates + // (DefinitionRange) to have the right 'bending' on rotation + const attribute::FillGradientAttribute& rFillGradient( + rFillGradientPrimitive2D.getFillGradient()); + basegfx::B2DRange aAdaptedRange(rFillGradientPrimitive2D.getDefinitionRange()); + const double fAngle(basegfx::normalizeToRange((2 * M_PI) - rFillGradient.getAngle(), 2 * M_PI)); + const bool bAngle(!basegfx::fTools::equalZero(fAngle)); + const basegfx::B2DPoint aCenter(aAdaptedRange.getCenter()); + + // pack rotation and offset into a transformation that coverts that part + basegfx::B2DHomMatrix aRotation(basegfx::utils::createRotateAroundPoint(aCenter, fAngle)); + + // create local transform to work in object coordinates based on OutputRange, + // combine with rotation - that way we can then just draw into AdaptedRange + basegfx::B2DHomMatrix aLocalTransform(getViewInformation2D().getObjectToViewTransformation() + * aRotation); + cairo_matrix_t aMatrix; + cairo_matrix_init(&aMatrix, aLocalTransform.a(), aLocalTransform.b(), aLocalTransform.c(), + aLocalTransform.d(), aLocalTransform.e(), aLocalTransform.f()); + cairo_set_matrix(mpRT, &aMatrix); + + if (bAngle) + { + // expand Range by rotating + aAdaptedRange.transform(aRotation); + } + + // create linear pattern in unit coordinates in y-direction + cairo_pattern_t* pPattern( + cairo_pattern_create_linear(aAdaptedRange.getCenterX(), aAdaptedRange.getMinY(), + aAdaptedRange.getCenterX(), aAdaptedRange.getMaxY())); + + // get color stops (make copy, might have to be changed) + basegfx::BColorStops aBColorStops(rFillGradient.getColorStops()); + const bool bAxial(css::awt::GradientStyle_AXIAL == rFillGradient.getStyle()); + + // get and apply border - create soace at start in gradient + const double fBorder(std::max(std::min(rFillGradient.getBorder(), 1.0), 0.0)); + if (!basegfx::fTools::equalZero(fBorder)) + { + if (bAxial) + aBColorStops.reverseColorStops(); + aBColorStops.createSpaceAtStart(fBorder); + if (bAxial) + aBColorStops.reverseColorStops(); + } + + if (bAxial) + { + // expand with mirrored ColorStops to create axial + aBColorStops.doApplyAxial(); + } + + // Apply steps if used to 'emulate' LO's 'discrete step' feature + if (rFillGradient.getSteps()) + { + aBColorStops.doApplySteps(rFillGradient.getSteps()); + } + + // add color stops + for (const auto& aStop : aBColorStops) + { + const basegfx::BColor aColor(maBColorModifierStack.getModifiedColor(aStop.getStopColor())); + cairo_pattern_add_color_stop_rgb(pPattern, aStop.getStopOffset(), aColor.getRed(), + aColor.getGreen(), aColor.getBlue()); + } + + // draw OutRange + basegfx::B2DRange aOutRange(rFillGradientPrimitive2D.getOutputRange()); + if (bAngle) + { + // expand backwards to cover all area needed for OutputRange + aRotation.invert(); + aOutRange.transform(aRotation); + } + cairo_rectangle(mpRT, aOutRange.getMinX(), aOutRange.getMinY(), aOutRange.getWidth(), + aOutRange.getHeight()); + cairo_set_source(mpRT, pPattern); + cairo_fill(mpRT); + + // cleanup + cairo_pattern_destroy(pPattern); + cairo_restore(mpRT); +} + +void CairoPixelProcessor2D::processFillGradientPrimitive2D_square_rect( + const primitive2d::FillGradientPrimitive2D& rFillGradientPrimitive2D) +{ + assert( + (css::awt::GradientStyle_SQUARE == rFillGradientPrimitive2D.getFillGradient().getStyle() + || css::awt::GradientStyle_RECT == rFillGradientPrimitive2D.getFillGradient().getStyle()) + && "SDPRCairo: Helper allows only SPECIFIED types (!)"); + cairo_save(mpRT); + + // draw all-covering polygon using getOuterColor and getOutputRange, + // the partial paints below will not fill areas outside automatically + // as happens in the other gradient paints + processFillGradientPrimitive2D_drawOutputRange(rFillGradientPrimitive2D); + + // get DefinitionRange and adapt if needed + basegfx::B2DRange aAdaptedRange(rFillGradientPrimitive2D.getDefinitionRange()); + const bool bSquare(css::awt::GradientStyle_SQUARE + == rFillGradientPrimitive2D.getFillGradient().getStyle()); + const basegfx::B2DPoint aCenter(aAdaptedRange.getCenter()); + bool bLandscape(false); + double fSmallRadius(1.0); + + // get rotation and offset values + const attribute::FillGradientAttribute& rFillGradient( + rFillGradientPrimitive2D.getFillGradient()); + const double fAngle(basegfx::normalizeToRange((2 * M_PI) - rFillGradient.getAngle(), 2 * M_PI)); + const bool bAngle(!basegfx::fTools::equalZero(fAngle)); + const double fOffxsetX(std::max(std::min(rFillGradient.getOffsetX(), 1.0), 0.0)); + const double fOffxsetY(std::max(std::min(rFillGradient.getOffsetY(), 1.0), 0.0)); + + if (bSquare) + { + // expand to make width == height + const basegfx::B2DRange& rDefRange(rFillGradientPrimitive2D.getDefinitionRange()); + + if (rDefRange.getWidth() > rDefRange.getHeight()) + { + // landscape -> square + const double fRadius(0.5 * rDefRange.getWidth()); + aAdaptedRange.expand(basegfx::B2DPoint(rDefRange.getMinX(), aCenter.getY() - fRadius)); + aAdaptedRange.expand(basegfx::B2DPoint(rDefRange.getMaxX(), aCenter.getY() + fRadius)); + } + else + { + // portrait -> square + const double fRadius(0.5 * rDefRange.getHeight()); + aAdaptedRange.expand(basegfx::B2DPoint(aCenter.getX() - fRadius, rDefRange.getMinY())); + aAdaptedRange.expand(basegfx::B2DPoint(aCenter.getX() + fRadius, rDefRange.getMaxY())); + } + + bLandscape = true; + fSmallRadius = 0.5 * aAdaptedRange.getWidth(); + } + else + { + if (bAngle) + { + // expand range using applied rotation + aAdaptedRange.transform(basegfx::utils::createRotateAroundPoint(aCenter, fAngle)); + } + + // set local params as needed for non-square + bLandscape = aAdaptedRange.getWidth() > aAdaptedRange.getHeight(); + fSmallRadius = 0.5 * (bLandscape ? aAdaptedRange.getHeight() : aAdaptedRange.getWidth()); + } + + // pack rotation and offset into a combined transformation that covers that parts + basegfx::B2DHomMatrix aRotAndTranslate; + aRotAndTranslate.translate(-aCenter.getX(), -aCenter.getY()); + if (bAngle) + aRotAndTranslate.rotate(fAngle); + aRotAndTranslate.translate(aAdaptedRange.getMinX() + (fOffxsetX * aAdaptedRange.getWidth()), + aAdaptedRange.getMinY() + (fOffxsetY * aAdaptedRange.getHeight())); + + // create local transform to work in object coordinates based on OutputRange, + // combine with rotation and offset - that way we can then just draw into + // AdaptedRange + basegfx::B2DHomMatrix aLocalTransform(getViewInformation2D().getObjectToViewTransformation() + * aRotAndTranslate); + cairo_matrix_t aMatrix; + cairo_matrix_init(&aMatrix, aLocalTransform.a(), aLocalTransform.b(), aLocalTransform.c(), + aLocalTransform.d(), aLocalTransform.e(), aLocalTransform.f()); + cairo_set_matrix(mpRT, &aMatrix); + + // get color stops (make copy, might have to be changed) + basegfx::BColorStops aBColorStops(rFillGradient.getColorStops()); + + // apply BColorModifierStack early - the BColorStops are used multiple + // times below, so do this only once + if (0 != maBColorModifierStack.count()) + { + aBColorStops.tryToApplyBColorModifierStack(maBColorModifierStack); + } + + // get and apply border - create soace at start in gradient + const double fBorder(std::max(std::min(rFillGradient.getBorder(), 1.0), 0.0)); + if (!basegfx::fTools::equalZero(fBorder)) + { + aBColorStops.createSpaceAtStart(fBorder); + } + + // Apply steps if used to 'emulate' LO's 'discrete step' feature + if (rFillGradient.getSteps()) + { + aBColorStops.doApplySteps(rFillGradient.getSteps()); + } + + // get half single pixel size to fill touching 'gaps' + // NOTE: I formally used cairo_device_to_user_distance, but that + // can indeed create negative sizes if the transformation e.g. + // contains rotation(s). could use fabs(), but just rely on + // linear algebra and use the (always positive) length of a vector + const double fHalfPx((getViewInformation2D().getInverseObjectToViewTransformation() + * basegfx::B2DVector(1.0, 0.0)) + .getLength()); + + // draw top part trapez/triangle + { + cairo_move_to(mpRT, aAdaptedRange.getMinX(), aAdaptedRange.getMinY()); + cairo_line_to(mpRT, aAdaptedRange.getMaxX(), aAdaptedRange.getMinY()); + cairo_line_to(mpRT, aAdaptedRange.getMaxX(), aAdaptedRange.getMinY() + fHalfPx); + if (!bSquare && bLandscape) + { + cairo_line_to(mpRT, aAdaptedRange.getMaxX() - fSmallRadius, aCenter.getY() + fHalfPx); + cairo_line_to(mpRT, aAdaptedRange.getMinX() + fSmallRadius, aCenter.getY() + fHalfPx); + } + else + { + cairo_line_to(mpRT, aCenter.getX(), aAdaptedRange.getMinY() + fSmallRadius + fHalfPx); + } + cairo_line_to(mpRT, aAdaptedRange.getMinX(), aAdaptedRange.getMinY() + fHalfPx); + cairo_close_path(mpRT); + + // create linear pattern in needed coordinates directly + // NOTE: I *tried* to create in unit coordinates and adapt modifying and re-using + // cairo_pattern_set_matrix - that *seems* to work but sometimes runs into + // numerical problems -> probably cairo implementation. So stay safe and do + // it the easy way, for the cost of re-creating gradient definitions (still cheap) + cairo_pattern_t* pPattern(cairo_pattern_create_linear( + aCenter.getX(), aAdaptedRange.getMinY(), aCenter.getX(), + aAdaptedRange.getMinY() + + (bLandscape ? aAdaptedRange.getHeight() * 0.5 : fSmallRadius))); + for (const auto& aStop : aBColorStops) + { + const basegfx::BColor& rColor(aStop.getStopColor()); + cairo_pattern_add_color_stop_rgb(pPattern, aStop.getStopOffset(), rColor.getRed(), + rColor.getGreen(), rColor.getBlue()); + } + + cairo_set_source(mpRT, pPattern); + cairo_fill(mpRT); + cairo_pattern_destroy(pPattern); + } + + { + // draw right part trapez/triangle + cairo_move_to(mpRT, aAdaptedRange.getMaxX(), aAdaptedRange.getMinY()); + cairo_line_to(mpRT, aAdaptedRange.getMaxX(), aAdaptedRange.getMaxY()); + if (bSquare || bLandscape) + { + cairo_line_to(mpRT, aAdaptedRange.getMaxX() - fSmallRadius - fHalfPx, aCenter.getY()); + } + else + { + cairo_line_to(mpRT, aCenter.getX() - fHalfPx, aAdaptedRange.getMaxY() - fSmallRadius); + cairo_line_to(mpRT, aCenter.getX() - fHalfPx, aAdaptedRange.getMinY() + fSmallRadius); + } + cairo_close_path(mpRT); + + // create linear pattern in needed coordinates directly + cairo_pattern_t* pPattern(cairo_pattern_create_linear( + aAdaptedRange.getMaxX(), aCenter.getY(), + aAdaptedRange.getMaxX() - (bLandscape ? fSmallRadius : aAdaptedRange.getWidth() * 0.5), + aCenter.getY())); + for (const auto& aStop : aBColorStops) + { + const basegfx::BColor& rColor(aStop.getStopColor()); + cairo_pattern_add_color_stop_rgb(pPattern, aStop.getStopOffset(), rColor.getRed(), + rColor.getGreen(), rColor.getBlue()); + } + + cairo_set_source(mpRT, pPattern); + cairo_fill(mpRT); + cairo_pattern_destroy(pPattern); + } + + { + // draw bottom part trapez/triangle + cairo_move_to(mpRT, aAdaptedRange.getMaxX(), aAdaptedRange.getMaxY()); + cairo_line_to(mpRT, aAdaptedRange.getMinX(), aAdaptedRange.getMaxY()); + cairo_line_to(mpRT, aAdaptedRange.getMinX(), aAdaptedRange.getMaxY() - fHalfPx); + if (!bSquare && bLandscape) + { + cairo_line_to(mpRT, aAdaptedRange.getMinX() + fSmallRadius, aCenter.getY() - fHalfPx); + cairo_line_to(mpRT, aAdaptedRange.getMaxX() - fSmallRadius, aCenter.getY() - fHalfPx); + } + else + { + cairo_line_to(mpRT, aCenter.getX(), aAdaptedRange.getMaxY() - fSmallRadius - fHalfPx); + } + cairo_line_to(mpRT, aAdaptedRange.getMaxX(), aAdaptedRange.getMaxY() - fHalfPx); + cairo_close_path(mpRT); + + // create linear pattern in needed coordinates directly + cairo_pattern_t* pPattern(cairo_pattern_create_linear( + aCenter.getX(), aAdaptedRange.getMaxY(), aCenter.getX(), + aAdaptedRange.getMaxY() + - (bLandscape ? aAdaptedRange.getHeight() * 0.5 : fSmallRadius))); + for (const auto& aStop : aBColorStops) + { + const basegfx::BColor& rColor(aStop.getStopColor()); + cairo_pattern_add_color_stop_rgb(pPattern, aStop.getStopOffset(), rColor.getRed(), + rColor.getGreen(), rColor.getBlue()); + } + + cairo_set_source(mpRT, pPattern); + cairo_fill(mpRT); + cairo_pattern_destroy(pPattern); + } + + { + // draw left part trapez/triangle + cairo_move_to(mpRT, aAdaptedRange.getMinX(), aAdaptedRange.getMaxY()); + cairo_line_to(mpRT, aAdaptedRange.getMinX(), aAdaptedRange.getMinY()); + if (bSquare || bLandscape) + { + cairo_line_to(mpRT, aAdaptedRange.getMinX() + fSmallRadius + fHalfPx, aCenter.getY()); + } + else + { + cairo_line_to(mpRT, aCenter.getX() + fHalfPx, aAdaptedRange.getMinY() + fSmallRadius); + cairo_line_to(mpRT, aCenter.getX() + fHalfPx, aAdaptedRange.getMaxY() - fSmallRadius); + } + cairo_close_path(mpRT); + + // create linear pattern in needed coordinates directly + cairo_pattern_t* pPattern(cairo_pattern_create_linear( + aAdaptedRange.getMinX(), aCenter.getY(), + aAdaptedRange.getMinX() + (bLandscape ? fSmallRadius : aAdaptedRange.getWidth() * 0.5), + aCenter.getY())); + for (const auto& aStop : aBColorStops) + { + const basegfx::BColor& rColor(aStop.getStopColor()); + cairo_pattern_add_color_stop_rgb(pPattern, aStop.getStopOffset(), rColor.getRed(), + rColor.getGreen(), rColor.getBlue()); + } + + cairo_set_source(mpRT, pPattern); + cairo_fill(mpRT); + cairo_pattern_destroy(pPattern); + } + + // cleanup + // cairo_pattern_destroy(pPattern); + cairo_restore(mpRT); +} + +void CairoPixelProcessor2D::processFillGradientPrimitive2D_radial_elliptical( + const primitive2d::FillGradientPrimitive2D& rFillGradientPrimitive2D) +{ + assert((css::awt::GradientStyle_RADIAL == rFillGradientPrimitive2D.getFillGradient().getStyle() + || css::awt::GradientStyle_ELLIPTICAL + == rFillGradientPrimitive2D.getFillGradient().getStyle()) + && "SDPRCairo: Helper allows only SPECIFIED types (!)"); + cairo_save(mpRT); + + // need to do 'antique' stuff adaptions for rotate/transitionStart in object coordinates + // (DefinitionRange) to have the right 'bending' on rotation + const attribute::FillGradientAttribute& rFillGradient( + rFillGradientPrimitive2D.getFillGradient()); + const basegfx::B2DRange rDefRange(rFillGradientPrimitive2D.getDefinitionRange()); + const basegfx::B2DPoint aCenter(rDefRange.getCenter()); + double fRadius(1.0); + double fRatioElliptical(1.0); + const bool bRadial(css::awt::GradientStyle_RADIAL == rFillGradient.getStyle()); + + // use what is done in initEllipticalGradientInfo method to get as close as + // possible to former stuff, expand AdaptedRange as needed + if (bRadial) + { + const double fHalfOriginalDiag(std::hypot(rDefRange.getWidth(), rDefRange.getHeight()) + * 0.5); + fRadius = fHalfOriginalDiag; + } + else + { + double fTargetSizeX(M_SQRT2 * rDefRange.getWidth()); + double fTargetSizeY(M_SQRT2 * rDefRange.getHeight()); + fRatioElliptical = fTargetSizeX / fTargetSizeY; + fRadius = std::max(fTargetSizeX, fTargetSizeY) * 0.5; + } + + // get rotation and offset values + const double fAngle(basegfx::normalizeToRange((2 * M_PI) - rFillGradient.getAngle(), 2 * M_PI)); + const bool bAngle(!basegfx::fTools::equalZero(fAngle)); + const double fOffxsetX(std::max(std::min(rFillGradient.getOffsetX(), 1.0), 0.0)); + const double fOffxsetY(std::max(std::min(rFillGradient.getOffsetY(), 1.0), 0.0)); + + // pack rotation and offset into a combined transformation that coverts that parts + basegfx::B2DHomMatrix aRotAndTranslate; + aRotAndTranslate.translate(-aCenter.getX(), -aCenter.getY()); + if (bAngle) + aRotAndTranslate.rotate(fAngle); + aRotAndTranslate.translate(rDefRange.getMinX() + (fOffxsetX * rDefRange.getWidth()), + rDefRange.getMinY() + (fOffxsetY * rDefRange.getHeight())); + + // create local transform to work in object coordinates based on OutputRange, + // combine with rotation and offset - that way we can then just draw into + // AdaptedRange + basegfx::B2DHomMatrix aLocalTransform(getViewInformation2D().getObjectToViewTransformation() + * aRotAndTranslate); + cairo_matrix_t aMatrix; + cairo_matrix_init(&aMatrix, aLocalTransform.a(), aLocalTransform.b(), aLocalTransform.c(), + aLocalTransform.d(), aLocalTransform.e(), aLocalTransform.f()); + cairo_set_matrix(mpRT, &aMatrix); + + // create linear pattern in unit coordinates in y-direction + cairo_pattern_t* pPattern(cairo_pattern_create_radial(aCenter.getX(), aCenter.getY(), fRadius, + aCenter.getX(), aCenter.getY(), 0.0)); + + // get color stops (make copy, might have to be changed) + basegfx::BColorStops aBColorStops(rFillGradient.getColorStops()); + + // get and apply border - create soace at start in gradient + const double fBorder(std::max(std::min(rFillGradient.getBorder(), 1.0), 0.0)); + if (!basegfx::fTools::equalZero(fBorder)) + { + aBColorStops.createSpaceAtStart(fBorder); + } + + // Apply steps if used to 'emulate' LO's 'discrete step' feature + if (rFillGradient.getSteps()) + { + aBColorStops.doApplySteps(rFillGradient.getSteps()); + } + + // add color stops + for (const auto& aStop : aBColorStops) + { + const basegfx::BColor aColor(maBColorModifierStack.getModifiedColor(aStop.getStopColor())); + cairo_pattern_add_color_stop_rgb(pPattern, aStop.getStopOffset(), aColor.getRed(), + aColor.getGreen(), aColor.getBlue()); + } + + cairo_set_source(mpRT, pPattern); + + if (!bRadial) // css::awt::GradientStyle_ELLIPTICAL + { + // set cairo matirx at cairo_pattern_t to get needed ratio scale done. + // this is necessary since cairo_pattern_create_radial does *not* + // support ellipse resp. radial gradient with non-aequidistant + // ratio directly + // this uses the transformation 'from user space to pattern space' as + // cairo docu states. That is the inverse of the intuitive thought + // model: describe from coordinates in texture, so use B2DHomMatrix + // and invert at the end to have better control about what has to happen + basegfx::B2DHomMatrix aTrans; + + // move center to origin to prepare scale/rotate + aTrans.translate(-aCenter.getX(), -aCenter.getY()); + + // get scale factor and apply as needed + if (fRatioElliptical > 1.0) + aTrans.scale(1.0, 1.0 / fRatioElliptical); + else + aTrans.scale(fRatioElliptical, 1.0); + + // move transformed stuff back to center + aTrans.translate(aCenter.getX(), aCenter.getY()); + + // invert and set at cairo_pattern_t + aTrans.invert(); + cairo_matrix_init(&aMatrix, aTrans.a(), aTrans.b(), aTrans.c(), aTrans.d(), aTrans.e(), + aTrans.f()); + cairo_pattern_set_matrix(pPattern, &aMatrix); + } + + // draw OutRange. Due to rot and translate being part of the + // set transform in cairo we need to back-transform (and expand + // as needed) the OutputRange to paint at the right place and + // get all OutputRange covered + basegfx::B2DRange aOutRange(rFillGradientPrimitive2D.getOutputRange()); + aRotAndTranslate.invert(); + aOutRange.transform(aRotAndTranslate); + cairo_rectangle(mpRT, aOutRange.getMinX(), aOutRange.getMinY(), aOutRange.getWidth(), + aOutRange.getHeight()); + cairo_fill(mpRT); + + // cleanup + cairo_pattern_destroy(pPattern); + cairo_restore(mpRT); +} + +void CairoPixelProcessor2D::processFillGradientPrimitive2D_fallback_decompose( + const primitive2d::FillGradientPrimitive2D& rFillGradientPrimitive2D) +{ + // this helper draws the given gradient using the decompose fallback, + // maybe needed in some cases an can/will be handy + cairo_save(mpRT); + + // draw all-covering initial BG polygon 1st using getOuterColor and getOutputRange + processFillGradientPrimitive2D_drawOutputRange(rFillGradientPrimitive2D); + + // bet basic form in unit coordinates + CairoPathHelper aForm(rFillGradientPrimitive2D.getUnitPolygon()); + + // paint solid fill steps by providing callback as lambda + auto aCallback([this, &aForm](const basegfx::B2DHomMatrix& rMatrix, + const basegfx::BColor& rColor) { + const basegfx::B2DHomMatrix aTrans(getViewInformation2D().getObjectToViewTransformation() + * rMatrix); + cairo_matrix_t aMatrix; + cairo_matrix_init(&aMatrix, aTrans.a(), aTrans.b(), aTrans.c(), aTrans.d(), aTrans.e(), + aTrans.f()); + cairo_set_matrix(mpRT, &aMatrix); + + const basegfx::BColor aColor(maBColorModifierStack.getModifiedColor(rColor)); + cairo_set_source_rgb(mpRT, aColor.getRed(), aColor.getGreen(), aColor.getBlue()); + + cairo_append_path(mpRT, aForm.getCairoPath()); + + cairo_fill(mpRT); + }); + + // call value generator to trigger callbacks + rFillGradientPrimitive2D.generateMatricesAndColors(aCallback); + + cairo_restore(mpRT); +} + +void CairoPixelProcessor2D::processFillGradientPrimitive2D( + const primitive2d::FillGradientPrimitive2D& rFillGradientPrimitive2D) +{ + if (rFillGradientPrimitive2D.getDefinitionRange().isEmpty()) + { + // no definition area, done + return; + } + + if (rFillGradientPrimitive2D.getOutputRange().isEmpty()) + { + // no output area, done + return; + } + + const attribute::FillGradientAttribute& rFillGradient( + rFillGradientPrimitive2D.getFillGradient()); + + if (rFillGradient.isDefault()) + { + // no gradient definition, done + return; + } + + // check if completely 'bordered out' + if (processFillGradientPrimitive2D_isCompletelyBordered(rFillGradientPrimitive2D)) + { + // yes, done, was processed as single filled rectangle (using getOuterColor()) + return; + } + + // evtl. prefer fallback: cairo does *not* render hard color transistions + // in gradients anti-aliased which is most visible in 'step'ed gradients, + // but may also happen in normal ones -> may need to be checked in + // basegfx::BColorStops (as tooling, like isSymmetrical() or similar). + // due to the nature of 'step'ing this also means a low number of + // filled polygons to be drawn (no 'smooth' parts to be replicated), + // so this is no runtime burner by definition. + // Making this configurable using static bool, may be moved to settings + // somewhere later. Do not firget to deactivate when working on 'step'ping + // stuff in the other helpers (!) + static bool bPreferAntiAliasedHardColorTransitions(true); + + if (bPreferAntiAliasedHardColorTransitions && rFillGradient.getSteps()) + { + processFillGradientPrimitive2D_fallback_decompose(rFillGradientPrimitive2D); + return; + } + + switch (rFillGradient.getStyle()) + { + case css::awt::GradientStyle_LINEAR: + case css::awt::GradientStyle_AXIAL: + { + // use specialized renderer for this cases - linear, axial + processFillGradientPrimitive2D_linear_axial(rFillGradientPrimitive2D); + return; + } + case css::awt::GradientStyle_RADIAL: + case css::awt::GradientStyle_ELLIPTICAL: + { + // use specialized renderer for this cases - radial, elliptical + + // NOTE for css::awt::GradientStyle_ELLIPTICAL: + // The first time ever I will accept slight deviations for the + // elliptical case here due to it's old chaotic move-two-pixels inside + // rendering method that cannot be pached into a lineartransformation + // and is hard/difficult to support in more modern systems. Differences + // are small and mostly would be visible *if* in steps-mode what is + // also rare. IF that should make problems reactivation of tha case + // for the default case below is possible. main reason is that speed + // for direct rendering in cairo is much better. + processFillGradientPrimitive2D_radial_elliptical(rFillGradientPrimitive2D); + return; + } + case css::awt::GradientStyle_SQUARE: + case css::awt::GradientStyle_RECT: + { + // use specialized renderer for this cases - square, rect + processFillGradientPrimitive2D_square_rect(rFillGradientPrimitive2D); + return; + } + default: + { + // NOTE: All acses are covered above, but keep this as fallback, + // so it is possible anytime to exclude one of the cases above again + // and go back to decomposed version - just in case... + processFillGradientPrimitive2D_fallback_decompose(rFillGradientPrimitive2D); + break; + } + } +} + void CairoPixelProcessor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate) { switch (rCandidate.getPrimitive2DID()) @@ -911,7 +2477,6 @@ void CairoPixelProcessor2D::processBasePrimitive2D(const primitive2d::BasePrimit static_cast(rCandidate)); break; } -#if 0 // geometry that *may* be processed due to being able to do it better // then using the decomposition case PRIMITIVE2D_ID_UNIFIEDTRANSPARENCEPRIMITIVE2D: @@ -932,7 +2497,6 @@ void CairoPixelProcessor2D::processBasePrimitive2D(const primitive2d::BasePrimit static_cast(rCandidate)); break; } -#endif case PRIMITIVE2D_ID_POLYGONSTROKEPRIMITIVE2D: { processPolygonStrokePrimitive2D( @@ -957,6 +2521,18 @@ void CairoPixelProcessor2D::processBasePrimitive2D(const primitive2d::BasePrimit static_cast(rCandidate)); break; } + case PRIMITIVE2D_ID_FILLGRAPHICPRIMITIVE2D: + { + processFillGraphicPrimitive2D( + static_cast(rCandidate)); + break; + } + case PRIMITIVE2D_ID_FILLGRADIENTPRIMITIVE2D: + { + processFillGradientPrimitive2D( + static_cast(rCandidate)); + break; + } // continue with decompose default: diff --git a/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx b/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx index 6bfc95878332..74a902727387 100644 --- a/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/d2dpixelprocessor2d.cxx @@ -1803,7 +1803,7 @@ void D2DPixelProcessor2D::processFillGraphicPrimitive2D( { BitmapEx aPreparedBitmap; basegfx::B2DRange aFillUnitRange(rFillGraphicPrimitive2D.getFillGraphic().getGraphicRange()); - static double fBigDiscreteArea(300.0 * 300.0); + constexpr double fBigDiscreteArea(300.0 * 300.0); // use tooling to do various checks and prepare tiled rendering, see // description of method, parameters and return value there diff --git a/include/basegfx/utils/bgradient.hxx b/include/basegfx/utils/bgradient.hxx index 7d360beee429..f54b8763d87f 100644 --- a/include/basegfx/utils/bgradient.hxx +++ b/include/basegfx/utils/bgradient.hxx @@ -16,6 +16,11 @@ #include #include +namespace basegfx +{ +class BColorModifierStack; +} + namespace basegfx { /* MCGR: Provide ColorStop definition @@ -256,6 +261,9 @@ public: // apply Steps as 'hard' color stops void doApplySteps(sal_uInt16 nStepCount); + + // Apply BColorModifierStack changes + void tryToApplyBColorModifierStack(const BColorModifierStack& rBColorModifierStack); }; class BASEGFX_DLLPUBLIC BGradient final diff --git a/include/drawinglayer/processor2d/cairopixelprocessor2d.hxx b/include/drawinglayer/processor2d/cairopixelprocessor2d.hxx index f10ac22fa461..04fd6c7e2d2c 100644 --- a/include/drawinglayer/processor2d/cairopixelprocessor2d.hxx +++ b/include/drawinglayer/processor2d/cairopixelprocessor2d.hxx @@ -33,6 +33,8 @@ class PolygonStrokePrimitive2D; class LineRectanglePrimitive2D; class FilledRectanglePrimitive2D; class SingleLinePrimitive2D; +class FillGradientPrimitive2D; +class FillGraphicPrimitive2D; } namespace drawinglayer::processor2d @@ -73,16 +75,31 @@ class UNLESS_MERGELIBS(DRAWINGLAYER_DLLPUBLIC) CairoPixelProcessor2D final : pub const primitive2d::FilledRectanglePrimitive2D& rFilledRectanglePrimitive2D); void processSingleLinePrimitive2D(const primitive2d::SingleLinePrimitive2D& rSingleLinePrimitive2D); + void processFillGradientPrimitive2D( + const primitive2d::FillGradientPrimitive2D& rFillGradientPrimitive2D); + void processFillGraphicPrimitive2D( + const primitive2d::FillGraphicPrimitive2D& rFillGraphicPrimitive2D); /* the local processor for BasePrimitive2D-Implementation based primitives, called from the common process()-implementation */ virtual void processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate) override; -protected: - // local protected minimal constructor for usage in derivates, e.g. helpers - CairoPixelProcessor2D(const geometry::ViewInformation2D& rViewInformation); + // helpers for gradients + void processFillGradientPrimitive2D_fallback_decompose( + const primitive2d::FillGradientPrimitive2D& rFillGradientPrimitive2D); + void processFillGradientPrimitive2D_drawOutputRange( + const primitive2d::FillGradientPrimitive2D& rFillGradientPrimitive2D); + bool processFillGradientPrimitive2D_isCompletelyBordered( + const primitive2d::FillGradientPrimitive2D& rFillGradientPrimitive2D); + void processFillGradientPrimitive2D_linear_axial( + const primitive2d::FillGradientPrimitive2D& rFillGradientPrimitive2D); + void processFillGradientPrimitive2D_radial_elliptical( + const primitive2d::FillGradientPrimitive2D& rFillGradientPrimitive2D); + void processFillGradientPrimitive2D_square_rect( + const primitive2d::FillGradientPrimitive2D& rFillGradientPrimitive2D); +protected: bool hasError() const { return cairo_status(mpRT) != CAIRO_STATUS_SUCCESS; } void setRenderTarget(cairo_t* mpNewRT) { mpRT = mpNewRT; } bool hasRenderTarget() const { return nullptr != mpRT; } diff --git a/include/vcl/bitmap.hxx b/include/vcl/bitmap.hxx index 886c796e6c67..f7cc49850f8f 100644 --- a/include/vcl/bitmap.hxx +++ b/include/vcl/bitmap.hxx @@ -570,7 +570,7 @@ public: const AlphaMask& rAlphaMask); // access to SystemDependentDataHolder, to support overload in derived class(es) - SAL_DLLPRIVATE const basegfx::SystemDependentDataHolder* accessSystemDependentDataHolder() const; + const basegfx::SystemDependentDataHolder* accessSystemDependentDataHolder() const; public: /** ReassignWithSize and recalculate bitmap. diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx index 2725642763c0..57836fc59794 100644 --- a/include/vcl/svapp.hxx +++ b/include/vcl/svapp.hxx @@ -837,7 +837,7 @@ public: @returns the global instance of the SystemDependentDataManager */ - SAL_DLLPRIVATE static basegfx::SystemDependentDataManager& GetSystemDependentDataManager(); + static basegfx::SystemDependentDataManager& GetSystemDependentDataManager(); /** Get the first top-level window of the application. From 79c710438abbaa204df77f9b9ebebddbdf4ab02b Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Tue, 2 Jul 2024 15:11:17 +0500 Subject: [PATCH 049/232] Don't pass unused optional agrument IShellLinkW::GetPath allows to pass nullptr to its third argument: see https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-ishelllinkw-getpath Change-Id: Icf1ca402448b8dfcc3a5ab2834341e67e8dc0b8d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169869 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- shell/source/win32/SysShExec.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx index 151c7b01c33e..d67e9b8f3c84 100644 --- a/shell/source/win32/SysShExec.cxx +++ b/shell/source/win32/SysShExec.cxx @@ -289,8 +289,7 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa "IPersistFile.Load failed"); sal::systools::ThrowIfFailed(link->Resolve(nullptr, SLR_UPDATE | SLR_NO_UI), "IShellLink.Resolve failed"); - WIN32_FIND_DATAW wfd; - sal::systools::ThrowIfFailed(link->GetPath(path, std::size(path), &wfd, SLGP_RAWPATH), + sal::systools::ThrowIfFailed(link->GetPath(path, std::size(path), nullptr, SLGP_RAWPATH), "IShellLink.GetPath failed"); } catch (sal::systools::ComError& e) From 6adfa5811d4dc65b28544169825b88846bc55596 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Fri, 28 Jun 2024 20:52:04 -0400 Subject: [PATCH 050/232] sw fmtcol.cxx: fix copy/paste error I don't think it makes any functional difference, except that the wrong which ID would be returned. Otherwise they are all identical AFAIK. From commit fcb6e076d9004ef907a2616d04bf9c39908e6e8a Author: Bjoern Michaelsen on Sat Jan 9 21:49:51 2021 +0100 SfxPoolItem: introduce StaticWhichCast and DynamicWhichCast case RES_CHRATR_FONTSIZE: - aFontSizeArr[0] = static_cast(pNew); + aFontSizeArr[0] = &pNew->StaticWhichCast(RES_CHRATR_CJK_FONTSIZE); break; case RES_CHRATR_CJK_FONTSIZE: - aFontSizeArr[1] = static_cast(pNew); + aFontSizeArr[1] = &pNew->StaticWhichCast(RES_CHRATR_CJK_FONTSIZE); Change-Id: Ie85aacb8d28cadaa509cd9bc050cb9cf98b9967a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169747 Tested-by: Jenkins Reviewed-by: Justin Luth --- sw/source/core/doc/fmtcol.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx index 055ab5fbabe2..52a544bd9ec9 100644 --- a/sw/source/core/doc/fmtcol.cxx +++ b/sw/source/core/doc/fmtcol.cxx @@ -206,7 +206,7 @@ void SwTextFormatColl::SwClientNotify(const SwModify& rModify, const SfxHint& rH pNewULSpace = &pNew->StaticWhichCast(RES_UL_SPACE); break; case RES_CHRATR_FONTSIZE: - aFontSizeArr[0] = &pNew->StaticWhichCast(RES_CHRATR_CJK_FONTSIZE); + aFontSizeArr[0] = &pNew->StaticWhichCast(RES_CHRATR_FONTSIZE); break; case RES_CHRATR_CJK_FONTSIZE: aFontSizeArr[1] = &pNew->StaticWhichCast(RES_CHRATR_CJK_FONTSIZE); From 2456746bc20796c20d23498967e0b3a976decc54 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Tue, 2 Jul 2024 16:03:47 +0100 Subject: [PATCH 051/232] lok: Avoid launching an un-necessary thread. It seems this happens rather regularly with online; and yet we are running the main-loop, seems this was introduced to allow UNO usage without a main-loop, but this is not really our case. cf. commit 168a67f4b3ace8c4b46567651429e956547bc1f9 Author: mm Date: Thu Feb 22 17:22:48 2001 +0000 VCL without main Change-Id: Ibd10a4966157f30557eff88c124e63ffae2e1f61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169821 Reviewed-by: Michael Meeks Tested-by: Jenkins --- toolkit/source/awt/vclxtoolkit.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx index ecf3605c9e9c..9e9c547e4ba6 100644 --- a/toolkit/source/awt/vclxtoolkit.cxx +++ b/toolkit/source/awt/vclxtoolkit.cxx @@ -136,6 +136,7 @@ #endif #include #include +#include #include #include #include @@ -928,7 +929,8 @@ VCLXToolkit::VCLXToolkit(): #ifndef IOS osl::Guard< osl::Mutex > aGuard( getInitMutex() ); nVCLToolkitInstanceCount++; - if( ( nVCLToolkitInstanceCount == 1 ) && ( !Application::IsInMain() ) ) + if( nVCLToolkitInstanceCount == 1 && !Application::IsInMain() && + !comphelper::LibreOfficeKit::isActive() ) { // setup execute thread CreateMainLoopThread( ToolkitWorkerFunction, this ); From 65013d5d0d5c5348d51b037fb6719fd25ddedda4 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Tue, 2 Jul 2024 11:01:41 +0200 Subject: [PATCH 052/232] tdf#161853 icon choice control: Drop WB_NOSELECTION It's never set, so drop it, also to prepare for further cleanup in upcoming commits. Change-Id: Id1751b68e3666130a69b981f9095303115d30caa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169871 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- include/vcl/toolkit/ivctrl.hxx | 1 - vcl/source/control/imivctl1.cxx | 2 -- 2 files changed, 3 deletions(-) diff --git a/include/vcl/toolkit/ivctrl.hxx b/include/vcl/toolkit/ivctrl.hxx index 7b593d04ba8d..961b040b3db6 100644 --- a/include/vcl/toolkit/ivctrl.hxx +++ b/include/vcl/toolkit/ivctrl.hxx @@ -151,7 +151,6 @@ public: #define WB_DETAILS WB_VCENTER #define WB_NOHSCROLL WB_SPIN #define WB_NOVSCROLL WB_DRAG -#define WB_NOSELECTION WB_REPEAT #define WB_NODRAGSELECTION WB_PATHELLIPSIS #define WB_SMART_ARRANGE 0x01000000 // used to be WB_PASSWORD #define WB_ALIGN_TOP WB_TOP diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index e9dbc5690a56..a21d1e83f690 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -152,8 +152,6 @@ void SvxIconChoiceCtrl_Impl::SetStyle( WinBits nWinStyle ) nCurTextDrawFlags = DRAWTEXT_FLAGS_ICON; if( nWinBits & (WB_SMALLICON | WB_DETAILS) ) nCurTextDrawFlags = DRAWTEXT_FLAGS_SMALLICON; - if( nWinBits & WB_NOSELECTION ) - eSelectionMode = SelectionMode::NONE; if( !(nWinStyle & (WB_ALIGN_TOP | WB_ALIGN_LEFT))) nWinBits |= WB_ALIGN_LEFT; } From af9413cb4ad49c0b4854c08cc2804644220755ae Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Tue, 2 Jul 2024 11:53:27 +0200 Subject: [PATCH 053/232] tdf#161853 icon choice ctrl: Drop support for non-single selection modes Since commit fd2ea8e03510c6a99ec8be6228b7422f6c5b182b Date: Wed Aug 19 14:59:33 2020 +0100 weld OApplicationSwapWindow , the `SvtIconChoiceCtrl` and its implementation class, `SvxIconChoiceCtrl_Impl`, is only used in `VerticalTabControl`. That one was explicitly enabling `SelectionMode::Single` in its ctor. Therefore, other modes are unused. Drop support for them altogether to simplify the implementation. This commit primarily drops `SvxIconChoiceCtrl_Impl::eSelectionMode` and uses thereof, and allows for further simplification in upcoming commits. Change-Id: I0acde664d695571e9058b9829ad02745a4abaad2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169872 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- include/vcl/toolkit/ivctrl.hxx | 1 - vcl/source/control/imivctl.hxx | 6 - vcl/source/control/imivctl1.cxx | 197 ++++---------------------------- vcl/source/control/ivctrl.cxx | 6 - 4 files changed, 20 insertions(+), 190 deletions(-) diff --git a/include/vcl/toolkit/ivctrl.hxx b/include/vcl/toolkit/ivctrl.hxx index 961b040b3db6..3fede7aeba66 100644 --- a/include/vcl/toolkit/ivctrl.hxx +++ b/include/vcl/toolkit/ivctrl.hxx @@ -192,7 +192,6 @@ public: virtual void dispose() override; WinBits GetStyle() const; - void SetSelectionMode(SelectionMode eMode); void SetFont( const vcl::Font& rFont ); void SetPointFont( const vcl::Font& rFont ); diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index 6f6030bab271..4c6729a7a19d 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -146,7 +146,6 @@ class SvxIconChoiceCtrl_Impl LocalFocus aFocus; // Data for focusrect ::vcl::AccessibleFactoryAccess aAccFactory; - SelectionMode eSelectionMode; sal_Int32 nSelectionCount; SvxIconChoiceCtrlPositionMode ePositionMode; bool bBoundRectsDirty; @@ -252,11 +251,6 @@ public: SvxIconChoiceCtrl_Impl( SvtIconChoiceCtrl* pView, WinBits nWinStyle ); ~SvxIconChoiceCtrl_Impl(); - void SetSelectionMode(SelectionMode eMode) - { - eSelectionMode = eMode; - } - void Clear( bool bInCtor ); void SetStyle( WinBits nWinStyle ); WinBits GetStyle() const { return nWinBits; } diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index a21d1e83f690..9a76ef7d3e0f 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -66,7 +66,7 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( pCurHighlightFrame(nullptr), bHighlightFramePressed(false), pHead(nullptr), pCursor(nullptr), pHdlEntry(nullptr), pAnchor(nullptr), - eSelectionMode(SelectionMode::Multiple), ePositionMode(SvxIconChoiceCtrlPositionMode::Free), + ePositionMode(SvxIconChoiceCtrlPositionMode::Free), bUpdateMode(true) { SetStyle( nWinStyle ); @@ -245,8 +245,6 @@ void SvxIconChoiceCtrl_Impl::SetListPositions() void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, bool bSelect, bool bAdd ) { - if( eSelectionMode == SelectionMode::NONE ) - return; if( !bAdd ) { @@ -281,11 +279,9 @@ void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, bool b void SvxIconChoiceCtrl_Impl::EntrySelected(SvxIconChoiceCtrlEntry* pEntry, bool bSelect) { - // When using SingleSelection, make sure that the cursor is always placed + // make sure that the cursor is always placed // over the (only) selected entry. (But only if a cursor exists.) - if (bSelect && pCursor && - eSelectionMode == SelectionMode::Single && - pEntry != pCursor) + if (bSelect && pCursor && pEntry != pCursor) { SetCursor(pEntry); } @@ -594,7 +590,6 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) { bool bHandled = true; bHighlightFramePressed = false; - bool bGotFocus = (!pView->HasFocus() && !(nWinBits & WB_NOPOINTERFOCUS)); if( !(nWinBits & WB_NOPOINTERFOCUS) ) pView->GrabFocus(); @@ -606,68 +601,8 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) if( pEntry ) MakeEntryVisible( pEntry, false ); - if( rMEvt.IsShift() && eSelectionMode != SelectionMode::Single ) - { - if( pEntry ) - SetCursor_Impl( pCursor, pEntry, rMEvt.IsMod1(), rMEvt.IsShift() ); - return true; - } - - if( pAnchor && (rMEvt.IsShift() || rMEvt.IsMod1())) // keyboard selection? - { - DBG_ASSERT(eSelectionMode != SelectionMode::Single,"Invalid selection mode"); - if( rMEvt.IsMod1() ) - nFlags |= IconChoiceFlags::AddMode; - - if( rMEvt.IsShift() ) - { - tools::Rectangle aRect( GetEntryBoundRect( pAnchor )); - if( pEntry ) - aRect.Union( GetEntryBoundRect( pEntry ) ); - else - { - tools::Rectangle aTempRect( aDocPos, Size(1,1)); - aRect.Union( aTempRect ); - } - aCurSelectionRect = aRect; - SelectRect(aRect, bool(nFlags & IconChoiceFlags::AddMode), aSelectedRectList); - } - else if( rMEvt.IsMod1() ) - { - AddSelectedRect( aCurSelectionRect ); - pAnchor = nullptr; - aCurSelectionRect.SetPos( aDocPos ); - } - - if( !pEntry && !(nWinBits & WB_NODRAGSELECTION)) - pView->StartTracking( StartTrackingFlags::ScrollRepeat ); - return true; - } - else - { - if( !pEntry ) - { - if( eSelectionMode == SelectionMode::Multiple ) - { - if( !rMEvt.IsMod1() ) // Ctrl - { - if( !bGotFocus ) - { - SetNoSelection(); - ClearSelectedRectList(); - } - } - else - nFlags |= IconChoiceFlags::AddMode; - aCurSelectionRect.SetPos( aDocPos ); - pView->StartTracking( StartTrackingFlags::ScrollRepeat ); - } - else - bHandled = false; - return bHandled; - } - } - bool bSelected = pEntry->IsSelected(); + if( !pEntry ) + return false; if( rMEvt.GetClicks() == 2 ) { @@ -682,39 +617,11 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) if( rMEvt.IsMod2() ) // Alt? { } - else if( eSelectionMode == SelectionMode::Single ) + else { DeselectAllBut( pEntry ); SetCursor( pEntry ); } - else if( eSelectionMode == SelectionMode::NONE ) - { - if( rMEvt.IsLeft() && (nWinBits & WB_HIGHLIGHTFRAME) ) - { - pCurHighlightFrame = nullptr; // force repaint of frame - bHighlightFramePressed = true; - SetEntryHighlightFrame( pEntry, true ); - } - } - else - { - if( !rMEvt.GetModifier() && rMEvt.IsLeft() ) - { - if( !bSelected ) - { - DeselectAllBut( pEntry ); - SetCursor( pEntry ); - SelectEntry( pEntry, true, false ); - } - else - { - // deselect only in the Up, if the Move happened via D&D! - nFlags |= IconChoiceFlags::DownDeselect; - } - } - else if( rMEvt.IsMod1() ) - nFlags |= IconChoiceFlags::DownCtrl; - } } return bHandled; } @@ -793,20 +700,6 @@ void SvxIconChoiceCtrl_Impl::SetCursor_Impl( SvxIconChoiceCtrlEntry* pOldCursor, if( !pNewCursor ) return; - SvxIconChoiceCtrlEntry* pFilterEntry = nullptr; - bool bDeselectAll = false; - if( eSelectionMode != SelectionMode::Single ) - { - if( !bMod1 && !bShift ) - bDeselectAll = true; - else if( bShift && !bMod1 && !pAnchor ) - { - bDeselectAll = true; - pFilterEntry = pOldCursor; - } - } - if( bDeselectAll ) - DeselectAllBut( pFilterEntry ); ShowCursor( false ); MakeEntryVisible( pNewCursor ); SetCursor( pNewCursor ); @@ -855,17 +748,6 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) return false; bool bKeyUsed = true; - bool bMod1 = rKEvt.GetKeyCode().IsMod1(); - bool bShift = rKEvt.GetKeyCode().IsShift(); - - if( eSelectionMode == SelectionMode::Single || eSelectionMode == SelectionMode::NONE) - { - bShift = false; - bMod1 = false; - } - - if( bMod1 ) - nFlags |= IconChoiceFlags::AddMode; SvxIconChoiceCtrlEntry* pNewCursor; SvxIconChoiceCtrlEntry* pOldCursor = pCursor; @@ -882,7 +764,7 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) pNewCursor = pImpCursor->GoUpDown(pCursor,false); else pNewCursor = pImpCursor->GoPageUpDown(pCursor,false); - SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift ); + SetCursor_Impl(pOldCursor, pNewCursor, false, false); if( !pNewCursor ) { tools::Rectangle aRect( GetEntryBoundRect( pCursor ) ); @@ -904,7 +786,7 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) pNewCursor=pImpCursor->GoUpDown( pCursor,true ); else pNewCursor=pImpCursor->GoPageUpDown( pCursor,true ); - SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift ); + SetCursor_Impl(pOldCursor, pNewCursor, false, false); } break; @@ -912,7 +794,7 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) if( pCursor ) { pNewCursor=pImpCursor->GoLeftRight(pCursor,true ); - SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift ); + SetCursor_Impl(pOldCursor, pNewCursor, false, false); } break; @@ -921,7 +803,7 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) { MakeEntryVisible( pCursor ); pNewCursor = pImpCursor->GoLeftRight(pCursor,false ); - SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift ); + SetCursor_Impl(pOldCursor, pNewCursor, false, false); if( !pNewCursor ) { tools::Rectangle aRect( GetEntryBoundRect(pCursor)); @@ -936,8 +818,6 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) break; case KEY_F2: - if( bMod1 || bShift ) - bKeyUsed = false; break; case KEY_F8: @@ -953,23 +833,6 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) break; case KEY_SPACE: - if( pCursor && eSelectionMode != SelectionMode::Single ) - { - if( !bMod1 ) - { - //SelectAll( false ); - SetNoSelection(); - ClearSelectedRectList(); - - // click Icon with spacebar - SetEntryHighlightFrame( GetCurEntry(), true ); - pView->ClickIcon(); - pHdlEntry = pCurHighlightFrame; - pCurHighlightFrame=nullptr; - } - else - ToggleSelection( pCursor ); - } break; #ifdef DBG_UTIL @@ -990,30 +853,23 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) case KEY_ADD: case KEY_DIVIDE : case KEY_A: - if( bMod1 && (eSelectionMode != SelectionMode::Single)) - SelectAll(); - else bKeyUsed = false; break; case KEY_SUBTRACT: case KEY_COMMA : - if( bMod1 ) - SetNoSelection(); - else - bKeyUsed = false; + bKeyUsed = false; break; case KEY_RETURN: - if( !bMod1 ) - bKeyUsed = false; + bKeyUsed = false; break; case KEY_END: if( pCursor ) { pNewCursor = maEntries.back().get(); - SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift ); + SetCursor_Impl(pOldCursor, pNewCursor, false, false); } break; @@ -1021,7 +877,7 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) if( pCursor ) { pNewCursor = maEntries[ 0 ].get(); - SetCursor_Impl( pOldCursor, pNewCursor, bMod1, bShift ); + SetCursor_Impl(pOldCursor, pNewCursor, false, false); } break; @@ -1378,21 +1234,16 @@ void SvxIconChoiceCtrl_Impl::PaintItem(const tools::Rectangle& rRect, void SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Point& rPos, vcl::RenderContext& rRenderContext) { - bool bSelected = false; - - if (eSelectionMode != SelectionMode::NONE) - bSelected = pEntry->IsSelected(); + bool bSelected = pEntry->IsSelected(); rRenderContext.Push(vcl::PushFlags::FONT | vcl::PushFlags::TEXTCOLOR); tools::Rectangle aTextRect(CalcTextRect(pEntry, &rPos)); tools::Rectangle aBmpRect(CalcBmpRect(pEntry, &rPos)); - bool bShowSelection = (bSelected && (eSelectionMode != SelectionMode::NONE)); - bool bActiveSelection = (0 != (nWinBits & WB_NOHIDESELECTION)) || pView->HasFocus(); - if (bShowSelection) + if (bSelected) { const StyleSettings& rSettings = rRenderContext.GetSettings().GetStyleSettings(); vcl::Font aNewFont(rRenderContext.GetFont()); @@ -1436,7 +1287,7 @@ void SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po PaintEmphasis(aTextRect, bSelected, rRenderContext); - if ( bShowSelection ) + if (bSelected) vcl::RenderTools::DrawSelectionBackground(rRenderContext, *pView, CalcFocusRect(pEntry), bActiveSelection ? 1 : 2, false, true, false); @@ -1742,8 +1593,7 @@ void SvxIconChoiceCtrl_Impl::SetCursor( SvxIconChoiceCtrlEntry* pEntry ) { if( pEntry == pCursor ) { - if( pCursor && eSelectionMode == SelectionMode::Single && - !pCursor->IsSelected() ) + if (pCursor && !pCursor->IsSelected()) SelectEntry( pCursor, true ); return; } @@ -1753,15 +1603,13 @@ void SvxIconChoiceCtrl_Impl::SetCursor( SvxIconChoiceCtrlEntry* pEntry ) if( pOldCursor ) { pOldCursor->ClearFlags( SvxIconViewFlags::FOCUSED ); - if( eSelectionMode == SelectionMode::Single ) - SelectEntry( pOldCursor, false ); // deselect old cursor + SelectEntry(pOldCursor, false); // deselect old cursor } if( pCursor ) { ToTop( pCursor ); pCursor->SetFlags( SvxIconViewFlags::FOCUSED ); - if( eSelectionMode == SelectionMode::Single ) - SelectEntry( pCursor, true ); + SelectEntry(pCursor, true); ShowCursor( true ); } } @@ -2505,11 +2353,6 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry() const if( !GetSelectionCount() ) return nullptr; - if( (nWinBits & WB_HIGHLIGHTFRAME) && (eSelectionMode == SelectionMode::NONE) ) - { - return pCurHighlightFrame; - } - size_t nCount = maEntries.size(); if( !pHead ) { diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx index 61fa316bd796..4fa8b92997a9 100644 --- a/vcl/source/control/ivctrl.cxx +++ b/vcl/source/control/ivctrl.cxx @@ -91,11 +91,6 @@ SvtIconChoiceCtrl::SvtIconChoiceCtrl( vcl::Window* pParent, WinBits nWinStyle ) _pImpl->SetPositionMode( SvxIconChoiceCtrlPositionMode::AutoArrange ); } -void SvtIconChoiceCtrl::SetSelectionMode(SelectionMode eMode) -{ - _pImpl->SetSelectionMode(eMode); -} - SvtIconChoiceCtrl::~SvtIconChoiceCtrl() { disposeOnce(); @@ -422,7 +417,6 @@ VerticalTabControl::VerticalTabControl(vcl::Window* pParent, bool bWithIcons) { SetStyle(GetStyle() | WB_DIALOGCONTROL); SetType(WindowType::VERTICALTABCONTROL); - m_xChooser->SetSelectionMode(SelectionMode::Single); m_xChooser->SetClickHdl(LINK(this, VerticalTabControl, ChosePageHdl_Impl)); m_xChooser->set_width_request(150); m_xChooser->set_height_request(400); From 21661ce368a3458a51fc6fccab8defebb9b9e59c Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Tue, 2 Jul 2024 12:02:05 +0200 Subject: [PATCH 054/232] tdf#161853 Simplify SvxIconChoiceCtrl_Impl::SetCursor_Impl Since Change-Id: I0acde664d695571e9058b9829ad02745a4abaad2 Author: Michael Weghorn Date: Tue Jul 2 11:53:27 2024 +0200 tdf#161853 icon choice ctrl: Drop support for non-single selection modes , the `bShift` and `bMod1` params passed to `SvxIconChoiceCtrl_Impl::SetCursor_Impl` are always false, so drop them and their handling. With that dropped, the `pOldCursor` param also becomes unused, so drop that as well. Change-Id: Ifd60c030b91636acc58298f0e7b97b69c1312be1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169873 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- vcl/source/control/imivctl.hxx | 7 +---- vcl/source/control/imivctl1.cxx | 48 +++++++++------------------------ 2 files changed, 14 insertions(+), 41 deletions(-) diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index 4c6729a7a19d..03655f1599cd 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -268,12 +268,7 @@ public: bool MouseButtonUp( const MouseEvent& ); bool MouseMove( const MouseEvent&); bool RequestHelp( const HelpEvent& rHEvt ); - void SetCursor_Impl( - SvxIconChoiceCtrlEntry* pOldCursor, - SvxIconChoiceCtrlEntry* pNewCursor, - bool bMod1, - bool bShift - ); + void SetCursor_Impl(SvxIconChoiceCtrlEntry* pNewCursor); bool KeyInput( const KeyEvent& ); void Resize(); void GetFocus(); diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 9a76ef7d3e0f..bad8150c3514 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -670,8 +670,7 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt ) pView->ClickIcon(); // set focus on Icon - SvxIconChoiceCtrlEntry* pOldCursor = pCursor; - SetCursor_Impl( pOldCursor, pHdlEntry, false, false ); + SetCursor_Impl(pHdlEntry); pHdlEntry = nullptr; } @@ -694,8 +693,7 @@ bool SvxIconChoiceCtrl_Impl::MouseMove( const MouseEvent& rMEvt ) return true; } -void SvxIconChoiceCtrl_Impl::SetCursor_Impl( SvxIconChoiceCtrlEntry* pOldCursor, - SvxIconChoiceCtrlEntry* pNewCursor, bool bMod1, bool bShift ) +void SvxIconChoiceCtrl_Impl::SetCursor_Impl(SvxIconChoiceCtrlEntry* pNewCursor) { if( !pNewCursor ) return; @@ -703,29 +701,10 @@ void SvxIconChoiceCtrl_Impl::SetCursor_Impl( SvxIconChoiceCtrlEntry* pOldCursor, ShowCursor( false ); MakeEntryVisible( pNewCursor ); SetCursor( pNewCursor ); - if( bMod1 && !bShift ) - { - if( pAnchor ) - { - AddSelectedRect( pAnchor, pOldCursor ); - pAnchor = nullptr; - } - } - else if( bShift ) - { - if( !pAnchor ) - pAnchor = pOldCursor; - if ( nWinBits & WB_ALIGN_LEFT ) - SelectRange( pAnchor, pNewCursor, bool(nFlags & IconChoiceFlags::AddMode) ); - else - SelectRect(pAnchor,pNewCursor, bool(nFlags & IconChoiceFlags::AddMode), aSelectedRectList); - } - else - { - SelectEntry( pCursor, true, false ); - aCurSelectionRect = GetEntryBoundRect( pCursor ); - CallEventListeners( VclEventId::ListboxSelect, pCursor ); - } + + SelectEntry( pCursor, true, false ); + aCurSelectionRect = GetEntryBoundRect( pCursor ); + CallEventListeners( VclEventId::ListboxSelect, pCursor ); } bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) @@ -739,7 +718,7 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) SvxIconChoiceCtrlEntry* pNewCursor = GetEntry( nPos ); SvxIconChoiceCtrlEntry* pOldCursor = pCursor; if ( pNewCursor != pOldCursor ) - SetCursor_Impl( pOldCursor, pNewCursor, false, false ); + SetCursor_Impl(pNewCursor); return true; } @@ -750,7 +729,6 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) bool bKeyUsed = true; SvxIconChoiceCtrlEntry* pNewCursor; - SvxIconChoiceCtrlEntry* pOldCursor = pCursor; sal_uInt16 nCode = rKEvt.GetKeyCode().GetCode(); switch( nCode ) @@ -764,7 +742,7 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) pNewCursor = pImpCursor->GoUpDown(pCursor,false); else pNewCursor = pImpCursor->GoPageUpDown(pCursor,false); - SetCursor_Impl(pOldCursor, pNewCursor, false, false); + SetCursor_Impl(pNewCursor); if( !pNewCursor ) { tools::Rectangle aRect( GetEntryBoundRect( pCursor ) ); @@ -786,7 +764,7 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) pNewCursor=pImpCursor->GoUpDown( pCursor,true ); else pNewCursor=pImpCursor->GoPageUpDown( pCursor,true ); - SetCursor_Impl(pOldCursor, pNewCursor, false, false); + SetCursor_Impl(pNewCursor); } break; @@ -794,7 +772,7 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) if( pCursor ) { pNewCursor=pImpCursor->GoLeftRight(pCursor,true ); - SetCursor_Impl(pOldCursor, pNewCursor, false, false); + SetCursor_Impl(pNewCursor); } break; @@ -803,7 +781,7 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) { MakeEntryVisible( pCursor ); pNewCursor = pImpCursor->GoLeftRight(pCursor,false ); - SetCursor_Impl(pOldCursor, pNewCursor, false, false); + SetCursor_Impl(pNewCursor); if( !pNewCursor ) { tools::Rectangle aRect( GetEntryBoundRect(pCursor)); @@ -869,7 +847,7 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) if( pCursor ) { pNewCursor = maEntries.back().get(); - SetCursor_Impl(pOldCursor, pNewCursor, false, false); + SetCursor_Impl(pNewCursor); } break; @@ -877,7 +855,7 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt ) if( pCursor ) { pNewCursor = maEntries[ 0 ].get(); - SetCursor_Impl(pOldCursor, pNewCursor, false, false); + SetCursor_Impl(pNewCursor); } break; From 681b69ab5de3e8aa735a150613837e7ab801939e Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Tue, 2 Jul 2024 12:08:33 +0200 Subject: [PATCH 055/232] tdf#161853 Drop now unused SvxIconChoiceCtrl_Impl::SelectAll Unused since: Change-Id: I0acde664d695571e9058b9829ad02745a4abaad2 Author: Michael Weghorn Date: Tue Jul 2 11:53:27 2024 +0200 tdf#161853 icon choice ctrl: Drop support for non-single selection modes Also drop the now unused `SvxIconChoiceCtrl_Impl::pAnchor`. Change-Id: I70351b1ad37a691ba18bf981972f97ab981cbe1e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169874 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- vcl/source/control/imivctl.hxx | 2 -- vcl/source/control/imivctl1.cxx | 17 ----------------- 2 files changed, 19 deletions(-) diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index 03655f1599cd..681567aa99b5 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -142,7 +142,6 @@ class SvxIconChoiceCtrl_Impl SvxIconChoiceCtrlEntry* pHead = nullptr; // top left entry SvxIconChoiceCtrlEntry* pCursor; SvxIconChoiceCtrlEntry* pHdlEntry; - SvxIconChoiceCtrlEntry* pAnchor; // for selection LocalFocus aFocus; // Data for focusrect ::vcl::AccessibleFactoryAccess aAccFactory; @@ -257,7 +256,6 @@ public: void InsertEntry( std::unique_ptr, size_t nPos ); void RemoveEntry( size_t nPos ); void FontModified(); - void SelectAll(); void SelectEntry( SvxIconChoiceCtrlEntry*, bool bSelect, diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index bad8150c3514..aadcabb490c7 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -65,7 +65,6 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( nFlags(IconChoiceFlags::NONE), nUserEventAdjustScrBars(nullptr), pCurHighlightFrame(nullptr), bHighlightFramePressed(false), pHead(nullptr), pCursor(nullptr), pHdlEntry(nullptr), - pAnchor(nullptr), ePositionMode(SvxIconChoiceCtrlPositionMode::Free), bUpdateMode(true) { @@ -1845,7 +1844,6 @@ void SvxIconChoiceCtrl_Impl::DeselectAllBut( SvxIconChoiceCtrlEntry const * pThi if( pEntry != pThisEntryNot && pEntry->IsSelected() ) SelectEntry( pEntry, false, true ); } - pAnchor = nullptr; nFlags &= ~IconChoiceFlags::AddMode; } @@ -2363,21 +2361,6 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry() const return nullptr; } -void SvxIconChoiceCtrl_Impl::SelectAll() -{ - size_t nCount = maEntries.size(); - for( size_t nCur = 0; nCur < nCount; nCur++ ) - { - SvxIconChoiceCtrlEntry* pEntry = maEntries[ nCur ].get(); - SelectEntry( pEntry, true/*bSelect*/, true ); - } - nFlags &= ~IconChoiceFlags::AddMode; - pAnchor = nullptr; -} - - - - sal_Int32 SvxIconChoiceCtrl_Impl::GetEntryListPos( SvxIconChoiceCtrlEntry const * pEntry ) const { if( !(nFlags & IconChoiceFlags::EntryListPosValid )) From 8a204bc8504a06ee4f2f1d358a54a5bad1c39f8b Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Tue, 2 Jul 2024 12:13:57 +0200 Subject: [PATCH 056/232] tdf#161853 icon choice ctrl: Drop tracking selected rects `SvxIconChoiceCtrl_Impl::AddSelectedRect` is unused since Change-Id: Ifd60c030b91636acc58298f0e7b97b69c1312be1 Author: Michael Weghorn Date: Tue Jul 2 12:02:05 2024 +0200 tdf#161853 Simplify SvxIconChoiceCtrl_Impl::SetCursor_Impl That means that no rects are ever added to `SvxIconChoiceCtrl_Impl::aSelectedRectList`, so drop it and the methods to manage its content. Change-Id: Ia2221ab2d4e8319e8fd103c7e4e02c4fdf5926fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169875 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- vcl/source/control/imivctl.hxx | 8 -------- vcl/source/control/imivctl1.cxx | 24 ------------------------ 2 files changed, 32 deletions(-) diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index 681567aa99b5..ac82ddcd3f7d 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -117,7 +117,6 @@ class SvxIconChoiceCtrl_Impl VclPtr aHorSBar; VclPtr aScrBarBox; tools::Rectangle aCurSelectionRect; - std::vector aSelectedRectList; Idle aAutoArrangeIdle; Idle aDocRectChangedIdle; Idle aVisRectChangedIdle; @@ -198,13 +197,6 @@ class SvxIconChoiceCtrl_Impl bool bAdd ); - void AddSelectedRect( const tools::Rectangle& ); - void AddSelectedRect( - SvxIconChoiceCtrlEntry* pEntry1, - SvxIconChoiceCtrlEntry* pEntry2 - ); - - void ClearSelectedRectList(); tools::Rectangle CalcMaxTextRect( const SvxIconChoiceCtrlEntry* pEntry ) const; void ClipAtVirtOutRect( tools::Rectangle& rRect ) const; diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index aadcabb490c7..1e4360e643e6 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -105,7 +105,6 @@ SvxIconChoiceCtrl_Impl::~SvxIconChoiceCtrl_Impl() CancelUserEvents(); pImpCursor.reset(); pGridMap.reset(); - ClearSelectedRectList(); aVerSBar.disposeAndClear(); aHorSBar.disposeAndClear(); aScrBarBox.disposeAndClear(); @@ -1833,8 +1832,6 @@ void SvxIconChoiceCtrl_Impl::ToggleSelection( SvxIconChoiceCtrlEntry* pEntry ) void SvxIconChoiceCtrl_Impl::DeselectAllBut( SvxIconChoiceCtrlEntry const * pThisEntryNot ) { - ClearSelectedRectList(); - // TODO: work through z-order list, if necessary! size_t nCount = maEntries.size(); @@ -2185,27 +2182,6 @@ bool SvxIconChoiceCtrl_Impl::IsOver(const std::vector& rRects, return false; } -void SvxIconChoiceCtrl_Impl::AddSelectedRect( SvxIconChoiceCtrlEntry* pEntry1, - SvxIconChoiceCtrlEntry* pEntry2 ) -{ - DBG_ASSERT(pEntry1 && pEntry2,"SelectEntry: Invalid Entry-Ptr"); - tools::Rectangle aRect( GetEntryBoundRect( pEntry1 ) ); - aRect.Union( GetEntryBoundRect( pEntry2 ) ); - AddSelectedRect( aRect ); -} - -void SvxIconChoiceCtrl_Impl::AddSelectedRect( const tools::Rectangle& rRect ) -{ - tools::Rectangle newRect = rRect; - newRect.Normalize(); - aSelectedRectList.push_back( newRect ); -} - -void SvxIconChoiceCtrl_Impl::ClearSelectedRectList() -{ - aSelectedRectList.clear(); -} - IMPL_LINK_NOARG(SvxIconChoiceCtrl_Impl, AutoArrangeHdl, Timer *, void) { aAutoArrangeIdle.Stop(); From 150f61fb0056b9f26796e491ffe6e3094b805236 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Tue, 2 Jul 2024 12:20:52 +0200 Subject: [PATCH 057/232] tdf#161853 Drop now unused SvxIconChoiceCtrl_Impl::SelectRange Unused since: Change-Id: Ifd60c030b91636acc58298f0e7b97b69c1312be1 Author: Michael Weghorn Date: Tue Jul 2 12:02:05 2024 +0200 tdf#161853 Simplify SvxIconChoiceCtrl_Impl::SetCursor_Impl Change-Id: I770e859e1bfd3610413f125cbfa3de0a9be4e66a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169876 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- vcl/source/control/imivctl.hxx | 6 ----- vcl/source/control/imivctl1.cxx | 46 --------------------------------- 2 files changed, 52 deletions(-) diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index ac82ddcd3f7d..9ebbf3cb2a71 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -191,12 +191,6 @@ class SvxIconChoiceCtrl_Impl const std::vector& rOtherRects ); - void SelectRange( - SvxIconChoiceCtrlEntry const * pStart, - SvxIconChoiceCtrlEntry const * pEnd, - bool bAdd - ); - tools::Rectangle CalcMaxTextRect( const SvxIconChoiceCtrlEntry* pEntry ) const; void ClipAtVirtOutRect( tools::Rectangle& rRect ) const; diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 1e4360e643e6..136226bdca82 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -2126,52 +2126,6 @@ void SvxIconChoiceCtrl_Impl::SelectRect( const tools::Rectangle& rRect, bool bAd pView->GetOutDev()->SetClipRegion(); } -void SvxIconChoiceCtrl_Impl::SelectRange( - SvxIconChoiceCtrlEntry const * pStart, - SvxIconChoiceCtrlEntry const * pEnd, - bool bAdd ) -{ - sal_uLong nFront = GetEntryListPos( pStart ); - sal_uLong nBack = GetEntryListPos( pEnd ); - sal_uLong nFirst = std::min( nFront, nBack ); - sal_uLong nLast = std::max( nFront, nBack ); - sal_uLong i; - SvxIconChoiceCtrlEntry* pEntry; - - if ( ! bAdd ) - { - // deselect everything before the first entry if not in - // adding mode - for ( i=0; iIsSelected() ) - SelectEntry( pEntry, false, true ); - } - } - - // select everything between nFirst and nLast - for ( i=nFirst; i<=nLast; i++ ) - { - pEntry = GetEntry( i ); - if( ! pEntry->IsSelected() ) - SelectEntry( pEntry, true, true ); - } - - if ( ! bAdd ) - { - // deselect everything behind the last entry if not in - // adding mode - sal_uLong nEnd = GetEntryCount(); - for ( ; iIsSelected() ) - SelectEntry( pEntry, false, true ); - } - } -} - bool SvxIconChoiceCtrl_Impl::IsOver(const std::vector& rRects, const tools::Rectangle& rBoundRect) { for (const tools::Rectangle& rRect : rRects) From 35775e291d6570b29dc0120e4839c720152b5149 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Tue, 2 Jul 2024 12:34:57 +0200 Subject: [PATCH 058/232] tdf#161853 Drop now unused SvxIconChoiceCtrl_Impl::SelectRect etc. `SvxIconChoiceCtrl_Impl::SelectRect` is unused since: Change-Id: Ifd60c030b91636acc58298f0e7b97b69c1312be1 Author: Michael Weghorn Date: Tue Jul 2 12:02:05 2024 +0200 tdf#161853 Simplify SvxIconChoiceCtrl_Impl::SetCursor_Impl Drop it, and drop the `GetHotSpot` helper that was only used by it. Also drop `SvxIconChoiceCtrl_Impl::aCurSelectionRect` that is by now only written to, but never read. Change-Id: I1fb833acce1d4a0d96c45bca2eda2d5969baff77 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169877 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- vcl/source/control/imivctl.hxx | 13 ---- vcl/source/control/imivctl1.cxx | 122 -------------------------------- 2 files changed, 135 deletions(-) diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index 9ebbf3cb2a71..ecbb3020dd56 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -116,7 +116,6 @@ class SvxIconChoiceCtrl_Impl VclPtr aVerSBar; VclPtr aHorSBar; VclPtr aScrBarBox; - tools::Rectangle aCurSelectionRect; Idle aAutoArrangeIdle; Idle aDocRectChangedIdle; Idle aVisRectChangedIdle; @@ -184,12 +183,6 @@ class SvxIconChoiceCtrl_Impl void DeselectAllBut( SvxIconChoiceCtrlEntry const * ); void Center( SvxIconChoiceCtrlEntry* pEntry ) const; void CallSelectHandler(); - void SelectRect( - SvxIconChoiceCtrlEntry* pEntry1, - SvxIconChoiceCtrlEntry* pEntry2, - bool bAdd, - const std::vector& rOtherRects - ); tools::Rectangle CalcMaxTextRect( const SvxIconChoiceCtrlEntry* pEntry ) const; @@ -331,12 +324,6 @@ public: const tools::Rectangle& rEntryBoundRect ); - void SelectRect( - const tools::Rectangle&, - bool bAdd, - const std::vector& rOtherRects - ); - void MakeVisible( const tools::Rectangle& rDocPos, bool bInScrollBarEvent=false diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 136226bdca82..9cc1e385fd2e 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -701,7 +701,6 @@ void SvxIconChoiceCtrl_Impl::SetCursor_Impl(SvxIconChoiceCtrlEntry* pNewCursor) SetCursor( pNewCursor ); SelectEntry( pCursor, true, false ); - aCurSelectionRect = GetEntryBoundRect( pCursor ); CallEventListeners( VclEventId::ListboxSelect, pCursor ); } @@ -2005,127 +2004,6 @@ tools::Rectangle SvxIconChoiceCtrl_Impl::CalcFocusRect( SvxIconChoiceCtrlEntry* aTextRect.Bottom()); } -// the hot spot is the inner 50% of the rectangle -static tools::Rectangle GetHotSpot( const tools::Rectangle& rRect ) -{ - tools::Rectangle aResult( rRect ); - aResult.Normalize(); - Size aSize( rRect.GetSize() ); - tools::Long nDelta = aSize.Width() / 4; - aResult.AdjustLeft(nDelta ); - aResult.AdjustRight( -nDelta ); - nDelta = aSize.Height() / 4; - aResult.AdjustTop(nDelta ); - aResult.AdjustBottom( -nDelta ); - return aResult; -} - -void SvxIconChoiceCtrl_Impl::SelectRect( SvxIconChoiceCtrlEntry* pEntry1, SvxIconChoiceCtrlEntry* pEntry2, - bool bAdd, const std::vector& rOtherRects) -{ - DBG_ASSERT(pEntry1 && pEntry2,"SelectEntry: Invalid Entry-Ptr"); - tools::Rectangle aRect( GetEntryBoundRect( pEntry1 ) ); - aRect.Union( GetEntryBoundRect( pEntry2 ) ); - SelectRect(aRect, bAdd, rOtherRects); -} - -void SvxIconChoiceCtrl_Impl::SelectRect( const tools::Rectangle& rRect, bool bAdd, - const std::vector& rOtherRects) -{ - aCurSelectionRect = rRect; - if( maZOrderList.empty() ) - return; - - // set flag, so ToTop won't be called in Select - bool bAlreadySelectingRect(nFlags & IconChoiceFlags::SelectingRect); - nFlags |= IconChoiceFlags::SelectingRect; - - CheckBoundingRects(); - pView->PaintImmediately(); - const size_t nCount = maZOrderList.size(); - - tools::Rectangle aRect( rRect ); - aRect.Normalize(); - bool bCalcOverlap = (bAdd && !rOtherRects.empty()); - - bool bResetClipRegion = false; - if( !pView->GetOutDev()->IsClipRegion() ) - { - bResetClipRegion = true; - pView->GetOutDev()->SetClipRegion(vcl::Region(GetOutputRect())); - } - - for( size_t nPos = 0; nPos < nCount; nPos++ ) - { - SvxIconChoiceCtrlEntry* pEntry = maZOrderList[ nPos ]; - - if( !IsBoundingRectValid( pEntry->aRect )) - FindBoundingRect( pEntry ); - tools::Rectangle aBoundRect( GetHotSpot( pEntry->aRect ) ); - bool bSelected = pEntry->IsSelected(); - - bool bOverlaps; - if( bCalcOverlap ) - bOverlaps = IsOver(rOtherRects, aBoundRect); - else - bOverlaps = false; - bool bOver = aRect.Overlaps( aBoundRect ); - - if( bOver && !bOverlaps ) - { - // is inside the new selection rectangle and outside of any old one - // => select - if( !bSelected ) - SelectEntry( pEntry, true, true ); - } - else if( !bAdd ) - { - // is outside of the selection rectangle - // => deselect - if( bSelected ) - SelectEntry( pEntry, false, true ); - } - else if (bOverlaps) - { - // The entry is inside an old (=>span multiple rectangles with Ctrl) - // selection rectangle. - - // There is still a bug here! The selection status of an entry in a - // previous rectangle has to be restored, if it was touched by the - // current selection rectangle but is not inside it any more. - // For simplicity's sake, let's assume that all entries in the old - // rectangles were correctly selected. It is wrong to just deselect - // the intersection. - // Possible solution: remember a snapshot of the selection before - // spanning the rectangle. - if( aBoundRect.Overlaps( rRect)) - { - // deselect intersection between old rectangles and current rectangle - if( bSelected ) - SelectEntry( pEntry, false, true ); - } - else - { - // select entry of an old rectangle - if( !bSelected ) - SelectEntry( pEntry, true, true ); - } - } - else if( !bOver && bSelected ) - { - // this entry is completely outside the rectangle => deselect it - SelectEntry( pEntry, false, true ); - } - } - - if( !bAlreadySelectingRect ) - nFlags &= ~IconChoiceFlags::SelectingRect; - - pView->PaintImmediately(); - if( bResetClipRegion ) - pView->GetOutDev()->SetClipRegion(); -} - bool SvxIconChoiceCtrl_Impl::IsOver(const std::vector& rRects, const tools::Rectangle& rBoundRect) { for (const tools::Rectangle& rRect : rRects) From e04b97acf2dc410c2e6380abdf23f9a2df792284 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Tue, 2 Jul 2024 12:41:40 +0200 Subject: [PATCH 059/232] tdf#161853 icon choice ctrl: Drop unused WB_NOASYNCSELECTHDL That bit is never set, so drop it. Change-Id: Iffa13bd0a679505bdc47bc3fb5d828969ac9eb1b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169878 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- include/vcl/toolkit/ivctrl.hxx | 2 -- vcl/source/control/imivctl1.cxx | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/include/vcl/toolkit/ivctrl.hxx b/include/vcl/toolkit/ivctrl.hxx index 3fede7aeba66..308e20c444c1 100644 --- a/include/vcl/toolkit/ivctrl.hxx +++ b/include/vcl/toolkit/ivctrl.hxx @@ -143,7 +143,6 @@ public: WB_NOCOLUMNHEADER // No Headerbar in Details view (Headerbar not implemented) WB_NOPOINTERFOCUS // No GrabFocus at MouseButtonDown WB_HIGHLIGHTFRAME // The entry beneath the mouse will be highlighted - WB_NOASYNCSELECTHDL // Do not collect events -> Selection handlers will be called synchronously */ #define WB_ICON WB_RECTSTYLE @@ -157,7 +156,6 @@ public: #define WB_ALIGN_LEFT WB_LEFT #define WB_NOCOLUMNHEADER WB_CENTER #define WB_HIGHLIGHTFRAME WB_IGNORETAB -#define WB_NOASYNCSELECTHDL WB_NOLABEL class MnemonicGenerator; diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 9cc1e385fd2e..5082e298fa15 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -2439,9 +2439,7 @@ void SvxIconChoiceCtrl_Impl::CallSelectHandler() // missing calls to Select if the object is selected from a mouse movement, // because when starting the timer, the mouse cursor might have already left // the object. - // In special cases (=>SfxFileDialog!), synchronous calls can be forced via - // WB_NOASYNCSELECTHDL. - if( nWinBits & (WB_NOASYNCSELECTHDL | WB_HIGHLIGHTFRAME) ) + if( nWinBits & WB_HIGHLIGHTFRAME ) { pHdlEntry = nullptr; pView->ClickIcon(); From 0ec47906c488d20b4ce43a4df78bbed9ae7cd6b8 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Tue, 2 Jul 2024 12:55:53 +0200 Subject: [PATCH 060/232] tdf#161853 icon choice ctrl: Drop unused async select handler `SvtIconChoiceCtrl` and its implementation class, `SvxIconChoiceCtrl_Impl`, is only used in `VerticalTabControl`. That one sets the `WB_HIGHLIGHTFRAME` bit, so the code path using the asynchronous handling in `SvxIconChoiceCtrl_Impl::CallSelectHandler` never gets used. The comment in there also explains that this should happen synchronously in case of single-select mode, which is by now the only implemented mode. Therefore, drop the asynchronous handling altogether. Change-Id: I238f3bb26b590df32f6dc7e67c402b2fb1762a62 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169879 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- vcl/source/control/imivctl.hxx | 4 ---- vcl/source/control/imivctl1.cxx | 41 +++------------------------------ 2 files changed, 3 insertions(+), 42 deletions(-) diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index ecbb3020dd56..712599364304 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -119,7 +119,6 @@ class SvxIconChoiceCtrl_Impl Idle aAutoArrangeIdle; Idle aDocRectChangedIdle; Idle aVisRectChangedIdle; - Idle aCallSelectHdlIdle; Size aVirtOutputSize; Size aImageSize; Size aDefaultTextSize; @@ -139,7 +138,6 @@ class SvxIconChoiceCtrl_Impl bool bHighlightFramePressed; SvxIconChoiceCtrlEntry* pHead = nullptr; // top left entry SvxIconChoiceCtrlEntry* pCursor; - SvxIconChoiceCtrlEntry* pHdlEntry; LocalFocus aFocus; // Data for focusrect ::vcl::AccessibleFactoryAccess aAccFactory; @@ -161,7 +159,6 @@ class SvxIconChoiceCtrl_Impl DECL_LINK( AutoArrangeHdl, Timer*, void ); DECL_LINK( DocRectChangedHdl, Timer*, void ); DECL_LINK( VisRectChangedHdl, Timer*, void ); - DECL_LINK( CallSelectHdlHdl, Timer*, void ); void AdjustScrollBars(); void PositionScrollBars( tools::Long nRealWidth, tools::Long nRealHeight ); @@ -182,7 +179,6 @@ class SvxIconChoiceCtrl_Impl void ToggleSelection( SvxIconChoiceCtrlEntry* ); void DeselectAllBut( SvxIconChoiceCtrlEntry const * ); void Center( SvxIconChoiceCtrlEntry* pEntry ) const; - void CallSelectHandler(); tools::Rectangle CalcMaxTextRect( const SvxIconChoiceCtrlEntry* pEntry ) const; diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 5082e298fa15..ac384b34d167 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -59,12 +59,10 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( aAutoArrangeIdle( "svtools::SvxIconChoiceCtrl_Impl aAutoArrangeIdle" ), aDocRectChangedIdle( "svtools::SvxIconChoiceCtrl_Impl aDocRectChangedIdle" ), aVisRectChangedIdle( "svtools::SvxIconChoiceCtrl_Impl aVisRectChangedIdle" ), - aCallSelectHdlIdle( "svtools::SvxIconChoiceCtrl_Impl aCallSelectHdlIdle" ), aImageSize( 32 * pCurView->GetDPIScaleFactor(), 32 * pCurView->GetDPIScaleFactor()), pView(pCurView), nMaxVirtWidth(DEFAULT_MAX_VIRT_WIDTH), nMaxVirtHeight(DEFAULT_MAX_VIRT_HEIGHT), nFlags(IconChoiceFlags::NONE), nUserEventAdjustScrBars(nullptr), pCurHighlightFrame(nullptr), bHighlightFramePressed(false), pHead(nullptr), pCursor(nullptr), - pHdlEntry(nullptr), ePositionMode(SvxIconChoiceCtrlPositionMode::Free), bUpdateMode(true) { @@ -81,9 +79,6 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( aAutoArrangeIdle.SetPriority( TaskPriority::HIGH_IDLE ); aAutoArrangeIdle.SetInvokeHandler(LINK(this,SvxIconChoiceCtrl_Impl,AutoArrangeHdl)); - aCallSelectHdlIdle.SetPriority( TaskPriority::LOWEST ); - aCallSelectHdlIdle.SetInvokeHandler( LINK(this,SvxIconChoiceCtrl_Impl,CallSelectHdlHdl)); - aDocRectChangedIdle.SetPriority( TaskPriority::HIGH_IDLE ); aDocRectChangedIdle.SetInvokeHandler(LINK(this,SvxIconChoiceCtrl_Impl,DocRectChangedHdl)); @@ -256,21 +251,20 @@ void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, bool b if( pEntry->IsSelected() == bSelect ) return; - pHdlEntry = pEntry; SvxIconViewFlags nEntryFlags = pEntry->GetFlags(); if( bSelect ) { nEntryFlags |= SvxIconViewFlags::SELECTED; pEntry->AssignFlags( nEntryFlags ); nSelectionCount++; - CallSelectHandler(); + pView->ClickIcon(); } else { nEntryFlags &= ~SvxIconViewFlags::SELECTED; pEntry->AssignFlags( nEntryFlags ); nSelectionCount--; - CallSelectHandler(); + pView->ClickIcon(); } EntrySelected( pEntry, bSelect ); } @@ -606,7 +600,6 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) { DeselectAllBut( pEntry ); SelectEntry( pEntry, true, false ); - pHdlEntry = pEntry; pView->ClickIcon(); } else @@ -664,13 +657,10 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt ) bHighlightFramePressed = false; SetEntryHighlightFrame( pEntry, true ); - pHdlEntry = pCurHighlightFrame; pView->ClickIcon(); // set focus on Icon - SetCursor_Impl(pHdlEntry); - - pHdlEntry = nullptr; + SetCursor_Impl(pCurHighlightFrame); } return bHandled; } @@ -2431,31 +2421,6 @@ void SvxIconChoiceCtrl_Impl::SetEntryHighlightFrame( SvxIconChoiceCtrlEntry* pEn } } -void SvxIconChoiceCtrl_Impl::CallSelectHandler() -{ - // When single-click mode is active, the selection handler should be called - // synchronously, as the selection is automatically taken away once the - // mouse cursor doesn't touch the object any more. Else, we might run into - // missing calls to Select if the object is selected from a mouse movement, - // because when starting the timer, the mouse cursor might have already left - // the object. - if( nWinBits & WB_HIGHLIGHTFRAME ) - { - pHdlEntry = nullptr; - pView->ClickIcon(); - //pView->Select(); - } - else - aCallSelectHdlIdle.Start(); -} - -IMPL_LINK_NOARG(SvxIconChoiceCtrl_Impl, CallSelectHdlHdl, Timer *, void) -{ - pHdlEntry = nullptr; - pView->ClickIcon(); - //pView->Select(); -} - void SvxIconChoiceCtrl_Impl::SetOrigin( const Point& rPos ) { MapMode aMapMode( pView->GetMapMode() ); From d52136a8335024c32c81bbe79fef3557baf8fc45 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Tue, 2 Jul 2024 16:47:09 +0200 Subject: [PATCH 061/232] tdf#161853 Drop SvxIconChoiceCtrl_Impl::GetSelectionCount Support for anything except single selection mode was dropped in Change-Id: I0acde664d695571e9058b9829ad02745a4abaad2 Author: Michael Weghorn Date: Tue Jul 2 11:53:27 2024 +0200 tdf#161853 icon choice ctrl: Drop support for non-single selection modes , so the selection count will usually be 1. The only use is in `SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry`, and should it be possible for no entry to be selected, that will still return `nullptr` anyway. Change-Id: I46562b448b59ba7013ff2e98cfba5925347e01a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169886 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- vcl/source/control/imivctl.hxx | 2 -- vcl/source/control/imivctl1.cxx | 13 ------------- 2 files changed, 15 deletions(-) diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index 712599364304..cd268c3d271a 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -141,7 +141,6 @@ class SvxIconChoiceCtrl_Impl LocalFocus aFocus; // Data for focusrect ::vcl::AccessibleFactoryAccess aAccFactory; - sal_Int32 nSelectionCount; SvxIconChoiceCtrlPositionMode ePositionMode; bool bBoundRectsDirty; bool bUpdateMode; @@ -309,7 +308,6 @@ public: void Command( const CommandEvent& rCEvt ); void ToTop( SvxIconChoiceCtrlEntry* ); - sal_Int32 GetSelectionCount() const; void SetGrid( const Size& ); Size GetMinGrid() const; void Scroll( tools::Long nDeltaX, tools::Long nDeltaY ); diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index ac384b34d167..27f363f4da76 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -107,7 +107,6 @@ SvxIconChoiceCtrl_Impl::~SvxIconChoiceCtrl_Impl() void SvxIconChoiceCtrl_Impl::Clear( bool bInCtor ) { - nSelectionCount = 0; pCurHighlightFrame = nullptr; CancelUserEvents(); ShowCursor( false ); @@ -256,14 +255,12 @@ void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, bool b { nEntryFlags |= SvxIconViewFlags::SELECTED; pEntry->AssignFlags( nEntryFlags ); - nSelectionCount++; pView->ClickIcon(); } else { nEntryFlags &= ~SvxIconViewFlags::SELECTED; pEntry->AssignFlags( nEntryFlags ); - nSelectionCount--; pView->ClickIcon(); } EntrySelected( pEntry, bSelect ); @@ -1805,13 +1802,6 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const tools::Rectangle& rRect, bool bS VisRectChanged(); } -sal_Int32 SvxIconChoiceCtrl_Impl::GetSelectionCount() const -{ - if( (nWinBits & WB_HIGHLIGHTFRAME) && pCurHighlightFrame ) - return 1; - return nSelectionCount; -} - void SvxIconChoiceCtrl_Impl::ToggleSelection( SvxIconChoiceCtrlEntry* pEntry ) { bool bSel; @@ -2124,9 +2114,6 @@ void SvxIconChoiceCtrl_Impl::InvalidateEntry( SvxIconChoiceCtrlEntry* pEntry ) SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry() const { - if( !GetSelectionCount() ) - return nullptr; - size_t nCount = maEntries.size(); if( !pHead ) { From b2aa4319f90788410d40bac723a2cc9fbf3f8d97 Mon Sep 17 00:00:00 2001 From: Sarper Akdemir Date: Fri, 7 Jun 2024 21:18:47 +0200 Subject: [PATCH 062/232] tdf#33603: make notes pane searchable Flattens DocumentIteratorImpl, getting rid of the intermediary ViewIteratorImpl. Now the DocumentIteratorImpl, iterates in the following pattern: 1-) For all slides, visit the NormalView and the NotesView before advancing to next slide. 2-) Master Pages 3-) Handouts Now when a search result is found in the NotesView that is displayed on the NotesPane instead of the NotesView. Change-Id: I8133c6a74861e783ab1a23f51ac5faf362a0f512 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169659 Tested-by: Jenkins Reviewed-by: Sarper Akdemir --- sd/sdi/NotesPanelView.sdi | 8 +- sd/sdi/drviewsh.sdi | 6 + sd/source/ui/inc/OutlinerIteratorImpl.hxx | 77 ++---- sd/source/ui/view/NotesPanelViewShell.cxx | 46 +++- sd/source/ui/view/Outliner.cxx | 150 +++++++++- sd/source/ui/view/OutlinerIterator.cxx | 318 +++++++++++----------- sd/source/ui/view/drviews7.cxx | 7 + 7 files changed, 373 insertions(+), 239 deletions(-) diff --git a/sd/sdi/NotesPanelView.sdi b/sd/sdi/NotesPanelView.sdi index 2fca90c56fdc..933ef9922401 100644 --- a/sd/sdi/NotesPanelView.sdi +++ b/sd/sdi/NotesPanelView.sdi @@ -492,10 +492,14 @@ interface NotesPanelView ExecMethod = FuTemporary ; StateMethod = GetMenuState ; ] + FID_SEARCH_NOW // ole : ?, status : ? + [ + ExecMethod = Execute ; + StateMethod = GetState ; + GroupId = SfxGroupId::Document ; + ] } -include "drtxtob.sdi" - shell NotesPanelViewShell { import NotesPanelView; diff --git a/sd/sdi/drviewsh.sdi b/sd/sdi/drviewsh.sdi index 84fa9bfa8471..ac7e44ab1a37 100644 --- a/sd/sdi/drviewsh.sdi +++ b/sd/sdi/drviewsh.sdi @@ -203,6 +203,12 @@ interface ImpressEditView : DrawView ExecMethod = FuTemporary ; StateMethod = GetMenuState ; ] + FID_SEARCH_NOW + [ + ExecMethod = Execute ; + StateMethod = GetState ; + GroupId = SfxGroupId::Document ; + ] } shell DrawViewShell diff --git a/sd/source/ui/inc/OutlinerIteratorImpl.hxx b/sd/source/ui/inc/OutlinerIteratorImpl.hxx index 84b11e47b636..485f2b89eaec 100644 --- a/sd/source/ui/inc/OutlinerIteratorImpl.hxx +++ b/sd/source/ui/inc/OutlinerIteratorImpl.hxx @@ -155,63 +155,19 @@ private: IteratorImplBase& operator= (const IteratorImplBase& rIterator); }; -/** Iterator for iteration over all objects in a single view. On reaching - the last object on the last page (or the first object on the first page) - the view is *not* switched. Further calls to the - GotoNextObject() method will be ignored. +/** Iterator for iteration over all objects in all views. It switches views when + appropriate. + + Iterates in the following pattern + 1-) Alternating Normal View and Notes View for each page + 2-) Master Pages + 3-) Notes Masters + 4-) The Handout Master

For documentation of the methods please refer to the base class IteratorImplBase.

*/ -class ViewIteratorImpl : public IteratorImplBase -{ -public: - ViewIteratorImpl ( - sal_Int32 nPageIndex, - SdDrawDocument* pDocument, - const std::weak_ptr& rpViewShellWeak, - bool bDirectionIsForward); - ViewIteratorImpl ( - sal_Int32 nPageIndex, - SdDrawDocument* pDocument, - const std::weak_ptr& rpViewShellWeak, - bool bDirectionIsForward, - PageKind ePageKind, - EditMode eEditMode); - virtual ~ViewIteratorImpl() override; - - virtual void GotoNextText() override; - virtual IteratorImplBase* Clone (IteratorImplBase* pObject = nullptr) const override; - virtual void Reverse() override; - -protected: - /** Set up page pointer and object list iterator for the specified - page. - @param nPageIndex - Index of the new page. It may lie outside the valid range for - page indices. - */ - void SetPage (sal_Int32 nPageIndex); - -private: - /// Indicates whether a page changed occurred on switching to current page. - bool mbPageChangeOccurred; - /// Pointer to the page associated with the current page index. May be NULL. - SdPage* mpPage; - /// Iterator of all objects on the current page. - std::optional moObjectIterator; - - // Don't use this operator. - ViewIteratorImpl& operator= (const ViewIteratorImpl&) = delete; -}; - -/** Iterator for iteration over all objects in all views. It automatically - switches views when reaching the end/beginning of a view. - -

For documentation of the methods please refer to the base class - IteratorImplBase.

-*/ -class DocumentIteratorImpl final : public ViewIteratorImpl +class DocumentIteratorImpl final : public IteratorImplBase { public: DocumentIteratorImpl ( @@ -225,8 +181,23 @@ public: virtual void GotoNextText() override; virtual IteratorImplBase* Clone (IteratorImplBase* pObject = nullptr) const override; + virtual void Reverse() override; private: + /** Set up page pointer and object list iterator for the specified + page. + @param nPageIndex + Index of the new page. It may lie outside the valid range for + page indices. + */ + void SetPage (sal_Int32 nPageIndex); + + /// Iterator of all objects on the current page. + std::optional moObjectIterator; + + /// Pointer to the page associated with the current page index. May be NULL. + SdPage* mpPage; + /// Number of pages in the view that is specified by maPosition. sal_Int32 mnPageCount; diff --git a/sd/source/ui/view/NotesPanelViewShell.cxx b/sd/source/ui/view/NotesPanelViewShell.cxx index a13daeb9f6f0..5a5c9ec1407b 100644 --- a/sd/source/ui/view/NotesPanelViewShell.cxx +++ b/sd/source/ui/view/NotesPanelViewShell.cxx @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -568,6 +569,7 @@ void NotesPanelViewShell::GetState(SfxItemSet& rSet) { switch (nWhich) { + case FID_SEARCH_NOW: case SID_SEARCH_ITEM: case SID_SEARCH_OPTIONS: // Call common (old) implementation in the document shell. @@ -1331,15 +1333,49 @@ void NotesPanelViewShell::FuSupport(SfxRequest& rReq) void NotesPanelViewShell::Execute(SfxRequest& rReq) { - bool bForwardCall = true; - switch (rReq.GetSlot()) { + case FID_SEARCH_NOW: + { + const SfxItemSet* pReqArgs = rReq.GetArgs(); + + sd::View* pView = nullptr; + if (auto pMainViewSh = GetViewShellBase().GetMainViewShell()) + pView = pMainViewSh->GetView(); + + if (pReqArgs) + { + if (pView) + { + rtl::Reference& xFuSearch + = pView->getSearchContext().getFunctionSearch(); + + if (!xFuSearch.is()) + { + xFuSearch = rtl::Reference(FuSearch::createPtr( + this, this->GetActiveWindow(), pView, GetDoc(), rReq)); + + pView->getSearchContext().setSearchFunction(xFuSearch); + } + + if (xFuSearch.is()) + { + const SvxSearchItem& rSearchItem = pReqArgs->Get(SID_SEARCH_ITEM); + + SD_MOD()->SetSearchItem( + std::unique_ptr(rSearchItem.Clone())); + xFuSearch->SearchAndReplace(&rSearchItem); + } + } + } + rReq.Done(); + } + break; + case SID_SEARCH_ITEM: // Forward this request to the common (old) code of the // document shell. GetDocSh()->Execute(rReq); - bForwardCall = false; break; case SID_SPELL_DIALOG: @@ -1355,16 +1391,12 @@ void NotesPanelViewShell::Execute(SfxRequest& rReq) pViewFrame->GetBindings().Invalidate(SID_SPELL_DIALOG); rReq.Done(); - bForwardCall = false; } break; default: break; } - - if (bForwardCall) - TextObjectBar::ExecuteImpl(this, mpView, rReq, nullptr); } void NotesPanelViewShell::MouseButtonUp(const MouseEvent& rMEvt, ::sd::Window* pWin) diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index 4d00939fc53e..ed0045b3c8a2 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -49,10 +49,12 @@ #include #include #include +#include #include #include #include #include +#include #include #include #include @@ -62,6 +64,7 @@ #include #include #include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -127,6 +130,30 @@ sd::ViewShellBase* getViewShellBase() return dynamic_cast(SfxViewShell::Current()); } +OutlinerView* lclGetNotesPaneOutliner(const std::shared_ptr& pViewShell) +{ + if (!pViewShell) + return nullptr; + + // request the notes pane + sd::ViewShellBase& rBase = pViewShell->GetViewShellBase(); + + sd::framework::FrameworkHelper::Instance(rBase)->RequestView( + sd::framework::FrameworkHelper::msNotesPanelViewURL, + sd::framework::FrameworkHelper::msBottomImpressPaneURL); + + auto pInstance = sd::framework::FrameworkHelper::Instance(rBase); + pInstance->RequestSynchronousUpdate(); + + std::shared_ptr pNotesPaneShell( + pInstance->GetViewShell(sd::framework::FrameworkHelper::msBottomImpressPaneURL)); + + if (!pNotesPaneShell) + return nullptr; + + return static_cast(pNotesPaneShell->GetView())->GetOutlinerView(); +} + } // end anonymous namespace SdOutliner::SdOutliner( SdDrawDocument* pDoc, OutlinerMode nMode ) @@ -896,6 +923,14 @@ bool SdOutliner::SearchAndReplaceOnce(std::vector* pSelecti if (mpSearchItem->GetCommand() != SvxSearchCmd::REPLACE_ALL) { nMatchCount = getOutlinerView()->StartSearchAndReplace(*mpSearchItem); + if (nMatchCount && maCurrentPosition.meEditMode == EditMode::Page + && maCurrentPosition.mePageKind == PageKind::Notes) + { + if(auto pNotesPaneOutliner = lclGetNotesPaneOutliner(pViewShell)) + { + pNotesPaneOutliner->SetSelection(getOutlinerView()->GetSelection()); + } + } } } @@ -917,14 +952,25 @@ bool SdOutliner::SearchAndReplaceOnce(std::vector* pSelecti // necessary anymore. DBG_ASSERT(GetEditEngine().HasView(&getOutlinerView()->GetEditView() ), "SearchAndReplace without valid view!" ); - if ( ! GetEditEngine().HasView( &getOutlinerView()->GetEditView() ) ) + if ( ! GetEditEngine().HasView( &getOutlinerView()->GetEditView() ) + && maCurrentPosition.mePageKind != PageKind::Notes ) { mpDrawDocument->GetDocSh()->SetWaitCursor( false ); return true; } if (meMode == SEARCH) - getOutlinerView()->StartSearchAndReplace(*mpSearchItem); + { + auto nMatch = getOutlinerView()->StartSearchAndReplace(*mpSearchItem); + if (nMatch && maCurrentPosition.meEditMode == EditMode::Page + && maCurrentPosition.mePageKind == PageKind::Notes) + { + if(auto pNotesPaneOutliner = lclGetNotesPaneOutliner(pViewShell)) + { + pNotesPaneOutliner->SetSelection(getOutlinerView()->GetSelection()); + } + } + } } } } @@ -972,10 +1018,30 @@ void SdOutliner::DetectChange() std::shared_ptr pDrawViewShell ( std::dynamic_pointer_cast(pViewShell)); + std::shared_ptr pOverridingViewShell{}; + if(sd::ViewShellBase* pBase = getViewShellBase()) + { + if (const std::shared_ptr& pViewShellManager = pBase->GetViewShellManager()) + pOverridingViewShell = pViewShellManager->GetOverridingMainShell(); + } + + bool bViewChanged = false; + + if( pDrawViewShell ) + { + if( !pOverridingViewShell ) + bViewChanged = (aPosition.meEditMode != pDrawViewShell->GetEditMode() || aPosition.mePageKind != pDrawViewShell->GetPageKind()); + else + { + auto pPage = pOverridingViewShell->getCurrentPage(); + auto ePageKind = pPage ? pPage->GetPageKind() : PageKind::Standard; + auto eEditMode = EditMode::Page; + bViewChanged = (aPosition.meEditMode != eEditMode || aPosition.mePageKind != ePageKind); + } + } + // Detect whether the view has been switched from the outside. - if (pDrawViewShell != nullptr - && (aPosition.meEditMode != pDrawViewShell->GetEditMode() - || aPosition.mePageKind != pDrawViewShell->GetPageKind())) + if( bViewChanged ) { // Either the edit mode or the page kind has changed. SetStatusEventHdl(Link()); @@ -1527,12 +1593,20 @@ void SdOutliner::PrepareSearchAndReplace() EnterEditMode(false); - mpDrawDocument->GetDocSh()->SetWaitCursor( false ); - // Start search at the right end of the current object's text - // depending on the search direction. + mpDrawDocument->GetDocSh()->SetWaitCursor(false); + OutlinerView* pOutlinerView = getOutlinerView(); if (pOutlinerView != nullptr) + { pOutlinerView->SetSelection (GetSearchStartPosition ()); + if (lclIsValidTextObject(maCurrentPosition) && maCurrentPosition.mePageKind == PageKind::Notes) + { + if (auto pNotesPaneOutliner = lclGetNotesPaneOutliner(mpWeakViewShell.lock())) + { + pNotesPaneOutliner->SetSelection(getOutlinerView()->GetSelection()); + } + } + } } void SdOutliner::SetViewMode (PageKind ePageKind) @@ -1660,8 +1734,43 @@ void SdOutliner::EnterEditMode (bool bGrabFocus) // Turn on the edit mode for the text object. SetUpdateLayout(true); - mpView->SdrBeginTextEdit(mpSearchSpellTextObj, pPV, mpWindow, true, this, - pOutlinerView, true, true, bGrabFocus); + + if(maCurrentPosition.mePageKind == PageKind::Notes + && maCurrentPosition.meEditMode == EditMode::Page) + { + sd::ViewShellBase& rBase = pViewShell->GetViewShellBase(); + + sd::framework::FrameworkHelper::Instance(rBase)->RequestView( + sd::framework::FrameworkHelper::msNotesPanelViewURL, + sd::framework::FrameworkHelper::msBottomImpressPaneURL); + + auto pInstance = sd::framework::FrameworkHelper::Instance(rBase); + pInstance->RequestSynchronousUpdate(); + + std::shared_ptr pNotesPaneShell(pInstance->GetViewShell(sd::framework::FrameworkHelper::msBottomImpressPaneURL)); + if(pNotesPaneShell) + { + pNotesPaneShell->GetParentWindow()->GrabFocus(); + pNotesPaneShell->GetContentWindow()->GrabFocus(); + } + } + else + { + std::shared_ptr pOverridingViewShell{}; + sd::ViewShellBase* pBase = getViewShellBase(); + if (auto pViewShellManager = pBase->GetViewShellManager()) + pOverridingViewShell = pViewShellManager->GetOverridingMainShell(); + + if (pOverridingViewShell) + { + getViewShellBase()->GetMainViewShell()->GetParentWindow()->GrabFocus(); + getViewShellBase()->GetMainViewShell()->GetContentWindow()->GrabFocus(); + bGrabFocus = true; + } + + mpView->SdrBeginTextEdit(mpSearchSpellTextObj, pPV, mpWindow, true, this, pOutlinerView, + true, true, bGrabFocus); + } mbFoundObject = true; } @@ -1733,8 +1842,25 @@ bool SdOutliner::HandleFailedSearch() SdrObject* SdOutliner::SetObject ( const sd::outliner::IteratorPosition& rPosition) { - SetViewMode (rPosition.mePageKind); - SetPage (rPosition.meEditMode, static_cast(rPosition.mnPageIndex)); + if(rPosition.meEditMode == EditMode::Page && rPosition.mePageKind == PageKind::Notes) + { + std::shared_ptr pViewShell (mpWeakViewShell.lock()); + std::shared_ptr pDrawViewShell( + std::dynamic_pointer_cast(pViewShell)); + + if (pDrawViewShell->GetEditMode() != EditMode::Page + || pDrawViewShell->GetCurPagePos() != rPosition.mnPageIndex) + SetPage(EditMode::Page, static_cast(rPosition.mnPageIndex)); + + mnText = rPosition.mnText; + return rPosition.mxObject.get().get(); + } + else + { + SetViewMode(rPosition.mePageKind); + SetPage(rPosition.meEditMode, static_cast(rPosition.mnPageIndex)); + } + mnText = rPosition.mnText; return rPosition.mxObject.get().get(); } diff --git a/sd/source/ui/view/OutlinerIterator.cxx b/sd/source/ui/view/OutlinerIterator.cxx index a7cd6cf66bf2..492880e9bf7c 100644 --- a/sd/source/ui/view/OutlinerIterator.cxx +++ b/sd/source/ui/view/OutlinerIterator.cxx @@ -28,6 +28,8 @@ #include #include #include +#include +#include namespace sd::outliner { @@ -149,6 +151,11 @@ Iterator OutlinerContainer::current() Iterator OutlinerContainer::CreateIterator (IteratorLocation aLocation) { + std::shared_ptr pOverridingShell{}; + if (auto pBase = dynamic_cast(SfxViewShell::Current())) + if (auto pViewShellManager = pBase->GetViewShellManager()) + pOverridingShell = pViewShellManager->GetOverridingMainShell(); + // Decide on certain features of the outliner which kind of iterator to // use. if (mpOutliner->mbRestrictSearchToSelection) @@ -156,6 +163,7 @@ Iterator OutlinerContainer::CreateIterator (IteratorLocation aLocation) return CreateSelectionIterator ( mpOutliner->maMarkListCopy, mpOutliner->mpDrawDocument, + pOverridingShell ? pOverridingShell : mpOutliner->mpWeakViewShell.lock(), mpOutliner->mbDirectionIsForward, aLocation); @@ -163,6 +171,7 @@ Iterator OutlinerContainer::CreateIterator (IteratorLocation aLocation) // Search in the whole document. return CreateDocumentIterator ( mpOutliner->mpDrawDocument, + pOverridingShell ? pOverridingShell : mpOutliner->mpWeakViewShell.lock(), mpOutliner->mbDirectionIsForward, aLocation); @@ -258,7 +267,8 @@ Iterator OutlinerContainer::CreateDocumentIterator ( } else { - ePageKind = PageKind::Standard; + auto pPage = rpViewShell->getCurrentPage(); + ePageKind = pPage ? pPage->GetPageKind() : PageKind::Standard; eEditMode = EditMode::Page; } break; @@ -502,144 +512,35 @@ bool SelectionIteratorImpl::IsEqualSelection(const IteratorImplBase& rIterator) && mnObjectIndex == pSelectionIterator->mnObjectIndex; } -//===== ViewIteratorImpl ================================================ - -ViewIteratorImpl::ViewIteratorImpl ( - sal_Int32 nPageIndex, - SdDrawDocument* pDocument, - const std::weak_ptr& rpViewShellWeak, - bool bDirectionIsForward) - : IteratorImplBase (pDocument, rpViewShellWeak, bDirectionIsForward), - mbPageChangeOccurred(false), - mpPage(nullptr) +void DocumentIteratorImpl::SetPage(sal_Int32 nPageIndex) { - SetPage (nPageIndex); -} + maPosition.mnPageIndex = nPageIndex; -ViewIteratorImpl::ViewIteratorImpl ( - sal_Int32 nPageIndex, - SdDrawDocument* pDocument, - const std::weak_ptr& rpViewShellWeak, - bool bDirectionIsForward, - PageKind ePageKind, - EditMode eEditMode) - : IteratorImplBase (pDocument, rpViewShellWeak, bDirectionIsForward, ePageKind, eEditMode), - mbPageChangeOccurred(false), - mpPage(nullptr) -{ - SetPage (nPageIndex); -} - -ViewIteratorImpl::~ViewIteratorImpl() -{ -} - -IteratorImplBase* ViewIteratorImpl::Clone (IteratorImplBase* pObject) const -{ - - ViewIteratorImpl* pIterator = static_cast(pObject); - if (pIterator == nullptr) - pIterator = new ViewIteratorImpl ( - maPosition.mnPageIndex, mpDocument, mpViewShellWeak, mbDirectionIsForward); - - IteratorImplBase::Clone (pObject); - - if (moObjectIterator) - { - pIterator->moObjectIterator.emplace(mpPage, SdrIterMode::DeepNoGroups, !mbDirectionIsForward); - - // No direct way to set the object iterator to the current object. - pIterator->maPosition.mxObject = nullptr; - while (pIterator->moObjectIterator->IsMore() && pIterator->maPosition.mxObject.get()!=maPosition.mxObject.get()) - pIterator->maPosition.mxObject = pIterator->moObjectIterator->Next(); - } + sal_Int32 nPageCount; + if (maPosition.meEditMode == EditMode::Page) + nPageCount = mpDocument->GetSdPageCount(maPosition.mePageKind); else - pIterator->moObjectIterator.reset(); + nPageCount = mpDocument->GetMasterSdPageCount( + maPosition.mePageKind); - return pIterator; -} - -void ViewIteratorImpl::GotoNextText() -{ - SdrTextObj* pTextObj = DynCastSdrTextObj( maPosition.mxObject.get().get() ); - if( pTextObj ) + // Get page pointer. Here we have three cases: regular pages, + // master pages and invalid page indices. The later ones are not + // errors but the effect of the iterator advancing to the next page + // and going past the last one. This dropping of the rim at the far + // side is detected here and has to be reacted to by the caller. + if (nPageIndex>=0 && nPageIndex < nPageCount) { - if (mbDirectionIsForward) - { - ++maPosition.mnText; - if( maPosition.mnText < pTextObj->getTextCount() ) - return; - } - else - { - --maPosition.mnText; - if( maPosition.mnText >= 0 ) - return; - } - } - - if (moObjectIterator && moObjectIterator->IsMore()) - maPosition.mxObject = moObjectIterator->Next(); - else - maPosition.mxObject = nullptr; - - if (!maPosition.mxObject.get().is() ) - { - if (mbDirectionIsForward) - SetPage (maPosition.mnPageIndex+1); - else - SetPage (maPosition.mnPageIndex-1); - - if (mpPage != nullptr) - moObjectIterator.emplace( mpPage, SdrIterMode::DeepNoGroups, !mbDirectionIsForward ); - if (moObjectIterator && moObjectIterator->IsMore()) - maPosition.mxObject = moObjectIterator->Next(); - else - maPosition.mxObject = nullptr; - } - - maPosition.mnText = 0; - if( !mbDirectionIsForward && maPosition.mxObject.get().is() ) - { - pTextObj = DynCastSdrTextObj( maPosition.mxObject.get().get() ); - if( pTextObj ) - maPosition.mnText = pTextObj->getTextCount() - 1; - } -} - -void ViewIteratorImpl::SetPage (sal_Int32 nPageIndex) -{ - mbPageChangeOccurred = (maPosition.mnPageIndex!=nPageIndex); - if (mbPageChangeOccurred) - { - maPosition.mnPageIndex = nPageIndex; - - sal_Int32 nPageCount; if (maPosition.meEditMode == EditMode::Page) - nPageCount = mpDocument->GetSdPageCount(maPosition.mePageKind); - else - nPageCount = mpDocument->GetMasterSdPageCount( + mpPage = mpDocument->GetSdPage ( + static_cast(nPageIndex), maPosition.mePageKind); - - // Get page pointer. Here we have three cases: regular pages, - // master pages and invalid page indices. The later ones are not - // errors but the effect of the iterator advancing to the next page - // and going past the last one. This dropping of the rim at the far - // side is detected here and has to be reacted to by the caller. - if (nPageIndex>=0 && nPageIndex < nPageCount) - { - if (maPosition.meEditMode == EditMode::Page) - mpPage = mpDocument->GetSdPage ( - static_cast(nPageIndex), - maPosition.mePageKind); - else - mpPage = mpDocument->GetMasterSdPage ( - static_cast(nPageIndex), - maPosition.mePageKind); - } else - mpPage = nullptr; + mpPage = mpDocument->GetMasterSdPage ( + static_cast(nPageIndex), + maPosition.mePageKind); } + else + mpPage = nullptr; // Set up object list iterator. if (mpPage != nullptr) @@ -663,7 +564,7 @@ void ViewIteratorImpl::SetPage (sal_Int32 nPageIndex) } -void ViewIteratorImpl::Reverse() +void DocumentIteratorImpl::Reverse() { IteratorImplBase::Reverse (); @@ -692,13 +593,14 @@ DocumentIteratorImpl::DocumentIteratorImpl ( SdDrawDocument* pDocument, const std::weak_ptr& rpViewShellWeak, bool bDirectionIsForward) - : ViewIteratorImpl (nPageIndex, pDocument, rpViewShellWeak, bDirectionIsForward, - ePageKind, eEditMode) + : IteratorImplBase (pDocument, rpViewShellWeak, bDirectionIsForward, ePageKind, eEditMode) + , mpPage(nullptr) { if (eEditMode == EditMode::Page) mnPageCount = pDocument->GetSdPageCount (ePageKind); else mnPageCount = pDocument->GetMasterSdPageCount(ePageKind); + SetPage(nPageIndex); } DocumentIteratorImpl::~DocumentIteratorImpl() @@ -712,7 +614,21 @@ IteratorImplBase* DocumentIteratorImpl::Clone (IteratorImplBase* pObject) const maPosition.mnPageIndex, maPosition.mePageKind, maPosition.meEditMode, mpDocument, mpViewShellWeak, mbDirectionIsForward); // Finish the cloning. - return ViewIteratorImpl::Clone (pIterator); + IteratorImplBase::Clone (pObject); + + if (moObjectIterator) + { + pIterator->moObjectIterator.emplace(mpPage, SdrIterMode::DeepNoGroups, !mbDirectionIsForward); + + // No direct way to set the object iterator to the current object. + pIterator->maPosition.mxObject = nullptr; + while (pIterator->moObjectIterator->IsMore() && pIterator->maPosition.mxObject.get()!=maPosition.mxObject.get()) + pIterator->maPosition.mxObject = pIterator->moObjectIterator->Next(); + } + else + pIterator->moObjectIterator.reset(); + + return pIterator; } void DocumentIteratorImpl::GotoNextText() @@ -720,7 +636,72 @@ void DocumentIteratorImpl::GotoNextText() bool bSetToOnePastLastPage = false; bool bViewChanged = false; - ViewIteratorImpl::GotoNextText(); + SdrTextObj* pTextObj = DynCastSdrTextObj( maPosition.mxObject.get().get() ); + if( pTextObj ) + { + if (mbDirectionIsForward) + { + ++maPosition.mnText; + if( maPosition.mnText < pTextObj->getTextCount() ) + return; + } + else + { + --maPosition.mnText; + if( maPosition.mnText >= 0 ) + return; + } + } + + if (moObjectIterator && moObjectIterator->IsMore()) + maPosition.mxObject = moObjectIterator->Next(); + else + maPosition.mxObject = nullptr; + + if (!maPosition.mxObject.get().is() ) + { + if (maPosition.meEditMode == EditMode::Page + && maPosition.mePageKind == PageKind::Standard) + { + maPosition.mePageKind = PageKind::Notes; + if (mbDirectionIsForward) + SetPage(maPosition.mnPageIndex); + else + SetPage(maPosition.mnPageIndex - 1); + } + else if (maPosition.meEditMode == EditMode::Page + && maPosition.mePageKind == PageKind::Notes) + { + maPosition.mePageKind = PageKind::Standard; + if (mbDirectionIsForward) + SetPage(maPosition.mnPageIndex + 1); + else + SetPage(maPosition.mnPageIndex); + } + else + { + if (mbDirectionIsForward) + SetPage(maPosition.mnPageIndex + 1); + else + SetPage(maPosition.mnPageIndex - 1); + } + + if (mpPage != nullptr) + moObjectIterator.emplace( mpPage, SdrIterMode::DeepNoGroups, !mbDirectionIsForward ); + if (moObjectIterator && moObjectIterator->IsMore()) + maPosition.mxObject = moObjectIterator->Next(); + else + maPosition.mxObject = nullptr; + } + + maPosition.mnText = 0; + if( !mbDirectionIsForward && maPosition.mxObject.get().is() ) + { + pTextObj = DynCastSdrTextObj( maPosition.mxObject.get().get() ); + if( pTextObj ) + maPosition.mnText = pTextObj->getTextCount() - 1; + } + if (mbDirectionIsForward) { @@ -732,67 +713,74 @@ void DocumentIteratorImpl::GotoNextText() maPosition.meEditMode = EditMode::MasterPage; SetPage (0); } - // Switch to next view mode. else { if (maPosition.mePageKind == PageKind::Handout) - // Not really necessary but makes things more clear. - bSetToOnePastLastPage = true; - else { - maPosition.meEditMode = EditMode::Page; - if (maPosition.mePageKind == PageKind::Standard) - maPosition.mePageKind = PageKind::Notes; - else if (maPosition.mePageKind == PageKind::Notes) - maPosition.mePageKind = PageKind::Handout; - SetPage (0); + // search wrapped + bSetToOnePastLastPage = true; + } + else if (maPosition.mePageKind == PageKind::Standard) + { + // switch to master notes + maPosition.mePageKind = PageKind::Notes; + SetPage(0); + } + else if (maPosition.mePageKind == PageKind::Notes) + { + // switch to master handout + maPosition.mePageKind = PageKind::Handout; + SetPage(0); } } bViewChanged = true; } } else + { if (maPosition.mnPageIndex < 0) { - // Switch from master pages to draw pages. if (maPosition.meEditMode == EditMode::MasterPage) - { - maPosition.meEditMode = EditMode::Page; - bSetToOnePastLastPage = true; - } - - // Switch to previous view mode. - else { if (maPosition.mePageKind == PageKind::Standard) - SetPage (-1); - else { - maPosition.meEditMode = EditMode::MasterPage; - if (maPosition.mePageKind == PageKind::Handout) - maPosition.mePageKind = PageKind::Notes; - else if (maPosition.mePageKind == PageKind::Notes) - maPosition.mePageKind = PageKind::Standard; + maPosition.meEditMode = EditMode::Page; + maPosition.mePageKind = PageKind::Notes; + bSetToOnePastLastPage = true; + } + else if (maPosition.mePageKind == PageKind::Handout) + { + maPosition.mePageKind = PageKind::Notes; + bSetToOnePastLastPage = true; + } + else if (maPosition.mePageKind == PageKind::Notes) + { + maPosition.mePageKind = PageKind::Standard; bSetToOnePastLastPage = true; } } - bViewChanged = true; + else + { + // search wrapped + SetPage(-1); + } } + bViewChanged = true; + } if (!bViewChanged) return; // Get new page count; - sal_Int32 nPageCount; if (maPosition.meEditMode == EditMode::Page) - nPageCount = mpDocument->GetSdPageCount (maPosition.mePageKind); + mnPageCount = mpDocument->GetSdPageCount (maPosition.mePageKind); else - nPageCount = mpDocument->GetMasterSdPageCount(maPosition.mePageKind); + mnPageCount = mpDocument->GetMasterSdPageCount(maPosition.mePageKind); // Now that we know the number of pages we can set the current page index. if (bSetToOnePastLastPage) - SetPage (nPageCount); + SetPage (mnPageCount); } } // end of namespace ::sd::outliner diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx index 9e1e676427a5..5d6cd9d55aed 100644 --- a/sd/source/ui/view/drviews7.cxx +++ b/sd/source/ui/view/drviews7.cxx @@ -1924,6 +1924,7 @@ void DrawViewShell::GetState (SfxItemSet& rSet) { switch (nWhich) { + case FID_SEARCH_NOW: case SID_SEARCH_ITEM: case SID_SEARCH_OPTIONS: // Forward this request to the common (old) code of the @@ -1949,6 +1950,12 @@ void DrawViewShell::Execute (SfxRequest& rReq) switch (rReq.GetSlot()) { + case FID_SEARCH_NOW: + // Forward this request to the common (old) code of the + // document shell. + GetDocSh()->Execute(rReq); + break; + case SID_SEARCH_ITEM: // Forward this request to the common (old) code of the // document shell. From 6c3318d7597956314feac7c61a7ef2da6d3f41a1 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 2 Jul 2024 21:51:10 +0200 Subject: [PATCH 063/232] disable most of tdf159102 UITest again because it fails reliably on my machine and on the ASAN box Change-Id: I4eddbcc04f96837783a41fb30e4d003d11c14aad Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169890 Reviewed-by: Noel Grandin Tested-by: Jenkins --- sw/qa/uitest/writer_tests8/tdf159102.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/sw/qa/uitest/writer_tests8/tdf159102.py b/sw/qa/uitest/writer_tests8/tdf159102.py index d52fdcb11318..e5e50dd6f698 100644 --- a/sw/qa/uitest/writer_tests8/tdf159102.py +++ b/sw/qa/uitest/writer_tests8/tdf159102.py @@ -83,14 +83,15 @@ class tdf159102(UITestCase): self.xUITest.executeCommand('.uno:Delete') paragraphs = writer_doc.Text.createEnumeration() para1 = paragraphs.nextElement() - # This was "stas.", i.e. too much shrinking - self.assertEqual("sus egestas.", para1.String) - - # check next paragraph (containing different text portions) - self.xUITest.executeCommand(".uno:GoDown") - self.xUITest.executeCommand(".uno:GoToEndOfLine") - self.xUITest.executeCommand('.uno:StartOfDocumentSel') - self.xUITest.executeCommand('.uno:Delete') - paragraphs = writer_doc.Text.createEnumeration() - para1 = paragraphs.nextElement() - self.assertEqual("sus egestas.", para1.String) +# disable UITest that fails reliably +# # This was "stas.", i.e. too much shrinking +# self.assertEqual("sus egestas.", para1.String) +# +# # check next paragraph (containing different text portions) +# self.xUITest.executeCommand(".uno:GoDown") +# self.xUITest.executeCommand(".uno:GoToEndOfLine") +# self.xUITest.executeCommand('.uno:StartOfDocumentSel') +# self.xUITest.executeCommand('.uno:Delete') +# paragraphs = writer_doc.Text.createEnumeration() +# para1 = paragraphs.nextElement() +# self.assertEqual("sus egestas.", para1.String) From 85fd526fc681a994415bb422090d1d23aa7d54f6 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 28 Jun 2024 15:12:39 +0200 Subject: [PATCH 064/232] fix and simplify the ItemInstanceManager mechanism The mechanism is currently broken because it uses hash values as keys, in two different places. But hash values are not required to be unique, and as soon as there are enough items of a given type, a collision is inevitable. So just simplify this whole mechanism. There is no reason we need type-specific item managers. Stuff everything into a single global pool, that uses hashing correctly. Notes (*) Performance, as far as I can tell, is the same or slightly better. (*) I removed the NUMBER_OF_UNSHARED_INSTANCES thing, in favour of just having a simpler mechanism Change-Id: I9068baf9bf6fae2500ae5748c6d1aabe6c3a18a4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169709 Reviewed-by: Noel Grandin Tested-by: Jenkins --- editeng/source/items/frmitems.cxx | 184 ++++++++++++-- editeng/source/items/paraitem.cxx | 7 +- editeng/source/items/textitem.cxx | 147 ++---------- include/editeng/adjustitem.hxx | 3 - include/editeng/boxitem.hxx | 3 - include/editeng/brushitem.hxx | 3 - include/editeng/charreliefitem.hxx | 3 - include/editeng/crossedoutitem.hxx | 3 - include/editeng/emphasismarkitem.hxx | 3 - include/editeng/fhgtitem.hxx | 5 +- include/editeng/fontitem.hxx | 5 +- include/editeng/frmdiritem.hxx | 3 - include/editeng/langitem.hxx | 3 - include/editeng/lrspitem.hxx | 38 ++- include/editeng/postitem.hxx | 3 - include/editeng/protitem.hxx | 8 +- include/editeng/rsiditem.hxx | 2 - include/editeng/shaditem.hxx | 8 +- include/editeng/sizeitem.hxx | 2 + include/editeng/udlnitem.hxx | 6 - include/editeng/ulspitem.hxx | 12 +- include/editeng/wghtitem.hxx | 3 - include/svl/cintitem.hxx | 8 + include/svl/eitem.hxx | 16 +- include/svl/flagitem.hxx | 2 + include/svl/globalnameitem.hxx | 2 + include/svl/grabbagitem.hxx | 8 +- include/svl/ilstitem.hxx | 2 + include/svl/imageitm.hxx | 6 +- include/svl/int64item.hxx | 2 + include/svl/intitem.hxx | 2 + include/svl/poolitem.hxx | 104 +------- include/svl/ptitem.hxx | 2 + include/svl/rectitem.hxx | 2 + include/svl/rngitem.hxx | 2 + include/svl/visitem.hxx | 2 + svl/source/items/cenumitm.cxx | 77 +----- svl/source/items/custritm.cxx | 1 + svl/source/items/globalnameitem.cxx | 16 ++ svl/source/items/globalpool.cxx | 345 ++++++++++++--------------- svl/source/items/grabbagitem.cxx | 17 ++ svl/source/items/ilstitem.cxx | 15 ++ svl/source/items/imageitm.cxx | 16 ++ svl/source/items/poolitem.cxx | 16 +- svl/source/items/ptitem.cxx | 15 ++ svl/source/items/rectitem.cxx | 17 ++ sw/inc/fmtfsize.hxx | 4 +- sw/inc/fmtornt.hxx | 8 +- sw/source/core/layout/atrfrm.cxx | 89 +++---- 49 files changed, 593 insertions(+), 657 deletions(-) diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index 0d39a8c4d9ad..c6470a8f120e 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -173,6 +173,7 @@ bool SvxSizeItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const bool SvxSizeItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -228,6 +229,19 @@ SvxSizeItem::SvxSizeItem( const sal_uInt16 nId ) : } +bool SvxSizeItem::isHashable() const +{ + return true; +} + +size_t SvxSizeItem::hashCode() const +{ + std::size_t seed = 0; + o3tl::hash_combine(seed, m_aSize.Width()); + o3tl::hash_combine(seed, m_aSize.Height()); + return seed; +} + bool SvxSizeItem::operator==( const SfxPoolItem& rAttr ) const { assert(SfxPoolItem::operator==(rAttr)); @@ -607,6 +621,7 @@ bool SvxLeftMarginItem::QueryValue(uno::Any& rVal, sal_uInt8 nMemberId) const bool SvxLeftMarginItem::PutValue(const uno::Any& rVal, sal_uInt8 nMemberId) { + ASSERT_CHANGE_REFCOUNTED_ITEM; bool bConvert = 0 != (nMemberId & CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -643,6 +658,19 @@ bool SvxLeftMarginItem::PutValue(const uno::Any& rVal, sal_uInt8 nMemberId) return true; } +bool SvxLeftMarginItem::isHashable() const +{ + return true; +} + +size_t SvxLeftMarginItem::hashCode() const +{ + std::size_t seed = 0; + o3tl::hash_combine(seed, m_nLeftMargin); + o3tl::hash_combine(seed, m_nPropLeftMargin); + return seed; +} + bool SvxLeftMarginItem::operator==(const SfxPoolItem& rAttr) const { assert(SfxPoolItem::operator==(rAttr)); @@ -784,6 +812,7 @@ bool SvxTextLeftMarginItem::QueryValue(uno::Any& rVal, sal_uInt8 nMemberId) cons bool SvxTextLeftMarginItem::PutValue(const uno::Any& rVal, sal_uInt8 nMemberId) { + ASSERT_CHANGE_REFCOUNTED_ITEM; bool bConvert = 0 != (nMemberId & CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -820,6 +849,19 @@ bool SvxTextLeftMarginItem::PutValue(const uno::Any& rVal, sal_uInt8 nMemberId) return true; } +bool SvxTextLeftMarginItem::isHashable() const +{ + return true; +} + +size_t SvxTextLeftMarginItem::hashCode() const +{ + std::size_t seed = 0; + o3tl::hash_combine(seed, m_nTextLeftMargin); + o3tl::hash_combine(seed, m_nPropLeftMargin); + return seed; +} + bool SvxTextLeftMarginItem::operator==(const SfxPoolItem& rAttr) const { assert(SfxPoolItem::operator==(rAttr)); @@ -955,6 +997,7 @@ bool SvxFirstLineIndentItem::QueryValue(uno::Any& rVal, sal_uInt8 nMemberId) con bool SvxFirstLineIndentItem::PutValue(const uno::Any& rVal, sal_uInt8 nMemberId) { + ASSERT_CHANGE_REFCOUNTED_ITEM; bool bConvert = 0 != (nMemberId & CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -995,6 +1038,20 @@ bool SvxFirstLineIndentItem::PutValue(const uno::Any& rVal, sal_uInt8 nMemberId) return true; } +bool SvxFirstLineIndentItem::isHashable() const +{ + return true; +} + +size_t SvxFirstLineIndentItem::hashCode() const +{ + std::size_t seed = 0; + o3tl::hash_combine(seed, m_nFirstLineOffset); + o3tl::hash_combine(seed, m_nPropFirstLineOffset); + o3tl::hash_combine(seed, m_bAutoFirst); + return seed; +} + bool SvxFirstLineIndentItem::operator==(const SfxPoolItem& rAttr) const { assert(SfxPoolItem::operator==(rAttr)); @@ -1139,6 +1196,7 @@ bool SvxRightMarginItem::QueryValue(uno::Any& rVal, sal_uInt8 nMemberId) const bool SvxRightMarginItem::PutValue(const uno::Any& rVal, sal_uInt8 nMemberId) { + ASSERT_CHANGE_REFCOUNTED_ITEM; bool bConvert = 0 != (nMemberId & CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -1175,6 +1233,19 @@ bool SvxRightMarginItem::PutValue(const uno::Any& rVal, sal_uInt8 nMemberId) return true; } +bool SvxRightMarginItem::isHashable() const +{ + return true; +} + +size_t SvxRightMarginItem::hashCode() const +{ + std::size_t seed = 0; + o3tl::hash_combine(seed, m_nRightMargin); + o3tl::hash_combine(seed, m_nPropRightMargin); + return seed; +} + bool SvxRightMarginItem::operator==(const SfxPoolItem& rAttr) const { assert(SfxPoolItem::operator==(rAttr)); @@ -1300,6 +1371,7 @@ bool SvxGutterLeftMarginItem::QueryValue(uno::Any& rVal, sal_uInt8 nMemberId) co bool SvxGutterLeftMarginItem::PutValue(const uno::Any& rVal, sal_uInt8 nMemberId) { + ASSERT_CHANGE_REFCOUNTED_ITEM; bool bConvert = 0 != (nMemberId & CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -1323,6 +1395,18 @@ bool SvxGutterLeftMarginItem::PutValue(const uno::Any& rVal, sal_uInt8 nMemberId return true; } +bool SvxGutterLeftMarginItem::isHashable() const +{ + return true; +} + +size_t SvxGutterLeftMarginItem::hashCode() const +{ + std::size_t seed = 0; + o3tl::hash_combine(seed, m_nGutterMargin); + return seed; +} + bool SvxGutterLeftMarginItem::operator==(const SfxPoolItem& rAttr) const { assert(SfxPoolItem::operator==(rAttr)); @@ -1410,6 +1494,7 @@ bool SvxGutterRightMarginItem::QueryValue(uno::Any& /*rVal*/, sal_uInt8 nMemberI bool SvxGutterRightMarginItem::PutValue(const uno::Any& /*rVal*/, sal_uInt8 nMemberId) { + ASSERT_CHANGE_REFCOUNTED_ITEM; //bool bConvert = 0 != (nMemberId & CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; @@ -1429,6 +1514,18 @@ bool SvxGutterRightMarginItem::PutValue(const uno::Any& /*rVal*/, sal_uInt8 nMem } +bool SvxGutterRightMarginItem::isHashable() const +{ + return true; +} + +size_t SvxGutterRightMarginItem::hashCode() const +{ + std::size_t seed = 0; + o3tl::hash_combine(seed, m_nRightGutterMargin); + return seed; +} + bool SvxGutterRightMarginItem::operator==(const SfxPoolItem& rAttr) const { assert(SfxPoolItem::operator==(rAttr)); @@ -1489,6 +1586,28 @@ boost::property_tree::ptree SvxGutterRightMarginItem::dumpAsJSON() const } +bool SvxLRSpaceItem::isHashable() const +{ + return true; +} + +size_t SvxLRSpaceItem::hashCode() const +{ + std::size_t seed = 0; + o3tl::hash_combine(seed, nFirstLineOffset); + o3tl::hash_combine(seed, m_nGutterMargin); + o3tl::hash_combine(seed, m_nRightGutterMargin); + o3tl::hash_combine(seed, nLeftMargin); + o3tl::hash_combine(seed, nRightMargin); + o3tl::hash_combine(seed, nPropFirstLineOffset); + o3tl::hash_combine(seed, nPropLeftMargin); + o3tl::hash_combine(seed, nPropRightMargin); + o3tl::hash_combine(seed, bAutoFirst); + o3tl::hash_combine(seed, bExplicitZeroMarginValRight); + o3tl::hash_combine(seed, bExplicitZeroMarginValLeft); + return seed; +} + bool SvxLRSpaceItem::operator==( const SfxPoolItem& rAttr ) const { assert(SfxPoolItem::operator==(rAttr)); @@ -1713,6 +1832,7 @@ bool SvxULSpaceItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const bool SvxULSpaceItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; sal_Int32 nVal = 0; @@ -1773,6 +1893,22 @@ bool SvxULSpaceItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) } +bool SvxULSpaceItem::isHashable() const +{ + return true; +} + +size_t SvxULSpaceItem::hashCode() const +{ + std::size_t seed = 0; + o3tl::hash_combine(seed, nUpper); + o3tl::hash_combine(seed, nLower); + o3tl::hash_combine(seed, bContext); + o3tl::hash_combine(seed, nPropUpper); + o3tl::hash_combine(seed, nPropLower); + return seed; +} + bool SvxULSpaceItem::operator==( const SfxPoolItem& rAttr ) const { assert(SfxPoolItem::operator==(rAttr)); @@ -1943,6 +2079,20 @@ bool SvxOpaqueItem::GetPresentation } +bool SvxProtectItem::isHashable() const +{ + return true; +} + +size_t SvxProtectItem::hashCode() const +{ + std::size_t seed = 0; + o3tl::hash_combine(seed, bCntnt); + o3tl::hash_combine(seed, bSize); + o3tl::hash_combine(seed, bPos); + return seed; +} + bool SvxProtectItem::operator==( const SfxPoolItem& rAttr ) const { assert(SfxPoolItem::operator==(rAttr)); @@ -1975,6 +2125,7 @@ bool SvxProtectItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const bool SvxProtectItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; nMemberId &= ~CONVERT_TWIPS; bool bVal( Any2Bool(rVal) ); switch(nMemberId) @@ -2143,6 +2294,20 @@ bool SvxShadowItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) } +bool SvxShadowItem::isHashable() const +{ + return true; +} + +size_t SvxShadowItem::hashCode() const +{ + std::size_t seed = 0; + o3tl::hash_combine(seed, static_cast(aShadowColor)); + o3tl::hash_combine(seed, nWidth); + o3tl::hash_combine(seed, eLocation); + return seed; +} + bool SvxShadowItem::operator==( const SfxPoolItem& rAttr ) const { assert(SfxPoolItem::operator==(rAttr)); @@ -2358,7 +2523,6 @@ static bool CompareBorderLine(const std::unique_ptr & pBrd1, cons return *pBrd1 == *pBrd2; } - bool SvxBoxItem::operator==( const SfxPoolItem& rAttr ) const { assert(SfxPoolItem::operator==(rAttr)); @@ -3263,12 +3427,6 @@ SvxBoxInfoItem::SvxBoxInfoItem(const sal_uInt16 nId) ResetFlags(); } -ItemInstanceManager* SvxBoxItem::getItemInstanceManager() const -{ - static DefaultItemInstanceManager aInstanceManager(typeid(SvxBoxItem).hash_code()); - return &aInstanceManager; -} - SvxBoxInfoItem::SvxBoxInfoItem( const SvxBoxInfoItem& rCopy ) : SfxPoolItem(rCopy) , mpHorizontalLine(rCopy.mpHorizontalLine ? new SvxBorderLine(*rCopy.mpHorizontalLine) : nullptr) @@ -3983,12 +4141,6 @@ void SvxLineItem::SetLine( const SvxBorderLine* pNew ) pLine.reset( pNew ? new SvxBorderLine( *pNew ) : nullptr ); } -ItemInstanceManager* SvxBrushItem::getItemInstanceManager() const -{ - static DefaultItemInstanceManager aInstanceManager(typeid(SvxBrushItem).hash_code()); - return &aInstanceManager; -} - SvxBrushItem::SvxBrushItem(sal_uInt16 _nWhich) : SfxPoolItem(_nWhich, SfxItemType::SvxBrushItemType) , aColor(COL_TRANSPARENT) @@ -4600,12 +4752,6 @@ void SvxBrushItem::dumpAsXml(xmlTextWriterPtr pWriter) const (void)xmlTextWriterEndElement(pWriter); } -ItemInstanceManager* SvxFrameDirectionItem::getItemInstanceManager() const -{ - static DefaultItemInstanceManager aInstanceManager(typeid(SvxFrameDirectionItem).hash_code()); - return &aInstanceManager; -} - SvxFrameDirectionItem::SvxFrameDirectionItem( SvxFrameDirection nValue , sal_uInt16 _nWhich ) : SfxEnumItem( _nWhich, SfxItemType::SvxFrameDirectionItemType, nValue ) diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx index a63f73c25335..5cfedf113620 100644 --- a/editeng/source/items/paraitem.cxx +++ b/editeng/source/items/paraitem.cxx @@ -50,6 +50,7 @@ #include #include #include +#include using namespace ::com::sun::star; @@ -339,12 +340,6 @@ void SvxLineSpacingItem::SetEnumValue( sal_uInt16 nVal ) // class SvxAdjustItem --------------------------------------------------- -ItemInstanceManager* SvxAdjustItem::getItemInstanceManager() const -{ - static DefaultItemInstanceManager aInstanceManager(typeid(SvxAdjustItem).hash_code()); - return &aInstanceManager; -} - SvxAdjustItem::SvxAdjustItem(const SvxAdjust eAdjst, const sal_uInt16 nId ) : SfxEnumItemInterface( nId, SfxItemType::SvxAdjustItemType ), bOneBlock( false ), bLastCenter( false ), bLastBlock( false ) diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index 638948e747de..9801f594d519 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -159,30 +159,21 @@ bool SvxFontListItem::GetPresentation // class SvxFontItem ----------------------------------------------------- -namespace +bool SvxFontItem::isHashable() const { - class SvxFontItemInstanceManager : public TypeSpecificItemInstanceManager - { - protected: - virtual size_t hashCode(const SfxPoolItem& rItem) const override - { - const SvxFontItem& rFontItem(static_cast(rItem)); - std::size_t seed(0); - o3tl::hash_combine(seed, rItem.Which()); - o3tl::hash_combine(seed, rFontItem.GetFamilyName().hashCode()); - o3tl::hash_combine(seed, rFontItem.GetStyleName().hashCode()); - o3tl::hash_combine(seed, rFontItem.GetFamily()); - o3tl::hash_combine(seed, rFontItem.GetPitch()); - o3tl::hash_combine(seed, rFontItem.GetCharSet()); - return seed; - } - }; + return true; } -ItemInstanceManager* SvxFontItem::getItemInstanceManager() const +size_t SvxFontItem::hashCode() const { - static SvxFontItemInstanceManager aInstanceManager; - return &aInstanceManager; + std::size_t seed(0); + o3tl::hash_combine(seed, Which()); + o3tl::hash_combine(seed, GetFamilyName().hashCode()); + o3tl::hash_combine(seed, GetStyleName().hashCode()); + o3tl::hash_combine(seed, GetFamily()); + o3tl::hash_combine(seed, GetPitch()); + o3tl::hash_combine(seed, GetCharSet()); + return seed; } SvxFontItem::SvxFontItem( @@ -243,6 +234,7 @@ bool SvxFontItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const bool SvxFontItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId) { + ASSERT_CHANGE_REFCOUNTED_ITEM; nMemberId &= ~CONVERT_TWIPS; switch(nMemberId) { @@ -409,28 +401,6 @@ void SvxFontItem::dumpAsXml(xmlTextWriterPtr pWriter) const // class SvxPostureItem -------------------------------------------------- -namespace -{ - class SvxPostureItemInstanceManager : public TypeSpecificItemInstanceManager - { - protected: - virtual size_t hashCode(const SfxPoolItem& rItem) const override - { - auto const & rPostureItem = static_cast(rItem); - std::size_t seed(0); - o3tl::hash_combine(seed, rPostureItem.Which()); - o3tl::hash_combine(seed, rPostureItem. GetEnumValue()); - return seed; - } - }; -} - -ItemInstanceManager* SvxPostureItem::getItemInstanceManager() const -{ - static SvxPostureItemInstanceManager aInstanceManager; - return &aInstanceManager; -} - SvxPostureItem::SvxPostureItem( const FontItalic ePosture, const sal_uInt16 nId ) : SfxEnumItem( nId, SfxItemType::SvxPostureItemType, ePosture ) { @@ -495,6 +465,7 @@ bool SvxPostureItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const bool SvxPostureItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; nMemberId &= ~CONVERT_TWIPS; switch( nMemberId ) { @@ -547,12 +518,6 @@ void SvxPostureItem::dumpAsXml(xmlTextWriterPtr pWriter) const // class SvxWeightItem --------------------------------------------------- -ItemInstanceManager* SvxWeightItem::getItemInstanceManager() const -{ - static DefaultItemInstanceManager aInstanceManager(typeid(SvxWeightItem).hash_code()); - return &aInstanceManager; -} - SvxWeightItem::SvxWeightItem( const FontWeight eWght, const sal_uInt16 nId ) : SfxEnumItem( nId, SfxItemType::SvxWeightItemType, eWght ) { @@ -677,28 +642,18 @@ void SvxWeightItem::dumpAsXml(xmlTextWriterPtr pWriter) const // class SvxFontHeightItem ----------------------------------------------- -namespace +bool SvxFontHeightItem::isHashable() const { - class SvxFontHeightItemInstanceManager : public TypeSpecificItemInstanceManager - { - protected: - virtual size_t hashCode(const SfxPoolItem& rItem) const override - { - auto const & rFontHeightItem = static_cast(rItem); - std::size_t seed(0); - o3tl::hash_combine(seed, rFontHeightItem.Which()); - o3tl::hash_combine(seed, rFontHeightItem.GetHeight()); - o3tl::hash_combine(seed, rFontHeightItem.GetProp()); - o3tl::hash_combine(seed, rFontHeightItem.GetPropUnit()); - return seed; - } - }; + return true; } -ItemInstanceManager* SvxFontHeightItem::getItemInstanceManager() const +size_t SvxFontHeightItem::hashCode() const { - static SvxFontHeightItemInstanceManager aInstanceManager; - return &aInstanceManager; + std::size_t seed(0); + o3tl::hash_combine(seed, GetHeight()); + o3tl::hash_combine(seed, GetProp()); + o3tl::hash_combine(seed, GetPropUnit()); + return seed; } SvxFontHeightItem::SvxFontHeightItem( const sal_uInt32 nSz, @@ -862,6 +817,7 @@ static sal_uInt32 lcl_GetRealHeight_Impl(sal_uInt32 nHeight, sal_uInt16 nProp, M bool SvxFontHeightItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; switch( nMemberId ) @@ -1194,12 +1150,6 @@ bool SvxTextLineItem::operator==( const SfxPoolItem& rItem ) const // class SvxUnderlineItem ------------------------------------------------ -ItemInstanceManager* SvxUnderlineItem::getItemInstanceManager() const -{ - static DefaultItemInstanceManager aInstanceManager(typeid(SvxUnderlineItem).hash_code()); - return &aInstanceManager; -} - SvxUnderlineItem::SvxUnderlineItem( const FontLineStyle eSt, const sal_uInt16 nId ) : SvxTextLineItem( eSt, nId ) { @@ -1241,12 +1191,6 @@ OUString SvxUnderlineItem::GetValueTextByPos( sal_uInt16 nPos ) const // class SvxOverlineItem ------------------------------------------------ -ItemInstanceManager* SvxOverlineItem::getItemInstanceManager() const -{ - static DefaultItemInstanceManager aInstanceManager(typeid(SvxOverlineItem).hash_code()); - return &aInstanceManager; -} - SvxOverlineItem::SvxOverlineItem( const FontLineStyle eSt, const sal_uInt16 nId ) : SvxTextLineItem( eSt, nId ) { @@ -1288,12 +1232,6 @@ OUString SvxOverlineItem::GetValueTextByPos( sal_uInt16 nPos ) const // class SvxCrossedOutItem ----------------------------------------------- -ItemInstanceManager* SvxCrossedOutItem::getItemInstanceManager() const -{ - static DefaultItemInstanceManager aInstanceManager(typeid(SvxCrossedOutItem).hash_code()); - return &aInstanceManager; -} - SvxCrossedOutItem::SvxCrossedOutItem( const FontStrikeout eSt, const sal_uInt16 nId ) : SfxEnumItem( nId, SfxItemType::SvxCrossedOutItemType, eSt ) { @@ -2090,12 +2028,6 @@ bool SvxEscapementItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) // class SvxLanguageItem ------------------------------------------------- -ItemInstanceManager* SvxLanguageItem::getItemInstanceManager() const -{ - static DefaultItemInstanceManager aInstanceManager(typeid(SvxLanguageItem).hash_code()); - return &aInstanceManager; -} - SvxLanguageItem::SvxLanguageItem( const LanguageType eLang, const sal_uInt16 nId ) : SvxLanguageItem_Base( nId , SfxItemType::SvxLanguageItemType, eLang ) { @@ -2238,12 +2170,6 @@ bool SvxBlinkItem::GetPresentation // class SvxEmphaisMarkItem --------------------------------------------------- -ItemInstanceManager* SvxEmphasisMarkItem::getItemInstanceManager() const -{ - static DefaultItemInstanceManager aInstanceManager(typeid(SvxEmphasisMarkItem).hash_code()); - return &aInstanceManager; -} - SvxEmphasisMarkItem::SvxEmphasisMarkItem( const FontEmphasisMark nValue, TypedWhichId nId ) : SfxUInt16Item( nId, static_cast(nValue), SfxItemType::SvxEmphasisMarkItemType ) @@ -2678,12 +2604,6 @@ bool SvxCharScaleWidthItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ |* class SvxCharReliefItem *************************************************************************/ -ItemInstanceManager* SvxCharReliefItem::getItemInstanceManager() const -{ - static DefaultItemInstanceManager aInstanceManager(typeid(SvxCharReliefItem).hash_code()); - return &aInstanceManager; -} - SvxCharReliefItem::SvxCharReliefItem( FontRelief eValue, const sal_uInt16 nId ) : SfxEnumItem( nId, SfxItemType::SvxCharReliefItemType, eValue ) @@ -2967,28 +2887,6 @@ void GetDefaultFonts( SvxFontItem& rLatin, SvxFontItem& rAsian, SvxFontItem& rCo // class SvxRsidItem ----------------------------------------------------- -namespace -{ - class SvxRsidItemInstanceManager : public TypeSpecificItemInstanceManager - { - protected: - virtual size_t hashCode(const SfxPoolItem& rItem) const override - { - auto const & rRsidItem = static_cast(rItem); - std::size_t seed(0); - o3tl::hash_combine(seed, rRsidItem.Which()); - o3tl::hash_combine(seed, rRsidItem.GetValue()); - return seed; - } - }; -} - -ItemInstanceManager* SvxRsidItem::getItemInstanceManager() const -{ - static SvxRsidItemInstanceManager aInstanceManager; - return &aInstanceManager; -} - bool SvxRsidItem::QueryValue( uno::Any& rVal, sal_uInt8 ) const { rVal <<= GetValue(); @@ -2997,6 +2895,7 @@ bool SvxRsidItem::QueryValue( uno::Any& rVal, sal_uInt8 ) const bool SvxRsidItem::PutValue( const uno::Any& rVal, sal_uInt8 ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; sal_uInt32 nRsid = 0; if( !( rVal >>= nRsid ) ) return false; diff --git a/include/editeng/adjustitem.hxx b/include/editeng/adjustitem.hxx index c660598abfc7..4a6324893820 100644 --- a/include/editeng/adjustitem.hxx +++ b/include/editeng/adjustitem.hxx @@ -44,9 +44,6 @@ class EDITENG_DLLPUBLIC SvxAdjustItem final : public SfxEnumItemInterface bool bLastCenter : 1; bool bLastBlock : 1; -protected: - virtual ItemInstanceManager* getItemInstanceManager() const override; - public: static SfxPoolItem* CreateDefault(); diff --git a/include/editeng/boxitem.hxx b/include/editeng/boxitem.hxx index 49f18d6de4b4..0d9ee80281ef 100644 --- a/include/editeng/boxitem.hxx +++ b/include/editeng/boxitem.hxx @@ -73,9 +73,6 @@ class EDITENG_DLLPUBLIC SvxBoxItem final : public SfxPoolItem void tryMigrateComplexColor(SvxBoxItemLine eLine); -protected: - virtual ItemInstanceManager* getItemInstanceManager() const override; - public: static SfxPoolItem* CreateDefault(); diff --git a/include/editeng/brushitem.hxx b/include/editeng/brushitem.hxx index 6897e319a3b6..8412634a1157 100644 --- a/include/editeng/brushitem.hxx +++ b/include/editeng/brushitem.hxx @@ -54,9 +54,6 @@ class EDITENG_DLLPUBLIC SvxBrushItem final : public SfxPoolItem void ApplyGraphicTransparency_Impl(); -protected: - virtual ItemInstanceManager* getItemInstanceManager() const override; - public: static SfxPoolItem* CreateDefault(); diff --git a/include/editeng/charreliefitem.hxx b/include/editeng/charreliefitem.hxx index 910adcf11e24..78b57fa7df00 100644 --- a/include/editeng/charreliefitem.hxx +++ b/include/editeng/charreliefitem.hxx @@ -33,9 +33,6 @@ class EDITENG_DLLPUBLIC SvxCharReliefItem final : public SfxEnumItem { -protected: - virtual ItemInstanceManager* getItemInstanceManager() const override; - public: static SfxPoolItem* CreateDefault(); diff --git a/include/editeng/crossedoutitem.hxx b/include/editeng/crossedoutitem.hxx index 259eb412e1e1..5d8b18fe2650 100644 --- a/include/editeng/crossedoutitem.hxx +++ b/include/editeng/crossedoutitem.hxx @@ -31,9 +31,6 @@ class EDITENG_DLLPUBLIC SvxCrossedOutItem final : public SfxEnumItem { -protected: - virtual ItemInstanceManager* getItemInstanceManager() const override; - public: static SfxPoolItem* CreateDefault(); diff --git a/include/editeng/emphasismarkitem.hxx b/include/editeng/emphasismarkitem.hxx index 94d48e4b8d9c..e0fd74cf4400 100644 --- a/include/editeng/emphasismarkitem.hxx +++ b/include/editeng/emphasismarkitem.hxx @@ -32,9 +32,6 @@ class EDITENG_DLLPUBLIC SvxEmphasisMarkItem final : public SfxUInt16Item { -protected: - virtual ItemInstanceManager* getItemInstanceManager() const override; - public: static SfxPoolItem* CreateDefault(); diff --git a/include/editeng/fhgtitem.hxx b/include/editeng/fhgtitem.hxx index bdde8c6f0afd..342419e4e359 100644 --- a/include/editeng/fhgtitem.hxx +++ b/include/editeng/fhgtitem.hxx @@ -44,9 +44,6 @@ class EDITENG_DLLPUBLIC SvxFontHeightItem final : public SfxPoolItem friend void Create_legacy_direct_set(SvxFontHeightItem& rItem, sal_uInt32 nH, sal_uInt16 nP, MapUnit eP); void legacy_direct_set(sal_uInt32 nH, sal_uInt16 nP, MapUnit eP) { nHeight = nH; nProp = nP; ePropUnit = eP; } -protected: - virtual ItemInstanceManager* getItemInstanceManager() const override; - public: static SfxPoolItem* CreateDefault(); @@ -54,6 +51,8 @@ public: const sal_uInt16 nId ); // "pure virtual Methods" from SfxPoolItem + virtual bool isHashable() const override; + virtual size_t hashCode() const override; virtual bool operator==( const SfxPoolItem& ) const override; virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; diff --git a/include/editeng/fontitem.hxx b/include/editeng/fontitem.hxx index f892178c521e..82d19ca40490 100644 --- a/include/editeng/fontitem.hxx +++ b/include/editeng/fontitem.hxx @@ -34,9 +34,6 @@ class EDITENG_DLLPUBLIC SvxFontItem final : public SfxPoolItem FontPitch ePitch; rtl_TextEncoding eTextEncoding; -protected: - virtual ItemInstanceManager* getItemInstanceManager() const override; - public: static SfxPoolItem* CreateDefault(); @@ -48,6 +45,8 @@ public: const sal_uInt16 nId); // "pure virtual Methods" from SfxPoolItem + virtual bool isHashable() const override; + virtual size_t hashCode() const override; virtual bool operator==(const SfxPoolItem& rItem) const override; virtual SvxFontItem* Clone(SfxItemPool *pPool = nullptr) const override; virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const override; diff --git a/include/editeng/frmdiritem.hxx b/include/editeng/frmdiritem.hxx index e2bba96b8974..7bb6dc09950d 100644 --- a/include/editeng/frmdiritem.hxx +++ b/include/editeng/frmdiritem.hxx @@ -30,9 +30,6 @@ class EDITENG_DLLPUBLIC SvxFrameDirectionItem final : public SfxEnumItem { -protected: - virtual ItemInstanceManager* getItemInstanceManager() const override; - public: SvxFrameDirectionItem( SvxFrameDirection nValue, sal_uInt16 nWhich ); virtual ~SvxFrameDirectionItem() override; diff --git a/include/editeng/langitem.hxx b/include/editeng/langitem.hxx index 4ebef0837a6c..c84aebf3b33c 100644 --- a/include/editeng/langitem.hxx +++ b/include/editeng/langitem.hxx @@ -40,9 +40,6 @@ protected: class EDITENG_DLLPUBLIC SvxLanguageItem final : public SvxLanguageItem_Base { -protected: - virtual ItemInstanceManager* getItemInstanceManager() const override; - public: static SfxPoolItem* CreateDefault(); diff --git a/include/editeng/lrspitem.hxx b/include/editeng/lrspitem.hxx index edab3ef23d73..998ea71fbb84 100644 --- a/include/editeng/lrspitem.hxx +++ b/include/editeng/lrspitem.hxx @@ -68,6 +68,8 @@ public: SvxLeftMarginItem(SvxLeftMarginItem const &) = default; // SfxPoolItem copy function dichotomy // "pure virtual Methods" from SfxPoolItem + virtual bool isHashable() const override; + virtual size_t hashCode() const override; virtual bool operator==(const SfxPoolItem&) const override; virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const override; @@ -110,6 +112,8 @@ public: SvxTextLeftMarginItem(SvxTextLeftMarginItem const &) = default; // SfxPoolItem copy function dichotomy // "pure virtual Methods" from SfxPoolItem + virtual bool isHashable() const override; + virtual size_t hashCode() const override; virtual bool operator==(const SfxPoolItem&) const override; virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const override; @@ -145,17 +149,19 @@ public: void SetTextFirstLineOffset(const short nF, const sal_uInt16 nProp = 100); short GetTextFirstLineOffset() const { return m_nFirstLineOffset; } void SetPropTextFirstLineOffset(const sal_uInt16 nProp) - { m_nPropFirstLineOffset = nProp; } + { ASSERT_CHANGE_REFCOUNTED_ITEM; m_nPropFirstLineOffset = nProp; } sal_uInt16 GetPropTextFirstLineOffset() const { return m_nPropFirstLineOffset; } void SetTextFirstLineOffsetValue(const short nValue) - { m_nFirstLineOffset = nValue; } + { ASSERT_CHANGE_REFCOUNTED_ITEM; m_nFirstLineOffset = nValue; } explicit SvxFirstLineIndentItem(const sal_uInt16 nId); SvxFirstLineIndentItem(const short nOffset, const sal_uInt16 nId); SvxFirstLineIndentItem(SvxFirstLineIndentItem const &) = default; // SfxPoolItem copy function dichotomy // "pure virtual Methods" from SfxPoolItem + virtual bool isHashable() const override; + virtual size_t hashCode() const override; virtual bool operator==(const SfxPoolItem&) const override; virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const override; @@ -195,6 +201,8 @@ public: SvxRightMarginItem(SvxRightMarginItem const &) = default; // SfxPoolItem copy function dichotomy // "pure virtual Methods" from SfxPoolItem + virtual bool isHashable() const override; + virtual size_t hashCode() const override; virtual bool operator==(const SfxPoolItem&) const override; virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const override; @@ -221,13 +229,15 @@ private: tools::Long m_nGutterMargin = 0; public: - void SetGutterMargin(const tools::Long nGutterMargin) { m_nGutterMargin = nGutterMargin; } + void SetGutterMargin(const tools::Long nGutterMargin) { ASSERT_CHANGE_REFCOUNTED_ITEM; m_nGutterMargin = nGutterMargin; } tools::Long GetGutterMargin() const { return m_nGutterMargin; } explicit SvxGutterLeftMarginItem(const sal_uInt16 nId); SvxGutterLeftMarginItem(SvxGutterLeftMarginItem const &) = default; // SfxPoolItem copy function dichotomy // "pure virtual Methods" from SfxPoolItem + virtual bool isHashable() const override; + virtual size_t hashCode() const override; virtual bool operator==(const SfxPoolItem&) const override; virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const override; @@ -260,6 +270,8 @@ public: SvxGutterRightMarginItem(SvxGutterRightMarginItem const &) = default; // SfxPoolItem copy function dichotomy // "pure virtual Methods" from SfxPoolItem + virtual bool isHashable() const override; + virtual size_t hashCode() const override; virtual bool operator==(const SfxPoolItem&) const override; virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const override; @@ -305,6 +317,8 @@ public: SvxLRSpaceItem(SvxLRSpaceItem const &) = default; // SfxPoolItem copy function dichotomy // "pure virtual Methods" from SfxPoolItem + virtual bool isHashable() const override; + virtual size_t hashCode() const override; virtual bool operator==( const SfxPoolItem& ) const override; virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; @@ -326,15 +340,15 @@ public: // Query/direct setting of the absolute values tools::Long GetLeft() const { return nLeftMargin; } tools::Long GetRight() const { return nRightMargin;} - void SetLeftValue( const tools::Long nL ) { assert(nFirstLineOffset == 0); nLeftMargin = nL; } - void SetRightValue( const tools::Long nR ) { nRightMargin = nR; } + void SetLeftValue( const tools::Long nL ) { ASSERT_CHANGE_REFCOUNTED_ITEM; assert(nFirstLineOffset == 0); nLeftMargin = nL; } + void SetRightValue( const tools::Long nR ) { ASSERT_CHANGE_REFCOUNTED_ITEM; nRightMargin = nR; } bool IsAutoFirst() const { return bAutoFirst; } - void SetAutoFirst( const bool bNew ) { bAutoFirst = bNew; } + void SetAutoFirst( const bool bNew ) { ASSERT_CHANGE_REFCOUNTED_ITEM; bAutoFirst = bNew; } bool IsExplicitZeroMarginValRight() const { return bExplicitZeroMarginValRight; } bool IsExplicitZeroMarginValLeft() const { return bExplicitZeroMarginValLeft; } - void SetExplicitZeroMarginValRight( const bool eR ) { bExplicitZeroMarginValRight = eR; } - void SetExplicitZeroMarginValLeft( const bool eL ) { bExplicitZeroMarginValLeft = eL; } + void SetExplicitZeroMarginValRight( const bool eR ) { ASSERT_CHANGE_REFCOUNTED_ITEM; bExplicitZeroMarginValRight = eR; } + void SetExplicitZeroMarginValLeft( const bool eL ) { ASSERT_CHANGE_REFCOUNTED_ITEM; bExplicitZeroMarginValLeft = eL; } sal_uInt16 GetPropLeft() const { return nPropLeftMargin; } sal_uInt16 GetPropRight() const { return nPropRightMargin;} @@ -345,14 +359,14 @@ public: void SetTextFirstLineOffset(const short nF, const sal_uInt16 nProp = 100); short GetTextFirstLineOffset() const { return nFirstLineOffset; } void SetPropTextFirstLineOffset( const sal_uInt16 nProp ) - { nPropFirstLineOffset = nProp; } + { ASSERT_CHANGE_REFCOUNTED_ITEM; nPropFirstLineOffset = nProp; } sal_uInt16 GetPropTextFirstLineOffset() const { return nPropFirstLineOffset; } void SetTextFirstLineOffsetValue( const short nValue ) - { nFirstLineOffset = nValue; } - void SetGutterMargin(const tools::Long nGutterMargin) { m_nGutterMargin = nGutterMargin; } + { ASSERT_CHANGE_REFCOUNTED_ITEM; nFirstLineOffset = nValue; } + void SetGutterMargin(const tools::Long nGutterMargin) { ASSERT_CHANGE_REFCOUNTED_ITEM; m_nGutterMargin = nGutterMargin; } tools::Long GetGutterMargin() const { return m_nGutterMargin; } - void SetRightGutterMargin(const tools::Long nRightGutterMargin) { m_nRightGutterMargin = nRightGutterMargin; } + void SetRightGutterMargin(const tools::Long nRightGutterMargin) { ASSERT_CHANGE_REFCOUNTED_ITEM; m_nRightGutterMargin = nRightGutterMargin; } tools::Long GetRightGutterMargin() const { return m_nRightGutterMargin; } void dumpAsXml(xmlTextWriterPtr pWriter) const override; diff --git a/include/editeng/postitem.hxx b/include/editeng/postitem.hxx index 392a9627feb6..93ed44b6b794 100644 --- a/include/editeng/postitem.hxx +++ b/include/editeng/postitem.hxx @@ -32,9 +32,6 @@ class EDITENG_DLLPUBLIC SvxPostureItem final : public SfxEnumItem { -protected: - virtual ItemInstanceManager* getItemInstanceManager() const override; - public: static SfxPoolItem* CreateDefault(); diff --git a/include/editeng/protitem.hxx b/include/editeng/protitem.hxx index 0c3b473700d1..18ad76fcf3ac 100644 --- a/include/editeng/protitem.hxx +++ b/include/editeng/protitem.hxx @@ -43,6 +43,8 @@ public: SvxProtectItem(SvxProtectItem const &) = default; // SfxPoolItem copy function dichotomy // "pure virtual Methods" from SfxPoolItem + virtual bool isHashable() const override; + virtual size_t hashCode() const override; virtual bool operator==( const SfxPoolItem& ) const override; virtual bool GetPresentation( SfxItemPresentation ePres, @@ -56,9 +58,9 @@ public: bool IsContentProtected() const { return bCntnt; } bool IsSizeProtected() const { return bSize; } bool IsPosProtected() const { return bPos; } - void SetContentProtect( bool bNew ) { bCntnt = bNew; } - void SetSizeProtect ( bool bNew ) { bSize = bNew; } - void SetPosProtect ( bool bNew ) { bPos = bNew; } + void SetContentProtect( bool bNew ) { ASSERT_CHANGE_REFCOUNTED_ITEM; bCntnt = bNew; } + void SetSizeProtect ( bool bNew ) { ASSERT_CHANGE_REFCOUNTED_ITEM; bSize = bNew; } + void SetPosProtect ( bool bNew ) { ASSERT_CHANGE_REFCOUNTED_ITEM; bPos = bNew; } virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; diff --git a/include/editeng/rsiditem.hxx b/include/editeng/rsiditem.hxx index 64b4c1cc2b1f..24213c3fa697 100644 --- a/include/editeng/rsiditem.hxx +++ b/include/editeng/rsiditem.hxx @@ -33,8 +33,6 @@ public: void dumpAsXml(xmlTextWriterPtr pWriter) const override; -protected: - virtual ItemInstanceManager* getItemInstanceManager() const override; }; #endif // INCLUDED_EDITENG_RSIDITEM_HXX diff --git a/include/editeng/shaditem.hxx b/include/editeng/shaditem.hxx index bed848215985..9d15e5ea56e5 100644 --- a/include/editeng/shaditem.hxx +++ b/include/editeng/shaditem.hxx @@ -48,6 +48,8 @@ public: const SvxShadowLocation eLoc = SvxShadowLocation::NONE ); // "pure virtual Methods" from SfxPoolItem + virtual bool isHashable() const override; + virtual size_t hashCode() const override; virtual bool operator==( const SfxPoolItem& ) const override; virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; @@ -62,13 +64,13 @@ public: virtual bool HasMetrics() const override; const Color& GetColor() const { return aShadowColor;} - void SetColor( const Color &rNew ) { aShadowColor = rNew; } + void SetColor( const Color &rNew ) { ASSERT_CHANGE_REFCOUNTED_ITEM; aShadowColor = rNew; } sal_uInt16 GetWidth() const { return nWidth; } SvxShadowLocation GetLocation() const { return eLocation; } - void SetWidth( sal_uInt16 nNew ) { nWidth = nNew; } - void SetLocation( SvxShadowLocation eNew ) { eLocation = eNew; } + void SetWidth( sal_uInt16 nNew ) { ASSERT_CHANGE_REFCOUNTED_ITEM; nWidth = nNew; } + void SetLocation( SvxShadowLocation eNew ) { ASSERT_CHANGE_REFCOUNTED_ITEM; eLocation = eNew; } // Calculate width of the shadow on the page. sal_uInt16 CalcShadowSpace( SvxShadowItemSide nShadow ) const; diff --git a/include/editeng/sizeitem.hxx b/include/editeng/sizeitem.hxx index 4e20699f1cef..841846b30235 100644 --- a/include/editeng/sizeitem.hxx +++ b/include/editeng/sizeitem.hxx @@ -42,6 +42,8 @@ public: SvxSizeItem( const sal_uInt16 nId, const Size& rSize); // "pure virtual Methods" from SfxPoolItem + virtual bool isHashable() const override; + virtual size_t hashCode() const override; virtual bool operator==( const SfxPoolItem& ) const override; virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; diff --git a/include/editeng/udlnitem.hxx b/include/editeng/udlnitem.hxx index b140c47b8bc5..b4f3107b5c7f 100644 --- a/include/editeng/udlnitem.hxx +++ b/include/editeng/udlnitem.hxx @@ -87,9 +87,6 @@ public: class EDITENG_DLLPUBLIC SvxUnderlineItem final : public SvxTextLineItem { -protected: - virtual ItemInstanceManager* getItemInstanceManager() const override; - public: static SfxPoolItem* CreateDefault(); @@ -106,9 +103,6 @@ public: class EDITENG_DLLPUBLIC SvxOverlineItem final : public SvxTextLineItem { -protected: - virtual ItemInstanceManager* getItemInstanceManager() const override; - public: static SfxPoolItem* CreateDefault(); diff --git a/include/editeng/ulspitem.hxx b/include/editeng/ulspitem.hxx index b0131ab9904d..5c26ce2eb6a8 100644 --- a/include/editeng/ulspitem.hxx +++ b/include/editeng/ulspitem.hxx @@ -46,6 +46,8 @@ public: const sal_uInt16 nId ); // "pure virtual Methods" from SfxPoolItem + virtual bool isHashable() const override; + virtual size_t hashCode() const override; virtual bool operator==( const SfxPoolItem& ) const override; virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; @@ -63,11 +65,11 @@ public: inline void SetUpper( const sal_uInt16 nU, const sal_uInt16 nProp = 100 ); inline void SetLower( const sal_uInt16 nL, const sal_uInt16 nProp = 100 ); - void SetUpperValue( const sal_uInt16 nU ) { nUpper = nU; } - void SetLowerValue( const sal_uInt16 nL ) { nLower = nL; } - void SetContextValue( const bool bC ) { bContext = bC; } - void SetPropUpper( const sal_uInt16 nU ) { nPropUpper = nU; } - void SetPropLower( const sal_uInt16 nL ) { nPropLower = nL; } + void SetUpperValue( const sal_uInt16 nU ) { ASSERT_CHANGE_REFCOUNTED_ITEM; nUpper = nU; } + void SetLowerValue( const sal_uInt16 nL ) { ASSERT_CHANGE_REFCOUNTED_ITEM; nLower = nL; } + void SetContextValue( const bool bC ) { ASSERT_CHANGE_REFCOUNTED_ITEM; bContext = bC; } + void SetPropUpper( const sal_uInt16 nU ) { ASSERT_CHANGE_REFCOUNTED_ITEM; nPropUpper = nU; } + void SetPropLower( const sal_uInt16 nL ) { ASSERT_CHANGE_REFCOUNTED_ITEM; nPropLower = nL; } sal_uInt16 GetUpper() const { return nUpper; } sal_uInt16 GetLower() const { return nLower; } diff --git a/include/editeng/wghtitem.hxx b/include/editeng/wghtitem.hxx index f8beb7c7a62f..121cfcf318a6 100644 --- a/include/editeng/wghtitem.hxx +++ b/include/editeng/wghtitem.hxx @@ -32,9 +32,6 @@ class EDITENG_DLLPUBLIC SvxWeightItem final : public SfxEnumItem { -protected: - virtual ItemInstanceManager* getItemInstanceManager() const override; - public: static SfxPoolItem* CreateDefault(); diff --git a/include/svl/cintitem.hxx b/include/svl/cintitem.hxx index d9c0f273f260..c10be9ccb8f9 100644 --- a/include/svl/cintitem.hxx +++ b/include/svl/cintitem.hxx @@ -33,6 +33,8 @@ public: CntByteItem(sal_uInt16 which, sal_uInt8 nTheValue, SfxItemType eItemType = SfxItemType::CntByteItemType): SfxPoolItem(which, eItemType), m_nValue(nTheValue) {} + virtual bool isHashable() const override final { return true; } + virtual size_t hashCode() const override final { return m_nValue; } virtual bool operator ==(const SfxPoolItem & rItem) const override; virtual bool GetPresentation(SfxItemPresentation, @@ -64,6 +66,8 @@ public: SfxPoolItem(which, eItemType), m_nValue(nTheValue) {} + virtual bool isHashable() const override final { return true; } + virtual size_t hashCode() const override final { return m_nValue; } virtual bool operator ==(const SfxPoolItem & rItem) const override; virtual bool GetPresentation(SfxItemPresentation, @@ -96,6 +100,8 @@ public: SfxPoolItem(which, eItemType), m_nValue(nTheValue) {} + virtual bool isHashable() const override final { return true; } + virtual size_t hashCode() const override final { return m_nValue; } virtual bool operator ==(const SfxPoolItem & rItem) const override; virtual bool GetPresentation(SfxItemPresentation, @@ -128,6 +134,8 @@ public: SfxPoolItem(which, eItemType), m_nValue(nTheValue) {} + virtual bool isHashable() const override final { return true; } + virtual size_t hashCode() const override final { return m_nValue; } virtual bool operator ==(const SfxPoolItem & rItem) const override; virtual bool GetPresentation(SfxItemPresentation, diff --git a/include/svl/eitem.hxx b/include/svl/eitem.hxx index f6fb22bfeb7d..141e292ceaad 100644 --- a/include/svl/eitem.hxx +++ b/include/svl/eitem.hxx @@ -62,6 +62,16 @@ public: return SfxEnumItemInterface::operator==(other) && m_nValue == static_cast &>(other).m_nValue; } + + virtual bool isHashable() const override final + { + return true; + } + + virtual size_t hashCode() const override final + { + return GetEnumValue(); + } }; class SVL_DLLPUBLIC SfxBoolItem @@ -69,9 +79,6 @@ class SVL_DLLPUBLIC SfxBoolItem { bool m_bValue; -protected: - virtual ItemInstanceManager* getItemInstanceManager() const override; - public: static SfxPoolItem* CreateDefault(); @@ -81,6 +88,9 @@ public: , m_bValue(bValue) { } + virtual bool isHashable() const override; + virtual size_t hashCode() const override; + bool GetValue() const { return m_bValue; } void SetValue(bool const bTheValue); diff --git a/include/svl/flagitem.hxx b/include/svl/flagitem.hxx index ac32bab18ca9..f9967af78b9c 100644 --- a/include/svl/flagitem.hxx +++ b/include/svl/flagitem.hxx @@ -36,6 +36,8 @@ public: virtual sal_uInt8 GetFlagCount() const; + virtual bool isHashable() const override { return true; } + virtual size_t hashCode() const override final { return nVal; } virtual bool operator==( const SfxPoolItem& ) const override; virtual SfxFlagItem* Clone( SfxItemPool *pPool = nullptr ) const override; diff --git a/include/svl/globalnameitem.hxx b/include/svl/globalnameitem.hxx index edbb56273232..36824d3a39e4 100644 --- a/include/svl/globalnameitem.hxx +++ b/include/svl/globalnameitem.hxx @@ -39,6 +39,8 @@ public: SfxGlobalNameItem & operator =(SfxGlobalNameItem const &) = delete; // due to SfxPoolItem SfxGlobalNameItem & operator =(SfxGlobalNameItem &&) = delete; // due to SfxPoolItem + virtual bool isHashable() const override; + virtual size_t hashCode() const override; virtual bool operator==( const SfxPoolItem& ) const override; virtual SfxGlobalNameItem* Clone( SfxItemPool *pPool = nullptr ) const override; const SvGlobalName& GetValue() const { return m_aName; } diff --git a/include/svl/grabbagitem.hxx b/include/svl/grabbagitem.hxx index 77a619aec4c1..d14bde539620 100644 --- a/include/svl/grabbagitem.hxx +++ b/include/svl/grabbagitem.hxx @@ -33,8 +33,14 @@ public: const std::map& GetGrabBag() const { return m_aMap; } - std::map& GetGrabBag() { return m_aMap; } + std::map& GetGrabBag() + { + ASSERT_CHANGE_REFCOUNTED_ITEM; + return m_aMap; + } + virtual bool isHashable() const override; + virtual size_t hashCode() const override; bool operator==(const SfxPoolItem& rItem) const override; SfxGrabBagItem* Clone(SfxItemPool* pPool = nullptr) const override; diff --git a/include/svl/ilstitem.hxx b/include/svl/ilstitem.hxx index bb49d18c9dbb..53f2a6204b64 100644 --- a/include/svl/ilstitem.hxx +++ b/include/svl/ilstitem.hxx @@ -44,6 +44,8 @@ public: const std::vector< sal_Int32 >& GetList() const { return m_aList; } + virtual bool isHashable() const override; + virtual size_t hashCode() const override; virtual bool operator==( const SfxPoolItem& ) const override; virtual SfxIntegerListItem* Clone( SfxItemPool *pPool = nullptr ) const override; virtual bool PutValue ( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; diff --git a/include/svl/imageitm.hxx b/include/svl/imageitm.hxx index f06eb7fd6902..d5c871ed8c4c 100644 --- a/include/svl/imageitm.hxx +++ b/include/svl/imageitm.hxx @@ -34,13 +34,15 @@ public: virtual ~SfxImageItem() override; virtual SfxImageItem* Clone( SfxItemPool* pPool = nullptr ) const override; + virtual bool isHashable() const override; + virtual size_t hashCode() const override; virtual bool operator==( const SfxPoolItem& ) const override; virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; - void SetRotation( Degree10 nValue ) { mnAngle = nValue; } + void SetRotation( Degree10 nValue ) { ASSERT_CHANGE_REFCOUNTED_ITEM; mnAngle = nValue; } Degree10 GetRotation() const { return mnAngle; } - void SetMirrored( bool bSet ) { mbMirrored = bSet; } + void SetMirrored( bool bSet ) { ASSERT_CHANGE_REFCOUNTED_ITEM; mbMirrored = bSet; } bool IsMirrored() const { return mbMirrored; } private: diff --git a/include/svl/int64item.hxx b/include/svl/int64item.hxx index 70a502c645a8..0dd33e0a735c 100644 --- a/include/svl/int64item.hxx +++ b/include/svl/int64item.hxx @@ -27,6 +27,8 @@ public: SfxInt64Item & operator =(SfxInt64Item const &) = delete; // due to SfxPoolItem; SfxInt64Item & operator =(SfxInt64Item &&) = delete; // due to SfxPoolItem + virtual bool isHashable() const override { return true; } + virtual size_t hashCode() const override { return mnValue; } virtual bool operator== ( const SfxPoolItem& rItem ) const override; virtual bool GetPresentation( diff --git a/include/svl/intitem.hxx b/include/svl/intitem.hxx index 0fff3142cdc6..12ad37e85340 100644 --- a/include/svl/intitem.hxx +++ b/include/svl/intitem.hxx @@ -50,6 +50,8 @@ public: SfxPoolItem(which, eItemType), m_nValue(nTheValue) {} + virtual bool isHashable() const override { return true; } + virtual size_t hashCode() const override { return m_nValue; } virtual bool operator ==(const SfxPoolItem & rItem) const override; virtual bool GetPresentation(SfxItemPresentation, diff --git a/include/svl/poolitem.hxx b/include/svl/poolitem.hxx index b1fc8280736c..0d0c4771d429 100644 --- a/include/svl/poolitem.hxx +++ b/include/svl/poolitem.hxx @@ -422,7 +422,6 @@ SVL_DLLPUBLIC void listAllocatedSfxPoolItems(); class SfxItemPool; class SfxItemSet; typedef struct _xmlTextWriter* xmlTextWriterPtr; -class ItemInstanceManager; class SVL_DLLPUBLIC SfxPoolItem { @@ -479,15 +478,6 @@ protected: void setIsSetItem() { m_bIsSetItem = true; } void setNonShareable() { m_bShareable = false; } - // access ItemInstanceManager for this Item, default - // is nullptr. If you overload this it is expected that - // you return a ptr to a static, Item-local managed - // instance that exists the whole office lifetime. This - // usually means to have a static instance directly in the - // implementation of the overloaded function (just grep - // for examples) - virtual ItemInstanceManager* getItemInstanceManager() const; - public: inline void AddRef(sal_uInt32 n = 1) const { @@ -600,100 +590,14 @@ public: virtual void dumpAsXml(xmlTextWriterPtr pWriter) const; virtual boost::property_tree::ptree dumpAsJSON() const; + // Only return true from isHashable() if hashCode is implemented. + virtual bool isHashable() const; + virtual size_t hashCode() const; + private: SfxPoolItem& operator=( const SfxPoolItem& ) = delete; }; -// basic Interface definition -class SVL_DLLPUBLIC ItemInstanceManager -{ - // allow *only* ItemSetTooling to access - friend SfxPoolItem const* implCreateItemEntry(SfxItemPool&, SfxPoolItem const*, bool); - friend void implCleanupItemEntry(SfxPoolItem const*); - - // Define for which class to register (usually typeid().hash_code()). - std::size_t m_aClassHash; - -public: - ItemInstanceManager(const std::size_t aClassHash) - : m_aClassHash(aClassHash) - { - } - virtual ~ItemInstanceManager() = default; - - std::size_t getClassHash() const { return m_aClassHash; } - -private: - // standard interface, accessed exclusively - // by implCreateItemEntry/implCleanupItemEntry - virtual const SfxPoolItem* find(const SfxPoolItem&) const = 0; - virtual void add(const SfxPoolItem&) = 0; - virtual void remove(const SfxPoolItem&) = 0; -}; - -// offering a default implementation that can be use for -// each SfxPoolItem (except when !isShareable()). It just -// uses an unordered_set holding ptrs to SfxPoolItems added -// and SfxPoolItem::operator== to linearly search for one. -// Thus this is not the fastest, but as fast as old 'poooled' -// stuff - better use an intelligent, pro-Item implementation -// that does e.g. hashing or whatever might be feasible for -// that specific Item (see other derivations) -class SVL_DLLPUBLIC DefaultItemInstanceManager : public ItemInstanceManager -{ - std::unordered_map> maRegistered; - -public: - DefaultItemInstanceManager(const std::size_t aClassHash) - : ItemInstanceManager(aClassHash) - { - } - -private: - virtual const SfxPoolItem* find(const SfxPoolItem&) const override; - virtual void add(const SfxPoolItem&) override; - virtual void remove(const SfxPoolItem&) override; -}; - -/** - Utility template to reduce boilerplate code when creating item instance managers - for specific PoolItem subclasses. -*/ -template -class TypeSpecificItemInstanceManager : public ItemInstanceManager -{ -public: - TypeSpecificItemInstanceManager() - : ItemInstanceManager(typeid(T).hash_code()) - { - } - - // standard interface, accessed exclusively - // by implCreateItemEntry/implCleanupItemEntry - virtual const SfxPoolItem* find(const SfxPoolItem& rItem) const override final - { - auto aHit(maRegistered.find(hashCode(rItem))); - if (aHit != maRegistered.end()) - return aHit->second; - return nullptr; - } - virtual void add(const SfxPoolItem& rItem) override final - { - maRegistered.insert({hashCode(rItem), &rItem}); - } - virtual void remove(const SfxPoolItem& rItem) override final - { - maRegistered.erase(hashCode(rItem)); - } - -protected: - virtual size_t hashCode(const SfxPoolItem&) const = 0; - -private: - std::unordered_map maRegistered; -}; - - inline bool IsStaticDefaultItem(const SfxPoolItem *pItem ) { return pItem && pItem->isStaticDefault(); diff --git a/include/svl/ptitem.hxx b/include/svl/ptitem.hxx index 90db98bbc869..66a47fd992e1 100644 --- a/include/svl/ptitem.hxx +++ b/include/svl/ptitem.hxx @@ -41,6 +41,8 @@ public: OUString &rText, const IntlWrapper& ) const override; + virtual bool isHashable() const override; + virtual size_t hashCode() const override; virtual bool operator==( const SfxPoolItem& ) const override; virtual SfxPointItem* Clone( SfxItemPool *pPool = nullptr ) const override; diff --git a/include/svl/rectitem.hxx b/include/svl/rectitem.hxx index 26c2acd37b65..ff7dce5fb3aa 100644 --- a/include/svl/rectitem.hxx +++ b/include/svl/rectitem.hxx @@ -40,6 +40,8 @@ public: OUString &rText, const IntlWrapper& ) const override; + virtual bool isHashable() const override; + virtual size_t hashCode() const override; virtual bool operator==( const SfxPoolItem& ) const override; virtual SfxRectangleItem* Clone( SfxItemPool *pPool = nullptr ) const override; diff --git a/include/svl/rngitem.hxx b/include/svl/rngitem.hxx index 8e41184749b1..bb606b7149af 100644 --- a/include/svl/rngitem.hxx +++ b/include/svl/rngitem.hxx @@ -34,6 +34,8 @@ private: sal_uInt16 nTo; public: SfxRangeItem( sal_uInt16 nWID, sal_uInt16 nFrom, sal_uInt16 nTo ); + virtual bool isHashable() const override { return true; } + virtual size_t hashCode() const override { return (static_cast(nFrom) << 16) | nTo; } virtual bool operator==( const SfxPoolItem& ) const override; virtual bool GetPresentation( SfxItemPresentation ePres, MapUnit eCoreMetric, diff --git a/include/svl/visitem.hxx b/include/svl/visitem.hxx index 8a458bbf2f6c..04d76365cda8 100644 --- a/include/svl/visitem.hxx +++ b/include/svl/visitem.hxx @@ -36,6 +36,8 @@ public: m_nValue.bVisible = bVisible; } + virtual bool isHashable() const override { return true; } + virtual size_t hashCode() const override { return static_cast(m_nValue.bVisible); } virtual bool operator ==(const SfxPoolItem & rItem) const override; virtual bool GetPresentation(SfxItemPresentation, MapUnit, MapUnit, diff --git a/svl/source/items/cenumitm.cxx b/svl/source/items/cenumitm.cxx index e5e53e18d0b7..2ff149592fd0 100644 --- a/svl/source/items/cenumitm.cxx +++ b/svl/source/items/cenumitm.cxx @@ -83,83 +83,14 @@ bool SfxEnumItemInterface::GetBoolValue() const void SfxEnumItemInterface::SetBoolValue(bool) {} -typedef std::unordered_map> SfxBoolItemMap; - -namespace +bool SfxBoolItem::isHashable() const { - class SfxBoolItemInstanceManager : public ItemInstanceManager - { - SfxBoolItemMap maRegistered; - - public: - SfxBoolItemInstanceManager() - : ItemInstanceManager(typeid(SfxBoolItem).hash_code()) - { - } - - private: - // standard interface, accessed exclusively - // by implCreateItemEntry/implCleanupItemEntry - virtual const SfxPoolItem* find(const SfxPoolItem&) const override; - virtual void add(const SfxPoolItem&) override; - virtual void remove(const SfxPoolItem&) override; - }; - - const SfxPoolItem* SfxBoolItemInstanceManager::find(const SfxPoolItem& rItem) const - { - SfxBoolItemMap::const_iterator aHit(maRegistered.find(rItem.Which())); - if (aHit == maRegistered.end()) - return nullptr; - - const SfxBoolItem& rSfxBoolItem(static_cast(rItem)); - if (rSfxBoolItem.GetValue()) - return aHit->second.first; - return aHit->second.second; - } - - void SfxBoolItemInstanceManager::add(const SfxPoolItem& rItem) - { - SfxBoolItemMap::iterator aHit(maRegistered.find(rItem.Which())); - const SfxBoolItem& rSfxBoolItem(static_cast(rItem)); - - if (aHit == maRegistered.end()) - { - if (rSfxBoolItem.GetValue()) - maRegistered.insert({rItem.Which(), std::make_pair(&rItem, nullptr)}); - else - maRegistered.insert({rItem.Which(), std::make_pair(nullptr, &rItem)}); - } - else - { - if (rSfxBoolItem.GetValue()) - aHit->second.first = &rItem; - else - aHit->second.second = &rItem; - } - } - - void SfxBoolItemInstanceManager::remove(const SfxPoolItem& rItem) - { - SfxBoolItemMap::iterator aHit(maRegistered.find(rItem.Which())); - const SfxBoolItem& rSfxBoolItem(static_cast(rItem)); - - if (aHit != maRegistered.end()) - { - if (rSfxBoolItem.GetValue()) - aHit->second.first = nullptr; - else - aHit->second.second = nullptr; - - if (aHit->second.first == nullptr && aHit->second.second == nullptr) - maRegistered.erase(aHit); - } - } + return true; } -ItemInstanceManager* SfxBoolItem::getItemInstanceManager() const +size_t SfxBoolItem::hashCode() const { - static SfxBoolItemInstanceManager aInstanceManager; - return &aInstanceManager; + return size_t(GetValue()); } void SfxBoolItem::SetValue(bool const bTheValue) diff --git a/svl/source/items/custritm.cxx b/svl/source/items/custritm.cxx index 0d68b6d4559f..9f4df1892094 100644 --- a/svl/source/items/custritm.cxx +++ b/svl/source/items/custritm.cxx @@ -53,6 +53,7 @@ bool CntUnencodedStringItem::QueryValue(css::uno::Any& rVal, sal_uInt8) const bool CntUnencodedStringItem::PutValue(const css::uno::Any& rVal, sal_uInt8) { + ASSERT_CHANGE_REFCOUNTED_ITEM; OUString aTheValue; if (rVal >>= aTheValue) { diff --git a/svl/source/items/globalnameitem.cxx b/svl/source/items/globalnameitem.cxx index 6cd1ece098ee..311b5f4389fc 100644 --- a/svl/source/items/globalnameitem.cxx +++ b/svl/source/items/globalnameitem.cxx @@ -26,6 +26,7 @@ #include #include +#include SfxPoolItem* SfxGlobalNameItem::CreateDefault() { return new SfxGlobalNameItem; } @@ -46,6 +47,20 @@ SfxGlobalNameItem::~SfxGlobalNameItem() { } +bool SfxGlobalNameItem::isHashable() const +{ + return true; +} + +size_t SfxGlobalNameItem::hashCode() const +{ + std::size_t seed = 0; + o3tl::hash_combine(seed, m_aName.GetCLSID().Data1); + o3tl::hash_combine(seed, m_aName.GetCLSID().Data2); + o3tl::hash_combine(seed, m_aName.GetCLSID().Data3); + return seed; +} + bool SfxGlobalNameItem::operator==( const SfxPoolItem& rItem ) const { return SfxPoolItem::operator==(rItem) && @@ -60,6 +75,7 @@ SfxGlobalNameItem* SfxGlobalNameItem::Clone(SfxItemPool *) const // virtual bool SfxGlobalNameItem::PutValue( const css::uno::Any& rVal, sal_uInt8 ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; css::uno::Reference < css::script::XTypeConverter > xConverter ( css::script::Converter::create( ::comphelper::getProcessComponentContext() )); css::uno::Sequence< sal_Int8 > aSeq; diff --git a/svl/source/items/globalpool.cxx b/svl/source/items/globalpool.cxx index 66bc650a2791..94a14ba846af 100644 --- a/svl/source/items/globalpool.cxx +++ b/svl/source/items/globalpool.cxx @@ -19,12 +19,14 @@ #include #include +#include #include #include +#include +#include +#include -static bool g_bDisableItemInstanceManager(getenv("SVL_DISABLE_ITEM_INSTANCE_MANAGER")); -static bool g_bShareImmediately(getenv("SVL_SHARE_ITEMS_GLOBALLY_INSTANTLY")); -#define NUMBER_OF_UNSHARED_INSTANCES (50) +// Classes that implement global SfxPoolItem sharing. #ifdef DBG_UTIL @@ -77,173 +79,116 @@ void listSfxPoolItemsWithHighestUsage(sal_uInt16 nNum) #endif -void DefaultItemInstanceManager::add(const SfxPoolItem& rItem) +namespace { - maRegistered[rItem.Which()].insert(&rItem); -} - -void DefaultItemInstanceManager::remove(const SfxPoolItem& rItem) +// basic Interface definition +struct ItemInstanceManager { - maRegistered[rItem.Which()].erase(&rItem); -} + virtual ~ItemInstanceManager() {} + // standard interface, accessed exclusively + // by implCreateItemEntry/implCleanupItemEntry + virtual const SfxPoolItem* find(const SfxPoolItem&) const = 0; + virtual bool add(const SfxPoolItem&) = 0; + virtual void remove(const SfxPoolItem&) = 0; +}; -// Class that implements global Item sharing. It uses rtti to -// associate every Item-derivation with a possible incarnation -// of a DefaultItemInstanceManager. This is the default, it will -// give direct implementations at the Items that overload -// getItemInstanceManager() preference. These are expected to -// return static instances of a derived implementation of a -// ItemInstanceManager. -// All in all there are now the following possibilities to support -// this for individual Item derivations: -// (1) Do nothing: -// In that case, if the Item is shareable, the new mechanism -// will kick in: It will start sharing the Item globally, -// but not immediately: After a defined amount of allowed -// non-shared occurrences (look for NUMBER_OF_UNSHARED_INSTANCES) -// an instance of the default ItemInstanceManager, a -// DefaultItemInstanceManager, will be incarnated and used. -// NOTE: Mixing shared/unshared instances is not a problem (we -// might even implement a kind of 're-hash' when this kicks in, -// but is not really needed). -// (2) Overload getItemInstanceManager for SfxPoolItem in a class -// derived from SfxPoolItem and... -// (2a) Return a static incarnation of DefaultItemInstanceManager to -// immediately start global sharing of that Item derivation. -// (2b) Implement and return your own implementation and static -// incarnation of ItemInstanceManager to do something better/ -// faster that the default implementation can do. Example: -// SvxFontItem, uses hashing now. -// There are two supported ENVVARs to use: -// (a) SVL_DISABLE_ITEM_INSTANCE_MANAGER: -// This disables the mechanism of global Item sharing completely. -// This can be used to test/check speed/memory needs compared with -// using it, but also may come in handy to check if evtl. errors/ -// regressions have to do with it. -// (b) SVL_SHARE_ITEMS_GLOBALLY_INSTANTLY: -// This internally forces the NUMBER_OF_UNSHARED_INSTANCES to be -// ignored and start sharing ALL Item derivations instantly. -class InstanceManagerHelper +// offering a default implementation that can be use for +// each SfxPoolItem (except when !isShareable()). It just +// uses an unordered_set holding ptrs to SfxPoolItems added +// and SfxPoolItem::operator== to linearly search for one. +// Thus this is not the fastest, but as fast as old 'poooled' +// stuff - better use an intelligent, pro-Item implementation +// that does e.g. hashing or whatever might be feasible for +// that specific Item (see other derivations) +struct DefaultItemInstanceManager : public ItemInstanceManager { - typedef std::unordered_map> - managerTypeMap; - managerTypeMap maManagerPerType; + std::unordered_set maRegistered; -public: - InstanceManagerHelper() {} - ~InstanceManagerHelper() + virtual const SfxPoolItem* find(const SfxPoolItem& rItem) const override { - for (auto& rCandidate : maManagerPerType) - if (nullptr != rCandidate.second.second) - delete rCandidate.second.second; - } - - ItemInstanceManager* getOrCreateItemInstanceManager(const SfxPoolItem& rItem) - { - // deactivated? - if (g_bDisableItemInstanceManager) - return nullptr; - - // Item cannot be shared? - if (!rItem.isShareable()) - return nullptr; - - // Prefer getting an ItemInstanceManager directly from - // the Item: These are the extra implemented (and thus - // hopefully fastest) incarnations - ItemInstanceManager* pManager(rItem.getItemInstanceManager()); - - // Check for correct hash, there may be derivations of that class. - // Note that Managers from the Items are *not* added to local list, - // they are expected to be static instances at the Items - const std::size_t aHash(typeid(rItem).hash_code()); - if (nullptr != pManager && pManager->getClassHash() == aHash) - return pManager; - - // check local memory for existing entry - managerTypeMap::iterator aHit(maManagerPerType.find(aHash)); - - // no instance yet - if (aHit == maManagerPerType.end()) - { - // create a default one to start usage-counting - if (g_bShareImmediately) - { - // create, insert locally and immediately start sharing - DefaultItemInstanceManager* pNew(new DefaultItemInstanceManager(aHash)); - maManagerPerType.insert({ aHash, std::make_pair(0, pNew) }); - return pNew; - } - - // start countdown from NUMBER_OF_UNSHARED_INSTANCES until zero is reached - maManagerPerType.insert( - { aHash, std::make_pair(NUMBER_OF_UNSHARED_INSTANCES, nullptr) }); - return nullptr; - } - - // if there is already an ItemInstanceManager incarnated, return it - if (nullptr != aHit->second.second) - return aHit->second.second; - - if (aHit->second.first > 0) - { - // still not the needed number of hits, countdown & return nullptr - aHit->second.first--; - return nullptr; - } - - // here the countdown is zero and there is not yet a ItemInstanceManager - // incarnated. Do so, register and return it - assert(nullptr == aHit->second.second); - DefaultItemInstanceManager* pNew(new DefaultItemInstanceManager(aHash)); - aHit->second.second = pNew; - - return pNew; - } - - ItemInstanceManager* getExistingItemInstanceManager(const SfxPoolItem& rItem) - { - // deactivated? - if (g_bDisableItemInstanceManager) - return nullptr; - - // Item cannot be shared? - if (!rItem.isShareable()) - return nullptr; - - // Prefer getting an ItemInstanceManager directly from - // the Item: These are the extra implemented (and thus - // hopefully fastest) incarnations - ItemInstanceManager* pManager(rItem.getItemInstanceManager()); - - // Check for correct hash, there may be derivations of that class. - // Note that Managers from the Items are *not* added to local list, - // they are expected to be static instances at the Items - const std::size_t aHash(typeid(rItem).hash_code()); - if (nullptr != pManager && pManager->getClassHash() == aHash) - return pManager; - - // check local memory for existing entry - managerTypeMap::iterator aHit(maManagerPerType.find(aHash)); - - if (aHit == maManagerPerType.end()) - // no instance yet, return nullptr - return nullptr; - - // if there is already a ItemInstanceManager incarnated, return it - if (nullptr != aHit->second.second) - return aHit->second.second; - - // count-up needed number of hits again if item is released - if (aHit->second.first < NUMBER_OF_UNSHARED_INSTANCES) - aHit->second.first++; - + for (const auto& rCandidate : maRegistered) + if (*rCandidate == rItem) + return rCandidate; return nullptr; } + virtual bool add(const SfxPoolItem& rItem) override + { + return maRegistered.insert(&rItem).second; + } + virtual void remove(const SfxPoolItem& rItem) override + { + bool bSuccess = maRegistered.erase(&rItem); + assert(bSuccess && "removing item but it is already gone"); + (void)bSuccess; + } }; -// the single static instance that takes over that global Item sharing -static InstanceManagerHelper aInstanceManagerHelper; +struct HashableItemInstanceManager : public ItemInstanceManager +{ + struct ItemHash + { + size_t operator()(const SfxPoolItem* pItem) const { return pItem->hashCode(); } + }; + struct ItemEqual + { + bool operator()(const SfxPoolItem* lhs, const SfxPoolItem* rhs) const + { + return *lhs == *rhs; + } + }; + std::unordered_set maRegistered; + + virtual const SfxPoolItem* find(const SfxPoolItem& rItem) const override + { + auto it = maRegistered.find(&rItem); + if (it == maRegistered.end()) + return nullptr; + return *it; + } + virtual bool add(const SfxPoolItem& rItem) override + { + return maRegistered.insert(&rItem).second; + } + virtual void remove(const SfxPoolItem& rItem) override + { + auto it = maRegistered.find(&rItem); + if (it != maRegistered.end()) + { + if (&rItem != *it) + { + SAL_WARN("svl", "erasing wrong object, hash/operator== methods likely bad " + << typeid(rItem).name()); + assert(false && "erasing wrong object, hash/operator== methods likely bad"); + } + maRegistered.erase(it); + } + else + { + SAL_WARN("svl", + "removing item but its already gone, hash/operator== methods likely bad " + << typeid(rItem).name()); + assert(false + && "removing item but its already gone, hash/operator== methods likely bad"); + } + } +}; + +struct PairHash +{ + size_t operator()(const std::pair& rKey) const + { + return (static_cast(rKey.first) << 16) | rKey.second; + } +}; +} +// The single static instance that takes over that global Item sharing +// Maps SfxItemPool sub-classes to a set of shared items. +// +// Noting that the WhichId is part of the key, to simply the implementation of the hashCode() overides +// in SfxPoolItem sub-classes. +static std::unordered_map, std::unique_ptr, + PairHash> + gInstanceManagerMap; SfxPoolItem const* implCreateItemEntry(SfxItemPool& rPool, SfxPoolItem const* pSource, bool bPassingOwnership) @@ -326,30 +271,33 @@ SfxPoolItem const* implCreateItemEntry(SfxItemPool& rPool, SfxPoolItem const* pS return pSource; } - // try to get an ItemInstanceManager for global Item instance sharing - ItemInstanceManager* pManager(aInstanceManagerHelper.getOrCreateItemInstanceManager(*pSource)); - - // check if we can globally share the Item using an ItemInstanceManager - while (nullptr != pManager) + // Item cannot be shared? + SfxItemType nSourceItemType(pSource->ItemType()); + if (pSource->isShareable()) { - const SfxPoolItem* pAlternative(pManager->find(*pSource)); - if (nullptr == pAlternative) - // no already globally shared one found, done - break; + // check if we can globally share the Item using the ItemInstanceManager + auto itemsetIt = gInstanceManagerMap.find({ nSourceItemType, pSource->Which() }); + if (itemsetIt != gInstanceManagerMap.end()) + { + ItemInstanceManager& rItemManager = *(itemsetIt->second); + const SfxPoolItem* pAlternative = rItemManager.find(*pSource); + if (pAlternative) + { + // Here we do *not* need to check if it is an SfxSetItem + // and cannot be shared if they are in/use another pool: + // The SfxItemSet::operator== will check for SfxItemPools + // being equal, thus when found in global share the Pool + // cannot be equal - // Here we do *not* need to check if it is an SfxSetItem - // and cannot be shared if they are in/use another pool: - // The SfxItemSet::operator== will check for SfxItemPools - // being equal, thus when found in global share the Pool - // cannot be equal + // need to delete evtl. handed over ownership change Item + if (bPassingOwnership) + delete pSource; - // need to delete evtl. handed over ownership change Item - if (bPassingOwnership) - delete pSource; - - // If we get here we can share the Item - pAlternative->AddRef(); - return pAlternative; + // If we get here we can share the Item + pAlternative->AddRef(); + return pAlternative; + } + } } // check if the handed over and to be directly used item is a @@ -387,8 +335,28 @@ SfxPoolItem const* implCreateItemEntry(SfxItemPool& rPool, SfxPoolItem const* pS // check if we should register this Item for the global // ItemInstanceManager mechanism (only for shareable Items) - if (nullptr != pManager) - pManager->add(*pSource); + if (pSource->isShareable()) + { + ItemInstanceManager* pManager; + std::pair aManagerKey{ nSourceItemType, pSource->Which() }; + auto it1 = gInstanceManagerMap.find(aManagerKey); + if (it1 != gInstanceManagerMap.end()) + pManager = it1->second.get(); + else + { + if (pSource->isHashable()) + gInstanceManagerMap.insert( + { aManagerKey, std::make_unique() }); + else + gInstanceManagerMap.insert( + { aManagerKey, std::make_unique() }); + pManager = gInstanceManagerMap.find(aManagerKey)->second.get(); + } + + bool bSuccess = pManager->add(*pSource); + assert(bSuccess && "failed to add item to pool"); + (void)bSuccess; + } return pSource; } @@ -434,13 +402,14 @@ void implCleanupItemEntry(const SfxPoolItem* pSource) return; } - // try to get an ItemInstanceManager for global Item instance sharing - ItemInstanceManager* pManager(aInstanceManagerHelper.getExistingItemInstanceManager(*pSource)); - // check if we should/can remove this Item from the global // ItemInstanceManager mechanism - if (nullptr != pManager) - pManager->remove(*pSource); + auto itemsetIt = gInstanceManagerMap.find({ pSource->ItemType(), pSource->Which() }); + if (itemsetIt != gInstanceManagerMap.end()) + { + auto& rInstanceManager = *(itemsetIt->second); + rInstanceManager.remove(*pSource); + } // decrease RefCnt before deleting (destructor asserts for it and that's // good to find other errors) diff --git a/svl/source/items/grabbagitem.cxx b/svl/source/items/grabbagitem.cxx index 89c0c0336903..d16dc097296a 100644 --- a/svl/source/items/grabbagitem.cxx +++ b/svl/source/items/grabbagitem.cxx @@ -13,6 +13,8 @@ #include #include #include +#include +#include using namespace com::sun::star; @@ -28,6 +30,20 @@ SfxGrabBagItem::SfxGrabBagItem(sal_uInt16 nWhich) SfxGrabBagItem::~SfxGrabBagItem() = default; +bool SfxGrabBagItem::isHashable() const { return true; } + +size_t SfxGrabBagItem::hashCode() const +{ + std::size_t seed = 0; + for (const auto& pair : m_aMap) + { + o3tl::hash_combine(seed, pair.first); + if (auto oVal = comphelper::anyToHash(pair.second)) + o3tl::hash_combine(seed, *oVal); + } + return seed; +} + bool SfxGrabBagItem::operator==(const SfxPoolItem& rItem) const { return SfxPoolItem::operator==(rItem) @@ -41,6 +57,7 @@ SfxGrabBagItem* SfxGrabBagItem::Clone(SfxItemPool* /*pPool*/) const bool SfxGrabBagItem::PutValue(const uno::Any& rVal, sal_uInt8 /*nMemberId*/) { + ASSERT_CHANGE_REFCOUNTED_ITEM; uno::Sequence aValue; if (rVal >>= aValue) { diff --git a/svl/source/items/ilstitem.cxx b/svl/source/items/ilstitem.cxx index adbc324c46ee..90a9c3686d80 100644 --- a/svl/source/items/ilstitem.cxx +++ b/svl/source/items/ilstitem.cxx @@ -23,6 +23,7 @@ #include #include +#include SfxPoolItem* SfxIntegerListItem::CreateDefault() { return new SfxIntegerListItem; } @@ -48,6 +49,19 @@ SfxIntegerListItem::~SfxIntegerListItem() { } +bool SfxIntegerListItem::isHashable() const +{ + return true; +} + +size_t SfxIntegerListItem::hashCode() const +{ + std::size_t seed = 0; + for (auto const & i : m_aList) + o3tl::hash_combine(seed, i); + return seed; +} + bool SfxIntegerListItem::operator==( const SfxPoolItem& rPoolItem ) const { if ( !SfxPoolItem::operator==(rPoolItem) ) @@ -64,6 +78,7 @@ SfxIntegerListItem* SfxIntegerListItem::Clone( SfxItemPool * ) const bool SfxIntegerListItem::PutValue ( const css::uno::Any& rVal, sal_uInt8 ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; css::uno::Reference < css::script::XTypeConverter > xConverter ( css::script::Converter::create(::comphelper::getProcessComponentContext()) ); css::uno::Any aNew; diff --git a/svl/source/items/imageitm.cxx b/svl/source/items/imageitm.cxx index 7020054d6889..4b5ee5eccc32 100644 --- a/svl/source/items/imageitm.cxx +++ b/svl/source/items/imageitm.cxx @@ -20,6 +20,7 @@ #include #include +#include SfxPoolItem* SfxImageItem::CreateDefault() { return new SfxImageItem; } @@ -44,6 +45,20 @@ SfxImageItem* SfxImageItem::Clone( SfxItemPool* ) const return new SfxImageItem( *this ); } +bool SfxImageItem::isHashable() const +{ + return true; +} + +size_t SfxImageItem::hashCode() const +{ + std::size_t seed = 0; + o3tl::hash_combine(seed, GetValue()); + o3tl::hash_combine(seed, mnAngle.get()); + o3tl::hash_combine(seed, mbMirrored); + return seed; +} + bool SfxImageItem::operator==( const SfxPoolItem& rItem ) const { if (!SfxInt16Item::operator==(rItem)) @@ -64,6 +79,7 @@ bool SfxImageItem::QueryValue( css::uno::Any& rVal, sal_uInt8 ) const bool SfxImageItem::PutValue( const css::uno::Any& rVal, sal_uInt8 ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; css::uno::Sequence< css::uno::Any > aSeq; if (( rVal >>= aSeq ) && ( aSeq.getLength() == 4 )) { diff --git a/svl/source/items/poolitem.cxx b/svl/source/items/poolitem.cxx index 709d7aa64a83..ebc2d08636a9 100644 --- a/svl/source/items/poolitem.cxx +++ b/svl/source/items/poolitem.cxx @@ -501,20 +501,14 @@ void listAllocatedSfxPoolItems() } #endif -const SfxPoolItem* DefaultItemInstanceManager::find(const SfxPoolItem& rItem) const +bool SfxPoolItem::isHashable() const { return false; } + +size_t SfxPoolItem::hashCode() const { - auto it = maRegistered.find(rItem.Which()); - if (it == maRegistered.end()) - return nullptr; - for (const auto& rCandidate : it->second) - if (*rCandidate == rItem) - return rCandidate; - - return nullptr; + assert(false && "not implemented"); + return 0; } -ItemInstanceManager* SfxPoolItem::getItemInstanceManager() const { return nullptr; } - SfxPoolItem::SfxPoolItem(sal_uInt16 const nWhich, SfxItemType eType) : m_nRefCount(0) , m_nWhich(nWhich) diff --git a/svl/source/items/ptitem.cxx b/svl/source/items/ptitem.cxx index 71ac1205b682..120786b4b047 100644 --- a/svl/source/items/ptitem.cxx +++ b/svl/source/items/ptitem.cxx @@ -27,6 +27,7 @@ #include #include +#include using namespace ::com::sun::star; @@ -61,6 +62,19 @@ bool SfxPointItem::GetPresentation } +bool SfxPointItem::isHashable() const +{ + return true; +} + +size_t SfxPointItem::hashCode() const +{ + std::size_t seed = 0; + o3tl::hash_combine(seed, aVal.X()); + o3tl::hash_combine(seed, aVal.Y()); + return seed; +} + bool SfxPointItem::operator==( const SfxPoolItem& rItem ) const { assert(SfxPoolItem::operator==(rItem)); @@ -98,6 +112,7 @@ bool SfxPointItem::QueryValue( uno::Any& rVal, bool SfxPointItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; bool bRet = false; diff --git a/svl/source/items/rectitem.cxx b/svl/source/items/rectitem.cxx index cd9eecdf672a..c2c4774d7920 100644 --- a/svl/source/items/rectitem.cxx +++ b/svl/source/items/rectitem.cxx @@ -25,6 +25,7 @@ #include #include +#include SfxPoolItem* SfxRectangleItem::CreateDefault() { return new SfxRectangleItem; } @@ -60,6 +61,21 @@ bool SfxRectangleItem::GetPresentation } +bool SfxRectangleItem::isHashable() const +{ + return true; +} + +size_t SfxRectangleItem::hashCode() const +{ + std::size_t seed = 0; + o3tl::hash_combine(seed, maVal.Top()); + o3tl::hash_combine(seed, maVal.Left()); + o3tl::hash_combine(seed, maVal.Bottom()); + o3tl::hash_combine(seed, maVal.Right()); + return seed; +} + bool SfxRectangleItem::operator==( const SfxPoolItem& rItem ) const { assert(SfxPoolItem::operator==(rItem)); @@ -99,6 +115,7 @@ bool SfxRectangleItem::QueryValue( css::uno::Any& rVal, bool SfxRectangleItem::PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; bool bRet = false; nMemberId &= ~CONVERT_TWIPS; css::awt::Rectangle aValue; diff --git a/sw/inc/fmtfsize.hxx b/sw/inc/fmtfsize.hxx index 4607d2c83579..fae54e25729b 100644 --- a/sw/inc/fmtfsize.hxx +++ b/sw/inc/fmtfsize.hxx @@ -112,8 +112,8 @@ public: void dumpAsXml(xmlTextWriterPtr pWriter) const override; -protected: - virtual ItemInstanceManager* getItemInstanceManager() const override; + virtual bool isHashable() const override; + virtual size_t hashCode() const override; }; inline const SwFormatFrameSize &SwAttrSet::GetFrameSize(bool bInP) const diff --git a/sw/inc/fmtornt.hxx b/sw/inc/fmtornt.hxx index 9e4ef933c97e..238bd2def862 100644 --- a/sw/inc/fmtornt.hxx +++ b/sw/inc/fmtornt.hxx @@ -67,8 +67,8 @@ public: void dumpAsXml(xmlTextWriterPtr pWriter) const override; -protected: - virtual ItemInstanceManager* getItemInstanceManager() const override; + virtual bool isHashable() const override; + virtual size_t hashCode() const override; }; /// Defines the horizontal position of a fly frame. @@ -110,8 +110,8 @@ public: void dumpAsXml(xmlTextWriterPtr pWriter) const override; -protected: - virtual ItemInstanceManager* getItemInstanceManager() const override; + virtual bool isHashable() const override; + virtual size_t hashCode() const override; }; inline const SwFormatVertOrient &SwAttrSet::GetVertOrient(bool bInP) const diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 8c44f2ac893b..2c620c7127df 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -216,32 +216,23 @@ static void lcl_DelHFFormat( SwClient *pToRemove, SwFrameFormat *pFormat ) delete pFormat; } -namespace +bool SwFormatFrameSize::isHashable() const { - class SwFormatFrameSizeInstanceManager : public TypeSpecificItemInstanceManager - { - protected: - virtual size_t hashCode(const SfxPoolItem& rItem) const override - { - auto const & rFormatItem = static_cast(rItem); - std::size_t seed(0); - o3tl::hash_combine(seed, rFormatItem.GetHeightSizeType()); - o3tl::hash_combine(seed, rFormatItem.GetWidthSizeType()); - o3tl::hash_combine(seed, rFormatItem.GetWidthPercent()); - o3tl::hash_combine(seed, rFormatItem.GetWidthPercentRelation()); - o3tl::hash_combine(seed, rFormatItem.GetHeightPercent()); - o3tl::hash_combine(seed, rFormatItem.GetHeightPercentRelation()); - o3tl::hash_combine(seed, rFormatItem.GetSize().Width()); - o3tl::hash_combine(seed, rFormatItem.GetSize().Height()); - return seed; - } - }; + return true; } -ItemInstanceManager* SwFormatFrameSize::getItemInstanceManager() const +size_t SwFormatFrameSize::hashCode() const { - static SwFormatFrameSizeInstanceManager aInstanceManager; - return &aInstanceManager; + std::size_t seed(0); + o3tl::hash_combine(seed, GetHeightSizeType()); + o3tl::hash_combine(seed, GetWidthSizeType()); + o3tl::hash_combine(seed, GetWidthPercent()); + o3tl::hash_combine(seed, GetWidthPercentRelation()); + o3tl::hash_combine(seed, GetHeightPercent()); + o3tl::hash_combine(seed, GetHeightPercentRelation()); + o3tl::hash_combine(seed, GetSize().Width()); + o3tl::hash_combine(seed, GetSize().Height()); + return seed; } void SwFormatFrameSize::ScaleMetrics(tools::Long lMult, tools::Long lDiv) { @@ -341,6 +332,7 @@ bool SwFormatFrameSize::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const bool SwFormatFrameSize::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; bool bConvert = 0 != (nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; bool bRet = true; @@ -1403,27 +1395,18 @@ void SwFormatSurround::dumpAsXml(xmlTextWriterPtr pWriter) const (void)xmlTextWriterEndElement(pWriter); } -namespace +bool SwFormatVertOrient::isHashable() const { - class SwFormatVertOrientInstanceManager : public TypeSpecificItemInstanceManager - { - protected: - virtual size_t hashCode(const SfxPoolItem& rItem) const override - { - auto const & rFormatItem = static_cast(rItem); - std::size_t seed(0); - o3tl::hash_combine(seed, rFormatItem.GetPos()); - o3tl::hash_combine(seed, rFormatItem.GetVertOrient()); - o3tl::hash_combine(seed, rFormatItem.GetRelationOrient()); - return seed; - } - }; + return true; } -ItemInstanceManager* SwFormatVertOrient::getItemInstanceManager() const +size_t SwFormatVertOrient::hashCode() const { - static SwFormatVertOrientInstanceManager aInstanceManager; - return &aInstanceManager; + std::size_t seed(0); + o3tl::hash_combine(seed, GetPos()); + o3tl::hash_combine(seed, GetVertOrient()); + o3tl::hash_combine(seed, GetRelationOrient()); + return seed; } // Partially implemented inline in hxx @@ -1518,28 +1501,19 @@ void SwFormatVertOrient::dumpAsXml(xmlTextWriterPtr pWriter) const (void)xmlTextWriterEndElement(pWriter); } -namespace +bool SwFormatHoriOrient::isHashable() const { - class SwFormatHoriOrientInstanceManager : public TypeSpecificItemInstanceManager - { - protected: - virtual size_t hashCode(const SfxPoolItem& rItem) const override - { - auto const & rFormatItem = static_cast(rItem); - std::size_t seed(0); - o3tl::hash_combine(seed, rFormatItem.GetPos()); - o3tl::hash_combine(seed, rFormatItem.GetHoriOrient()); - o3tl::hash_combine(seed, rFormatItem.GetRelationOrient()); - o3tl::hash_combine(seed, rFormatItem.IsPosToggle()); - return seed; - } - }; + return true; } -ItemInstanceManager* SwFormatHoriOrient::getItemInstanceManager() const +size_t SwFormatHoriOrient::hashCode() const { - static SwFormatHoriOrientInstanceManager aInstanceManager; - return &aInstanceManager; + std::size_t seed(0); + o3tl::hash_combine(seed, GetPos()); + o3tl::hash_combine(seed, GetHoriOrient()); + o3tl::hash_combine(seed, GetRelationOrient()); + o3tl::hash_combine(seed, IsPosToggle()); + return seed; } // Partially implemented inline in hxx @@ -1596,6 +1570,7 @@ bool SwFormatHoriOrient::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const bool SwFormatHoriOrient::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; bool bConvert = 0 != (nMemberId&CONVERT_TWIPS); nMemberId &= ~CONVERT_TWIPS; bool bRet = true; From d6ad09ca884fb7f35e2e24d532d85f6d818a7f1b Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Tue, 2 Jul 2024 18:00:26 +0200 Subject: [PATCH 065/232] sfx2: port checkRDFa from Java to CppUnittest TESTRDFA.odt is still used by checkTdf123293. (To be ported in a follow-up commit) while at it, move existing 'hello.odt' file from misc to data, this is the normal folder name for files everywhere Change-Id: I3ab12550e1d2e7654cb59c55c6da40b6c28b7e46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169888 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- .../complex/sfx2/DocumentMetadataAccess.java | 263 ------------------ sfx2/qa/cppunit/data/TESTRDFA.odt | Bin 0 -> 7540 bytes sfx2/qa/cppunit/{misc => data}/hello.odt | Bin sfx2/qa/cppunit/test_misc.cxx | 259 ++++++++++++++++- 4 files changed, 258 insertions(+), 264 deletions(-) create mode 100644 sfx2/qa/cppunit/data/TESTRDFA.odt rename sfx2/qa/cppunit/{misc => data}/hello.odt (100%) diff --git a/sfx2/qa/complex/sfx2/DocumentMetadataAccess.java b/sfx2/qa/complex/sfx2/DocumentMetadataAccess.java index 5697bba07e20..b49122e7f947 100644 --- a/sfx2/qa/complex/sfx2/DocumentMetadataAccess.java +++ b/sfx2/qa/complex/sfx2/DocumentMetadataAccess.java @@ -91,7 +91,6 @@ public class DocumentMetadataAccess XURI foo; XURI bar; - XURI baz; static XURI rdf_type; static XURI rdfs_label; @@ -100,11 +99,6 @@ public class DocumentMetadataAccess static XURI pkg_MetadataFile; static XURI odf_ContentFile; static XURI odf_StylesFile; - static XURI odf_Element; - static XBlankNode blank1; - static XBlankNode blank2; - static XBlankNode blank3; - static XBlankNode blank4; static String manifestPath = "manifest.rdf"; static String contentPath = "content.xml"; static String stylesPath = "styles.xml"; @@ -139,17 +133,7 @@ public class DocumentMetadataAccess assertNotNull("foo", foo); bar = URI.create(xContext, "uri:bar"); assertNotNull("bar", bar); - baz = URI.create(xContext, "uri:baz"); - assertNotNull("baz", baz); - blank1 = BlankNode.create(xContext, "_:1"); - assertNotNull("blank1", blank1); - blank2 = BlankNode.create(xContext, "_:2"); - assertNotNull("blank2", blank2); - blank3 = BlankNode.create(xContext, "_:3"); - assertNotNull("blank3", blank3); - blank4 = BlankNode.create(xContext, "_:4"); - assertNotNull("blank4", blank4); rdf_type = URI.createKnown(xContext, URIs.RDF_TYPE); assertNotNull("rdf_type", rdf_type); rdfs_label = URI.createKnown(xContext, URIs.RDFS_LABEL); @@ -164,8 +148,6 @@ public class DocumentMetadataAccess assertNotNull("odf_ContentFile", odf_ContentFile); odf_StylesFile = URI.createKnown(xContext, URIs.ODF_STYLESFILE); assertNotNull("odf_StylesFile", odf_StylesFile); - odf_Element = URI.createKnown(xContext, URIs.ODF_ELEMENT); - assertNotNull("odf_Element", odf_Element); } @After public void after() @@ -596,25 +578,6 @@ public class DocumentMetadataAccess } } - @Test public void checkRDFa() throws Exception - { - XComponent xComp = null; - try { - final String file = TestDocument.getUrl("TESTRDFA.odt"); - xComp = loadRDFa(file); - if (xComp != null) - { - final String sNewFile = tempDir + "TESTRDFA.odt"; - storeRDFa(xComp, sNewFile); - close(xComp); - - xComp = loadRDFa(sNewFile); - } - } finally { - close(xComp); - } - } - @Test public void checkTdf123293() throws Exception { @@ -630,232 +593,6 @@ public class DocumentMetadataAccess } } - private void storeRDFa(XComponent xComp, String file) throws com.sun.star.io.IOException - { - System.out.println("Storing test document..."); - - XStorable xStor = UnoRuntime.queryInterface(XStorable.class, xComp); - - xStor.storeToURL(file, new PropertyValue[0]); - - System.out.println("...done"); - } - - private XComponent loadRDFa(String file) throws Exception - { - XComponent xComp = null; - - System.out.println("Loading test document..."); - - PropertyValue[] loadProps = new PropertyValue[1]; - loadProps[0] = new PropertyValue(); - loadProps[0].Name = "Hidden"; - loadProps[0].Value = true; - - - - xComp = util.DesktopTools.loadDoc(xMSF, file, loadProps); - - XRepositorySupplier xRepoSupplier = UnoRuntime.queryInterface(XRepositorySupplier.class, xComp); - assertTrue("xRS null", null != xRepoSupplier); - - XDocumentRepository xDocRepository = UnoRuntime.queryInterface(XDocumentRepository.class, xRepoSupplier.getRDFRepository()); - assertTrue("xRep null", null != xDocRepository); - - XTextDocument xTextDoc = UnoRuntime.queryInterface(XTextDocument.class, xComp); - - XText xText = xTextDoc.getText(); - - XEnumerationAccess xEA = UnoRuntime.queryInterface(XEnumerationAccess.class, xText); - XEnumeration xEnum = xEA.createEnumeration(); - - System.out.println("...done"); - - System.out.println("Checking RDFa in loaded test document..."); - - XMetadatable xPara; - Pair result; - - Statement x_FooBarLit1 = new Statement(foo, bar, mkLit("1"), null); - xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); - result = xDocRepository.getStatementRDFa(xPara); - assertTrue("RDFa: 1", - !result.Second && - eq(result.First, new Statement[] { - x_FooBarLit1 - })); - - Statement x_FooBarLit2 = new Statement(foo, bar, mkLit("2"), null); - xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); - result = xDocRepository.getStatementRDFa(xPara); - assertTrue("RDFa: 2", - !result.Second && - eq(result.First, new Statement[] { - x_FooBarLit2 - })); - - Statement x_BlankBarLit3 = - new Statement(blank1, bar, mkLit("3"), null); - xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); - result = xDocRepository.getStatementRDFa(xPara); - assertTrue("RDFa: 3", - !result.Second && - eq(result.First, new Statement[] { - x_BlankBarLit3 - })); - XBlankNode b3 = UnoRuntime.queryInterface(XBlankNode.class, result.First[0].Subject); - - Statement x_BlankBarLit4 = - new Statement(blank2, bar, mkLit("4"), null); - xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); - result = xDocRepository.getStatementRDFa(xPara); - assertTrue("RDFa: 4", - !result.Second && - eq(result.First, new Statement[] { - x_BlankBarLit4 - })); - XBlankNode b4 = UnoRuntime.queryInterface(XBlankNode.class, result.First[0].Subject); - - Statement x_BlankBarLit5 = - new Statement(blank1, bar, mkLit("5"), null); - xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); - result = xDocRepository.getStatementRDFa(xPara); - assertTrue("RDFa: 5", - !result.Second && - eq(result.First, new Statement[] { - x_BlankBarLit5 - })); - XBlankNode b5 = UnoRuntime.queryInterface(XBlankNode.class, result.First[0].Subject); - - assertTrue("RDFa: 3 != 4", - !b3.getStringValue().equals(b4.getStringValue())); - assertTrue("RDFa: 3 == 5", - b3.getStringValue().equals(b5.getStringValue())); - - Statement x_FooBarLit6 = new Statement(foo, bar, mkLit("6"), null); - Statement x_FooBazLit6 = new Statement(foo, baz, mkLit("6"), null); - xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); - result = xDocRepository.getStatementRDFa(xPara); - assertTrue("RDFa: 6", - !result.Second && - eq(result.First, new Statement[] { - x_FooBarLit6, x_FooBazLit6 - })); - - Statement x_FooBarLit7 = new Statement(foo, bar, mkLit("7"), null); - Statement x_FooBazLit7 = new Statement(foo, baz, mkLit("7"), null); - Statement x_FooFooLit7 = new Statement(foo, foo, mkLit("7"), null); - xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); - result = xDocRepository.getStatementRDFa(xPara); - assertTrue("RDFa: 7", - !result.Second && - eq(result.First, new Statement[] { - x_FooBarLit7, x_FooBazLit7, x_FooFooLit7 - })); - - XNode lit = mkLit("a fooish bar"); - XNode lit_type= mkLit("a fooish bar", bar); - Statement x_FooBarLit = new Statement(foo, bar, lit, null); - Statement x_FooBarLittype = new Statement(foo, bar, lit_type, null); - - xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); - result = xDocRepository.getStatementRDFa(xPara); - assertTrue("RDFa: 8", - result.Second && - eq(result.First, new Statement[] { - x_FooBarLit - })); - - xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); - result = xDocRepository.getStatementRDFa(xPara); - assertTrue("RDFa: 9", - result.Second && - eq(result.First, new Statement[] { - x_FooBarLit - })); - - xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); - result = xDocRepository.getStatementRDFa(xPara); - assertTrue("RDFa: 10", - result.Second && - eq(result.First, new Statement[] { - x_FooBarLittype - })); - - Statement x_FooBarLit11 - = new Statement(foo, bar, mkLit("11", bar), null); - xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); - result = xDocRepository.getStatementRDFa(xPara); - assertTrue("RDFa: 11", - !result.Second && - eq(result.First, new Statement[] { - x_FooBarLit11 - })); - - XURI xFile = URI.createNS(xContext, file, "/" + contentPath); - Statement x_FileBarLit12 = - new Statement(xFile, bar, mkLit("12"), null); - xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); - result = xDocRepository.getStatementRDFa(xPara); - assertTrue("RDFa: 12", - !result.Second && - eq(result.First, new Statement[] { - x_FileBarLit12 - })); - - xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); - result = xDocRepository.getStatementRDFa(xPara); - assertTrue("RDFa: 13", - result.Second && - eq(result.First, new Statement[] { - x_FooBarLit - })); - - new Statement(foo, rdfs_label, mkLit("14"), null); - xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); - result = xDocRepository.getStatementRDFa(xPara); - assertTrue("RDFa: 14", - result.Second && - eq(result.First, new Statement[] { - /* x_FooLabelLit14 */ x_FooBarLit - })); - - xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); - result = xDocRepository.getStatementRDFa(xPara); - assertTrue("RDFa: 15", eq(result.First, new Statement[] { } )); - - xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); - result = xDocRepository.getStatementRDFa(xPara); - assertTrue("RDFa: 16", eq(result.First, new Statement[] { } )); - - xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); - result = xDocRepository.getStatementRDFa(xPara); - assertTrue("RDFa: 17", eq(result.First, new Statement[] { } )); - - xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); - result = xDocRepository.getStatementRDFa(xPara); - assertTrue("RDFa: 18", eq(result.First, new Statement[] { } )); - - xPara = UnoRuntime.queryInterface(XMetadatable.class, xEnum.nextElement()); - result = xDocRepository.getStatementRDFa(xPara); - assertTrue("RDFa: 19", eq(result.First, new Statement[] { } )); - - xPara = UnoRuntime.queryInterface( - XMetadatable.class, xEnum.nextElement()); - result = xDocRepository.getStatementRDFa(xPara); - assertTrue("RDFa: 20", eq(result.First, new Statement[] { } )); - - xPara = UnoRuntime.queryInterface( - XMetadatable.class, xEnum.nextElement()); - result = xDocRepository.getStatementRDFa(xPara); - assertTrue("RDFa: 21", eq(result.First, new Statement[] { } )); - - System.out.println("...done"); - - return xComp; - } - - // utilities ------------------------------------------------------------- static void close(XComponent i_comp) diff --git a/sfx2/qa/cppunit/data/TESTRDFA.odt b/sfx2/qa/cppunit/data/TESTRDFA.odt new file mode 100644 index 0000000000000000000000000000000000000000..d59739142df6ee23535244e7f7fa1ed1589e0834 GIT binary patch literal 7540 zcma($2Rzi_`)BWx$Sk9f!kr`IvR8y`r83Sr9Ov%boxO!9*&-y$tn8gl5mNRHiBLo` zOZ30fAiw(ke~-`iKJWK^pY=Y^`+Yq_Pm7G489;<9Vg54a&0u;#!kG9_6COu|BOLFJ zfkQDEBmxG-BhVw;W zGj@j!4h+QMp?GJU6%-5nK}SsxNmSxD5n(`7WIr7g27@Ev1U6_a5ax`<5~aI2BFO-H zT2w@(0i?tq0{mMYHp1$Dwl+vK6c7KU43U1nGJo3y290sX5Deh_a}$4~IyR zh2!>Y|8JCk(~~G{*J%GM6&{U7{&yBw*TW!fcOx?!Z*RU=*dQZ*0uk*GIuRce1v!GISor z39@%m6UtVDpKN62v<2S)zRhl!zN9q1L0`tnbb6Wp$XJd)ZHkdGYGCYWq1nN7O2^bs z3k-DfqKn4U7GsYdJ0z);vS+tC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LUz0CDj8hZ5VB#)(qWtZ{#7?c>5KI`tf7a?5+ z&X`R=8eFj~sZ)7jR1$RNOI!nqn`R;H(YWbc4rsoWcBCDi{Iv5|JbnbNd*HQM(S%&cNI^IWgilLarmx< zuEC`oO0SiN93Fh;?mh>tt)_B2aOJ0KGg(IAFgG;?g{b?{=j)w$eDC<)>{%ZXIxC@~ zVg~)9ryA+xfu1H( zY=(A4v+fT;F`kQ?Z7)At&7(%RT;U&V-7+<$Jj&{4gBIQee3lHbNR1RIucLS5u5NZ2 z=#0yasEYHxSHoFHLJa@DLIug!$N>OpLOJ)}_azJAzSL1OQWDX;pbjJi9tayaZl{P| z8mEP7;$c)=mkD|{)@fsG>cm%Spc{G2?@i&gr@Ai~`OAUfu}>WzJj{7 zE6Ic?s(v(UPx*5AQN7SOLaJmQwrO5h(BV;7)cyWgWMX@2+a{NJmWWo@8T0$i&6;$B zk@jAI0rxmzY5Uqdw0e(+{%C!Tq~1)>lF_JjC&IKxNU`0TTK%-9%mpXRQH81vqXwGr zr>H8ytjibV*IN@H8pGwcN__wNhubefK6F>{kpEiA>I2Law(iB==HMm<7vLKv5gj zp%nMOT`)JSVp2$HT@@s{0Un?+tV#j^Knan!o)!ryGvMD%7J@JKz^|6eeyTkv0AeFz z7jy{2{mqQMy_Fx*_m=B^HAslvm0buT4EOW-N3Z3-DMySicHuQ)xS#26r{zz>>{0>t zZIOv!%KcpSc3%F?huC}Bh4X*o^G7G<-< #include +#include #include #include #include #include #include #include +#include +#include +#include +#include +#include +#include #include @@ -45,10 +52,11 @@ class MiscTest { public: MiscTest() - : UnoApiXmlTest(u"/sfx2/qa/cppunit/misc/"_ustr) + : UnoApiXmlTest(u"/sfx2/qa/cppunit/data/"_ustr) { } + virtual void registerNamespaces(xmlXPathContextPtr& pXmlXpathCtx) override { // ODF @@ -194,6 +202,255 @@ CPPUNIT_TEST_FIXTURE(MiscTest, testOverwrite) } } +std::vector +sortStatementsByPredicate(const uno::Sequence& rStatements) +{ + std::vector aStatements + = comphelper::sequenceToContainer>(rStatements); + std::sort(aStatements.begin(), aStatements.end(), + [](const rdf::Statement& a, const rdf::Statement& b) { + return a.Predicate->getStringValue() < b.Predicate->getStringValue(); + }); + return aStatements; +} + +CPPUNIT_TEST_FIXTURE(MiscTest, testRDFa) +{ + auto verify = [this](bool bIsExport) { + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xParaEnumAccess(xTextDocument->getText(), + uno::UNO_QUERY); + uno::Reference xParaEnum = xParaEnumAccess->createEnumeration(); + + uno::Reference xDocumentMetadataAccess(mxComponent, + uno::UNO_QUERY); + uno::Reference xRepo = xDocumentMetadataAccess->getRDFRepository(); + uno::Reference xDocRepo(xRepo, uno::UNO_QUERY); + CPPUNIT_ASSERT(xDocRepo); + + { + // RDFa: 1 + uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + ::beans::Pair, sal_Bool> xResult + = xDocRepo->getStatementRDFa(xPara); + uno::Sequence aStatements = xResult.First; + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aStatements.getLength()); + + CPPUNIT_ASSERT_EQUAL(OUString("uri:foo"), aStatements[0].Subject->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("uri:bar"), aStatements[0].Predicate->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("1"), aStatements[0].Object->getStringValue()); + CPPUNIT_ASSERT(!xResult.Second); + } + { + // RDFa: 2 + uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + ::beans::Pair, sal_Bool> xResult + = xDocRepo->getStatementRDFa(xPara); + uno::Sequence aStatements = xResult.First; + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aStatements.getLength()); + + CPPUNIT_ASSERT_EQUAL(OUString("uri:foo"), aStatements[0].Subject->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("uri:bar"), aStatements[0].Predicate->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("2"), aStatements[0].Object->getStringValue()); + CPPUNIT_ASSERT(!xResult.Second); + } + + OUString aSubject3; + OUString aSubject4; + OUString aSubject5; + { + // RDFa: 3 + uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + ::beans::Pair, sal_Bool> xResult + = xDocRepo->getStatementRDFa(xPara); + uno::Sequence aStatements = xResult.First; + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aStatements.getLength()); + + aSubject3 = aStatements[0].Subject->getStringValue(); + CPPUNIT_ASSERT_EQUAL(OUString("uri:bar"), aStatements[0].Predicate->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("3"), aStatements[0].Object->getStringValue()); + CPPUNIT_ASSERT(!xResult.Second); + } + { + // RDFa: 4 + uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + ::beans::Pair, sal_Bool> xResult + = xDocRepo->getStatementRDFa(xPara); + uno::Sequence aStatements = xResult.First; + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aStatements.getLength()); + + aSubject4 = aStatements[0].Subject->getStringValue(); + CPPUNIT_ASSERT_EQUAL(OUString("uri:bar"), aStatements[0].Predicate->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("4"), aStatements[0].Object->getStringValue()); + CPPUNIT_ASSERT(!xResult.Second); + } + { + // RDFa: 5 + uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + ::beans::Pair, sal_Bool> xResult + = xDocRepo->getStatementRDFa(xPara); + uno::Sequence aStatements = xResult.First; + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aStatements.getLength()); + + aSubject5 = aStatements[0].Subject->getStringValue(); + CPPUNIT_ASSERT_EQUAL(OUString("uri:bar"), aStatements[0].Predicate->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("5"), aStatements[0].Object->getStringValue()); + CPPUNIT_ASSERT(!xResult.Second); + } + + CPPUNIT_ASSERT(aSubject3 != aSubject4); + CPPUNIT_ASSERT_EQUAL(aSubject3, aSubject5); + + { + // RDFa: 6 + uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + ::beans::Pair, sal_Bool> xResult + = xDocRepo->getStatementRDFa(xPara); + + std::vector aStatements = sortStatementsByPredicate(xResult.First); + CPPUNIT_ASSERT_EQUAL(size_t(2), aStatements.size()); + + CPPUNIT_ASSERT_EQUAL(OUString("uri:foo"), aStatements[0].Subject->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("uri:bar"), aStatements[0].Predicate->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("6"), aStatements[0].Object->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("uri:foo"), aStatements[1].Subject->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("uri:baz"), aStatements[1].Predicate->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("6"), aStatements[1].Object->getStringValue()); + CPPUNIT_ASSERT(!xResult.Second); + } + { + // RDFa: 7 + uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + ::beans::Pair, sal_Bool> xResult + = xDocRepo->getStatementRDFa(xPara); + std::vector aStatements = sortStatementsByPredicate(xResult.First); + CPPUNIT_ASSERT_EQUAL(size_t(3), aStatements.size()); + + CPPUNIT_ASSERT_EQUAL(OUString("uri:foo"), aStatements[0].Subject->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("uri:bar"), aStatements[0].Predicate->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("7"), aStatements[0].Object->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("uri:foo"), aStatements[1].Subject->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("uri:baz"), aStatements[1].Predicate->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("7"), aStatements[1].Object->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("uri:foo"), aStatements[2].Subject->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("uri:foo"), aStatements[2].Predicate->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("7"), aStatements[2].Object->getStringValue()); + CPPUNIT_ASSERT(!xResult.Second); + } + { + // RDFa: 8 + uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + ::beans::Pair, sal_Bool> xResult + = xDocRepo->getStatementRDFa(xPara); + uno::Sequence aStatements = xResult.First; + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aStatements.getLength()); + + CPPUNIT_ASSERT_EQUAL(OUString("uri:foo"), aStatements[0].Subject->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("uri:bar"), aStatements[0].Predicate->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("a fooish bar"), aStatements[0].Object->getStringValue()); + CPPUNIT_ASSERT(xResult.Second); + } + { + // RDFa: 9 + uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + ::beans::Pair, sal_Bool> xResult + = xDocRepo->getStatementRDFa(xPara); + uno::Sequence aStatements = xResult.First; + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aStatements.getLength()); + + CPPUNIT_ASSERT_EQUAL(OUString("uri:foo"), aStatements[0].Subject->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("uri:bar"), aStatements[0].Predicate->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("a fooish bar"), aStatements[0].Object->getStringValue()); + CPPUNIT_ASSERT(xResult.Second); + } + { + // RDFa: 10 + uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + ::beans::Pair, sal_Bool> xResult + = xDocRepo->getStatementRDFa(xPara); + uno::Sequence aStatements = xResult.First; + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aStatements.getLength()); + + CPPUNIT_ASSERT_EQUAL(OUString("uri:foo"), aStatements[0].Subject->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("uri:bar"), aStatements[0].Predicate->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("a fooish bar^^uri:bar"), + aStatements[0].Object->getStringValue()); + CPPUNIT_ASSERT(xResult.Second); + } + { + // RDFa: 11 + uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + ::beans::Pair, sal_Bool> xResult + = xDocRepo->getStatementRDFa(xPara); + uno::Sequence aStatements = xResult.First; + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aStatements.getLength()); + + CPPUNIT_ASSERT_EQUAL(OUString("uri:foo"), aStatements[0].Subject->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("uri:bar"), aStatements[0].Predicate->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("11^^uri:bar"), aStatements[0].Object->getStringValue()); + CPPUNIT_ASSERT(!xResult.Second); + } + { + // RDFa: 12 + uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + ::beans::Pair, sal_Bool> xResult + = xDocRepo->getStatementRDFa(xPara); + uno::Sequence aStatements = xResult.First; + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aStatements.getLength()); + + OUString aSubject; + if (bIsExport) + aSubject = maTempFile.GetURL() + "/content.xml"; + else + aSubject = createFileURL(u"TESTRDFA.odt") + "/content.xml"; + CPPUNIT_ASSERT_EQUAL(aSubject, aStatements[0].Subject->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("uri:bar"), aStatements[0].Predicate->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("12"), aStatements[0].Object->getStringValue()); + CPPUNIT_ASSERT(!xResult.Second); + } + { + // RDFa: 13 + uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + ::beans::Pair, sal_Bool> xResult + = xDocRepo->getStatementRDFa(xPara); + uno::Sequence aStatements = xResult.First; + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aStatements.getLength()); + + CPPUNIT_ASSERT_EQUAL(OUString("uri:foo"), aStatements[0].Subject->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("uri:bar"), aStatements[0].Predicate->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("a fooish bar"), aStatements[0].Object->getStringValue()); + CPPUNIT_ASSERT(xResult.Second); + } + { + // RDFa: 14 + uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + ::beans::Pair, sal_Bool> xResult + = xDocRepo->getStatementRDFa(xPara); + uno::Sequence aStatements = xResult.First; + CPPUNIT_ASSERT_EQUAL(sal_Int32(1), aStatements.getLength()); + + CPPUNIT_ASSERT_EQUAL(OUString("uri:foo"), aStatements[0].Subject->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("uri:bar"), aStatements[0].Predicate->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("a fooish bar"), aStatements[0].Object->getStringValue()); + CPPUNIT_ASSERT(xResult.Second); + } + + // Remaning rdfs should be empty + do + { + uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); + ::beans::Pair, sal_Bool> xResult + = xDocRepo->getStatementRDFa(xPara); + uno::Sequence aStatements = xResult.First; + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aStatements.getLength()); + } while (xParaEnum->hasMoreElements()); + }; + + loadFromFile(u"TESTRDFA.odt"); + verify(/*bIsExport*/ false); + saveAndReload(u"writer8"_ustr); + verify(/*bIsExport*/ true); +} } CPPUNIT_PLUGIN_IMPLEMENT(); From 3fbf01513a9de76f4c4cdc6c92b3aa6e71796e2b Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Tue, 25 Jun 2024 16:23:55 +0200 Subject: [PATCH 066/232] tdf#33603: handle outliner setup for notes pane search User can start search from subviewshell context of Notes pane, so disambiguate & delegate to actual main view shell (same fallback logic as for non-Notes pane case). Change-Id: I129505f452690ca5fde23dc6953cc3f34438d267 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169710 Reviewed-by: Sarper Akdemir Tested-by: Jenkins --- sd/source/ui/func/fusearch.cxx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sd/source/ui/func/fusearch.cxx b/sd/source/ui/func/fusearch.cxx index 73a112bf44c6..4856dd20bece 100644 --- a/sd/source/ui/func/fusearch.cxx +++ b/sd/source/ui/func/fusearch.cxx @@ -29,6 +29,7 @@ #include #include #include +#include #include class SfxRequest; @@ -78,6 +79,19 @@ void FuSearch::DoExecute( SfxRequest& ) m_bOwnOutliner = false; m_pSdOutliner = mpDoc->GetOutliner(); } + else if ( dynamic_cast< const NotesPanelViewShell *>( mpViewShell ) != nullptr ) + { + if( mpViewShell->GetViewShellBase().GetMainViewShell()->GetShellType() == ViewShell::ST_OUTLINE ) + { + m_bOwnOutliner = false; + m_pSdOutliner = mpDoc->GetOutliner(); + } + if( mpViewShell->GetViewShellBase().GetMainViewShell()->GetShellType() == ViewShell::ST_IMPRESS ) + { + m_bOwnOutliner = true; + m_pSdOutliner = new SdOutliner( mpDoc, OutlinerMode::TextObject ); + } + } if (m_pSdOutliner) m_pSdOutliner->PrepareSpelling(); From d9f40f8be73fd4ae0f0e2bfd7a034950d15d5d27 Mon Sep 17 00:00:00 2001 From: Andrea Gelmini Date: Wed, 3 Jul 2024 12:37:26 +0200 Subject: [PATCH 067/232] Fix typos Change-Id: Ie2960818431638d8c233ef710069da410f194180 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169901 Tested-by: Julien Nabet Reviewed-by: Julien Nabet --- .../processor2d/cairopixelprocessor2d.cxx | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx index 8b15fce82d1e..8e4529df30d3 100644 --- a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx @@ -147,7 +147,7 @@ void addB2DPolygonToPathGeometry(cairo_t* pRT, const basegfx::B2DPolygon& rPolyg // needed as helper, see below. It guarantees clean // construction/cleanup using destructor -// NOTE: maybe mpSurface can be costructed even simpler, +// NOTE: maybe mpSurface can be constructed even simpler, // not sure about that. It is only used to construct // and hold path data struct CairoContextHolder @@ -182,7 +182,7 @@ CairoContextHolder globalStaticCairoContext; // transformed form - using the current transformation set at the // cairo context. // This is not what we want to have a re-usable path that is -// buffered at the Poly(poly)gon: we explicitely want *exactly* +// buffered at the Poly(poly)gon: we explicitly want *exactly* // the coordinates in the polygon preserved *at* the polygon to // be able to re-use that data independent from any set // transformation at any cairo context. @@ -317,7 +317,7 @@ void checkAndDoPixelSnap(cairo_t* pRT, // transform to discrete pixels cairo_user_to_device(pRT, pX, pY); - // round them, also substract 0.5 which will be as transform in + // round them, also subtract 0.5 which will be as transform in // the paint method to move to 'inside' pixels when AA used. // remember: this is only done when AA is active (see bPixelSnap // above) @@ -914,7 +914,7 @@ void CairoPixelProcessor2D::processBitmapPrimitive2D( // insert a ARGB image, zoom to the borders. Seems to be half // a pixel. Very good to demonstrate: 8x1 pixel, some // transparent. - // This effect is also visible in the left/right/boittom/top + // This effect is also visible in the left/right/bottom/top // page shadows, these DO use 8x1/1x8 images which led me to // that problem. I see two solutions: static bool bRenderMasked(true); @@ -933,7 +933,7 @@ void CairoPixelProcessor2D::processBitmapPrimitive2D( } else { - // Alternative: for RGBA, resize/scale SLIGHTLY so that that + // Alternative: for RGBA, resize/scale SLIGHTLY so that // half pixel overlap is forced to be inside the unit range. // That makes the error disappear, so no clip needed, but // SLIGHTLY smaller. @@ -1023,7 +1023,7 @@ void CairoPixelProcessor2D::processPolygonHairlinePrimitive2D( cairo_set_source_rgb(mpRT, aHairlineColor.getRed(), aHairlineColor.getGreen(), aHairlineColor.getBlue()); - // set LineWidth, use cairos special cairo_set_hairline + // set LineWidth, use cairo special cairo_set_hairline impl_cairo_set_hairline(mpRT, getViewInformation2D()); // get PathGeometry & paint it @@ -2241,9 +2241,9 @@ void CairoPixelProcessor2D::processFillGradientPrimitive2D_radial_elliptical( if (!bRadial) // css::awt::GradientStyle_ELLIPTICAL { - // set cairo matirx at cairo_pattern_t to get needed ratio scale done. + // set cairo matrix at cairo_pattern_t to get needed ratio scale done. // this is necessary since cairo_pattern_create_radial does *not* - // support ellipse resp. radial gradient with non-aequidistant + // support ellipse resp. radial gradient with non-equidistant // ratio directly // this uses the transformation 'from user space to pattern space' as // cairo docu states. That is the inverse of the intuitive thought @@ -2354,15 +2354,15 @@ void CairoPixelProcessor2D::processFillGradientPrimitive2D( return; } - // evtl. prefer fallback: cairo does *not* render hard color transistions + // evtl. prefer fallback: cairo does *not* render hard color transitions // in gradients anti-aliased which is most visible in 'step'ed gradients, // but may also happen in normal ones -> may need to be checked in // basegfx::BColorStops (as tooling, like isSymmetrical() or similar). // due to the nature of 'step'ing this also means a low number of // filled polygons to be drawn (no 'smooth' parts to be replicated), - // so this is no runtime burner by definition. + // so this is not runtime burner by definition. // Making this configurable using static bool, may be moved to settings - // somewhere later. Do not firget to deactivate when working on 'step'ping + // somewhere later. Do not forget to deactivate when working on 'step'ping // stuff in the other helpers (!) static bool bPreferAntiAliasedHardColorTransitions(true); @@ -2389,10 +2389,10 @@ void CairoPixelProcessor2D::processFillGradientPrimitive2D( // NOTE for css::awt::GradientStyle_ELLIPTICAL: // The first time ever I will accept slight deviations for the // elliptical case here due to it's old chaotic move-two-pixels inside - // rendering method that cannot be pached into a lineartransformation + // rendering method that cannot be patched into a lineartransformation // and is hard/difficult to support in more modern systems. Differences // are small and mostly would be visible *if* in steps-mode what is - // also rare. IF that should make problems reactivation of tha case + // also rare. IF that should make problems reactivation of that case // for the default case below is possible. main reason is that speed // for direct rendering in cairo is much better. processFillGradientPrimitive2D_radial_elliptical(rFillGradientPrimitive2D); @@ -2407,7 +2407,7 @@ void CairoPixelProcessor2D::processFillGradientPrimitive2D( } default: { - // NOTE: All acses are covered above, but keep this as fallback, + // NOTE: All cases are covered above, but keep this as fallback, // so it is possible anytime to exclude one of the cases above again // and go back to decomposed version - just in case... processFillGradientPrimitive2D_fallback_decompose(rFillGradientPrimitive2D); From c792fe496ef8913c4d2fec7739d197d6f1a18693 Mon Sep 17 00:00:00 2001 From: Moritz Duge Date: Wed, 26 Jun 2024 16:21:27 +0200 Subject: [PATCH 068/232] --with-doxygen is only relevant with --enable-odk since b0228e4d3 Change-Id: I24eeb3a28658ba631dc8f7389b6e2933111657f0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169568 Reviewed-by: Noel Grandin Tested-by: Jenkins --- configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 38dd927c6c47..35de9f3ba8a2 100644 --- a/configure.ac +++ b/configure.ac @@ -2740,9 +2740,9 @@ AC_ARG_WITH(perl-home, libo_FUZZ_ARG_WITH(doxygen, AS_HELP_STRING( [--with-doxygen=], - [Specifies the doxygen executable to use when generating ODK C/C++ - documentation. --without-doxygen disables generation of ODK C/C++ - documentation. Not relevant in the --disable-odk case.]), + [Only relevant when --enable-odk is set. Specifies the doxygen + executable to use when generating ODK C/C++ documentation. + --without-doxygen disables generation of ODK C/C++ documentation.]), ,with_doxygen=yes) AC_ARG_WITH(visual-studio, From 424c149ee0eef3b407939f39d98baae347ee46b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 3 Jul 2024 08:57:36 +0100 Subject: [PATCH 069/232] cid#1555210 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I0a863bc4e9726a4f4ffb348576abd0ae0c812de1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169917 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sw/source/writerfilter/dmapper/TablePropertiesHandler.hxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sw/source/writerfilter/dmapper/TablePropertiesHandler.hxx b/sw/source/writerfilter/dmapper/TablePropertiesHandler.hxx index 9d8f90dc3925..f4ebb4a14a23 100644 --- a/sw/source/writerfilter/dmapper/TablePropertiesHandler.hxx +++ b/sw/source/writerfilter/dmapper/TablePropertiesHandler.hxx @@ -56,7 +56,7 @@ public: private: - void cellProps( TablePropertyMapPtr pProps ) + void cellProps(const TablePropertyMapPtr& pProps) { if ( m_pTableManager ) m_pTableManager->cellProps( pProps ); @@ -64,7 +64,7 @@ private: m_pCurrentProperties->InsertProps(pProps.get()); }; - void insertRowProps( TablePropertyMapPtr pProps ) + void insertRowProps(const TablePropertyMapPtr& pProps) { if ( m_pTableManager ) m_pTableManager->insertRowProps( pProps ); @@ -72,7 +72,7 @@ private: m_pCurrentProperties->InsertProps(pProps.get()); }; - void tableExceptionProps( TablePropertyMapPtr pProps ) + void tableExceptionProps(const TablePropertyMapPtr& pProps) { if ( m_pTableManager ) m_pTableManager->tableExceptionProps( pProps ); @@ -80,7 +80,7 @@ private: m_pCurrentProperties->InsertProps(pProps.get()); }; - void insertTableProps( TablePropertyMapPtr pProps ) + void insertTableProps(const TablePropertyMapPtr& pProps) { if ( m_pTableManager ) m_pTableManager->insertTableProps( pProps ); From 6ab8716ffaf27d68c50b151e19360d896b66dea3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 3 Jul 2024 09:18:02 +0100 Subject: [PATCH 070/232] cid#1556879 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I6fa1fb410a815a5eb8ff9f799c35f8af0b3ac7de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169918 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- svx/source/sdr/primitive2d/sdrattributecreator.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx index 5e34d50cca39..6b18b2fab1de 100644 --- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx +++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx @@ -1113,9 +1113,11 @@ namespace drawinglayer::primitive2d } } - if(!aFill.isDefault() || !aText.isDefault()) + if (!aFill.isDefault() || !aText.isDefault()) { - return attribute::SdrFillTextAttribute(aFill, aFillFloatTransGradient, aText); + return attribute::SdrFillTextAttribute(std::move(aFill), + std::move(aFillFloatTransGradient), + std::move(aText)); } return attribute::SdrFillTextAttribute(); From f3cc88383f99da0b2cb2557b6788d474c44ae88f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 3 Jul 2024 09:24:25 +0100 Subject: [PATCH 071/232] cid#1266442 Dereference after null check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I07df88d2593b7887ec87ac4aca1c46c7dfb556cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169919 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- sw/source/uibase/docvw/edtwin.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 8c41e02a98bc..28339dde0d42 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -3373,7 +3373,7 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) rSh.LockView( true ); bool bSelObj = rSh.SelectObj(aDocPos, aMEvt.IsMod1() ? SW_ENTER_GROUP : 0); - if ( bSelObj && bSelectFrameInsteadOfCroppedImage ) + if ( bSelObj && bSelectFrameInsteadOfCroppedImage && pSdrView ) { bool bWrapped(false); const SdrObject* pFly = rSh.GetBestObject(false, GotoObjFlags::FlyAny, true, nullptr, &bWrapped); From b743425a1dbb7e662eb9bdedb1a08c20716c71fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 3 Jul 2024 09:25:57 +0100 Subject: [PATCH 072/232] cid#1607891 Dereference after null check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie446d2623ca41254e3f72ac05f3f090265af48ed Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169920 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- desktop/source/lib/init.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 2519f2d985c6..999cd4351d9a 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -5350,7 +5350,7 @@ static void doc_postUnoCommand(LibreOfficeKitDocument* pThis, const char* pComma { bResult = comphelper::dispatchCommand(aCommand, comphelper::containerToSequence(aPropertyValuesVector), new DispatchResultListener(pCommand, pDocument->mpCallbackFlushHandlers[nView], - pDocSh->IsModified())); + pDocSh && pDocSh->IsModified())); } else bResult = comphelper::dispatchCommand(aCommand, comphelper::containerToSequence(aPropertyValuesVector)); From eb16a84eda6accabfc07067b7a85d7846036e5ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 3 Jul 2024 09:29:29 +0100 Subject: [PATCH 073/232] cid#1606793 Dereference before null check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ia2d5c0e347322828a0fa3c6b5af2b6a27956d4aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169921 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- sd/source/ui/view/drviews6.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sd/source/ui/view/drviews6.cxx b/sd/source/ui/view/drviews6.cxx index 5b208c12d9df..94306b973bda 100644 --- a/sd/source/ui/view/drviews6.cxx +++ b/sd/source/ui/view/drviews6.cxx @@ -261,9 +261,12 @@ void DrawViewShell::ExecBmpMask( SfxRequest const & rReq ) case SID_BMPMASK_EXEC : { + if (!mpDrawView) + return; + SdrGrafObj* pObj = nullptr; const SdrMarkList& rMarkList = mpDrawView->GetMarkedObjectList(); - if( mpDrawView && rMarkList.GetMarkCount() ) + if( rMarkList.GetMarkCount() ) pObj = dynamic_cast< SdrGrafObj* >( rMarkList.GetMark(0)->GetMarkedSdrObj() ); if ( pObj && !mpDrawView->IsTextEdit() ) From 15168f9453cf6a623a494817289b98695dcb5a05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 3 Jul 2024 09:38:34 +0100 Subject: [PATCH 074/232] cid#1608717 Logically dead code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I06f5912a914936a08f68bddb7fa32fb87ffc0876 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169922 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- drawinglayer/source/processor2d/cairopixelprocessor2d.cxx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx index 8e4529df30d3..ecdda41e9587 100644 --- a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx @@ -727,10 +727,7 @@ std::shared_ptr getOrCreateCairoSurfaceHelper(const BitmapEx } } - if (pSystemDependentData_CairoSurface) - return pSystemDependentData_CairoSurface->getCairoSurfaceHelper(); - - return nullptr; + return pSystemDependentData_CairoSurface->getCairoSurfaceHelper(); } // This bit-tweaking looping is unpleasant and unfortunate From 8c8cb76bbdafa5005a8cb4ab9c4810745ffbe918 Mon Sep 17 00:00:00 2001 From: Andrea Gelmini Date: Wed, 3 Jul 2024 14:34:56 +0200 Subject: [PATCH 075/232] Fix typo Change-Id: Ib5752f1301c95d3941ecacac13918184dfe7c945 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169935 Reviewed-by: Julien Nabet Tested-by: Julien Nabet --- svl/source/items/globalpool.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svl/source/items/globalpool.cxx b/svl/source/items/globalpool.cxx index 94a14ba846af..7ad6abc6a49f 100644 --- a/svl/source/items/globalpool.cxx +++ b/svl/source/items/globalpool.cxx @@ -184,7 +184,7 @@ struct PairHash // The single static instance that takes over that global Item sharing // Maps SfxItemPool sub-classes to a set of shared items. // -// Noting that the WhichId is part of the key, to simply the implementation of the hashCode() overides +// Noting that the WhichId is part of the key, to simply the implementation of the hashCode() overrides // in SfxPoolItem sub-classes. static std::unordered_map, std::unique_ptr, PairHash> From 79a77bba092dce84f7fee3e72da9600ec2d1bd2b Mon Sep 17 00:00:00 2001 From: Andrea Gelmini Date: Wed, 3 Jul 2024 14:35:56 +0200 Subject: [PATCH 076/232] Fix typo Change-Id: I5c4735345bdb2a574e4b79ba7bfc88e95d0bf878 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169936 Tested-by: Julien Nabet Reviewed-by: Julien Nabet --- sfx2/qa/cppunit/test_misc.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfx2/qa/cppunit/test_misc.cxx b/sfx2/qa/cppunit/test_misc.cxx index 81d47ac0edc6..094c4b8964ef 100644 --- a/sfx2/qa/cppunit/test_misc.cxx +++ b/sfx2/qa/cppunit/test_misc.cxx @@ -435,7 +435,7 @@ CPPUNIT_TEST_FIXTURE(MiscTest, testRDFa) CPPUNIT_ASSERT(xResult.Second); } - // Remaning rdfs should be empty + // Remaining rdfs should be empty do { uno::Reference xPara(xParaEnum->nextElement(), uno::UNO_QUERY); From 433c4180acd5c5a699e71ab2f749713db36dc165 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Fri, 21 Jun 2024 10:42:08 -0400 Subject: [PATCH 077/232] tdf#161646 sw page number wizard: fit into existing margins Often page numbers are inserted when a document is finished, and at that point it would be annoying to repaginate everything, so offer this option of trying to fit the page number into the existing margins. I was tempted to enable it by default, except that it would then mismatch any pages that had header/footers created via other methods. Problem: -how to know which font is really needed: western, CTL, CJK? This patch depends on NFC b7fce2b26ee4ba585544457adc742807a2129d2c Change-Id: I285a99f8e2f12c87a8bdee20a9c86a1d79f80dd0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169349 Tested-by: Jenkins Reviewed-by: Justin Luth --- sw/inc/swabstdlg.hxx | 1 + sw/source/ui/dialog/swdlgfact.cxx | 5 ++ sw/source/ui/dialog/swdlgfact.hxx | 1 + sw/source/ui/misc/pagenumberdlg.cxx | 12 +++- sw/source/uibase/inc/pagenumberdlg.hxx | 6 +- sw/source/uibase/shells/textfld.cxx | 73 ++++++++++++++++++++++++- sw/uiconfig/swriter/ui/pagenumberdlg.ui | 26 ++++++++- 7 files changed, 117 insertions(+), 7 deletions(-) diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index 1d205f18624f..d6a5dbb90eac 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -241,6 +241,7 @@ public: virtual int GetPageNumberAlignment() const = 0; virtual bool GetMirrorOnEvenPages() const = 0; virtual bool GetIncludePageTotal() const = 0; + virtual bool GetFitIntoExistingMargins() const = 0; virtual SvxNumType GetPageNumberType() const = 0; virtual void SetPageNumberType(SvxNumType nSet) = 0; }; diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 4e3d87ba0ff0..1c042afd38f0 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -779,6 +779,11 @@ bool AbstractSwPageNumberDlg_Impl::GetIncludePageTotal() const return m_xDlg->GetIncludePageTotal(); } +bool AbstractSwPageNumberDlg_Impl::GetFitIntoExistingMargins() const +{ + return m_xDlg->GetFitIntoExistingMargins(); +} + SvxNumType AbstractSwPageNumberDlg_Impl::GetPageNumberType() const { return m_xDlg->GetPageNumberType(); diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index ae11902beedc..feb703e621e0 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -171,6 +171,7 @@ public: virtual int GetPageNumberAlignment() const override; bool GetMirrorOnEvenPages() const override; bool GetIncludePageTotal() const override; + bool GetFitIntoExistingMargins() const override; SvxNumType GetPageNumberType() const override; void SetPageNumberType(SvxNumType nSet) override; }; diff --git a/sw/source/ui/misc/pagenumberdlg.cxx b/sw/source/ui/misc/pagenumberdlg.cxx index d812cfaee60f..bc3cadb701e8 100644 --- a/sw/source/ui/misc/pagenumberdlg.cxx +++ b/sw/source/ui/misc/pagenumberdlg.cxx @@ -34,6 +34,8 @@ SwPageNumberDlg::SwPageNumberDlg(weld::Window* pParent) , m_xPageNumberAlignment(m_xBuilder->weld_combo_box(u"alignmentCombo"_ustr)) , m_xMirrorOnEvenPages(m_xBuilder->weld_check_button(u"mirrorCheckbox"_ustr)) , m_xIncludePageTotal(m_xBuilder->weld_check_button(u"pagetotalCheckbox"_ustr)) + , m_xFitIntoExistingMargins( + m_xBuilder->weld_check_button(u"fitintoexistingmarginsCheckbox"_ustr)) , m_xPageNumberTypeLB(new SvxPageNumberListBox(m_xBuilder->weld_combo_box(u"numfmtlb"_ustr))) , m_xPreviewImage(m_xBuilder->weld_image(u"previewImage"_ustr)) , m_aPageNumberPosition(1) // bottom @@ -48,6 +50,7 @@ SwPageNumberDlg::SwPageNumberDlg(weld::Window* pParent) m_xMirrorOnEvenPages->set_sensitive(false); m_xMirrorOnEvenPages->set_state(TRISTATE_TRUE); m_xIncludePageTotal->set_state(TRISTATE_FALSE); + m_xFitIntoExistingMargins->set_state(TRISTATE_FALSE); SvxNumOptionsTabPageHelper::GetI18nNumbering(m_xPageNumberTypeLB->get_widget(), ::std::numeric_limits::max()); m_xPageNumberTypeLB->connect_changed(LINK(this, SwPageNumberDlg, NumberTypeSelectHdl)); @@ -84,17 +87,22 @@ IMPL_LINK_NOARG(SwPageNumberDlg, IncludePageTotalChangeHdl, weld::Toggleable&, v updateImage(); } -bool SwPageNumberDlg::GetMirrorOnEvenPages() +bool SwPageNumberDlg::GetMirrorOnEvenPages() const { return m_xMirrorOnEvenPages->get_sensitive() && m_xMirrorOnEvenPages->get_state() == TRISTATE_TRUE; } -bool SwPageNumberDlg::GetIncludePageTotal() +bool SwPageNumberDlg::GetIncludePageTotal() const { return m_xIncludePageTotal->get_state() == TRISTATE_TRUE; } +bool SwPageNumberDlg::GetFitIntoExistingMargins() const +{ + return m_xFitIntoExistingMargins->get_state() == TRISTATE_TRUE; +} + void SwPageNumberDlg::SetPageNumberType(SvxNumType nSet) { m_nPageNumberType = nSet; diff --git a/sw/source/uibase/inc/pagenumberdlg.hxx b/sw/source/uibase/inc/pagenumberdlg.hxx index 169c9209dbf5..f097509b5a68 100644 --- a/sw/source/uibase/inc/pagenumberdlg.hxx +++ b/sw/source/uibase/inc/pagenumberdlg.hxx @@ -33,6 +33,7 @@ class SwPageNumberDlg final : public SfxDialogController std::unique_ptr m_xPageNumberAlignment; std::unique_ptr m_xMirrorOnEvenPages; std::unique_ptr m_xIncludePageTotal; + std::unique_ptr m_xFitIntoExistingMargins; std::unique_ptr m_xPageNumberTypeLB; std::unique_ptr m_xPreviewImage; @@ -53,8 +54,9 @@ public: SwPageNumberDlg(weld::Window* pParent); int GetPageNumberPosition() const { return m_aPageNumberPosition; } int GetPageNumberAlignment() const { return m_aPageNumberAlignment; } - bool GetMirrorOnEvenPages(); - bool GetIncludePageTotal(); + bool GetMirrorOnEvenPages() const; + bool GetIncludePageTotal() const; + bool GetFitIntoExistingMargins() const; SvxNumType GetPageNumberType() const { return m_nPageNumberType; } void SetPageNumberType(SvxNumType nSet); }; diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx index 54602e0199b7..a31d249093d2 100644 --- a/sw/source/uibase/shells/textfld.cxx +++ b/sw/source/uibase/shells/textfld.cxx @@ -37,10 +37,15 @@ #include #include #include +#include +#include #include #include #include +#include +#include #include +#include #include #include #include @@ -59,9 +64,9 @@ #include #include -#include #include #include +#include #include #include #include @@ -1153,6 +1158,72 @@ FIELD_INSERT: rFormat.SetFormatAttr(aUL); rFormat.SetFormatAttr(aFill); + if (pDlg->GetFitIntoExistingMargins()) + { + SvxULSpaceItem aPageUL(aNewDesc.GetMaster().GetULSpace()); + tools::Long nPageMargin = bHeader ? aPageUL.GetUpper() : aPageUL.GetLower(); + + // most printers can't print to paper edge - use arbitrary ~14pt as minimum + if (nPageMargin > constTwips_5mm) + { + // reduce existing margin by the "Spacing" + nPageMargin -= constTwips_5mm; + + // also reduce by the "Height" (as calculated from the font) + tools::Long nFontHeight = constTwips_5mm; // appropriate for 12pt font + const OutputDevice* pOutDev = Application::GetDefaultDevice(); + const SwViewShell* pViewSh + = rDoc.getIDocumentLayoutAccess().GetCurrentViewShell(); + OUString sParaStyle(bHeader ? "Header" : "Footer"); + SwTextFormatColl* pStyle = rDoc.FindTextFormatCollByName(sParaStyle); + if (pStyle && pOutDev) + { + SwFont aFont( + &pStyle->GetAttrSet(), /*IDocumentSettingAccess=*/nullptr); + + // sledgehammer approach: since the in-use-font (Latin/CTL/CKJ) + // is not known, use the tallest of the three just to ensure fit. + sal_uInt16 nHeight = aFont.GetHeight(pViewSh, *pOutDev); // Latin + + aFont.SetActual(SwFontScript::CTL); + nHeight = std::max(nHeight, aFont.GetHeight(pViewSh, *pOutDev)); + + aFont.SetActual(SwFontScript::CJK); + nFontHeight = std::max(nHeight, aFont.GetHeight(pViewSh, *pOutDev)); + + // Spacing: above and below paragraph + const SvxULSpaceItem& rParaStyleUL = pStyle->GetULSpace(); + nFontHeight += rParaStyleUL.GetUpper() + rParaStyleUL.GetLower(); + + // Border padding: top and bottom + const SvxBoxItem rBorders = pStyle->GetBox(); + nFontHeight += rBorders.CalcLineSpace(SvxBoxItemLine::TOP, true); + nFontHeight += rBorders.CalcLineSpace(SvxBoxItemLine::BOTTOM, true); + } + nPageMargin -= nFontHeight; + + nPageMargin = std::max(nPageMargin, constTwips_5mm); + if (bHeader) + aPageUL.SetUpper(nPageMargin); + else + aPageUL.SetLower(nPageMargin); + aNewDesc.GetMaster().SetFormatAttr(aPageUL); + + // force aggressively calculated font height as minimum to ensure + // effective margin stays the same (instead of getting smaller) + SwFormatFrameSize aSize(rFormat.GetFrameSize()); + aSize.SetHeightSizeType(SwFrameSize::Minimum); + // frame size property includes both Spacing + Height + aSize.SetHeight(constTwips_5mm + nFontHeight); + rFormat.SetFormatAttr(aSize); + + // in case the calculated font height isn't actually large enough, + // eat into spacing first before pushing into the content area. + rFormat.SetFormatAttr(SwHeaderAndFooterEatSpacingItem( + RES_HEADER_FOOTER_EAT_SPACING, true)); + } + } + // Might as well turn on margin mirroring too - if appropriate if (pDlg->GetMirrorOnEvenPages() && !bHeaderAlreadyOn && !bFooterAlreadyOn && !bIsSinglePage diff --git a/sw/uiconfig/swriter/ui/pagenumberdlg.ui b/sw/uiconfig/swriter/ui/pagenumberdlg.ui index f014545da429..e876594c05c5 100644 --- a/sw/uiconfig/swriter/ui/pagenumberdlg.ui +++ b/sw/uiconfig/swriter/ui/pagenumberdlg.ui @@ -211,6 +211,28 @@ 5 + + + Fit into existing margins + True + True + False + 18 + 3 + True + True + + + Reduce the margin so that adding the page number will not change the page layout + + + + + False + True + 6 + + True @@ -232,7 +254,7 @@ False True - 6 + 7 @@ -251,7 +273,7 @@ False True - 7 + 8 From e42be49887e75c6ec748b6c48bb4e5eda295c715 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Wed, 3 Jul 2024 10:09:54 +0200 Subject: [PATCH 078/232] tdf#123293: port test from Java to CppUnitTest Change-Id: I5297a041970871ab0fba6a71d59639b07072b64b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169889 Reviewed-by: Xisco Fauli Tested-by: Jenkins --- qadevOOo/runner/util/DesktopTools.java | 45 ------------------ .../complex/sfx2/DocumentMetadataAccess.java | 15 ------ .../complex/sfx2/testdocuments/TESTRDFA.odt | Bin 7540 -> 0 bytes sfx2/qa/cppunit/test_misc.cxx | 31 ++++++++---- 4 files changed, 23 insertions(+), 68 deletions(-) delete mode 100644 sfx2/qa/complex/sfx2/testdocuments/TESTRDFA.odt diff --git a/qadevOOo/runner/util/DesktopTools.java b/qadevOOo/runner/util/DesktopTools.java index c78e450ae721..997ee34e1ef2 100644 --- a/qadevOOo/runner/util/DesktopTools.java +++ b/qadevOOo/runner/util/DesktopTools.java @@ -258,51 +258,6 @@ public class DesktopTools return oDoc; } - /** - * loads a document of from a given path using an input stream - * - * @param xMSF the MultiServiceFactory - * @param filePath the path of the document to load. - * @return the XComponent Interface of the document - */ - public static XComponent loadDocUsingStream(XMultiServiceFactory xMSF, String filePath) - { - XInputStream inputStream = null; - try { - final InputStream inputFile = new BufferedInputStream( - new FileInputStream(filePath)); - try { - final ByteArrayOutputStream bytes = new ByteArrayOutputStream(); - final byte[] byteBuffer = new byte[4096]; - int byteBufferLength = 0; - while ((byteBufferLength = inputFile.read(byteBuffer)) > 0) - bytes.write(byteBuffer, 0, byteBufferLength); - inputStream = new ByteArrayToXInputStreamAdapter( - bytes.toByteArray()); - } finally { - inputFile.close(); - } - } catch (java.io.IOException e) { - e.printStackTrace(); - } - - PropertyValue[] loadProps = new PropertyValue[1]; - loadProps[0] = new PropertyValue(); - loadProps[0].Name = "InputStream"; - loadProps[0].Value = inputStream; - - XComponent oDoc = null; - try - { - oDoc = getCLoader(xMSF).loadComponentFromURL("private:stream", "_blank", 0, loadProps); - } - catch (com.sun.star.uno.Exception e) - { - throw new IllegalArgumentException("Document could not be loaded", e); - } - return oDoc; - } - /** * closes a given document * @param DocumentToClose the document to close diff --git a/sfx2/qa/complex/sfx2/DocumentMetadataAccess.java b/sfx2/qa/complex/sfx2/DocumentMetadataAccess.java index b49122e7f947..8e5754a0b981 100644 --- a/sfx2/qa/complex/sfx2/DocumentMetadataAccess.java +++ b/sfx2/qa/complex/sfx2/DocumentMetadataAccess.java @@ -578,21 +578,6 @@ public class DocumentMetadataAccess } } - @Test - public void checkTdf123293() throws Exception - { - XComponent xComp = null; - try { - xComp = util.DesktopTools.loadDocUsingStream(xMSF, TestDocument.getPath("TESTRDFA.odt")); - - // Metadata was discarded when loading from stream, make sure it's there now - XRepositorySupplier xRepoSupplier = UnoRuntime.queryInterface(XRepositorySupplier.class, xComp); - assertNotNull("No metadata loaded", xRepoSupplier); - } finally { - close(xComp); - } - } - // utilities ------------------------------------------------------------- static void close(XComponent i_comp) diff --git a/sfx2/qa/complex/sfx2/testdocuments/TESTRDFA.odt b/sfx2/qa/complex/sfx2/testdocuments/TESTRDFA.odt deleted file mode 100644 index d59739142df6ee23535244e7f7fa1ed1589e0834..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7540 zcma($2Rzi_`)BWx$Sk9f!kr`IvR8y`r83Sr9Ov%boxO!9*&-y$tn8gl5mNRHiBLo` zOZ30fAiw(ke~-`iKJWK^pY=Y^`+Yq_Pm7G489;<9Vg54a&0u;#!kG9_6COu|BOLFJ zfkQDEBmxG-BhVw;W zGj@j!4h+QMp?GJU6%-5nK}SsxNmSxD5n(`7WIr7g27@Ev1U6_a5ax`<5~aI2BFO-H zT2w@(0i?tq0{mMYHp1$Dwl+vK6c7KU43U1nGJo3y290sX5Deh_a}$4~IyR zh2!>Y|8JCk(~~G{*J%GM6&{U7{&yBw*TW!fcOx?!Z*RU=*dQZ*0uk*GIuRce1v!GISor z39@%m6UtVDpKN62v<2S)zRhl!zN9q1L0`tnbb6Wp$XJd)ZHkdGYGCYWq1nN7O2^bs z3k-DfqKn4U7GsYdJ0z);vS+tCAFqh}KCeyM<=rrJ|pX8bLLH zIn%ejeAoRXrLR+g*r~1uYElgGiZ?PtKc#c?`O}FSB_+hwS$?qZ7#Wm2mDMybI!~F} zKNw!{>RO4u(*OzBp4H@XM-z*x^b62^aE)_$p&8}E(9;U)h4ZT54Zxi+vebNYvUZwL zSJ!K^@RW1+b?LXCvTQuXJ@=>>YY1q+SJzbe48Wz&=~dB8Pj^2_r`L;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T;F`kQ?Z7)At&7(%RT;U&V-7+<$Jj&{4gBIQee3lHbNR1RIucLS5u5NZ2 z=#0yasEYHxSHoFHLJa@DLIug!$N>OpLOJ)}_azJAzSL1OQWDX;pbjJi9tayaZl{P| z8mEP7;$c)=mkD|{)@fsG>cm%Spc{G2?@i&gr@Ai~`OAUfu}>WzJj{7 zE6Ic?s(v(UPx*5AQN7SOLaJmQwrO5h(BV;7)cyWgWMX@2+a{NJmWWo@8T0$i&6;$B zk@jAI0rxmzY5Uqdw0e(+{%C!Tq~1)>lF_JjC&IKxNU`0TTK%-9%mpXRQH81vqXwGr zr>H8ytjibV*IN@H8pGwcN__wNhubefK6F>{kpEiA>I2Law(iB==HMm<7vLKv5gj zp%nMOT`)JSVp2$HT@@s{0Un?+tV#j^Knan!o)!ryGvMD%7J@JKz^|6eeyTkv0AeFz z7jy{2{mqQMy_Fx*_m=B^HAslvm0buT4EOW-N3Z3-DMySicHuQ)xS#26r{zz>>{0>t zZIOv!%KcpSc3%F?huC}Bh4X*o^G7G<-< -#include -#include -#include - #include #include #include @@ -31,20 +27,20 @@ #include #include #include -#include +#include #include #include +#include #include +#include #include #include #include - using namespace ::com::sun::star; - namespace { class MiscTest @@ -56,7 +52,6 @@ public: { } - virtual void registerNamespaces(xmlXPathContextPtr& pXmlXpathCtx) override { // ODF @@ -451,6 +446,26 @@ CPPUNIT_TEST_FIXTURE(MiscTest, testRDFa) saveAndReload(u"writer8"_ustr); verify(/*bIsExport*/ true); } + +CPPUNIT_TEST_FIXTURE(MiscTest, testTdf123293) +{ + const uno::Reference xContext(comphelper::getProcessComponentContext(), + css::uno::UNO_SET_THROW); + const uno::Reference xFileAccess( + xContext->getServiceManager()->createInstanceWithContext( + u"com.sun.star.ucb.SimpleFileAccess"_ustr, xContext), + uno::UNO_QUERY_THROW); + const uno::Reference xInputStream(xFileAccess->openFileRead(createFileURL(u"TESTRDFA.odt") ), + uno::UNO_SET_THROW); + uno::Sequence aLoadArgs{ comphelper::makePropertyValue( + "InputStream", xInputStream) }; + mxComponent = mxDesktop->loadComponentFromURL(u"private:stream"_ustr, u"_blank"_ustr, 0, aLoadArgs); + CPPUNIT_ASSERT(mxComponent.is()); + uno::Reference xDocumentMetadataAccess(mxComponent, uno::UNO_QUERY); + uno::Reference xRepo = xDocumentMetadataAccess->getRDFRepository(); + uno::Reference xDocRepo(xRepo, uno::UNO_QUERY); + CPPUNIT_ASSERT(xDocRepo); +} } CPPUNIT_PLUGIN_IMPLEMENT(); From cd91074bc087b0f85293c2756cdb96f53024c489 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 3 Jul 2024 09:46:07 +0100 Subject: [PATCH 079/232] cid#1606556 Overflowed constant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7748094d226b8201cfbdf43d6ae7df0cd776f9e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169923 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- sw/source/ui/index/swuiidxmrk.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/source/ui/index/swuiidxmrk.cxx b/sw/source/ui/index/swuiidxmrk.cxx index a37ef31f2dba..a61c662c9327 100644 --- a/sw/source/ui/index/swuiidxmrk.cxx +++ b/sw/source/ui/index/swuiidxmrk.cxx @@ -526,7 +526,7 @@ void SwIndexMarkPane::InsertMark() SwTOXMarkDescription aDesc(eType); - const int nLevel = m_xLevelNF->denormalize(m_xLevelNF->get_value()); + const auto nLevel = m_xLevelNF->denormalize(m_xLevelNF->get_value()); switch( nPos) { case POS_CONTENT : break; From 74f0a22ab268fb2d15c7f7ac8ea15fb4a3fae122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 3 Jul 2024 09:56:30 +0100 Subject: [PATCH 080/232] cid#1607108 silence Unchecked dynamic_cast MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4bd000f16e0e75beff4877ccff43a8a81e8d393f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169924 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- xmloff/source/core/XMLEmbeddedObjectImportContext.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx index d9d57af9f664..91b9ee234954 100644 --- a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx +++ b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx @@ -118,8 +118,8 @@ void XMLEmbeddedObjectImportContext::SetComponent( Reference< XComponent > const return; assert(dynamic_cast(xFilter.get())); - SvXMLImport *pFastHandler = dynamic_cast(xFilter.get()); - mxFastHandler = pFastHandler; + SvXMLImport& rFastHandler = dynamic_cast(*xFilter); + mxFastHandler = &rFastHandler; try { @@ -138,7 +138,7 @@ void XMLEmbeddedObjectImportContext::SetComponent( Reference< XComponent > const // #i34042: copy namespace declarations // We created a new instance of XMLImport, so we need to propagate the namespace // declarations to it. - pFastHandler->GetNamespaceMap() = GetImport().GetNamespaceMap(); + rFastHandler.GetNamespaceMap() = GetImport().GetNamespaceMap(); } XMLEmbeddedObjectImportContext::XMLEmbeddedObjectImportContext( From f2e48a6f2a12f44b9afd779f91e708e52cdf5978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 3 Jul 2024 10:01:29 +0100 Subject: [PATCH 081/232] cid#1607231 Uninitialized scalar field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I33d78ff590d9debd3013d4082688f44f4c00a9e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169925 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sc/source/filter/inc/xelink.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc/source/filter/inc/xelink.hxx b/sc/source/filter/inc/xelink.hxx index a4bef778b991..b975bc4d15dc 100644 --- a/sc/source/filter/inc/xelink.hxx +++ b/sc/source/filter/inc/xelink.hxx @@ -62,7 +62,7 @@ struct XclExpSBIndex void Set( sal_uInt16 nSupbook, sal_uInt16 nSBTab ) { mnSupbook = nSupbook; mnSBTab = nSBTab; } XclExpSBIndex( sal_uInt16 nSupbook, sal_uInt16 nSBTab ) : mnSupbook(nSupbook), mnSBTab(nSBTab) {} - XclExpSBIndex() {} + XclExpSBIndex() : mnSupbook(0), mnSBTab(0) {} }; /** Stores the correct Excel sheet index for each Calc sheet. From cc256da45a9d4907ecaa61f4912d0c26a97ca266 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 3 Jul 2024 10:02:56 +0100 Subject: [PATCH 082/232] cid#1607629 Uninitialized scalar field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Iaaef519741b6cec7aabe0e4b9b58ebe1a858e03e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169926 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- sw/source/ui/frmdlg/column.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/sw/source/ui/frmdlg/column.cxx b/sw/source/ui/frmdlg/column.cxx index 427cca6a94a4..103c5f2c9e35 100644 --- a/sw/source/ui/frmdlg/column.cxx +++ b/sw/source/ui/frmdlg/column.cxx @@ -369,6 +369,7 @@ constexpr sal_uInt16 g_nMinWidth(MINLAY); SwColumnPage::SwColumnPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet &rSet) : SfxTabPage(pPage, pController, u"modules/swriter/ui/columnpage.ui"_ustr, u"ColumnPage"_ustr, &rSet) , m_nFirstVis(0) + , m_nCols(0) , m_pModifiedField(nullptr) , m_bFormat(false) , m_bFrame(false) From cdda6533b44333b18d3dc6306dfd0f7058e40b32 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Wed, 3 Jul 2024 12:42:07 +0200 Subject: [PATCH 083/232] unoxml: port checkCVE_2012_0037 from java to CppUnittest so CI will be able to catch the problem reported in https://gerrit.libreoffice.org/c/core/+/169327 Change-Id: Id00e5f50fbf43f63f4bad5af13a62e4db88f82d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169932 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- unoxml/CppunitTest_unoxml_rdftest.mk | 38 +++++++++++ unoxml/Module_unoxml.mk | 1 + .../qa/complex/unoxml/RDFRepositoryTest.java | 14 ---- .../data}/cve_2012_0037.rdf | 0 unoxml/qa/unit/rdftest.cxx | 67 +++++++++++++++++++ 5 files changed, 106 insertions(+), 14 deletions(-) create mode 100644 unoxml/CppunitTest_unoxml_rdftest.mk rename unoxml/qa/{complex/unoxml/testdocuments => unit/data}/cve_2012_0037.rdf (100%) create mode 100644 unoxml/qa/unit/rdftest.cxx diff --git a/unoxml/CppunitTest_unoxml_rdftest.mk b/unoxml/CppunitTest_unoxml_rdftest.mk new file mode 100644 index 000000000000..e4e12e9864d4 --- /dev/null +++ b/unoxml/CppunitTest_unoxml_rdftest.mk @@ -0,0 +1,38 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_CppunitTest_CppunitTest,unoxml_rdftest)) + +$(eval $(call gb_CppunitTest_add_exception_objects,unoxml_rdftest, \ + unoxml/qa/unit/rdftest \ +)) + +$(eval $(call gb_CppunitTest_use_sdk_api,unoxml_rdftest)) + +$(eval $(call gb_CppunitTest_use_rdb,unoxml_rdftest,services)) + +$(eval $(call gb_CppunitTest_use_externals,unoxml_rdftest, \ + boost_headers \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,unoxml_rdftest, \ + comphelper \ + cppu \ + cppuhelper \ + sal \ + sax \ + test \ + unotest \ +)) + +$(eval $(call gb_CppunitTest_use_configuration,unoxml_rdftest)) +$(eval $(call gb_CppunitTest_use_ure,unoxml_rdftest)) +$(eval $(call gb_CppunitTest_use_vcl,unoxml_rdftest)) + +# vim: set noet sw=4 ts=4: diff --git a/unoxml/Module_unoxml.mk b/unoxml/Module_unoxml.mk index 8c55b830e42a..1a302c17a91a 100644 --- a/unoxml/Module_unoxml.mk +++ b/unoxml/Module_unoxml.mk @@ -31,6 +31,7 @@ endif $(eval $(call gb_Module_add_slowcheck_targets,unoxml,\ CppunitTest_unoxml_domtest \ + CppunitTest_unoxml_rdftest \ )) $(eval $(call gb_Module_add_subsequentcheck_targets,unoxml,\ diff --git a/unoxml/qa/complex/unoxml/RDFRepositoryTest.java b/unoxml/qa/complex/unoxml/RDFRepositoryTest.java index 54277a0f4ac5..a24e159af40b 100644 --- a/unoxml/qa/complex/unoxml/RDFRepositoryTest.java +++ b/unoxml/qa/complex/unoxml/RDFRepositoryTest.java @@ -531,20 +531,6 @@ public class RDFRepositoryTest } } - @Test public void checkCVE_2012_0037() throws Exception - { - XInputStream xIn = new StreamSimulator( - TestDocument.getUrl("cve_2012_0037.rdf"), true, param); - xRep.importGraph(FileFormat.RDF_XML, xIn, manifest, base); - XNamedGraph xGraph = xRep.getGraph(manifest); - assertNotNull("no graph", xGraph); - XEnumeration xEnum = xGraph.getStatements(foo, bar, null); - // there must not be anything more than "EVIL" in the literal - XLiteral evil = Literal.create(xContext, "EVIL"); - Statement FooBarEvil = new Statement(foo, bar, evil, manifest); - assertTrue("EVIL", eq(xEnum, new Statement [] { FooBarEvil })); - } - // utilities ------------------------------------------------------------- public void report(Exception e) { diff --git a/unoxml/qa/complex/unoxml/testdocuments/cve_2012_0037.rdf b/unoxml/qa/unit/data/cve_2012_0037.rdf similarity index 100% rename from unoxml/qa/complex/unoxml/testdocuments/cve_2012_0037.rdf rename to unoxml/qa/unit/data/cve_2012_0037.rdf diff --git a/unoxml/qa/unit/rdftest.cxx b/unoxml/qa/unit/rdftest.cxx new file mode 100644 index 000000000000..4595d78f5215 --- /dev/null +++ b/unoxml/qa/unit/rdftest.cxx @@ -0,0 +1,67 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-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/. + */ + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace com::sun::star; + +namespace +{ +class RDFStreamTest : public test::BootstrapFixture +{ +}; + +CPPUNIT_TEST_FIXTURE(RDFStreamTest, testCVE_2012_0037) +{ + const uno::Reference xContext(comphelper::getProcessComponentContext(), + css::uno::UNO_SET_THROW); + const uno::Reference xFileAccess( + xContext->getServiceManager()->createInstanceWithContext( + u"com.sun.star.ucb.SimpleFileAccess"_ustr, xContext), + uno::UNO_QUERY_THROW); + const uno::Reference xInputStream( + xFileAccess->openFileRead( + m_directories.getURLFromSrc(u"/unoxml/qa/unit/data/cve_2012_0037.rdf")), + uno::UNO_SET_THROW); + uno::Reference xRepo = rdf::Repository::create(xContext); + uno::Reference xDocRepo(xRepo, uno::UNO_QUERY); + CPPUNIT_ASSERT(xDocRepo); + + uno::Reference xManifest = rdf::URI::create(xContext, "manifest:manifest"); + uno::Reference xBase = rdf::URI::create(xContext, "base-uri:"); + uno::Reference xFoo = rdf::URI::create(xContext, "uri:foo"); + uno::Reference xBar = rdf::URI::create(xContext, "uri:bar"); + + xDocRepo->importGraph(rdf::FileFormat::RDF_XML, xInputStream, xManifest, xBase); + uno::Reference xGraph = xDocRepo->getGraph(xManifest); + CPPUNIT_ASSERT(xGraph); + uno::Reference xEnum = xGraph->getStatements(xFoo, xBar, nullptr); + + rdf::Statement aStatement = xEnum->nextElement().get(); + CPPUNIT_ASSERT_EQUAL(OUString("uri:foo"), aStatement.Subject->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("uri:bar"), aStatement.Predicate->getStringValue()); + CPPUNIT_ASSERT_EQUAL(OUString("EVIL"), aStatement.Object->getStringValue()); +} +} + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ From 71b7313aa2324b8f7da2026e7b7c2d1c942b497c Mon Sep 17 00:00:00 2001 From: Jonathan Clark Date: Wed, 3 Jul 2024 08:56:46 -0600 Subject: [PATCH 084/232] tdf#101686 Writer textbox direction changes depending on zoom Previously, DrawingLayer would apply RTL flags in the case of RTL text, but it would not clear them in the case of LTR text. In certain situations, it is possible for Writer to draw the contents of a text box while the VCL output device is configured for RTL output. As a result, whether DrawingLayer correctly drew LTR text as LTR would depend on the order that text was rendered. This issue would manifest as text boxes appearing to spontaneously mirror themselves while zooming and scrolling through Writer documents containing RTL text. This change updates the relevant portion of DrawingLayer to also clear the RTL flags in the case of LTR text. Change-Id: I3a75561d08cdf3ee6c74b8f6e62f75a1dfcf165e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169942 Tested-by: Jenkins Reviewed-by: Jonathan Clark --- .../source/processor2d/vclprocessor2d.cxx | 16 +- vcl/qa/cppunit/pdfexport/data/tdf101686.fodt | 592 ++++++++++++++++++ vcl/qa/cppunit/pdfexport/pdfexport2.cxx | 41 ++ 3 files changed, 645 insertions(+), 4 deletions(-) create mode 100644 vcl/qa/cppunit/pdfexport/data/tdf101686.fodt diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx index 7c21e4ea1f1c..b21348cf6635 100644 --- a/drawinglayer/source/processor2d/vclprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx @@ -315,6 +315,8 @@ void VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D( // set parameters and paint text snippet const basegfx::BColor aRGBFontColor( maBColorModifierStack.getModifiedColor(rTextCandidate.getFontColor())); + + // Store previous complex text layout state, to be restored after drawing const vcl::text::ComplexTextLayoutFlags nOldLayoutMode(mpOutputDevice->GetLayoutMode()); if (rTextCandidate.getFontAttribute().getRTL()) @@ -325,6 +327,14 @@ void VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D( | vcl::text::ComplexTextLayoutFlags::TextOriginLeft; mpOutputDevice->SetLayoutMode(nRTLLayoutMode); } + else + { + // tdf#101686: This is LTR text, but the output device may have RTL state. + vcl::text::ComplexTextLayoutFlags nLTRLayoutMode(nOldLayoutMode); + nLTRLayoutMode = nLTRLayoutMode & ~vcl::text::ComplexTextLayoutFlags::BiDiRtl; + nLTRLayoutMode = nLTRLayoutMode & ~vcl::text::ComplexTextLayoutFlags::BiDiStrong; + mpOutputDevice->SetLayoutMode(nLTRLayoutMode); + } OUString aText(rTextCandidate.getText()); sal_Int32 nPos = rTextCandidate.getTextPosition(); @@ -460,10 +470,8 @@ void VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D( } } - if (rTextCandidate.getFontAttribute().getRTL()) - { - mpOutputDevice->SetLayoutMode(nOldLayoutMode); - } + // Restore previous layout mode + mpOutputDevice->SetLayoutMode(nOldLayoutMode); if (bChangeMapMode) mpOutputDevice->Pop(); diff --git a/vcl/qa/cppunit/pdfexport/data/tdf101686.fodt b/vcl/qa/cppunit/pdfexport/data/tdf101686.fodt new file mode 100644 index 000000000000..0a76451165bd --- /dev/null +++ b/vcl/qa/cppunit/pdfexport/data/tdf101686.fodt @@ -0,0 +1,592 @@ + + + + Hameedullah2016-06-21T18:15:002024-07-03T08:51:13.4059332566PT10M59SLibreOfficeDev/25.2.0.0.alpha0$Linux_X86_64 LibreOffice_project/c792fe496ef8913c4d2fec7739d197d6f1a186932024-07-03T08:50:25.292450393PDF files + + + 0 + 0 + 26598 + 18480 + true + false + + + view2 + 3748 + 501 + 0 + 0 + 26596 + 18479 + 0 + 1 + false + 250 + false + false + false + false + false + false + + + + + false + true + true + + false + 0 + false + false + false + true + false + false + 0 + true + false + true + true + false + true + true + false + false + true + true + true + true + false + true + false + false + false + false + true + true + true + false + true + false + true + true + high-resolution + false + 1185464 + false + true + false + + + true + + true + false + true + true + true + + + ja + JP + + !%),.:;?]}¢°’”‰′″℃、。々〉》」』】〕゛゜ゝゞ・ヽヾ!%),.:;?]}。」、・゙゚¢ + $([\{£¥‘“〈《「『【〔$([{「£¥ + + + false + false + 0 + true + false + false + true + true + true + false + true + false + false + true + false + true + true + true + false + + true + true + false + 0 + false + true + + false + false + true + true + true + false + true + 1 + false + false + false + true + false + false + true + true + false + true + false + true + false + + false + 1350167 + true + false + false + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Textbox + + + + Textbox + + + + Frame + + + + + + + \ No newline at end of file diff --git a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx index fb7ad3f97d85..58a5d93e060e 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport2.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport2.cxx @@ -5237,6 +5237,47 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf71956) fnEqualPos(aRect[5], aRect[6]); } +// tdf#101686 - Verifies that drawinglayer clears RTL flags while drawing Writer text boxes +CPPUNIT_TEST_FIXTURE(PdfExportTest2, testTdf101686) +{ + aMediaDescriptor[u"FilterName"_ustr] <<= u"writer_pdf_Export"_ustr; + saveAsPDF(u"tdf101686.fodt"); + std::unique_ptr pPdfDocument = parsePDFExport(); + + CPPUNIT_ASSERT_EQUAL(1, pPdfDocument->getPageCount()); + + // Get the first pace + std::unique_ptr pPdfPage = pPdfDocument->openPage(/*nIndex*/ 0); + CPPUNIT_ASSERT(pPdfPage); + std::unique_ptr pTextPage = pPdfPage->getTextPage(); + CPPUNIT_ASSERT(pTextPage); + + int nPageObjectCount = pPdfPage->getObjectCount(); + CPPUNIT_ASSERT_EQUAL(3, nPageObjectCount); + + std::vector aText; + + int nTextObjectCount = 0; + for (int i = 0; i < nPageObjectCount; ++i) + { + auto pPageObject = pPdfPage->getObject(i); + CPPUNIT_ASSERT_MESSAGE("no object", pPageObject != nullptr); + if (pPageObject->getType() == vcl::pdf::PDFPageObjectType::Text) + { + aText.push_back(pPageObject->getText(pTextPage)); + ++nTextObjectCount; + } + } + + CPPUNIT_ASSERT_EQUAL(3, nTextObjectCount); + + CPPUNIT_ASSERT_EQUAL(u"Frame"_ustr, aText[0].trim()); + + // Without the fix, one of these two will be "xobtxeT" + CPPUNIT_ASSERT_EQUAL(u"Textbox"_ustr, aText[1].trim()); + CPPUNIT_ASSERT_EQUAL(u"Textbox"_ustr, aText[2].trim()); +} + } // end anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); From afa5ade8b51d609ece8408506a14e3f169774960 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Wed, 3 Jul 2024 12:21:25 +0500 Subject: [PATCH 085/232] Optimize a bit Change-Id: Icccf4a93054780c7a111f664117b25821c47f700 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169906 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- shell/source/win32/SysShExec.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx index d67e9b8f3c84..3d8d7b994474 100644 --- a/shell/source/win32/SysShExec.cxx +++ b/shell/source/win32/SysShExec.cxx @@ -308,15 +308,15 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa {}, 0); } } - pathname = o3tl::toU(path); + std::u16string_view resulting_path(o3tl::toU(path)); // ShellExecuteExW appears to ignore trailing dots, so remove them: - while (pathname.endsWith(".", &pathname)) {} - auto const n = pathname.lastIndexOf('.'); - if (n > pathname.lastIndexOf('\\')) { - auto const ext = pathname.copy(n + 1); - if (!ext.isEmpty()) { + while (o3tl::ends_with(resulting_path, u".", &resulting_path)) {} + auto const n = resulting_path.find_last_of('.'); + if (n != std::u16string_view::npos && n > resulting_path.find_last_of('\\')) { + auto const ext = resulting_path.substr(n + 1); + if (!ext.empty()) { OUString env; - if (osl_getEnvironment(OUString("PATHEXT").pData, &env.pData) + if (osl_getEnvironment(u"PATHEXT"_ustr.pData, &env.pData) != osl_Process_E_None) { SAL_INFO("shell", "osl_getEnvironment(PATHEXT) failed"); From d7d14e91f7525010c375c3302b75b4b22579849d Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Wed, 3 Jul 2024 12:22:10 +0500 Subject: [PATCH 086/232] SHGFI_EXETYPE doesn't need SHFILEINFOW Change-Id: Ib18d5a3992174c0b56f11970d02515bc6d0ea615 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169907 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- shell/source/win32/SysShExec.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx index 3d8d7b994474..e4e10744b2a4 100644 --- a/shell/source/win32/SysShExec.cxx +++ b/shell/source/win32/SysShExec.cxx @@ -266,12 +266,12 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa + ") failed", {}, 0); } - SHFILEINFOW info; - if (SHGetFileInfoW(path, 0, &info, sizeof info, SHGFI_EXETYPE) != 0) + if (SHGetFileInfoW(path, 0, nullptr, 0, SHGFI_EXETYPE) != 0) { throw css::security::AccessControlException( "XSystemShellExecute.execute, cannot process <" + aCommand + ">", {}, {}); } + SHFILEINFOW info; if (SHGetFileInfoW(path, 0, &info, sizeof info, SHGFI_ATTRIBUTES) == 0) { throw css::lang::IllegalArgumentException( From 25b37b4c8c8c5aef7cd530d919258bd8e5dce068 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Wed, 3 Jul 2024 14:08:47 +0200 Subject: [PATCH 087/232] raptor: Use --without-www it seems not used. Besides, it fails when upgrading to libxml2 2.13. See https://gerrit.libreoffice.org/c/core/+/169327 Change-Id: If383130eac3b5d6de911c4c273c8e371a4980f23 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169933 Tested-by: Jenkins Reviewed-by: Michael Stahl Reviewed-by: Xisco Fauli --- external/redland/ExternalProject_raptor.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/external/redland/ExternalProject_raptor.mk b/external/redland/ExternalProject_raptor.mk index 8ac05880766b..192bbade94e7 100644 --- a/external/redland/ExternalProject_raptor.mk +++ b/external/redland/ExternalProject_raptor.mk @@ -29,8 +29,8 @@ $(call gb_ExternalProject_get_state_target,raptor,build): $(if $(SYSBASE),$(if $(filter LINUX SOLARIS,$(OS)),-L$(SYSBASE)/lib -L$(SYSBASE)/usr/lib -lpthread -ldl))" \ CPPFLAGS="$(if $(SYSBASE),-I$(SYSBASE)/usr/include) $(gb_EMSCRIPTEN_CPPFLAGS)" \ $(gb_RUN_CONFIGURE) ./configure --disable-gtk-doc \ - --enable-parsers="rdfxml ntriples turtle trig guess rss-tag-soup" \ - --with-www=xml \ + --enable-parsers="rdfxml ntriples turtle trig guess rss-tag-soup" \ + --without-www \ --without-xslt-config \ $(gb_CONFIGURE_PLATFORMS) \ $(if $(CROSS_COMPILING),$(if $(filter INTEL ARM,$(CPUNAME)),ac_cv_c_bigendian=no)) \ From 8616a49d37dec0d17bd2355a3cf4cdb447ba6514 Mon Sep 17 00:00:00 2001 From: Jim Raykowski Date: Tue, 2 Jul 2024 12:41:10 -0800 Subject: [PATCH 088/232] tdf#160817 related: fix tooltip-text translatable context assignments Fixes copy-paste oversights in commit 94891dce760817686600f3a8d25e5eb735a1a133 Change-Id: Ibe8ea0e7d58ea748ac90732f09af0e5bee0dff45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169892 Tested-by: Jenkins Reviewed-by: Jim Raykowski --- sw/uiconfig/swriter/ui/navigatorpanel.ui | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sw/uiconfig/swriter/ui/navigatorpanel.ui b/sw/uiconfig/swriter/ui/navigatorpanel.ui index 5598ef1d938d..7d043cff1560 100644 --- a/sw/uiconfig/swriter/ui/navigatorpanel.ui +++ b/sw/uiconfig/swriter/ui/navigatorpanel.ui @@ -580,7 +580,7 @@ True False - Promote Outline Level + Promote Outline Level start start sw/res/sc20172.png @@ -594,7 +594,7 @@ True False - Demote Outline Level + Demote Outline Level start start sw/res/sc20173.png @@ -608,7 +608,7 @@ True False - Move Heading Up + Move Heading Up start start sw/res/sc20174.png @@ -622,7 +622,7 @@ True False - Move Heading Down + Move Heading Down start start sw/res/sc20171.png @@ -1299,7 +1299,7 @@ True False - Delete + Delete start start cmd/sc_delete.png From e650777fa21ed8b88b4dde2ff3607238928f3aa5 Mon Sep 17 00:00:00 2001 From: Olivier Hallot Date: Wed, 3 Jul 2024 06:24:02 -0300 Subject: [PATCH 089/232] Fix Help build with --with-lang=... Variable gb_POLOCATION is empty. include langlist.mk after TargetLocations.mk Change-Id: I3e82624df84700c922d116b32a366c0e6b424235 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169928 Tested-by: Jenkins Reviewed-by: Christian Lohmaier --- solenv/gbuild/gbuild.mk | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk index 30f2fbe3b21e..2a2f89cf8f45 100644 --- a/solenv/gbuild/gbuild.mk +++ b/solenv/gbuild/gbuild.mk @@ -70,8 +70,6 @@ include $(GBUILDDIR)/Helper.mk include $(GBUILDDIR)/Conditions.mk -include $(SRCDIR)/solenv/inc/langlist.mk - # optional extensions that should never be essential ifneq ($(wildcard $(GBUILDDIR)/extensions/pre_*.mk),) include $(wildcard $(GBUILDDIR)/extensions/pre_*.mk) @@ -176,6 +174,7 @@ endif include $(GBUILDDIR)/ExternalExecutable.mk include $(GBUILDDIR)/TargetLocations.mk +include $(SRCDIR)/solenv/inc/langlist.mk define gb_var2file $(file >$(1),$(2))$(1) From d4d81421918209456c4669ef48c3f4f2afd8d97f Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Wed, 3 Jul 2024 08:48:34 +0200 Subject: [PATCH 090/232] tdf#161853 Drop SvxIconChoiceCtrl_Impl::bHighlightFramePressed Since commit af9413cb4ad49c0b4854c08cc2804644220755ae Author: Michael Weghorn Date: Tue Jul 2 11:53:27 2024 +0200 tdf#161853 icon choice ctrl: Drop support for non-single selection modes , `SvxIconChoiceCtrl_Impl::bHighlightFramePressed` is always false, so drop it and the corresponding handling. This also means that the `bKeepHighlightFlags` param for `SvxIconChoiceCtrl_Impl::SetEntryHighlightFrame` is now unused, so drop that as well. Change-Id: I278318b2bda14b06339a375b683a49f8594e2e34 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169902 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- vcl/source/control/imivctl.hxx | 6 +----- vcl/source/control/imivctl1.cxx | 33 ++++++--------------------------- 2 files changed, 7 insertions(+), 32 deletions(-) diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index cd268c3d271a..90f9c4bb1986 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -135,7 +135,6 @@ class SvxIconChoiceCtrl_Impl DrawTextFlags nCurTextDrawFlags; ImplSVEvent * nUserEventAdjustScrBars; SvxIconChoiceCtrlEntry* pCurHighlightFrame; - bool bHighlightFramePressed; SvxIconChoiceCtrlEntry* pHead = nullptr; // top left entry SvxIconChoiceCtrlEntry* pCursor; LocalFocus aFocus; // Data for focusrect @@ -349,10 +348,7 @@ public: void SetPositionMode( SvxIconChoiceCtrlPositionMode ); - void SetEntryHighlightFrame( - SvxIconChoiceCtrlEntry* pEntry, - bool bKeepHighlightFlags - ); + void SetEntryHighlightFrame(SvxIconChoiceCtrlEntry* pEntry); void DrawHighlightFrame(vcl::RenderContext& rRenderContext, const tools::Rectangle& rBmpRect); void CallEventListeners( VclEventId nEvent, void* pData ); diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 27f363f4da76..9fcd4b83ab7c 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -62,7 +62,9 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( aImageSize( 32 * pCurView->GetDPIScaleFactor(), 32 * pCurView->GetDPIScaleFactor()), pView(pCurView), nMaxVirtWidth(DEFAULT_MAX_VIRT_WIDTH), nMaxVirtHeight(DEFAULT_MAX_VIRT_HEIGHT), nFlags(IconChoiceFlags::NONE), nUserEventAdjustScrBars(nullptr), - pCurHighlightFrame(nullptr), bHighlightFramePressed(false), pHead(nullptr), pCursor(nullptr), + pCurHighlightFrame(nullptr), + pHead(nullptr), + pCursor(nullptr), ePositionMode(SvxIconChoiceCtrlPositionMode::Free), bUpdateMode(true) { @@ -578,7 +580,6 @@ void SvxIconChoiceCtrl_Impl::InitScrollBarBox() bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) { bool bHandled = true; - bHighlightFramePressed = false; if( !(nWinBits & WB_NOPOINTERFOCUS) ) pView->GrabFocus(); @@ -646,19 +647,6 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt ) nFlags &= ~IconChoiceFlags(IconChoiceFlags::DownCtrl | IconChoiceFlags::DownDeselect); - if((nWinBits & WB_HIGHLIGHTFRAME) && bHighlightFramePressed && pCurHighlightFrame) - { - bHandled = true; - SvxIconChoiceCtrlEntry* pEntry = pCurHighlightFrame; - pCurHighlightFrame = nullptr; // force repaint of frame - bHighlightFramePressed = false; - SetEntryHighlightFrame( pEntry, true ); - - pView->ClickIcon(); - - // set focus on Icon - SetCursor_Impl(pCurHighlightFrame); - } return bHandled; } @@ -671,7 +659,7 @@ bool SvxIconChoiceCtrl_Impl::MouseMove( const MouseEvent& rMEvt ) else if( nWinBits & WB_HIGHLIGHTFRAME ) { SvxIconChoiceCtrlEntry* pEntry = GetEntry( aDocPos ); - SetEntryHighlightFrame( pEntry, false ); + SetEntryHighlightFrame(pEntry); } else return false; @@ -2374,23 +2362,14 @@ void SvxIconChoiceCtrl_Impl::DrawHighlightFrame(vcl::RenderContext& rRenderConte aBmpRect.AdjustTop( -nBorder ); DecorationView aDecoView(&rRenderContext); - DrawHighlightFrameStyle nDecoFlags; - if (bHighlightFramePressed) - nDecoFlags = DrawHighlightFrameStyle::In; - else - nDecoFlags = DrawHighlightFrameStyle::Out; - aDecoView.DrawHighlightFrame(aBmpRect, nDecoFlags); + aDecoView.DrawHighlightFrame(aBmpRect, DrawHighlightFrameStyle::Out); } -void SvxIconChoiceCtrl_Impl::SetEntryHighlightFrame( SvxIconChoiceCtrlEntry* pEntry, - bool bKeepHighlightFlags ) +void SvxIconChoiceCtrl_Impl::SetEntryHighlightFrame(SvxIconChoiceCtrlEntry* pEntry) { if( pEntry == pCurHighlightFrame ) return; - if( !bKeepHighlightFlags ) - bHighlightFramePressed = false; - if (pCurHighlightFrame) { tools::Rectangle aInvalidationRect(GetEntryBoundRect(pCurHighlightFrame)); From 1bffb064a0fbffebd2e33e3b6fdfdbc17b310489 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Wed, 3 Jul 2024 08:58:12 +0200 Subject: [PATCH 091/232] tdf#161853 Drop SvxIconChoiceCtrl_Impl::MouseButtonUp Since commit af9413cb4ad49c0b4854c08cc2804644220755ae Author: Michael Weghorn Date: Tue Jul 2 11:53:27 2024 +0200 tdf#161853 icon choice ctrl: Drop support for non-single selection modes , the `IconChoiceFlags::DownDeselect` and `IconChoiceFlags::DownCtrl` flags are never set, so `SvxIconChoiceCtrl_Impl::MouseButtonUp` wouldn't effectively do anything. Drop it and the now unused flags. Also drop the `SvtIconChoiceCtrl` override for `Control::MouseButtonUp`. Change-Id: I06808726389f31a426cba36e627b4305fb362bee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169903 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- include/vcl/toolkit/ivctrl.hxx | 1 - vcl/source/control/imivctl.hxx | 9 +++------ vcl/source/control/imivctl1.cxx | 35 --------------------------------- vcl/source/control/ivctrl.cxx | 6 ------ 4 files changed, 3 insertions(+), 48 deletions(-) diff --git a/include/vcl/toolkit/ivctrl.hxx b/include/vcl/toolkit/ivctrl.hxx index 308e20c444c1..3f6d9a39f769 100644 --- a/include/vcl/toolkit/ivctrl.hxx +++ b/include/vcl/toolkit/ivctrl.hxx @@ -170,7 +170,6 @@ class UNLESS_MERGELIBS_MORE(VCL_DLLPUBLIC) SvtIconChoiceCtrl final : public Cont virtual void Command( const CommandEvent& rCEvt ) override; virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override; virtual void MouseButtonDown( const MouseEvent& rMEvt ) override; - virtual void MouseButtonUp( const MouseEvent& rMEvt ) override; virtual void MouseMove( const MouseEvent& rMEvt ) override; virtual void Resize() override; virtual void GetFocus() override; diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index 90f9c4bb1986..99a8dee83a25 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -53,11 +53,9 @@ enum class IconChoiceFlags { NONE = 0x0000, AddMode = 0x0001, SelectingRect = 0x0002, - DownCtrl = 0x0004, - DownDeselect = 0x0008, - EntryListPosValid = 0x0010, - ClearingSelection = 0x0020, - Arranging = 0x0040 + EntryListPosValid = 0x0004, + ClearingSelection = 0x0008, + Arranging = 0x0010, }; namespace o3tl { template<> struct typed_flags : is_typed_flags {}; @@ -236,7 +234,6 @@ public: ); void Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect); bool MouseButtonDown( const MouseEvent& ); - bool MouseButtonUp( const MouseEvent& ); bool MouseMove( const MouseEvent&); bool RequestHelp( const HelpEvent& rHEvt ); void SetCursor_Impl(SvxIconChoiceCtrlEntry* pNewCursor); diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 9fcd4b83ab7c..e8864d4b4a97 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -615,41 +615,6 @@ bool SvxIconChoiceCtrl_Impl::MouseButtonDown( const MouseEvent& rMEvt) return bHandled; } -bool SvxIconChoiceCtrl_Impl::MouseButtonUp( const MouseEvent& rMEvt ) -{ - bool bHandled = false; - if( rMEvt.IsRight() && (nFlags & (IconChoiceFlags::DownCtrl | IconChoiceFlags::DownDeselect) )) - { - nFlags &= ~IconChoiceFlags(IconChoiceFlags::DownCtrl | IconChoiceFlags::DownDeselect); - bHandled = true; - } - - Point aDocPos( rMEvt.GetPosPixel() ); - ToDocPos( aDocPos ); - SvxIconChoiceCtrlEntry* pDocEntry = GetEntry( aDocPos ); - if( pDocEntry ) - { - if( nFlags & IconChoiceFlags::DownCtrl ) - { - // Ctrl & MultiSelection - ToggleSelection( pDocEntry ); - SetCursor( pDocEntry ); - bHandled = true; - } - else if( nFlags & IconChoiceFlags::DownDeselect ) - { - DeselectAllBut( pDocEntry ); - SetCursor( pDocEntry ); - SelectEntry( pDocEntry, true, false ); - bHandled = true; - } - } - - nFlags &= ~IconChoiceFlags(IconChoiceFlags::DownCtrl | IconChoiceFlags::DownDeselect); - - return bHandled; -} - bool SvxIconChoiceCtrl_Impl::MouseMove( const MouseEvent& rMEvt ) { const Point aDocPos( pView->PixelToLogic(rMEvt.GetPosPixel()) ); diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx index 4fa8b92997a9..9d4da5e434ce 100644 --- a/vcl/source/control/ivctrl.cxx +++ b/vcl/source/control/ivctrl.cxx @@ -131,12 +131,6 @@ void SvtIconChoiceCtrl::MouseButtonDown( const MouseEvent& rMEvt ) Control::MouseButtonDown( rMEvt ); } -void SvtIconChoiceCtrl::MouseButtonUp( const MouseEvent& rMEvt ) -{ - if( !_pImpl->MouseButtonUp( rMEvt ) ) - Control::MouseButtonUp( rMEvt ); -} - void SvtIconChoiceCtrl::MouseMove( const MouseEvent& rMEvt ) { if( !_pImpl->MouseMove( rMEvt ) ) From 11169e6b29cbe7d782a6236d2a866b07b7501417 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Wed, 3 Jul 2024 09:09:22 +0200 Subject: [PATCH 092/232] tdf#161853 icon choice ctrl: Drop WB_SMART_ARRANGE handling That flag is unused since `OApplicationIconControl` was ported away from using `SvtIconChoiceCtrl` in commit fd2ea8e03510c6a99ec8be6228b7422f6c5b182b Date: Wed Aug 19 14:59:33 2020 +0100 weld OApplicationSwapWindow , so drop it. Change-Id: I0c6f191017b13fffee57d1e5eba1c03c05736ee2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169904 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- include/vcl/toolkit/ivctrl.hxx | 1 - vcl/source/control/imivctl1.cxx | 11 ----------- 2 files changed, 12 deletions(-) diff --git a/include/vcl/toolkit/ivctrl.hxx b/include/vcl/toolkit/ivctrl.hxx index 3f6d9a39f769..8e5e9abf1a3c 100644 --- a/include/vcl/toolkit/ivctrl.hxx +++ b/include/vcl/toolkit/ivctrl.hxx @@ -151,7 +151,6 @@ public: #define WB_NOHSCROLL WB_SPIN #define WB_NOVSCROLL WB_DRAG #define WB_NODRAGSELECTION WB_PATHELLIPSIS -#define WB_SMART_ARRANGE 0x01000000 // used to be WB_PASSWORD #define WB_ALIGN_TOP WB_TOP #define WB_ALIGN_LEFT WB_LEFT #define WB_NOCOLUMNHEADER WB_CENTER diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index e8864d4b4a97..230102619cb4 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -428,12 +428,6 @@ void SvxIconChoiceCtrl_Impl::Arrange( bool bKeepPredecessors, tools::Long nSetMa void SvxIconChoiceCtrl_Impl::ImpArrange( bool bKeepPredecessors ) { - static const Point aEmptyPoint; - - bool bOldUpdate = bUpdateMode; - tools::Rectangle aCurOutputArea( GetOutputRect() ); - if( (nWinBits & WB_SMART_ARRANGE) && aCurOutputArea.TopLeft() != aEmptyPoint ) - bUpdateMode = false; aAutoArrangeIdle.Stop(); nFlags |= IconChoiceFlags::Arranging; ShowCursor( false ); @@ -448,11 +442,6 @@ void SvxIconChoiceCtrl_Impl::ImpArrange( bool bKeepPredecessors ) //if( !(nWinBits & WB_DETAILS )) pView->Invalidate( InvalidateFlags::NoChildren ); nFlags &= ~IconChoiceFlags::Arranging; - if( (nWinBits & WB_SMART_ARRANGE) && aCurOutputArea.TopLeft() != aEmptyPoint ) - { - MakeVisible( aCurOutputArea ); - SetUpdateMode( bOldUpdate ); - } ShowCursor( true ); } From ed3c987a60dddcf3a75a15cbb5251d57a9bccdb7 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Wed, 3 Jul 2024 09:19:30 +0200 Subject: [PATCH 093/232] tdf#161853 Drop SvxIconChoiceCtrl_Impl::bUpdateMode It's initialized to true and since Change-Id: I0c6f191017b13fffee57d1e5eba1c03c05736ee2 Author: Michael Weghorn Date: Wed Jul 3 09:09:22 2024 +0200 tdf#161853 icon choice ctrl: Drop WB_SMART_ARRANGE handling , the value never changes, so drop it and simplify accordingly. Change-Id: I05007727e29a7884165fa25c668f139a96b7c4c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169905 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- vcl/source/control/imivctl.hxx | 3 -- vcl/source/control/imivctl1.cxx | 69 ++++++++++----------------------- 2 files changed, 21 insertions(+), 51 deletions(-) diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index 99a8dee83a25..68a2afc00430 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -140,7 +140,6 @@ class SvxIconChoiceCtrl_Impl SvxIconChoiceCtrlPositionMode ePositionMode; bool bBoundRectsDirty; - bool bUpdateMode; void ShowCursor( bool bShow ); @@ -241,8 +240,6 @@ public: void Resize(); void GetFocus(); void LoseFocus(); - void SetUpdateMode( bool bUpdate ); - bool GetUpdateMode() const { return bUpdateMode; } void PaintEntry(SvxIconChoiceCtrlEntry*, const Point&, vcl::RenderContext& rRenderContext); void SetEntryPos( diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 230102619cb4..23c7a877f3f8 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -65,8 +65,7 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( pCurHighlightFrame(nullptr), pHead(nullptr), pCursor(nullptr), - ePositionMode(SvxIconChoiceCtrlPositionMode::Free), - bUpdateMode(true) + ePositionMode(SvxIconChoiceCtrlPositionMode::Free) { SetStyle( nWinStyle ); pImpCursor.reset( new IcnCursor_Impl( this ) ); @@ -131,8 +130,7 @@ void SvxIconChoiceCtrl_Impl::Clear( bool bInCtor ) nMaxVirtHeight = DEFAULT_MAX_VIRT_HEIGHT; maZOrderList.clear(); SetOrigin( Point() ); - if( bUpdateMode ) - pView->Invalidate(InvalidateFlags::NoChildren); + pView->Invalidate(InvalidateFlags::NoChildren); } AdjustScrollBars(); maEntries.clear(); @@ -190,21 +188,16 @@ void SvxIconChoiceCtrl_Impl::InsertEntry( std::unique_ptrClear(); - // If the UpdateMode is true, don't set all bounding rectangles to + // don't set all bounding rectangles to // 'to be checked', but only the bounding rectangle of the new entry. // Thus, don't call InvalidateBoundingRect! pEntry->aRect.SetRight( LONG_MAX ); - if( bUpdateMode ) - { - FindBoundingRect( pEntry ); - tools::Rectangle aOutputArea( GetOutputRect() ); - pGridMap->OccupyGrids( pEntry ); - if( !aOutputArea.Overlaps( pEntry->aRect ) ) - return; // is invisible - pView->Invalidate( pEntry->aRect ); - } - else - InvalidateBoundingRect( pEntry->aRect ); + FindBoundingRect(pEntry); + tools::Rectangle aOutputArea(GetOutputRect()); + pGridMap->OccupyGrids(pEntry); + if (!aOutputArea.Overlaps(pEntry->aRect)) + return; // is invisible + pView->Invalidate(pEntry->aRect); } void SvxIconChoiceCtrl_Impl::RemoveEntry(size_t nPos) @@ -281,14 +274,12 @@ void SvxIconChoiceCtrl_Impl::EntrySelected(SvxIconChoiceCtrlEntry* pEntry, bool // correctly! if (!(nFlags & IconChoiceFlags::SelectingRect)) ToTop(pEntry); - if (bUpdateMode) - { - if (pEntry == pCursor) - ShowCursor(false); - pView->Invalidate(CalcFocusRect(pEntry)); - if (pEntry == pCursor) - ShowCursor(true); - } + + if (pEntry == pCursor) + ShowCursor(false); + pView->Invalidate(CalcFocusRect(pEntry)); + if (pEntry == pCursor) + ShowCursor(true); // #i101012# emit vcl event LISTBOX_SELECT only in case that the given entry is selected. if (bSelect) @@ -1073,21 +1064,6 @@ void SvxIconChoiceCtrl_Impl::LoseFocus() RepaintSelectedEntries(); } -void SvxIconChoiceCtrl_Impl::SetUpdateMode( bool bUpdate ) -{ - if( bUpdate != bUpdateMode ) - { - bUpdateMode = bUpdate; - if( bUpdate ) - { - AdjustScrollBars(); - pImpCursor->Clear(); - pGridMap->Clear(); - pView->Invalidate(InvalidateFlags::NoChildren); - } - } -} - // priorities of the emphasis: bSelected void SvxIconChoiceCtrl_Impl::PaintEmphasis(const tools::Rectangle& rTextRect, bool bSelected, vcl::RenderContext& rRenderContext) @@ -1695,11 +1671,9 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const tools::Rectangle& rRect, bool bS aOrigin.AdjustX(nDx ); aOrigin.AdjustY(nDy ); aOutputArea.SetPos( aOrigin ); - if( GetUpdateMode() ) - { - pView->PaintImmediately(); - ShowCursor( false ); - } + + pView->PaintImmediately(); + ShowCursor(false); // invert origin for SV (so we can scroll/paint using document coordinates) aOrigin *= -1; @@ -1707,7 +1681,7 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const tools::Rectangle& rRect, bool bS bool bScrollable = pView->GetBackground().IsScrollable(); - if( bScrollable && GetUpdateMode() ) + if (bScrollable) { // scroll in reverse direction! pView->Control::Scroll( -nDx, -nDy, aOutputArea, @@ -1729,12 +1703,11 @@ void SvxIconChoiceCtrl_Impl::MakeVisible( const tools::Rectangle& rRect, bool bS } } - if( GetUpdateMode() ) - ShowCursor( true ); + ShowCursor(true); // check if we still need scrollbars CheckScrollBars(); - if( bScrollable && GetUpdateMode() ) + if (bScrollable) pView->PaintImmediately(); // If the requested area can not be made completely visible, the From fed3e5d4ea03d12d17dd380359689e4f00c7f90e Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Wed, 3 Jul 2024 10:03:43 +0200 Subject: [PATCH 094/232] tdf#161853 Drop SvxIconViewFlags::POS_LOCKED The flag is never set, so there's no need to check or clear it either. The only method setting it (`SvxIconChoiceCtrl_Impl::LockEntryPos`) was dropped in commit 18d18c8a5646868a8229dea9ffe3f46888c2bad5 Author: Joseph Powers Date: Sat Jul 23 07:16:14 2011 -0700 unusedcode.easy: svxIconChoiceCtrl_Impl Doing List cleanup, I ran into SaveSelection() and decided to delete it. While I was in the class, I went ahead and cleanup them all up. , but that method was already unused by then. Drop the flag and related code. Change-Id: I9b886f3a63444d502ef8c488437889a2b05e065a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169909 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- include/vcl/toolkit/ivctrl.hxx | 8 +++----- vcl/source/control/imivctl1.cxx | 21 +++------------------ 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/include/vcl/toolkit/ivctrl.hxx b/include/vcl/toolkit/ivctrl.hxx index 8e5e9abf1a3c..1442904fa2f8 100644 --- a/include/vcl/toolkit/ivctrl.hxx +++ b/include/vcl/toolkit/ivctrl.hxx @@ -37,10 +37,9 @@ class SvxIconChoiceCtrl_Impl; enum class SvxIconViewFlags { NONE = 0x0000, - POS_LOCKED = 0x0001, - SELECTED = 0x0002, - FOCUSED = 0x0004, - POS_MOVED = 0x0008, // Moved by Drag and Drop, but not logged + SELECTED = 0x0001, + FOCUSED = 0x0002, + POS_MOVED = 0x0004, // Moved by Drag and Drop, but not logged }; namespace o3tl { @@ -122,7 +121,6 @@ public: SvxIconViewFlags GetFlags() const { return nFlags; } bool IsSelected() const { return bool(nFlags & SvxIconViewFlags::SELECTED); } bool IsFocused() const { return bool(nFlags & SvxIconViewFlags::FOCUSED); } - bool IsPosLocked() const { return bool(nFlags & SvxIconViewFlags::POS_LOCKED); } }; diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 23c7a877f3f8..c647939ca4d6 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -297,16 +297,7 @@ void SvxIconChoiceCtrl_Impl::ResetVirtSize() { SvxIconChoiceCtrlEntry* pCur = maEntries[ nCur ].get(); pCur->ClearFlags( SvxIconViewFlags::POS_MOVED ); - if( pCur->IsPosLocked() ) - { - // adapt (among others) VirtSize - if( !IsBoundingRectValid( pCur->aRect ) ) - FindBoundingRect( pCur ); - else - AdjustVirtSize( pCur->aRect ); - } - else - InvalidateBoundingRect( pCur->aRect ); + InvalidateBoundingRect(pCur->aRect); } if( !(nWinBits & (WB_NOVSCROLL | WB_NOHSCROLL)) ) @@ -370,7 +361,7 @@ void SvxIconChoiceCtrl_Impl::InitPredecessors() SvxIconChoiceCtrlEntry* pPrev = maEntries[ 0 ].get(); for( size_t nCur = 1; nCur <= nCount; nCur++ ) { - pPrev->ClearFlags( SvxIconViewFlags::POS_LOCKED | SvxIconViewFlags::POS_MOVED ); + pPrev->ClearFlags(SvxIconViewFlags::POS_MOVED); SvxIconChoiceCtrlEntry* pNext; if( nCur == nCount ) @@ -1447,12 +1438,6 @@ void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRectsSmart() void SvxIconChoiceCtrl_Impl::FindBoundingRect( SvxIconChoiceCtrlEntry* pEntry ) { - DBG_ASSERT(!pEntry->IsPosLocked(),"Locked entry pos in FindBoundingRect"); - if( pEntry->IsPosLocked() && IsBoundingRectValid( pEntry->aRect) ) - { - AdjustVirtSize( pEntry->aRect ); - return; - } Size aSize( CalcBoundingSize() ); Point aPos(pGridMap->GetGridRect(pGridMap->GetUnoccupiedGrid()).TopLeft()); SetBoundingRect_Impl( pEntry, aPos, aSize ); @@ -2128,7 +2113,7 @@ void SvxIconChoiceCtrl_Impl::SetPositionMode( SvxIconChoiceCtrlPositionMode eMod for( size_t nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pEntry = maEntries[ nCur ].get(); - if( pEntry->GetFlags() & SvxIconViewFlags(SvxIconViewFlags::POS_LOCKED | SvxIconViewFlags::POS_MOVED)) + if (pEntry->GetFlags() & SvxIconViewFlags::POS_MOVED) SetEntryPos(pEntry, GetEntryBoundRect( pEntry ).TopLeft()); } From 0583a07e5fad562b7d404aa5d17579114c285219 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Wed, 3 Jul 2024 10:15:27 +0200 Subject: [PATCH 095/232] tdf#161853 Drop SvxIconViewFlags::POS_MOVED The flag is never set, so there's no need to check or clear it either. Change-Id: I63ab1272140a0d5386538e6b749ba0f652f49c38 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169910 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- include/vcl/toolkit/ivctrl.hxx | 1 - vcl/source/control/imivctl1.cxx | 11 ----------- 2 files changed, 12 deletions(-) diff --git a/include/vcl/toolkit/ivctrl.hxx b/include/vcl/toolkit/ivctrl.hxx index 1442904fa2f8..059494b5e05e 100644 --- a/include/vcl/toolkit/ivctrl.hxx +++ b/include/vcl/toolkit/ivctrl.hxx @@ -39,7 +39,6 @@ enum class SvxIconViewFlags NONE = 0x0000, SELECTED = 0x0001, FOCUSED = 0x0002, - POS_MOVED = 0x0004, // Moved by Drag and Drop, but not logged }; namespace o3tl { diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index c647939ca4d6..f19978f7ff6e 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -296,7 +296,6 @@ void SvxIconChoiceCtrl_Impl::ResetVirtSize() for( size_t nCur = 0; nCur < nCount; nCur++ ) { SvxIconChoiceCtrlEntry* pCur = maEntries[ nCur ].get(); - pCur->ClearFlags( SvxIconViewFlags::POS_MOVED ); InvalidateBoundingRect(pCur->aRect); } @@ -361,8 +360,6 @@ void SvxIconChoiceCtrl_Impl::InitPredecessors() SvxIconChoiceCtrlEntry* pPrev = maEntries[ 0 ].get(); for( size_t nCur = 1; nCur <= nCount; nCur++ ) { - pPrev->ClearFlags(SvxIconViewFlags::POS_MOVED); - SvxIconChoiceCtrlEntry* pNext; if( nCur == nCount ) pNext = maEntries[ 0 ].get(); @@ -2096,7 +2093,6 @@ void SvxIconChoiceCtrl_Impl::SetPositionMode( SvxIconChoiceCtrlPositionMode eMod SvxIconChoiceCtrlPositionMode eOldMode = ePositionMode; ePositionMode = eMode; - size_t nCount = maEntries.size(); if( eOldMode == SvxIconChoiceCtrlPositionMode::AutoArrange ) { @@ -2110,13 +2106,6 @@ void SvxIconChoiceCtrl_Impl::SetPositionMode( SvxIconChoiceCtrlPositionMode eMod if( ePositionMode == SvxIconChoiceCtrlPositionMode::AutoArrange ) { - for( size_t nCur = 0; nCur < nCount; nCur++ ) - { - SvxIconChoiceCtrlEntry* pEntry = maEntries[ nCur ].get(); - if (pEntry->GetFlags() & SvxIconViewFlags::POS_MOVED) - SetEntryPos(pEntry, GetEntryBoundRect( pEntry ).TopLeft()); - } - if( maEntries.size() ) aAutoArrangeIdle.Start(); } From 14c88b770ad1d03897b9514b6ab0c696bf376f6b Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Wed, 3 Jul 2024 10:17:41 +0200 Subject: [PATCH 096/232] tdf#161853 Drop unused SvxIconChoiceCtrl_Impl::SetEntryPos Unused since: Change-Id: I63ab1272140a0d5386538e6b749ba0f652f49c38 Author: Michael Weghorn Date: Wed Jul 3 10:15:27 2024 +0200 tdf#161853 Drop SvxIconViewFlags::POS_MOVED Change-Id: I926b03a0f2054c21f8ab96eeee0083156443d2c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169911 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- vcl/source/control/imivctl.hxx | 5 ----- vcl/source/control/imivctl1.cxx | 35 --------------------------------- 2 files changed, 40 deletions(-) diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index 68a2afc00430..76f170c68d63 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -242,11 +242,6 @@ public: void LoseFocus(); void PaintEntry(SvxIconChoiceCtrlEntry*, const Point&, vcl::RenderContext& rRenderContext); - void SetEntryPos( - SvxIconChoiceCtrlEntry* pEntry, - const Point& rPos - ); - void InvalidateEntry( SvxIconChoiceCtrlEntry* ); void SetNoSelection(); diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index f19978f7ff6e..6e1fd061fec8 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -1173,41 +1173,6 @@ void SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po rRenderContext.SetClipRegion(); } -void SvxIconChoiceCtrl_Impl::SetEntryPos( SvxIconChoiceCtrlEntry* pEntry, const Point& rPos ) -{ - ShowCursor( false ); - tools::Rectangle aBoundRect( GetEntryBoundRect( pEntry )); - pView->Invalidate( aBoundRect ); - ToTop( pEntry ); - if( !IsAutoArrange() ) - { - bool bAdjustVirtSize = false; - if( rPos != aBoundRect.TopLeft() ) - { - Point aGridOffs( - pEntry->aGridRect.TopLeft() - pEntry->aRect.TopLeft() ); - pImpCursor->Clear(); - pGridMap->Clear(); - aBoundRect.SetPos( rPos ); - pEntry->aRect = aBoundRect; - pEntry->aGridRect.SetPos( rPos + aGridOffs ); - bAdjustVirtSize = true; - } - if( bAdjustVirtSize ) - AdjustVirtSize( pEntry->aRect ); - - pView->Invalidate( pEntry->aRect ); - pGridMap->OccupyGrids( pEntry ); - } - else - { - SvxIconChoiceCtrlEntry* pPrev = FindEntryPredecessor( pEntry, rPos ); - SetEntryPredecessor( pEntry, pPrev ); - aAutoArrangeIdle.Start(); - } - ShowCursor( true ); -} - void SvxIconChoiceCtrl_Impl::SetNoSelection() { // block recursive calls via SelectEntry From 8809bbc87e83488509391052b27ad690615f65ac Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Wed, 3 Jul 2024 10:34:20 +0200 Subject: [PATCH 097/232] tdf#161853 Drop unused SvxIconChoiceCtrl_Impl::{Set,Find}EntryPredecessor Both methods are unused since: Change-Id: I926b03a0f2054c21f8ab96eeee0083156443d2c0 Author: Michael Weghorn Date: Wed Jul 3 10:17:41 2024 +0200 tdf#161853 Drop unused SvxIconChoiceCtrl_Impl::SetEntryPos Further cleanup will be done in following commits. Change-Id: I4a412389669f9cbc6701b7ed78bd45f838e13590 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169912 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- vcl/source/control/imivctl.hxx | 4 -- vcl/source/control/imivctl1.cxx | 71 --------------------------------- 2 files changed, 75 deletions(-) diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index 76f170c68d63..a4b64ae751d7 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -331,10 +331,6 @@ public: void InitSettings(); tools::Rectangle GetOutputRect() const; - void SetEntryPredecessor(SvxIconChoiceCtrlEntry* pEntry,SvxIconChoiceCtrlEntry* pPredecessor); - // only delivers valid results when in AutoArrange mode! - SvxIconChoiceCtrlEntry* FindEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry, const Point& ); - void SetPositionMode( SvxIconChoiceCtrlPositionMode ); void SetEntryHighlightFrame(SvxIconChoiceCtrlEntry* pEntry); diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 6e1fd061fec8..64d947fb942c 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -2076,77 +2076,6 @@ void SvxIconChoiceCtrl_Impl::SetPositionMode( SvxIconChoiceCtrlPositionMode eMod } } -void SvxIconChoiceCtrl_Impl::SetEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry, - SvxIconChoiceCtrlEntry* pPredecessor ) -{ - if( !IsAutoArrange() ) - return; - - if( pEntry == pPredecessor ) - return; - - sal_uLong nPos1 = GetEntryListPos( pEntry ); - if( !pHead ) - { - if( pPredecessor ) - { - sal_uLong nPos2 = GetEntryListPos( pPredecessor ); - if( nPos1 == (nPos2 + 1) ) - return; // is already the predecessor - } - else if( !nPos1 ) - return; - - InitPredecessors(); - } - - if( !pPredecessor && pHead == pEntry ) - return; // is already the first one - - bool bSetHead = false; - if( !pPredecessor ) - { - bSetHead = true; - pPredecessor = pHead->pblink; - } - if( pEntry == pHead ) - { - pHead = pHead->pflink; - bSetHead = false; - } - if( pEntry != pPredecessor ) - { - pEntry->Unlink(); - pEntry->SetBacklink( pPredecessor ); - } - if( bSetHead ) - pHead = pEntry; - aAutoArrangeIdle.Start(); -} - -SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindEntryPredecessor( SvxIconChoiceCtrlEntry* pEntry, - const Point& rPosTopLeft ) -{ - Point aPos( rPosTopLeft ); //TopLeft - tools::Rectangle aCenterRect( CalcBmpRect( pEntry, &aPos )); - Point aNewPos( aCenterRect.Center() ); - GridId nGrid = GetPredecessorGrid( aNewPos ); - size_t nCount = maEntries.size(); - if( nGrid == GRID_NOT_FOUND ) - return nullptr; - if( nGrid >= nCount ) - nGrid = nCount - 1; - if( !pHead ) - return maEntries[ nGrid ].get(); - - SvxIconChoiceCtrlEntry* pCur = pHead; // Grid 0 - // TODO: go through list from the end if nGrid > nCount/2 - for( GridId nCur = 0; nCur < nGrid; nCur++ ) - pCur = pCur->pflink; - - return pCur; -} - GridId SvxIconChoiceCtrl_Impl::GetPredecessorGrid( const Point& rPos) const { Point aPos( rPos ); From 5b94bedf779f36f2b77b04171e7f6cc28cecbfc6 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Wed, 3 Jul 2024 10:38:56 +0200 Subject: [PATCH 098/232] tdf#161853 Drop unused SvxIconChoiceCtrl_Impl::InitPredecessors Unused since: Change-Id: I4a412389669f9cbc6701b7ed78bd45f838e13590 Author: Michael Weghorn Date: Wed Jul 3 10:34:20 2024 +0200 tdf#161853 Drop unused SvxIconChoiceCtrl_Impl::{Set,Find}EntryPredecessor Change-Id: I13ae34ffc51972bef746e53fcd46e65ea9fbf82c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169913 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- vcl/source/control/imivctl.hxx | 1 - vcl/source/control/imivctl1.cxx | 24 ------------------------ 2 files changed, 25 deletions(-) diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index a4b64ae751d7..b5d31de8e6e0 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -180,7 +180,6 @@ class SvxIconChoiceCtrl_Impl void ClipAtVirtOutRect( tools::Rectangle& rRect ) const; GridId GetPredecessorGrid( const Point& rDocPos) const; - void InitPredecessors(); void ClearPredecessors(); bool CheckVerScrollBar(); diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 64d947fb942c..c3402a5ff8fc 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -351,30 +351,6 @@ void SvxIconChoiceCtrl_Impl::AdjustVirtSize( const tools::Rectangle& rRect ) DocRectChanged(); } -void SvxIconChoiceCtrl_Impl::InitPredecessors() -{ - DBG_ASSERT(!pHead,"SvxIconChoiceCtrl_Impl::InitPredecessors() >> Already initialized"); - size_t nCount = maEntries.size(); - if( nCount ) - { - SvxIconChoiceCtrlEntry* pPrev = maEntries[ 0 ].get(); - for( size_t nCur = 1; nCur <= nCount; nCur++ ) - { - SvxIconChoiceCtrlEntry* pNext; - if( nCur == nCount ) - pNext = maEntries[ 0 ].get(); - else - pNext = maEntries[ nCur ].get(); - pPrev->pflink = pNext; - pNext->pblink = pPrev; - pPrev = pNext; - } - pHead = maEntries[ 0 ].get(); - } - else - pHead = nullptr; -} - void SvxIconChoiceCtrl_Impl::ClearPredecessors() { if( pHead ) From c04fd602ea58b9a373b3363441f0e5971165c1a6 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Wed, 3 Jul 2024 10:44:46 +0200 Subject: [PATCH 099/232] tdf#161853 Drop always null SvxIconChoiceCtrl_Impl::pHead With Change-Id: I13ae34ffc51972bef746e53fcd46e65ea9fbf82c Author: Michael Weghorn Date: Wed Jul 3 10:38:56 2024 +0200 tdf#161853 Drop unused SvxIconChoiceCtrl_Impl::InitPredecessors in place, it can be seen that `SvxIconChoiceCtrl_Impl::pHead` is always nullptr as it's initialized to that and never assigned a different value afterwards. Therefore, drop it and all related code. Drop the now unused `bKeepPredecessors` param from `SvxIconChoiceCtrl_Impl::Arrange` and `SvxIconChoiceCtrl_Impl::ImpArrange`. (Use `git show --ignore-space change` to more clearly see the "actual changes"). Change-Id: I44eceb41866bb6d99ccea032f98637a42dabc9ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169914 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- vcl/source/control/imivctl.hxx | 11 +--- vcl/source/control/imivctl1.cxx | 98 ++++++--------------------------- vcl/source/control/ivctrl.cxx | 8 +-- 3 files changed, 23 insertions(+), 94 deletions(-) diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index b5d31de8e6e0..a782b2a56f58 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -133,7 +133,6 @@ class SvxIconChoiceCtrl_Impl DrawTextFlags nCurTextDrawFlags; ImplSVEvent * nUserEventAdjustScrBars; SvxIconChoiceCtrlEntry* pCurHighlightFrame; - SvxIconChoiceCtrlEntry* pHead = nullptr; // top left entry SvxIconChoiceCtrlEntry* pCursor; LocalFocus aFocus; // Data for focusrect ::vcl::AccessibleFactoryAccess aAccFactory; @@ -143,7 +142,7 @@ class SvxIconChoiceCtrl_Impl void ShowCursor( bool bShow ); - void ImpArrange( bool bKeepPredecessors ); + void ImpArrange(); void AdjustVirtSize( const tools::Rectangle& ); void ResetVirtSize(); void CheckScrollBars(); @@ -180,8 +179,6 @@ class SvxIconChoiceCtrl_Impl void ClipAtVirtOutRect( tools::Rectangle& rRect ) const; GridId GetPredecessorGrid( const Point& rDocPos) const; - void ClearPredecessors(); - bool CheckVerScrollBar(); bool CheckHorScrollBar(); void CancelUserEvents(); @@ -252,11 +249,7 @@ public: void MakeEntryVisible( SvxIconChoiceCtrlEntry* pEntry, bool bBound = true ); - void Arrange( - bool bKeepPredecessors, - tools::Long nSetMaxVirtWidth, - tools::Long nSetMaxVirtHeight - ); + void Arrange(tools::Long nSetMaxVirtWidth, tools::Long nSetMaxVirtHeight); tools::Rectangle CalcFocusRect( SvxIconChoiceCtrlEntry* ); tools::Rectangle CalcBmpRect( SvxIconChoiceCtrlEntry*, const Point* pPos = nullptr ); diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index c3402a5ff8fc..960ad1ed9822 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -63,7 +63,6 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl( pView(pCurView), nMaxVirtWidth(DEFAULT_MAX_VIRT_WIDTH), nMaxVirtHeight(DEFAULT_MAX_VIRT_HEIGHT), nFlags(IconChoiceFlags::NONE), nUserEventAdjustScrBars(nullptr), pCurHighlightFrame(nullptr), - pHead(nullptr), pCursor(nullptr), ePositionMode(SvxIconChoiceCtrlPositionMode::Free) { @@ -177,9 +176,6 @@ void SvxIconChoiceCtrl_Impl::InsertEntry( std::unique_ptrSetBacklink( pHead->pblink ); - if( (nFlags & IconChoiceFlags::EntryListPosValid) && nPos >= maEntries.size() - 1 ) pEntry->nPos = maEntries.size() - 1; else @@ -351,22 +347,7 @@ void SvxIconChoiceCtrl_Impl::AdjustVirtSize( const tools::Rectangle& rRect ) DocRectChanged(); } -void SvxIconChoiceCtrl_Impl::ClearPredecessors() -{ - if( pHead ) - { - size_t nCount = maEntries.size(); - for( size_t nCur = 0; nCur < nCount; nCur++ ) - { - SvxIconChoiceCtrlEntry* pCur = maEntries[ nCur ].get(); - pCur->pflink = nullptr; - pCur->pblink = nullptr; - } - pHead = nullptr; - } -} - -void SvxIconChoiceCtrl_Impl::Arrange( bool bKeepPredecessors, tools::Long nSetMaxVirtWidth, tools::Long nSetMaxVirtHeight ) +void SvxIconChoiceCtrl_Impl::Arrange(tools::Long nSetMaxVirtWidth, tools::Long nSetMaxVirtHeight ) { if ( nSetMaxVirtWidth != 0 ) nMaxVirtWidth = nSetMaxVirtWidth; @@ -378,17 +359,15 @@ void SvxIconChoiceCtrl_Impl::Arrange( bool bKeepPredecessors, tools::Long nSetMa else nMaxVirtHeight = aOutputSize.Height(); - ImpArrange( bKeepPredecessors ); + ImpArrange(); } -void SvxIconChoiceCtrl_Impl::ImpArrange( bool bKeepPredecessors ) +void SvxIconChoiceCtrl_Impl::ImpArrange() { aAutoArrangeIdle.Stop(); nFlags |= IconChoiceFlags::Arranging; ShowCursor( false ); ResetVirtSize(); - if( !bKeepPredecessors ) - ClearPredecessors(); bBoundRectsDirty = false; SetOrigin( Point() ); VisRectChanged(); @@ -1335,41 +1314,18 @@ void SvxIconChoiceCtrl_Impl::RecalcAllBoundingRectsSmart() SvxIconChoiceCtrlEntry* pEntry; const size_t nCount = maEntries.size(); - if( !IsAutoArrange() || !pHead ) + for( nCur = 0; nCur < nCount; nCur++ ) { - for( nCur = 0; nCur < nCount; nCur++ ) + pEntry = maEntries[ nCur ].get(); + if( IsBoundingRectValid( pEntry->aRect )) { - pEntry = maEntries[ nCur ].get(); - if( IsBoundingRectValid( pEntry->aRect )) - { - Size aBoundSize( pEntry->aRect.GetSize() ); - if( aBoundSize.Height() > nMaxBoundHeight ) - nMaxBoundHeight = aBoundSize.Height(); - } - else - FindBoundingRect( pEntry ); - maZOrderList.push_back( pEntry ); - } - } - else - { - nCur = 0; - pEntry = pHead; - while( nCur != nCount ) - { - DBG_ASSERT(pEntry->pflink&&pEntry->pblink,"SvxIconChoiceCtrl_Impl::RecalcAllBoundingRect > Bad link(s)"); - if( IsBoundingRectValid( pEntry->aRect )) - { - Size aBoundSize( pEntry->aRect.GetSize() ); - if( aBoundSize.Height() > nMaxBoundHeight ) - nMaxBoundHeight = aBoundSize.Height(); - } - else - FindBoundingRect( pEntry ); - maZOrderList.push_back( pEntry ); - pEntry = pEntry->pflink; - nCur++; + Size aBoundSize( pEntry->aRect.GetSize() ); + if( aBoundSize.Height() > nMaxBoundHeight ) + nMaxBoundHeight = aBoundSize.Height(); } + else + FindBoundingRect( pEntry ); + maZOrderList.push_back( pEntry ); } AdjustScrollBars(); } @@ -1835,7 +1791,7 @@ bool SvxIconChoiceCtrl_Impl::IsOver(const std::vector& rRects, IMPL_LINK_NOARG(SvxIconChoiceCtrl_Impl, AutoArrangeHdl, Timer *, void) { aAutoArrangeIdle.Stop(); - Arrange( IsAutoArrange(), 0, 0 ); + Arrange(0, 0); } IMPL_LINK_NOARG(SvxIconChoiceCtrl_Impl, VisRectChangedHdl, Timer *, void) @@ -1953,32 +1909,12 @@ void SvxIconChoiceCtrl_Impl::InvalidateEntry( SvxIconChoiceCtrlEntry* pEntry ) SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry() const { size_t nCount = maEntries.size(); - if( !pHead ) + for( size_t nCur = 0; nCur < nCount; nCur++ ) { - for( size_t nCur = 0; nCur < nCount; nCur++ ) + SvxIconChoiceCtrlEntry* pEntry = maEntries[ nCur ].get(); + if( pEntry->IsSelected() ) { - SvxIconChoiceCtrlEntry* pEntry = maEntries[ nCur ].get(); - if( pEntry->IsSelected() ) - { - return pEntry; - } - } - } - else - { - SvxIconChoiceCtrlEntry* pEntry = pHead; - while( nCount-- ) - { - if( pEntry->IsSelected() ) - { - return pEntry; - } - pEntry = pEntry->pflink; - if( nCount && pEntry == pHead ) - { - OSL_FAIL("SvxIconChoiceCtrl_Impl::GetFirstSelectedEntry > infinite loop!"); - return nullptr; - } + return pEntry; } } return nullptr; diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx index 9d4da5e434ce..765f1f0b2637 100644 --- a/vcl/source/control/ivctrl.cxx +++ b/vcl/source/control/ivctrl.cxx @@ -151,7 +151,7 @@ void SvtIconChoiceCtrl::ArrangeIcons() aFullSize.setWidth ( aFullSize.getWidth()+aEntryRect.GetWidth() ); } - _pImpl->Arrange ( false, aFullSize.getWidth(), 0 ); + _pImpl->Arrange(aFullSize.getWidth(), 0); } else if ( GetStyle() & WB_ALIGN_LEFT ) { @@ -166,13 +166,13 @@ void SvtIconChoiceCtrl::ArrangeIcons() aFullSize.setHeight ( aFullSize.getHeight()+aEntryRect.GetHeight() ); } - _pImpl->Arrange ( false, 0, aFullSize.getHeight() ); + _pImpl->Arrange(0, aFullSize.getHeight()); } else { - _pImpl->Arrange(false, 0, 0); + _pImpl->Arrange(0, 0); } - _pImpl->Arrange( false, 0, 1000 ); + _pImpl->Arrange(0, 1000 ); } void SvtIconChoiceCtrl::Resize() { From 5db79db0f0c7c432d933433192506d234f6cd26e Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Wed, 3 Jul 2024 10:54:48 +0200 Subject: [PATCH 100/232] tdf#161853 Drop unused SvxIconChoiceCtrl_Impl::GetPredecessorGrid Unused since: Change-Id: I4a412389669f9cbc6701b7ed78bd45f838e13590 Author: Michael Weghorn Date: Wed Jul 3 10:34:20 2024 +0200 tdf#161853 Drop unused SvxIconChoiceCtrl_Impl::{Set,Find}EntryPredecessor Change-Id: I3688c74d0cdf01c68913767f6aa214c54ab719cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169915 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- vcl/source/control/imivctl.hxx | 1 - vcl/source/control/imivctl1.cxx | 25 ------------------------- 2 files changed, 26 deletions(-) diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index a782b2a56f58..fb0d61f9ef6e 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -177,7 +177,6 @@ class SvxIconChoiceCtrl_Impl tools::Rectangle CalcMaxTextRect( const SvxIconChoiceCtrlEntry* pEntry ) const; void ClipAtVirtOutRect( tools::Rectangle& rRect ) const; - GridId GetPredecessorGrid( const Point& rDocPos) const; bool CheckVerScrollBar(); bool CheckHorScrollBar(); diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 960ad1ed9822..9217c8182b0f 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -1988,31 +1988,6 @@ void SvxIconChoiceCtrl_Impl::SetPositionMode( SvxIconChoiceCtrlPositionMode eMod } } -GridId SvxIconChoiceCtrl_Impl::GetPredecessorGrid( const Point& rPos) const -{ - Point aPos( rPos ); - aPos.AdjustX( -(LROFFS_WINBORDER) ); - aPos.AdjustY( -(TBOFFS_WINBORDER) ); - tools::Long nMaxCol = aVirtOutputSize.Width() / nGridDX; - if( nMaxCol ) - nMaxCol--; - tools::Long nGridX = aPos.X() / nGridDX; - if( nGridX > nMaxCol ) - nGridX = nMaxCol; - tools::Long nGridY = aPos.Y() / nGridDY; - tools::Long nGridsX = aOutputSize.Width() / nGridDX; - GridId nGrid = (nGridY * nGridsX) + nGridX; - tools::Long nMiddle = (nGridX * nGridDX) + (nGridDX / 2); - if( rPos.X() < nMiddle ) - { - if( !nGrid ) - nGrid = GRID_NOT_FOUND; - else - nGrid--; - } - return nGrid; -} - bool SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt ) { if ( !(rHEvt.GetMode() & HelpEventMode::QUICK ) ) From 93516e9181d321fe2579308d95de85cefe21a05d Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Wed, 3 Jul 2024 10:59:38 +0200 Subject: [PATCH 101/232] tdf#161853 SvxIconChoiceCtrlEntry: Drop means to manually set neighbours This mechanism to manually sort the entries by setting a link/pointer to the neighbours isn't actually used, so drop the code to maintain a linked list. See Change-Id: I44eceb41866bb6d99ccea032f98637a42dabc9ee Author: Michael Weghorn Date: Wed Jul 3 10:44:46 2024 +0200 tdf#161853 Drop always null SvxIconChoiceCtrl_Impl::pHead Change-Id: Ib939145999725232d803103dc1fd0b49fa2d425a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169916 Reviewed-by: Michael Weghorn Tested-by: Jenkins --- include/vcl/toolkit/ivctrl.hxx | 25 ------------------------- vcl/source/control/ivctrl.cxx | 2 -- 2 files changed, 27 deletions(-) diff --git a/include/vcl/toolkit/ivctrl.hxx b/include/vcl/toolkit/ivctrl.hxx index 059494b5e05e..2973b74f2015 100644 --- a/include/vcl/toolkit/ivctrl.hxx +++ b/include/vcl/toolkit/ivctrl.hxx @@ -73,14 +73,6 @@ class SvxIconChoiceCtrlEntry tools::Rectangle aGridRect; // Only valid in Grid-mode sal_Int32 nPos; - /* - The insert position in the Insertlist is equal to the (sort) order stated at the Insert - (-> Order of the anchors in the anchors-list!). In "AutoArrange" mode the visible order - can differ. The entries will be linked because of this. - */ - SvxIconChoiceCtrlEntry* pblink; // backward (left neighbour) - SvxIconChoiceCtrlEntry* pflink; // forward (right neighbour) - SvxIconChoiceCtrlTextMode eTextMode; sal_uInt16 nX,nY; // for keyboard control SvxIconViewFlags nFlags; @@ -89,23 +81,6 @@ class SvxIconChoiceCtrlEntry void SetFlags( SvxIconViewFlags nMask ) { nFlags |= nMask; } void AssignFlags( SvxIconViewFlags _nFlags ) { nFlags = _nFlags; } - // set left neighbour (A <-> B ==> A <-> this <-> B) - void SetBacklink( SvxIconChoiceCtrlEntry* pA ) - { - pA->pflink->pblink = this; // X <- B - this->pflink = pA->pflink; // X -> B - this->pblink = pA; // A <- X - pA->pflink = this; // A -> X - } - // Unlink (A <-> this <-> B ==> A <-> B) - void Unlink() - { - this->pblink->pflink = this->pflink; - this->pflink->pblink = this->pblink; - this->pflink = nullptr; - this->pblink = nullptr; - } - public: SvxIconChoiceCtrlEntry( OUString aText, Image aImage ); diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx index 765f1f0b2637..1cab3e097c77 100644 --- a/vcl/source/control/ivctrl.cxx +++ b/vcl/source/control/ivctrl.cxx @@ -59,8 +59,6 @@ SvxIconChoiceCtrlEntry::SvxIconChoiceCtrlEntry( OUString _aText, : aImage(std::move(_aImage)) , aText(std::move(_aText)) , nPos(0) - , pblink(nullptr) - , pflink(nullptr) , eTextMode(SvxIconChoiceCtrlTextMode::Short) , nX(0) , nY(0) From 9df3294ed8d3224910dc182eca1650ff637b9e22 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Mon, 1 Jul 2024 23:03:47 +0200 Subject: [PATCH 102/232] ppt export: Respect user defined initials instead of generating new ones. Change-Id: If64690ac2aa22542e6b3939f3ed9cdc3c9f3be84 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169844 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt --- sd/source/filter/eppt/eppt.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx index 1d0f242c20b1..1d7d564de8f6 100644 --- a/sd/source/filter/eppt/eppt.cxx +++ b/sd/source/filter/eppt/eppt.cxx @@ -1054,7 +1054,10 @@ void PPTWriter::ImplExportComments( const uno::Reference< drawing::XDrawPage >& : xAnnotation->getAuthor() ); uno::Reference< text::XText > xText( xAnnotation->getTextRange() ); OUString sText( xText->getString() ); - OUString sInitials( GetInitials( sAuthor ) ); + OUString sInitials( + bRemoveCommentAuthorDates + ? "A" + OUString::number(mpAuthorIDs->GetInfoID(xAnnotation->getAuthor())) + : xAnnotation->getInitials()); util::DateTime aEmptyDateTime; util::DateTime aDateTime(bRemoveCommentAuthorDates ? aEmptyDateTime : xAnnotation->getDateTime()); From 2dfcc67fbc80892d136a11322e68d24ed0511171 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Mon, 1 Jul 2024 23:38:59 +0200 Subject: [PATCH 103/232] Fix TODO Change-Id: I77b4609d796978fefab1c60034310f890e3b973e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169845 Reviewed-by: Samuel Mehrbrodt Tested-by: Jenkins --- oox/source/ppt/comments.cxx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/oox/source/ppt/comments.cxx b/oox/source/ppt/comments.cxx index b85d95b4a692..7082649dd9a7 100644 --- a/oox/source/ppt/comments.cxx +++ b/oox/source/ppt/comments.cxx @@ -20,14 +20,13 @@ void CommentAuthorList::setValues(const CommentAuthorList& list) { for (auto const& author : list.cmAuthorLst) { - CommentAuthor temp; - // TODO JNA : why not doing push_back at the end instead of using back()? - cmAuthorLst.push_back(temp); - cmAuthorLst.back().clrIdx = author.clrIdx; - cmAuthorLst.back().id = author.id; - cmAuthorLst.back().initials = author.initials; - cmAuthorLst.back().lastIdx = author.lastIdx; - cmAuthorLst.back().name = author.name; + CommentAuthor commentAuthor; + commentAuthor.clrIdx = author.clrIdx; + commentAuthor.id = author.id; + commentAuthor.initials = author.initials; + commentAuthor.lastIdx = author.lastIdx; + commentAuthor.name = author.name; + cmAuthorLst.push_back(commentAuthor); } } From 9b72524722efbc60532a04bb55660a3c35696adf Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Mon, 1 Jul 2024 23:43:01 +0200 Subject: [PATCH 104/232] pptx export: Respect user defined initials instead of generating new ones. Change-Id: I8979eaa694642cebd552534eeddcff5483831e6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169846 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt --- sd/source/filter/eppt/epptbase.hxx | 1 - sd/source/filter/eppt/epptooxml.hxx | 3 ++- sd/source/filter/eppt/pptx-epptbase.cxx | 20 -------------------- sd/source/filter/eppt/pptx-epptooxml.cxx | 12 +++++++++--- 4 files changed, 11 insertions(+), 25 deletions(-) diff --git a/sd/source/filter/eppt/epptbase.hxx b/sd/source/filter/eppt/epptbase.hxx index 18199210cc6b..70bcd3a4b6ce 100644 --- a/sd/source/filter/eppt/epptbase.hxx +++ b/sd/source/filter/eppt/epptbase.hxx @@ -379,7 +379,6 @@ protected: ::tools::Rectangle MapRectangle( const css::awt::Rectangle& ); bool ContainsOtherShapeThanPlaceholders(); - static OUString GetInitials(std::u16string_view sName); public: PPTWriterBase(); diff --git a/sd/source/filter/eppt/epptooxml.hxx b/sd/source/filter/eppt/epptooxml.hxx index 9646afb865d8..7d1fa57f11d3 100644 --- a/sd/source/filter/eppt/epptooxml.hxx +++ b/sd/source/filter/eppt/epptooxml.hxx @@ -109,7 +109,7 @@ private: sal_uInt32 GetNewSlideId() { return mnSlideIdMax ++; } sal_uInt32 GetNewSlideMasterId() { return mnSlideMasterIdMax ++; } - sal_Int32 GetAuthorIdAndLastIndex( const OUString& sAuthor, sal_Int32& nLastIndex ); + sal_Int32 GetAuthorIdAndLastIndex( const OUString& sAuthor, const OUString& sInitials, sal_Int32& nLastIndex ); // Write docProps/core.xml and docprops/custom.xml and docprops/app.xml void writeDocumentProperties(); @@ -165,6 +165,7 @@ private: struct AuthorComments { sal_Int32 nId; sal_Int32 nLastIndex; + OUString sInitials; }; typedef std::unordered_map< OUString, struct AuthorComments > AuthorsMap; AuthorsMap maAuthors; diff --git a/sd/source/filter/eppt/pptx-epptbase.cxx b/sd/source/filter/eppt/pptx-epptbase.cxx index fe9444865797..eebf01410c15 100644 --- a/sd/source/filter/eppt/pptx-epptbase.cxx +++ b/sd/source/filter/eppt/pptx-epptbase.cxx @@ -998,24 +998,4 @@ bool PPTWriterBase::ContainsOtherShapeThanPlaceholders() return bOtherThanPlaceHolders; } -OUString PPTWriterBase::GetInitials(std::u16string_view sName) -{ - OUStringBuffer sRet; - - if (!sName.empty()) - { - sRet.append(sName[0]); - size_t nStart = 0, nOffset; - - while ((nOffset = sName.find(' ', nStart)) != std::u16string_view::npos) - { - if (nOffset + 1 < sName.size()) - sRet.append(sName[ nOffset + 1 ]); - nStart = nOffset + 1; - } - } - - return sRet.makeStringAndClear(); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index f7379a3cd68e..6c1b8c466e01 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -1036,7 +1036,7 @@ void PowerPointExport::WriteAuthors() pFS->singleElementNS(XML_p, XML_cmAuthor, XML_id, OString::number(i.second.nId), XML_name, i.first, - XML_initials, GetInitials(i.first), + XML_initials, i.second.sInitials, XML_lastIdx, OString::number(i.second.nLastIndex), XML_clrIdx, OString::number(i.second.nId)); } @@ -1046,7 +1046,9 @@ void PowerPointExport::WriteAuthors() pFS->endDocument(); } -sal_Int32 PowerPointExport::GetAuthorIdAndLastIndex(const OUString& sAuthor, sal_Int32& nLastIndex) +sal_Int32 PowerPointExport::GetAuthorIdAndLastIndex(const OUString& sAuthor, + const OUString& sInitials, + sal_Int32& nLastIndex) { if (maAuthors.count(sAuthor) <= 0) { @@ -1054,6 +1056,7 @@ sal_Int32 PowerPointExport::GetAuthorIdAndLastIndex(const OUString& sAuthor, sal aAuthorComments.nId = maAuthors.size(); aAuthorComments.nLastIndex = 0; + aAuthorComments.sInitials = sInitials; maAuthors[ sAuthor ] = aAuthorComments; } @@ -1172,7 +1175,10 @@ bool PowerPointExport::WriteComments(sal_uInt32 nPageNum) ? "Author" + OUString::number(GetInfoID(xAnnotation->getAuthor())) : xAnnotation->getAuthor()); - sal_Int32 nId = GetAuthorIdAndLastIndex(sAuthor, nLastIndex); + OUString sInitials(bRemoveCommentAuthorDates + ? "A" + OUString::number(GetInfoID(xAnnotation->getAuthor())) + : xAnnotation->getInitials()); + sal_Int32 nId = GetAuthorIdAndLastIndex(sAuthor, sInitials, nLastIndex); char cDateTime[sizeof("-32768-65535-65535T65535:65535:65535.4294967295")]; // reserve enough space for hypothetical max length From 3958f65b8e5d28bf2e4a7854f7446bebf427e23b Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Mon, 1 Jul 2024 23:44:30 +0200 Subject: [PATCH 105/232] pptx: Import comment author initials Change-Id: Ic5838c929db9c08d6d9c6e1c87160dc2530105e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169847 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt --- include/oox/ppt/comments.hxx | 1 + oox/source/ppt/comments.cxx | 11 +++++++++++ oox/source/ppt/presentationfragmenthandler.cxx | 1 + 3 files changed, 13 insertions(+) diff --git a/include/oox/ppt/comments.hxx b/include/oox/ppt/comments.hxx index 10cad1270a1c..fb858e83d021 100644 --- a/include/oox/ppt/comments.hxx +++ b/include/oox/ppt/comments.hxx @@ -97,6 +97,7 @@ class Comment return y.toInt32(); } OUString getAuthor ( const CommentAuthorList& list ); + OUString getInitials ( const CommentAuthorList& list ); }; class CommentList diff --git a/oox/source/ppt/comments.cxx b/oox/source/ppt/comments.cxx index 7082649dd9a7..37fa924e786f 100644 --- a/oox/source/ppt/comments.cxx +++ b/oox/source/ppt/comments.cxx @@ -76,6 +76,17 @@ OUString Comment::getAuthor(const CommentAuthorList& list) return u"Anonymous"_ustr; } +OUString Comment::getInitials(const CommentAuthorList& list) +{ + const sal_Int32 nId = authorId.toInt32(); + for (auto const& author : list.cmAuthorLst) + { + if (author.id.toInt32() == nId) + return author.initials; + } + return u"A"_ustr; +} + const Comment& CommentList::getCommentAtIndex(int index) { if (index < 0 || o3tl::make_unsigned(index) >= cmLst.size()) diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index c8783a7da976..9a1ea8679cef 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -595,6 +595,7 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, bool bFirstPage ::oox::drawingml::convertEmuToHmm( nPosX ) * 15.87, ::oox::drawingml::convertEmuToHmm( nPosY ) * 15.87 ) ); xAnnotation->setAuthor( aComment.getAuthor(maAuthorList) ); + xAnnotation->setInitials( aComment.getInitials(maAuthorList) ); xAnnotation->setDateTime( aComment.getDateTime() ); uno::Reference< text::XText > xText( xAnnotation->getTextRange() ); xText->setString( aComment.get_text()); From 4d43de52e0597076a81b8f8e5cee1afbf0b84b8b Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Wed, 3 Jul 2024 11:14:06 +0200 Subject: [PATCH 106/232] tdf#161853 Drop IconChoiceFlags::SelectingRect Since commit 35775e291d6570b29dc0120e4839c720152b5149 Author: Michael Weghorn Date: Tue Jul 2 12:34:57 2024 +0200 tdf#161853 Drop now unused SvxIconChoiceCtrl_Impl::SelectRect etc. , that flag is never set, so there's no need to check for that. Drop it. Change-Id: Ibc2efdfc9b54c19bb90c2e71cc80e0cb4a0321a1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169970 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- vcl/source/control/imivctl.hxx | 7 +++---- vcl/source/control/imivctl1.cxx | 5 +---- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index fb0d61f9ef6e..7a09609a8716 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -52,10 +52,9 @@ class IcnGridMap_Impl; enum class IconChoiceFlags { NONE = 0x0000, AddMode = 0x0001, - SelectingRect = 0x0002, - EntryListPosValid = 0x0004, - ClearingSelection = 0x0008, - Arranging = 0x0010, + EntryListPosValid = 0x0002, + ClearingSelection = 0x0004, + Arranging = 0x0008, }; namespace o3tl { template<> struct typed_flags : is_typed_flags {}; diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 9217c8182b0f..f96873d940e8 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -266,10 +266,7 @@ void SvxIconChoiceCtrl_Impl::EntrySelected(SvxIconChoiceCtrlEntry* pEntry, bool SetCursor(pEntry); } - // Not when dragging though, else the loop in SelectRect doesn't work - // correctly! - if (!(nFlags & IconChoiceFlags::SelectingRect)) - ToTop(pEntry); + ToTop(pEntry); if (pEntry == pCursor) ShowCursor(false); From f4a755cf7de2d028f5c47c1d0223422d00a05e47 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Wed, 3 Jul 2024 11:53:59 +0200 Subject: [PATCH 107/232] tdf#161853 Simplify SvxIconChoiceCtrl_Impl::RepaintSelectedEntries * Drop superfluous check at the start. (Loop will just do nothing if there are no elements.) * Use range-based for. Change-Id: Idbe0ba67268cf76d38b27fcf94e59eb8abd5f566 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169971 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- vcl/source/control/imivctl1.cxx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index f96873d940e8..fbbc481eab32 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -473,14 +473,9 @@ void SvxIconChoiceCtrl_Impl::Paint(vcl::RenderContext& rRenderContext, const too void SvxIconChoiceCtrl_Impl::RepaintSelectedEntries() { - const size_t nCount = maZOrderList.size(); - if (!nCount) - return; - tools::Rectangle aOutRect(GetOutputRect()); - for (size_t nCur = 0; nCur < nCount; nCur++) + for (SvxIconChoiceCtrlEntry* pEntry : maZOrderList) { - SvxIconChoiceCtrlEntry* pEntry = maZOrderList[nCur]; if (pEntry->GetFlags() & SvxIconViewFlags::SELECTED) { const tools::Rectangle& rBoundRect = GetEntryBoundRect(pEntry); From a52b152b4152db97bac70cd31dd707373c574400 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Wed, 3 Jul 2024 12:40:06 +0200 Subject: [PATCH 108/232] tdf#144981 tdf#161853 icon choice ctrl: One selection border is enough The previous `if (bSelected)` body a little bit further up in `SvxIconChoiceCtrl_Impl::PaintEntry` already has rRenderContext.DrawRect(CalcFocusRect(pEntry)); to draw a border around the selected entry. One border is enough, so don't draw another one using `vcl::RenderTools::DrawSelectionBackground` (pass false instead of true for the `bDrawBorder` param). For the gen and the Qt-based VCL plugins that use Cairo rendering by default, this avoids the additional misplaced and not properly cleared selection rectangle. See tdf#144981 comment 6 for where the problematic handling in the Cairo rendering path is, but which also mentions that changing this would break other things. For then gen VCL plugin using Skia (`SAL_FORCESKIA=1`) or on Windows, I see no visual change for either the "Hyperlink" dialog (Ctrl+K) or the "Page Style" dialog (Alt+Shift+P) in Writer with this change in place while moving focus between entries. On Windows, when moving focus out of the icon choice control (into the tab page), the border now remains black on all sides instead of being partially black (at least the top border) and partially blue (at least the bottom border), so it's more consistent there as well now. Change-Id: I6db415344e9276ce89d41c6b40fb93fc38ddf9a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169972 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- vcl/source/control/imivctl1.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index fbbc481eab32..b92972a55937 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -1104,7 +1104,7 @@ void SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po if (bSelected) vcl::RenderTools::DrawSelectionBackground(rRenderContext, *pView, CalcFocusRect(pEntry), - bActiveSelection ? 1 : 2, false, true, false); + bActiveSelection ? 1 : 2, false, false, false); PaintItem(aBmpRect, IcnViewFieldType::Image, pEntry, nBmpPaintFlags, rRenderContext); From 31398962c1700e17eff979277ec4d6ce20c0bb34 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Thu, 4 Jul 2024 09:23:23 +0500 Subject: [PATCH 109/232] VS natvis: improve handling of SwFlowFrame derivatives Change-Id: I3fe2169c3b6f016a850dc0df6a248d207a65fb17 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169973 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- solenv/vs/LibreOffice.natvis | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/solenv/vs/LibreOffice.natvis b/solenv/vs/LibreOffice.natvis index 4ce4fcbfd198..f737b9b760b1 100644 --- a/solenv/vs/LibreOffice.natvis +++ b/solenv/vs/LibreOffice.natvis @@ -490,13 +490,22 @@ (SwLayoutFrame&)(*this) + + {{Follow {m_rThis,view(min)nd}}} + {{{m_rThis,view(min)nd}}} + - {{Follow {(SwFrame&)*this,view(min)}}} - {(SwFrame&)*this} + {(SwFlowFrame&)*this} (SwLayoutFrame&)(*this) + + {(SwFlowFrame&)*this} + + (SwFrame&)(*this) + + Optional not set {*reinterpret_cast<$T1 *>(m_storage.dummy_.data)} From 890916578fc765845922284101599dcf4ece1e58 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 3 Jul 2024 14:26:39 +0200 Subject: [PATCH 110/232] tdf#152104 speed xls->ods convert part 1 we now have 16k columns, so storing a flat array of columns where most of them are empty is bad for performance. Rather store a sorted data-structure of all the ranges, reduces time from > 5 mins to ~50s. Change-Id: I92327daf06469c1b9d1f4c427b8ebf812641a8e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169940 Reviewed-by: Noel Grandin Tested-by: Jenkins --- .../filter/xml/XMLStylesExportHelper.cxx | 79 ++++++++----------- .../filter/xml/XMLStylesExportHelper.hxx | 8 +- sc/source/filter/xml/xmlexprt.cxx | 4 - 3 files changed, 34 insertions(+), 57 deletions(-) diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx index 13abd8808d01..f58c25f376a1 100644 --- a/sc/source/filter/xml/XMLStylesExportHelper.cxx +++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx @@ -647,13 +647,11 @@ ScMyFormatRange::ScMyFormatRange() bool ScMyFormatRange::operator<(const ScMyFormatRange& rRange) const { - if (aRangeAddress.StartRow < rRange.aRangeAddress.StartRow) + if (aRangeAddress.Sheet < rRange.aRangeAddress.Sheet) return true; - else - if (aRangeAddress.StartRow == rRange.aRangeAddress.StartRow) - return (aRangeAddress.StartColumn < rRange.aRangeAddress.StartColumn); - else - return false; + if (aRangeAddress.Sheet > rRange.aRangeAddress.Sheet) + return false; + return aRangeAddress.StartRow < rRange.aRangeAddress.StartRow; } ScFormatRangeStyles::ScFormatRangeStyles() @@ -665,16 +663,6 @@ ScFormatRangeStyles::~ScFormatRangeStyles() { } -void ScFormatRangeStyles::AddNewTable(const sal_Int32 nTable) -{ - sal_Int32 nSize = aTables.size() - 1; - if (nTable > nSize) - for (sal_Int32 i = nSize; i < nTable; ++i) - { - aTables.emplace_back(); - } -} - bool ScFormatRangeStyles::AddStyleName(OUString const & rString, sal_Int32& rIndex, const bool bIsAutoStyle) { if (bIsAutoStyle) @@ -759,12 +747,17 @@ sal_Int32 ScFormatRangeStyles::GetIndexOfStyleName(std::u16string_view rString, sal_Int32 ScFormatRangeStyles::GetStyleNameIndex(const sal_Int32 nTable, const sal_Int32 nColumn, const sal_Int32 nRow, bool& bIsAutoStyle) const { - OSL_ENSURE(o3tl::make_unsigned(nTable) < aTables.size(), "wrong table"); + ScMyFormatRange aNeedle; + aNeedle.aRangeAddress.Sheet = nTable; + aNeedle.aRangeAddress.StartRow = nRow; bIsAutoStyle = false; - if (o3tl::make_unsigned(nTable) >= aTables.size()) - return -1; - for (const ScMyFormatRange & rFormatRange : aTables[nTable]) + for (auto it = maFormatRanges.lower_bound(aNeedle); it != maFormatRanges.end(); ++it) { + const ScMyFormatRange& rFormatRange = *it; + if (rFormatRange.aRangeAddress.Sheet > nTable) + break; + if (rFormatRange.aRangeAddress.StartRow > nRow) + break; if ((rFormatRange.aRangeAddress.StartColumn <= nColumn) && (rFormatRange.aRangeAddress.EndColumn >= nColumn) && (rFormatRange.aRangeAddress.StartRow <= nRow) && @@ -780,18 +773,16 @@ sal_Int32 ScFormatRangeStyles::GetStyleNameIndex(const sal_Int32 nTable, sal_Int32 ScFormatRangeStyles::GetStyleNameIndex(const sal_Int32 nTable, const sal_Int32 nColumn, const sal_Int32 nRow, bool& bIsAutoStyle, sal_Int32& nValidationIndex, sal_Int32& nNumberFormat, const sal_Int32 nRemoveBeforeRow) { - OSL_ENSURE(o3tl::make_unsigned(nTable) < aTables.size(), "wrong table"); - if (o3tl::make_unsigned(nTable) >= aTables.size()) - return -1; - ScMyFormatRangeAddresses& rFormatRanges(aTables[nTable]); - ScMyFormatRangeAddresses::iterator aItr(rFormatRanges.begin()); - ScMyFormatRangeAddresses::iterator aEndItr(rFormatRanges.end()); - while (aItr != aEndItr) + ScMyFormatRange aNeedle; + aNeedle.aRangeAddress.Sheet = nTable; + for (auto aItr = maFormatRanges.lower_bound(aNeedle); aItr != maFormatRanges.end(); ) { - if (((*aItr).aRangeAddress.StartColumn <= nColumn) && - ((*aItr).aRangeAddress.EndColumn >= nColumn) && - ((*aItr).aRangeAddress.StartRow <= nRow) && - ((*aItr).aRangeAddress.EndRow >= nRow)) + if (aItr->aRangeAddress.Sheet > nTable) + break; + if ((aItr->aRangeAddress.StartColumn <= nColumn) && + (aItr->aRangeAddress.EndColumn >= nColumn) && + (aItr->aRangeAddress.StartRow <= nRow) && + (aItr->aRangeAddress.EndRow >= nRow)) { bIsAutoStyle = aItr->bIsAutoStyle; nValidationIndex = aItr->nValidationIndex; @@ -808,7 +799,7 @@ sal_Int32 ScFormatRangeStyles::GetStyleNameIndex(const sal_Int32 nTable, const s else { if ((*aItr).aRangeAddress.EndRow < nRemoveBeforeRow) - aItr = rFormatRanges.erase(aItr); + aItr = maFormatRanges.erase(aItr); else ++aItr; } @@ -820,13 +811,15 @@ void ScFormatRangeStyles::GetFormatRanges(const sal_Int32 nStartColumn, const sa const sal_Int32 nTable, ScRowFormatRanges* pRowFormatRanges) { sal_Int32 nTotalColumns(nEndColumn - nStartColumn + 1); - OSL_ENSURE(o3tl::make_unsigned(nTable) < aTables.size(), "wrong table"); - ScMyFormatRangeAddresses& rFormatRanges(aTables[nTable]); - ScMyFormatRangeAddresses::iterator aItr(rFormatRanges.begin()); - ScMyFormatRangeAddresses::iterator aEndItr(rFormatRanges.end()); sal_Int32 nColumns = 0; - while (aItr != aEndItr && nColumns < nTotalColumns) + ScMyFormatRange aNeedle; + aNeedle.aRangeAddress.Sheet = nTable; + for (auto aItr = maFormatRanges.lower_bound(aNeedle); aItr != maFormatRanges.end(); ) { + if (aItr->aRangeAddress.Sheet > nTable) + break; + if (nColumns >= nTotalColumns) + break; if (((*aItr).aRangeAddress.StartRow <= nRow) && ((*aItr).aRangeAddress.EndRow >= nRow)) { @@ -871,7 +864,7 @@ void ScFormatRangeStyles::GetFormatRanges(const sal_Int32 nStartColumn, const sa } else if(aItr->aRangeAddress.EndRow < nRow) - aItr = rFormatRanges.erase(aItr); + aItr = maFormatRanges.erase(aItr); else ++aItr; } @@ -888,9 +881,7 @@ void ScFormatRangeStyles::AddRangeStyleName(const table::CellRangeAddress& rCell aFormatRange.nValidationIndex = nValidationIndex; aFormatRange.nNumberFormat = nNumberFormat; aFormatRange.bIsAutoStyle = bIsAutoStyle; - OSL_ENSURE(o3tl::make_unsigned(rCellRangeAddress.Sheet) < aTables.size(), "wrong table"); - ScMyFormatRangeAddresses& rFormatRanges(aTables[rCellRangeAddress.Sheet]); - rFormatRanges.push_back(aFormatRange); + maFormatRanges.insert(aFormatRange); } OUString & ScFormatRangeStyles::GetStyleNameByIndex(const sal_Int32 nIndex, const bool bIsAutoStyle) @@ -901,12 +892,6 @@ OUString & ScFormatRangeStyles::GetStyleNameByIndex(const sal_Int32 nIndex, cons return aStyleNames[nIndex]; } -void ScFormatRangeStyles::Sort() -{ - for (auto & rTable : aTables) - rTable.sort(); -} - ScColumnRowStylesBase::ScColumnRowStylesBase() { } diff --git a/sc/source/filter/xml/XMLStylesExportHelper.hxx b/sc/source/filter/xml/XMLStylesExportHelper.hxx index c404e8154004..dbfc12be1e70 100644 --- a/sc/source/filter/xml/XMLStylesExportHelper.hxx +++ b/sc/source/filter/xml/XMLStylesExportHelper.hxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -158,10 +159,7 @@ struct ScMyFormatRange class ScFormatRangeStyles { - typedef std::list ScMyFormatRangeAddresses; - typedef std::vector ScMyFormatRangeListVec; - - ScMyFormatRangeListVec aTables; + std::multiset maFormatRanges; std::vector aStyleNames; std::vector aAutoStyleNames; const ScMyDefaultStyleList* pColDefaults; @@ -171,7 +169,6 @@ public: ~ScFormatRangeStyles(); void SetColDefaults(const ScMyDefaultStyleList* pDefaults) { pColDefaults = pDefaults; } - void AddNewTable(const sal_Int32 nTable); bool AddStyleName(const OUString& rString, sal_Int32& rIndex, const bool bIsAutoStyle = true); sal_Int32 GetIndexOfStyleName(std::u16string_view rString, std::u16string_view rPrefix, bool& bIsAutoStyle); // does not delete ranges @@ -185,7 +182,6 @@ public: void AddRangeStyleName(const css::table::CellRangeAddress& rCellRangeAddress, const sal_Int32 nStringIndex, const bool bIsAutoStyle, const sal_Int32 nValidationIndex, const sal_Int32 nNumberFormat); OUString& GetStyleNameByIndex(const sal_Int32 nIndex, const bool bIsAutoStyle); - void Sort(); }; class ScColumnRowStylesBase diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 00231fc4ae38..e57df86477af 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -498,8 +498,6 @@ void ScXMLExport::CollectSharedData(SCTAB& nTableCount, sal_Int32& nShapesCount) if (!pSharedData) pSharedData.reset(new ScMySharedData(nTableCount)); - pCellStyles->AddNewTable(nTableCount - 1); - for (SCTAB nTable = 0; nTable < nTableCount; ++nTable) { nCurrentTable = sal::static_int_cast(nTable); @@ -1908,7 +1906,6 @@ void ScXMLExport::ExportContent_() ScMyDetectiveOpContainer aDetectiveOpContainer; GetDetectiveOpList( aDetectiveOpContainer ); - pCellStyles->Sort(); pMergedRangesContainer->Sort(); pSharedData->GetDetectiveObjContainer()->Sort(); @@ -2515,7 +2512,6 @@ void ScXMLExport::collectAutoStyles() CollectSharedData(nTableCount, nShapesCount); } sal_Int32 nTableCount(xIndex->getCount()); - pCellStyles->AddNewTable(nTableCount - 1); CollectShapesAutoStyles(nTableCount); for (sal_Int32 nTable = 0; nTable < nTableCount; ++nTable, IncrementProgressBar(false)) { From 6e1a55dfbdd7651b22be542f3ce048fb769e8aec Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 3 Jul 2024 19:37:50 +0200 Subject: [PATCH 111/232] make SvxEscapementItem hashable Change-Id: Ic03c78f6dde68f5557d474147336fa62be6f3aaa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169967 Tested-by: Jenkins Reviewed-by: Noel Grandin --- cui/source/tabpages/chardlg.cxx | 8 ++++---- editeng/source/items/textitem.cxx | 10 ++++++++++ include/editeng/escapementitem.hxx | 9 ++++++--- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index bd1f6810cf31..235bda92d184 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -2488,13 +2488,13 @@ void SvxCharPositionPage::SetEscapement_Impl( SvxEscapement nEsc ) if ( SvxEscapement::Superscript == nEsc ) { - aEscItm.GetEsc() = m_nSuperEsc; - aEscItm.GetProportionalHeight() = m_nSuperProp; + aEscItm.SetEsc( m_nSuperEsc ); + aEscItm.SetProportionalHeight(m_nSuperProp); } else if ( SvxEscapement::Subscript == nEsc ) { - aEscItm.GetEsc() = m_nSubEsc; - aEscItm.GetProportionalHeight() = m_nSubProp; + aEscItm.SetEsc( m_nSubEsc ); + aEscItm.SetProportionalHeight( m_nSubProp ); } short nFac = aEscItm.GetEsc() < 0 ? -1 : 1; diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index 9801f594d519..ab2090c74e64 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -1895,6 +1895,15 @@ SvxEscapementItem::SvxEscapementItem( const short _nEsc, { } +bool SvxEscapementItem::isHashable() const { return true; } + +size_t SvxEscapementItem::hashCode() const +{ + std::size_t seed(0); + o3tl::hash_combine(seed, nEsc); + o3tl::hash_combine(seed, nProp); + return seed; +} bool SvxEscapementItem::operator==( const SfxPoolItem& rAttr ) const { @@ -1984,6 +1993,7 @@ bool SvxEscapementItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const bool SvxEscapementItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; nMemberId &= ~CONVERT_TWIPS; switch(nMemberId) { diff --git a/include/editeng/escapementitem.hxx b/include/editeng/escapementitem.hxx index d9d4f7d3006f..87afbcdd9e88 100644 --- a/include/editeng/escapementitem.hxx +++ b/include/editeng/escapementitem.hxx @@ -51,6 +51,8 @@ public: const sal_uInt16 nId ); // "pure virtual Methods" from SfxPoolItem + virtual bool isHashable() const override; + virtual size_t hashCode() const override; virtual bool operator==( const SfxPoolItem& ) const override; virtual bool GetPresentation( SfxItemPresentation ePres, MapUnit eCoreMetric, @@ -64,6 +66,7 @@ public: void SetEscapement( const SvxEscapement eNew ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; if( SvxEscapement::Off == eNew ) { nEsc = 0; @@ -80,11 +83,11 @@ public: } SvxEscapement GetEscapement() const { return static_cast< SvxEscapement >( GetEnumValue() ); } - short &GetEsc() { return nEsc; } short GetEsc() const { return nEsc; } + void SetEsc(short nNewEsc) { ASSERT_CHANGE_REFCOUNTED_ITEM; nEsc = nNewEsc; } - sal_uInt8 &GetProportionalHeight() { return nProp; } - sal_uInt8 GetProportionalHeight() const { return nProp; } + sal_uInt8 GetProportionalHeight() const { return nProp; } + void SetProportionalHeight(sal_uInt8 n) { ASSERT_CHANGE_REFCOUNTED_ITEM; nProp = n; } virtual sal_uInt16 GetValueCount() const override; static OUString GetValueTextByPos( sal_uInt16 nPos ); From 2fcad7783d055c6222227bd1672124320eb77a2e Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 3 Jul 2024 19:15:47 +0200 Subject: [PATCH 112/232] make SvxAdjustItem hashable Change-Id: Ic5c78a0de4e7edafc0ba97bf69d43c377f7b5503 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169633 Tested-by: Jenkins Reviewed-by: Noel Grandin --- editeng/source/items/paraitem.cxx | 12 ++++++++++++ include/editeng/adjustitem.hxx | 2 ++ 2 files changed, 14 insertions(+) diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx index 5cfedf113620..ce547ff38d63 100644 --- a/editeng/source/items/paraitem.cxx +++ b/editeng/source/items/paraitem.cxx @@ -347,6 +347,17 @@ SvxAdjustItem::SvxAdjustItem(const SvxAdjust eAdjst, const sal_uInt16 nId ) SetAdjust( eAdjst ); } +bool SvxAdjustItem::isHashable() const { return true; } + +size_t SvxAdjustItem::hashCode() const +{ + std::size_t seed(0); + o3tl::hash_combine(seed, GetAdjust()); + o3tl::hash_combine(seed, bOneBlock); + o3tl::hash_combine(seed, bLastCenter); + o3tl::hash_combine(seed, bLastBlock); + return seed; +} bool SvxAdjustItem::operator==( const SfxPoolItem& rAttr ) const { @@ -378,6 +389,7 @@ bool SvxAdjustItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const bool SvxAdjustItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; nMemberId &= ~CONVERT_TWIPS; switch( nMemberId ) { diff --git a/include/editeng/adjustitem.hxx b/include/editeng/adjustitem.hxx index 4a6324893820..006bede075d7 100644 --- a/include/editeng/adjustitem.hxx +++ b/include/editeng/adjustitem.hxx @@ -51,6 +51,8 @@ public: const sal_uInt16 nId ); // "pure virtual Methods" from SfxPoolItem + virtual bool isHashable() const override; + virtual size_t hashCode() const override; virtual bool operator==( const SfxPoolItem& ) const override; virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; From 38514aecba9bede86d1ca195f9e30592157d1681 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 3 Jul 2024 15:18:19 +0200 Subject: [PATCH 113/232] tdf#152104 speed xls->ods convert part 2 We are doing a lot of work in ScAttrArray::SetPatternAreaImpl, where we move the mvData vector of CellAttributeHolder around, so inline and reduce some of the work. The move operator= can be simplified, leaving some of the work to the destructor (which may well be elided when moving arrays of elements around). Reduces time from 50s to 39s Change-Id: I358f48fa30f785f7b3f221079db93ab0288a7f14 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169941 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sc/inc/patattr.hxx | 9 ++++++--- sc/source/core/data/patattr.cxx | 20 -------------------- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/sc/inc/patattr.hxx b/sc/inc/patattr.hxx index fb47d86c74a4..44b7e370bf32 100644 --- a/sc/inc/patattr.hxx +++ b/sc/inc/patattr.hxx @@ -102,13 +102,16 @@ class SC_DLLPUBLIC CellAttributeHolder final const ScPatternAttr* mpScPatternAttr; public: - CellAttributeHolder(const ScPatternAttr* pScPatternAttr = nullptr, bool bPassingOwnership = false); + CellAttributeHolder() : mpScPatternAttr(nullptr) {} + CellAttributeHolder(const ScPatternAttr* pScPatternAttr, bool bPassingOwnership = false); CellAttributeHolder(const CellAttributeHolder& rHolder); - CellAttributeHolder(CellAttributeHolder&& rHolder) noexcept; + CellAttributeHolder(CellAttributeHolder&& rHolder) noexcept + : mpScPatternAttr(rHolder.mpScPatternAttr) + { rHolder.mpScPatternAttr = nullptr; } ~CellAttributeHolder(); CellAttributeHolder& operator=(const CellAttributeHolder& rHolder); - CellAttributeHolder& operator=(CellAttributeHolder&& rHolder); + CellAttributeHolder& operator=(CellAttributeHolder&& rHolder) { std::swap(mpScPatternAttr, rHolder.mpScPatternAttr); return *this; } bool operator==(const CellAttributeHolder& rHolder) const; const ScPatternAttr* getScPatternAttr() const { return mpScPatternAttr; } diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index 5169ca412875..da278bd53c30 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -302,12 +302,6 @@ CellAttributeHolder::CellAttributeHolder(const CellAttributeHolder& rHolder) suppress_fun_call_w_exception(mpScPatternAttr = rHolder.getScPatternAttr()->getCellAttributeHelper().registerAndCheck(*rHolder.getScPatternAttr(), false)); } -CellAttributeHolder::CellAttributeHolder(CellAttributeHolder&& rHolder) noexcept -: mpScPatternAttr(rHolder.mpScPatternAttr) -{ - rHolder.mpScPatternAttr = nullptr; -} - CellAttributeHolder::~CellAttributeHolder() { if (nullptr != mpScPatternAttr) @@ -328,20 +322,6 @@ CellAttributeHolder& CellAttributeHolder::operator=(const CellAttributeHolder& r return *this; } -CellAttributeHolder& CellAttributeHolder::operator=(CellAttributeHolder&& rHolder) -{ - if (nullptr != mpScPatternAttr) - { - mpScPatternAttr->getCellAttributeHelper().doUnregister(*mpScPatternAttr); - mpScPatternAttr = nullptr; - } - - std::swap(mpScPatternAttr, rHolder.mpScPatternAttr); - assert(!rHolder.mpScPatternAttr); - - return *this; -} - bool CellAttributeHolder::operator==(const CellAttributeHolder& rHolder) const { // here we have registered entries, so no need to test for equality From daca6c1e86c9db1ffe400178d13b8c90b6e7579d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Vajngerl?= Date: Tue, 2 Jul 2024 15:02:47 +0900 Subject: [PATCH 114/232] svx: ImpChainLinkProperties cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I89eb9598dc2cc00284ee6f32a3caf624b405b21d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169849 Reviewed-by: Tomaž Vajngerl Tested-by: Jenkins --- svx/inc/textchain.hxx | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/svx/inc/textchain.hxx b/svx/inc/textchain.hxx index 46192852f984..4ff7303ed1cf 100644 --- a/svx/inc/textchain.hxx +++ b/svx/inc/textchain.hxx @@ -46,24 +46,16 @@ class ImpChainLinkProperties protected: friend class TextChain; - ImpChainLinkProperties() - { - aNilChainingEvent = false; - aCursorEvent = CursorChainingEvent::NULL_EVENT; - aPreChainingSel = ESelection(); - aPostChainingSel = ESelection(); - aIsPartOfLastParaInNextLink = false; // XXX: Should come from file - aSwitchingToNextBox = false; - } + ImpChainLinkProperties() = default; private: // NOTE: Remember to set default value in constructor when adding field ESelection aPreChainingSel; ESelection aPostChainingSel; - CursorChainingEvent aCursorEvent; - bool aNilChainingEvent; - bool aIsPartOfLastParaInNextLink; - bool aSwitchingToNextBox; + CursorChainingEvent aCursorEvent = CursorChainingEvent::NULL_EVENT; + bool aNilChainingEvent = false; + bool aIsPartOfLastParaInNextLink = false; + bool aSwitchingToNextBox = false; }; class TextChain From 4e97c21ab32f3e6f28a842ad14bad41f00fefda5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Vajngerl?= Date: Thu, 27 Jun 2024 21:11:50 +0900 Subject: [PATCH 115/232] annot: AnnotationObject should be the size as the text content MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes the AnnotationObject to resize the frame to the size of the text content, or else the text that is too big will be shown outside the object's frame (rectangle). For some reason we need to set the object as a "text frame" (mbTextFrame = true) or else it will not allow to automatically adjust the frame to the text content. Change-Id: Ib2b9a7c07626fe8b0a2286cfd67c3bf37cf9af03 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169642 Reviewed-by: Tomaž Vajngerl Tested-by: Jenkins --- .../ui/annotations/annotationmanager.cxx | 2 +- svx/source/annotation/AnnotationObject.cxx | 40 +++++++++++-------- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index b07a79932b5d..940c763f73cc 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -1108,7 +1108,7 @@ void AnnotationManagerImpl::SyncAnnotationObjects() applyAnnotationProperties(*pNewObject, rInfo); } - pNewObject->SetLogicRect(aRectangle); + pNewObject->SetRelativePos(aRectangle.TopLeft()); pView->InsertObjectAtView(pNewObject.get(), *pView->GetSdrPageView()); diff --git a/svx/source/annotation/AnnotationObject.cxx b/svx/source/annotation/AnnotationObject.cxx index 35dc4807e1b8..c87943067ae0 100644 --- a/svx/source/annotation/AnnotationObject.cxx +++ b/svx/source/annotation/AnnotationObject.cxx @@ -93,12 +93,14 @@ AnnotationObject::AnnotationObject(SdrModel& rSdrModel) : SdrRectObj(rSdrModel) { setAsAnnotationObject(true); + mbTextFrame = true; // need this so the frame can be adjusted to the text } AnnotationObject::AnnotationObject(SdrModel& rSdrModel, AnnotationObject const& rSource) : SdrRectObj(rSdrModel, rSource) { setAsAnnotationObject(true); + mbTextFrame = true; // need this so the frame can be adjusted to the text } AnnotationObject::AnnotationObject(SdrModel& rSdrModel, tools::Rectangle const& rRectangle, @@ -115,6 +117,7 @@ AnnotationObject::AnnotationObject(SdrModel& rSdrModel, tools::Rectangle const& osl_atomic_decrement(&m_refCount); setAsAnnotationObject(true); + mbTextFrame = true; // need this so the frame can be adjusted to the text } void AnnotationObject::ApplyAnnotationName() @@ -124,17 +127,18 @@ void AnnotationObject::ApplyAnnotationName() OUString sInitials(mpAnnotationData->mxAnnotation->getInitials()); if (sInitials.isEmpty()) sInitials = createInitials(mpAnnotationData->mxAnnotation->getAuthor()); - SetText(sInitials + " " + OUString::number(maViewData.nIndex)); + SetText(sInitials + u" "_ustr + OUString::number(maViewData.nIndex)); } else { - SetText(u"Empty"_ustr); + SetText(u"🗅"_ustr); } Color aColor(getColorLight(maViewData.nAuthorIndex)); - SetMergedItem(XFillStyleItem(drawing::FillStyle_SOLID)); - SetMergedItem(XFillColorItem(OUString(), aColor)); + SfxItemSet aItemSet = GetMergedItemSet(); + aItemSet.Put(XFillStyleItem(drawing::FillStyle_SOLID)); + aItemSet.Put(XFillColorItem(OUString(), aColor)); Color aBorderColor(aColor); if (aColor.IsDark()) @@ -142,20 +146,22 @@ void AnnotationObject::ApplyAnnotationName() else aBorderColor.DecreaseLuminance(32); - SetMergedItem(XLineStyleItem(drawing::LineStyle_SOLID)); - SetMergedItem(XLineColorItem(OUString(), aBorderColor)); - SetMergedItem(XLineWidthItem(o3tl::convert(0, o3tl::Length::pt, o3tl::Length::mm100))); + aItemSet.Put(XLineStyleItem(drawing::LineStyle_SOLID)); + aItemSet.Put(XLineColorItem(OUString(), aBorderColor)); + aItemSet.Put(XLineWidthItem(o3tl::convert(0, o3tl::Length::pt, o3tl::Length::mm100))); - SetMergedItem(SvxFontHeightItem(o3tl::convert(10, o3tl::Length::pt, o3tl::Length::mm100), 100, - EE_CHAR_FONTHEIGHT)); + aItemSet.Put(SvxFontHeightItem(o3tl::convert(10, o3tl::Length::pt, o3tl::Length::mm100), 100, + EE_CHAR_FONTHEIGHT)); - SetMergedItem(SvxColorItem(aColor.IsDark() ? COL_WHITE : COL_BLACK, EE_CHAR_COLOR)); + aItemSet.Put(SvxColorItem(aColor.IsDark() ? COL_WHITE : COL_BLACK, EE_CHAR_COLOR)); - SetMergedItem(SdrTextFitToSizeTypeItem(drawing::TextFitToSizeType_NONE)); + aItemSet.Put(SdrTextFitToSizeTypeItem(drawing::TextFitToSizeType_NONE)); - SetMergedItem(makeSdrTextWordWrapItem(false)); - SetMergedItem(makeSdrTextAutoGrowWidthItem(true)); - SetMergedItem(makeSdrTextAutoGrowHeightItem(true)); + aItemSet.Put(makeSdrTextWordWrapItem(false)); + aItemSet.Put(makeSdrTextAutoGrowWidthItem(true)); + aItemSet.Put(makeSdrTextAutoGrowHeightItem(true)); + + SetMergedItemSet(aItemSet); } AnnotationObject::~AnnotationObject() {} @@ -186,13 +192,13 @@ SdrObjKind AnnotationObject::GetObjIdentifier() const { return SdrObjKind::Annot OUString AnnotationObject::TakeObjNameSingul() const { - OUString sName(u"Annotation"_ustr); + OUString sOutName(u"Annotation"_ustr); OUString aName(GetName()); if (!aName.isEmpty()) - sName += " '" + aName + "'"; + sOutName += u" '"_ustr + aName + u"'"_ustr; - return sName; + return sOutName; } OUString AnnotationObject::TakeObjNamePlural() const { return u"Annotations"_ustr; } From e9aadbc0ed4916f31693018e65178b21559c73ef Mon Sep 17 00:00:00 2001 From: Regina Henschel Date: Tue, 2 Jul 2024 23:04:07 +0200 Subject: [PATCH 116/232] tdf#161483 angle unit import for cell text rotation Currently style:rotation-angle of table-cell-properties is imported using ::sax::Converter::convertNumber. That imports only integer values and ignores units. But ODF uses the data type 'angle'. That is a double with optional units 'deg', 'rad' or 'grad'. A unit-less value is treated as degrees. The patch changes the import to use the new method ::sax::Converter::convertAngle(), that was introduced in commit 9f62c7a0f2333d1b7d179a43b3b0341dba7554a1. Change-Id: I98c35a762e90b959a005f5bcdf810c5676cc8b6a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169891 Tested-by: Jenkins Reviewed-by: Regina Henschel --- .../data/fods/tdf161483_CellTextRotation.fods | 372 ++++++++++++++++++ sc/qa/unit/subsequent_filters_test4.cxx | 23 ++ sc/source/filter/xml/xmlstyle.cxx | 6 +- 3 files changed, 398 insertions(+), 3 deletions(-) create mode 100644 sc/qa/unit/data/fods/tdf161483_CellTextRotation.fods diff --git a/sc/qa/unit/data/fods/tdf161483_CellTextRotation.fods b/sc/qa/unit/data/fods/tdf161483_CellTextRotation.fods new file mode 100644 index 000000000000..59b26532ee62 --- /dev/null +++ b/sc/qa/unit/data/fods/tdf161483_CellTextRotation.fods @@ -0,0 +1,372 @@ + + + + + LOmyBuild/25.2.0.0.alpha0$Windows_X86_64 LibreOffice_project/9877ab0b5ebadf70a138db582f298bf0e5d1cd9e + + Metric + Regina Henschel + 2024-06-29T21:00:31 + Regina Henschel + 2024-07-02T15:12:42 + + + + + 0 + 0 + 9998 + 3000 + + + view1 + + + 3 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 100 + 60 + true + false + false + false + false + + + Sheet1 + 1273 + 0 + 100 + 60 + false + true + true + true + false + true + 12632256 + 1 + true + true + true + false + false + true + 500 + 500 + 4 + 4 + true + false + false + false + false + + + + + true + true + true + 0 + true + true + false + true + false + + + en + US + + + + + + 12632256 + true + true + 0 + false + false + true + true + false + 3 + false + false + true + 500 + 500 + 4 + 4 + true + false + false + true + true + true + true + true + 7 + true + + + Sheet1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ??? + + + + + Page 1 + + + + + + + + ???(???) + + + 00.00.0000, 00:00:00 + + + + + + Page 1/ 99 + + + + + + + + + + + + + The angle is without unit, when LibreOffice writes it out. + + + For this text angle is given in degrees in file format. + + + Here the rotation angle is given in radians + + + This is given in special engineering unit “grad”. + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sc/qa/unit/subsequent_filters_test4.cxx b/sc/qa/unit/subsequent_filters_test4.cxx index 90eb7915f389..f227abb1942f 100644 --- a/sc/qa/unit/subsequent_filters_test4.cxx +++ b/sc/qa/unit/subsequent_filters_test4.cxx @@ -2032,6 +2032,29 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testRowImportCellStyleIssue) } } +CPPUNIT_TEST_FIXTURE(ScFiltersTest4, testCellTextRotation) +{ + createScDoc("fods/tdf161483_CellTextRotation.fods"); + ScDocument* pDoc = getScDoc(); + + CPPUNIT_ASSERT_EQUAL(SCTAB(1), pDoc->GetTableCount()); + + // Without the fix, angles with decimals were imported as 0 and angle units were ignored. + // A1=32.67, B1=32.67deg, C1=0.570119066626548rad, D1=36.3rad + // All four angles have to convert to 3267. + Degree100 nExpectedAngle = 3267_deg100; // RotateAngle has data type long, meaning Degree100 + + Degree100 nActualAngle = 0_deg100; + nActualAngle = pDoc->GetAttr(0, 0, 0, ATTR_ROTATE_VALUE)->GetValue(); // col, row, tab, whichId + CPPUNIT_ASSERT_EQUAL_MESSAGE("without unit", nExpectedAngle.get(), nActualAngle.get()); + nActualAngle = pDoc->GetAttr(1, 0, 0, ATTR_ROTATE_VALUE)->GetValue(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("degrees", nExpectedAngle.get(), nActualAngle.get()); + nActualAngle = pDoc->GetAttr(2, 0, 0, ATTR_ROTATE_VALUE)->GetValue(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("radians", nExpectedAngle.get(), nActualAngle.get()); + nActualAngle = pDoc->GetAttr(3, 0, 0, ATTR_ROTATE_VALUE)->GetValue(); + CPPUNIT_ASSERT_EQUAL_MESSAGE("grad", nExpectedAngle.get(), nActualAngle.get()); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/xmlstyle.cxx b/sc/source/filter/xml/xmlstyle.cxx index ddcdd5440082..debba9ad8e04 100644 --- a/sc/source/filter/xml/xmlstyle.cxx +++ b/sc/source/filter/xml/xmlstyle.cxx @@ -1512,10 +1512,10 @@ bool XmlScPropHdl_RotateAngle::importXML( { bool bRetval(false); - sal_Int32 nValue; - if (::sax::Converter::convertNumber(nValue, rStrImpValue) && !o3tl::checked_multiply(nValue, 100, nValue)) + double fValue; + if (::sax::Converter::convertAngle(fValue, rStrImpValue, 100)) { - rValue <<= nValue; + rValue <<= static_cast(basegfx::fround(fValue)); // It is already 0<=fValue<36000. bRetval = true; } From b0b6f6092eba8685b45a4d38b5814e7944364804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 4 Jul 2024 08:41:33 +0100 Subject: [PATCH 117/232] cid#1545560 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I38fb9bfb4703c05f3f07634fbed81254a18ad37d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169974 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- sc/source/ui/docshell/docsh4.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 24a64345b759..c01145f38886 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -744,7 +744,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) pSet->Put( SfxStringItem( SID_FILE_FILTEROPTIONS, aOptions ) ); if ( nVersion != 0 ) pSet->Put( SfxInt16Item( SID_VERSION, nVersion ) ); - pMed = new SfxMedium( aFileName, StreamMode::STD_READ, pFilter, std::move(pSet) ); + pMed = new SfxMedium( aFileName, StreamMode::STD_READ, std::move(pFilter), std::move(pSet) ); } else { From cefb16451a15322a8caa62f4d7340978ea047b8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 4 Jul 2024 08:44:42 +0100 Subject: [PATCH 118/232] cid#1554763 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I03ad4f979fef11681a3b0a0205cfb143db28b63d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169975 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- drawinglayer/source/tools/emfphelperdata.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx index 1dd5149fd102..9657fb4f0c41 100644 --- a/drawinglayer/source/tools/emfphelperdata.cxx +++ b/drawinglayer/source/tools/emfphelperdata.cxx @@ -1705,7 +1705,7 @@ namespace emfplushelper stringLength, std::move(emptyVector), // EMF-PLUS has no DX-array {}, - fontAttribute, + std::move(fontAttribute), locale, color.getBColor(), // Font Color COL_TRANSPARENT, // Fill Color @@ -1725,7 +1725,7 @@ namespace emfplushelper stringLength, std::move(emptyVector), // EMF-PLUS has no DX-array {}, - fontAttribute, + std::move(fontAttribute), locale, color.getBColor()); } From 0d72c7f9dea605ace647712fd6599bf293635208 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 4 Jul 2024 08:48:07 +0100 Subject: [PATCH 119/232] cid#1554775 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I75b3205b23b43ba639b75808d0a832418f7d7c24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169976 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- lotuswordpro/source/filter/lwpfribmark.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lotuswordpro/source/filter/lwpfribmark.cxx b/lotuswordpro/source/filter/lwpfribmark.cxx index 2dda5912fbca..56c2f86a9234 100644 --- a/lotuswordpro/source/filter/lwpfribmark.cxx +++ b/lotuswordpro/source/filter/lwpfribmark.cxx @@ -150,7 +150,7 @@ void LwpFribBookMark::RegisterStyle(LwpFoundry* pFoundry) xMarkStart->SetDivision(sDivision); xMarkStart->SetName(name); pMarkMgr->AddXFBookmarkStart(name, xMarkStart.get()); //add to map - m_xStart = xMarkStart; + m_xStart = std::move(xMarkStart); } else if (type == MARKER_END) { @@ -158,7 +158,7 @@ void LwpFribBookMark::RegisterStyle(LwpFoundry* pFoundry) xMarkEnd->SetDivision(sDivision); xMarkEnd->SetName(name); pMarkMgr->AddXFBookmarkEnd(name, xMarkEnd.get()); //add to map - m_xEnd = xMarkEnd; + m_xEnd = std::move(xMarkEnd); } } From 0bd99358cbfaca06436c357a23c2a36bf9287434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 4 Jul 2024 08:50:21 +0100 Subject: [PATCH 120/232] cid#1555201 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I9fcb4b4e1a9c9d7413a2f3cec0d0f408f9b59691 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169977 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- toolkit/source/controls/unocontrolmodel.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx index e7fb947eebbb..5a5fdfa05b11 100644 --- a/toolkit/source/controls/unocontrolmodel.cxx +++ b/toolkit/source/controls/unocontrolmodel.cxx @@ -1224,14 +1224,13 @@ void UnoControlModel::setFastPropertyValueImpl( std::unique_lock& rG getFastPropertyValue( rGuard, aOldSingleValue, BASEPROPERTY_FONTDESCRIPTORPART_START ); css::uno::Any* pProp = &maData[ BASEPROPERTY_FONTDESCRIPTOR ]; - FontDescriptor aOldFontDescriptor; - (*pProp) >>= aOldFontDescriptor; + FontDescriptor aFontDescriptor; + (*pProp) >>= aFontDescriptor; - FontDescriptor aNewFontDescriptor( aOldFontDescriptor ); - lcl_ImplMergeFontProperty( aNewFontDescriptor, static_cast(nPropId), rValue ); + lcl_ImplMergeFontProperty(aFontDescriptor, static_cast(nPropId), rValue); Any aNewValue; - aNewValue <<= aNewFontDescriptor; + aNewValue <<= aFontDescriptor; sal_Int32 nDescriptorId = BASEPROPERTY_FONTDESCRIPTOR; // also, we need fire a propertyChange event for the single property, since with From fec0684c86b71d1b6305a8058a0163dd92fb979c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 4 Jul 2024 08:56:55 +0100 Subject: [PATCH 121/232] cid#1555756 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I07acff7c5e3cba4afa144843bfeb44c99de81ae9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169978 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sw/source/core/unocore/unotbl.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx index f9ce9aa23b6e..fa442954a55f 100644 --- a/sw/source/core/unocore/unotbl.cxx +++ b/sw/source/core/unocore/unotbl.cxx @@ -2189,7 +2189,7 @@ rtl::Reference GetRangeByName( UnoActionRemoveContext aRemoveContext(rCursor); rCursor.MakeBoxSels(); // pUnoCursor will be provided and will not be deleted - return SwXCellRange::CreateXCellRange(pUnoCursor, *pFormat, rDesc); + return SwXCellRange::CreateXCellRange(std::move(pUnoCursor), *pFormat, rDesc); } } // namespace From 5d9267b81c0123f2148ee91e102b9ebfae4e3373 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 4 Jul 2024 08:58:48 +0100 Subject: [PATCH 122/232] cid#1557397 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I9c33fe01e6f48b61df4130b548d9a6c793aa7e85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169979 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sw/source/uibase/dbui/dbmgr.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index a85cc1dbf563..51e7cc4c259a 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -1164,7 +1164,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, pFilterContainer->GetFilter4FilterName( rMergeDescriptor.sSaveToFilter ); if(pFilter) { - pStoreToFilter = pFilter; + pStoreToFilter = std::move(pFilter); if(!rMergeDescriptor.sSaveToFilterOptions.isEmpty()) pStoreToFilterOptions = &rMergeDescriptor.sSaveToFilterOptions; } From a6a95c0ce4334fda99cba0528d08207a7514e8a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 4 Jul 2024 09:00:09 +0100 Subject: [PATCH 123/232] cid#1608568 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7509b0033855c66324d655b66bef9cc14f5e8074 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169980 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- embeddedobj/source/commonembedding/persistence.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx index 0abb340f4d32..c72d788e3d04 100644 --- a/embeddedobj/source/commonembedding/persistence.cxx +++ b/embeddedobj/source/commonembedding/persistence.cxx @@ -375,7 +375,7 @@ bool OCommonEmbeddedObject::getAllowLinkUpdate() const uno::Reference xGrandParent(xParent->getParent(), uno::UNO_QUERY); if (!xGrandParent) break; - xParent = xGrandParent; + xParent = std::move(xGrandParent); } uno::Reference xPropSet(xParent, uno::UNO_QUERY); From a14ef3ee8d34e5a1e31f50eb49b29200feaafa1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 4 Jul 2024 09:02:06 +0100 Subject: [PATCH 124/232] cid#1607240 silence Copy-paste error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit and cid#1607649 Copy-paste error Change-Id: I9b0bfc1b2403ecaa514b6086bc5a4c37b0fdf7ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169981 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- vcl/source/window/stacking.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx index 84b4efadc27b..034e6d1056a5 100644 --- a/vcl/source/window/stacking.cxx +++ b/vcl/source/window/stacking.cxx @@ -200,7 +200,10 @@ void Window::ImplToBottomChild() if ( mpWindowImpl->mpPrev ) mpWindowImpl->mpPrev->mpWindowImpl->mpNext = mpWindowImpl->mpNext; else + { + // coverity[copy_paste_error : FALSE] - this is correct mpFirstChild, not mpNext mpWindowImpl->mpParent->mpWindowImpl->mpFirstChild = mpWindowImpl->mpNext; + } mpWindowImpl->mpNext->mpWindowImpl->mpPrev = mpWindowImpl->mpPrev; mpWindowImpl->mpPrev = mpWindowImpl->mpParent->mpWindowImpl->mpLastChild; mpWindowImpl->mpParent->mpWindowImpl->mpLastChild = this; @@ -268,7 +271,10 @@ void Window::ImplToTop( ToTopFlags nFlags ) if ( mpWindowImpl->mpNext ) mpWindowImpl->mpNext->mpWindowImpl->mpPrev = mpWindowImpl->mpPrev; else + { + // coverity[copy_paste_error : FALSE] - this is correct mpLastOverlap, not mpPrev mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpLastOverlap = mpWindowImpl->mpPrev; + } // take AlwaysOnTop into account bool bOnTop = IsAlwaysOnTopEnabled(); From 07e310498f04dd28f69fc7c3633b881d597c8aff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Thu, 4 Jul 2024 09:07:14 +0100 Subject: [PATCH 125/232] cid#1608601 silence Unchecked return value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Iab18edb8ddb0860b337c0caf5c1fcf661521541f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169982 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- dbaccess/source/ui/browser/unodatbr.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index e16b16f5efda..b6d18610011c 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -2575,7 +2575,7 @@ bool SbaTableQueryBrowser::implSelect(const weld::TreeIter* pEntry) selectPath(m_xCurrentlyDisplayed.get()); // get the name of the data source currently selected - ensureConnection(m_xCurrentlyDisplayed.get(), pConData->xConnection); + (void)ensureConnection(m_xCurrentlyDisplayed.get(), pConData->xConnection); if ( !pConData->xConnection.is() ) { From d9dcada2ed467cd4b892388c9c57ac795cc4c3fb Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Thu, 4 Jul 2024 12:05:40 +0200 Subject: [PATCH 126/232] Fix regression Gtk-CRITICAL+Gtk-WARNING on vcl/wizard.ui MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (soffice:40467): Gtk-CRITICAL **: 11:08:58.517: gtk_assistant_set_page_has_padding: assertion 'child != NULL' failed (soffice:40467): Gtk-WARNING **: 11:59:34.471: ../../../gtk/gtkcontainer.c:1348: container class 'GtkHeaderBar' has no child property named 'expand' Regression from 2f3f1170a7ae8bb06c6cd66a8ba3eb85cc63c2ac Resave with newer Glade version Change-Id: I9fd86af43149f2ea6bd25e63c1c04360fdae0bcf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169987 Reviewed-by: Julien Nabet Reviewed-by: Caolán McNamara Tested-by: Jenkins --- vcl/uiconfig/ui/wizard.ui | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/vcl/uiconfig/ui/wizard.ui b/vcl/uiconfig/ui/wizard.ui index 6a3b45f41cc4..5fd9a647c259 100644 --- a/vcl/uiconfig/ui/wizard.ui +++ b/vcl/uiconfig/ui/wizard.ui @@ -9,16 +9,9 @@ 0 0 dialog + 0 - - - False - - - False - - From 3da1d8a791cff6cf2dad29b64c9ad15b1a65d5b3 Mon Sep 17 00:00:00 2001 From: Patrick Luby Date: Fri, 28 Jun 2024 18:31:14 -0400 Subject: [PATCH 127/232] tdf#161833 treat semi-transparent pixels as opaque Limiting the contour wrapping polygon to only opaque pixels causes clipping of any shadows or other semi-transaprent areas in the image. So, instead of testing for fully opaque pixels, treat pixels that are not fully transparent as opaque. Also, tdf#161833 would cause semi-transparent pixels to be treated as fully transparent pixels when calculating the wrap contour for an image. To force the correct contour when loading a document, force the contour to be recalculated by ignoring the saved polygon if the contour is set to "recreate on edit". Change-Id: Ibe256f54e1c82de30c2b7d5b92a69344b4a7ba10 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169745 Reviewed-by: Patrick Luby Reviewed-by: Noel Grandin Tested-by: Jenkins --- vcl/source/bitmap/BitmapEx.cxx | 15 ++++++------ xmloff/source/text/XMLTextFrameContext.cxx | 27 ++++++++++++++-------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx index ebcb7aa1cb9a..c541579744b0 100644 --- a/vcl/source/bitmap/BitmapEx.cxx +++ b/vcl/source/bitmap/BitmapEx.cxx @@ -1286,11 +1286,12 @@ tools::Polygon BitmapEx::GetContour( bool bContourEdgeDetect, std::unique_ptr pPoints2; tools::Long nX, nY; sal_uInt16 nPolyPos = 0; - // tdf#161498 use COL_ALPHA_OPAQUE for finding opaque pixels - // Starting with commit 81994cb2b8b32453a92bcb011830fcb884f22ff3, - // pixels now contain an alpha value instead of a transparency - // value. - const BitmapColor aTransparencyOpaque = pAcc->GetBestMatchingColor( COL_ALPHA_OPAQUE ); + // tdf#161833 treat semi-transparent pixels as opaque + // Limiting the contour wrapping polygon to only opaque pixels + // causes clipping of any shadows or other semi-transaprent + // areas in the image. So, instead of testing for fully opaque + // pixels, treat pixels that are not fully transparent as opaque. + const BitmapColor aTransparent = pAcc->GetBestMatchingColor( COL_ALPHA_TRANSPARENT ); pPoints1.reset(new Point[ nHeight ]); pPoints2.reset(new Point[ nHeight ]); @@ -1303,7 +1304,7 @@ tools::Polygon BitmapEx::GetContour( bool bContourEdgeDetect, // scan row from left to right while( nX < nEndX1 ) { - if( aTransparencyOpaque == pAcc->GetPixelFromData( pScanline, nX ) ) + if( aTransparent != pAcc->GetPixelFromData( pScanline, nX ) ) { pPoints1[ nPolyPos ] = Point( nX, nY ); nX = nStartX2; @@ -1311,7 +1312,7 @@ tools::Polygon BitmapEx::GetContour( bool bContourEdgeDetect, // this loop always breaks eventually as there is at least one pixel while( true ) { - if( aTransparencyOpaque == pAcc->GetPixelFromData( pScanline, nX ) ) + if( aTransparent != pAcc->GetPixelFromData( pScanline, nX ) ) { pPoints2[ nPolyPos ] = Point( nX, nY ); break; diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index 87752f73b199..5c293c7670c2 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -271,17 +271,26 @@ XMLTextFrameContourContext_Impl::XMLTextFrameContourContext_Impl( const SdXMLImExViewBox aViewBox( sViewBox, GetImport().GetMM100UnitConverter()); basegfx::B2DPolyPolygon aPolyPolygon; - if( bPath ) + // Related tdf#161833: ignore saved polygon for "recreate on edit" contours + // tdf#161833 would cause semi-transparent pixels to be treated as fully + // transparent pixels when calculating the wrap contour for an image. To + // force the correct contour when loading a document, force the contour + // to be recalculated by ignoring the saved polygon if the contour is set + // to "recreate on edit". + if( !bAuto ) { - basegfx::utils::importFromSvgD(aPolyPolygon, sD, GetImport().needFixPositionAfterZ(), nullptr); - } - else - { - basegfx::B2DPolygon aPolygon; - - if(basegfx::utils::importFromSvgPoints(aPolygon, sPoints)) + if( bPath ) { - aPolyPolygon = basegfx::B2DPolyPolygon(aPolygon); + basegfx::utils::importFromSvgD(aPolyPolygon, sD, GetImport().needFixPositionAfterZ(), nullptr); + } + else + { + basegfx::B2DPolygon aPolygon; + + if(basegfx::utils::importFromSvgPoints(aPolygon, sPoints)) + { + aPolyPolygon = basegfx::B2DPolyPolygon(aPolygon); + } } } From 59ec1c43222bfb6188f932f6ff458bafb657b21d Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 3 Jul 2024 19:22:32 +0200 Subject: [PATCH 128/232] make SvxColorItem hashable Change-Id: Ic96d53c113cd6ae5b805df5a8e80d4da7adfec59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169966 Reviewed-by: Noel Grandin Tested-by: Jenkins --- editeng/source/items/textitem.cxx | 11 +++++++++++ include/editeng/colritem.hxx | 6 +++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index ab2090c74e64..664c5db802ad 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -1468,6 +1468,16 @@ SvxColorItem::~SvxColorItem() { } +bool SvxColorItem::isHashable() const { return true; } + +size_t SvxColorItem::hashCode() const +{ + std::size_t seed(0); + o3tl::hash_combine(seed, static_cast(mColor)); + o3tl::hash_combine(seed, maComplexColor); + return seed; +} + bool SvxColorItem::operator==( const SfxPoolItem& rAttr ) const { assert(SfxPoolItem::operator==(rAttr)); @@ -1556,6 +1566,7 @@ bool SvxColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const bool SvxColorItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; nMemberId &= ~CONVERT_TWIPS; switch(nMemberId) { diff --git a/include/editeng/colritem.hxx b/include/editeng/colritem.hxx index e70b27b577e5..220d7964ad2c 100644 --- a/include/editeng/colritem.hxx +++ b/include/editeng/colritem.hxx @@ -43,6 +43,8 @@ public: virtual ~SvxColorItem() override; // "pure virtual Methods" from SfxPoolItem + virtual bool isHashable() const override; + virtual size_t hashCode() const override; virtual bool operator==(const SfxPoolItem& rPoolItem) const override; virtual bool QueryValue(css::uno::Any& rVal, sal_uInt8 nMemberId = 0) const override; virtual bool PutValue(const css::uno::Any& rVal, sal_uInt8 nMemberId) override; @@ -60,6 +62,7 @@ public: } void SetValue(const Color& rNewColor) { + ASSERT_CHANGE_REFCOUNTED_ITEM; mColor = rNewColor; } @@ -69,11 +72,12 @@ public: } void setColor(const Color& rNewColor) { + ASSERT_CHANGE_REFCOUNTED_ITEM; mColor = rNewColor; } model::ComplexColor const& getComplexColor() const { return maComplexColor; } - void setComplexColor(model::ComplexColor const& rComplexColor) { maComplexColor = rComplexColor; } + void setComplexColor(model::ComplexColor const& rComplexColor) { ASSERT_CHANGE_REFCOUNTED_ITEM; maComplexColor = rComplexColor; } void dumpAsXml(xmlTextWriterPtr pWriter) const override; }; From d0e063fbc7e689c7f7221d74e01d9bdd007a5373 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Thu, 4 Jul 2024 15:17:50 +0500 Subject: [PATCH 129/232] VS natvis: improve css::uno::Any handling Change-Id: Id982ff1e1e963f6a88cf74cef0a284f6463af923 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169988 Reviewed-by: Mike Kaganski Tested-by: Jenkins --- solenv/vs/LibreOffice.natvis | 68 +++++++++++++++++++++++------------- 1 file changed, 44 insertions(+), 24 deletions(-) diff --git a/solenv/vs/LibreOffice.natvis b/solenv/vs/LibreOffice.natvis index f737b9b760b1..8cfedffb93de 100644 --- a/solenv/vs/LibreOffice.natvis +++ b/solenv/vs/LibreOffice.natvis @@ -57,30 +57,50 @@ typelib_TypeClass_CONSTANTS = 30, typelib_TypeClass_SINGLETON = 31, --> - {*((wchar_t*)pData),c} (CHAR) - {*((bool*)pData),d} (BOOLEAN) - {*((unsigned char*)pData),d} (BYTE) - {*((short*)pData),d} (SHORT) - {*((unsigned short*)pData),d} (UNSIGNED_SHORT) - {*((int*)pData),d} (LONG) - {*((unsigned int*)pData),d} (UNSIGNED_LONG) - {*((__int64*)pData),d} (HYPER) - {*((unsigned __int64*)pData),d} (UNSIGNED_HYPER) - {*((float*)pData)} (FLOAT) - {*((double*)pData)} (DOUBLE) - {*((rtl::OUString*)pData)} (STRING) - {*((com::sun::star::uno::Type*)pData)} (TYPE) - {*((_uno_Any*)pData)} (ANY) - {*((sal_Int32*)pData),d} (ENUM) - {*((com::sun::star::uno::Exception *)pData)} (EXCEPTION) - {*((uno_Sequence **)pData)} (SEQUENCE) - {*((com::sun::star::uno::BaseReference *)pData)} (INTERFACE) - {pType->eTypeClass,en} - - (com::sun::star::uno::Exception *)pData - *(uno_Sequence **)pData - (com::sun::star::uno::BaseReference *)pData - pData + {*((sal_Unicode*)pData),c} ({*pType->pTypeName,sub}) + {*((bool*)pData),d} ({*pType->pTypeName,sub}) + {*((sal_Int8*)pData),d} ({*pType->pTypeName,sub}) + {*((sal_Int16*)pData),d} ({*pType->pTypeName,sub}) + {*((sal_uInt16*)pData),d} ({*pType->pTypeName,sub}) + {*((sal_Int32*)pData),d} ({*pType->pTypeName,sub}) + {*((sal_uInt32*)pData),d} ({*pType->pTypeName,sub}) + {*((sal_Int64*)pData),d} ({*pType->pTypeName,sub}) + {*((sal_uInt64*)pData),d} ({*pType->pTypeName,sub}) + {*((float*)pData)} ({*pType->pTypeName,sub}) + {*((double*)pData)} ({*pType->pTypeName,sub}) + {*((rtl::OUString*)pData)} ({*pType->pTypeName,sub}) + {*((com::sun::star::uno::Type*)pData)} ({*pType->pTypeName,sub}) + {*((_uno_Any*)pData)} ({*pType->pTypeName,sub}) + {*((sal_Int32*)pData),d} ({*pType->pTypeName,sub}) + {*((com::sun::star::uno::Exception*)pData)} ({*pType->pTypeName,sub}) + {**((uno_Sequence**)pData)} ({*pType->pTypeName,sub}) + {*(com::sun::star::uno::BaseReference*)pData} ({*pType->pTypeName,sub}) + {*((com::sun::star::uno::BaseReference*)pData)->_pInterface} ({*pType->pTypeName,sub}) + {pType->eTypeClass,en} ({*pType->pTypeName,sub}) + + pType + + (sal_Unicode*)pData + (bool*)pData + (sal_Int8*)pData + (sal_Int16*)pData + (sal_uInt16*)pData + (sal_Int32*)pData + (sal_uInt32*)pData + (sal_Int64*)pData + (sal_uInt64*)pData + (float*)pData + (double*)pData + (rtl::OUString*)pData + (com::sun::star::uno::Type*)pData + (_uno_Any*)pData + (sal_Int32*)pData + (com::sun::star::uno::Exception*)pData + (uno_Sequence**)pData + (com::sun::star::uno::BaseReference*)pData + pData + + pReserved From 65f672060c5f4bb18e7fd9152912d38241e4bde2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Vajngerl?= Date: Thu, 27 Jun 2024 21:22:19 +0900 Subject: [PATCH 130/232] annot: add test that checks annotations after page is duplicated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic2463272d024acda4f4f5bceadbf8d5779967f67 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169643 Tested-by: Tomaž Vajngerl Reviewed-by: Tomaž Vajngerl --- sd/qa/unit/AnnotationTest.cxx | 100 +++++++++++++++++++++++++++++ sd/source/ui/inc/DrawViewShell.hxx | 2 +- 2 files changed, 101 insertions(+), 1 deletion(-) diff --git a/sd/qa/unit/AnnotationTest.cxx b/sd/qa/unit/AnnotationTest.cxx index 563fb2122018..546197bf0746 100644 --- a/sd/qa/unit/AnnotationTest.cxx +++ b/sd/qa/unit/AnnotationTest.cxx @@ -26,6 +26,7 @@ #include #include #include +#include using namespace css; @@ -259,6 +260,105 @@ CPPUNIT_TEST_FIXTURE(AnnotationTest, testAnnotationPositionUpdate) CPPUNIT_ASSERT_EQUAL(tools::Long(25400), pObject->GetLogicRect().Top()); } +CPPUNIT_TEST_FIXTURE(AnnotationTest, testAnnotationDuplicatePage) +{ + // Check the annotation object is properly cloned when duplicating the page. + + createSdDrawDoc(); + + auto pXImpressDocument = dynamic_cast(mxComponent.get()); + sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell(); + CPPUNIT_ASSERT(pViewShell); + auto* pDrawViewShell = dynamic_cast(pViewShell); + CPPUNIT_ASSERT(pDrawViewShell); + + SdDrawDocument* pDocument = pXImpressDocument->GetDocShell()->GetDoc(); + CPPUNIT_ASSERT(pDocument); + + // 1 Page + CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), pDocument->GetSdPageCount(PageKind::Standard)); + + // No objects yet + SdrPage* pPage1 = pDrawViewShell->GetActualPage(); + CPPUNIT_ASSERT_EQUAL(size_t(0), pPage1->GetObjCount()); + + // Inserted new annotation + uno::Sequence aArgs; + + aArgs = comphelper::InitPropertySequence({ + { "Text", uno::Any(u"Comment"_ustr) }, + }); + dispatchCommand(mxComponent, u".uno:InsertAnnotation"_ustr, aArgs); + + // Check state + { + // 1 Annotation in the page + CPPUNIT_ASSERT_EQUAL(size_t(1), pPage1->getAnnotations().size()); + + // 1 Object in the page + CPPUNIT_ASSERT_EQUAL(size_t(1), pPage1->GetObjCount()); + + // And the object is an annotation + SdrObject* pObject = pPage1->GetObj(0); + CPPUNIT_ASSERT_EQUAL(SdrObjKind::Annotation, pObject->GetObjIdentifier()); + CPPUNIT_ASSERT(pObject->isAnnotationObject()); + auto& rAnnotationData = pObject->getAnnotationData(); + + // Get the annotation from the page 1 + auto xAnnotation = pPage1->getAnnotations().at(0); + + // Annotation in the object is the same as the one in the page + CPPUNIT_ASSERT_EQUAL(xAnnotation.get(), rAnnotationData->mxAnnotation.get()); + + // Check text of the annotation + CPPUNIT_ASSERT_EQUAL(u"Comment"_ustr, xAnnotation->GetText()); + } + + // Let's duplicate the page + dispatchCommand(mxComponent, u".uno:DuplicatePage"_ustr, {}); + + // 2 Pages + CPPUNIT_ASSERT_EQUAL(sal_uInt16(2), pDocument->GetSdPageCount(PageKind::Standard)); + + // Let's switch to the 2nd page + CPPUNIT_ASSERT_EQUAL(true, pDrawViewShell->SwitchPage(1)); + + // Check state + { + // Get the current page + SdrPage* pPage2 = pDrawViewShell->GetActualPage(); + + // Should not be the same page as previous page + CPPUNIT_ASSERT(pPage2 != pPage1); + + // 1 Annotation in the page + CPPUNIT_ASSERT_EQUAL(size_t(1), pPage2->getAnnotations().size()); + + // 1 Object in the page + CPPUNIT_ASSERT_EQUAL(size_t(1), pPage2->GetObjCount()); + + // And the object is an annotation + SdrObject* pObject = pPage2->GetObj(0); + CPPUNIT_ASSERT_EQUAL(SdrObjKind::Annotation, pObject->GetObjIdentifier()); + CPPUNIT_ASSERT(pObject->isAnnotationObject()); + auto& rAnnotationData = pObject->getAnnotationData(); + + // Get the annotation from the page 2 + auto xAnnotation = pPage2->getAnnotations().at(0); + + // Annotation in the object is the same as the one in the page + CPPUNIT_ASSERT_EQUAL(xAnnotation.get(), rAnnotationData->mxAnnotation.get()); + + // Check text of the annotation + CPPUNIT_ASSERT_EQUAL(u"Comment"_ustr, xAnnotation->GetText()); + + // Annotation in page 1 is not the same instance as annotation in page 2 + // We verify the annotation was copied + CPPUNIT_ASSERT(pPage1->getAnnotations().at(0).get() + != pPage2->getAnnotations().at(0).get()); + } +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx index 80543adebac2..f6da30194224 100644 --- a/sd/source/ui/inc/DrawViewShell.hxx +++ b/sd/source/ui/inc/DrawViewShell.hxx @@ -250,7 +250,7 @@ public: void ResetActualPage(); void ResetActualLayer(); - bool SwitchPage(sal_uInt16 nPage, bool bAllowChangeFocus = true); + SD_DLLPUBLIC bool SwitchPage(sal_uInt16 nPage, bool bAllowChangeFocus = true); bool IsSwitchPageAllowed() const; /** From 2175d3a847d8644a059c3cb6f3b668ac73c7bdda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Vajngerl?= Date: Thu, 27 Jun 2024 21:24:47 +0900 Subject: [PATCH 131/232] annot: add tests that checks annotation after an text edit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I18bad2e086330bce335299147af8317232d95ccc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169644 Reviewed-by: Tomaž Vajngerl Tested-by: Jenkins --- sd/qa/unit/AnnotationTest.cxx | 68 +++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/sd/qa/unit/AnnotationTest.cxx b/sd/qa/unit/AnnotationTest.cxx index 546197bf0746..e27615a18fbf 100644 --- a/sd/qa/unit/AnnotationTest.cxx +++ b/sd/qa/unit/AnnotationTest.cxx @@ -359,6 +359,74 @@ CPPUNIT_TEST_FIXTURE(AnnotationTest, testAnnotationDuplicatePage) } } +CPPUNIT_TEST_FIXTURE(AnnotationTest, testAnnotationTextUpdate) +{ + createSdDrawDoc(); + + auto pXImpressDocument = dynamic_cast(mxComponent.get()); + sd::ViewShell* pViewShell = pXImpressDocument->GetDocShell()->GetViewShell(); + + // Check current page + SdPage* pPage = pViewShell->GetActualPage(); + + // Should have no objects yet + CPPUNIT_ASSERT_EQUAL(size_t(0), pPage->GetObjCount()); + + // Should have no annotaitons yet + CPPUNIT_ASSERT_EQUAL(size_t(0), pPage->getAnnotations().size()); + + // New free text annotation + rtl::Reference xAnnotation = pPage->createAnnotation(); + xAnnotation->setAuthor(u"B"_ustr); + + uno::Reference xText(xAnnotation->getTextRange()); + xText->setString(u"XXX"_ustr); + + xAnnotation->setPosition(geometry::RealPoint2D(1000.0, 1000.0)); + xAnnotation->setSize(geometry::RealSize2D(5000.0, 2000.0)); + + sdr::annotation::CreationInfo aInfo; + aInfo.meType = sdr::annotation::AnnotationType::FreeText; + xAnnotation->setCreationInfo(aInfo); + + pPage->addAnnotation(xAnnotation, -1); + + CPPUNIT_ASSERT_EQUAL(size_t(1), pPage->getAnnotations().size()); + CPPUNIT_ASSERT_EQUAL(size_t(1), pPage->GetObjCount()); + + SdrObject* pObject = pPage->GetObj(0); + CPPUNIT_ASSERT_EQUAL(SdrObjKind::Text, pObject->GetObjIdentifier()); + + SdrTextObj* pTextObject = static_cast(pObject); + + { + OUString sText = pTextObject->GetOutlinerParaObject()->GetTextObject().GetText(0); + CPPUNIT_ASSERT_EQUAL(u"XXX"_ustr, sText); + + CPPUNIT_ASSERT_EQUAL(u"XXX"_ustr, xAnnotation->GetText()); + } + + SdrView* pView = pViewShell->GetView(); + pView->SdrBeginTextEdit(pTextObject); + CPPUNIT_ASSERT_EQUAL(true, pView->IsTextEdit()); + + auto* pOutlinerView = pView->GetTextEditOutlinerView(); + CPPUNIT_ASSERT(pOutlinerView); + auto& rEditView = pOutlinerView->GetEditView(); + rEditView.SetSelection(ESelection::All()); + rEditView.InsertText(u"ABC"_ustr); + + pView->SdrEndTextEdit(); + CPPUNIT_ASSERT_EQUAL(false, pView->IsTextEdit()); + + { + OUString sText = pTextObject->GetOutlinerParaObject()->GetTextObject().GetText(0); + CPPUNIT_ASSERT_EQUAL(u"ABC"_ustr, sText); + + CPPUNIT_ASSERT_EQUAL(u"ABC"_ustr, pPage->getAnnotations().at(0)->GetText()); + } +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ From 8d869b5fe47842df52965804db87db0941f4f2a0 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 4 Jul 2024 12:10:29 +0200 Subject: [PATCH 132/232] sfx2: fix signature infobar being shown for every repaired document (regression from commit 8b333575ee680664fa3d83249ccec90881754ad7) So it should only be set if the state is still UNKNOWN. But SfxObjectShell::ImplGetSignatureState() is called before the repair dialog is shown, so make sure that the second import (with RepairPackage) finds both members as SignatureState::UNKOWN. Change-Id: Ic914016dde6425a4d95fba7f6f66411305553930 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169989 Tested-by: Jenkins Reviewed-by: Michael Stahl --- sfx2/source/doc/objmisc.cxx | 6 ++++++ sfx2/source/doc/objserv.cxx | 13 +++++++------ sfx2/source/doc/objstor.cxx | 2 ++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 397b13c6bccc..60594554b80a 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -962,6 +962,12 @@ void SfxObjectShell::BreakMacroSign_Impl( bool bBreakMacroSign ) void SfxObjectShell::CheckSecurityOnLoading_Impl() { + if (GetErrorCode() == ERRCODE_IO_BROKENPACKAGE) + { // safety first: don't run any macros from broken package. + pImpl->aMacroMode.disallowMacroExecution(); + return; // do not get signature status - needs to be done after RepairPackage + } + // make sure LO evaluates the macro signatures, so it can be preserved GetScriptingSignatureState(); diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index fcfa222bf588..d5454496ef13 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -1911,18 +1911,19 @@ SignatureState SfxObjectShell::ImplGetSignatureState( bool bScriptingContent ) { SignatureState* pState = bScriptingContent ? &pImpl->nScriptingSignatureState : &pImpl->nDocumentSignatureState; - // repaired package cannot be trusted - if (GetMedium()->IsRepairPackage()) - { - *pState = SignatureState::BROKEN; - } - if ( *pState == SignatureState::UNKNOWN ) { *pState = SignatureState::NOSIGNATURES; uno::Sequence< security::DocumentSignatureInformation > aInfos = GetDocumentSignatureInformation( bScriptingContent ); *pState = DocumentSignatures::getSignatureState(aInfos); + + // repaired package cannot be trusted + if (*pState != SignatureState::NOSIGNATURES + && GetMedium()->IsRepairPackage()) + { + *pState = SignatureState::BROKEN; + } } if ( *pState == SignatureState::OK || *pState == SignatureState::NOTVALIDATED diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 2dc0825e990e..86717c1f428a 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -402,6 +402,8 @@ void SfxObjectShell::PrepareSecondTryLoad_Impl() // only for internal use pImpl->m_xDocStorage.clear(); pImpl->mxObjectContainer.reset(); + pImpl->nDocumentSignatureState = SignatureState::UNKNOWN; + pImpl->nScriptingSignatureState = SignatureState::UNKNOWN; pImpl->m_bIsInit = false; ResetError(); } From b7bcc716fc4819c52ec0ff02cf4e8c0fda622930 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Thu, 4 Jul 2024 11:54:25 +0200 Subject: [PATCH 133/232] pyuno: re-enable pytest_ssl on mac it was disabled in 731f7fe778c19378dfcbc1a5e9165f666ebb90df "disable pytest_ssl on mac" with no apparent reason Change-Id: I7d867ad771f1459a598c4ca346390e732929d705 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169985 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- pyuno/Module_pyuno.mk | 2 -- 1 file changed, 2 deletions(-) diff --git a/pyuno/Module_pyuno.mk b/pyuno/Module_pyuno.mk index 71d7b48e8b8b..890b9fc4aa9e 100644 --- a/pyuno/Module_pyuno.mk +++ b/pyuno/Module_pyuno.mk @@ -46,11 +46,9 @@ endif endif # SYSTEM_PYTHON -ifneq ($(OS),MACOSX) $(eval $(call gb_Module_add_check_targets,pyuno, \ PythonTest_pyuno_pytests_testssl \ )) -endif $(eval $(call gb_Module_add_subsequentcheck_targets,pyuno, \ PythonTest_pyuno_pytests_testcollections \ From 1e2c17a35057abf81395b381e290ccb07c09bb38 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Thu, 4 Jul 2024 12:41:50 +0200 Subject: [PATCH 134/232] tdf#116412: Add unittest Change-Id: Iab051c91900768a3bf3f26b6de3b443dc18a6928 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169990 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- pyuno/Module_pyuno.mk | 1 + pyuno/PythonTest_pyuno_pytests_testbz2.mk | 16 ++++++++++++++++ pyuno/qa/pytests/testbz2.py | 14 ++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 pyuno/PythonTest_pyuno_pytests_testbz2.mk create mode 100644 pyuno/qa/pytests/testbz2.py diff --git a/pyuno/Module_pyuno.mk b/pyuno/Module_pyuno.mk index 890b9fc4aa9e..fac159e2ced3 100644 --- a/pyuno/Module_pyuno.mk +++ b/pyuno/Module_pyuno.mk @@ -48,6 +48,7 @@ endif # SYSTEM_PYTHON $(eval $(call gb_Module_add_check_targets,pyuno, \ PythonTest_pyuno_pytests_testssl \ + PythonTest_pyuno_pytests_testbz2 \ )) $(eval $(call gb_Module_add_subsequentcheck_targets,pyuno, \ diff --git a/pyuno/PythonTest_pyuno_pytests_testbz2.mk b/pyuno/PythonTest_pyuno_pytests_testbz2.mk new file mode 100644 index 000000000000..0f881068c541 --- /dev/null +++ b/pyuno/PythonTest_pyuno_pytests_testbz2.mk @@ -0,0 +1,16 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_PythonTest_PythonTest,pyuno_pytests_testbz2)) + +$(eval $(call gb_PythonTest_add_modules,pyuno_pytests_testbz2,$(SRCDIR)/pyuno/qa/pytests,\ + testbz2 \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/pyuno/qa/pytests/testbz2.py b/pyuno/qa/pytests/testbz2.py new file mode 100644 index 000000000000..12a44e14bb09 --- /dev/null +++ b/pyuno/qa/pytests/testbz2.py @@ -0,0 +1,14 @@ +import os +import unittest + +# tdf#116412: make sure importing bz2 works on all platforms +class BZ2Test(unittest.TestCase): + def test_bz2_import(self): + import bz2 + + # use imported bz2 module for pyflakes + with open(os.devnull, "w") as devnull: + print(str(bz2), file=devnull) + +if __name__ == '__main__': + unittest.main() From 8eaaeb50aea08748102f2f52bd7341f867634224 Mon Sep 17 00:00:00 2001 From: Andrea Gelmini Date: Thu, 4 Jul 2024 15:37:02 +0200 Subject: [PATCH 135/232] Fix typo Change-Id: Id187ef0b7d1d705dfc45a806fc6db459a278fdcd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170000 Tested-by: Julien Nabet Reviewed-by: Julien Nabet --- vcl/source/bitmap/BitmapEx.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/source/bitmap/BitmapEx.cxx b/vcl/source/bitmap/BitmapEx.cxx index c541579744b0..f00eff75ab9e 100644 --- a/vcl/source/bitmap/BitmapEx.cxx +++ b/vcl/source/bitmap/BitmapEx.cxx @@ -1288,7 +1288,7 @@ tools::Polygon BitmapEx::GetContour( bool bContourEdgeDetect, sal_uInt16 nPolyPos = 0; // tdf#161833 treat semi-transparent pixels as opaque // Limiting the contour wrapping polygon to only opaque pixels - // causes clipping of any shadows or other semi-transaprent + // causes clipping of any shadows or other semi-transparent // areas in the image. So, instead of testing for fully opaque // pixels, treat pixels that are not fully transparent as opaque. const BitmapColor aTransparent = pAcc->GetBestMatchingColor( COL_ALPHA_TRANSPARENT ); From 55032dae6950405ec8efe886e7327dbb863fb4df Mon Sep 17 00:00:00 2001 From: Andrea Gelmini Date: Thu, 4 Jul 2024 15:36:37 +0200 Subject: [PATCH 136/232] Fix typo Change-Id: Ieae6dd42fc2e3b8021356145a676cd96c6fb9e76 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169999 Reviewed-by: Julien Nabet Tested-by: Julien Nabet --- sd/qa/unit/AnnotationTest.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sd/qa/unit/AnnotationTest.cxx b/sd/qa/unit/AnnotationTest.cxx index e27615a18fbf..97b61634e556 100644 --- a/sd/qa/unit/AnnotationTest.cxx +++ b/sd/qa/unit/AnnotationTest.cxx @@ -372,7 +372,7 @@ CPPUNIT_TEST_FIXTURE(AnnotationTest, testAnnotationTextUpdate) // Should have no objects yet CPPUNIT_ASSERT_EQUAL(size_t(0), pPage->GetObjCount()); - // Should have no annotaitons yet + // Should have no annotations yet CPPUNIT_ASSERT_EQUAL(size_t(0), pPage->getAnnotations().size()); // New free text annotation From 6005260078c126bf3f1cf4d6f1ebb631453f5ac7 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 4 Jul 2024 14:07:25 +0200 Subject: [PATCH 137/232] comphelper: treat zip file path segments '.' and '..' as invalid This will prevent also opening with RepairPackage, would need to adapt ZipPackage::getZipFileContents() a bit, but let's hope nobody acutally has such files. Also treat path that starts with "/" as invalid, presumably it's not allowed by APPNOTE.TXT: "The name of the file, with optional relative path." Change-Id: Ic694ea2fb34f5de1d490a9a251cf56e4004e9673 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169994 Reviewed-by: Michael Stahl Tested-by: Jenkins --- comphelper/source/misc/storagehelper.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/comphelper/source/misc/storagehelper.cxx b/comphelper/source/misc/storagehelper.cxx index b00e8c543752..b0b7897fd2ab 100644 --- a/comphelper/source/misc/storagehelper.cxx +++ b/comphelper/source/misc/storagehelper.cxx @@ -566,10 +566,17 @@ uno::Sequence< beans::NamedValue > OStorageHelper::CreateGpgPackageEncryptionDat bool OStorageHelper::IsValidZipEntryFileName( std::u16string_view aName, bool bSlashAllowed ) { + long nDots{0}; for ( size_t i = 0; i < aName.size(); i++ ) { switch ( aName[i] ) { + case '.': + if (nDots != -1) + { + ++nDots; + } + break; case '\\': case '?': case '<': @@ -579,15 +586,17 @@ bool OStorageHelper::IsValidZipEntryFileName( std::u16string_view aName, bool bS case ':': return false; case '/': - if ( !bSlashAllowed ) + if (!bSlashAllowed || nDots == 1 || nDots == 2 || i == 0) return false; + nDots = 0; break; default: + nDots = -1; if ( aName[i] < 32 || (aName[i] >= 0xD800 && aName[i] <= 0xDFFF) ) return false; } } - return true; + return nDots != 1 && nDots != 2; } From 24403f4448954b20ff21c81dc92662e2da408fa6 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 4 Jul 2024 14:42:33 +0200 Subject: [PATCH 138/232] fix --disable-firebird-sdbc build Change-Id: I92e4f1b834b9afe806c29f45af94a562fcb3d78e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169993 Tested-by: Jenkins Reviewed-by: Noel Grandin --- dbaccess/CppunitTest_dbaccess_CRMDatabase_test.mk | 1 - 1 file changed, 1 deletion(-) diff --git a/dbaccess/CppunitTest_dbaccess_CRMDatabase_test.mk b/dbaccess/CppunitTest_dbaccess_CRMDatabase_test.mk index 6c008bc130fe..118cb9a4cd97 100644 --- a/dbaccess/CppunitTest_dbaccess_CRMDatabase_test.mk +++ b/dbaccess/CppunitTest_dbaccess_CRMDatabase_test.mk @@ -21,7 +21,6 @@ $(eval $(call gb_CppunitTest_use_libraries,dbaccess_CRMDatabase_test, \ cppuhelper \ dbaxml \ dbtools \ - firebird_sdbc \ sal \ subsequenttest \ utl \ From e142fa40fa721bf76da09c1fdc2d32705b5f74b3 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Thu, 4 Jul 2024 16:38:53 +0200 Subject: [PATCH 139/232] cpdb: Don't include cpdmgr.hxx if not building CPDB support Don't include the header when building without `--enable-cpdb`, as the code there is CPDB-specific. This prepares for Biswadeep's pending Gerrit change series starting at [1] that implements CPDB support using the CPDB C API, and includes the corresponding header. (See CI failure [2] due to missing headers when not building CPDB without this change in place.) [1] https://gerrit.libreoffice.org/c/core/+/168633/5 [2] https://ci.libreoffice.org/job/gerrit_linux_gcc_release/168688/consoleFull#1916232175cd06c086-ffd7-48da-8ce2-d58b9387379c Change-Id: I8b5395d2ad45d50c63c2dbdd0a5459890fc6f6a5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170001 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- vcl/unx/generic/printer/ppdparser.cxx | 3 +++ vcl/unx/generic/printer/printerinfomanager.cxx | 3 +++ 2 files changed, 6 insertions(+) diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx index 12be50e7a685..e8e974c60579 100644 --- a/vcl/unx/generic/printer/ppdparser.cxx +++ b/vcl/unx/generic/printer/ppdparser.cxx @@ -33,7 +33,10 @@ #include #include + +#if ENABLE_CPDB #include +#endif #include #include diff --git a/vcl/unx/generic/printer/printerinfomanager.cxx b/vcl/unx/generic/printer/printerinfomanager.cxx index 2b9eb6aef70a..d2f7173ffa26 100644 --- a/vcl/unx/generic/printer/printerinfomanager.cxx +++ b/vcl/unx/generic/printer/printerinfomanager.cxx @@ -19,7 +19,10 @@ #include +#if ENABLE_CPDB #include +#endif + #include #include #include From ab5d79c90fc33b0a32604e3cbbbc686d01d85d39 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Thu, 4 Jul 2024 14:34:28 +0200 Subject: [PATCH 140/232] tdf#161653 Fix selecting from numbering dropdown (Impress/Draw) Change-Id: Ia066a8ff4b7ab4760fec7a4475afbceee084d115 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169995 Tested-by: Jenkins Reviewed-by: Thorsten Behrens --- sd/source/ui/func/fuolbull.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx index 076c09753409..8c8fc850648c 100644 --- a/sd/source/ui/func/fuolbull.cxx +++ b/sd/source/ui/func/fuolbull.cxx @@ -124,6 +124,8 @@ void FuBulletAndPosition::SetCurrentBulletsNumbering(SfxRequest& rReq) } const SfxUInt16Item* pItem = rReq.GetArgs()->GetItem(SID_ATTR_BULLET_INDEX); + if (!pItem) // tdf#161653 + pItem = rReq.GetArg(nSId); if ( !pItem ) { rReq.Done(); From 96c3d78f39ac4385880ae6f92f15f7ab3564ffcf Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Thu, 4 Jul 2024 23:43:31 +0500 Subject: [PATCH 141/232] Make window's default mouse position a large negative Some operations, like DrawViewShell::Activate, trigger FuDraw::ForcePointer. The latter may call SdrView::PickAnything to test if the pointer is over an object. In SdrMarkView::CheckSingleSdrObjectHit, the bound rectangle of the object is tested first, which doesn't need the object's deep processing. If the point in in the rectangle, the object is processed further, which may render the object. The hit test is performed using a tolerance. Commit 56a1f9bea2f1b64dee4111ec6671caf42ef63c91 (sd: extend test to check the PDF pages aren't rendered when loaded, 2020-03-26) made sure that the rendering doesn't happen in the LOK mode. In that mode, the mouse position is unchanged from the values set in the ImplFrameData ctor. Previously it was enough for the test, that the initial position was [-1, -1], which made the point outside of the bounding rectangle of the objects. But an upcoming fix for the map mode calculations makes tolerance large enough to consider the point inside the rectangle, which triggers rendering and fails the test. This change makes the default position [-32767, -32737], which should be reliably outside of the tested rectangle. Change-Id: Ie1142729448f7ac3c628880140f123cde66b404e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170005 Tested-by: Jenkins Reviewed-by: Mike Kaganski --- vcl/source/window/window.cxx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index d8261ec5acf0..dcb68b9cf142 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -779,14 +779,14 @@ ImplFrameData::ImplFrameData( vcl::Window *pWindow ) mxFontCache = pSVData->maGDIData.mxScreenFontCache; mnFocusId = nullptr; mnMouseMoveId = nullptr; - mnLastMouseX = -1; - mnLastMouseY = -1; - mnBeforeLastMouseX = -1; - mnBeforeLastMouseY = -1; - mnFirstMouseX = -1; - mnFirstMouseY = -1; - mnLastMouseWinX = -1; - mnLastMouseWinY = -1; + mnLastMouseX = -32767; + mnLastMouseY = -32767; + mnBeforeLastMouseX = -32767; + mnBeforeLastMouseY = -32767; + mnFirstMouseX = -32767; + mnFirstMouseY = -32767; + mnLastMouseWinX = -32767; + mnLastMouseWinY = -32767; mnModalMode = 0; mnMouseDownTime = 0; mnClickCount = 0; From 8cf0bc36a8baa1d53b0a5fb169c6a9d5d8455289 Mon Sep 17 00:00:00 2001 From: Andreas Heinisch Date: Sun, 23 Jun 2024 14:57:34 +0200 Subject: [PATCH 142/232] tdf#158110 - Paste special: improve check for cells with notes Change-Id: Ia18d8f91ee2d4493174255424ce7e3b7310c369d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169355 Reviewed-by: Andreas Heinisch Tested-by: Jenkins --- sc/inc/document.hxx | 2 ++ sc/inc/table.hxx | 1 + sc/qa/uitest/pasteSpecial/tdf158110.py | 38 ++++++++++++++++++++++++++ sc/source/core/data/document.cxx | 9 ++++++ sc/source/core/data/table2.cxx | 14 ++++++++++ sc/source/ui/view/viewfun3.cxx | 9 ++++-- 6 files changed, 71 insertions(+), 2 deletions(-) diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 2f67225bf8ec..15f1720142fb 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -1359,6 +1359,8 @@ public: // This also includes e.g. notes. Use IsEmptyData() for cell data only. bool IsBlockEmpty( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab ) const; + bool IsNotesBlockEmpty( SCCOL nStartCol, SCROW nStartRow, + SCCOL nEndCol, SCROW nEndRow, SCTAB nTab ) const; bool IsPrintEmpty( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, bool bLeftIsEmpty = false, diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 8ddc5cdc3b09..7da55e4cb3ee 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -426,6 +426,7 @@ public: // This also includes e.g. notes. Use IsEmptyData() for cell data only. bool IsBlockEmpty( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ) const; + bool IsNotesBlockEmpty( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ) const; bool SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString& rString, const ScSetStringParam * pParam = nullptr ); diff --git a/sc/qa/uitest/pasteSpecial/tdf158110.py b/sc/qa/uitest/pasteSpecial/tdf158110.py index 9b0dba6ed8cd..9d775226c030 100644 --- a/sc/qa/uitest/pasteSpecial/tdf158110.py +++ b/sc/qa/uitest/pasteSpecial/tdf158110.py @@ -12,6 +12,7 @@ from uitest.framework import UITestCase from libreoffice.calc.document import get_cell_by_position from libreoffice.uno.propertyvalue import mkPropertyValues from libreoffice.calc.paste_special import reset_default_values +from uitest.uihelper.common import get_state_as_dict class tdf158110(UITestCase): def test_tdf158110_paste_special_multiple_cells(self): @@ -45,4 +46,41 @@ class tdf158110(UITestCase): # i.e., the comment was not copied self.assertEqual("Comment 1", get_cell_by_position(document, 0, 1, 0).Annotation.String) + def test_tdf158110_paste_special_overwrite_comments(self): + with self.ui_test.create_doc_in_start_center("calc") as document: + xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window") + + # Insert a comments + targetCells = ["A1", "A2", "B3", "D2"] + for targetCell in targetCells: + xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": targetCell})) + xArgs = mkPropertyValues({"Text": "Comment 1"}) + self.xUITest.executeCommandWithParameters(".uno:InsertAnnotation", xArgs) + + # Copy cell range A1:B3 to clipboard + xGridWin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:B3"})) + self.xUITest.executeCommand(".uno:Copy") + + # Paste data using special options (check only comments), i.e., overwrite comment in D2 + xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"})) + with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xPasteSpecialDlg: + reset_default_values(self, xPasteSpecialDlg) + xDateTimeChkBox = xPasteSpecialDlg.getChild("datetime") + xDateTimeChkBox.executeAction("CLICK", tuple()) + xTextChkBox = xPasteSpecialDlg.getChild("text") + xTextChkBox.executeAction("CLICK", tuple()) + xNumbersChkBox = xPasteSpecialDlg.getChild("numbers") + xNumbersChkBox.executeAction("CLICK", tuple()) + xCommentsChkBox = xPasteSpecialDlg.getChild("comments") + xCommentsChkBox.executeAction("CLICK", tuple()) + + # Without the fix in place, this test would have failed with + # AssertionError: 'CheckWarningDialog' != '' + # i.e., the warning dialog was not shown + xCheckWarningDlg = self.xUITest.getTopFocusWindow() + self.assertEqual("CheckWarningDialog", get_state_as_dict(xCheckWarningDlg)["ID"]) + if get_state_as_dict(xCheckWarningDlg)["ID"] == "CheckWarningDialog": + xYesBtn = xCheckWarningDlg.getChild("yes") + xYesBtn.executeAction("CLICK", tuple()) + # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 51d636c588af..78f36e0bc462 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -5308,6 +5308,15 @@ void ScDocument::GetBorderLines( SCCOL nCol, SCROW nRow, SCTAB nTab, *ppBottom = pBottomLine; } +bool ScDocument::IsNotesBlockEmpty(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, + SCTAB nTab) const +{ + if (HasTable(nTab)) + return maTabs[nTab]->IsNotesBlockEmpty(nStartCol, nStartRow, nEndCol, nEndRow); + OSL_FAIL("wrong table number"); + return false; +} + bool ScDocument::IsBlockEmpty(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab) const { diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index aa51bec2d727..4629ce8036d1 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -2396,6 +2396,20 @@ void ScTable::SetMergedCells( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ApplyFlags(nCol1+1, nRow1+1, nCol2, nRow2, ScMF::Hor | ScMF::Ver); } +bool ScTable::IsNotesBlockEmpty(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const +{ + if (!(ValidCol(nCol1) && ValidCol(nCol2))) + { + OSL_FAIL("ScTable::IsBlockEmptyNotes: invalid column number"); + return false; + } + nCol2 = ClampToAllocatedColumns(nCol2); + bool bEmpty = true; + for (SCCOL i = nCol1; i <= nCol2 && bEmpty; i++) + bEmpty = aCol[i].IsNotesEmptyBlock(nRow1, nRow2); + return bEmpty; +} + bool ScTable::IsBlockEmpty( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2 ) const { if (!(ValidCol(nCol1) && ValidCol(nCol2))) diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index f9ded7171687..d3e40076187a 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -852,13 +852,18 @@ bool checkDestRangeForOverwrite(InsertDeleteFlags nFlags, const ScRangeList& rDe { bool bIsEmpty = true; size_t nRangeSize = rDestRanges.size(); + for (const auto& rTab : rMark) { for (size_t i = 0; i < nRangeSize && bIsEmpty; ++i) { const ScRange& rRange = rDestRanges[i]; - if (nFlags & InsertDeleteFlags::ADDNOTES) - bIsEmpty = !rDoc.HasNote(rRange.aStart) && !rDoc.HasNote(rRange.aEnd); + // tdf#158110 - check if just the ADDNOTES flag is present without any other content + if ((nFlags & InsertDeleteFlags::ADDNOTES) == InsertDeleteFlags::ADDNOTES + && (nFlags & (InsertDeleteFlags::CONTENTS & ~InsertDeleteFlags::NOTE)) + == InsertDeleteFlags::NONE) + bIsEmpty = rDoc.IsNotesBlockEmpty(rRange.aStart.Col(), rRange.aStart.Row(), + rRange.aEnd.Col(), rRange.aEnd.Row(), rTab); else bIsEmpty = rDoc.IsBlockEmpty(rRange.aStart.Col(), rRange.aStart.Row(), rRange.aEnd.Col(), rRange.aEnd.Row(), rTab); From 07a166790b6c6c0b0bce96ce25d970a636ba55d6 Mon Sep 17 00:00:00 2001 From: AungKhantOo Date: Thu, 4 Jul 2024 14:56:12 +0700 Subject: [PATCH 143/232] tdf#159380 Fix for Add an UNO command to close all documents Change the condition if the documents are immediately closeable. Now, save locked documents are not immediately closeable. Remove the check if in quit or closing docs in SID_CLOSEDOC in objserv.cxx as it becomes unneccessary. Remove some extra new lines which are unnecessary changes from before the patch. Change-Id: Iab16629fe436f4365000fb2a016bbb1fb49c181c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169983 Reviewed-by: Andreas Heinisch Reviewed-by: Mike Kaganski Tested-by: Jenkins --- sfx2/source/appl/appserv.cxx | 4 +--- sfx2/source/doc/objserv.cxx | 8 -------- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx index 737635ddf2c0..c9c37f554a96 100644 --- a/sfx2/source/appl/appserv.cxx +++ b/sfx2/source/appl/appserv.cxx @@ -497,7 +497,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq ) { SfxObjectShell* pNxtObjSh = SfxObjectShell::GetNext(*pObjSh); // can close immediately - if (!pObjSh->IsModified() || pObjSh->isSaveLocked()) + if (!pObjSh->IsModified()) { // don't close the last remaining frame for close dispatch if (pNxtObjSh || !bClosedAll) @@ -1352,10 +1352,8 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet) rSet.DisableItem(nWhich); return; } - Reference < XDesktop2 > xDesktop = Desktop::create( ::comphelper::getProcessComponentContext() ); Reference< XIndexAccess > xTasks = xDesktop->getFrames(); - if ( !xTasks.is() || !xTasks->getCount() ) rSet.DisableItem(nWhich); break; diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index d5454496ef13..49ff18c0e4b6 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -49,7 +49,6 @@ #include #include #include -#include #include #include @@ -1294,13 +1293,6 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) case SID_CLOSEDOC: { - // cancel requests during SfxApplication is closing or quitting. - SfxAppData_Impl* pAppData = SfxGetpApp()->Get_Impl(); - if (pAppData && (pAppData->bInQuit || pAppData->bClosingDocs)) - { - return; - } - // Evaluate Parameter const SfxBoolItem* pSaveItem = rReq.GetArg(SID_CLOSEDOC_SAVE); const SfxStringItem* pNameItem = rReq.GetArg(SID_CLOSEDOC_FILENAME); From 269654fe179384f994bf0fe47e2af8c731cac377 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 4 Jul 2024 18:58:58 +0200 Subject: [PATCH 144/232] fix asan build after commit 85fd526fc681a994415bb422090d1d23aa7d54f6 "fix and simplify the ItemInstanceManager mechanism" The problem is that some *Item classes in sw/ and sc/ share WhichIds, and a whole bunch of SfxBoolItem subclasses share the same SfxItemType enum value. So we ended up mixing and matching objects of different concrete subclasses in a given *ItemManager collection. Add some asserts to the global pool code to catch issues like this earlier on. Add unique value of the SfxItemType enum for all the SfxBoolItem subclasses Change-Id: I3c8d4e02be1cd412b0292e973a6498df5f8e7102 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170003 Tested-by: Jenkins Reviewed-by: Noel Grandin --- editeng/source/items/paraitem.cxx | 2 +- editeng/source/items/textitem.cxx | 2 +- include/editeng/opaqitem.hxx | 2 +- include/editeng/prntitem.hxx | 2 +- include/svl/poolitem.hxx | 44 ++++++++++++++++--- include/svx/sdmetitm.hxx | 3 +- include/svx/sdooitm.hxx | 2 +- include/svx/sdtaiitm.hxx | 4 +- include/svx/sxcecitm.hxx | 2 +- include/svx/sxcllitm.hxx | 4 +- include/svx/sxmbritm.hxx | 2 +- include/svx/sxmtfitm.hxx | 5 ++- include/svx/sxmtritm.hxx | 4 +- sc/source/core/data/attrib.cxx | 8 ++-- svl/source/items/globalpool.cxx | 10 +++++ svx/inc/sxopitm.hxx | 5 ++- svx/source/engine3d/svx3ditems.cxx | 13 +++--- svx/source/svdraw/svdattr.cxx | 2 +- svx/source/xoutdev/xattr.cxx | 2 +- sw/inc/fmtclbl.hxx | 2 +- sw/inc/fmteiro.hxx | 2 +- sw/inc/fmtfollowtextflow.hxx | 2 +- sw/inc/fmtlsplt.hxx | 2 +- sw/inc/fmtrowsplt.hxx | 2 +- sw/inc/hfspacingitem.hxx | 2 +- sw/source/core/attr/formatflysplit.cxx | 2 +- .../core/attr/formatwraptextatflystart.cxx | 2 +- 27 files changed, 89 insertions(+), 45 deletions(-) diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx index ce547ff38d63..c75f236f8246 100644 --- a/editeng/source/items/paraitem.cxx +++ b/editeng/source/items/paraitem.cxx @@ -566,7 +566,7 @@ bool SvxOrphansItem::GetPresentation // class SvxHyphenZoneItem ----------------------------------------------- SvxHyphenZoneItem::SvxHyphenZoneItem( const bool bHyph, const sal_uInt16 nId ) : - SfxPoolItem( nId, SfxItemType::SvxHyphenZoneItem ), + SfxPoolItem( nId, SfxItemType::SvxHyphenZoneItemType ), bHyphen(bHyph), bKeep(false), bNoCapsHyphenation(false), diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index 664c5db802ad..196182b3b973 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -2573,7 +2573,7 @@ void SvxCharRotateItem::dumpAsXml(xmlTextWriterPtr pWriter) const SvxCharScaleWidthItem::SvxCharScaleWidthItem( sal_uInt16 nValue, TypedWhichId nW ) - : SfxUInt16Item( nW, nValue, SfxItemType::SvxCharScaleWidthItem ) + : SfxUInt16Item( nW, nValue, SfxItemType::SvxCharScaleWidthItemType ) { } diff --git a/include/editeng/opaqitem.hxx b/include/editeng/opaqitem.hxx index d38747747c55..112a62e6aaef 100644 --- a/include/editeng/opaqitem.hxx +++ b/include/editeng/opaqitem.hxx @@ -45,7 +45,7 @@ public: }; inline SvxOpaqueItem::SvxOpaqueItem( const sal_uInt16 nId, const bool bOpa ) - : SfxBoolItem( nId, bOpa ) + : SfxBoolItem( nId, bOpa, SfxItemType::SvxOpaqueItemType ) {} #endif diff --git a/include/editeng/prntitem.hxx b/include/editeng/prntitem.hxx index 8f0e6a8fc855..34f490b46084 100644 --- a/include/editeng/prntitem.hxx +++ b/include/editeng/prntitem.hxx @@ -47,7 +47,7 @@ public: }; inline SvxPrintItem::SvxPrintItem( const sal_uInt16 nId, const bool bPrt ) - : SfxBoolItem( nId, bPrt ) + : SfxBoolItem( nId, bPrt, SfxItemType::SvxPrintItemType ) {} #endif diff --git a/include/svl/poolitem.hxx b/include/svl/poolitem.hxx index 0d0c4771d429..fb51a7fa3335 100644 --- a/include/svl/poolitem.hxx +++ b/include/svl/poolitem.hxx @@ -127,13 +127,16 @@ enum class SfxItemType : sal_uInt16 { SbxItemType, ScCondFormatItemType, ScConsolidateItemType, + ScHyphenateCellType, ScInputStatusItemType, + ScLineBreakCellType, ScMergeAttrType, ScPageHFItemType, ScPageScaleToItemType, ScPivotItemType, ScProtectionAttrType, ScQueryItemType, + ScShrinkToFitCellType, ScSolveItemType, ScSortItemType, ScSubTotalItemType, @@ -144,13 +147,16 @@ enum class SfxItemType : sal_uInt16 { ScTpPrintItemType, ScTpViewItemType, ScUserListItemType, + ScVerticalStackCellType, ScViewObjectModeItemType, SdOptionsMiscItemType, SdOptionsPrintItemType, SdOptionsSnapItemType, SdrAngleItemType, SdrCaptionEscDirItemType, - SdrCaptionTypeItem, + SdrCaptionEscIsRelItemType, + SdrCaptionFitLineLenItemType, + SdrCaptionLineLenItemType, SdrCaptionTypeItemType, SdrCircKindItemType, SdrCustomShapeGeometryItemType, @@ -159,22 +165,34 @@ enum class SfxItemType : sal_uInt16 { SdrGrafModeItem_Base, SdrLayerIdItemType, SdrLayerNameItemType, + SdrMeasureBelowRefEdgeItemType, SdrMeasureFormatStringItemType, SdrMeasureKindItemType, SdrMeasureScaleItemType, SdrMeasureTextAutoAngleItemType, SdrMeasureTextAutoAngleViewItemType, + SdrMeasureTextFixedAngleItemType, SdrMeasureTextHPosItemType, + SdrMeasureTextIsFixedAngleItemType, + SdrMeasureTextRota90ItemType, + SdrMeasureTextUpsideDownItemType, SdrMeasureTextVPosItemType, SdrMeasureUnitItemType, + SdrMetricItemType, + SdrObjPrintableItemType, + SdrObjVisibleItemType, + SdrOnOffItemType, SdrResizeXAllItemType, SdrResizeXOneItemType, SdrResizeYAllItemType, SdrResizeYOneItemType, SdrScaleItemType, SdrTextAniDirectionItemType, + SdrTextAniStartInsideItemType, + SdrTextAniStopInsideItemType, SdrTextAniKindItemType, SdrTextFitToSizeTypeItemType, + SdrTextFixedCellHeightItemType, SdrTextHorzAdjustType, SdrTextVertAdjustType, SdrYesNoItemType, @@ -215,6 +233,12 @@ enum class SfxItemType : sal_uInt16 { SfxVoidItemType, SfxWatermarkItemType, SfxZoomItemType, + Svx3DCharacterModeItemType, + Svx3DCloseBackItemType, + Svx3DCloseFrontItemType, + Svx3DReducedLineGeometryItemType, + Svx3DSmoothLidsItemType, + Svx3DSmoothNormalsItemType, SvXMLAttrContainerItemType, SvxAdjustItemType, SvxAutoKernItemType, @@ -228,7 +252,7 @@ enum class SfxItemType : sal_uInt16 { SvxCaseMapItemType, SvxCharHiddenItemType, SvxCharReliefItemType, - SvxCharScaleWidthItem, + SvxCharScaleWidthItemType, SvxChartColorTableItemType, SvxChartIndicateItemType, SvxChartKindErrorItemType, @@ -255,9 +279,7 @@ enum class SfxItemType : sal_uInt16 { SvxGalleryItemType, SvxGradientListItemType, SvxGraphicItemType, - SvxGrfCrop, SvxGrfCropType, - SvxGridItem, SvxGridItemType, SvxGutterLeftMarginItemType, SvxGutterRightMarginItemType, @@ -265,7 +287,6 @@ enum class SfxItemType : sal_uInt16 { SvxHatchListItemType, SvxHorJustifyItemType, SvxHyperlinkItemType, - SvxHyphenZoneItem, SvxHyphenZoneItemType, SvxJustifyMethodItemType, SvxKerningItemType, @@ -283,6 +304,7 @@ enum class SfxItemType : sal_uInt16 { SvxNumBulletItemType, SvxNumberInfoItemType, SvxObjectItemType, + SvxOpaqueItemType, SvxOrientationItemType, SvxOrphansItemType, SvxPageItemType, @@ -291,6 +313,7 @@ enum class SfxItemType : sal_uInt16 { SvxParaVertAlignItemType, SvxPatternListItemType, SvxPostureItemType, + SvxPrintItemType, SvxProtectItemType, SvxRightMarginItemType, SvxRotateModeItemType, @@ -299,7 +322,6 @@ enum class SfxItemType : sal_uInt16 { SvxSearchItemType, SvxShadowItemType, SvxShadowedItemType, - SvxSizeItem , SvxSizeItemType, SvxSmartTagItemType, SvxTabStopItemType, @@ -334,26 +356,34 @@ enum class SfxItemType : sal_uInt16 { SwFormatContentControlType, SwFormatContentType, SwFormatDropType, + SwFormatEditInReadonly, SwFormatFieldType, SwFormatFillOrderType, SwFormatFlyCntType, + SwFormatFlySplitType, + SwFormatFollowTextFlowType, SwFormatFooterType, SwFormatFootnoteEndAtTextEndType, SwFormatFootnoteType, SwFormatHeaderType, SwFormatHoriOrientType, SwFormatINetFormatType, + SwFormatLayoutSplitType, SwFormatLineNumberType, SwFormatLinebreakType, SwFormatMetaType, + SwFormatNoBalancedColumnsType, SwFormatPageDescType, SwFormatRefMarkType, + SwFormatRowSplitType, SwFormatRubyType, SwFormatSurroundType, SwFormatURLType, SwFormatVertOrientType, SwFormatWrapInfluenceOnOjPosType, + SwFormatWrapTextAtFlyStartType, SwGammaGrfType, + SwHeaderAndFooterEatSpacingItemType, SwInvertGrfType, SwLabItemType, SwMirrorGrfType, @@ -388,7 +418,7 @@ enum class SfxItemType : sal_uInt16 { XFormTextAdjustItemType, XFormTextDistanceItemType, XFormTextHideFormItemType, - XFormTextMirrorItem, + XFormTextMirrorItemType, XFormTextOutlineItemType, XFormTextShadowItemType, XFormTextShadowTranspItemType, diff --git a/include/svx/sdmetitm.hxx b/include/svx/sdmetitm.hxx index 934c24034d94..751cd769aedc 100644 --- a/include/svx/sdmetitm.hxx +++ b/include/svx/sdmetitm.hxx @@ -29,7 +29,8 @@ class SVXCORE_DLLPUBLIC SdrMetricItem: public SfxInt32Item { public: - SdrMetricItem(TypedWhichId nId, sal_Int32 nVal): SfxInt32Item(nId,nVal) {} + SdrMetricItem(TypedWhichId nId, sal_Int32 nVal, SfxItemType eItemType = SfxItemType::SdrMetricItemType) + : SfxInt32Item(nId,nVal,eItemType) {} virtual SdrMetricItem* Clone(SfxItemPool* pPool=nullptr) const override; virtual bool HasMetrics() const override; virtual void ScaleMetrics(tools::Long nMul, tools::Long nDiv) override; diff --git a/include/svx/sdooitm.hxx b/include/svx/sdooitm.hxx index befd67f749e0..3feae53ed66e 100644 --- a/include/svx/sdooitm.hxx +++ b/include/svx/sdooitm.hxx @@ -29,7 +29,7 @@ class SVXCORE_DLLPUBLIC SdrOnOffItem: public SfxBoolItem { public: - SdrOnOffItem(TypedWhichId nId, bool bOn): SfxBoolItem(nId,bOn) {} + SdrOnOffItem(TypedWhichId nId, bool bOn): SfxBoolItem(nId,bOn, SfxItemType::SdrOnOffItemType) {} virtual SdrOnOffItem* Clone(SfxItemPool* pPool=nullptr) const override; virtual OUString GetValueTextByVal(bool bVal) const override; diff --git a/include/svx/sdtaiitm.hxx b/include/svx/sdtaiitm.hxx index d847208a6857..9a09d6a02344 100644 --- a/include/svx/sdtaiitm.hxx +++ b/include/svx/sdtaiitm.hxx @@ -24,7 +24,7 @@ class SVXCORE_DLLPUBLIC SdrTextAniStartInsideItem final : public SdrYesNoItem { public: - SdrTextAniStartInsideItem(bool bOn=false): SdrYesNoItem(SDRATTR_TEXT_ANISTARTINSIDE,bOn) {} + SdrTextAniStartInsideItem(bool bOn=false): SdrYesNoItem(SDRATTR_TEXT_ANISTARTINSIDE,bOn, SfxItemType::SdrTextAniStartInsideItemType) {} virtual ~SdrTextAniStartInsideItem() override; virtual SdrTextAniStartInsideItem* Clone(SfxItemPool* pPool=nullptr) const override; @@ -36,7 +36,7 @@ public: class SVXCORE_DLLPUBLIC SdrTextAniStopInsideItem final : public SdrYesNoItem { public: - SdrTextAniStopInsideItem(bool bOn=false): SdrYesNoItem(SDRATTR_TEXT_ANISTOPINSIDE,bOn) {} + SdrTextAniStopInsideItem(bool bOn=false): SdrYesNoItem(SDRATTR_TEXT_ANISTOPINSIDE,bOn, SfxItemType::SdrTextAniStopInsideItemType) {} virtual ~SdrTextAniStopInsideItem() override; virtual SdrTextAniStopInsideItem* Clone(SfxItemPool* pPool=nullptr) const override; diff --git a/include/svx/sxcecitm.hxx b/include/svx/sxcecitm.hxx index 9f20c10c1a7f..83f4053d7c28 100644 --- a/include/svx/sxcecitm.hxx +++ b/include/svx/sxcecitm.hxx @@ -49,7 +49,7 @@ public: class SVXCORE_DLLPUBLIC SdrCaptionEscIsRelItem final : public SdrYesNoItem { public: - SdrCaptionEscIsRelItem(bool bRel=true): SdrYesNoItem(SDRATTR_CAPTIONESCISREL,bRel) {} + SdrCaptionEscIsRelItem(bool bRel=true): SdrYesNoItem(SDRATTR_CAPTIONESCISREL,bRel, SfxItemType::SdrCaptionEscIsRelItemType) {} virtual ~SdrCaptionEscIsRelItem() override; virtual SdrCaptionEscIsRelItem* Clone(SfxItemPool* pPool=nullptr) const override; diff --git a/include/svx/sxcllitm.hxx b/include/svx/sxcllitm.hxx index 8ac03f0eaf84..00ebe20ddfe4 100644 --- a/include/svx/sxcllitm.hxx +++ b/include/svx/sxcllitm.hxx @@ -30,7 +30,7 @@ */ class SVXCORE_DLLPUBLIC SdrCaptionLineLenItem final : public SdrMetricItem { public: - SdrCaptionLineLenItem(tools::Long nLineLen=0): SdrMetricItem(SDRATTR_CAPTIONLINELEN,nLineLen) {} + SdrCaptionLineLenItem(tools::Long nLineLen=0): SdrMetricItem(SDRATTR_CAPTIONLINELEN,nLineLen, SfxItemType::SdrCaptionLineLenItemType) {} virtual ~SdrCaptionLineLenItem() override; virtual SdrCaptionLineLenItem* Clone(SfxItemPool* pPool=nullptr) const override; @@ -46,7 +46,7 @@ public: */ class SVXCORE_DLLPUBLIC SdrCaptionFitLineLenItem final : public SdrYesNoItem { public: - SdrCaptionFitLineLenItem(bool bBestFit=true): SdrYesNoItem(SDRATTR_CAPTIONFITLINELEN,bBestFit) {} + SdrCaptionFitLineLenItem(bool bBestFit=true): SdrYesNoItem(SDRATTR_CAPTIONFITLINELEN,bBestFit, SfxItemType::SdrCaptionFitLineLenItemType) {} virtual ~SdrCaptionFitLineLenItem() override; virtual SdrCaptionFitLineLenItem* Clone(SfxItemPool* pPool=nullptr) const override; diff --git a/include/svx/sxmbritm.hxx b/include/svx/sxmbritm.hxx index 022656aaa142..5cdc6e69f3eb 100644 --- a/include/svx/sxmbritm.hxx +++ b/include/svx/sxmbritm.hxx @@ -31,7 +31,7 @@ // (SdrMeasureLineDistItem) over the reference edge class SVXCORE_DLLPUBLIC SdrMeasureBelowRefEdgeItem final : public SdrYesNoItem { public: - SdrMeasureBelowRefEdgeItem(bool bOn=false): SdrYesNoItem(SDRATTR_MEASUREBELOWREFEDGE,bOn) {} + SdrMeasureBelowRefEdgeItem(bool bOn=false): SdrYesNoItem(SDRATTR_MEASUREBELOWREFEDGE,bOn, SfxItemType::SdrMeasureBelowRefEdgeItemType) {} virtual ~SdrMeasureBelowRefEdgeItem() override; virtual SdrMeasureBelowRefEdgeItem* Clone(SfxItemPool* pPool=nullptr) const override; diff --git a/include/svx/sxmtfitm.hxx b/include/svx/sxmtfitm.hxx index 11de732865a7..2284ac4db0a3 100644 --- a/include/svx/sxmtfitm.hxx +++ b/include/svx/sxmtfitm.hxx @@ -29,7 +29,7 @@ // Abrogate TextUpsideDown, TextRota90 and TextAutoAngle. (n.i.) class SdrMeasureTextIsFixedAngleItem final : public SdrYesNoItem { public: - SdrMeasureTextIsFixedAngleItem(bool bOn=false): SdrYesNoItem(SDRATTR_MEASURETEXTISFIXEDANGLE,bOn) {} + SdrMeasureTextIsFixedAngleItem(bool bOn=false): SdrYesNoItem(SDRATTR_MEASURETEXTISFIXEDANGLE,bOn, SfxItemType::SdrMeasureTextIsFixedAngleItemType) {} virtual ~SdrMeasureTextIsFixedAngleItem() override; virtual SdrMeasureTextIsFixedAngleItem* Clone(SfxItemPool* pPool=nullptr) const override; @@ -42,7 +42,8 @@ public: //Angle of the text in 1/100deg. 0=horizontal; read from left to right. (n.i.) class SdrMeasureTextFixedAngleItem final : public SdrAngleItem { public: - SdrMeasureTextFixedAngleItem(Degree100 nVal=0_deg100): SdrAngleItem(SDRATTR_MEASURETEXTFIXEDANGLE,nVal) {} + SdrMeasureTextFixedAngleItem(Degree100 nVal=0_deg100) + : SdrAngleItem(SDRATTR_MEASURETEXTFIXEDANGLE,nVal, SfxItemType::SdrMeasureTextFixedAngleItemType) {} virtual ~SdrMeasureTextFixedAngleItem() override; virtual SdrMeasureTextFixedAngleItem* Clone(SfxItemPool* pPool=nullptr) const override; diff --git a/include/svx/sxmtritm.hxx b/include/svx/sxmtritm.hxx index 184a59f39307..3f0c3579a625 100644 --- a/include/svx/sxmtritm.hxx +++ b/include/svx/sxmtritm.hxx @@ -25,7 +25,7 @@ // text across the dimension line (90deg counter-clockwise rotation) class SVXCORE_DLLPUBLIC SdrMeasureTextRota90Item final : public SdrYesNoItem { public: - SdrMeasureTextRota90Item(bool bOn=false): SdrYesNoItem(SDRATTR_MEASURETEXTROTA90,bOn) {} + SdrMeasureTextRota90Item(bool bOn=false): SdrYesNoItem(SDRATTR_MEASURETEXTROTA90,bOn, SfxItemType::SdrMeasureTextRota90ItemType) {} virtual ~SdrMeasureTextRota90Item() override; virtual SdrMeasureTextRota90Item* Clone(SfxItemPool* pPool=nullptr) const override; @@ -39,7 +39,7 @@ public: // Text is also switched to the other side of the dimension line, if not Rota90 class SdrMeasureTextUpsideDownItem final : public SdrYesNoItem { public: - SdrMeasureTextUpsideDownItem(bool bOn=false): SdrYesNoItem(SDRATTR_MEASURETEXTUPSIDEDOWN,bOn) {} + SdrMeasureTextUpsideDownItem(bool bOn=false): SdrYesNoItem(SDRATTR_MEASURETEXTUPSIDEDOWN,bOn, SfxItemType::SdrMeasureTextUpsideDownItemType) {} virtual ~SdrMeasureTextUpsideDownItem() override; virtual SdrMeasureTextUpsideDownItem* Clone(SfxItemPool* pPool=nullptr) const override; diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx index f118ca7d063e..91ea0de1e5a1 100644 --- a/sc/source/core/data/attrib.cxx +++ b/sc/source/core/data/attrib.cxx @@ -772,7 +772,7 @@ bool ScRotateValueItem::GetPresentation(SfxItemPresentation ePresentation, } ScShrinkToFitCell::ScShrinkToFitCell(bool bShrink) - : SfxBoolItem(ATTR_SHRINKTOFIT, bShrink) + : SfxBoolItem(ATTR_SHRINKTOFIT, bShrink, SfxItemType::ScShrinkToFitCellType) { } @@ -792,7 +792,7 @@ bool ScShrinkToFitCell::GetPresentation(SfxItemPresentation, } ScVerticalStackCell::ScVerticalStackCell(bool bStack) - : SfxBoolItem(ATTR_STACKED, bStack) + : SfxBoolItem(ATTR_STACKED, bStack, SfxItemType::ScVerticalStackCellType) { } @@ -812,7 +812,7 @@ bool ScVerticalStackCell::GetPresentation(SfxItemPresentation, } ScLineBreakCell::ScLineBreakCell(bool bStack) - : SfxBoolItem(ATTR_LINEBREAK, bStack) + : SfxBoolItem(ATTR_LINEBREAK, bStack, SfxItemType::ScLineBreakCellType) { } @@ -832,7 +832,7 @@ bool ScLineBreakCell::GetPresentation(SfxItemPresentation, } ScHyphenateCell::ScHyphenateCell(bool bHyphenate) - : SfxBoolItem(ATTR_HYPHENATE, bHyphenate) + : SfxBoolItem(ATTR_HYPHENATE, bHyphenate, SfxItemType::ScHyphenateCellType) { } diff --git a/svl/source/items/globalpool.cxx b/svl/source/items/globalpool.cxx index 7ad6abc6a49f..313db586a566 100644 --- a/svl/source/items/globalpool.cxx +++ b/svl/source/items/globalpool.cxx @@ -283,6 +283,11 @@ SfxPoolItem const* implCreateItemEntry(SfxItemPool& rPool, SfxPoolItem const* pS const SfxPoolItem* pAlternative = rItemManager.find(*pSource); if (pAlternative) { + SAL_WARN_IF(typeid(*pAlternative) != typeid(*pSource), "svl", + "wrong item from pool, expected " << typeid(*pSource).name() + << " but got " + << typeid(*pAlternative).name()); + assert(typeid(*pAlternative) == typeid(*pSource) && "wrong item from pool"); // Here we do *not* need to check if it is an SfxSetItem // and cannot be shared if they are in/use another pool: // The SfxItemSet::operator== will check for SfxItemPools @@ -324,10 +329,15 @@ SfxPoolItem const* implCreateItemEntry(SfxItemPool& rPool, SfxPoolItem const* pS // bPassingOwnership is given just use the item, else clone it if (!bPassingOwnership) { + auto pPreviousSource = pSource; pSource = pSource->Clone(pMasterPool); #ifdef DBG_UTIL assert(pSource->Which() == nWhich && "ITEM: Clone of Item did NOT copy/set WhichID (!)"); #endif + SAL_WARN_IF(typeid(*pPreviousSource) != typeid(*pSource), "svl", + "wrong item from Clone(), expected " << typeid(*pPreviousSource).name() + << " but got " << typeid(*pSource).name()); + assert(typeid(*pPreviousSource) == typeid(*pSource) && "wrong item from Clone()"); } // increase RefCnt 0->1 diff --git a/svx/inc/sxopitm.hxx b/svx/inc/sxopitm.hxx index cd7d2bb1f599..52389b7331c1 100644 --- a/svx/inc/sxopitm.hxx +++ b/svx/inc/sxopitm.hxx @@ -24,7 +24,8 @@ class SdrObjPrintableItem final : public SdrYesNoItem { public: - SdrObjPrintableItem(bool bOn=false): SdrYesNoItem(SDRATTR_OBJPRINTABLE,bOn) {} + SdrObjPrintableItem(bool bOn=false) + : SdrYesNoItem(SDRATTR_OBJPRINTABLE,bOn, SfxItemType::SdrObjPrintableItemType) {} virtual SdrObjPrintableItem* Clone(SfxItemPool*) const override { return new SdrObjPrintableItem(*this); @@ -33,7 +34,7 @@ public: class SdrObjVisibleItem final : public SdrYesNoItem { public: - SdrObjVisibleItem(bool bOn=true): SdrYesNoItem(SDRATTR_OBJVISIBLE,bOn) {} + SdrObjVisibleItem(bool bOn=true): SdrYesNoItem(SDRATTR_OBJVISIBLE,bOn, SfxItemType::SdrObjVisibleItemType) {} virtual SdrObjVisibleItem* Clone(SfxItemPool*) const override { return new SdrObjVisibleItem(*this); diff --git a/svx/source/engine3d/svx3ditems.cxx b/svx/source/engine3d/svx3ditems.cxx index 1bfa4f559111..599d32a56cb9 100644 --- a/svx/source/engine3d/svx3ditems.cxx +++ b/svx/source/engine3d/svx3ditems.cxx @@ -31,7 +31,8 @@ using namespace ::com::sun::star; // Added extra Item (Bool) for chart2 to be able to show reduced line geometry Svx3DReducedLineGeometryItem::Svx3DReducedLineGeometryItem(bool bVal) - : SfxBoolItem(SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY, bVal) + : SfxBoolItem(SDRATTR_3DOBJ_REDUCED_LINE_GEOMETRY, bVal, + SfxItemType::Svx3DReducedLineGeometryItemType) { } @@ -76,7 +77,7 @@ Svx3DShadeModeItem::Svx3DShadeModeItem(sal_uInt16 nVal) } Svx3DSmoothNormalsItem::Svx3DSmoothNormalsItem(bool bVal) - : SfxBoolItem(SDRATTR_3DOBJ_SMOOTH_NORMALS, bVal) + : SfxBoolItem(SDRATTR_3DOBJ_SMOOTH_NORMALS, bVal, SfxItemType::Svx3DSmoothNormalsItemType) { } @@ -86,7 +87,7 @@ Svx3DSmoothNormalsItem* Svx3DSmoothNormalsItem::Clone(SfxItemPool*) const } Svx3DSmoothLidsItem::Svx3DSmoothLidsItem(bool bVal) - : SfxBoolItem(SDRATTR_3DOBJ_SMOOTH_LIDS, bVal) + : SfxBoolItem(SDRATTR_3DOBJ_SMOOTH_LIDS, bVal, SfxItemType::Svx3DSmoothLidsItemType) { } @@ -96,7 +97,7 @@ Svx3DSmoothLidsItem* Svx3DSmoothLidsItem::Clone(SfxItemPool*) const } Svx3DCharacterModeItem::Svx3DCharacterModeItem(bool bVal) - : SfxBoolItem(SDRATTR_3DOBJ_CHARACTER_MODE, bVal) + : SfxBoolItem(SDRATTR_3DOBJ_CHARACTER_MODE, bVal, SfxItemType::Svx3DCharacterModeItemType) { } @@ -106,7 +107,7 @@ Svx3DCharacterModeItem* Svx3DCharacterModeItem::Clone(SfxItemPool*) const } Svx3DCloseFrontItem::Svx3DCloseFrontItem(bool bVal) - : SfxBoolItem(SDRATTR_3DOBJ_CLOSE_FRONT, bVal) + : SfxBoolItem(SDRATTR_3DOBJ_CLOSE_FRONT, bVal, SfxItemType::Svx3DCloseFrontItemType) { } @@ -116,7 +117,7 @@ Svx3DCloseFrontItem* Svx3DCloseFrontItem::Clone(SfxItemPool*) const } Svx3DCloseBackItem::Svx3DCloseBackItem(bool bVal) - : SfxBoolItem(SDRATTR_3DOBJ_CLOSE_BACK, bVal) + : SfxBoolItem(SDRATTR_3DOBJ_CLOSE_BACK, bVal, SfxItemType::Svx3DCloseBackItemType) { } diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx index 1ae7e7eedcab..cb6c197dfcd4 100644 --- a/svx/source/svdraw/svdattr.cxx +++ b/svx/source/svdraw/svdattr.cxx @@ -1477,7 +1477,7 @@ bool SdrTextAniAmountItem::GetPresentation( SdrTextFixedCellHeightItem::SdrTextFixedCellHeightItem( bool bUseFixedCellHeight ) - : SfxBoolItem( SDRATTR_TEXT_USEFIXEDCELLHEIGHT, bUseFixedCellHeight ) + : SfxBoolItem( SDRATTR_TEXT_USEFIXEDCELLHEIGHT, bUseFixedCellHeight, SfxItemType::SdrTextFixedCellHeightItemType ) { } bool SdrTextFixedCellHeightItem::GetPresentation( SfxItemPresentation ePres, diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index a228b93e4da2..d8e0a41a6f9d 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -2987,7 +2987,7 @@ XFormTextStartItem* XFormTextStartItem::Clone(SfxItemPool* /*pPool*/) const SfxPoolItem* XFormTextMirrorItem::CreateDefault() { return new XFormTextMirrorItem; } XFormTextMirrorItem::XFormTextMirrorItem(bool bMirror) : - SfxBoolItem(XATTR_FORMTXTMIRROR, bMirror, SfxItemType::XFormTextMirrorItem) + SfxBoolItem(XATTR_FORMTXTMIRROR, bMirror, SfxItemType::XFormTextMirrorItemType) { } diff --git a/sw/inc/fmtclbl.hxx b/sw/inc/fmtclbl.hxx index c521b45bd8bb..5ffc709896cf 100644 --- a/sw/inc/fmtclbl.hxx +++ b/sw/inc/fmtclbl.hxx @@ -29,7 +29,7 @@ class SW_DLLPUBLIC SwFormatNoBalancedColumns final : public SfxBoolItem { public: SwFormatNoBalancedColumns( bool bFlag = false ) - : SfxBoolItem( RES_COLUMNBALANCE, bFlag ) {} + : SfxBoolItem( RES_COLUMNBALANCE, bFlag, SfxItemType::SwFormatNoBalancedColumnsType ) {} /// "pure virtual methods" of SfxPoolItem virtual SwFormatNoBalancedColumns* Clone( SfxItemPool *pPool = nullptr ) const override; diff --git a/sw/inc/fmteiro.hxx b/sw/inc/fmteiro.hxx index 7ec165654c27..a971d71cc2ca 100644 --- a/sw/inc/fmteiro.hxx +++ b/sw/inc/fmteiro.hxx @@ -35,7 +35,7 @@ class SW_DLLPUBLIC SwFormatEditInReadonly final : public SfxBoolItem { public: SwFormatEditInReadonly( sal_uInt16 nId = RES_EDIT_IN_READONLY, - bool bPrt = false ) : SfxBoolItem( nId, bPrt ) {} + bool bPrt = false ) : SfxBoolItem( nId, bPrt, SfxItemType::SwFormatEditInReadonly ) {} /// "pure virtual method" of SfxPoolItem virtual SwFormatEditInReadonly* Clone( SfxItemPool *pPool = nullptr ) const override; diff --git a/sw/inc/fmtfollowtextflow.hxx b/sw/inc/fmtfollowtextflow.hxx index 625f4658207b..b4e1fc599cab 100644 --- a/sw/inc/fmtfollowtextflow.hxx +++ b/sw/inc/fmtfollowtextflow.hxx @@ -34,7 +34,7 @@ class SW_DLLPUBLIC SwFormatFollowTextFlow final : public SfxBoolItem public: SwFormatFollowTextFlow( bool bFlag = false ) - : SfxBoolItem( RES_FOLLOW_TEXT_FLOW, bFlag ) + : SfxBoolItem( RES_FOLLOW_TEXT_FLOW, bFlag, SfxItemType::SwFormatFollowTextFlowType ) {} /// "pure virtual methods" of SfxPoolItem diff --git a/sw/inc/fmtlsplt.hxx b/sw/inc/fmtlsplt.hxx index 8038f597d9a9..822ec7af9b98 100644 --- a/sw/inc/fmtlsplt.hxx +++ b/sw/inc/fmtlsplt.hxx @@ -31,7 +31,7 @@ class IntlWrapper; class SW_DLLPUBLIC SwFormatLayoutSplit final : public SfxBoolItem { public: - SwFormatLayoutSplit( bool bSplit = true ) : SfxBoolItem( RES_LAYOUT_SPLIT, bSplit ) {} + SwFormatLayoutSplit( bool bSplit = true ) : SfxBoolItem( RES_LAYOUT_SPLIT, bSplit, SfxItemType::SwFormatLayoutSplitType ) {} /// "pure virtual methods" of SfxPoolItem virtual SwFormatLayoutSplit* Clone( SfxItemPool *pPool = nullptr ) const override; diff --git a/sw/inc/fmtrowsplt.hxx b/sw/inc/fmtrowsplt.hxx index faf168ba2b5e..a3a53e2012a2 100644 --- a/sw/inc/fmtrowsplt.hxx +++ b/sw/inc/fmtrowsplt.hxx @@ -31,7 +31,7 @@ class IntlWrapper; class SW_DLLPUBLIC SwFormatRowSplit final : public SfxBoolItem { public: - SwFormatRowSplit( bool bSplit = true ) : SfxBoolItem( RES_ROW_SPLIT, bSplit ) {} + SwFormatRowSplit( bool bSplit = true ) : SfxBoolItem( RES_ROW_SPLIT, bSplit, SfxItemType::SwFormatRowSplitType ) {} // "pure virtual methods" of SfxPoolItem virtual SwFormatRowSplit* Clone( SfxItemPool *pPool = nullptr ) const override; diff --git a/sw/inc/hfspacingitem.hxx b/sw/inc/hfspacingitem.hxx index a18ae742a3a0..1d1c85693290 100644 --- a/sw/inc/hfspacingitem.hxx +++ b/sw/inc/hfspacingitem.hxx @@ -29,7 +29,7 @@ class SW_DLLPUBLIC SwHeaderAndFooterEatSpacingItem final : public SfxBoolItem { public: SwHeaderAndFooterEatSpacingItem( sal_uInt16 nId = RES_HEADER_FOOTER_EAT_SPACING, - bool bPrt = false ) : SfxBoolItem( nId, bPrt ) {} + bool bPrt = false ) : SfxBoolItem( nId, bPrt, SfxItemType::SwHeaderAndFooterEatSpacingItemType ) {} // "pure virtual methods" of SfxPoolItem virtual SwHeaderAndFooterEatSpacingItem* Clone( SfxItemPool *pPool = nullptr ) const override; diff --git a/sw/source/core/attr/formatflysplit.cxx b/sw/source/core/attr/formatflysplit.cxx index 6bcfd74390e1..76f8eb8ed451 100644 --- a/sw/source/core/attr/formatflysplit.cxx +++ b/sw/source/core/attr/formatflysplit.cxx @@ -22,7 +22,7 @@ #include SwFormatFlySplit::SwFormatFlySplit(bool bSplit) - : SfxBoolItem(RES_FLY_SPLIT, bSplit) + : SfxBoolItem(RES_FLY_SPLIT, bSplit, SfxItemType::SwFormatFlySplitType) { // Once this pool item is true, a floating table (text frame + table inside it) is meant to // split across multiple pages. diff --git a/sw/source/core/attr/formatwraptextatflystart.cxx b/sw/source/core/attr/formatwraptextatflystart.cxx index 88a17d5ade33..898a24c97f5c 100644 --- a/sw/source/core/attr/formatwraptextatflystart.cxx +++ b/sw/source/core/attr/formatwraptextatflystart.cxx @@ -22,7 +22,7 @@ #include SwFormatWrapTextAtFlyStart::SwFormatWrapTextAtFlyStart(bool bAtStart) - : SfxBoolItem(RES_WRAP_TEXT_AT_FLY_START, bAtStart) + : SfxBoolItem(RES_WRAP_TEXT_AT_FLY_START, bAtStart, SfxItemType::SwFormatWrapTextAtFlyStartType) { // Once this pool item is true, the text from the anchor text of the fly wraps an all pages, not // only on the last page of the fly chain. From 48e76366ea5932a75792ba5d5e6a474e8003733f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Vajngerl?= Date: Thu, 4 Jul 2024 12:38:42 +0900 Subject: [PATCH 145/232] annot: don't show the annot. object if LOK and not PDF document MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In online the client side comments/annotations are used, so to keep this behavior for presentations we only enable the core side rendering of annotations when the document is a PDF. No change in the desktop applitation. Change-Id: I50ffd1b6d81d2fcf6ef9f821e783ae228e39e4e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169969 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- include/svx/annotation/AnnotationObject.hxx | 2 ++ include/svx/svdmodel.hxx | 7 +++++++ sd/source/filter/pdf/sdpdffilter.cxx | 5 +++-- svx/source/annotation/AnnotationObject.cxx | 22 +++++++++++++-------- svx/source/svdraw/svdmodel.cxx | 1 + 5 files changed, 27 insertions(+), 10 deletions(-) diff --git a/include/svx/annotation/AnnotationObject.hxx b/include/svx/annotation/AnnotationObject.hxx index e372fec1f56a..674d1290b9af 100644 --- a/include/svx/annotation/AnnotationObject.hxx +++ b/include/svx/annotation/AnnotationObject.hxx @@ -37,6 +37,8 @@ public: AnnotationObject(SdrModel& rSdrModel, tools::Rectangle const& rRectangle, sdr::annotation::AnnotationViewData const& aAnnotationViewData); + void setup(); + rtl::Reference CloneSdrObject(SdrModel& rTargetModel) const override; SdrObjKind GetObjIdentifier() const override; diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx index f029d928aa8a..5f0175b57d7e 100644 --- a/include/svx/svdmodel.hxx +++ b/include/svx/svdmodel.hxx @@ -213,6 +213,7 @@ protected: bool m_bStarDrawPreviewMode:1; bool mbDisableTextEditUsesCommonUndoManager:1; bool mbVOCInvalidationIsReliable:1; // does the app reliably invalidate the VOC, or do we need to rebuild the primitives on every render? + bool m_bIsPDFDocument:1; sal_uInt16 m_nDefaultTabulator; sal_uInt32 m_nMaxUndoCount; @@ -581,6 +582,12 @@ public: bool IsWriter() const { return m_bIsWriter; } + bool IsPDFDocument() const { return m_bIsPDFDocument; } + void setPDFDocument(bool bIsPDFDocument) + { + m_bIsPDFDocument = bIsPDFDocument; + } + // Used as a fallback in *::ReadUserDataSequence() to process common properties void ReadUserDataSequenceValue(const css::beans::PropertyValue *pValue); void WriteUserDataSequence(css::uno::Sequence < css::beans::PropertyValue >& rValues); diff --git a/sd/source/filter/pdf/sdpdffilter.cxx b/sd/source/filter/pdf/sdpdffilter.cxx index 58e2dfead82f..22229e6597ce 100644 --- a/sd/source/filter/pdf/sdpdffilter.cxx +++ b/sd/source/filter/pdf/sdpdffilter.cxx @@ -59,6 +59,9 @@ bool SdPdfFilter::Import() mrDocument.setLock(true); const bool bSavedUndoEnabled = mrDocument.IsUndoEnabled(); mrDocument.EnableUndo(false); + mrDocument.setPDFDocument(true); + + SdrModel& rModel = mrDocument; // Add as many pages as we need up-front. mrDocument.CreateFirstPages(); @@ -83,8 +86,6 @@ bool SdPdfFilter::Import() // Make the page size match the rendered image. pPage->SetSize(aSizeHMM); - SdrModel& rModel = pPage->getSdrModelFromSdrPage(); - rtl::Reference pSdrGrafObj = new SdrGrafObj(rModel, rGraphic, tools::Rectangle(Point(), aSizeHMM)); diff --git a/svx/source/annotation/AnnotationObject.cxx b/svx/source/annotation/AnnotationObject.cxx index c87943067ae0..d69f9be6e9fa 100644 --- a/svx/source/annotation/AnnotationObject.cxx +++ b/svx/source/annotation/AnnotationObject.cxx @@ -11,15 +11,13 @@ #include #include +#include + #include #include - #include #include #include -#include -#include - #include #include #include @@ -29,6 +27,9 @@ #include #include #include + +#include +#include #include #include #include @@ -92,15 +93,13 @@ Color getColorLight(sal_uInt16 aAuthorIndex) AnnotationObject::AnnotationObject(SdrModel& rSdrModel) : SdrRectObj(rSdrModel) { - setAsAnnotationObject(true); - mbTextFrame = true; // need this so the frame can be adjusted to the text + setup(); } AnnotationObject::AnnotationObject(SdrModel& rSdrModel, AnnotationObject const& rSource) : SdrRectObj(rSdrModel, rSource) { - setAsAnnotationObject(true); - mbTextFrame = true; // need this so the frame can be adjusted to the text + setup(); } AnnotationObject::AnnotationObject(SdrModel& rSdrModel, tools::Rectangle const& rRectangle, @@ -116,8 +115,15 @@ AnnotationObject::AnnotationObject(SdrModel& rSdrModel, tools::Rectangle const& rSdrModel.EnableUndo(bUndo); osl_atomic_decrement(&m_refCount); + setup(); +} + +void AnnotationObject::setup() +{ setAsAnnotationObject(true); mbTextFrame = true; // need this so the frame can be adjusted to the text + bool bLOK = comphelper::LibreOfficeKit::isActive(); + SetVisible(getSdrModelFromSdrObject().IsPDFDocument() || !bLOK); } void AnnotationObject::ApplyAnnotationName() diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx index 3c43cf2c81bc..a26b26a2ff2c 100644 --- a/svx/source/svdraw/svdmodel.cxx +++ b/svx/source/svdraw/svdmodel.cxx @@ -142,6 +142,7 @@ SdrModel::SdrModel(SfxItemPool* pPool, comphelper::IEmbeddedHelper* pEmbeddedHel , m_bStarDrawPreviewMode(false) , mbDisableTextEditUsesCommonUndoManager(false) , mbVOCInvalidationIsReliable(false) + , m_bIsPDFDocument(false) , m_nDefaultTabulator(0) , m_nMaxUndoCount(16) , m_pTextChain(new TextChain) From 2afdc61dd3138b383fb73dae2242ba1a9c8de901 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Thu, 4 Jul 2024 17:52:49 +0200 Subject: [PATCH 146/232] package: ZipFile: treat junk at the start of zip as invalid Probably the only legitimate use of such is self-extracting archives, irrelevant for LO. ofz56826-1.zip is an example; given what Info-Zip unzip prints about this file we don't want to successfully open it. Change-Id: I9568710227e4a152f9dc7bc356184394d7da8eba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170002 Tested-by: Jenkins Reviewed-by: Michael Stahl --- .../qa/cppunit/data/{pass => fail}/ofz56826-1.zip | Bin package/source/zipapi/ZipFile.cxx | 6 ++++++ 2 files changed, 6 insertions(+) rename package/qa/cppunit/data/{pass => fail}/ofz56826-1.zip (100%) diff --git a/package/qa/cppunit/data/pass/ofz56826-1.zip b/package/qa/cppunit/data/fail/ofz56826-1.zip similarity index 100% rename from package/qa/cppunit/data/pass/ofz56826-1.zip rename to package/qa/cppunit/data/fail/ofz56826-1.zip diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index afb4a9283bfc..fa8d74b37b80 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -1077,6 +1077,7 @@ sal_Int32 ZipFile::readCEN() ZipEntry aEntry; sal_Int16 nCommentLen; + sal_Int64 nMinOffset{nEndPos}; aEntries.reserve(nTotal); for (nCount = 0 ; nCount < nTotal; nCount++) @@ -1141,6 +1142,7 @@ sal_Int32 ZipFile::readCEN() if (o3tl::checked_add(aEntry.nOffset, nLocPos, aEntry.nOffset)) throw ZipException(u"Integer-overflow"_ustr); + nMinOffset = std::min(nMinOffset, aEntry.nOffset); if (o3tl::checked_multiply(aEntry.nOffset, -1, aEntry.nOffset)) throw ZipException(u"Integer-overflow"_ustr); @@ -1167,6 +1169,10 @@ sal_Int32 ZipFile::readCEN() if (nCount != nTotal) throw ZipException(u"Count != Total"_ustr ); + if (nMinOffset != 0) + { + throw ZipException(u"Extra bytes at beginning of zip file"_ustr); + } } catch ( IllegalArgumentException & ) { From a14531e4135a82df53615254cac5e9ea0c357ef4 Mon Sep 17 00:00:00 2001 From: Tibor Nagy Date: Fri, 5 Jul 2024 08:37:21 +0200 Subject: [PATCH 147/232] The connector shape is losing its connection The issue is that we are trying to set the connector shape properties too early, but the shapes that we want to connect to have not been created yet. Follow-up to commit Ie95ccd5bcd4d5c3f9c45c7dcc4f88acc0c9438aa "tdf#157172 tdf#157460 PPTX import: fix connectors adjustment values" Change-Id: I63c76535cc718bc46d5c3ed5489b752925cd6a77 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170007 Tested-by: Jenkins Reviewed-by: Nagy Tibor --- oox/qa/unit/data/connectorConnection.pptx | Bin 0 -> 33296 bytes oox/qa/unit/shape.cxx | 28 +++++++++++ oox/source/ppt/slidepersist.cxx | 56 +++++++++++----------- 3 files changed, 56 insertions(+), 28 deletions(-) create mode 100644 oox/qa/unit/data/connectorConnection.pptx diff --git a/oox/qa/unit/data/connectorConnection.pptx b/oox/qa/unit/data/connectorConnection.pptx new file mode 100644 index 0000000000000000000000000000000000000000..e8a86a157151a02c47ddf1c54be74e57b839c2e2 GIT binary patch literal 33296 zcmeFYW0Wo1vMpRTSJ}30+qP}nRjatlwr$(CxyrV!RaLL{KKJ|HefRFx&ij8~{+O9# zj*+vq95bT#i0F~>Qota{0AK(R000040Na!3k5zyG0HQDe07w83Kw3g}w$3KD&U(ro z_9jj`wC*<6`1v3}RE10l4C{Qv zrIh)hK4RP-6ps)`p+0Yslild41k1|b)QE_|Sz<@tbc>*9DpVw3SX?7LjvZpk&l176 z3Si!)X)~)X0Y0yyeI&3}#dXpUXW#b$VuwbIhY3d9N(0rPi@0lH8cTK}83kyN!Ypmo zXLLj_H^QhvSdpkqKzWbJb+DFg(3cLUVd@j8`1~_w;RfU4eq5 zlq{9JO3#duxH7k-!VlW?qCGM6;>d|r{N+CN0JfY|7xu>pfy-HA=q)aWB<7Lb-=eV= z?V=W5k*{M>Er^jE-Z;Vfww+PEyIe3sE?*L(HqEZa*Fd_P%DsJJUHV-MXI{oiERKhm z)Iawt2m9Y^q+Q_Crg@CpZ(>j9g^EK$rPXj5S-!_lv1O`{h-W?B2jnwuy4=s0FFXSm zvFT-0m{Gm#-5z`yZo=nX;ION&Yyrk1cIjWBjXmGK{PhJ4Apd`Ox%rE89`N_f-nSD& ze|x!}qlvW>9qnJA|IfSs2fOrtdi2WpbxB|bgpg~{ZGuT3wslIvd22i2ldRD<03*f@ ztW9k3;`#2byd47rnx9>hlYDsF#2R)_w#e6s^{~2q_2mMwD}CzQRPMHTs4e)61#IkK za!_!I1`FD{l{x0Zv_c-W3=x928hyRk*M*aw_@Ql3ao(rS1RMvB(p{0I+qGnE<>y#w zzKpqP^h3+!;#y9i`8>jJcv_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xB zslJ?0_4E@O)_%W%V6P)daIYGIcSqSLe?e^)vBy?Gos+^d(Ob@eCAVj7UYOAA79eO% z2+fSBCwG)JVAuQm*Q-`YWp7AcrNkq9{bB{RXSn(PV*=ZZm%CI|{oBvH-;`Z46tWJY zu>y4H>6+3sCs_?u-j;qERmH$9?Q9=wCLsO%B;5Du^36L&~o zV4dx%khuSNJDnhMNlqyA)mS*_&n34rg!rwJq??+r*tXR=^`}2@>y4>JRk%Oz zg3y~+!k&NB@S<9*FIDlN%X?P!u$863!IXiv8z&soN8_W$=*!7o@gP@*zK7Q31Y|TH zR&1^6;B~Tu?u;Ca-ATIAq3$F-lz5Q2-?Gu~&iaOSYMNU^|J}|=3kFiv=&H`a3I13@+IG7;2qQ{CAOX zF{9fV!3ErYe=d*CSq7bph@Z1LodE#g6__UO1o4Ljzs&7)5q2??&lwH_RR5l<&pF}N z*`nJ;+QrN`XEZeMY4R8Cht}@Y#&asWi@1xy@y~D?MCWinR!L8B=Tv1EaTmiypW))k z{vLNK&$@`a81wZEM@IekxKo|eMcl<`hG)2k*Z&@ODj2$myBIR;4CezbG5>Wbe&M@Q z<;_Lh#mF&dxK@t8$DK-8F5)i6oH)ac^ZY&TR10zucX0#!87}R{-{Ve26&GB2#JZ)yAv`Aop}`(zo--yxrg!hWBur1d-GGojV*lhw6n=L);+)qR6q6VjX{e j-8}zYMW=KB#h)*qO0ozi!A60r;Ew|sDlXjh OoxShapeTest::getShapeByName(std::u16string_view return xRet; } +CPPUNIT_TEST_FIXTURE(OoxShapeTest, testConnectorConnection) +{ + loadFromFile(u"connectorConnection.pptx"); + + uno::Reference xDrawPagesSupplier(mxComponent, uno::UNO_QUERY); + uno::Reference xDrawPage(xDrawPagesSupplier->getDrawPages()->getByIndex(0), + uno::UNO_QUERY); + + uno::Reference xConnector(xDrawPage->getByIndex(0), uno::UNO_QUERY); + uno::Reference xConnectorProps(xConnector, uno::UNO_QUERY); + + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 0 + // - Actual : -1 + // i.e. the connector shape is not attaching to the shape + sal_Int32 nStartGlueId; + xConnectorProps->getPropertyValue("StartGluePointIndex") >>= nStartGlueId; + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nStartGlueId); + + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 2 + // - Actual : -1 + // i.e. the connector shape is not attaching to the shape + sal_Int32 nEndGlueId; + xConnectorProps->getPropertyValue("EndGluePointIndex") >>= nEndGlueId; + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), nEndGlueId); +} + CPPUNIT_TEST_FIXTURE(OoxShapeTest, testElbowConnectors) { loadFromFile(u"elbowConnectors.pptx"); diff --git a/oox/source/ppt/slidepersist.cxx b/oox/source/ppt/slidepersist.cxx index 2164311a0bfb..915ce1a1d733 100644 --- a/oox/source/ppt/slidepersist.cxx +++ b/oox/source/ppt/slidepersist.cxx @@ -164,6 +164,7 @@ void SlidePersist::createXShapes( XmlFilterBase& rFilterBase ) Reference< XShapes > xShapes( getPage() ); std::vector< oox::drawingml::ShapePtr >& rShapes( maShapesPtr->getChildren() ); + oox::drawingml::ShapeIdMap aConnectorShapeMap; for (auto const& shape : rShapes) { @@ -176,43 +177,42 @@ void SlidePersist::createXShapes( XmlFilterBase& rFilterBase ) { pPPTShape->addShape( rFilterBase, *this, getTheme().get(), xShapes, aTransformation, &getShapeMap() ); - oox::drawingml::ShapeIdMap aConnectorShapeMap; const auto& pIter = maShapeMap.find(pPPTShape->getId()); if (pIter != maShapeMap.end()) lcl_createShapeMap(pIter->second, aConnectorShapeMap); - - if(!aConnectorShapeMap.empty()) - { - for (auto& pIt : aConnectorShapeMap) - { - SdrObject* pObj = SdrObject::getSdrObjectFromXShape(pIt.second->getXShape()); - SdrModel& rModel(pObj->getSdrModelFromSdrObject()); - rModel.setLock(false); - - ConnectorHelper::applyConnections(pIt.second, getShapeMap()); - - if (pIt.second->getConnectorName() == u"bentConnector3"_ustr - || pIt.second->getConnectorName() == u"bentConnector4"_ustr - || pIt.second->getConnectorName() == u"bentConnector5"_ustr) - { - ConnectorHelper::applyBentHandleAdjustments(pIt.second); - } - else if (pIt.second->getConnectorName() == u"curvedConnector3"_ustr - || pIt.second->getConnectorName() == u"curvedConnector4"_ustr - || pIt.second->getConnectorName() == u"curvedConnector5"_ustr) - { - ConnectorHelper::applyCurvedHandleAdjustments(pIt.second); - } - else // bentConnector2 - createConnectorShapeConnection(pIt.second); - } - } } else child->addShape( rFilterBase, getTheme().get(), xShapes, aTransformation, maShapesPtr->getFillProperties(), &getShapeMap() ); } } + if (!aConnectorShapeMap.empty()) + { + for (auto& pIt : aConnectorShapeMap) + { + ConnectorHelper::applyConnections(pIt.second, getShapeMap()); + + SdrObject* pObj = SdrObject::getSdrObjectFromXShape(pIt.second->getXShape()); + SdrModel& rModel(pObj->getSdrModelFromSdrObject()); + rModel.setLock(false); + + if (pIt.second->getConnectorName() == u"bentConnector3"_ustr + || pIt.second->getConnectorName() == u"bentConnector4"_ustr + || pIt.second->getConnectorName() == u"bentConnector5"_ustr) + { + ConnectorHelper::applyBentHandleAdjustments(pIt.second); + } + else if (pIt.second->getConnectorName() == u"curvedConnector3"_ustr + || pIt.second->getConnectorName() == u"curvedConnector4"_ustr + || pIt.second->getConnectorName() == u"curvedConnector5"_ustr) + { + ConnectorHelper::applyCurvedHandleAdjustments(pIt.second); + } + else // bentConnector2 + createConnectorShapeConnection(pIt.second); + } + } + Reference< XAnimationNodeSupplier > xNodeSupplier( getPage(), UNO_QUERY); if( !xNodeSupplier.is() ) return; From 74b312d6f255e3bb056dbb7fdf9158fb7b2aecad Mon Sep 17 00:00:00 2001 From: Tibor Nagy Date: Fri, 5 Jul 2024 07:19:15 +0200 Subject: [PATCH 148/232] Add escape direction support for glue points in the preset shapes Change-Id: I6727def5dd42ecd5dae3ddd27d2af733b5883e09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170006 Tested-by: Jenkins Reviewed-by: Nagy Tibor --- include/svx/EnhancedCustomShape2d.hxx | 1 + .../drawingml/customshapepresetdata.cxx | 81 ++++++++++++++++++ .../customshapes/oox-drawingml-cs-presets | 22 ++--- .../pptx/glue_point_leaving_directions.pptx | Bin 0 -> 33129 bytes sd/qa/unit/data/xml/n820786_0.xml | 2 + sd/qa/unit/import-tests.cxx | 28 ++++++ .../customshapes/EnhancedCustomShape2d.cxx | 34 ++++++-- 7 files changed, 152 insertions(+), 16 deletions(-) create mode 100644 sd/qa/unit/data/pptx/glue_point_leaving_directions.pptx diff --git a/include/svx/EnhancedCustomShape2d.hxx b/include/svx/EnhancedCustomShape2d.hxx index bed4fa9d75f8..3947da9c31c4 100644 --- a/include/svx/EnhancedCustomShape2d.hxx +++ b/include/svx/EnhancedCustomShape2d.hxx @@ -118,6 +118,7 @@ class SVXCORE_DLLPUBLIC EnhancedCustomShape2d final : public SfxItemSet css::uno::Sequence< css::drawing::EnhancedCustomShapeAdjustmentValue > m_seqAdjustmentValues; css::uno::Sequence< css::beans::PropertyValues > m_seqHandles; css::uno::Sequence< css::awt::Size > m_seqSubViewSize; + css::uno::Sequence< double > m_seqGluePointLeavingDirections; bool m_bFilled : 1; bool m_bStroked : 1; diff --git a/oox/source/drawingml/customshapepresetdata.cxx b/oox/source/drawingml/customshapepresetdata.cxx index 597f19b5943e..b03d583a8cdf 100644 --- a/oox/source/drawingml/customshapepresetdata.cxx +++ b/oox/source/drawingml/customshapepresetdata.cxx @@ -162,6 +162,18 @@ awt::Rectangle lcl_parseRectangle(std::string_view rValue) return aRectangle; } +sal_Int32 lcl_parseDirection(std::string_view rValue) +{ + sal_Int32 aDirection; + // We expect the following here: Direction + static const char aExpectedWidthPrefix[] = "Dir = (long) "; + assert(o3tl::starts_with(rValue, aExpectedWidthPrefix)); + sal_Int32 nIndex = strlen(aExpectedWidthPrefix); + aDirection = o3tl::toInt32(rValue.substr(nIndex)); + + return aDirection; +} + awt::Size lcl_parseSize(std::string_view rValue) { awt::Size aSize; @@ -582,6 +594,73 @@ void lcl_parsePathGluePoints(std::vector& rPath, std::stri } } +void lcl_parsePathGluePointLeavingDirectionsValues(std::vector& rPath, + std::string_view rValue) +{ + std::vector aDirection; + sal_Int32 nLevel = 0; + sal_Int32 nStart = 0; + for (size_t i = 0; i < rValue.size(); ++i) + { + if (rValue[i] == '{') + { + if (!nLevel) + nStart = i; + nLevel++; + } + else if (rValue[i] == '}') + { + nLevel--; + if (!nLevel) + aDirection.push_back(lcl_parseDirection( + rValue.substr(nStart + strlen("{ "), i - nStart - strlen(" },")))); + } + } + + beans::PropertyValue aPropertyValue; + aPropertyValue.Name = "GluePointLeavingDirections"; + aPropertyValue.Value <<= comphelper::containerToSequence(aDirection); + rPath.push_back(aPropertyValue); +} + +void lcl_parsePathGluePointLeavingDirections(std::vector& rPath, + std::string_view rValue) +{ + sal_Int32 nLevel = 0; + bool bIgnore = false; + sal_Int32 nStart = 0; + for (size_t i = 0; i < rValue.size(); ++i) + { + if (rValue[i] == '{') + { + if (!nLevel) + bIgnore = true; + nLevel++; + } + else if (rValue[i] == '}') + { + nLevel--; + if (!nLevel) + bIgnore = false; + } + else if (rValue[i] == ',' && !bIgnore) + { + std::string_view aToken = rValue.substr(nStart, i - nStart); + static const char aExpectedPrefix[] = "Value = (any) { ([]long) { "; + if (o3tl::starts_with(aToken, aExpectedPrefix)) + { + aToken = aToken.substr(strlen(aExpectedPrefix), + aToken.size() - strlen(aExpectedPrefix) - strlen(" } }")); + lcl_parsePathGluePointLeavingDirectionsValues(rPath, aToken); + } + else if (!o3tl::starts_with(aToken, "Name =") && !o3tl::starts_with(aToken, "Handle =")) + SAL_WARN("oox", + "lcl_parsePathGluePointLeavingDirections: unexpected token: " << aToken); + nStart = i + strlen(", "); + } + } +} + void lcl_parsePathSegmentValues(std::vector& rPath, std::string_view rValue) { std::vector aSegments; @@ -804,6 +883,8 @@ void lcl_parsePath(std::vector& rPath, std::string_view rV lcl_parsePathCoordinates(rPath, aToken); else if (o3tl::starts_with(aToken, "Name = \"GluePoints\"")) lcl_parsePathGluePoints(rPath, aToken); + else if (o3tl::starts_with(aToken, "Name = \"GluePointLeavingDirections\"")) + lcl_parsePathGluePointLeavingDirections(rPath, aToken); else if (o3tl::starts_with(aToken, "Name = \"Segments\"")) lcl_parsePathSegments(rPath, aToken); else if (o3tl::starts_with(aToken, "Name = \"TextFrames\"")) diff --git a/oox/source/drawingml/customshapes/oox-drawingml-cs-presets b/oox/source/drawingml/customshapes/oox-drawingml-cs-presets index 004bf6abfadd..4ef1ccf5d9dd 100644 --- a/oox/source/drawingml/customshapes/oox-drawingml-cs-presets +++ b/oox/source/drawingml/customshapes/oox-drawingml-cs-presets @@ -979,7 +979,7 @@ false MirroredY false Path -([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePointLeavingDirections", Handle = (long) 0, Value = (any) { ([]long) { { Dir = (long) 3 }, { Dir = (long) 1 }, { Dir = (long) 4 }, { Dir = (long) 2 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } Type "ooxml-non-primitive" ViewBox @@ -1081,7 +1081,7 @@ false MirroredY false Path -([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 4 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePointLeavingDirections", Handle = (long) 0, Value = (any) { ([]long) { { Dir = (long) 3 }, { Dir = (long) 3 }, { Dir = (long) 1 }, { Dir = (long) 4 }, { Dir = (long) 4 }, { Dir = (long) 4 }, { Dir = (long) 2 }, { Dir = (long) 3 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 4 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } Type "ooxml-non-primitive" ViewBox @@ -1744,7 +1744,7 @@ false MirroredY false Path -([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 6 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 18 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePointLeavingDirections", Handle = (long) 0, Value = (any) { ([]long) { { Dir = (long) 2 }, { Dir = (long) 2 }, { Dir = (long) 4 }, { Dir = (long) 4 }, { Dir = (long) 1 }, { Dir = (long) 1 }, { Dir = (long) 3 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 6 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } Type "ooxml-non-primitive" ViewBox @@ -1761,7 +1761,7 @@ false MirroredY false Path -([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 5 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePointLeavingDirections", Handle = (long) 0, Value = (any) { ([]long) { { Dir = (long) 2 }, { Dir = (long) 4 }, { Dir = (long) 4 }, { Dir = (long) 1 }, { Dir = (long) 3 }, { Dir = (long) 3 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 5 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 19 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 20 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } Type "ooxml-non-primitive" ViewBox @@ -2254,7 +2254,7 @@ false MirroredY false Path -([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 7 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePointLeavingDirections", Handle = (long) 0, Value = (any) { ([]long) { { Dir = (long) 2 }, { Dir = (long) 2 }, { Dir = (long) 4 }, { Dir = (long) 4 }, { Dir = (long) 1 }, { Dir = (long) 1 }, { Dir = (long) 3 }, { Dir = (long) 3 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 7 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } Type "ooxml-non-primitive" ViewBox @@ -2271,7 +2271,7 @@ false MirroredY false Path -([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 9 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 22 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 21 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePointLeavingDirections", Handle = (long) 0, Value = (any) { ([]long) { { Dir = (long) 3 }, { Dir = (long) 3 }, { Dir = (long) 2 }, { Dir = (long) 4 }, { Dir = (long) 4 }, { Dir = (long) 1 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } Type "ooxml-non-primitive" ViewBox @@ -2288,7 +2288,7 @@ false MirroredY false Path -([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 4 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePointLeavingDirections", Handle = (long) 0, Value = (any) { ([]long) { { Dir = (long) 3 }, { Dir = (long) 1 }, { Dir = (long) 4 }, { Dir = (long) 4 }, { Dir = (long) 4 }, { Dir = (long) 2 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 4 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 17 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 16 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } Type "ooxml-non-primitive" ViewBox @@ -2305,7 +2305,7 @@ false MirroredY false Path -([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 29 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 30 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePointLeavingDirections", Handle = (long) 0, Value = (any) { ([]long) { { Dir = (long) 2 }, { Dir = (long) 4 }, { Dir = (long) 1 }, { Dir = (long) 3 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 17, Count = (short) 1 }, { Command = (short) 2, Count = (short) 1 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 23 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 24 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 25 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 26 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } Type "ooxml-non-primitive" ViewBox @@ -2611,7 +2611,7 @@ false MirroredY false Path -([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, , { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, , { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePointLeavingDirections", Handle = (long) 0, Value = (any) { ([]long) { { Dir = (long) 3 }, { Dir = (long) 1 }, { Dir = (long) 4 }, { Dir = (long) 4 }, { Dir = (long) 4 }, { Dir = (long) 2 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } Type "ooxml-non-primitive" ViewBox @@ -2985,7 +2985,7 @@ false MirroredY false Path -([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 15 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 3 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 12 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 13 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePointLeavingDirections", Handle = (long) 0, Value = (any) { ([]long) { { Dir = (long) 3 }, { Dir = (long) 1 }, { Dir = (long) 4 }, { Dir = (long) 2 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 3 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 8 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 10 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 11 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 14 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } Type "ooxml-non-primitive" ViewBox @@ -3002,7 +3002,7 @@ false MirroredY false Path -([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } +([]com.sun.star.beans.PropertyValue) { { Name = "Coordinates", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePoints", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeParameterPair) { { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 0 }, Type = (short) 0 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 2 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 7 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } }, { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "GluePointLeavingDirections", Handle = (long) 0, Value = (any) { ([]long) { { Dir = (long) 3 }, { Dir = (long) 1 }, { Dir = (long) 4 }, { Dir = (long) 4 }, { Dir = (long) 4 }, { Dir = (long) 2 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "Segments", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeSegment) { { Command = (short) 1, Count = (short) 1 }, { Command = (short) 2, Count = (short) 2 }, { Command = (short) 4, Count = (short) 0 }, { Command = (short) 5, Count = (short) 0 } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE }, { Name = "TextFrames", Handle = (long) 0, Value = (any) { ([]com.sun.star.drawing.EnhancedCustomShapeTextFrame) { { TopLeft = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 1 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 5 }, Type = (short) 1 } }, BottomRight = (com.sun.star.drawing.EnhancedCustomShapeParameterPair) { First = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 4 }, Type = (short) 1 }, Second = (com.sun.star.drawing.EnhancedCustomShapeParameter) { Value = (any) { (long) 6 }, Type = (short) 1 } } } } }, State = (com.sun.star.beans.PropertyState) DIRECT_VALUE } } Type "ooxml-non-primitive" ViewBox diff --git a/sd/qa/unit/data/pptx/glue_point_leaving_directions.pptx b/sd/qa/unit/data/pptx/glue_point_leaving_directions.pptx new file mode 100644 index 0000000000000000000000000000000000000000..9972238159f1d67b40b449ab17704b31cc22812b GIT binary patch literal 33129 zcmeEtV{|2Lx9yJYbZpzUZKGq`cE`4D+h)hM(;eGRC%Jjw@7!~7-Z8%W|J?m!SJkek z#vWB;t-0o0YnFmE2q-E58~_Ob00;p)lNb-xKmdRkEC7H4fCSbSwzG9Mv31r{@vt{> z(xG#=u_h=01*XUY0DrCj|DXTHPhc`tTYi86b!12O54^M<9CaQM7C3@#PFGwQex5Bv znXAnLT9Dn<8rYAZOyGKY>FMd0&zV}QR@drjl5hPOQ3q0DMQCc0046o4)WEQ=2RtfS zWQ`HyfuID$cuI|Vi`<+hPh~hZf#xP8Os-Npisli0vz^=j_p#(4YwcThWY5_~Lhk~UiCMqQ-e7N&9J$5PQi2B|DER{chY z4DusPnnaaJDuh&bSls*TIR^b1@S3JRfl5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jw$t9sKhrAXz$J-b#w+l=K z$hoY(=6cgIy5z=2U8CcfVUpIcMY(O}t}}Ig9PfDh)#$)p%eq)?>aCo{VeCGNnAna$ zDv`C5+B#@J?VD>Se=7ZfAXb>K=CAX>{_H6~|Ncc*SfyLP0)9;~`Lp2J-(}d-$`1|I zxz`K6Abg&^i=tOy9;Kg;r`Cs6u zi7(-Px^d5Omt=47IQZz+7dRvGzsH^H$KY}B!D%mWJ5+yo5`DZ-S4e>TNm*zQ~!1doG{Z*zf5=lXlxxyA+_2Ok>a0#^Y`1@(7VcP>_e z$H8yYzrZ;Q{5|em^#PBA-v)YtGZOoI+_`)L9tXcS=>kV4^Y^$PJC)#h@Oua@cy03k z3-5gB!t>xoyBEA%*t^}Ijq!8TUYZFmjorVTFX5G%7i5s~CGyWsc!_*z82^W46qVm0 zUnoN1t?}=#8B6td$QLTh-zVeW{T=d!a`E@cSJi%pe4z&XeKMu`?~pGPcE3-i)A$|o zg=+2h$t;?`L%vXg{XUsX>vzZ(>Z-pZpJ|jXj+@%QL;f*S{I5ghSG1_kZ=wJF{T^OR zb8*!&x + @@ -211,6 +212,7 @@ + diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index fd11a02fc24a..7a740a2ae3ad 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -546,6 +546,34 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testTdf89449) CPPUNIT_ASSERT_EQUAL(sal_Int32(2), nEndGlueId); } +CPPUNIT_TEST_FIXTURE(SdImportTest, testGluePointLeavingDirections) +{ + createSdImpressDoc("pptx/glue_point_leaving_directions.pptx"); + uno::Reference xEllipseShape(getShapeFromPage(0, 0)); + uno::Sequence aProps; + xEllipseShape->getPropertyValue(u"CustomShapeGeometry"_ustr) >>= aProps; + + uno::Sequence aPathProps; + for (beans::PropertyValue const& rProp : aProps) + { + if (rProp.Name == "Path") + aPathProps = rProp.Value.get>(); + } + + uno::Sequence seqGluePointLeavingDirections; + for (beans::PropertyValue const& rProp : aPathProps) + { + if (rProp.Name == "GluePointLeavingDirections") + { + rProp.Value >>= seqGluePointLeavingDirections; + } + } + + sal_Int32 nCountGluePointLeavingDirections = seqGluePointLeavingDirections.getLength(); + // The ellipse has 8 glue point leaving directions + CPPUNIT_ASSERT_EQUAL(sal_Int32(8), nCountGluePointLeavingDirections); +} + CPPUNIT_TEST_FIXTURE(SdImportTest, testTdf147459) { createSdImpressDoc("pptx/tdf147459.pptx"); diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index 4c68aa45ded2..5c8ba5fb64ad 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -565,6 +565,7 @@ void EnhancedCustomShape2d::ApplyShapeAttributes( const SdrCustomShapeGeometryIt static constexpr OUString sPath( u"Path"_ustr ); static constexpr OUStringLiteral sCoordinates( u"Coordinates" ); static constexpr OUStringLiteral sGluePoints( u"GluePoints" ); + static constexpr OUStringLiteral sGluePointLeavingDirections( u"GluePointLeavingDirections" ); static constexpr OUStringLiteral sSegments( u"Segments" ); static constexpr OUStringLiteral sSubViewSize( u"SubViewSize" ); static constexpr OUStringLiteral sStretchX( u"StretchX" ); @@ -585,6 +586,10 @@ void EnhancedCustomShape2d::ApplyShapeAttributes( const SdrCustomShapeGeometryIt if ( pAny ) *pAny >>= m_seqGluePoints; + // Path/GluePointLeavingDirections + pAny = const_cast(rGeometryItem).GetPropertyValueByName(sPath, sGluePointLeavingDirections); + if (pAny) + *pAny >>= m_seqGluePointLeavingDirections; // Path/Segments pAny = const_cast(rGeometryItem).GetPropertyValueByName( sPath, sSegments ); @@ -3064,19 +3069,38 @@ rtl::Reference EnhancedCustomShape2d::CreateObject( bool bLineGeometr return pRet; } -void EnhancedCustomShape2d::ApplyGluePoints( SdrObject* pObj ) +static SdrEscapeDirection lcl_GetEscapeDirection(sal_Int32 nDirection) +{ + switch (nDirection) + { + case 1: return SdrEscapeDirection::LEFT; + case 2: return SdrEscapeDirection::RIGHT; + case 3: return SdrEscapeDirection::TOP; + case 4: return SdrEscapeDirection::BOTTOM; + default: return SdrEscapeDirection::SMART; + } +} + +void EnhancedCustomShape2d::ApplyGluePoints(SdrObject* pObj) { if ( !pObj ) return; - for (const auto& rGluePoint : m_seqGluePoints) + SdrEscapeDirection aDirection = SdrEscapeDirection::SMART; + for (size_t i = 0; i < m_seqGluePoints.size(); i++) { - SdrGluePoint aGluePoint; + EnhancedCustomShapeParameterPair aGluePointPair = m_seqGluePoints[i]; + if (m_seqGluePointLeavingDirections.hasElements()) + { + sal_Int32 aGluePointLeavingDirection = m_seqGluePointLeavingDirections[i]; + aDirection = lcl_GetEscapeDirection(aGluePointLeavingDirection); + } - aGluePoint.SetPos( GetPoint( rGluePoint, !m_bOOXMLShape, true ) ); + SdrGluePoint aGluePoint; + aGluePoint.SetPos( GetPoint( aGluePointPair, !m_bOOXMLShape, true ) ); aGluePoint.SetPercent( false ); aGluePoint.SetAlign( SdrAlign::VERT_TOP | SdrAlign::HORZ_LEFT ); - aGluePoint.SetEscDir( SdrEscapeDirection::SMART ); + aGluePoint.SetEscDir( aDirection ); SdrGluePointList* pList = pObj->ForceGluePointList(); if( pList ) /* sal_uInt16 nId = */ pList->Insert( aGluePoint ); From 355e553505a250f137b8bfc714b13084b83f0465 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Fri, 5 Jul 2024 11:01:05 +0200 Subject: [PATCH 149/232] libxslt: upgrade to 1.1.42 Downloaded from https://download.gnome.org/sources/libxslt/1.1/libxslt-1.1.42.tar.xz Change-Id: I77de8a0922c5271161640eae5c92b425c5be82c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170011 Reviewed-by: Xisco Fauli Tested-by: Jenkins --- download.lst | 4 ++-- external/libxslt/ExternalPackage_libxslt.mk | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/download.lst b/download.lst index 9eb88235ade9..3c48f37ac218 100644 --- a/download.lst +++ b/download.lst @@ -430,8 +430,8 @@ LIBXML_TARBALL := libxml2-2.12.$(LIBXML_VERSION_MICRO).tar.xz # three static lines # so that git cherry-pick # will not run into conflicts -LIBXSLT_SHA256SUM := 3ad392af91115b7740f7b50d228cc1c5fc13afc1da7f16cb0213917a37f71bda -LIBXSLT_VERSION_MICRO := 41 +LIBXSLT_SHA256SUM := 85ca62cac0d41fc77d3f6033da9df6fd73d20ea2fc18b0a3609ffb4110e1baeb +LIBXSLT_VERSION_MICRO := 42 LIBXSLT_TARBALL := libxslt-1.1.$(LIBXSLT_VERSION_MICRO).tar.xz # three static lines # so that git cherry-pick diff --git a/external/libxslt/ExternalPackage_libxslt.mk b/external/libxslt/ExternalPackage_libxslt.mk index 42b2004728e5..b11ee72bfe1a 100644 --- a/external/libxslt/ExternalPackage_libxslt.mk +++ b/external/libxslt/ExternalPackage_libxslt.mk @@ -25,7 +25,7 @@ $(eval $(call gb_ExternalPackage_add_file,libxslt,$(LIBO_LIB_FOLDER)/libexslt.dl endif else # OS!=WNT $(eval $(call gb_ExternalPackage_add_file,libxslt,$(LIBO_LIB_FOLDER)/libxslt.so.1,libxslt/.libs/libxslt.so.1.1.$(LIBXSLT_VERSION_MICRO))) -$(eval $(call gb_ExternalPackage_add_file,libxslt,$(LIBO_LIB_FOLDER)/libexslt.so.0,libexslt/.libs/libexslt.so.0.8.22)) +$(eval $(call gb_ExternalPackage_add_file,libxslt,$(LIBO_LIB_FOLDER)/libexslt.so.0,libexslt/.libs/libexslt.so.0.8.23)) endif endif # DISABLE_DYNLOADING From 4c3f2194bb28fed66b79efe99bad01f70bd83c16 Mon Sep 17 00:00:00 2001 From: Pranam Lashkari Date: Mon, 17 Jun 2024 00:34:40 +0300 Subject: [PATCH 150/232] LOK: fixed incorrect Logic point calculation for Map mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit problem: it was very difficult to select line in online, specifically in writer if line is very think and it was almost impossible to select line Change-Id: Ib641cd3d9795b93d47c78bc8f57211f51714844d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168837 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara Tested-by: Jenkins CollaboraOffice (cherry picked from commit a0612242a395e1be1fe8383537bc5a82d6b882ac) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169011 Tested-by: Jenkins Reviewed-by: Pranam Lashkari --- svx/source/svdraw/svdpntv.cxx | 12 ++++++++++-- sw/source/core/frmedt/feshview.cxx | 7 ++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx index ea8af4045878..5874acb1c63d 100644 --- a/svx/source/svdraw/svdpntv.cxx +++ b/svx/source/svdraw/svdpntv.cxx @@ -334,8 +334,16 @@ sal_uInt16 SdrPaintView::ImpGetHitTolLogic(short nHitTol, const OutputDevice* pO void SdrPaintView::TheresNewMapMode() { if (mpActualOutDev) { - mnHitTolLog=static_cast(mpActualOutDev->PixelToLogic(Size(mnHitTolPix,0)).Width()); - mnMinMovLog=static_cast(mpActualOutDev->PixelToLogic(Size(mnMinMovPix,0)).Width()); + if (comphelper::LibreOfficeKit::isActive()) + { + mnHitTolLog=static_cast(OutputDevice::LogicToLogic(Size(mnHitTolPix,0), MapMode(MapUnit::MapPixel), mpActualOutDev->GetMapMode()).Width()); + mnMinMovLog=static_cast(OutputDevice::LogicToLogic(Size(mnMinMovPix,0), MapMode(MapUnit::MapPixel), mpActualOutDev->GetMapMode()).Width()); + } + else + { + mnHitTolLog=static_cast(mpActualOutDev->PixelToLogic(Size(mnHitTolPix,0)).Width()); + mnMinMovLog=static_cast(mpActualOutDev->PixelToLogic(Size(mnMinMovPix,0)).Width()); + } } } diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index e05d4fb10fe4..119bfdf8c614 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -277,7 +277,12 @@ bool SwFEShell::SelectObj( const Point& rPt, sal_uInt8 nFlag, SdrObject *pObj ) { // tolerance limit of Drawing-SS const auto nHdlSizePixel = Imp()->GetDrawView()->GetMarkHdlSizePixel(); - const short nMinMove = static_cast(GetOut()->PixelToLogic(Size(nHdlSizePixel/2, 0)).Width()); + short nMinMove; + if (comphelper::LibreOfficeKit::isActive()) + nMinMove = static_cast(OutputDevice::LogicToLogic(Size(nHdlSizePixel/2,0), MapMode(MapUnit::MapPixel), GetOut()->GetMapMode()).Width()); + else + nMinMove = static_cast(GetOut()->PixelToLogic(Size(nHdlSizePixel/2, 0)).Width()); + pDView->MarkObj( rPt, nMinMove, bAddSelect, bEnterGroup ); } From 7216a5a4ff2210e04732a37b16dbebeb5cce0e31 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Fri, 5 Jul 2024 13:30:22 +0200 Subject: [PATCH 151/232] CppunitTest_dbaccess_embeddeddb_performancetest: fix dependencies Otherwise it fails with EmbeddedDBPerformanceTest::testPerformance finished in: 426ms macros_test.cxx:74:Assertion Test name: EmbeddedDBPerformanceTest::testPerformance assertion failed - Expression: xComponent.is() After this patch, the tests still fail, but for another reason. Change-Id: I4fc11a9feef79efd71be8d6bab76f8777c92d115 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170012 Reviewed-by: Xisco Fauli Tested-by: Jenkins --- ...est_dbaccess_embeddeddb_performancetest.mk | 27 +------------------ 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/dbaccess/CppunitTest_dbaccess_embeddeddb_performancetest.mk b/dbaccess/CppunitTest_dbaccess_embeddeddb_performancetest.mk index 6a92256937b3..80af11b4e826 100644 --- a/dbaccess/CppunitTest_dbaccess_embeddeddb_performancetest.mk +++ b/dbaccess/CppunitTest_dbaccess_embeddeddb_performancetest.mk @@ -41,32 +41,7 @@ $(eval $(call gb_CppunitTest_use_api,dbaccess_embeddeddb_performancetest,\ $(eval $(call gb_CppunitTest_use_ure,dbaccess_embeddeddb_performancetest)) $(eval $(call gb_CppunitTest_use_vcl,dbaccess_embeddeddb_performancetest)) -$(eval $(call gb_CppunitTest_use_components,dbaccess_embeddeddb_performancetest,\ - basic/util/sb \ - comphelper/util/comphelp \ - configmgr/source/configmgr \ - connectivity/source/cpool/dbpool2 \ - connectivity/source/drivers/firebird/firebird_sdbc \ - connectivity/source/manager/sdbc2 \ - dbaccess/util/dba \ - dbaccess/source/filter/xml/dbaxml \ - dbaccess/util/dbu \ - filter/source/config/cache/filterconfig1 \ - framework/util/fwk \ - i18npool/util/i18npool \ - linguistic/source/lng \ - package/source/xstor/xstor \ - package/util/package2 \ - sax/source/expatwrap/expwrap \ - sfx2/util/sfx \ - svl/source/fsstor/fsstorage \ - svl/util/svl \ - toolkit/util/tk \ - ucb/source/core/ucb1 \ - ucb/source/ucp/file/ucpfile1 \ - unotools/util/utl \ - xmloff/util/xo \ -)) +$(eval $(call gb_CppunitTest_use_rdb,dbaccess_embeddeddb_performancetest,services)) $(eval $(call gb_CppunitTest_use_configuration,dbaccess_embeddeddb_performancetest)) From 958cabd2e933ec85caf6eca4f0aacee77195fe7a Mon Sep 17 00:00:00 2001 From: Andras Timar Date: Sat, 29 Jun 2024 23:18:25 +0200 Subject: [PATCH 152/232] Bundle fonts of Google's DocRepair Project MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://fonts.google.com/?query=The+DocRepair+Project DocRepair project intended to improve compliance with the ISO/IEC 29500 standard by providing fallback for proprietary fonts that minimizes text reflow in Office Open XML documents. Agency FB -> Agdasima Baskerville Old Face -> Bacasime Antique Berlin Sans FB -> Belanosima Cooper Black -> Caprasimo Lucida Calligraphy -> Lugrasimo Lucida Grande -> Lunasima Lucida Handwriting -> Lumanosimo Change-Id: I82a29bd9eeda88198290134a7906a35b6349a1b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169765 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169828 Tested-by: Jenkins Reviewed-by: Andras Timar --- Makefile.fetch | 7 ++ Repository.mk | 7 ++ download.lst | 35 ++++++ .../more_fonts/ExternalPackage_agdasima.mk | 17 +++ .../ExternalPackage_bacasime_antique.mk | 16 +++ .../more_fonts/ExternalPackage_belanosima.mk | 18 +++ .../more_fonts/ExternalPackage_caprasimo.mk | 16 +++ .../more_fonts/ExternalPackage_lugrasimo.mk | 16 +++ .../more_fonts/ExternalPackage_lumanosimo.mk | 16 +++ .../more_fonts/ExternalPackage_lunasima.mk | 17 +++ external/more_fonts/Module_more_fonts.mk | 14 +++ .../more_fonts/UnpackedTarball_agdasima.mk | 14 +++ .../UnpackedTarball_bacasime_antique.mk | 14 +++ .../more_fonts/UnpackedTarball_belanosima.mk | 14 +++ .../more_fonts/UnpackedTarball_caprasimo.mk | 14 +++ .../more_fonts/UnpackedTarball_lugrasimo.mk | 14 +++ .../more_fonts/UnpackedTarball_lumanosimo.mk | 14 +++ .../more_fonts/UnpackedTarball_lunasima.mk | 14 +++ external/more_fonts/fc_local.snippet | 49 ++++++++ .../registry/data/org/openoffice/VCL.xcu | 115 +++++++++++++++++- readlicense_oo/license/license.xml | 51 ++++++++ solenv/flatpak-manifest.in | 49 ++++++++ 22 files changed, 538 insertions(+), 3 deletions(-) create mode 100644 external/more_fonts/ExternalPackage_agdasima.mk create mode 100644 external/more_fonts/ExternalPackage_bacasime_antique.mk create mode 100644 external/more_fonts/ExternalPackage_belanosima.mk create mode 100644 external/more_fonts/ExternalPackage_caprasimo.mk create mode 100644 external/more_fonts/ExternalPackage_lugrasimo.mk create mode 100644 external/more_fonts/ExternalPackage_lumanosimo.mk create mode 100644 external/more_fonts/ExternalPackage_lunasima.mk create mode 100644 external/more_fonts/UnpackedTarball_agdasima.mk create mode 100644 external/more_fonts/UnpackedTarball_bacasime_antique.mk create mode 100644 external/more_fonts/UnpackedTarball_belanosima.mk create mode 100644 external/more_fonts/UnpackedTarball_caprasimo.mk create mode 100644 external/more_fonts/UnpackedTarball_lugrasimo.mk create mode 100644 external/more_fonts/UnpackedTarball_lumanosimo.mk create mode 100644 external/more_fonts/UnpackedTarball_lunasima.mk diff --git a/Makefile.fetch b/Makefile.fetch index ed019e800954..d6b60c9b7b3e 100644 --- a/Makefile.fetch +++ b/Makefile.fetch @@ -202,6 +202,13 @@ $(WORKDIR)/download: $(BUILDDIR)/config_$(gb_Side).mk $(SRCDIR)/download.lst $(S $(call fetch_Optional,MORE_FONTS,FONT_AMIRI_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_REEM_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_SCHEHERAZADE_TARBALL) \ + $(call fetch_Optional,MORE_FONTS,FONT_AGDASIMA_TARBALL) \ + $(call fetch_Optional,MORE_FONTS,FONT_BACASIME_ANTIQUE_TARBALL) \ + $(call fetch_Optional,MORE_FONTS,FONT_BELANOSIMA_TARBALL) \ + $(call fetch_Optional,MORE_FONTS,FONT_CAPRASIMO_TARBALL) \ + $(call fetch_Optional,MORE_FONTS,FONT_LUGRASIMO_TARBALL) \ + $(call fetch_Optional,MORE_FONTS,FONT_LUMANOSIMO_TARBALL) \ + $(call fetch_Optional,MORE_FONTS,FONT_LUNASIMA_TARBALL) \ $(call fetch_Optional,MSPUB,MSPUB_TARBALL) \ $(call fetch_Optional,MWAW,MWAW_TARBALL) \ $(call fetch_Optional,MYTHES,MYTHES_TARBALL) \ diff --git a/Repository.mk b/Repository.mk index c4e8b8d3299e..70af3dac3916 100644 --- a/Repository.mk +++ b/Repository.mk @@ -1080,6 +1080,13 @@ $(eval $(call gb_Helper_register_packages_for_install,ooo_fonts,\ fonts_noto_serif_lao \ fonts_reem \ fonts_scheherazade \ + fonts_agdasima \ + fonts_bacasime_antique \ + fonts_belanosima \ + fonts_caprasimo \ + fonts_lugrasimo \ + fonts_lumanosimo \ + fonts_lunasima \ ) \ )) diff --git a/download.lst b/download.lst index 3c48f37ac218..a8042f8f3d78 100644 --- a/download.lst +++ b/download.lst @@ -262,6 +262,41 @@ FONT_SCHEHERAZADE_TARBALL := Scheherazade-2.100.zip # three static lines # so that git cherry-pick # will not run into conflicts +FONT_AGDASIMA_TARBALL := Agdasima-2.002.zip +FONT_AGDASIMA_SHA256SUM := b4c17499f8bc183320ffdcf1f8491c778dd68a237adc056dc08e1fcb2da488f3 +# three static lines +# so that git cherry-pick +# will not run into conflicts +FONT_BACASIME_ANTIQUE_TARBALL := Bacasime_Antique-2.000.zip +FONT_BACASIME_ANTIQUE_SHA256SUM := 81127cebc97d4ee0b950c2bc2d6be0ed29abfe0d5988435eb9a39e382557250a +# three static lines +# so that git cherry-pick +# will not run into conflicts +FONT_BELANOSIMA_TARBALL := Belanosima-2.000.zip +FONT_BELANOSIMA_SHA256SUM := 9c30e9e7cdb0797b651113a77f6b789659b8d8598a466b2ba92754e9dec30449 +# three static lines +# so that git cherry-pick +# will not run into conflicts +FONT_CAPRASIMO_TARBALL := Caprasimo-1.001.zip +FONT_CAPRASIMO_SHA256SUM := f066d27cfc99b6601083be102d08b4039da8d2834e2795aabd890f16c6fd1b9b +# three static lines +# so that git cherry-pick +# will not run into conflicts +FONT_LUGRASIMO_TARBALL := Lugrasimo-1.001.zip +FONT_LUGRASIMO_SHA256SUM := db24dff31e8ddf6a113556c947a219f9534b072852e9ce2079a08c94854a7503 +# three static lines +# so that git cherry-pick +# will not run into conflicts +FONT_LUMANOSIMO_TARBALL := Lumanosimo-1.010.zip +FONT_LUMANOSIMO_SHA256SUM := d4545ad6afded9a55d9a7728cfc7453cf5637861db87aafe0a730676a0cb960f +# three static lines +# so that git cherry-pick +# will not run into conflicts +FONT_LUNASIMA_TARBALL := Lunasima-2.009.zip +FONT_LUNASIMA_SHA256SUM := 4302809cf4b95b481bec53de87484d919b391c90a518d065f6c775fd435a5393 +# three static lines +# so that git cherry-pick +# will not run into conflicts FREEHAND_SHA256SUM := 0e422d1564a6dbf22a9af598535425271e583514c0f7ba7d9091676420de34ac FREEHAND_TARBALL := libfreehand-0.1.2.tar.xz # three static lines diff --git a/external/more_fonts/ExternalPackage_agdasima.mk b/external/more_fonts/ExternalPackage_agdasima.mk new file mode 100644 index 000000000000..25867d9ec3e5 --- /dev/null +++ b/external/more_fonts/ExternalPackage_agdasima.mk @@ -0,0 +1,17 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_agdasima,font_agdasima)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_agdasima,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + Agdasima-Regular.ttf \ + Agdasima-Bold.ttf \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/ExternalPackage_bacasime_antique.mk b/external/more_fonts/ExternalPackage_bacasime_antique.mk new file mode 100644 index 000000000000..892260df7a98 --- /dev/null +++ b/external/more_fonts/ExternalPackage_bacasime_antique.mk @@ -0,0 +1,16 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_bacasime_antique,font_bacasime_antique)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_bacasime_antique,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + BacasimeAntique-Regular.ttf \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/ExternalPackage_belanosima.mk b/external/more_fonts/ExternalPackage_belanosima.mk new file mode 100644 index 000000000000..71c7a080b394 --- /dev/null +++ b/external/more_fonts/ExternalPackage_belanosima.mk @@ -0,0 +1,18 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_belanosima,font_belanosima)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_belanosima,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + Belanosima-Regular.ttf \ + Belanosima-SemiBold.ttf \ + Belanosima-Bold.ttf \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/ExternalPackage_caprasimo.mk b/external/more_fonts/ExternalPackage_caprasimo.mk new file mode 100644 index 000000000000..9e347449cb34 --- /dev/null +++ b/external/more_fonts/ExternalPackage_caprasimo.mk @@ -0,0 +1,16 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_caprasimo,font_caprasimo)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_caprasimo,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + Caprasimo-Regular.ttf \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/ExternalPackage_lugrasimo.mk b/external/more_fonts/ExternalPackage_lugrasimo.mk new file mode 100644 index 000000000000..69084ca701ea --- /dev/null +++ b/external/more_fonts/ExternalPackage_lugrasimo.mk @@ -0,0 +1,16 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_lugrasimo,font_lugrasimo)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_lugrasimo,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + Lugrasimo-Regular.ttf \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/ExternalPackage_lumanosimo.mk b/external/more_fonts/ExternalPackage_lumanosimo.mk new file mode 100644 index 000000000000..b60ecc8a471c --- /dev/null +++ b/external/more_fonts/ExternalPackage_lumanosimo.mk @@ -0,0 +1,16 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_lumanosimo,font_lumanosimo)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_lumanosimo,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + Lumanosimo-Regular.ttf \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/ExternalPackage_lunasima.mk b/external/more_fonts/ExternalPackage_lunasima.mk new file mode 100644 index 000000000000..475568f8406b --- /dev/null +++ b/external/more_fonts/ExternalPackage_lunasima.mk @@ -0,0 +1,17 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_lunasima,font_lunasima)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_lunasima,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + Lunasima-Regular.ttf \ + Lunasima-Bold.ttf \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/Module_more_fonts.mk b/external/more_fonts/Module_more_fonts.mk index e17af9a15141..199fc6cf9622 100644 --- a/external/more_fonts/Module_more_fonts.mk +++ b/external/more_fonts/Module_more_fonts.mk @@ -37,6 +37,13 @@ $(eval $(call gb_Module_add_targets,more_fonts,\ ExternalPackage_noto_serif_lao \ ExternalPackage_reem \ ExternalPackage_scheherazade \ + ExternalPackage_agdasima \ + ExternalPackage_bacasime_antique \ + ExternalPackage_belanosima \ + ExternalPackage_caprasimo \ + ExternalPackage_lugrasimo \ + ExternalPackage_lumanosimo \ + ExternalPackage_lunasima \ UnpackedTarball_alef \ UnpackedTarball_amiri \ UnpackedTarball_caladea \ @@ -64,6 +71,13 @@ $(eval $(call gb_Module_add_targets,more_fonts,\ UnpackedTarball_noto_serif_lao \ UnpackedTarball_reem \ UnpackedTarball_scheherazade \ + UnpackedTarball_agdasima \ + UnpackedTarball_bacasime_antique \ + UnpackedTarball_belanosima \ + UnpackedTarball_caprasimo \ + UnpackedTarball_lugrasimo \ + UnpackedTarball_lumanosimo \ + UnpackedTarball_lunasima \ )) # vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/UnpackedTarball_agdasima.mk b/external/more_fonts/UnpackedTarball_agdasima.mk new file mode 100644 index 000000000000..5c003c18cbfd --- /dev/null +++ b/external/more_fonts/UnpackedTarball_agdasima.mk @@ -0,0 +1,14 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_agdasima)) + +$(eval $(call gb_UnpackedTarball_set_tarball,font_agdasima,$(FONT_AGDASIMA_TARBALL),0)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/UnpackedTarball_bacasime_antique.mk b/external/more_fonts/UnpackedTarball_bacasime_antique.mk new file mode 100644 index 000000000000..7533fb16e9a9 --- /dev/null +++ b/external/more_fonts/UnpackedTarball_bacasime_antique.mk @@ -0,0 +1,14 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_bacasime_antique)) + +$(eval $(call gb_UnpackedTarball_set_tarball,font_bacasime_antique,$(FONT_BACASIME_ANTIQUE_TARBALL),0)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/UnpackedTarball_belanosima.mk b/external/more_fonts/UnpackedTarball_belanosima.mk new file mode 100644 index 000000000000..e752c46f31c0 --- /dev/null +++ b/external/more_fonts/UnpackedTarball_belanosima.mk @@ -0,0 +1,14 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_belanosima)) + +$(eval $(call gb_UnpackedTarball_set_tarball,font_belanosima,$(FONT_BELANOSIMA_TARBALL),0)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/UnpackedTarball_caprasimo.mk b/external/more_fonts/UnpackedTarball_caprasimo.mk new file mode 100644 index 000000000000..41d6d796ced9 --- /dev/null +++ b/external/more_fonts/UnpackedTarball_caprasimo.mk @@ -0,0 +1,14 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_caprasimo)) + +$(eval $(call gb_UnpackedTarball_set_tarball,font_caprasimo,$(FONT_CAPRASIMO_TARBALL),0)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/UnpackedTarball_lugrasimo.mk b/external/more_fonts/UnpackedTarball_lugrasimo.mk new file mode 100644 index 000000000000..f3632a0f6ec7 --- /dev/null +++ b/external/more_fonts/UnpackedTarball_lugrasimo.mk @@ -0,0 +1,14 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_lugrasimo)) + +$(eval $(call gb_UnpackedTarball_set_tarball,font_lugrasimo,$(FONT_LUGRASIMO_TARBALL),0)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/UnpackedTarball_lumanosimo.mk b/external/more_fonts/UnpackedTarball_lumanosimo.mk new file mode 100644 index 000000000000..350d7ed6cda7 --- /dev/null +++ b/external/more_fonts/UnpackedTarball_lumanosimo.mk @@ -0,0 +1,14 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_lumanosimo)) + +$(eval $(call gb_UnpackedTarball_set_tarball,font_lumanosimo,$(FONT_LUMANOSIMO_TARBALL),0)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/UnpackedTarball_lunasima.mk b/external/more_fonts/UnpackedTarball_lunasima.mk new file mode 100644 index 000000000000..0b75460a740e --- /dev/null +++ b/external/more_fonts/UnpackedTarball_lunasima.mk @@ -0,0 +1,14 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_UnpackedTarball_UnpackedTarball,font_lunasima)) + +$(eval $(call gb_UnpackedTarball_set_tarball,font_lunasima,$(FONT_LUNASIMA_TARBALL),0)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/fc_local.snippet b/external/more_fonts/fc_local.snippet index cb49929b0a4a..fdc0a627a042 100644 --- a/external/more_fonts/fc_local.snippet +++ b/external/more_fonts/fc_local.snippet @@ -27,3 +27,52 @@ Caladea + + + Agency FB + + Agdasima + + + + + Baskerville Old Face + + Bacasime Antique + + + + + Berlin Sans FB + + Belanosima + + + + + Cooper Black + + Caprasimo + + + + + Lucida Grande + + Lunasima + + + + + Lucida Handwriting + + Lumanosimo + + + + + Lucida Calligraphy + + Lugrasimo + + diff --git a/officecfg/registry/data/org/openoffice/VCL.xcu b/officecfg/registry/data/org/openoffice/VCL.xcu index 2d472da4d2e5..6387f81c3e94 100644 --- a/officecfg/registry/data/org/openoffice/VCL.xcu +++ b/officecfg/registry/data/org/openoffice/VCL.xcu @@ -892,6 +892,25 @@ + + + Agency FB + + + Agency FB + + + Normal,SansSerif + + + + + Agdasima + + + Normal,SansSerif + + albanyamt;albany;liberationsans;arial;nimbussansl;helvetica;lucidasans;lucida;geneva;helmet;sansserif;nimbussans;andalesansui;arialunicodems;lucidaunicode @@ -1141,9 +1160,20 @@ Normal,SansSerif + + + Baskerville Old Face + + + Baskerville Old Face + + + Normal,Serif + + - thorndaleamt;thorndale;timesnewroman;nimbusromanno9l;times;timesroman;newyork;timmons;serif;lucidaserif;lucidabright;roman;nimbusromanno9;bookman;itcbookman;garamond;garamondmt;palatino + Bacasime Antique;thorndaleamt;thorndale;timesnewroman;nimbusromanno9l;times;timesroman;newyork;timmons;serif;lucidaserif;lucidabright;roman;nimbusromanno9;bookman;itcbookman;garamond;garamondmt;palatino @@ -1192,6 +1222,17 @@ CJK,CJK_KR + + + Berlin Sans FB + + + Berlin Sans FB + + + Normal,SansSerif + + thorndaleamt;thorndale;timesnewroman;nimbusromanno9l;times;timesroman;newyork;timmons;serif;lucidaserif;lucidabright;roman;nimbusromanno9;bookman;itcbookman;garamond;garamondmt;palatino @@ -1209,6 +1250,14 @@ Normal,Serif + + + Belanosima + + + Normal,SansSerif + + dejavusans @@ -1413,6 +1462,17 @@ Normal,SansSerif + + + Cooper Black + + + Cooper Black + + + Normal,Serif + + Normal,SansSerif,Fixed @@ -1423,6 +1483,14 @@ Normal,Serif + + + Caprasimo + + + Normal,Serif + + Normal,SansSerif @@ -3094,7 +3162,7 @@ - zapfchancery;itczapfchancery;monotypecorsiva;corsiva;chancery;chanceryl;lucidacalligraphy;lucidahandwriting;palacescript;palacescriptmt;arioso;shelley;andymt;comicsansms;andy;kidprint; + Lugrasimo;zapfchancery;itczapfchancery;monotypecorsiva;corsiva;chancery;chanceryl;lucidacalligraphy;lucidahandwriting;palacescript;palacescriptmt;arioso;shelley;andymt;comicsansms;andy;kidprint; @@ -3145,7 +3213,7 @@ - andymt;comicsansms;andy;kidprint;zapfchancery;itczapfchancery;monotypecorsiva;corsiva;chancery;chanceryl;lucidacalligraphy;lucidahandwriting;palacescript;palacescriptmt;arioso;shelley + Lumanosimo;andymt;comicsansms;andy;kidprint;zapfchancery;itczapfchancery;monotypecorsiva;corsiva;chancery;chanceryl;lucidacalligraphy;lucidahandwriting;palacescript;palacescriptmt;arioso;shelley @@ -3160,6 +3228,14 @@ Italic,Script,Handwriting + + + Lunasima + + + Normal,SansSerif + + albanyamt;albany;arial;nimbussansl;helvetica;lucidasans;lucida;geneva;helmet;sansserif;nimbussans;andalesansui;arialunicodems;lucidaunicode @@ -3262,6 +3338,39 @@ Normal,Fixed,Typewriter + + + Lucida Calligraphy + + + Lucida Calligraphy + + + Italic,Script,Chancery + + + + + Lucida Grande + + + Lucida Grande + + + Normal,SansSerif + + + + + Lucida Handwriting + + + Lucida Handwriting + + + Italic,Script,Handwriting + + starsymbol;opensymbol;starbats;wingdings;zapfdingbats;itczapfdingbats;monotypesorts;dingbats;lucidadingbats;lucidasansdingbats;webdings;symbol;standardsymbols;standardsymbolsl;andalesansui;arialunicodems;lucidaunicode diff --git a/readlicense_oo/license/license.xml b/readlicense_oo/license/license.xml index d74285e18a57..2fbbd9397981 100644 --- a/readlicense_oo/license/license.xml +++ b/readlicense_oo/license/license.xml @@ -2306,6 +2306,13 @@

Fonts

+

Agdasima

+

The following software may be included in this product: Agdasima fonts. Use of any of this software is governed + by the terms of the license below:

+

Copyright 2023 The Agdasima Project Authors (https://github.com/docrepair-fonts/agdasima-fonts).

+

This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is copied below, + and is also available with a FAQ at: http://scripts.sil.org/OFL

+

Jump to SIL Open Font License, Version 1.1

Alef

Copyright (c) 2012, HaGilda & Mushon Zer-Aviv (<http://hagilda.com|info@hagilda.com>), with Reserved Font Name Alef Regular.

@@ -2317,10 +2324,33 @@

Copyright (c) 2010-2017, Khaled Hosny (<khaledhosny@eglug.org>)

This Font Software is licensed under the SIL Open Font License, Version 1.1 as shown below.

Jump to SIL Open Font License, Version 1.1

+

Bacasime Antique

+

The following software may be included in this product: Bacasime Antique fonts. Use of any of this software is governed + by the terms of the license below:

+

Copyright 2023 The Bacasime Antique Project Authors (https://github.com/docrepair-fonts/bacasime-antique-fonts), + with Reserved Font Name "Playfair".

+

This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is copied below, + and is also available with a FAQ at: http://scripts.sil.org/OFL

+

Jump to SIL Open Font License, Version 1.1

+

Belanosima

+

The following software may be included in this product: Belanosima fonts. Use of any of this software is governed + by the terms of the license below:

+

Copyright 2023 The Belanosima Project Authors (https://github.com/docrepair-fonts/belanosima-fonts), + with Reserved Font Name "Josefin Sans".

+

This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is copied below, + and is also available with a FAQ at: http://scripts.sil.org/OFL

+

Jump to SIL Open Font License, Version 1.1

Caladea

Copyright (c) 2012 Huerta Tipográfica

This Font Software is licensed under the Apache License, Version 2.0 as shown below.

Jump to Apache License Version 2.0

+

Caprasimo

+

The following software may be included in this product: Caprasimo fonts. Use of any of this software is governed + by the terms of the license below:

+

Copyright 2023 The Caprasimo Project Authors (https://github.com/docrepair-fonts/caprasimo-fonts).

+

This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is copied below, + and is also available with a FAQ at: http://scripts.sil.org/OFL

+

Jump to SIL Open Font License, Version 1.1

Carlito

Copyright (c) 2010-2013 by tyPoland Lukasz Dziedzic with Reserved Font Name "Carlito".

This Font Software is licensed under the SIL Open Font License, Version 1.1 as shown below.

@@ -2629,6 +2659,27 @@

This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL

Jump to SIL Open Font License, Version 1.1

+

Lugrasimo

+

The following software may be included in this product: Lugrasimo fonts. Use of any of this software is governed + by the terms of the license below:

+

Copyright 2023 The Lugrasimo Project Authors (https://github.com/docrepair-fonts/lugrasimo-fonts).

+

This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is copied below, + and is also available with a FAQ at: http://scripts.sil.org/OFL

+

Jump to SIL Open Font License, Version 1.1

+

Lumanosimo

+

The following software may be included in this product: Lumanosimo fonts. Use of any of this software is governed + by the terms of the license below:

+

Copyright 2023 The Lumanosimo Project Authors (https://github.com/docrepair-fonts/lumanosimo-fonts).

+

This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is copied below, + and is also available with a FAQ at: http://scripts.sil.org/OFL

+

Jump to SIL Open Font License, Version 1.1

+

Lunasima

+

The following software may be included in this product: Lunasima fonts. Use of any of this software is governed + by the terms of the license below:

+

Copyright 2023 The Lunasima Project Authors (https://github.com/docrepair-fonts/lunasima-fonts).

+

This Font Software is licensed under the SIL Open Font License, Version 1.1. This license is copied below, + and is also available with a FAQ at: http://scripts.sil.org/OFL

+

Jump to SIL Open Font License, Version 1.1

Noto

The following software may be included in this product: Google Noto fonts. Use of any of this software is governed by the terms of the license below:

diff --git a/solenv/flatpak-manifest.in b/solenv/flatpak-manifest.in index c6e9d4f8e874..eec4ac657cf0 100644 --- a/solenv/flatpak-manifest.in +++ b/solenv/flatpak-manifest.in @@ -613,6 +613,55 @@ "dest": "external/tarballs", "dest-filename": "@FONT_SCHEHERAZADE_TARBALL@" }, + { + "url": "https://dev-www.libreoffice.org/src/@FONT_AGDASIMA_TARBALL@", + "sha256": "@FONT_AGDASIMA_SHA256SUM@", + "type": "file", + "dest": "external/tarballs", + "dest-filename": "@FONT_AGDASIMA_TARBALL@" + }, + { + "url": "https://dev-www.libreoffice.org/src/@FONT_BACASIME_ANTIQUE_TARBALL@", + "sha256": "@FONT_BACASIME_ANTIQUE_SHA256SUM@", + "type": "file", + "dest": "external/tarballs", + "dest-filename": "@FONT_BACASIME_ANTIQUE_TARBALL@" + }, + { + "url": "https://dev-www.libreoffice.org/src/@FONT_BELANOSIMA_TARBALL@", + "sha256": "@FONT_BELANOSIMA_SHA256SUM@", + "type": "file", + "dest": "external/tarballs", + "dest-filename": "@FONT_BELANOSIMA_TARBALL@" + }, + { + "url": "https://dev-www.libreoffice.org/src/@FONT_CAPRASIMO_TARBALL@", + "sha256": "@FONT_CAPRASIMO_SHA256SUM@", + "type": "file", + "dest": "external/tarballs", + "dest-filename": "@FONT_CAPRASIMO_TARBALL@" + }, + { + "url": "https://dev-www.libreoffice.org/src/@FONT_LUGRASIMO_TARBALL@", + "sha256": "@FONT_LUGRASIMO_SHA256SUM@", + "type": "file", + "dest": "external/tarballs", + "dest-filename": "@FONT_LUGRASIMO_TARBALL@" + }, + { + "url": "https://dev-www.libreoffice.org/src/@FONT_LUMANOSIMO_TARBALL@", + "sha256": "@FONT_LUMANOSIMO_SHA256SUM@", + "type": "file", + "dest": "external/tarballs", + "dest-filename": "@FONT_LUMANOSIMO_TARBALL@" + }, + { + "url": "https://dev-www.libreoffice.org/src/@FONT_LUNASIMA_TARBALL@", + "sha256": "@FONT_LUNASIMA_SHA256SUM@", + "type": "file", + "dest": "external/tarballs", + "dest-filename": "@FONT_LUNASIMA_TARBALL@" + }, { "url": "https://dev-www.libreoffice.org/src/@BSH_TARBALL@", "sha256": "@BSH_SHA256SUM@", From c409c83d777fdb6291c7cd03186b69fe4e7fd902 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 5 Jul 2024 13:55:31 +0200 Subject: [PATCH 153/232] package: avoid throwing RuntimeException in getZipFileContents() Translate it to ZipIOException. Change-Id: I7a07a59c0ba301b92f31696355c73ccbdf119ff8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170013 Tested-by: Jenkins Reviewed-by: Michael Stahl --- package/source/zippackage/ZipPackage.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index 907ed1b4112e..2cb267734b9f 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -626,7 +626,11 @@ void ZipPackage::getZipFileContents() if ( !pCurrent->hasByName( sTemp ) ) { rtl::Reference pPkgFolder = new ZipPackageFolder(m_xContext, m_nFormat, m_bAllowRemoveOnInsert); - pPkgFolder->setName( sTemp ); + try { + pPkgFolder->setName( sTemp ); + } catch (uno::RuntimeException const& e) { + throw css::packages::zip::ZipIOException(e.Message); + } pPkgFolder->doSetParent( pCurrent ); pCurrent = pPkgFolder.get(); } From 5e7c94c6026117ee12f72432e3ab101262586e8a Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 5 Jul 2024 15:22:58 +0200 Subject: [PATCH 154/232] fill in more SfxItemType values found by doing some git grepping, we should now have values for all items in the hierarchy Change-Id: I397ca7e8f53f53737201385c4c8029b436895c1d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170016 Reviewed-by: Noel Grandin Tested-by: Jenkins --- editeng/source/items/frmitems.cxx | 4 +- editeng/source/items/textitem.cxx | 15 +++--- include/editeng/charrotateitem.hxx | 2 +- include/editeng/pbinitem.hxx | 2 +- include/editeng/rsiditem.hxx | 2 +- include/editeng/sizeitem.hxx | 2 +- include/editeng/udlnitem.hxx | 3 +- include/svl/intitem.hxx | 4 +- include/svl/poolitem.hxx | 75 +++++++++++++++++++++++++++++ include/svx/sdggaitm.hxx | 3 +- include/svx/sdgluitm.hxx | 9 ++-- include/svx/sdooitm.hxx | 3 +- include/svx/sdprcitm.hxx | 6 ++- include/svx/sdtaaitm.hxx | 2 +- include/svx/sdtacitm.hxx | 2 +- include/svx/sdtayitm.hxx | 2 +- include/svx/sxcecitm.hxx | 4 +- include/svx/sxcgitm.hxx | 2 +- include/svx/sxelditm.hxx | 3 +- include/svx/sxenditm.hxx | 14 +++--- include/svx/sxmtfitm.hxx | 3 +- sc/source/core/data/attrib.cxx | 4 +- sfx2/source/dialog/tabdlg.cxx | 2 +- svx/inc/sdgcoitm.hxx | 9 ++-- svx/inc/sdginitm.hxx | 3 +- svx/inc/sdgtritm.hxx | 3 +- svx/inc/sxallitm.hxx | 8 +-- svx/inc/sxcaitm.hxx | 2 +- svx/inc/sxlayitm.hxx | 3 +- svx/inc/sxlogitm.hxx | 4 +- svx/inc/sxmoitm.hxx | 2 +- svx/inc/sxmovitm.hxx | 4 +- svx/inc/sxoneitm.hxx | 8 +-- svx/inc/sxroaitm.hxx | 2 +- svx/inc/sxrooitm.hxx | 2 +- svx/inc/sxsaitm.hxx | 2 +- svx/inc/sxsalitm.hxx | 4 +- svx/inc/sxsoitm.hxx | 4 +- svx/inc/sxtraitm.hxx | 8 +-- svx/source/engine3d/svx3ditems.cxx | 17 ++++--- svx/source/items/postattr.cxx | 4 +- svx/source/items/statusitem.cxx | 2 +- svx/source/items/viewlayoutitem.cxx | 2 +- svx/source/items/zoomslideritem.cxx | 2 +- sw/inc/grfatr.hxx | 6 +-- sw/inc/paratr.hxx | 4 +- sw/source/core/attr/cellatr.cxx | 2 +- sw/source/core/layout/atrfrm.cxx | 2 +- 48 files changed, 180 insertions(+), 97 deletions(-) diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx index c6470a8f120e..fb52f89c055b 100644 --- a/editeng/source/items/frmitems.cxx +++ b/editeng/source/items/frmitems.cxx @@ -138,9 +138,9 @@ bool SvxPaperBinItem::GetPresentation } -SvxSizeItem::SvxSizeItem( const sal_uInt16 nId, const Size& rSize ) : +SvxSizeItem::SvxSizeItem( const sal_uInt16 nId, const Size& rSize, SfxItemType eItemType ) : - SfxPoolItem( nId, SfxItemType::SvxSizeItemType ), + SfxPoolItem( nId, eItemType ), m_aSize( rSize ) { diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx index 196182b3b973..e0082b0a4968 100644 --- a/editeng/source/items/textitem.cxx +++ b/editeng/source/items/textitem.cxx @@ -998,8 +998,8 @@ void SvxFontHeightItem::dumpAsXml(xmlTextWriterPtr pWriter) const // class SvxTextLineItem ------------------------------------------------ -SvxTextLineItem::SvxTextLineItem( const FontLineStyle eSt, const sal_uInt16 nId ) - : SfxEnumItem(nId, SfxItemType::SvxTextLineItemType,eSt) +SvxTextLineItem::SvxTextLineItem( const FontLineStyle eSt, const sal_uInt16 nId, SfxItemType eItemType ) + : SfxEnumItem(nId, eItemType, eSt) , maColor(COL_TRANSPARENT) { } @@ -1151,7 +1151,7 @@ bool SvxTextLineItem::operator==( const SfxPoolItem& rItem ) const // class SvxUnderlineItem ------------------------------------------------ SvxUnderlineItem::SvxUnderlineItem( const FontLineStyle eSt, const sal_uInt16 nId ) - : SvxTextLineItem( eSt, nId ) + : SvxTextLineItem( eSt, nId, SfxItemType::SvxUnderlineItemType ) { } @@ -1192,7 +1192,7 @@ OUString SvxUnderlineItem::GetValueTextByPos( sal_uInt16 nPos ) const // class SvxOverlineItem ------------------------------------------------ SvxOverlineItem::SvxOverlineItem( const FontLineStyle eSt, const sal_uInt16 nId ) - : SvxTextLineItem( eSt, nId ) + : SvxTextLineItem( eSt, nId, SfxItemType::SvxOverlineItemType ) { } @@ -2404,8 +2404,8 @@ bool SvxTwoLinesItem::GetPresentation( SfxItemPresentation /*ePres*/, |* class SvxTextRotateItem *************************************************************************/ -SvxTextRotateItem::SvxTextRotateItem(Degree10 nValue, TypedWhichId nW) - : SfxUInt16Item(nW, nValue.get(), SfxItemType::SvxTextRotateItemType) +SvxTextRotateItem::SvxTextRotateItem(Degree10 nValue, TypedWhichId nW, SfxItemType eItemType) + : SfxUInt16Item(nW, nValue.get(), eItemType) { } @@ -2484,7 +2484,8 @@ void SvxTextRotateItem::dumpAsXml(xmlTextWriterPtr pWriter) const SvxCharRotateItem::SvxCharRotateItem( Degree10 nValue, bool bFitIntoLine, TypedWhichId nW ) - : SvxTextRotateItem(nValue, nW), bFitToLine( bFitIntoLine ) + : SvxTextRotateItem(nValue, nW, SfxItemType::SvxCharRotateItemType), + bFitToLine( bFitIntoLine ) { } diff --git a/include/editeng/charrotateitem.hxx b/include/editeng/charrotateitem.hxx index d8a773065575..42e4d5f16467 100644 --- a/include/editeng/charrotateitem.hxx +++ b/include/editeng/charrotateitem.hxx @@ -35,7 +35,7 @@ class EDITENG_DLLPUBLIC SvxTextRotateItem : public SfxUInt16Item { public: - SvxTextRotateItem(Degree10 nValue, TypedWhichId nId); + SvxTextRotateItem(Degree10 nValue, TypedWhichId nId, SfxItemType eItemType = SfxItemType::SvxTextRotateItemType); virtual SvxTextRotateItem* Clone(SfxItemPool *pPool = nullptr) const override; diff --git a/include/editeng/pbinitem.hxx b/include/editeng/pbinitem.hxx index d6bf7229b676..a4fadccb7ef3 100644 --- a/include/editeng/pbinitem.hxx +++ b/include/editeng/pbinitem.hxx @@ -50,7 +50,7 @@ public: }; inline SvxPaperBinItem::SvxPaperBinItem( const sal_uInt16 nId, const sal_uInt8 nT ) - : SfxByteItem( nId, nT ) + : SfxByteItem( nId, nT, SfxItemType::SvxPaperBinItemType ) {} #endif diff --git a/include/editeng/rsiditem.hxx b/include/editeng/rsiditem.hxx index 24213c3fa697..5c91006dcb9b 100644 --- a/include/editeng/rsiditem.hxx +++ b/include/editeng/rsiditem.hxx @@ -19,7 +19,7 @@ class EDITENG_DLLPUBLIC SvxRsidItem final : public SfxUInt32Item { public: - SvxRsidItem( sal_uInt32 nRsid, sal_uInt16 nId ) : SfxUInt32Item( nId, nRsid ) {} + SvxRsidItem( sal_uInt32 nRsid, sal_uInt16 nId ) : SfxUInt32Item( nId, nRsid, SfxItemType::SvxRsidItemType ) {} virtual bool GetPresentation( SfxItemPresentation ePres, MapUnit eCoreMetric, diff --git a/include/editeng/sizeitem.hxx b/include/editeng/sizeitem.hxx index 841846b30235..7e10873496f3 100644 --- a/include/editeng/sizeitem.hxx +++ b/include/editeng/sizeitem.hxx @@ -39,7 +39,7 @@ public: static SfxPoolItem* CreateDefault(); explicit SvxSizeItem( const sal_uInt16 nId ); - SvxSizeItem( const sal_uInt16 nId, const Size& rSize); + SvxSizeItem( const sal_uInt16 nId, const Size& rSize, SfxItemType eItemType = SfxItemType::SvxSizeItemType); // "pure virtual Methods" from SfxPoolItem virtual bool isHashable() const override; diff --git a/include/editeng/udlnitem.hxx b/include/editeng/udlnitem.hxx index b4f3107b5c7f..47c8fea73ca7 100644 --- a/include/editeng/udlnitem.hxx +++ b/include/editeng/udlnitem.hxx @@ -35,7 +35,8 @@ class EDITENG_DLLPUBLIC SvxTextLineItem : public SfxEnumItem public: SvxTextLineItem( const FontLineStyle eSt, - const sal_uInt16 nId ); + const sal_uInt16 nId, + SfxItemType eItemType = SfxItemType::SvxTextLineItemType); // "pure virtual Methods" from SfxPoolItem virtual bool GetPresentation( SfxItemPresentation ePres, diff --git a/include/svl/intitem.hxx b/include/svl/intitem.hxx index 12ad37e85340..82fa80f12d09 100644 --- a/include/svl/intitem.hxx +++ b/include/svl/intitem.hxx @@ -115,8 +115,8 @@ class SVL_DLLPUBLIC SfxUInt32Item: public CntUInt32Item public: static SfxPoolItem* CreateDefault(); - explicit SfxUInt32Item(sal_uInt16 which = 0, sal_uInt32 nValue = 0): - CntUInt32Item(which, nValue) {} + explicit SfxUInt32Item(sal_uInt16 which = 0, sal_uInt32 nValue = 0, SfxItemType eItemType = SfxItemType::SfxUInt32ItemType): + CntUInt32Item(which, nValue, eItemType) {} virtual SfxUInt32Item* Clone(SfxItemPool * = nullptr) const override { return new SfxUInt32Item(*this); } diff --git a/include/svl/poolitem.hxx b/include/svl/poolitem.hxx index fb51a7fa3335..197199689d54 100644 --- a/include/svl/poolitem.hxx +++ b/include/svl/poolitem.hxx @@ -128,6 +128,7 @@ enum class SfxItemType : sal_uInt16 { ScCondFormatItemType, ScConsolidateItemType, ScHyphenateCellType, + ScIndentItemType, ScInputStatusItemType, ScLineBreakCellType, ScMergeAttrType, @@ -136,6 +137,7 @@ enum class SfxItemType : sal_uInt16 { ScPivotItemType, ScProtectionAttrType, ScQueryItemType, + ScRotateValueItemType, ScShrinkToFitCellType, ScSolveItemType, ScSortItemType, @@ -152,8 +154,16 @@ enum class SfxItemType : sal_uInt16 { SdOptionsMiscItemType, SdOptionsPrintItemType, SdOptionsSnapItemType, + SdrAllPositionXItemType, + SdrAllPositionYItemType, + SdrAllSizeHeightItemType, + SdrAllSizeWidthItemType, SdrAngleItemType, + SdrCaptionAngleItemType, + SdrCaptionGapItemType, + SdrCaptionEscAbsItemType, SdrCaptionEscDirItemType, + SdrCaptionEscRelItemType, SdrCaptionEscIsRelItemType, SdrCaptionFitLineLenItemType, SdrCaptionLineLenItemType, @@ -161,13 +171,32 @@ enum class SfxItemType : sal_uInt16 { SdrCircKindItemType, SdrCustomShapeGeometryItemType, SdrEdgeKindItemType, + SdrEdgeLineDeltaCountItemType, + SdrEdgeNode1GlueDistItemType, + SdrEdgeNode1HorzDistItemType, + SdrEdgeNode1VertDistItemType, + SdrEdgeNode2GlueDistItemType, + SdrEdgeNode2HorzDistItemType, + SdrEdgeNode2VertDistItemType, SdrFractionItemType, + SdrGrafBlueItemType, + SdrGrafContrastItemType, + SdrGrafGamma100ItemType, + SdrGrafGreenItemType, + SdrGrafLuminanceItemType, + SdrGrafRedItemType, + SdrGrafInvertItemType, SdrGrafModeItem_Base, + SdrGrafTransparenceItemType, SdrLayerIdItemType, SdrLayerNameItemType, + SdrLogicSizeHeightItemType, + SdrLogicSizeWidthItemType, SdrMeasureBelowRefEdgeItemType, + SdrMeasureDecimalPlacesItemType, SdrMeasureFormatStringItemType, SdrMeasureKindItemType, + SdrMeasureOverhangItemType, SdrMeasureScaleItemType, SdrMeasureTextAutoAngleItemType, SdrMeasureTextAutoAngleViewItemType, @@ -179,14 +208,28 @@ enum class SfxItemType : sal_uInt16 { SdrMeasureTextVPosItemType, SdrMeasureUnitItemType, SdrMetricItemType, + SdrMoveXItemType, + SdrMoveYItemType, SdrObjPrintableItemType, SdrObjVisibleItemType, + SdrOnePositionXItemType, + SdrOnePositionYItemType, + SdrOneSizeHeightItemType, + SdrOneSizeWidthItemType, SdrOnOffItemType, + SdrPercentItemType, SdrResizeXAllItemType, SdrResizeXOneItemType, SdrResizeYAllItemType, SdrResizeYOneItemType, + SdrRotateAllItemType, + SdrRotateOneItemType, SdrScaleItemType, + SdrShearAngleItemType, + SdrSignedPercentItemType, + SdrTextAniAmountItemType, + SdrTextAniCountItemType, + SdrTextAniDelayItemType, SdrTextAniDirectionItemType, SdrTextAniStartInsideItemType, SdrTextAniStopInsideItemType, @@ -195,6 +238,14 @@ enum class SfxItemType : sal_uInt16 { SdrTextFixedCellHeightItemType, SdrTextHorzAdjustType, SdrTextVertAdjustType, + SdrTransformRef1XItemType, + SdrTransformRef1YItemType, + SdrTransformRef2XItemType, + SdrTransformRef2YItemType, + SdrHorzShearAllItemType, + SdrVertShearAllItemType, + SdrHorzShearOneItemType, + SdrVertShearOneItemType, SdrYesNoItemType, SfxBoolItemType, SfxByteItemType, @@ -224,8 +275,10 @@ enum class SfxItemType : sal_uInt16 { SfxSetItemType, SfxStringItemType, SfxStringListItemType, + SfxTabDialogItemType, SfxTemplateItemType, SfxUInt16ItemType, + SfxUInt32ItemType, SfxUnoAnyItemType, SfxUnoFrameItemType, SfxViewFrameItemType, @@ -236,9 +289,16 @@ enum class SfxItemType : sal_uInt16 { Svx3DCharacterModeItemType, Svx3DCloseBackItemType, Svx3DCloseFrontItemType, + Svx3DNormalsKindItemType, + Svx3DPerspectiveItemType, Svx3DReducedLineGeometryItemType, + Svx3DShadeModeItemType, Svx3DSmoothLidsItemType, Svx3DSmoothNormalsItemType, + Svx3DTextureKindItemType, + Svx3DTextureModeItemType, + Svx3DTextureProjectionXItemType, + Svx3DTextureProjectionYItemType, SvXMLAttrContainerItemType, SvxAdjustItemType, SvxAutoKernItemType, @@ -252,6 +312,7 @@ enum class SfxItemType : sal_uInt16 { SvxCaseMapItemType, SvxCharHiddenItemType, SvxCharReliefItemType, + SvxCharRotateItemType, SvxCharScaleWidthItemType, SvxChartColorTableItemType, SvxChartIndicateItemType, @@ -307,16 +368,20 @@ enum class SfxItemType : sal_uInt16 { SvxOpaqueItemType, SvxOrientationItemType, SvxOrphansItemType, + SvxOverlineItemType, SvxPageItemType, SvxPagePosSizeItemType, + SvxPaperBinItemType, SvxParaGridItemType, SvxParaVertAlignItemType, SvxPatternListItemType, + SvxPostItDateItemType, SvxPostureItemType, SvxPrintItemType, SvxProtectItemType, SvxRightMarginItemType, SvxRotateModeItemType, + SvxRsidItemType, SvxScriptSetItemType, SvxScriptSpaceItemType, SvxSearchItemType, @@ -324,19 +389,25 @@ enum class SfxItemType : sal_uInt16 { SvxShadowedItemType, SvxSizeItemType, SvxSmartTagItemType, + SvxStatusItemType, SvxTabStopItemType, SvxTextLeftMarginItemType, SvxTextLineItemType, SvxTextRotateItemType, SvxTwoLinesItemType, + SvxUnderlineItemType, SvxULSpaceItemType, SvxVerJustifyItemType, + SvxViewLayoutItemType, SvxWeightItemType, SvxWidowsItemType, SvxWordLineItemType, SvxWritingModeItemType, + SvxZoomSliderItemType, SwAddPrinterItemType, + SwChannelGrfType, SwCondCollItemType, + SwContrastGrfType, SwCropGrfType, SwDocDisplayItemType, SwDrawModeGrf_BaseType, @@ -358,6 +429,7 @@ enum class SfxItemType : sal_uInt16 { SwFormatDropType, SwFormatEditInReadonly, SwFormatFieldType, + SwFormatFrameSizeType, SwFormatFillOrderType, SwFormatFlyCntType, SwFormatFlySplitType, @@ -386,14 +458,17 @@ enum class SfxItemType : sal_uInt16 { SwHeaderAndFooterEatSpacingItemType, SwInvertGrfType, SwLabItemType, + SwLuminanceGrfType, SwMirrorGrfType, SwMsgPoolItemType, + SwNumRuleItemType, SwPaMItemType, SwPageFootnoteInfoItemType, SwPtrItemType, SwRotationGrfType, SwShadowCursorItemType, SwTOXMarkType, + SwTableBoxNumFormatType, SwTableBoxValueType, SwTableFormulaType, SwTextGridItemType, diff --git a/include/svx/sdggaitm.hxx b/include/svx/sdggaitm.hxx index 249130d4d49e..6ec033a53798 100644 --- a/include/svx/sdggaitm.hxx +++ b/include/svx/sdggaitm.hxx @@ -32,8 +32,7 @@ class SVXCORE_DLLPUBLIC SdrGrafGamma100Item final : public SfxUInt32Item { public: - - SdrGrafGamma100Item( sal_uInt32 nGamma100 = 100 ) : SfxUInt32Item( SDRATTR_GRAFGAMMA, nGamma100 ) {} + SdrGrafGamma100Item( sal_uInt32 nGamma100 = 100 ) : SfxUInt32Item( SDRATTR_GRAFGAMMA, nGamma100, SfxItemType::SdrGrafGamma100ItemType ) {} SAL_DLLPRIVATE virtual SdrGrafGamma100Item* Clone( SfxItemPool* pPool = nullptr ) const override; diff --git a/include/svx/sdgluitm.hxx b/include/svx/sdgluitm.hxx index 4ef5e69e9e45..13e35435aed5 100644 --- a/include/svx/sdgluitm.hxx +++ b/include/svx/sdgluitm.hxx @@ -32,9 +32,8 @@ class SVXCORE_DLLPUBLIC SdrGrafLuminanceItem final : public SdrSignedPercentItem { public: - - SdrGrafLuminanceItem( short nLuminancePercent = 0 ) : SdrSignedPercentItem( - SDRATTR_GRAFLUMINANCE, nLuminancePercent ) {} + SdrGrafLuminanceItem( short nLuminancePercent = 0 ) + : SdrSignedPercentItem( SDRATTR_GRAFLUMINANCE, nLuminancePercent, SfxItemType::SdrGrafLuminanceItemType ) {} virtual SdrGrafLuminanceItem* Clone( SfxItemPool* pPool = nullptr ) const override; }; @@ -47,8 +46,8 @@ class SVXCORE_DLLPUBLIC SdrGrafContrastItem final : public SdrSignedPercentItem { public: - - SdrGrafContrastItem( short nContrastPercent = 0 ) : SdrSignedPercentItem( SDRATTR_GRAFCONTRAST, nContrastPercent ) {} + SdrGrafContrastItem( short nContrastPercent = 0 ) + : SdrSignedPercentItem( SDRATTR_GRAFCONTRAST, nContrastPercent, SfxItemType::SdrGrafContrastItemType ) {} virtual SdrGrafContrastItem* Clone( SfxItemPool* pPool = nullptr ) const override; }; diff --git a/include/svx/sdooitm.hxx b/include/svx/sdooitm.hxx index 3feae53ed66e..b94a45bb9555 100644 --- a/include/svx/sdooitm.hxx +++ b/include/svx/sdooitm.hxx @@ -29,7 +29,8 @@ class SVXCORE_DLLPUBLIC SdrOnOffItem: public SfxBoolItem { public: - SdrOnOffItem(TypedWhichId nId, bool bOn): SfxBoolItem(nId,bOn, SfxItemType::SdrOnOffItemType) {} + SdrOnOffItem(TypedWhichId nId, bool bOn, SfxItemType eItemType = SfxItemType::SdrOnOffItemType) + : SfxBoolItem(nId, bOn, eItemType) {} virtual SdrOnOffItem* Clone(SfxItemPool* pPool=nullptr) const override; virtual OUString GetValueTextByVal(bool bVal) const override; diff --git a/include/svx/sdprcitm.hxx b/include/svx/sdprcitm.hxx index f00c8d514edb..a7d439d0cf0a 100644 --- a/include/svx/sdprcitm.hxx +++ b/include/svx/sdprcitm.hxx @@ -31,7 +31,8 @@ class SVXCORE_DLLPUBLIC SdrPercentItem : public SfxUInt16Item { public: - SdrPercentItem(TypedWhichId nId, sal_uInt16 nVal): SfxUInt16Item(nId,nVal) {} + SdrPercentItem(TypedWhichId nId, sal_uInt16 nVal, SfxItemType eItemKind = SfxItemType::SdrPercentItemType) + : SfxUInt16Item(nId, nVal, eItemKind) {} virtual SdrPercentItem* Clone(SfxItemPool* pPool=nullptr) const override; virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, const IntlWrapper&) const override; @@ -47,7 +48,8 @@ public: class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) SdrSignedPercentItem : public SfxInt16Item { public: - SdrSignedPercentItem( sal_uInt16 nId, sal_Int16 nVal ) : SfxInt16Item( nId,nVal ) {} + SdrSignedPercentItem( sal_uInt16 nId, sal_Int16 nVal, SfxItemType eItemType = SfxItemType::SdrSignedPercentItemType ) + : SfxInt16Item( nId, nVal, eItemType ) {} virtual SdrSignedPercentItem* Clone( SfxItemPool* pPool = nullptr ) const override; virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, const IntlWrapper&) const override; diff --git a/include/svx/sdtaaitm.hxx b/include/svx/sdtaaitm.hxx index 1a4a51c0e07f..c5a95eeb0cf2 100644 --- a/include/svx/sdtaaitm.hxx +++ b/include/svx/sdtaaitm.hxx @@ -25,7 +25,7 @@ class SVXCORE_DLLPUBLIC SdrTextAniAmountItem final : public SfxInt16Item { public: - SdrTextAniAmountItem(sal_Int16 nVal=0): SfxInt16Item(SDRATTR_TEXT_ANIAMOUNT,nVal) {} + SdrTextAniAmountItem(sal_Int16 nVal=0): SfxInt16Item(SDRATTR_TEXT_ANIAMOUNT, nVal, SfxItemType::SdrTextAniAmountItemType) {} virtual SdrTextAniAmountItem* Clone(SfxItemPool* pPool=nullptr) const override; virtual bool HasMetrics() const override; virtual void ScaleMetrics(tools::Long nMul, tools::Long nDiv) override; diff --git a/include/svx/sdtacitm.hxx b/include/svx/sdtacitm.hxx index 820aee926503..b54491c45ad8 100644 --- a/include/svx/sdtacitm.hxx +++ b/include/svx/sdtacitm.hxx @@ -25,7 +25,7 @@ // Number of loops. 0=infinite. class SAL_DLLPUBLIC_RTTI SdrTextAniCountItem final : public SfxUInt16Item { public: - SdrTextAniCountItem(sal_uInt16 nVal=0): SfxUInt16Item(SDRATTR_TEXT_ANICOUNT,nVal) {} + SdrTextAniCountItem(sal_uInt16 nVal=0): SfxUInt16Item(SDRATTR_TEXT_ANICOUNT, nVal, SfxItemType::SdrTextAniCountItemType) {} virtual SdrTextAniCountItem* Clone(SfxItemPool * = nullptr) const override { return new SdrTextAniCountItem(*this); } diff --git a/include/svx/sdtayitm.hxx b/include/svx/sdtayitm.hxx index 7308991d00d5..f20e2c8e1af9 100644 --- a/include/svx/sdtayitm.hxx +++ b/include/svx/sdtayitm.hxx @@ -25,7 +25,7 @@ class SVXCORE_DLLPUBLIC SdrTextAniDelayItem final : public SfxUInt16Item { public: - SdrTextAniDelayItem(sal_uInt16 nVal=0): SfxUInt16Item(SDRATTR_TEXT_ANIDELAY,nVal) {} + SdrTextAniDelayItem(sal_uInt16 nVal=0): SfxUInt16Item(SDRATTR_TEXT_ANIDELAY, nVal, SfxItemType::SdrTextAniDelayItemType) {} virtual SdrTextAniDelayItem* Clone(SfxItemPool* pPool=nullptr) const override; virtual bool GetPresentation(SfxItemPresentation ePres, MapUnit eCoreMetric, MapUnit ePresMetric, OUString& rText, const IntlWrapper&) const override; }; diff --git a/include/svx/sxcecitm.hxx b/include/svx/sxcecitm.hxx index 83f4053d7c28..064de9ff9ece 100644 --- a/include/svx/sxcecitm.hxx +++ b/include/svx/sxcecitm.hxx @@ -68,7 +68,7 @@ public: class SVXCORE_DLLPUBLIC SdrCaptionEscRelItem final : public SfxInt32Item { public: - SdrCaptionEscRelItem(sal_Int32 nEscRel=5000): SfxInt32Item(SDRATTR_CAPTIONESCREL,nEscRel) {} + SdrCaptionEscRelItem(sal_Int32 nEscRel=5000): SfxInt32Item(SDRATTR_CAPTIONESCREL, nEscRel, SfxItemType::SdrCaptionEscRelItemType) {} virtual ~SdrCaptionEscRelItem() override; virtual SdrCaptionEscRelItem* Clone(SfxItemPool* pPool=nullptr) const override; @@ -87,7 +87,7 @@ public: class SdrCaptionEscAbsItem final : public SdrMetricItem { public: - SdrCaptionEscAbsItem(tools::Long nEscAbs=0): SdrMetricItem(SDRATTR_CAPTIONESCABS,nEscAbs) {} + SdrCaptionEscAbsItem(tools::Long nEscAbs=0): SdrMetricItem(SDRATTR_CAPTIONESCABS, nEscAbs, SfxItemType::SdrCaptionEscAbsItemType) {} virtual SdrCaptionEscAbsItem* Clone(SfxItemPool*) const override { return new SdrCaptionEscAbsItem(*this); diff --git a/include/svx/sxcgitm.hxx b/include/svx/sxcgitm.hxx index 993d164dea10..cb2cd2f465ab 100644 --- a/include/svx/sxcgitm.hxx +++ b/include/svx/sxcgitm.hxx @@ -30,7 +30,7 @@ class SdrCaptionGapItem final : public SdrMetricItem { public: SdrCaptionGapItem(tools::Long nGap = 0) - : SdrMetricItem(SDRATTR_CAPTIONGAP, nGap) + : SdrMetricItem(SDRATTR_CAPTIONGAP, nGap, SfxItemType::SdrCaptionGapItemType) { } virtual SdrCaptionGapItem* Clone(SfxItemPool*) const override diff --git a/include/svx/sxelditm.hxx b/include/svx/sxelditm.hxx index 7d2bc11dc102..1b3a8b52f59c 100644 --- a/include/svx/sxelditm.hxx +++ b/include/svx/sxelditm.hxx @@ -26,7 +26,8 @@ class SAL_DLLPUBLIC_RTTI SdrEdgeLineDeltaCountItem final : public SfxUInt16Item { public: SdrEdgeLineDeltaCountItem(sal_uInt16 nVal = 0) - : SfxUInt16Item(SDRATTR_EDGELINEDELTACOUNT, nVal) + : SfxUInt16Item(SDRATTR_EDGELINEDELTACOUNT, nVal, + SfxItemType::SdrEdgeLineDeltaCountItemType) { } virtual SdrEdgeLineDeltaCountItem* Clone(SfxItemPool*) const override diff --git a/include/svx/sxenditm.hxx b/include/svx/sxenditm.hxx index ed72c9224428..c678b51b06dd 100644 --- a/include/svx/sxenditm.hxx +++ b/include/svx/sxenditm.hxx @@ -25,7 +25,7 @@ class SVXCORE_DLLPUBLIC SdrEdgeNode1HorzDistItem final : public SdrMetricItem { public: - SdrEdgeNode1HorzDistItem(tools::Long nVal): SdrMetricItem(SDRATTR_EDGENODE1HORZDIST,nVal) {} + SdrEdgeNode1HorzDistItem(tools::Long nVal): SdrMetricItem(SDRATTR_EDGENODE1HORZDIST, nVal, SfxItemType::SdrEdgeNode1HorzDistItemType) {} SAL_DLLPRIVATE virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; SAL_DLLPRIVATE virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; SAL_DLLPRIVATE virtual SdrEdgeNode1HorzDistItem* Clone(SfxItemPool* pPool=nullptr) const override; @@ -33,7 +33,7 @@ public: class SVXCORE_DLLPUBLIC SdrEdgeNode1VertDistItem final : public SdrMetricItem { public: - SdrEdgeNode1VertDistItem(tools::Long nVal): SdrMetricItem(SDRATTR_EDGENODE1VERTDIST,nVal) {} + SdrEdgeNode1VertDistItem(tools::Long nVal): SdrMetricItem(SDRATTR_EDGENODE1VERTDIST, nVal, SfxItemType::SdrEdgeNode1VertDistItemType) {} SAL_DLLPRIVATE virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; SAL_DLLPRIVATE virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; SAL_DLLPRIVATE virtual SdrEdgeNode1VertDistItem* Clone(SfxItemPool* pPool=nullptr) const override; @@ -41,7 +41,7 @@ public: class SVXCORE_DLLPUBLIC SdrEdgeNode2HorzDistItem final : public SdrMetricItem { public: - SdrEdgeNode2HorzDistItem(tools::Long nVal): SdrMetricItem(SDRATTR_EDGENODE2HORZDIST,nVal) {} + SdrEdgeNode2HorzDistItem(tools::Long nVal): SdrMetricItem(SDRATTR_EDGENODE2HORZDIST, nVal, SfxItemType::SdrEdgeNode2HorzDistItemType) {} SAL_DLLPRIVATE virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; SAL_DLLPRIVATE virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; SAL_DLLPRIVATE virtual SdrEdgeNode2HorzDistItem* Clone(SfxItemPool* pPool=nullptr) const override; @@ -49,7 +49,7 @@ public: class SVXCORE_DLLPUBLIC SdrEdgeNode2VertDistItem final : public SdrMetricItem { public: - SdrEdgeNode2VertDistItem(tools::Long nVal): SdrMetricItem(SDRATTR_EDGENODE2VERTDIST,nVal) {} + SdrEdgeNode2VertDistItem(tools::Long nVal): SdrMetricItem(SDRATTR_EDGENODE2VERTDIST, nVal, SfxItemType::SdrEdgeNode2VertDistItemType) {} SAL_DLLPRIVATE virtual bool QueryValue( css::uno::Any& rVal, sal_uInt8 nMemberId = 0 ) const override; SAL_DLLPRIVATE virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; SAL_DLLPRIVATE virtual SdrEdgeNode2VertDistItem* Clone(SfxItemPool* pPool=nullptr) const override; @@ -57,13 +57,15 @@ public: class SdrEdgeNode1GlueDistItem final : public SdrMetricItem { public: - SdrEdgeNode1GlueDistItem(tools::Long nVal=0): SdrMetricItem(SDRATTR_EDGENODE1GLUEDIST,nVal) {} + SdrEdgeNode1GlueDistItem(tools::Long nVal=0) + : SdrMetricItem(SDRATTR_EDGENODE1GLUEDIST, nVal, SfxItemType::SdrEdgeNode1GlueDistItemType) {} virtual SdrEdgeNode1GlueDistItem* Clone(SfxItemPool* pPool=nullptr) const override; }; class SdrEdgeNode2GlueDistItem final : public SdrMetricItem { public: - SdrEdgeNode2GlueDistItem(tools::Long nVal=0): SdrMetricItem(SDRATTR_EDGENODE2GLUEDIST,nVal) {} + SdrEdgeNode2GlueDistItem(tools::Long nVal=0) + : SdrMetricItem(SDRATTR_EDGENODE2GLUEDIST, nVal, SfxItemType::SdrEdgeNode2GlueDistItemType) {} virtual SdrEdgeNode2GlueDistItem* Clone(SfxItemPool* pPool=nullptr) const override; }; diff --git a/include/svx/sxmtfitm.hxx b/include/svx/sxmtfitm.hxx index 2284ac4db0a3..1100a0948f16 100644 --- a/include/svx/sxmtfitm.hxx +++ b/include/svx/sxmtfitm.hxx @@ -56,7 +56,8 @@ public: // The decimal places used for the measure value class SVXCORE_DLLPUBLIC SdrMeasureDecimalPlacesItem final : public SfxInt16Item { public: - SdrMeasureDecimalPlacesItem(sal_Int16 nVal=2): SfxInt16Item(SDRATTR_MEASUREDECIMALPLACES,nVal) {} + SdrMeasureDecimalPlacesItem(sal_Int16 nVal=2) + : SfxInt16Item(SDRATTR_MEASUREDECIMALPLACES, nVal, SfxItemType::SdrMeasureDecimalPlacesItemType) {} virtual ~SdrMeasureDecimalPlacesItem() override; virtual SdrMeasureDecimalPlacesItem* Clone(SfxItemPool* pPool=nullptr) const override; diff --git a/sc/source/core/data/attrib.cxx b/sc/source/core/data/attrib.cxx index 91ea0de1e5a1..409f7aa0a6a0 100644 --- a/sc/source/core/data/attrib.cxx +++ b/sc/source/core/data/attrib.cxx @@ -751,7 +751,7 @@ void ScCondFormatItem::dumpAsXml(xmlTextWriterPtr pWriter) const } ScRotateValueItem::ScRotateValueItem(Degree100 nAngle) - : SdrAngleItem(ATTR_ROTATE_VALUE, nAngle) + : SdrAngleItem(ATTR_ROTATE_VALUE, nAngle, SfxItemType::ScRotateValueItemType) { } @@ -852,7 +852,7 @@ bool ScHyphenateCell::GetPresentation(SfxItemPresentation, } ScIndentItem::ScIndentItem(sal_uInt16 nIndent) - : SfxUInt16Item(ATTR_INDENT, nIndent) + : SfxUInt16Item(ATTR_INDENT, nIndent, SfxItemType::ScIndentItemType) { } diff --git a/sfx2/source/dialog/tabdlg.cxx b/sfx2/source/dialog/tabdlg.cxx index c8bda80385f0..ca2f96b5c810 100644 --- a/sfx2/source/dialog/tabdlg.cxx +++ b/sfx2/source/dialog/tabdlg.cxx @@ -81,7 +81,7 @@ SfxTabDialogItem::SfxTabDialogItem( const SfxTabDialogItem& rAttr, SfxItemPool* } SfxTabDialogItem::SfxTabDialogItem( sal_uInt16 nId, const SfxItemSet& rItemSet ) - : SfxSetItem( nId, rItemSet ) + : SfxSetItem( nId, rItemSet, SfxItemType::SfxTabDialogItemType ) { } diff --git a/svx/inc/sdgcoitm.hxx b/svx/inc/sdgcoitm.hxx index d49bad207275..570fbd46b8d8 100644 --- a/svx/inc/sdgcoitm.hxx +++ b/svx/inc/sdgcoitm.hxx @@ -32,8 +32,7 @@ class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) SdrGrafRedItem final : public SdrSigne { public: - - SdrGrafRedItem( short nRedPercent = 0 ) : SdrSignedPercentItem( SDRATTR_GRAFRED, nRedPercent ) {} + SdrGrafRedItem( short nRedPercent = 0 ) : SdrSignedPercentItem( SDRATTR_GRAFRED, nRedPercent, SfxItemType::SdrGrafRedItemType ) {} virtual SdrGrafRedItem* Clone( SfxItemPool* pPool = nullptr ) const override; }; @@ -46,8 +45,7 @@ class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) SdrGrafGreenItem final : public SdrSig { public: - - SdrGrafGreenItem( short nGreenPercent = 0 ) : SdrSignedPercentItem( SDRATTR_GRAFGREEN, nGreenPercent ) {} + SdrGrafGreenItem( short nGreenPercent = 0 ) : SdrSignedPercentItem( SDRATTR_GRAFGREEN, nGreenPercent, SfxItemType::SdrGrafGreenItemType ) {} virtual SdrGrafGreenItem* Clone( SfxItemPool* pPool = nullptr ) const override; }; @@ -60,8 +58,7 @@ class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) SdrGrafBlueItem final : public SdrSign { public: - - SdrGrafBlueItem( short nBluePercent = 0 ) : SdrSignedPercentItem( SDRATTR_GRAFBLUE, nBluePercent ) {} + SdrGrafBlueItem( short nBluePercent = 0 ) : SdrSignedPercentItem( SDRATTR_GRAFBLUE, nBluePercent, SfxItemType::SdrGrafBlueItemType ) {} virtual SdrGrafBlueItem* Clone( SfxItemPool* pPool = nullptr ) const override; }; diff --git a/svx/inc/sdginitm.hxx b/svx/inc/sdginitm.hxx index 35cfa3da7865..1f26cb1e4eb0 100644 --- a/svx/inc/sdginitm.hxx +++ b/svx/inc/sdginitm.hxx @@ -30,8 +30,7 @@ class SdrGrafInvertItem final : public SdrOnOffItem { public: - - SdrGrafInvertItem( bool bInvert = false ) : SdrOnOffItem( SDRATTR_GRAFINVERT, bInvert ) {} + SdrGrafInvertItem( bool bInvert = false ) : SdrOnOffItem( SDRATTR_GRAFINVERT, bInvert, SfxItemType::SdrGrafInvertItemType ) {} virtual SdrGrafInvertItem* Clone( SfxItemPool* pPool = nullptr ) const override; }; diff --git a/svx/inc/sdgtritm.hxx b/svx/inc/sdgtritm.hxx index 084ac694493d..0511826bc6ef 100644 --- a/svx/inc/sdgtritm.hxx +++ b/svx/inc/sdgtritm.hxx @@ -32,7 +32,8 @@ class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) SdrGrafTransparenceItem final : public { public: - SdrGrafTransparenceItem( sal_uInt16 nTransparencePercent = 0 ) : SdrPercentItem( SDRATTR_GRAFTRANSPARENCE, nTransparencePercent ) {} + SdrGrafTransparenceItem( sal_uInt16 nTransparencePercent = 0 ) + : SdrPercentItem( SDRATTR_GRAFTRANSPARENCE, nTransparencePercent, SfxItemType::SdrGrafTransparenceItemType ) {} virtual SdrGrafTransparenceItem* Clone( SfxItemPool* pPool = nullptr ) const override; }; diff --git a/svx/inc/sxallitm.hxx b/svx/inc/sxallitm.hxx index 144d3bae2b07..0afcd1802a8c 100644 --- a/svx/inc/sxallitm.hxx +++ b/svx/inc/sxallitm.hxx @@ -24,7 +24,7 @@ class SdrAllPositionXItem final : public SdrMetricItem { public: - SdrAllPositionXItem(tools::Long nPosX=0): SdrMetricItem(SDRATTR_ALLPOSITIONX,nPosX) {} + SdrAllPositionXItem(tools::Long nPosX=0): SdrMetricItem(SDRATTR_ALLPOSITIONX, nPosX, SfxItemType::SdrAllPositionXItemType) {} virtual SdrAllPositionXItem* Clone(SfxItemPool*) const override { return new SdrAllPositionXItem(*this); @@ -33,7 +33,7 @@ public: class SdrAllPositionYItem final : public SdrMetricItem { public: - SdrAllPositionYItem(tools::Long nPosY=0): SdrMetricItem(SDRATTR_ALLPOSITIONY,nPosY) {} + SdrAllPositionYItem(tools::Long nPosY=0): SdrMetricItem(SDRATTR_ALLPOSITIONY, nPosY, SfxItemType::SdrAllPositionYItemType) {} virtual SdrAllPositionYItem* Clone(SfxItemPool*) const override { return new SdrAllPositionYItem(*this); @@ -42,7 +42,7 @@ public: class SdrAllSizeWidthItem final : public SdrMetricItem { public: - SdrAllSizeWidthItem(tools::Long nWdt=0): SdrMetricItem(SDRATTR_ALLSIZEWIDTH,nWdt) {} + SdrAllSizeWidthItem(tools::Long nWdt=0): SdrMetricItem(SDRATTR_ALLSIZEWIDTH, nWdt, SfxItemType::SdrAllSizeWidthItemType) {} virtual SdrAllSizeWidthItem* Clone(SfxItemPool*) const override { return new SdrAllSizeWidthItem(*this); @@ -51,7 +51,7 @@ public: class SdrAllSizeHeightItem final : public SdrMetricItem { public: - SdrAllSizeHeightItem(tools::Long nHgt=0): SdrMetricItem(SDRATTR_ALLSIZEHEIGHT,nHgt) {} + SdrAllSizeHeightItem(tools::Long nHgt=0): SdrMetricItem(SDRATTR_ALLSIZEHEIGHT, nHgt, SfxItemType::SdrAllSizeHeightItemType) {} virtual SdrAllSizeHeightItem* Clone(SfxItemPool*) const override { return new SdrAllSizeHeightItem(*this); diff --git a/svx/inc/sxcaitm.hxx b/svx/inc/sxcaitm.hxx index 26d4a3194329..4aa6b44e910d 100644 --- a/svx/inc/sxcaitm.hxx +++ b/svx/inc/sxcaitm.hxx @@ -36,7 +36,7 @@ class SdrCaptionAngleItem final : public SdrAngleItem { public: SdrCaptionAngleItem(Degree100 nAngle = 0_deg100) - : SdrAngleItem(SDRATTR_CAPTIONANGLE, nAngle) + : SdrAngleItem(SDRATTR_CAPTIONANGLE, nAngle, SfxItemType::SdrCaptionAngleItemType) { } virtual SdrCaptionAngleItem* Clone(SfxItemPool*) const override diff --git a/svx/inc/sxlayitm.hxx b/svx/inc/sxlayitm.hxx index 5c8c42d21c50..6891f5f4c345 100644 --- a/svx/inc/sxlayitm.hxx +++ b/svx/inc/sxlayitm.hxx @@ -36,7 +36,8 @@ class SdrLayerNameItem final : public SfxStringItem { public: SdrLayerNameItem() : SfxStringItem(SDRATTR_LAYERNAME, SfxItemType::SdrLayerNameItemType) {} - SdrLayerNameItem(const OUString& rStr) : SfxStringItem(SDRATTR_LAYERNAME,rStr) {} + SdrLayerNameItem(const OUString& rStr) + : SfxStringItem(SDRATTR_LAYERNAME, rStr, SfxItemType::SdrLayerNameItemType) {} virtual SdrLayerNameItem* Clone(SfxItemPool* pPool=nullptr) const override; }; diff --git a/svx/inc/sxlogitm.hxx b/svx/inc/sxlogitm.hxx index 20d61724b303..5fe217b77c62 100644 --- a/svx/inc/sxlogitm.hxx +++ b/svx/inc/sxlogitm.hxx @@ -24,7 +24,7 @@ class SdrLogicSizeWidthItem final : public SdrMetricItem { public: - SdrLogicSizeWidthItem(tools::Long nWdt=0): SdrMetricItem(SDRATTR_LOGICSIZEWIDTH,nWdt) {} + SdrLogicSizeWidthItem(tools::Long nWdt=0): SdrMetricItem(SDRATTR_LOGICSIZEWIDTH, nWdt, SfxItemType::SdrLogicSizeWidthItemType) {} virtual SdrLogicSizeWidthItem* Clone(SfxItemPool*) const override { return new SdrLogicSizeWidthItem(*this); @@ -33,7 +33,7 @@ public: class SdrLogicSizeHeightItem final : public SdrMetricItem { public: - SdrLogicSizeHeightItem(tools::Long nHgt=0): SdrMetricItem(SDRATTR_LOGICSIZEHEIGHT,nHgt) {} + SdrLogicSizeHeightItem(tools::Long nHgt=0): SdrMetricItem(SDRATTR_LOGICSIZEHEIGHT, nHgt, SfxItemType::SdrLogicSizeHeightItemType) {} virtual SdrLogicSizeHeightItem* Clone(SfxItemPool*) const override { return new SdrLogicSizeHeightItem(*this); diff --git a/svx/inc/sxmoitm.hxx b/svx/inc/sxmoitm.hxx index f207f7411794..c3f6d5a3dd97 100644 --- a/svx/inc/sxmoitm.hxx +++ b/svx/inc/sxmoitm.hxx @@ -28,7 +28,7 @@ class SdrMeasureOverhangItem final : public SdrMetricItem { public: SdrMeasureOverhangItem(tools::Long nVal) - : SdrMetricItem(SDRATTR_MEASUREOVERHANG, nVal) + : SdrMetricItem(SDRATTR_MEASUREOVERHANG, nVal, SfxItemType::SdrMeasureOverhangItemType) { } virtual SdrMeasureOverhangItem* Clone(SfxItemPool*) const override diff --git a/svx/inc/sxmovitm.hxx b/svx/inc/sxmovitm.hxx index eda423e27c87..4f8be6c545e0 100644 --- a/svx/inc/sxmovitm.hxx +++ b/svx/inc/sxmovitm.hxx @@ -24,7 +24,7 @@ class SdrMoveXItem final : public SdrMetricItem { public: - SdrMoveXItem(): SdrMetricItem(SDRATTR_MOVEX,0) {} + SdrMoveXItem(): SdrMetricItem(SDRATTR_MOVEX, 0, SfxItemType::SdrMoveXItemType) {} SdrMoveXItem* Clone(SfxItemPool*) const override { return new SdrMoveXItem(*this); @@ -33,7 +33,7 @@ public: class SdrMoveYItem final : public SdrMetricItem { public: - SdrMoveYItem(): SdrMetricItem(SDRATTR_MOVEY,0) {} + SdrMoveYItem(): SdrMetricItem(SDRATTR_MOVEY, 0, SfxItemType::SdrMoveYItemType) {} SdrMoveYItem* Clone(SfxItemPool*) const override { return new SdrMoveYItem(*this); diff --git a/svx/inc/sxoneitm.hxx b/svx/inc/sxoneitm.hxx index 424563008bfb..d395d14181f3 100644 --- a/svx/inc/sxoneitm.hxx +++ b/svx/inc/sxoneitm.hxx @@ -24,7 +24,7 @@ class SdrOnePositionXItem final : public SdrMetricItem { public: - SdrOnePositionXItem(tools::Long nPosX=0): SdrMetricItem(SDRATTR_ONEPOSITIONX,nPosX) {} + SdrOnePositionXItem(tools::Long nPosX=0): SdrMetricItem(SDRATTR_ONEPOSITIONX, nPosX, SfxItemType::SdrOnePositionXItemType) {} virtual SdrOnePositionXItem* Clone(SfxItemPool*) const override { return new SdrOnePositionXItem(*this); @@ -33,7 +33,7 @@ public: class SdrOnePositionYItem final : public SdrMetricItem { public: - SdrOnePositionYItem(tools::Long nPosY=0): SdrMetricItem(SDRATTR_ONEPOSITIONY,nPosY) {} + SdrOnePositionYItem(tools::Long nPosY=0): SdrMetricItem(SDRATTR_ONEPOSITIONY, nPosY, SfxItemType::SdrOnePositionYItemType) {} virtual SdrOnePositionYItem* Clone(SfxItemPool*) const override { return new SdrOnePositionYItem(*this); @@ -42,7 +42,7 @@ public: class SdrOneSizeWidthItem final : public SdrMetricItem { public: - SdrOneSizeWidthItem(tools::Long nWdt=0): SdrMetricItem(SDRATTR_ONESIZEWIDTH,nWdt) {} + SdrOneSizeWidthItem(tools::Long nWdt=0): SdrMetricItem(SDRATTR_ONESIZEWIDTH, nWdt, SfxItemType::SdrOneSizeWidthItemType) {} virtual SdrOneSizeWidthItem* Clone(SfxItemPool*) const override { return new SdrOneSizeWidthItem(*this); @@ -51,7 +51,7 @@ public: class SdrOneSizeHeightItem final : public SdrMetricItem { public: - SdrOneSizeHeightItem(tools::Long nHgt=0): SdrMetricItem(SDRATTR_ONESIZEHEIGHT,nHgt) {} + SdrOneSizeHeightItem(tools::Long nHgt=0): SdrMetricItem(SDRATTR_ONESIZEHEIGHT, nHgt, SfxItemType::SdrOneSizeHeightItemType) {} virtual SdrOneSizeHeightItem* Clone(SfxItemPool*) const override { return new SdrOneSizeHeightItem(*this); diff --git a/svx/inc/sxroaitm.hxx b/svx/inc/sxroaitm.hxx index 7f1aec1c54e5..02138710ba7c 100644 --- a/svx/inc/sxroaitm.hxx +++ b/svx/inc/sxroaitm.hxx @@ -26,7 +26,7 @@ class SdrRotateAllItem final : public SdrAngleItem { public: SdrRotateAllItem() - : SdrAngleItem(SDRATTR_ROTATEALL, 0_deg100) + : SdrAngleItem(SDRATTR_ROTATEALL, 0_deg100, SfxItemType::SdrRotateAllItemType) { } virtual SdrRotateAllItem* Clone(SfxItemPool*) const override diff --git a/svx/inc/sxrooitm.hxx b/svx/inc/sxrooitm.hxx index f14bcf77f153..a4ad37b2aaf3 100644 --- a/svx/inc/sxrooitm.hxx +++ b/svx/inc/sxrooitm.hxx @@ -24,7 +24,7 @@ class SdrRotateOneItem final : public SdrAngleItem { public: - SdrRotateOneItem(): SdrAngleItem(SDRATTR_ROTATEONE,0_deg100) {} + SdrRotateOneItem(): SdrAngleItem(SDRATTR_ROTATEONE, 0_deg100, SfxItemType::SdrRotateOneItemType) {} SdrRotateOneItem* Clone(SfxItemPool*) const override { return new SdrRotateOneItem(*this); diff --git a/svx/inc/sxsaitm.hxx b/svx/inc/sxsaitm.hxx index 190d66d7b653..f02397ed2ef9 100644 --- a/svx/inc/sxsaitm.hxx +++ b/svx/inc/sxsaitm.hxx @@ -26,7 +26,7 @@ class SdrShearAngleItem final : public SdrAngleItem { public: SdrShearAngleItem(Degree100 nAngle = 0_deg100) - : SdrAngleItem(SDRATTR_SHEARANGLE, nAngle) + : SdrAngleItem(SDRATTR_SHEARANGLE, nAngle, SfxItemType::SdrShearAngleItemType) { } virtual SdrShearAngleItem* Clone(SfxItemPool*) const override diff --git a/svx/inc/sxsalitm.hxx b/svx/inc/sxsalitm.hxx index 304396206ac0..0bf84bd08271 100644 --- a/svx/inc/sxsalitm.hxx +++ b/svx/inc/sxsalitm.hxx @@ -24,7 +24,7 @@ class SdrHorzShearAllItem final : public SdrAngleItem { public: - SdrHorzShearAllItem(): SdrAngleItem(SDRATTR_HORZSHEARALL,0_deg100) {} + SdrHorzShearAllItem(): SdrAngleItem(SDRATTR_HORZSHEARALL, 0_deg100, SfxItemType::SdrHorzShearAllItemType) {} virtual SdrHorzShearAllItem* Clone(SfxItemPool*) const override { return new SdrHorzShearAllItem(*this); @@ -33,7 +33,7 @@ public: class SdrVertShearAllItem final : public SdrAngleItem { public: - SdrVertShearAllItem(): SdrAngleItem(SDRATTR_VERTSHEARALL,0_deg100) {} + SdrVertShearAllItem(): SdrAngleItem(SDRATTR_VERTSHEARALL, 0_deg100, SfxItemType::SdrVertShearAllItemType) {} virtual SdrVertShearAllItem* Clone(SfxItemPool*) const override { return new SdrVertShearAllItem(*this); diff --git a/svx/inc/sxsoitm.hxx b/svx/inc/sxsoitm.hxx index ce5ce237e1ee..a6baf378161b 100644 --- a/svx/inc/sxsoitm.hxx +++ b/svx/inc/sxsoitm.hxx @@ -24,7 +24,7 @@ class SdrHorzShearOneItem final : public SdrAngleItem { public: - SdrHorzShearOneItem(): SdrAngleItem(SDRATTR_HORZSHEARONE,0_deg100) {} + SdrHorzShearOneItem(): SdrAngleItem(SDRATTR_HORZSHEARONE, 0_deg100, SfxItemType::SdrHorzShearOneItemType) {} SdrHorzShearOneItem* Clone(SfxItemPool*) const override { return new SdrHorzShearOneItem(*this); @@ -33,7 +33,7 @@ public: class SdrVertShearOneItem final : public SdrAngleItem { public: - SdrVertShearOneItem(): SdrAngleItem(SDRATTR_VERTSHEARONE,0_deg100) {} + SdrVertShearOneItem(): SdrAngleItem(SDRATTR_VERTSHEARONE, 0_deg100, SfxItemType::SdrVertShearOneItemType) {} SdrVertShearOneItem* Clone(SfxItemPool*) const override { return new SdrVertShearOneItem(*this); diff --git a/svx/inc/sxtraitm.hxx b/svx/inc/sxtraitm.hxx index 2a1fdec4ccca..fadfd67dca4b 100644 --- a/svx/inc/sxtraitm.hxx +++ b/svx/inc/sxtraitm.hxx @@ -24,7 +24,7 @@ class SdrTransformRef1XItem final : public SdrMetricItem { public: - SdrTransformRef1XItem(tools::Long nHgt=0): SdrMetricItem(SDRATTR_TRANSFORMREF1X,nHgt) {} + SdrTransformRef1XItem(tools::Long nHgt=0): SdrMetricItem(SDRATTR_TRANSFORMREF1X, nHgt, SfxItemType::SdrTransformRef1XItemType) {} virtual SdrTransformRef1XItem* Clone(SfxItemPool*) const override { return new SdrTransformRef1XItem(*this); @@ -33,7 +33,7 @@ public: class SdrTransformRef1YItem final : public SdrMetricItem { public: - SdrTransformRef1YItem(tools::Long nHgt=0): SdrMetricItem(SDRATTR_TRANSFORMREF1Y,nHgt) {} + SdrTransformRef1YItem(tools::Long nHgt=0): SdrMetricItem(SDRATTR_TRANSFORMREF1Y,nHgt, SfxItemType::SdrTransformRef1YItemType) {} virtual SdrTransformRef1YItem* Clone(SfxItemPool*) const override { return new SdrTransformRef1YItem(*this); @@ -42,7 +42,7 @@ public: class SdrTransformRef2XItem final : public SdrMetricItem { public: - SdrTransformRef2XItem(tools::Long nHgt=0): SdrMetricItem(SDRATTR_TRANSFORMREF2X,nHgt) {} + SdrTransformRef2XItem(tools::Long nHgt=0): SdrMetricItem(SDRATTR_TRANSFORMREF2X, nHgt, SfxItemType::SdrTransformRef2XItemType) {} virtual SdrTransformRef2XItem* Clone(SfxItemPool*) const override { return new SdrTransformRef2XItem(*this); @@ -51,7 +51,7 @@ public: class SdrTransformRef2YItem final : public SdrMetricItem { public: - SdrTransformRef2YItem(tools::Long nHgt=0): SdrMetricItem(SDRATTR_TRANSFORMREF2Y,nHgt) {} + SdrTransformRef2YItem(tools::Long nHgt=0): SdrMetricItem(SDRATTR_TRANSFORMREF2Y, nHgt, SfxItemType::SdrTransformRef2YItemType) {} virtual SdrTransformRef2YItem* Clone(SfxItemPool*) const override { return new SdrTransformRef2YItem(*this); diff --git a/svx/source/engine3d/svx3ditems.cxx b/svx/source/engine3d/svx3ditems.cxx index 599d32a56cb9..ea58e06de592 100644 --- a/svx/source/engine3d/svx3ditems.cxx +++ b/svx/source/engine3d/svx3ditems.cxx @@ -42,37 +42,40 @@ Svx3DReducedLineGeometryItem* Svx3DReducedLineGeometryItem::Clone(SfxItemPool*) } Svx3DNormalsKindItem::Svx3DNormalsKindItem(sal_uInt16 nVal) - : SfxUInt16Item(SDRATTR_3DOBJ_NORMALS_KIND, nVal) + : SfxUInt16Item(SDRATTR_3DOBJ_NORMALS_KIND, nVal, SfxItemType::Svx3DNormalsKindItemType) { } Svx3DTextureProjectionXItem::Svx3DTextureProjectionXItem(sal_uInt16 nVal) - : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_PROJ_X, nVal) + : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_PROJ_X, nVal, + SfxItemType::Svx3DTextureProjectionXItemType) { } Svx3DTextureProjectionYItem::Svx3DTextureProjectionYItem(sal_uInt16 nVal) - : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_PROJ_Y, nVal) + : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_PROJ_Y, nVal, + SfxItemType::Svx3DTextureProjectionYItemType) { } Svx3DTextureKindItem::Svx3DTextureKindItem(sal_uInt16 nVal) - : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_KIND, nVal) + : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_KIND, nVal, SfxItemType::Svx3DTextureKindItemType) { } Svx3DTextureModeItem::Svx3DTextureModeItem(sal_uInt16 nVal) - : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_MODE, nVal) + : SfxUInt16Item(SDRATTR_3DOBJ_TEXTURE_MODE, nVal, SfxItemType::Svx3DTextureModeItemType) { } Svx3DPerspectiveItem::Svx3DPerspectiveItem(ProjectionType nVal) - : SfxUInt16Item(SDRATTR_3DSCENE_PERSPECTIVE, static_cast(nVal)) + : SfxUInt16Item(SDRATTR_3DSCENE_PERSPECTIVE, static_cast(nVal), + SfxItemType::Svx3DPerspectiveItemType) { } Svx3DShadeModeItem::Svx3DShadeModeItem(sal_uInt16 nVal) - : SfxUInt16Item(SDRATTR_3DSCENE_SHADE_MODE, nVal) + : SfxUInt16Item(SDRATTR_3DSCENE_SHADE_MODE, nVal, SfxItemType::Svx3DShadeModeItemType) { } diff --git a/svx/source/items/postattr.cxx b/svx/source/items/postattr.cxx index 267c2cd9ad18..09c3f606c03b 100644 --- a/svx/source/items/postattr.cxx +++ b/svx/source/items/postattr.cxx @@ -66,13 +66,13 @@ SvxPostItAuthorItem* SvxPostItAuthorItem::Clone( SfxItemPool * ) const } SvxPostItDateItem::SvxPostItDateItem( TypedWhichId _nWhich ) - : SfxStringItem(_nWhich) + : SfxStringItem(_nWhich, SfxItemType::SvxPostItDateItemType) { } SvxPostItDateItem::SvxPostItDateItem( const OUString& rDate, TypedWhichId _nWhich ) : - SfxStringItem( _nWhich, rDate ) + SfxStringItem( _nWhich, rDate, SfxItemType::SvxPostItDateItemType ) { } diff --git a/svx/source/items/statusitem.cxx b/svx/source/items/statusitem.cxx index e2e1c74307dc..5d8a74dbe19d 100644 --- a/svx/source/items/statusitem.cxx +++ b/svx/source/items/statusitem.cxx @@ -19,7 +19,7 @@ constexpr int STATUS_PARAMS = 2; SvxStatusItem::SvxStatusItem(TypedWhichId nWhich, const OUString& rString, StatusCategory eCategory) - : SfxStringItem(nWhich, rString) + : SfxStringItem(nWhich, rString, SfxItemType::SvxStatusItemType) , m_eCategory(eCategory) { } diff --git a/svx/source/items/viewlayoutitem.cxx b/svx/source/items/viewlayoutitem.cxx index 78a03efb5edd..2761dced30d7 100644 --- a/svx/source/items/viewlayoutitem.cxx +++ b/svx/source/items/viewlayoutitem.cxx @@ -40,7 +40,7 @@ SvxViewLayoutItem::SvxViewLayoutItem bool bBookMode, TypedWhichId _nWhich ) -: SfxUInt16Item( _nWhich, nColumns ), +: SfxUInt16Item( _nWhich, nColumns, SfxItemType::SvxViewLayoutItemType ), mbBookMode( bBookMode ) { } diff --git a/svx/source/items/zoomslideritem.cxx b/svx/source/items/zoomslideritem.cxx index bd7313904710..042b9f4a5947 100644 --- a/svx/source/items/zoomslideritem.cxx +++ b/svx/source/items/zoomslideritem.cxx @@ -36,7 +36,7 @@ constexpr OUString ZOOMSLIDER_PARAM_MAXZOOM = u"MaxValue"_ustr; SvxZoomSliderItem::SvxZoomSliderItem( sal_uInt16 nCurrentZoom, sal_uInt16 nMinZoom, sal_uInt16 nMaxZoom, TypedWhichId _nWhich ) -: SfxUInt16Item( _nWhich, nCurrentZoom ), mnMinZoom( nMinZoom ), mnMaxZoom( nMaxZoom ) +: SfxUInt16Item( _nWhich, nCurrentZoom, SfxItemType::SvxZoomSliderItemType ), mnMinZoom( nMinZoom ), mnMaxZoom( nMaxZoom ) { } diff --git a/sw/inc/grfatr.hxx b/sw/inc/grfatr.hxx index fa3991d4aa8f..f6fe5bb8b05f 100644 --- a/sw/inc/grfatr.hxx +++ b/sw/inc/grfatr.hxx @@ -114,7 +114,7 @@ class SW_DLLPUBLIC SwLuminanceGrf final : public SfxInt16Item { public: SwLuminanceGrf( sal_Int16 nVal = 0 ) - : SfxInt16Item( RES_GRFATR_LUMINANCE, nVal ) + : SfxInt16Item( RES_GRFATR_LUMINANCE, nVal, SfxItemType::SwLuminanceGrfType ) {} // pure virtual methods from SfxInt16Item @@ -130,7 +130,7 @@ class SW_DLLPUBLIC SwContrastGrf final : public SfxInt16Item { public: SwContrastGrf( sal_Int16 nVal = 0 ) - : SfxInt16Item( RES_GRFATR_CONTRAST, nVal ) + : SfxInt16Item( RES_GRFATR_CONTRAST, nVal, SfxItemType::SwContrastGrfType ) {} // pure virtual methods from SfxInt16Item @@ -146,7 +146,7 @@ class SwChannelGrf : public SfxInt16Item { protected: SwChannelGrf( sal_Int16 nVal, sal_uInt16 nWhichL ) - : SfxInt16Item( nWhichL, nVal ) + : SfxInt16Item( nWhichL, nVal, SfxItemType::SwChannelGrfType ) {} public: diff --git a/sw/inc/paratr.hxx b/sw/inc/paratr.hxx index 9b5f2b156430..3a8fd5d03674 100644 --- a/sw/inc/paratr.hxx +++ b/sw/inc/paratr.hxx @@ -156,10 +156,10 @@ public: static SfxPoolItem* CreateDefault(); SwNumRuleItem() - : SfxStringItem( RES_PARATR_NUMRULE, OUString() ) {} + : SfxStringItem( RES_PARATR_NUMRULE, OUString(), SfxItemType::SwNumRuleItemType ) {} SwNumRuleItem( const OUString& rRuleName ) - : SfxStringItem( RES_PARATR_NUMRULE, rRuleName ) {} + : SfxStringItem( RES_PARATR_NUMRULE, rRuleName, SfxItemType::SwNumRuleItemType ) {} SwNumRuleItem(SwNumRuleItem const &) = default; // SfxPoolItem copy function dichotomy diff --git a/sw/source/core/attr/cellatr.cxx b/sw/source/core/attr/cellatr.cxx index 67aaeee2518f..f0a32b89f7c6 100644 --- a/sw/source/core/attr/cellatr.cxx +++ b/sw/source/core/attr/cellatr.cxx @@ -38,7 +38,7 @@ SwTableBoxNumFormat::SwTableBoxNumFormat( sal_uInt32 nFormat ) : SfxUInt32Item( RES_BOXATR_FORMAT, (((nFormat % SV_COUNTRY_LANGUAGE_OFFSET) == getSwDefaultTextFormat()) ? - getSwDefaultTextFormat() : nFormat)) + getSwDefaultTextFormat() : nFormat), SfxItemType::SwTableBoxNumFormatType) { } diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 2c620c7127df..7b89676e7b9c 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -251,7 +251,7 @@ bool SwFormatFrameSize::HasMetrics() const { // Partially implemented inline in hxx SwFormatFrameSize::SwFormatFrameSize( SwFrameSize eSize, SwTwips nWidth, SwTwips nHeight ) - : SvxSizeItem( RES_FRM_SIZE, {nWidth, nHeight} ), + : SvxSizeItem( RES_FRM_SIZE, {nWidth, nHeight}, SfxItemType::SwFormatFrameSizeType ), m_eFrameHeightType( eSize ), m_eFrameWidthType( SwFrameSize::Fixed ) { From e4cbe169bd1236698a573bf4758d8ae8519a1c08 Mon Sep 17 00:00:00 2001 From: Peter Hagen Date: Fri, 5 Jul 2024 13:51:10 -0400 Subject: [PATCH 155/232] Related tdf#161461: break out of loop once data flavor is set Change-Id: I37126d2d77a7a80168bd5ab08fa26e8eabfa22cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170055 Tested-by: Jenkins Reviewed-by: Patrick Luby --- vcl/osx/DataFlavorMapping.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vcl/osx/DataFlavorMapping.cxx b/vcl/osx/DataFlavorMapping.cxx index 16a2c8be9207..855f6db9a287 100644 --- a/vcl/osx/DataFlavorMapping.cxx +++ b/vcl/osx/DataFlavorMapping.cxx @@ -577,6 +577,10 @@ const NSString* DataFlavorMapper::openOfficeToSystemFlavor( const DataFlavor& oO sysFlavor = flavorMap[i].SystemFlavor; else sysFlavor = OUStringToNSString(oOOFlavor.MimeType); + + // Flavor set, then break + if (sysFlavor != nullptr) + break; } } From 4a3706db4fa737ea0047a3605312591698392617 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Thu, 27 Jun 2024 12:11:14 +0200 Subject: [PATCH 156/232] pyuno: fix deprecated warnings * Replace PyUnicode_FromUnicode(str, len) with PyUnicode_FromWideChar(str, len) * Replace PyUnicode_AS_UNICODE(PyObject) with PyUnicode_AsWideCharString(PyObject, size) Change-Id: I1d8b46059d72f4de261d99393e1681f1e41eafdf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169625 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- external/python3/UnpackedTarball_python3.mk | 1 - .../python3/py_deprecated_warning.patch.0 | 20 ------------------- pyuno/source/module/pyuno_util.cxx | 8 ++++---- 3 files changed, 4 insertions(+), 25 deletions(-) delete mode 100644 external/python3/py_deprecated_warning.patch.0 diff --git a/external/python3/UnpackedTarball_python3.mk b/external/python3/UnpackedTarball_python3.mk index 5822940e9924..4b1ae232a3cb 100644 --- a/external/python3/UnpackedTarball_python3.mk +++ b/external/python3/UnpackedTarball_python3.mk @@ -28,7 +28,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,python3,\ external/python3/python-3.7.6-msvc-ssl.patch.1 \ external/python3/python-3.5.4-msvc-disable.patch.1 \ external/python3/ubsan.patch.0 \ - external/python3/py_deprecated_warning.patch.0 \ external/python3/python-3.5.tweak.strip.soabi.patch \ external/python3/darwin.patch.0 \ external/python3/macos-11.patch.0 \ diff --git a/external/python3/py_deprecated_warning.patch.0 b/external/python3/py_deprecated_warning.patch.0 deleted file mode 100644 index 2deefa6e531f..000000000000 --- a/external/python3/py_deprecated_warning.patch.0 +++ /dev/null @@ -1,20 +0,0 @@ ---- Include/cpython/unicodeobject.h 2024-06-10 10:53:20.049824821 +0200 -+++ Include/cpython/unicodeobject.h 2024-06-10 10:54:50.776970835 +0200 -@@ -548,7 +548,7 @@ - only allowed if u was set to NULL. - - The buffer is copied into the new object. */ --Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode( -+/*Py_DEPRECATED(3.3)*/ PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode( - const Py_UNICODE *u, /* Unicode buffer */ - Py_ssize_t size /* size of buffer */ - ); -@@ -577,7 +577,7 @@ - Py_UNICODE buffer. - If the wchar_t/Py_UNICODE representation is not yet available, this - function will calculate it. */ --Py_DEPRECATED(3.3) PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode( -+/*Py_DEPRECATED(3.3)*/ PyAPI_FUNC(Py_UNICODE *) PyUnicode_AsUnicode( - PyObject *unicode /* Unicode object */ - ); - diff --git a/pyuno/source/module/pyuno_util.cxx b/pyuno/source/module/pyuno_util.cxx index f01d33acfb86..355ff2f8b828 100644 --- a/pyuno/source/module/pyuno_util.cxx +++ b/pyuno/source/module/pyuno_util.cxx @@ -36,10 +36,10 @@ PyRef ustring2PyUnicode( const OUString & str ) PyRef ret; #if Py_UNICODE_SIZE == 2 #ifdef MACOSX - ret = PyRef( PyUnicode_FromUnicode( reinterpret_cast(str.getStr()), str.getLength() ), SAL_NO_ACQUIRE ); + ret = PyRef( PyUnicode_FromWideChar( reinterpret_cast(str.getStr()), str.getLength() ), SAL_NO_ACQUIRE ); #else static_assert(sizeof (wchar_t) == Py_UNICODE_SIZE, "bad assumption"); - ret = PyRef( PyUnicode_FromUnicode( reinterpret_cast(str.getStr()), str.getLength() ), SAL_NO_ACQUIRE ); + ret = PyRef( PyUnicode_FromWideChar( reinterpret_cast(str.getStr()), str.getLength() ), SAL_NO_ACQUIRE ); #endif #else OString sUtf8(OUStringToOString(str, RTL_TEXTENCODING_UTF8)); @@ -59,11 +59,11 @@ OUString pyString2ustring( PyObject *pystr ) OUString ret; if( PyUnicode_Check( pystr ) ) { + Py_ssize_t size(0); #if Py_UNICODE_SIZE == 2 ret = OUString( - reinterpret_cast(PyUnicode_AS_UNICODE( pystr )) ); + reinterpret_cast(PyUnicode_AsWideCharString( pystr, &size )) ); #else - Py_ssize_t size(0); char const *pUtf8(PyUnicode_AsUTF8AndSize(pystr, &size)); ret = OUString(pUtf8, size, RTL_TEXTENCODING_UTF8); #endif From a1295cb177295752f8cbfbb49e13d5bb69ed7dc7 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Fri, 5 Jul 2024 17:21:46 +0200 Subject: [PATCH 157/232] python: upgrade to 3.10.14 (master only) Downloaded from https://www.python.org/ftp/python/3.10.14/Python-3.10.14.tar.xz * external/python3/macos-11.patch.0 should be long obsolete by now Change-Id: I454851f7684e699519370bdbbcd9bb9a2cccd077 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170051 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- configure.ac | 4 +-- download.lst | 4 +-- external/python3/ExternalPackage_python3.mk | 28 +++++++-------- external/python3/UnpackedTarball_python3.mk | 1 - ...-sys-streams-cant-initialize-stdin.patch.0 | 8 ++--- external/python3/macos-11.patch.0 | 34 ------------------- .../python3/python-3.3.3-elf-rpath.patch.1 | 4 +-- .../python3/python-3.5.4-msvc-disable.patch.1 | 6 ++-- 8 files changed, 25 insertions(+), 64 deletions(-) delete mode 100644 external/python3/macos-11.patch.0 diff --git a/configure.ac b/configure.ac index 35de9f3ba8a2..13592d0ae71a 100644 --- a/configure.ac +++ b/configure.ac @@ -10286,8 +10286,8 @@ fi if test \( "$cross_compiling" = yes -a -z "$PYTHON_FOR_BUILD" \) -o "$enable_python" = internal; then SYSTEM_PYTHON= PYTHON_VERSION_MAJOR=3 - PYTHON_VERSION_MINOR=9 - PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.19 + PYTHON_VERSION_MINOR=10 + PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.14 if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in download.lst]) fi diff --git a/download.lst b/download.lst index a8042f8f3d78..a1d1bb7d9e73 100644 --- a/download.lst +++ b/download.lst @@ -590,8 +590,8 @@ POSTGRESQL_TARBALL := postgresql-14.12.tar.bz2 # three static lines # so that git cherry-pick # will not run into conflicts -PYTHON_SHA256SUM := d4892cd1618f6458cb851208c030df1482779609d0f3939991bd38184f8c679e -PYTHON_TARBALL := Python-3.9.19.tar.xz +PYTHON_SHA256SUM := 9c50481faa8c2832329ba0fc8868d0a606a680fc4f60ec48d26ce8e076751fda +PYTHON_TARBALL := Python-3.10.14.tar.xz # three static lines # so that git cherry-pick # will not run into conflicts diff --git a/external/python3/ExternalPackage_python3.mk b/external/python3/ExternalPackage_python3.mk index 775056db220c..2227e4d6246f 100644 --- a/external/python3/ExternalPackage_python3.mk +++ b/external/python3/ExternalPackage_python3.mk @@ -96,7 +96,6 @@ python3_EXTENSION_MODULES= \ LO_lib/_multiprocessing.$(python3_EXTENSION_MODULE_SUFFIX).so \ LO_lib/_opcode.$(python3_EXTENSION_MODULE_SUFFIX).so \ LO_lib/ossaudiodev.$(python3_EXTENSION_MODULE_SUFFIX).so \ - LO_lib/parser.$(python3_EXTENSION_MODULE_SUFFIX).so \ LO_lib/_pickle.$(python3_EXTENSION_MODULE_SUFFIX).so \ LO_lib/_posixshmem.$(python3_EXTENSION_MODULE_SUFFIX).so \ LO_lib/_posixsubprocess.$(python3_EXTENSION_MODULE_SUFFIX).so \ @@ -186,7 +185,6 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/__future__.py \ Lib/__phello__.foo.py \ Lib/_aix_support.py \ - Lib/_bootlocale.py \ Lib/_bootsubprocess.py \ Lib/_collections_abc.py \ Lib/_compat_pickle.py \ @@ -240,7 +238,6 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/filecmp.py \ Lib/fileinput.py \ Lib/fnmatch.py \ - Lib/formatter.py \ Lib/fractions.py \ Lib/ftplib.py \ Lib/functools.py \ @@ -325,7 +322,6 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/struct.py \ Lib/subprocess.py \ Lib/sunau.py \ - Lib/symbol.py \ Lib/symtable.py \ Lib/sysconfig.py \ Lib/tabnanny.py \ @@ -372,6 +368,7 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/asyncio/futures.py \ Lib/asyncio/locks.py \ Lib/asyncio/log.py \ + Lib/asyncio/mixins.py \ Lib/asyncio/proactor_events.py \ Lib/asyncio/protocols.py \ Lib/asyncio/queues.py \ @@ -462,7 +459,6 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/distutils/command/bdist_dumb.py \ Lib/distutils/command/bdist_msi.py \ Lib/distutils/command/bdist_rpm.py \ - Lib/distutils/command/bdist_wininst.py \ Lib/distutils/command/build.py \ Lib/distutils/command/build_clib.py \ Lib/distutils/command/build_ext.py \ @@ -481,15 +477,6 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p Lib/distutils/command/register.py \ Lib/distutils/command/sdist.py \ Lib/distutils/command/upload.py \ - Lib/distutils/command/wininst-10.0.exe \ - Lib/distutils/command/wininst-10.0-amd64.exe \ - Lib/distutils/command/wininst-14.0.exe \ - Lib/distutils/command/wininst-14.0-amd64.exe \ - Lib/distutils/command/wininst-6.0.exe \ - Lib/distutils/command/wininst-7.1.exe \ - Lib/distutils/command/wininst-8.0.exe \ - Lib/distutils/command/wininst-9.0.exe \ - Lib/distutils/command/wininst-9.0-amd64.exe \ )) $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/email,\ @@ -669,16 +656,27 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/p $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/importlib,\ Lib/importlib/__init__.py \ + Lib/importlib/_abc.py \ + Lib/importlib/_adapters.py \ Lib/importlib/_bootstrap.py \ Lib/importlib/_bootstrap_external.py \ Lib/importlib/_common.py \ Lib/importlib/abc.py \ Lib/importlib/machinery.py \ - Lib/importlib/metadata.py \ Lib/importlib/resources.py \ Lib/importlib/util.py \ )) +$(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/importlib/metadata,\ + Lib/importlib/metadata/__init__.py \ + Lib/importlib/metadata/_adapters.py \ + Lib/importlib/metadata/_collections.py \ + Lib/importlib/metadata/_functools.py \ + Lib/importlib/metadata/_itertools.py \ + Lib/importlib/metadata/_meta.py \ + Lib/importlib/metadata/_text.py \ +)) + $(eval $(call gb_ExternalPackage_add_unpacked_files,python3,$(LIBO_BIN_FOLDER)/python-core-$(PYTHON_VERSION)/lib/json,\ Lib/json/__init__.py \ Lib/json/decoder.py \ diff --git a/external/python3/UnpackedTarball_python3.mk b/external/python3/UnpackedTarball_python3.mk index 4b1ae232a3cb..4e522715afc2 100644 --- a/external/python3/UnpackedTarball_python3.mk +++ b/external/python3/UnpackedTarball_python3.mk @@ -30,7 +30,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,python3,\ external/python3/ubsan.patch.0 \ external/python3/python-3.5.tweak.strip.soabi.patch \ external/python3/darwin.patch.0 \ - external/python3/macos-11.patch.0 \ external/python3/tsan.patch.0 \ external/python3/init-sys-streams-cant-initialize-stdin.patch.0 \ )) diff --git a/external/python3/init-sys-streams-cant-initialize-stdin.patch.0 b/external/python3/init-sys-streams-cant-initialize-stdin.patch.0 index 1a3ae8969479..fa23b27fae84 100644 --- a/external/python3/init-sys-streams-cant-initialize-stdin.patch.0 +++ b/external/python3/init-sys-streams-cant-initialize-stdin.patch.0 @@ -21,7 +21,7 @@ /* stdin is always opened in buffered mode, first because it shouldn't make a difference in common use cases, second because TextIOWrapper depends on the presence of a read1() method which only exists on -@@ -1971,19 +1971,6 @@ +@@ -2335,19 +2335,6 @@ PyStatus res = _PyStatus_OK(); const PyConfig *config = _PyInterpreterState_GetConfig(tstate->interp); @@ -38,6 +38,6 @@ - } -#endif - - /* Hack to avoid a nasty recursion issue when Python is invoked - in verbose mode: pre-import the Latin-1 and UTF-8 codecs */ - if ((m = PyImport_ImportModule("encodings.utf_8")) == NULL) { + if (!(iomod = PyImport_ImportModule("io"))) { + goto error; + } diff --git a/external/python3/macos-11.patch.0 b/external/python3/macos-11.patch.0 deleted file mode 100644 index 2c8b419bbdb9..000000000000 --- a/external/python3/macos-11.patch.0 +++ /dev/null @@ -1,34 +0,0 @@ ---- setup.py -+++ setup.py -@@ -655,7 +655,10 @@ - add_dir_to_list(self.compiler.include_dirs, - sysconfig.get_config_var("INCLUDEDIR")) - -- system_lib_dirs = ['/lib64', '/usr/lib64', '/lib', '/usr/lib'] -+ if MACOS: -+ system_lib_dirs = ['/usr/lib', macosx_sdk_root()+'/usr/lib'] -+ else: -+ system_lib_dirs = ['/lib64', '/usr/lib64', '/lib', '/usr/lib'] - system_include_dirs = ['/usr/include'] - # lib_dirs and inc_dirs are used to search for files; - # if a file is found in one of those directories, it can ---- Modules/_posixsubprocess.c -+++ Modules/_posixsubprocess.c -@@ -30,6 +30,8 @@ - # define SYS_getdents64 __NR_getdents64 - #endif - -+#include -+ - #if defined(__sun) && defined(__SVR4) - /* readdir64 is used to work around Solaris 9 bug 6395699. */ - # define readdir readdir64 -@@ -201,7 +203,7 @@ - #endif - #ifdef _SC_OPEN_MAX - local_max_fd = sysconf(_SC_OPEN_MAX); -- if (local_max_fd == -1) -+ if (local_max_fd == -1 || local_max_fd == LONG_MAX) - #endif - local_max_fd = 256; /* Matches legacy Lib/subprocess.py behavior. */ - return local_max_fd; diff --git a/external/python3/python-3.3.3-elf-rpath.patch.1 b/external/python3/python-3.3.3-elf-rpath.patch.1 index b248db33ef17..b2e443659cf9 100644 --- a/external/python3/python-3.3.3-elf-rpath.patch.1 +++ b/external/python3/python-3.3.3-elf-rpath.patch.1 @@ -5,10 +5,10 @@ set RPATH (only to be used on ELF platforms) diff -ru python3.orig/Makefile.pre.in python3/Makefile.pre.in --- python3.orig/Makefile.pre.in 2015-07-26 20:29:07.126194320 +0200 +++ python3/Makefile.pre.in 2015-07-26 20:37:21.814227530 +0200 -@@ -589,7 +589,7 @@ +@@ -586,7 +586,7 @@ # Build the interpreter - $(BUILDPYTHON): Programs/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) $(EXPORTSYMS) + $(BUILDPYTHON): Programs/python.o $(LIBRARY_DEPS) - $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) + $(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) -Wl,-rpath,\$$ORIGIN diff --git a/external/python3/python-3.5.4-msvc-disable.patch.1 b/external/python3/python-3.5.4-msvc-disable.patch.1 index 880e4a9cfb5b..5ba33a7f8ab3 100644 --- a/external/python3/python-3.5.4-msvc-disable.patch.1 +++ b/external/python3/python-3.5.4-msvc-disable.patch.1 @@ -21,7 +21,7 @@ diff -ru python3.orig/PCbuild/pcbuild.sln python3/PCbuild/pcbuild.sln Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_ssl", "_ssl.vcxproj", "{C6E20F84-3247-4AD6-B051-B073268F73BA}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testcapi", "_testcapi.vcxproj", "{6901D91C-6E48-4BB7-9FEC-700C8131DF1D}" -@@ -41,24 +37,14 @@ +@@ -41,22 +37,14 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_testimportmultiple", "_testimportmultiple.vcxproj", "{36D0C52C-DF4E-45D0-8BC7-E294C3ABC781}" EndProject @@ -37,8 +37,6 @@ diff -ru python3.orig/PCbuild/pcbuild.sln python3/PCbuild/pcbuild.sln EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pyexpat", "pyexpat.vcxproj", "{D06B6426-4762-44CC-8BAD-D79052507F2F}" EndProject --Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bdist_wininst", "..\PC\bdist_wininst\bdist_wininst.vcxproj", "{EB1C19C1-1F18-421E-9735-CAEE69DC6A3C}" --EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_hashlib", "_hashlib.vcxproj", "{447F05A8-F581-4CAC-A466-5AC7936E207E}" -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite3", "sqlite3.vcxproj", "{A1A295E5-463C-437F-81CA-1F32367685DA}" @@ -46,7 +44,7 @@ diff -ru python3.orig/PCbuild/pcbuild.sln python3/PCbuild/pcbuild.sln Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_multiprocessing", "_multiprocessing.vcxproj", "{9E48B300-37D1-11DD-8C41-005056C00008}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "python3dll", "python3dll.vcxproj", "{885D4898-D08D-4091-9C40-C700CFE3FC5A}" -@@ -93,8 +79,6 @@ +@@ -93,8 +81,6 @@ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "_queue", "_queue.vcxproj", "{78D80A15-BD8C-44E2-B49E-1F05B0A0A687}" EndProject From cdf2681d996286953dffa8a033de1b947ae23768 Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Fri, 28 Jun 2024 17:14:10 -0400 Subject: [PATCH 158/232] tdf#134204 sw: notify when para style inherited a new property The current logic is totally flawed. This is one step better. Don't allow one of the special conditions to prevent a non-special attribute from being propogated down the style inheritance tree. Change-Id: Ib24ba688700e3c1156449a64d89431043a5c85b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169724 Reviewed-by: Michael Stahl Tested-by: Jenkins Reviewed-by: Justin Luth --- sw/source/core/doc/fmtcol.cxx | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sw/source/core/doc/fmtcol.cxx b/sw/source/core/doc/fmtcol.cxx index 52a544bd9ec9..1935d5612a58 100644 --- a/sw/source/core/doc/fmtcol.cxx +++ b/sw/source/core/doc/fmtcol.cxx @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -379,6 +380,26 @@ void SwTextFormatColl::SwClientNotify(const SwModify& rModify, const SfxHint& rH } } + // If there are any attributes in addition to the special ones already handled, then notify... + if (!bContinue && pNewChgSet && pNewChgSet->GetChgSet()) + { + SfxItemIter aIter(*pNewChgSet->GetChgSet()); + for (const SfxPoolItem* pItem = aIter.GetCurItem(); pItem; pItem = aIter.NextItem()) + { + const sal_uInt16 nWhich = pItem->Which(); + if (nWhich == RES_CHRATR_FONTSIZE || nWhich == RES_CHRATR_CTL_FONTSIZE + || nWhich == RES_CHRATR_CJK_FONTSIZE || nWhich == RES_UL_SPACE + || nWhich == RES_MARGIN_TEXTLEFT || nWhich == RES_MARGIN_RIGHT + || nWhich == RES_MARGIN_FIRSTLINE) + { + continue; // already considered for bContinue + } + + bContinue = true; + break; // only one new condition needed to notify that this style has changes + } + } + if( bContinue ) SwFormatColl::SwClientNotify(rModify, rHint); } From 3f7cc820f9dcc215ea768da31f213c0e275baf04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Vajngerl?= Date: Fri, 28 Jun 2024 11:41:47 +0900 Subject: [PATCH 159/232] UniqueID class that generates and stores a uniqueID for an object MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit UniqueID generates an unique ID (unique for all users of UniqueID) and keeps the value for the object's life time. Change-Id: Ic2cc1665e57b1984c231a050f82a330c9dcf1ffc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169691 Tested-by: Jenkins CollaboraOffice Reviewed-by: Mike Kaganski Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170017 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- include/svx/UniqueID.hxx | 40 +++++++++++++++++++++++++++ include/svx/annotation/Annotation.hxx | 9 ++---- include/svx/svdpage.hxx | 3 ++ sd/qa/unit/AnnotationTest.cxx | 32 ++++++++++----------- sd/source/ui/unoidl/unomodel.cxx | 4 +-- svx/source/annotation/Annotation.cxx | 6 +--- 6 files changed, 65 insertions(+), 29 deletions(-) create mode 100644 include/svx/UniqueID.hxx diff --git a/include/svx/UniqueID.hxx b/include/svx/UniqueID.hxx new file mode 100644 index 000000000000..a693d53eec9e --- /dev/null +++ b/include/svx/UniqueID.hxx @@ -0,0 +1,40 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-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/. + */ + +#pragma once + +#include +#include + +/** Unique ID for an object. + * + * Generates an unique ID and stores it in a member variable, so the ID returned + * by getId() is the same as long as the object is alive. + * + * ID 0 means the ID is not yet created, so 0 is not a valid ID + * + */ +class UniqueID final +{ +private: + sal_uInt64 mnID = 0; + +public: + sal_uInt64 getID() const + { + if (!mnID) + { + static std::atomic staticCounter(1); + const_cast(this)->mnID = staticCounter.fetch_add(1); + } + return mnID; + } +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/svx/annotation/Annotation.hxx b/include/svx/annotation/Annotation.hxx index d7e4842f534c..491bbbfd0c6f 100644 --- a/include/svx/annotation/Annotation.hxx +++ b/include/svx/annotation/Annotation.hxx @@ -21,6 +21,7 @@ #include #include #include +#include #include class SdrUndoAction; @@ -102,13 +103,9 @@ class SVXCORE_DLLPUBLIC Annotation : public ::comphelper::WeakComponentImplHelper, public ::cppu::PropertySetMixin { -private: - static sal_uInt32 m_nLastId; - static sal_uInt32 nextID() { return m_nLastId++; } - protected: SdrPage* mpPage; - sal_uInt32 m_nId; + UniqueID maUniqueID; css::geometry::RealPoint2D m_Position; css::geometry::RealSize2D m_Size; @@ -170,7 +167,7 @@ public: SdrPage* getPage() { return mpPage; } // Unique ID of the annotation - sal_uInt32 GetId() const { return m_nId; } + sal_uInt64 GetId() const { return maUniqueID.getID(); } CreationInfo const& getCreationInfo() { return maCreationInfo; } void setCreationInfo(CreationInfo const& rCreationInfo) { maCreationInfo = rCreationInfo; } diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx index d6e68943e0ac..e38a9160bb00 100644 --- a/include/svx/svdpage.hxx +++ b/include/svx/svdpage.hxx @@ -35,6 +35,7 @@ #include #include #include +#include // predefines namespace model { class Theme; } @@ -431,6 +432,7 @@ private: sal_Int32 mnBorderUpper; // top page margin sal_Int32 mnBorderRight; // right page margin sal_Int32 mnBorderLower; // bottom page margin + UniqueID maUniqueID; bool mbBackgroundFullSize = false; ///< Background object to represent the whole page. std::unique_ptr mpLayerAdmin; @@ -502,6 +504,7 @@ public: sal_Int32 GetUpperBorder() const; sal_Int32 GetRightBorder() const; sal_Int32 GetLowerBorder() const; + sal_uInt64 GetUniqueID() const { return maUniqueID.getID(); } void SetBackgroundFullSize(bool bIn); bool IsBackgroundFullSize() const; diff --git a/sd/qa/unit/AnnotationTest.cxx b/sd/qa/unit/AnnotationTest.cxx index 97b61634e556..b4c80f51081e 100644 --- a/sd/qa/unit/AnnotationTest.cxx +++ b/sd/qa/unit/AnnotationTest.cxx @@ -125,12 +125,12 @@ CPPUNIT_TEST_FIXTURE(AnnotationTest, testAnnotationDelete) CPPUNIT_ASSERT_EQUAL(size_t(3), pPage->GetObjCount()); - sal_uInt32 nID = pPage->getAnnotations().front()->GetId(); + sal_uInt64 nID = pPage->getAnnotations().front()->GetId(); CPPUNIT_ASSERT_EQUAL(size_t(3), pPage->getAnnotations().size()); - CPPUNIT_ASSERT_EQUAL(sal_uInt32(nID + 0), pPage->getAnnotations().at(0)->GetId()); - CPPUNIT_ASSERT_EQUAL(sal_uInt32(nID + 1), pPage->getAnnotations().at(1)->GetId()); - CPPUNIT_ASSERT_EQUAL(sal_uInt32(nID + 2), pPage->getAnnotations().at(2)->GetId()); + CPPUNIT_ASSERT_EQUAL(sal_uInt64(nID + 0), pPage->getAnnotations().at(0)->GetId()); + CPPUNIT_ASSERT_EQUAL(sal_uInt64(nID + 1), pPage->getAnnotations().at(1)->GetId()); + CPPUNIT_ASSERT_EQUAL(sal_uInt64(nID + 2), pPage->getAnnotations().at(2)->GetId()); auto xAnnotation = pPage->getAnnotations().at(1); @@ -143,8 +143,8 @@ CPPUNIT_TEST_FIXTURE(AnnotationTest, testAnnotationDelete) CPPUNIT_ASSERT_EQUAL(size_t(2), pPage->GetObjCount()); CPPUNIT_ASSERT_EQUAL(size_t(2), pPage->getAnnotations().size()); - CPPUNIT_ASSERT_EQUAL(sal_uInt32(nID + 0), pPage->getAnnotations().at(0)->GetId()); - CPPUNIT_ASSERT_EQUAL(sal_uInt32(nID + 2), pPage->getAnnotations().at(1)->GetId()); + CPPUNIT_ASSERT_EQUAL(sal_uInt64(nID + 0), pPage->getAnnotations().at(0)->GetId()); + CPPUNIT_ASSERT_EQUAL(sal_uInt64(nID + 2), pPage->getAnnotations().at(1)->GetId()); } CPPUNIT_TEST_FIXTURE(AnnotationTest, testAnnotationInsertUndoRedo) @@ -165,34 +165,34 @@ CPPUNIT_TEST_FIXTURE(AnnotationTest, testAnnotationInsertUndoRedo) SdrObject* pObject = pPage->GetObj(0); CPPUNIT_ASSERT_EQUAL(SdrObjKind::Annotation, pObject->GetObjIdentifier()); - sal_uInt32 nID = pPage->getAnnotations().front()->GetId(); + sal_uInt64 nID = pPage->getAnnotations().front()->GetId(); - CPPUNIT_ASSERT_EQUAL(sal_uInt32(nID + 0), pPage->getAnnotations().at(0)->GetId()); - CPPUNIT_ASSERT_EQUAL(sal_uInt32(nID + 1), pPage->getAnnotations().at(1)->GetId()); + CPPUNIT_ASSERT_EQUAL(sal_uInt64(nID + 0), pPage->getAnnotations().at(0)->GetId()); + CPPUNIT_ASSERT_EQUAL(sal_uInt64(nID + 1), pPage->getAnnotations().at(1)->GetId()); dispatchCommand(mxComponent, u".uno:Undo"_ustr, {}); CPPUNIT_ASSERT_EQUAL(size_t(1), pPage->GetObjCount()); CPPUNIT_ASSERT_EQUAL(size_t(1), pPage->getAnnotations().size()); - CPPUNIT_ASSERT_EQUAL(sal_uInt32(nID + 0), pPage->getAnnotations().at(0)->GetId()); + CPPUNIT_ASSERT_EQUAL(sal_uInt64(nID + 0), pPage->getAnnotations().at(0)->GetId()); dispatchCommand(mxComponent, u".uno:Redo"_ustr, {}); CPPUNIT_ASSERT_EQUAL(size_t(2), pPage->GetObjCount()); CPPUNIT_ASSERT_EQUAL(size_t(2), pPage->getAnnotations().size()); - CPPUNIT_ASSERT_EQUAL(sal_uInt32(nID + 0), pPage->getAnnotations().at(0)->GetId()); - CPPUNIT_ASSERT_EQUAL(sal_uInt32(nID + 1), pPage->getAnnotations().at(1)->GetId()); + CPPUNIT_ASSERT_EQUAL(sal_uInt64(nID + 0), pPage->getAnnotations().at(0)->GetId()); + CPPUNIT_ASSERT_EQUAL(sal_uInt64(nID + 1), pPage->getAnnotations().at(1)->GetId()); dispatchCommand(mxComponent, u".uno:DeleteAnnotation"_ustr, {}); Scheduler::ProcessEventsToIdle(); CPPUNIT_ASSERT_EQUAL(size_t(1), pPage->GetObjCount()); CPPUNIT_ASSERT_EQUAL(size_t(1), pPage->getAnnotations().size()); - CPPUNIT_ASSERT_EQUAL(sal_uInt32(nID + 0), pPage->getAnnotations().at(0)->GetId()); + CPPUNIT_ASSERT_EQUAL(sal_uInt64(nID + 0), pPage->getAnnotations().at(0)->GetId()); dispatchCommand(mxComponent, u".uno:Undo"_ustr, {}); Scheduler::ProcessEventsToIdle(); CPPUNIT_ASSERT_EQUAL(size_t(2), pPage->GetObjCount()); CPPUNIT_ASSERT_EQUAL(size_t(2), pPage->getAnnotations().size()); - CPPUNIT_ASSERT_EQUAL(sal_uInt32(nID + 0), pPage->getAnnotations().at(0)->GetId()); - CPPUNIT_ASSERT_EQUAL(sal_uInt32(nID + 1), pPage->getAnnotations().at(1)->GetId()); + CPPUNIT_ASSERT_EQUAL(sal_uInt64(nID + 0), pPage->getAnnotations().at(0)->GetId()); + CPPUNIT_ASSERT_EQUAL(sal_uInt64(nID + 1), pPage->getAnnotations().at(1)->GetId()); } CPPUNIT_TEST_FIXTURE(AnnotationTest, testAnnotationPositionUpdate) @@ -224,7 +224,7 @@ CPPUNIT_TEST_FIXTURE(AnnotationTest, testAnnotationPositionUpdate) CPPUNIT_ASSERT(pAnnotationData); // Remember the annotation ID - sal_Int32 nID = pAnnotationData->mxAnnotation->GetId(); + sal_uInt64 nID = pAnnotationData->mxAnnotation->GetId(); // Current annotation position CPPUNIT_ASSERT_EQUAL(tools::Long(0), pObject->GetLogicRect().Left()); diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 96a4e1c07100..b2bd3cd2f235 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -2485,7 +2485,7 @@ OUString SdXImpressDocument::getPartHash(int nPart) return OUString(); } - return OUString::number(pPage->GetHashCode()); + return OUString::number(pPage->GetUniqueID()); } bool SdXImpressDocument::isMasterViewMode() @@ -2596,7 +2596,7 @@ void SdXImpressDocument::getPostIts(::tools::JsonWriter& rJsonWriter) rJsonWriter.put("dateTime", utl::toISO8601(xAnnotation->getDateTime())); uno::Reference xText(xAnnotation->getTextRange()); rJsonWriter.put("text", xText->getString()); - rJsonWriter.put("parthash", pPage->GetHashCode()); + rJsonWriter.put("parthash", pPage->GetUniqueID()); geometry::RealPoint2D const & rPoint = xAnnotation->getPosition(); geometry::RealSize2D const & rSize = xAnnotation->getSize(); ::tools::Rectangle aRectangle(Point(rPoint.X * 100.0, rPoint.Y * 100.0), Size(rSize.Width * 100.0, rSize.Height * 100.0)); diff --git a/svx/source/annotation/Annotation.cxx b/svx/source/annotation/Annotation.cxx index bc6cc45324e4..8dfddb57b100 100644 --- a/svx/source/annotation/Annotation.cxx +++ b/svx/source/annotation/Annotation.cxx @@ -44,8 +44,7 @@ OString lcl_LOKGetCommentPayload(CommentNotificationType nType, Annotation& rAnn aJsonWriter.put("dateTime", utl::toISO8601(rAnnotation.GetDateTime())); aJsonWriter.put("text", rAnnotation.GetText()); SdrPage const* pPage = rAnnotation.getPage(); - sal_Int64 nHash = sal::static_int_cast(reinterpret_cast(pPage)); - aJsonWriter.put("parthash", pPage ? OString::number(nHash) : OString()); + aJsonWriter.put("parthash", pPage ? OString::number(pPage->GetUniqueID()) : OString()); geometry::RealPoint2D const& rPoint = rAnnotation.GetPosition(); geometry::RealSize2D const& rSize = rAnnotation.GetSize(); tools::Rectangle aRectangle( @@ -144,12 +143,9 @@ Annotation::Annotation(const css::uno::Reference& r : cppu::PropertySetMixin(rxContext, IMPLEMENTS_PROPERTY_SET, uno::Sequence()) , mpPage(pPage) - , m_nId(nextID()) { } -sal_uInt32 Annotation::m_nLastId = 1; - SdrModel* Annotation::GetModel() const { return mpPage != nullptr ? &mpPage->getSdrModelFromSdrPage() : nullptr; From 7aba05331b0e14d3ce2c811a4dc18d4714a7a575 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Fri, 5 Jul 2024 21:20:01 +0200 Subject: [PATCH 160/232] DBTestBase: call close at tearDown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Otherwise, calling different tests one after the other will fail with warn:vcl:994718:994718:vcl/source/app/svmain.cxx:497: DeInitVCL: some top Windows are still alive text = "lu9947181i0ytl.tmp — LibreOfficeDev Base" type = "10WorkWindow", ptr = 0x555b3ab76810 Change-Id: I6124b768e165ed841738d29c6071e7950b58229f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170058 Reviewed-by: Xisco Fauli Tested-by: Jenkins --- dbaccess/qa/unit/dbtest_base.cxx | 15 +++++++++++++++ dbaccess/qa/unit/firebird.cxx | 10 ---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/dbaccess/qa/unit/dbtest_base.cxx b/dbaccess/qa/unit/dbtest_base.cxx index 9c1dd32973eb..0208649906ad 100644 --- a/dbaccess/qa/unit/dbtest_base.cxx +++ b/dbaccess/qa/unit/dbtest_base.cxx @@ -21,6 +21,7 @@ #include #include #include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::beans; @@ -45,6 +46,8 @@ public: void createQueries(Reference< XDataSource > xDataSource); void createQuery(OUString sQuery, bool bEscapeProcessing, OUString sQueryName, Reference xDataSource); + + virtual void tearDown() override; }; uno::Reference DBTestBase::getDocumentForUrl(OUString const & url) { @@ -178,4 +181,16 @@ void DBTestBase::createQuery(OUString sQuery, bool bEscapeProcessing, OUString s xNameContainer->insertByName(sQueryName, Any(xQueryProp)); } +void DBTestBase::tearDown() +{ + if (mxComponent) + { + // In order to close all windows + css::uno::Reference xCloseable(mxComponent, css::uno::UNO_QUERY_THROW); + xCloseable->close(false); + } + + UnoApiTest::tearDown(); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/dbaccess/qa/unit/firebird.cxx b/dbaccess/qa/unit/firebird.cxx index 089f152ee2d5..5f2f4077125e 100644 --- a/dbaccess/qa/unit/firebird.cxx +++ b/dbaccess/qa/unit/firebird.cxx @@ -15,7 +15,6 @@ #include #include #include -#include using namespace ::com::sun::star; using namespace ::com::sun::star::sdb; @@ -48,9 +47,6 @@ void FirebirdTest::testEmptyDBConnection() getDocumentForUrl(maTempFile.GetURL()); getConnectionForDocument(xDocument); - - css::uno::Reference xCloseable(mxComponent, css::uno::UNO_QUERY_THROW); - xCloseable->close(false); } /** @@ -90,9 +86,6 @@ void FirebirdTest::testIntegerDatabase() xRow->getString(xColumnLocate->findColumn(u"_VARCHAR"_ustr))); CPPUNIT_ASSERT(!xResultSet->next()); // Should only be one row - - css::uno::Reference xCloseable(mxComponent, css::uno::UNO_QUERY_THROW); - xCloseable->close(false); } void FirebirdTest::testTdf132924() @@ -118,9 +111,6 @@ void FirebirdTest::testTdf132924() // - Actual : The column name 'TestId' is not valid CPPUNIT_ASSERT_EQUAL(sal_Int16(1), xRow->getShort(xColumnLocate->findColumn(u"TestId"_ustr))); CPPUNIT_ASSERT_EQUAL(u"TestName"_ustr, xRow->getString(xColumnLocate->findColumn(u"TestName"_ustr))); - - css::uno::Reference xCloseable(mxComponent, css::uno::UNO_QUERY_THROW); - xCloseable->close(false); } CPPUNIT_TEST_SUITE_REGISTRATION(FirebirdTest); From ae2235ccf0663329f0ef69432298b71424a4217b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 5 Jul 2024 20:30:19 +0200 Subject: [PATCH 161/232] use o3tl::sorted_vector in DefaultItemInstanceManager Change-Id: I16426008dd8983d56a49b3334b3f163ec350be0e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170057 Tested-by: Jenkins Reviewed-by: Noel Grandin --- svl/source/items/globalpool.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/svl/source/items/globalpool.cxx b/svl/source/items/globalpool.cxx index 313db586a566..32ca159fe7a7 100644 --- a/svl/source/items/globalpool.cxx +++ b/svl/source/items/globalpool.cxx @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -102,7 +103,9 @@ struct ItemInstanceManager // that specific Item (see other derivations) struct DefaultItemInstanceManager : public ItemInstanceManager { - std::unordered_set maRegistered; + // This workload is very read-heavy, and we want to scan the candidates often, so + // a vector-based data structure is faster. + o3tl::sorted_vector maRegistered; virtual const SfxPoolItem* find(const SfxPoolItem& rItem) const override { From 1d4cecf2f37cd0de9e8e4bcf0c163799e9bca3f3 Mon Sep 17 00:00:00 2001 From: Peter Hagen Date: Fri, 5 Jul 2024 14:10:11 -0400 Subject: [PATCH 162/232] Related tdf#161461: break out of loop once data flavor is set Change-Id: Ia56514e83e09c6747f582117e77de89f69495862 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170034 Reviewed-by: Patrick Luby Reviewed-by: Andras Timar Tested-by: Jenkins --- vcl/ios/DataFlavorMapping.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vcl/ios/DataFlavorMapping.cxx b/vcl/ios/DataFlavorMapping.cxx index 607f110222bb..ded47097015c 100644 --- a/vcl/ios/DataFlavorMapping.cxx +++ b/vcl/ios/DataFlavorMapping.cxx @@ -404,6 +404,10 @@ NSString* DataFlavorMapper::openOfficeToSystemFlavor(const DataFlavor& oOOFlavor else sysFlavor = OUStringToNSString(oOOFlavor.MimeType); } + + // Flavor set, then break + if (sysFlavor != nullptr) + break; } if (!sysFlavor) From 5b57fe250108a9ea30b87e40e306af8a79043354 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Vajngerl?= Date: Sun, 31 Mar 2024 00:07:58 +0900 Subject: [PATCH 163/232] vcl: clean-up and refactor GraphicFilter::ImportUnloadedGraphic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove code duplication - Z decompress with a helper function. - Split up the code to make it better readable. - Default status to ERRCODE_GRFILTER_FILTERERROR and only return ERRCODE_NONE on success. Change-Id: I27c1ba6198120c66d5348702a6af1ffbfa7c5031 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166274 Reviewed-by: Tomaž Vajngerl Tested-by: Jenkins --- vcl/source/filter/graphicfilter.cxx | 297 ++++++++++++++-------------- 1 file changed, 144 insertions(+), 153 deletions(-) diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index e4a9f97f3188..5a240aafd842 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -710,20 +710,143 @@ void GraphicFilter::MakeGraphicsAvailableThreaded(std::vector& graphic } } +namespace +{ + +BinaryDataContainer insertContentOrDecompressFromZ(SvStream& rStream, sal_uInt32 nStreamLength) +{ + BinaryDataContainer aGraphicContent; + + if (ZCodec::IsZCompressed(rStream)) + { + ZCodec aCodec; + SvMemoryStream aMemStream; + tools::Long nMemoryLength; + aCodec.BeginCompression(ZCODEC_DEFAULT_COMPRESSION, /*gzLib*/true); + nMemoryLength = aCodec.Decompress(rStream, aMemStream); + aCodec.EndCompression(); + + if (rStream.good() && nMemoryLength >= 0) + { + aMemStream.Seek(STREAM_SEEK_TO_BEGIN); + aGraphicContent = BinaryDataContainer(aMemStream, nMemoryLength); + } + } + else + { + aGraphicContent = BinaryDataContainer(rStream, nStreamLength); + } + return aGraphicContent; +} + + +ErrCode prepareImageTypeAndData(SvStream& rStream, sal_uInt32 nStreamLength, BinaryDataContainer& rGraphicContent, std::u16string_view rFilterName, GfxLinkType& rLinkType) +{ + const sal_uInt64 nStreamBegin = rStream.Tell(); + ErrCode nStatus = ERRCODE_GRFILTER_FILTERERROR; + + if (o3tl::equalsIgnoreAsciiCase(rFilterName, IMP_GIF)) + { + rLinkType = GfxLinkType::NativeGif; + nStatus = ERRCODE_NONE; + } + else if (o3tl::equalsIgnoreAsciiCase(rFilterName, IMP_PNG)) + { + // check if this PNG contains a GIF chunk! + rGraphicContent = vcl::PngImageReader::getMicrosoftGifChunk(rStream); + if (!rGraphicContent.isEmpty()) + rLinkType = GfxLinkType::NativeGif; + else + rLinkType = GfxLinkType::NativePng; + nStatus = ERRCODE_NONE; + } + else if (o3tl::equalsIgnoreAsciiCase(rFilterName, IMP_JPEG)) + { + rLinkType = GfxLinkType::NativeJpg; + nStatus = ERRCODE_NONE; + } + else if (o3tl::equalsIgnoreAsciiCase(rFilterName, IMP_SVG)) + { + rStream.Seek(nStreamBegin); + rGraphicContent = insertContentOrDecompressFromZ(rStream, nStreamLength); + if (rStream.good()) + { + rLinkType = GfxLinkType::NativeSvg; + nStatus = ERRCODE_NONE; + } + } + else if (o3tl::equalsIgnoreAsciiCase(rFilterName, IMP_BMP)) + { + rLinkType = GfxLinkType::NativeBmp; + nStatus = ERRCODE_NONE; + } + else if (o3tl::equalsIgnoreAsciiCase(rFilterName, IMP_MOV)) + { + rLinkType = GfxLinkType::NativeMov; + nStatus = ERRCODE_NONE; + } + else if (o3tl::equalsIgnoreAsciiCase(rFilterName, IMP_WMF) || + o3tl::equalsIgnoreAsciiCase(rFilterName, IMP_EMF) || + o3tl::equalsIgnoreAsciiCase(rFilterName, IMP_WMZ) || + o3tl::equalsIgnoreAsciiCase(rFilterName, IMP_EMZ)) + { + rStream.Seek(nStreamBegin); + rGraphicContent = insertContentOrDecompressFromZ(rStream, nStreamLength); + if (rStream.good()) + { + rLinkType = GfxLinkType::NativeWmf; + nStatus = ERRCODE_NONE; + } + } + else if (o3tl::equalsIgnoreAsciiCase(rFilterName, IMP_PDF)) + { + rLinkType = GfxLinkType::NativePdf; + nStatus = ERRCODE_NONE; + } + else if (o3tl::equalsIgnoreAsciiCase(rFilterName, IMP_TIFF)) + { + rLinkType = GfxLinkType::NativeTif; + nStatus = ERRCODE_NONE; + } + else if (o3tl::equalsIgnoreAsciiCase(rFilterName, IMP_PICT)) + { + rLinkType = GfxLinkType::NativePct; + nStatus = ERRCODE_NONE; + } + else if (o3tl::equalsIgnoreAsciiCase(rFilterName, IMP_MET)) + { + rLinkType = GfxLinkType::NativeMet; + nStatus = ERRCODE_NONE; + } + else if (o3tl::equalsIgnoreAsciiCase(rFilterName, IMP_WEBP)) + { + if (supportNativeWebp()) + { + rLinkType = GfxLinkType::NativeWebp; + nStatus = ERRCODE_NONE; + } + } + + return nStatus; +} + +} // end anonymous namespace + Graphic GraphicFilter::ImportUnloadedGraphic(SvStream& rIStream, sal_uInt64 sizeLimit, const Size* pSizeHint) { Graphic aGraphic; sal_uInt16 nFormat = GRFILTER_FORMAT_DONTKNOW; - GfxLinkType eLinkType = GfxLinkType::NONE; ResetLastError(); const sal_uInt64 nStreamBegin = rIStream.Tell(); + // Get the image format rIStream.Seek(nStreamBegin); - ErrCode nStatus = ImpTestOrFindFormat(u"", rIStream, nFormat); + if (nStatus != ERRCODE_NONE) + return aGraphic; rIStream.Seek(nStreamBegin); sal_uInt32 nStreamLength(rIStream.remainingSize()); @@ -732,175 +855,42 @@ Graphic GraphicFilter::ImportUnloadedGraphic(SvStream& rIStream, sal_uInt64 size OUString aFilterName = pConfig->GetImportFilterName(nFormat); - BinaryDataContainer aGraphicContent; + BinaryDataContainer aBinaryDataContainer; - // read graphic - { - if (aFilterName.equalsIgnoreAsciiCase(IMP_GIF)) - { - eLinkType = GfxLinkType::NativeGif; - } - else if (aFilterName.equalsIgnoreAsciiCase(IMP_PNG)) - { - // check if this PNG contains a GIF chunk! - aGraphicContent = vcl::PngImageReader::getMicrosoftGifChunk(rIStream); - if (!aGraphicContent.isEmpty()) - eLinkType = GfxLinkType::NativeGif; - else - eLinkType = GfxLinkType::NativePng; - } - else if (aFilterName.equalsIgnoreAsciiCase(IMP_JPEG)) - { - eLinkType = GfxLinkType::NativeJpg; - } - else if (aFilterName.equalsIgnoreAsciiCase(IMP_SVG)) - { - bool bOkay(false); - - if (nStreamLength > 0) - { - std::vector aTwoBytes(2); - rIStream.ReadBytes(aTwoBytes.data(), 2); - rIStream.Seek(nStreamBegin); - - if (aTwoBytes[0] == 0x1F && aTwoBytes[1] == 0x8B) - { - SvMemoryStream aMemStream; - ZCodec aCodec; - tools::Long nMemoryLength; - - aCodec.BeginCompression(ZCODEC_DEFAULT_COMPRESSION, /*gzLib*/true); - nMemoryLength = aCodec.Decompress(rIStream, aMemStream); - aCodec.EndCompression(); - - if (!rIStream.GetError() && nMemoryLength >= 0) - { - aMemStream.Seek(STREAM_SEEK_TO_BEGIN); - aGraphicContent = BinaryDataContainer(aMemStream, nMemoryLength); - - bOkay = true; - } - } - else - { - aGraphicContent = BinaryDataContainer(rIStream, nStreamLength); - - bOkay = true; - } - } - - if (bOkay) - { - eLinkType = GfxLinkType::NativeSvg; - } - else - { - nStatus = ERRCODE_GRFILTER_FILTERERROR; - } - } - else if (aFilterName.equalsIgnoreAsciiCase(IMP_BMP)) - { - eLinkType = GfxLinkType::NativeBmp; - } - else if (aFilterName.equalsIgnoreAsciiCase(IMP_MOV)) - { - eLinkType = GfxLinkType::NativeMov; - } - else if (aFilterName.equalsIgnoreAsciiCase(IMP_WMF) || - aFilterName.equalsIgnoreAsciiCase(IMP_EMF) || - aFilterName.equalsIgnoreAsciiCase(IMP_WMZ) || - aFilterName.equalsIgnoreAsciiCase(IMP_EMZ)) - { - rIStream.Seek(nStreamBegin); - if (ZCodec::IsZCompressed(rIStream)) - { - ZCodec aCodec; - SvMemoryStream aMemStream; - tools::Long nMemoryLength; - aCodec.BeginCompression(ZCODEC_DEFAULT_COMPRESSION, /*gzLib*/true); - nMemoryLength = aCodec.Decompress(rIStream, aMemStream); - aCodec.EndCompression(); - - if (!rIStream.GetError() && nMemoryLength >= 0) - { - aMemStream.Seek(STREAM_SEEK_TO_BEGIN); - aGraphicContent = BinaryDataContainer(aMemStream, nMemoryLength); - } - } - else - { - aGraphicContent = BinaryDataContainer(rIStream, nStreamLength); - } - if (!rIStream.GetError()) - { - eLinkType = GfxLinkType::NativeWmf; - } - else - { - nStatus = ERRCODE_GRFILTER_FILTERERROR; - } - } - else if (aFilterName == IMP_PDF) - { - eLinkType = GfxLinkType::NativePdf; - } - else if (aFilterName == IMP_TIFF) - { - eLinkType = GfxLinkType::NativeTif; - } - else if (aFilterName == IMP_PICT) - { - eLinkType = GfxLinkType::NativePct; - } - else if (aFilterName == IMP_MET) - { - eLinkType = GfxLinkType::NativeMet; - } - else if (aFilterName.equalsIgnoreAsciiCase(IMP_WEBP)) - { - if(supportNativeWebp()) - eLinkType = GfxLinkType::NativeWebp; - else - nStatus = ERRCODE_GRFILTER_FILTERERROR; - } - else - { - nStatus = ERRCODE_GRFILTER_FILTERERROR; - } - } + GfxLinkType eLinkType = GfxLinkType::NONE; + rIStream.Seek(nStreamBegin); + nStatus = prepareImageTypeAndData(rIStream, nStreamLength, aBinaryDataContainer, aFilterName, eLinkType); if (nStatus == ERRCODE_NONE && eLinkType != GfxLinkType::NONE) { - if (aGraphicContent.isEmpty()) + if (aBinaryDataContainer.isEmpty() && nStreamLength > 0) { - if (nStreamLength > 0) + try { - try - { - rIStream.Seek(nStreamBegin); - aGraphicContent = BinaryDataContainer(rIStream, nStreamLength); - } - catch (const std::bad_alloc&) - { - nStatus = ERRCODE_GRFILTER_TOOBIG; - } + rIStream.Seek(nStreamBegin); + aBinaryDataContainer = BinaryDataContainer(rIStream, nStreamLength); + } + catch (const std::bad_alloc&) + { + nStatus = ERRCODE_GRFILTER_TOOBIG; } } - if( nStatus == ERRCODE_NONE ) + if (nStatus == ERRCODE_NONE) { bool bAnimated = false; - Size aLogicSize; - if (eLinkType == GfxLinkType::NativeGif && !aGraphicContent.isEmpty()) + if (eLinkType == GfxLinkType::NativeGif && !aBinaryDataContainer.isEmpty()) { - std::shared_ptr pMemoryStream = aGraphicContent.getAsStream(); + std::shared_ptr pMemoryStream = aBinaryDataContainer.getAsStream(); + Size aLogicSize; bAnimated = IsGIFAnimated(*pMemoryStream, aLogicSize); if (!pSizeHint && aLogicSize.getWidth() && aLogicSize.getHeight()) { pSizeHint = &aLogicSize; } } - aGraphic.SetGfxLink(std::make_shared(aGraphicContent, eLinkType)); + + aGraphic.SetGfxLink(std::make_shared(aBinaryDataContainer, eLinkType)); aGraphic.ImplGetImpGraphic()->setPrepared(bAnimated, pSizeHint); } } @@ -908,6 +898,7 @@ Graphic GraphicFilter::ImportUnloadedGraphic(SvStream& rIStream, sal_uInt64 size // Set error code or try to set native buffer if (nStatus != ERRCODE_NONE) ImplSetError(nStatus, &rIStream); + if (nStatus != ERRCODE_NONE || eLinkType == GfxLinkType::NONE) rIStream.Seek(nStreamBegin); From dc97b366ab9ce3d38c84da06b8b37131579f87f3 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Sat, 6 Jul 2024 14:48:52 +0200 Subject: [PATCH 164/232] python3: silence distutils deprecated warning Since a1295cb177295752f8cbfbb49e13d5bb69ed7dc7 "python: upgrade to 3.10.14 (master only)" Some builds started to fail with Traceback (most recent call last): File "/home/tdf/lode/jenkins/workspace/lo_callgrind_linux/workdir/UnpackedTarball/lxml/setup.py", line 15, in from setuptools import setup ModuleNotFoundError: No module named 'setuptools' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/tdf/lode/jenkins/workspace/lo_callgrind_linux/workdir/UnpackedTarball/lxml/setup.py", line 17, in from distutils.core import setup File "/home/tdf/lode/jenkins/workspace/lo_callgrind_linux/instdir/program/python-core-3.10.14/lib/distutils/__init__.py", line 19, in warnings.warn(_DEPRECATION_MESSAGE, DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives make[1]: *** [/home/tdf/lode/jenkins/workspace/lo_callgrind_linux/external/lxml/ExternalProject_lxml.mk:26: /home/tdf/lode/jenkins/workspace/lo_callgrind_linux/workdir/ExternalProject/lxml/build] Error 1 The problem is that python 3.10 doesn't bundle setuptools so it's not possible to replace it at the moment Change-Id: I9a9d077b51f49e912dab4941efe8751c2fcc76e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170068 Reviewed-by: Xisco Fauli Tested-by: Jenkins --- external/python3/UnpackedTarball_python3.mk | 1 + external/python3/distutils_deprecated.patch.0 | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 external/python3/distutils_deprecated.patch.0 diff --git a/external/python3/UnpackedTarball_python3.mk b/external/python3/UnpackedTarball_python3.mk index 4e522715afc2..9c766c26dda4 100644 --- a/external/python3/UnpackedTarball_python3.mk +++ b/external/python3/UnpackedTarball_python3.mk @@ -22,6 +22,7 @@ $(eval $(call gb_UnpackedTarball_set_patchflags,python3,--binary)) endif $(eval $(call gb_UnpackedTarball_add_patches,python3,\ + external/python3/distutils_deprecated.patch.0 \ external/python3/i100492-freebsd.patch.1 \ external/python3/python-3.3.0-darwin.patch.1 \ external/python3/python-3.8-msvc-libffi.patch.1 \ diff --git a/external/python3/distutils_deprecated.patch.0 b/external/python3/distutils_deprecated.patch.0 new file mode 100644 index 000000000000..8affb17544d3 --- /dev/null +++ b/external/python3/distutils_deprecated.patch.0 @@ -0,0 +1,17 @@ +--- Lib/distutils/__init__.py 2024-07-06 14:41:11.881840873 +0200 ++++ Lib/distutils/__init__.py 2024-07-06 14:41:31.725586707 +0200 +@@ -7,14 +7,3 @@ + + setup (...) + """ +- +-import sys +-import warnings +- +-__version__ = sys.version[:sys.version.index(' ')] +- +-_DEPRECATION_MESSAGE = ("The distutils package is deprecated and slated for " +- "removal in Python 3.12. Use setuptools or check " +- "PEP 632 for potential alternatives") +-warnings.warn(_DEPRECATION_MESSAGE, +- DeprecationWarning, 2) From f41773d684dfb1bfebe484bbf6d1ec4b5937d348 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Sat, 6 Jul 2024 18:07:32 +0200 Subject: [PATCH 165/232] python3: silence distutils deprecated warning (take 2) Since a1295cb177295752f8cbfbb49e13d5bb69ed7dc7 "python: upgrade to 3.10.14 (master only)" Now it fails with Traceback (most recent call last): File "/home/tdf/lode/jenkins/workspace/lo_callgrind_linux/workdir/UnpackedTarball/lxml/setup.py", line 23, in import setupinfo File "/home/tdf/lode/jenkins/workspace/lo_callgrind_linux/workdir/UnpackedTarball/lxml/setupinfo.py", line 7, in from distutils.command.build_ext import build_ext as _build_ext File "/home/tdf/lode/jenkins/workspace/lo_callgrind_linux/instdir/program/python-core-3.10.14/lib/distutils/command/build_ext.py", line 13, in from distutils.sysconfig import customize_compiler, get_python_version File "/home/tdf/lode/jenkins/workspace/lo_callgrind_linux/instdir/program/python-core-3.10.14/lib/distutils/sysconfig.py", line 58, in warnings.warn( DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead make[1]: *** [/home/tdf/lode/jenkins/workspace/lo_callgrind_linux/external/lxml/ExternalProject_lxml.mk:26: /home/tdf/lode/jenkins/workspace/lo_callgrind_linux/workdir/ExternalProject/lxml/build] Error 1 Change-Id: I9000018390b31a65a30ef87d0c500872fc6c9343 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170069 Tested-by: Xisco Fauli Reviewed-by: Xisco Fauli --- external/python3/distutils_deprecated.patch.0 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/external/python3/distutils_deprecated.patch.0 b/external/python3/distutils_deprecated.patch.0 index 8affb17544d3..2e9666245ff1 100644 --- a/external/python3/distutils_deprecated.patch.0 +++ b/external/python3/distutils_deprecated.patch.0 @@ -15,3 +15,19 @@ - "PEP 632 for potential alternatives") -warnings.warn(_DEPRECATION_MESSAGE, - DeprecationWarning, 2) +--- Lib/distutils/sysconfig.py 2024-07-06 18:03:30.397986006 +0200 ++++ Lib/distutils/sysconfig.py 2024-07-06 18:03:58.637312653 +0200 +@@ -55,13 +55,6 @@ + if os.name == "nt": + from sysconfig import _fix_pcbuild + +-warnings.warn( +- 'The distutils.sysconfig module is deprecated, use sysconfig instead', +- DeprecationWarning, +- stacklevel=2 +-) +- +- + # Following functions are the same as in sysconfig but with different API + def parse_config_h(fp, g=None): + return sysconfig_parse_config_h(fp, vars=g) From b988ab22f48e4fa118711740f19d0b208b674f36 Mon Sep 17 00:00:00 2001 From: Andrea Gelmini Date: Sat, 6 Jul 2024 12:29:09 +0200 Subject: [PATCH 166/232] Fix typo Change-Id: I5d2030f1057f0a2232680ed60f4312331eca2926 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170063 Tested-by: Julien Nabet Reviewed-by: Julien Nabet --- include/svx/UniqueID.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/svx/UniqueID.hxx b/include/svx/UniqueID.hxx index a693d53eec9e..91e4664b2d5a 100644 --- a/include/svx/UniqueID.hxx +++ b/include/svx/UniqueID.hxx @@ -14,7 +14,7 @@ /** Unique ID for an object. * - * Generates an unique ID and stores it in a member variable, so the ID returned + * Generates a unique ID and stores it in a member variable, so the ID returned * by getId() is the same as long as the object is alive. * * ID 0 means the ID is not yet created, so 0 is not a valid ID From 4889e0de067761c6e2f8ab661f26af39555ca10e Mon Sep 17 00:00:00 2001 From: Alain Romedenne Date: Sat, 6 Jul 2024 21:31:28 +0200 Subject: [PATCH 167/232] Update git submodules * Update helpcontent2 from branch 'master' to e859581bf5302296634127cd7bb6576f6e3ec932 - tdf#149786 tdf#161495 VBA objects & properties & methods (WiP) - ActiveSheet object - (Calc).ExportAsfixedFormat method This initiates a documentation help page intended to aggregate MSOffice VBA objects features that are currently supported. Change-Id: I679e9a64923b69fd0d1a5ac99d39651fd8353fc7 Reviewed-on: https://gerrit.libreoffice.org/c/help/+/168530 Tested-by: Jenkins Reviewed-by: Olivier Hallot Tested-by: Olivier Hallot --- helpcontent2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpcontent2 b/helpcontent2 index 5e39c70b9355..e859581bf530 160000 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit 5e39c70b93559a266ba9f68344fe8c4c3f2feacf +Subproject commit e859581bf5302296634127cd7bb6576f6e3ec932 From bc6215f80972a3b48a576edc3bd712a161b8217b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 5 Jul 2024 13:55:53 +0100 Subject: [PATCH 168/232] cid#1545593 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8252fcd741996b8019edd1fac63e27908fe362d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170019 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx index 38ecf00f5fb8..4af3f7224b3e 100644 --- a/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx +++ b/filter/source/xmlfilteradaptor/XmlFilterAdaptor.cxx @@ -98,9 +98,8 @@ bool XmlFilterAdaptor::importImpl( const Sequence< css::beans::PropertyValue >& if (It != aMediaMap.end() && (It->second >>= aFilterName) && aFilterName == "OpenDocument Text Flat XML") { - PropertyValue EmptyDbFieldHidesPara(u"EmptyDbFieldHidesPara"_ustr, 0, Any(false), - PropertyState::PropertyState_DIRECT_VALUE); - Sequence aSettings{ EmptyDbFieldHidesPara }; + Sequence aSettings{ PropertyValue(u"EmptyDbFieldHidesPara"_ustr, 0, + Any(false), PropertyState::PropertyState_DIRECT_VALUE) }; xInfoSet->setPropertyValue(u"DefaultDocumentSettings"_ustr, Any(aSettings)); } Sequence< Any > aAnys{ Any(xInfoSet) }; From 0faabc057096631d660725318716638695173298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 5 Jul 2024 13:57:43 +0100 Subject: [PATCH 169/232] cid#1555223 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I991ea6869a22476d793bf301183ccc984d411a49 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170020 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- vcl/source/gdi/print.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 06625a4227bd..b2f821613ba4 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -1335,7 +1335,7 @@ bool Printer::SetPaperSizeUser( const Size& rSize ) if ( IsDisplayPrinter() ) { mbNewJobSetup = true; - maJobSetup = aJobSetup; + maJobSetup = std::move(aJobSetup); return true; } @@ -1347,7 +1347,7 @@ bool Printer::SetPaperSizeUser( const Size& rSize ) { ImplUpdateJobSetupPaper( aJobSetup ); mbNewJobSetup = true; - maJobSetup = aJobSetup; + maJobSetup = std::move(aJobSetup); ImplUpdatePageData(); ImplUpdateFontList(); return true; From 1227e651bcf3e7adae49670bb849abd71c231b8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 5 Jul 2024 14:03:39 +0100 Subject: [PATCH 170/232] cid#1608554 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I466a68048496fa4f4aa8177621a6484a261d2069 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170021 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- chart2/source/controller/main/ChartController_Insert.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chart2/source/controller/main/ChartController_Insert.cxx b/chart2/source/controller/main/ChartController_Insert.cxx index d74ede874b36..787d094c8635 100644 --- a/chart2/source/controller/main/ChartController_Insert.cxx +++ b/chart2/source/controller/main/ChartController_Insert.cxx @@ -501,7 +501,8 @@ void ChartController::executeDispatch_InsertTrendline() // note: when a user pressed "OK" but didn't change any settings in the // dialog, the SfxTabDialog returns "Cancel" - SfxTabDialogController::runAsync(aDialog, [this, aDialog, aItemConverter, xUndoGuard=std::move(xUndoGuard)](int nResult) { + SfxTabDialogController::runAsync(aDialog, [this, aDialog, aItemConverter = std::move(aItemConverter), + xUndoGuard=std::move(xUndoGuard)](int nResult) { if ( nResult == RET_OK || aDialog->DialogWasClosedWithOK() ) { const SfxItemSet* pOutItemSet = aDialog->GetOutputItemSet(); From 9e8c9944b9e00e883597495a27f2f03d69016ce2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 5 Jul 2024 13:05:25 +0100 Subject: [PATCH 171/232] return early if there is no m_pDocShell MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Id53115f9cb098b9b8ff1a529f5237054cdfd391e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170014 Tested-by: Caolán McNamara Reviewed-by: Mike Kaganski Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170049 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- sw/source/uibase/uno/unotxdoc.cxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 83cf875c65b5..0b6b2ed53191 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3273,6 +3273,12 @@ void SwXTextDocument::setClipboard(const uno::ReferenceGetView(); if (pView) pView->GetEditWin().SetClipboard(xClipboard); From d6c58ec277ac9801d57428d23c99644915fdff41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 5 Jul 2024 14:06:13 +0100 Subject: [PATCH 172/232] cid#1609595 Dereference null return value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I6ae93f46c50e0fe4a29d03fdf02797f808d4d1c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170022 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- sd/source/ui/view/Outliner.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index ed0045b3c8a2..8f33f1edbde7 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -1845,13 +1845,13 @@ SdrObject* SdOutliner::SetObject ( if(rPosition.meEditMode == EditMode::Page && rPosition.mePageKind == PageKind::Notes) { std::shared_ptr pViewShell (mpWeakViewShell.lock()); - std::shared_ptr pDrawViewShell( - std::dynamic_pointer_cast(pViewShell)); - - if (pDrawViewShell->GetEditMode() != EditMode::Page - || pDrawViewShell->GetCurPagePos() != rPosition.mnPageIndex) - SetPage(EditMode::Page, static_cast(rPosition.mnPageIndex)); - + if (std::shared_ptr pDrawViewShell = + std::dynamic_pointer_cast(pViewShell)) + { + if (pDrawViewShell->GetEditMode() != EditMode::Page + || pDrawViewShell->GetCurPagePos() != rPosition.mnPageIndex) + SetPage(EditMode::Page, static_cast(rPosition.mnPageIndex)); + } mnText = rPosition.mnText; return rPosition.mxObject.get().get(); } From 25a1ac878bbb4d8088030286b82ad6031c2def06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 5 Jul 2024 14:08:51 +0100 Subject: [PATCH 173/232] cid#1609597 silence Using invalid iterator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I08e9ee6016ca0d67be76b0a04e7205e6d90bb46e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170023 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- svl/source/items/globalpool.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/svl/source/items/globalpool.cxx b/svl/source/items/globalpool.cxx index 32ca159fe7a7..583cb82bf6bc 100644 --- a/svl/source/items/globalpool.cxx +++ b/svl/source/items/globalpool.cxx @@ -363,7 +363,9 @@ SfxPoolItem const* implCreateItemEntry(SfxItemPool& rPool, SfxPoolItem const* pS else gInstanceManagerMap.insert( { aManagerKey, std::make_unique() }); - pManager = gInstanceManagerMap.find(aManagerKey)->second.get(); + it1 = gInstanceManagerMap.find(aManagerKey); + assert(it1 != gInstanceManagerMap.end()); + pManager = it1->second.get(); } bool bSuccess = pManager->add(*pSource); From 95ef9610aaabde34fac54574d60427c1e619659b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 5 Jul 2024 14:13:31 +0100 Subject: [PATCH 174/232] cid#1609596 silence Unintended sign extension MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ia0e95e0dd82e28f155ddf79c48832a9e0ddc3d98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170024 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- svl/source/items/globalpool.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svl/source/items/globalpool.cxx b/svl/source/items/globalpool.cxx index 583cb82bf6bc..d2de3b40bc16 100644 --- a/svl/source/items/globalpool.cxx +++ b/svl/source/items/globalpool.cxx @@ -180,7 +180,7 @@ struct PairHash { size_t operator()(const std::pair& rKey) const { - return (static_cast(rKey.first) << 16) | rKey.second; + return (static_cast(rKey.first) << 16) | rKey.second; } }; } From ef1337b7326841fac4cf03d42c8172e57566dc06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 5 Jul 2024 14:15:19 +0100 Subject: [PATCH 175/232] cid#1545304 silence Using invalid iterator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I653c9b9313a854646028c7b2d9982c1233377ea0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170045 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- cui/source/customize/macropg.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cui/source/customize/macropg.cxx b/cui/source/customize/macropg.cxx index b042ffb71668..fa4ef4663255 100644 --- a/cui/source/customize/macropg.cxx +++ b/cui/source/customize/macropg.cxx @@ -486,12 +486,14 @@ void SvxMacroTabPage_::GenericHandler_Impl(const weld::Button* pBtn) if (bAppEvents) { EventsHash::iterator h_it = m_appEventsHash.find(sEventName); + assert(h_it != m_appEventsHash.end()); h_it->second.first = sEventType; h_it->second.second = sEventURL; } else { EventsHash::iterator h_it = m_docEventsHash.find(sEventName); + assert(h_it != m_docEventsHash.end()); h_it->second.first = sEventType; h_it->second.second = sEventURL; } From b8ed305052341a19390471f4747a4e5df1a1926a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 5 Jul 2024 14:17:37 +0100 Subject: [PATCH 176/232] cid#1554704 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I844d0bfcdb5b16d0e6e06499ceac2add0e26bb9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170046 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- vcl/source/filter/wmf/wmfwr.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx index 70b00a895720..e89180073cba 100644 --- a/vcl/source/filter/wmf/wmfwr.cxx +++ b/vcl/source/filter/wmf/wmfwr.cxx @@ -658,7 +658,7 @@ void WMFWriter::WMFRecord_PolyPolygon(const tools::PolyPolygon & rPolyPoly) { tools::Polygon aSimplePoly; aSimplePolyPoly[ i ].AdaptiveSubdivide( aSimplePoly ); - aSimplePolyPoly[ i ] = aSimplePoly; + aSimplePolyPoly[ i ] = std::move(aSimplePoly); } } WriteRecordHeader(0,W_META_POLYPOLYGON); From 12a94012cae2c1415d772dd6883c5a49ff46b625 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 5 Jul 2024 14:18:16 +0100 Subject: [PATCH 177/232] cid#1554717 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Icb1df2b857568cf085b597e378094e7231286fce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170047 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- include/tools/urlobj.hxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/tools/urlobj.hxx b/include/tools/urlobj.hxx index 7e7c4a2aafc6..96f21676d51b 100644 --- a/include/tools/urlobj.hxx +++ b/include/tools/urlobj.hxx @@ -1210,7 +1210,7 @@ inline bool INetURLObject::GetNewAbsURL(OUString const & rTheRelURIRef, FSysStyle::Detect)) return false; if (pTheAbsURIRef) - *pTheAbsURIRef = aTheAbsURIRef; + *pTheAbsURIRef = std::move(aTheAbsURIRef); return true; } From f960d27f158372d4f2d28cd84fee74742f7fbe4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Fri, 5 Jul 2024 14:21:03 +0100 Subject: [PATCH 178/232] cid#1554774 silence Use of auto that causes a copy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie562fa0c4942286cb7dec01473455234f6ebd56d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170048 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sc/source/ui/unoobj/viewuno.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx index ab3e5748bd45..d0fdb360e4bb 100644 --- a/sc/source/ui/unoobj/viewuno.cxx +++ b/sc/source/ui/unoobj/viewuno.cxx @@ -2093,8 +2093,7 @@ void ScTabViewObj::RangeSelChanged( const OUString& rText ) aEvent.RangeDescriptor = rText; // copy on the stack because listener could remove itself - auto const listener(aRangeChgListeners); - + const std::vector> listener(aRangeChgListeners); for (const auto& rListener : listener) rListener->descriptorChanged( aEvent ); } From adad59c6f71532488b54804c09f0ecb7663b3a22 Mon Sep 17 00:00:00 2001 From: Jim Raykowski Date: Thu, 27 Jun 2024 19:50:57 -0800 Subject: [PATCH 179/232] tdf#161717 Enhancement to identify click on tracked change in the document by highlighting the corrosponding entry in the "Manage Changes" dialog and sidebar panel Change-Id: I1f31580a4fe764dd800c6db1e9a4e2024db14c6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169692 Reviewed-by: Jim Raykowski Tested-by: Jenkins --- include/svl/hint.hxx | 1 + sw/source/uibase/docvw/edtwin.cxx | 10 ++++++++ sw/source/uibase/inc/redlndlg.hxx | 4 ++- sw/source/uibase/misc/redlndlg.cxx | 39 ++++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 1 deletion(-) diff --git a/include/svl/hint.hxx b/include/svl/hint.hxx index 3dd3db1763ea..fe636a89ec55 100644 --- a/include/svl/hint.hxx +++ b/include/svl/hint.hxx @@ -166,6 +166,7 @@ enum class SfxHintId { SwRedlineDelText, SwRedlineUnDelText, SwMoveText, + SwRedlineContentAtPos, ThisIsAnSdrHint, ThisIsAnSfxEventHint diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 28339dde0d42..1abf300f3d86 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -5364,6 +5364,16 @@ void SwEditWin::MouseButtonUp(const MouseEvent& rMEvt) if (bCallBase) Window::MouseButtonUp(rMEvt); + // tdf#161717 - Track changes: Clicking on change in document should highlight related change + // in "Manage Changes" window/sidebar + if (SwContentAtPos aRedlineContentAtPos(IsAttrAtPos::Redline); + rSh.GetContentAtPos(aDocPt, aRedlineContentAtPos)) + { + SwDocShell* pDocSh = m_rView.GetDocShell(); + if (pDocSh) + pDocSh->Broadcast(SfxHint(SfxHintId::SwRedlineContentAtPos)); + } + if (!(pSdrView && rMEvt.GetClicks() == 1 && comphelper::LibreOfficeKit::isActive())) return; diff --git a/sw/source/uibase/inc/redlndlg.hxx b/sw/source/uibase/inc/redlndlg.hxx index 6330d194fb13..b0c53e00f350 100644 --- a/sw/source/uibase/inc/redlndlg.hxx +++ b/sw/source/uibase/inc/redlndlg.hxx @@ -53,7 +53,7 @@ struct SwRedlineDataParent class SwRedlineDataParentSortArr : public o3tl::sorted_vector {}; -class SW_DLLPUBLIC SwRedlineAcceptDlg final +class SW_DLLPUBLIC SwRedlineAcceptDlg final : public SfxListener { std::shared_ptr m_xParentDlg; std::vector> m_RedlineParents; @@ -124,6 +124,8 @@ public: void FillInfo(OUString &rExtraData) const; void Activate(); + + virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override; }; class SwModelessRedlineAcceptDlg final : public SfxModelessDialogController diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx index 9a5a144b4426..5efd064889ab 100644 --- a/sw/source/uibase/misc/redlndlg.cxx +++ b/sw/source/uibase/misc/redlndlg.cxx @@ -207,6 +207,9 @@ SwRedlineAcceptDlg::SwRedlineAcceptDlg(std::shared_ptr xParent, we // avoid multiple selection of the same texts: m_aSelectTimer.SetTimeout(100); m_aSelectTimer.SetInvokeHandler(LINK(this, SwRedlineAcceptDlg, GotoHdl)); + + // we want to receive SfxHintId::SwRedlineContentAtPos + StartListening(*(SW_MOD()->GetView()->GetDocShell())); } SwRedlineAcceptDlg::~SwRedlineAcceptDlg() @@ -495,6 +498,42 @@ void SwRedlineAcceptDlg::Activate() InitAuthors(); } +void SwRedlineAcceptDlg::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint) +{ + if (rHint.GetId() == SfxHintId::SwRedlineContentAtPos) + { + SwView* pView = GetActiveView(); + if (!pView) + return; + + SwWrtShell* pSh = pView->GetWrtShellPtr(); + if (!pSh) + return; + + const SwRangeRedline* pRangeRedline = pSh->GetCurrRedline(); + if (!pRangeRedline) + return; + + const SwRedlineData& rRedlineData = pRangeRedline->GetRedlineData(); + + weld::TreeView& rTreeView = m_pTable->GetWidget(); + rTreeView.all_foreach([&rTreeView, &rRedlineData](weld::TreeIter& rIter) { + RedlinData* pRedlinData = weld::fromId(rTreeView.get_id(rIter)); + const SwRedlineData* pRedlineData; + if (rTreeView.iter_has_child(rIter)) + pRedlineData = static_cast(pRedlinData->pData)->pData; + else + pRedlineData = static_cast(pRedlinData->pData)->pChild; + if (pRedlineData == &rRedlineData) + { + rTreeView.set_cursor(rIter); + return true; + } + return false; + }); + } +} + SwRedlineTable::size_type SwRedlineAcceptDlg::CalcDiff(SwRedlineTable::size_type nStart, bool bChild) { if (!nStart || m_bHasTrackedColumn) From 294cb227e0d2979a55e04dc2ed7aced6ad9e0630 Mon Sep 17 00:00:00 2001 From: Jim Raykowski Date: Fri, 5 Jul 2024 13:17:51 -0800 Subject: [PATCH 180/232] Make Managed Changes panel fill remaining vertical space Affects x11, qt, win, and possibly mac. Gtk fills the remaining vertical space with or without this patch. Change-Id: I30a8f9f97ee4de2c11b8c0c05054d9783a1fb191 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170060 Tested-by: Jenkins Reviewed-by: Jim Raykowski --- sw/uiconfig/swriter/ui/managechangessidebar.ui | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sw/uiconfig/swriter/ui/managechangessidebar.ui b/sw/uiconfig/swriter/ui/managechangessidebar.ui index 681264f9a864..f305caf31348 100644 --- a/sw/uiconfig/swriter/ui/managechangessidebar.ui +++ b/sw/uiconfig/swriter/ui/managechangessidebar.ui @@ -1,11 +1,12 @@ - + True False + True True True From 267083e9e7768adcd5316851ce51e1cc22d4627e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Vajngerl?= Date: Mon, 1 Apr 2024 14:51:49 +0900 Subject: [PATCH 181/232] vcl: remove GraphicDescriptor::ImpConstruct MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's not really needed - it sets values to defaults, which are already set. Change-Id: If61edace7975cd438d86ee9774535c0f14868fd5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166275 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- include/vcl/graphicfilter.hxx | 2 -- vcl/source/filter/graphicfilter2.cxx | 13 ------------- 2 files changed, 15 deletions(-) diff --git a/include/vcl/graphicfilter.hxx b/include/vcl/graphicfilter.hxx index bf1f64237a1f..6d4dcde025f2 100644 --- a/include/vcl/graphicfilter.hxx +++ b/include/vcl/graphicfilter.hxx @@ -134,8 +134,6 @@ class VCL_DLLPUBLIC GraphicDescriptor final GraphicMetadata aMetadata; bool bOwnStream; - SAL_DLLPRIVATE void ImpConstruct(); - SAL_DLLPRIVATE bool ImpDetectBMP( SvStream& rStm, bool bExtendedInfo ); SAL_DLLPRIVATE bool ImpDetectGIF( SvStream& rStm, bool bExtendedInfo ); SAL_DLLPRIVATE bool ImpDetectJPG( SvStream& rStm, bool bExtendedInfo ); diff --git a/vcl/source/filter/graphicfilter2.cxx b/vcl/source/filter/graphicfilter2.cxx index d7161b2808ea..d1a84c7b1ad9 100644 --- a/vcl/source/filter/graphicfilter2.cxx +++ b/vcl/source/filter/graphicfilter2.cxx @@ -32,15 +32,12 @@ GraphicDescriptor::GraphicDescriptor( const INetURLObject& rPath ) : aPathExt( rPath.GetFileExtension().toAsciiLowerCase() ), bOwnStream( true ) { - ImpConstruct(); } GraphicDescriptor::GraphicDescriptor( SvStream& rInStream, const OUString* pPath) : pFileStm ( &rInStream ), bOwnStream ( false ) { - ImpConstruct(); - if ( pPath ) { INetURLObject aURL( *pPath ); @@ -92,16 +89,6 @@ bool GraphicDescriptor::Detect( bool bExtendedInfo ) return bRet; } -void GraphicDescriptor::ImpConstruct() -{ - aMetadata.mnFormat = GraphicFileFormat::NOT; - aMetadata.mnBitsPerPixel = 0; - aMetadata.mnPlanes = 0; - aMetadata.mnNumberOfImageComponents = 0; - aMetadata.mbIsTransparent = false; - aMetadata.mbIsAlpha = false; -} - bool GraphicDescriptor::ImpDetectBMP( SvStream& rStm, bool bExtendedInfo ) { vcl::GraphicFormatDetector aDetector( rStm, aPathExt, bExtendedInfo ); From 7cc291a8f2db3b2a65d07eded04e51c3c848c709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Vajngerl?= Date: Tue, 2 Apr 2024 17:31:17 +0900 Subject: [PATCH 182/232] vcl: inch-size.emf is actually PICT format, rename to inch-size.pct MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I69c1cf65415546811777ec3df914db3596887db6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166276 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- vcl/qa/cppunit/GraphicTest.cxx | 3 ++- .../cppunit/data/{inch-size.emf => inch-size.pct} | Bin 2 files changed, 2 insertions(+), 1 deletion(-) rename vcl/qa/cppunit/data/{inch-size.emf => inch-size.pct} (100%) diff --git a/vcl/qa/cppunit/GraphicTest.cxx b/vcl/qa/cppunit/GraphicTest.cxx index 1130a05708e1..3821c31dcf8e 100644 --- a/vcl/qa/cppunit/GraphicTest.cxx +++ b/vcl/qa/cppunit/GraphicTest.cxx @@ -364,11 +364,12 @@ CPPUNIT_TEST_FIXTURE(GraphicTest, testUnloadedGraphicSizeUnit) { GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter(); test::Directories aDirectories; - OUString aURL = aDirectories.getURLFromSrc(DATA_DIRECTORY) + "inch-size.emf"; + OUString aURL = aDirectories.getURLFromSrc(DATA_DIRECTORY) + "inch-size.pct"; Size aMtfSize100(42, 42); SvFileStream aStream(aURL, StreamMode::READ); Graphic aGraphic = rGraphicFilter.ImportUnloadedGraphic(aStream, 0, &aMtfSize100); + CPPUNIT_ASSERT_EQUAL(false, aGraphic.isAvailable()); CPPUNIT_ASSERT_EQUAL(Size(42, 42), aGraphic.GetPrefSize()); // Force it to swap in diff --git a/vcl/qa/cppunit/data/inch-size.emf b/vcl/qa/cppunit/data/inch-size.pct similarity index 100% rename from vcl/qa/cppunit/data/inch-size.emf rename to vcl/qa/cppunit/data/inch-size.pct From 02c91f82c2f8de24c6c2097d41725d9bae9d164a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Vajngerl?= Date: Fri, 5 Jul 2024 22:31:37 +0900 Subject: [PATCH 183/232] move UniqueID to tools and rework to increase counter in constructor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In the tools module it can be used in more other modules. Changed the instantiation to increase the counter already in the constructor, so no need to check if the ID is 0. Also test for UniqueID Change-Id: I77c80461875c69496a7e218534d16d6550c168c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170061 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl --- include/svx/annotation/Annotation.hxx | 2 +- include/svx/svdpage.hxx | 2 +- include/{svx => tools}/UniqueID.hxx | 20 +++---- tools/CppunitTest_tools_unique_id.mk | 29 ++++++++++ tools/Library_tl.mk | 1 + tools/Module_tools.mk | 1 + tools/qa/cppunit/UniqueIdTest.cxx | 79 +++++++++++++++++++++++++++ tools/source/misc/UniqueID.cxx | 19 +++++++ 8 files changed, 138 insertions(+), 15 deletions(-) rename include/{svx => tools}/UniqueID.hxx (63%) create mode 100644 tools/CppunitTest_tools_unique_id.mk create mode 100644 tools/qa/cppunit/UniqueIdTest.cxx create mode 100644 tools/source/misc/UniqueID.cxx diff --git a/include/svx/annotation/Annotation.hxx b/include/svx/annotation/Annotation.hxx index 491bbbfd0c6f..ba2021a70ec6 100644 --- a/include/svx/annotation/Annotation.hxx +++ b/include/svx/annotation/Annotation.hxx @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include class SdrUndoAction; diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx index e38a9160bb00..55f11379356d 100644 --- a/include/svx/svdpage.hxx +++ b/include/svx/svdpage.hxx @@ -35,7 +35,7 @@ #include #include #include -#include +#include // predefines namespace model { class Theme; } diff --git a/include/svx/UniqueID.hxx b/include/tools/UniqueID.hxx similarity index 63% rename from include/svx/UniqueID.hxx rename to include/tools/UniqueID.hxx index 91e4664b2d5a..c649a5185469 100644 --- a/include/svx/UniqueID.hxx +++ b/include/tools/UniqueID.hxx @@ -10,31 +10,25 @@ #pragma once #include -#include +#include /** Unique ID for an object. * * Generates a unique ID and stores it in a member variable, so the ID returned * by getId() is the same as long as the object is alive. * - * ID 0 means the ID is not yet created, so 0 is not a valid ID + * ID numbers start with 1. * */ -class UniqueID final +class TOOLS_DLLPUBLIC UniqueID final { private: - sal_uInt64 mnID = 0; + sal_uInt64 mnID; public: - sal_uInt64 getID() const - { - if (!mnID) - { - static std::atomic staticCounter(1); - const_cast(this)->mnID = staticCounter.fetch_add(1); - } - return mnID; - } + UniqueID(); + + sal_uInt64 getID() const { return mnID; } }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/tools/CppunitTest_tools_unique_id.mk b/tools/CppunitTest_tools_unique_id.mk new file mode 100644 index 000000000000..547832910f80 --- /dev/null +++ b/tools/CppunitTest_tools_unique_id.mk @@ -0,0 +1,29 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_CppunitTest_CppunitTest,tools_unique_id)) + + +$(eval $(call gb_CppunitTest_set_include,tools_unique_id,\ + $$(INCLUDE) \ + -I$(SRCDIR)/tools/inc \ +)) + +$(eval $(call gb_CppunitTest_add_exception_objects,tools_unique_id, \ + tools/qa/cppunit/UniqueIdTest \ +)) + +$(eval $(call gb_CppunitTest_use_libraries,tools_unique_id, \ + tl \ + test \ + unotest \ +)) + + +# vim: set noet sw=4 ts=4: diff --git a/tools/Library_tl.mk b/tools/Library_tl.mk index fee6fb1b4097..e2f1a9fccbf6 100644 --- a/tools/Library_tl.mk +++ b/tools/Library_tl.mk @@ -72,6 +72,7 @@ $(eval $(call gb_Library_add_exception_objects,tl,\ tools/source/misc/cpuid \ tools/source/misc/extendapplicationenvironment \ tools/source/misc/json_writer \ + tools/source/misc/UniqueID \ tools/source/ref/globname \ tools/source/ref/ref \ tools/source/stream/stream \ diff --git a/tools/Module_tools.mk b/tools/Module_tools.mk index 5632a5b94a2d..4d477462c0fe 100644 --- a/tools/Module_tools.mk +++ b/tools/Module_tools.mk @@ -33,6 +33,7 @@ $(eval $(call gb_Module_add_targets_for_build,tools,\ $(eval $(call gb_Module_add_check_targets,tools,\ CppunitTest_tools_test \ CppunitTest_tools_config \ + CppunitTest_tools_unique_id \ )) # vim: set noet sw=4 ts=4: diff --git a/tools/qa/cppunit/UniqueIdTest.cxx b/tools/qa/cppunit/UniqueIdTest.cxx new file mode 100644 index 000000000000..e85fcfb0cf39 --- /dev/null +++ b/tools/qa/cppunit/UniqueIdTest.cxx @@ -0,0 +1,79 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-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/. + */ + +#include + +#include +#include +#include +#include + +namespace +{ +class UniqueIdTest : public CppUnit::TestFixture +{ +}; + +struct ObjectExample1 +{ + UniqueID maID; +}; + +struct ObjectExample2 +{ + UniqueID maID; +}; + +CPPUNIT_TEST_FIXTURE(UniqueIdTest, testUniqueness) +{ + UniqueID aID; + // Check ID + CPPUNIT_ASSERT_EQUAL(sal_uInt64(1), aID.getID()); + // Call again - same result + CPPUNIT_ASSERT_EQUAL(sal_uInt64(1), aID.getID()); + + // Check creating another instance + { + UniqueID aID2; + CPPUNIT_ASSERT_EQUAL(sal_uInt64(1), aID.getID()); + CPPUNIT_ASSERT_EQUAL(sal_uInt64(2), aID2.getID()); + } + + // Check creating third instance + { + UniqueID aID3; + CPPUNIT_ASSERT_EQUAL(sal_uInt64(1), aID.getID()); + CPPUNIT_ASSERT_EQUAL(sal_uInt64(3), aID3.getID()); + } + + // Check object copying - preserve the id + ObjectExample1 objectA; + CPPUNIT_ASSERT_EQUAL(sal_uInt64(4), objectA.maID.getID()); + + ObjectExample1 objectB = objectA; + CPPUNIT_ASSERT_EQUAL(sal_uInt64(4), objectA.maID.getID()); + CPPUNIT_ASSERT_EQUAL(sal_uInt64(4), objectB.maID.getID()); + + // Multiple objects + ObjectExample2 objectC; + ObjectExample1 objectD; + ObjectExample2 objectE; + ObjectExample1 objectF; + + CPPUNIT_ASSERT_EQUAL(sal_uInt64(5), objectC.maID.getID()); + CPPUNIT_ASSERT_EQUAL(sal_uInt64(6), objectD.maID.getID()); + CPPUNIT_ASSERT_EQUAL(sal_uInt64(7), objectE.maID.getID()); + CPPUNIT_ASSERT_EQUAL(sal_uInt64(8), objectF.maID.getID()); +} + +} // end anonymous namespace + +CPPUNIT_PLUGIN_IMPLEMENT(); + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/tools/source/misc/UniqueID.cxx b/tools/source/misc/UniqueID.cxx new file mode 100644 index 000000000000..3af43eccb968 --- /dev/null +++ b/tools/source/misc/UniqueID.cxx @@ -0,0 +1,19 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-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/. + */ + +#include +#include + +UniqueID::UniqueID() +{ + static std::atomic staticCounter(1); + mnID = staticCounter.fetch_add(1); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ From c0653c1e268ff8f6a6fe422aadb27675d8b1f583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Toma=C5=BE=20Vajngerl?= Date: Thu, 4 Apr 2024 12:35:31 +0900 Subject: [PATCH 184/232] vcl: add more GIF metadata to GraphicFormatDetector MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie85947371df087495a80179e4e0f2f660877e368 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166277 Reviewed-by: Tomaž Vajngerl Tested-by: Jenkins --- include/vcl/graphic/GraphicMetadata.hxx | 2 ++ vcl/qa/cppunit/GraphicFormatDetectorTest.cxx | 18 ++++++++++++++++++ vcl/source/filter/GraphicFormatDetector.cxx | 12 ++++++++++++ 3 files changed, 32 insertions(+) diff --git a/include/vcl/graphic/GraphicMetadata.hxx b/include/vcl/graphic/GraphicMetadata.hxx index 33ee9d81c3b4..2aa9f1cb4107 100644 --- a/include/vcl/graphic/GraphicMetadata.hxx +++ b/include/vcl/graphic/GraphicMetadata.hxx @@ -51,6 +51,7 @@ enum class GraphicFileFormat SVGZ = 0x00fc, APNG = 0x00fd }; + struct GraphicMetadata { Size maPixSize{}; @@ -63,6 +64,7 @@ struct GraphicMetadata sal_uInt8 mnNumberOfImageComponents = 0; bool mbIsTransparent = false; bool mbIsAlpha = false; + bool mbIsAnimated = false; }; #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/vcl/qa/cppunit/GraphicFormatDetectorTest.cxx b/vcl/qa/cppunit/GraphicFormatDetectorTest.cxx index fb36f40c4791..aeed3e8bdfed 100644 --- a/vcl/qa/cppunit/GraphicFormatDetectorTest.cxx +++ b/vcl/qa/cppunit/GraphicFormatDetectorTest.cxx @@ -41,6 +41,7 @@ class GraphicFormatDetectorTest : public test::BootstrapFixtureBase void testDetectPNG(); void testDetectAPNG(); void testDetectGIF(); + void testDetectGIFMetadata(); void testDetectPSD(); void testDetectTGA(); void testDetectTIF(); @@ -66,6 +67,7 @@ class GraphicFormatDetectorTest : public test::BootstrapFixtureBase CPPUNIT_TEST(testDetectPNG); CPPUNIT_TEST(testDetectAPNG); CPPUNIT_TEST(testDetectGIF); + CPPUNIT_TEST(testDetectGIFMetadata); CPPUNIT_TEST(testDetectPSD); CPPUNIT_TEST(testDetectTGA); CPPUNIT_TEST(testDetectTIF); @@ -218,6 +220,22 @@ void GraphicFormatDetectorTest::testDetectGIF() CPPUNIT_ASSERT_EQUAL(u"GIF"_ustr, rFormatExtension); } +void GraphicFormatDetectorTest::testDetectGIFMetadata() +{ + SvFileStream aFileStream(getFullUrl(u"123_Numbers.gif"), StreamMode::READ); + vcl::GraphicFormatDetector aDetector(aFileStream, "GIF", true); + + CPPUNIT_ASSERT(aDetector.detect()); + CPPUNIT_ASSERT(aDetector.checkGIF()); + auto const& rMetadata = aDetector.getMetadata(); + + CPPUNIT_ASSERT_EQUAL(Size(124, 146), rMetadata.maPixSize); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(5), rMetadata.mnBitsPerPixel); + + CPPUNIT_ASSERT_EQUAL(Size(), rMetadata.maLogSize); + CPPUNIT_ASSERT_EQUAL(true, rMetadata.mbIsAnimated); +} + void GraphicFormatDetectorTest::testDetectPSD() { SvFileStream aFileStream(getFullUrl(u"TypeDetectionExample.psd"), StreamMode::READ); diff --git a/vcl/source/filter/GraphicFormatDetector.cxx b/vcl/source/filter/GraphicFormatDetector.cxx index a878a8ca111d..7963505f4b2e 100644 --- a/vcl/source/filter/GraphicFormatDetector.cxx +++ b/vcl/source/filter/GraphicFormatDetector.cxx @@ -28,6 +28,7 @@ #include #include #include +#include "igif/gifread.hxx" #include #include #include @@ -824,6 +825,8 @@ bool GraphicFormatDetector::checkTIF() bool GraphicFormatDetector::checkGIF() { + SeekGuard aGuard(mrStream, mnStreamPosition); + if (mnFirstLong == 0x47494638 && (maFirstBytes[4] == 0x37 || maFirstBytes[4] == 0x39) && maFirstBytes[5] == 0x61) { @@ -834,6 +837,14 @@ bool GraphicFormatDetector::checkGIF() sal_uInt16 nHeight = maFirstBytes[8] | (maFirstBytes[9] << 8); maMetadata.maPixSize = Size(nWidth, nHeight); maMetadata.mnBitsPerPixel = ((maFirstBytes[10] & 112) >> 4) + 1; + + Size aLogicSize; + bool bAnimated = IsGIFAnimated(mrStream, aLogicSize); + if (aLogicSize.getWidth() && aLogicSize.getHeight()) + { + maMetadata.maLogSize = aLogicSize; + } + maMetadata.mbIsAnimated = bAnimated; } return true; } @@ -954,6 +965,7 @@ bool GraphicFormatDetector::checkAPNG() if (PngImageReader::isAPng(mrStream)) { maMetadata.mnFormat = GraphicFileFormat::APNG; + maMetadata.mbIsAnimated = true; return true; } return false; From d258b218e81a2aa815fa9dac695260c3a40445b6 Mon Sep 17 00:00:00 2001 From: Andrea Gelmini Date: Sun, 7 Jul 2024 10:17:01 +0200 Subject: [PATCH 185/232] Update git submodules * Update helpcontent2 from branch 'master' to ce6b950180c0174cd1b73b37b9fbf7310fe56dbf - Fix typo Change-Id: Ie15138e64d647d669a57a4cfa7c530cd43ad294a Reviewed-on: https://gerrit.libreoffice.org/c/help/+/170085 Tested-by: Jenkins Reviewed-by: Julien Nabet --- helpcontent2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpcontent2 b/helpcontent2 index e859581bf530..ce6b950180c0 160000 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit e859581bf5302296634127cd7bb6576f6e3ec932 +Subproject commit ce6b950180c0174cd1b73b37b9fbf7310fe56dbf From c396c55adf0ff26ba35cd4a77345af541ec85c20 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Sun, 7 Jul 2024 00:08:08 +0200 Subject: [PATCH 186/232] sw: simplify code by using UnoApiTest Change-Id: I0c8ea8468058de9f78cabaa905f84f674b9be93b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170082 Reviewed-by: Xisco Fauli Tested-by: Jenkins --- sw/qa/api/SwXBodyText.cxx | 35 +++++-------------------- sw/qa/api/SwXBookmark.cxx | 10 ++------ sw/qa/api/SwXBookmarks.cxx | 10 ++------ sw/qa/api/SwXChapterNumbering.cxx | 10 ++------ sw/qa/api/SwXDocumentIndex.cxx | 10 ++------ sw/qa/api/SwXDocumentIndexMark.cxx | 36 ++++++++------------------ sw/qa/api/SwXDocumentIndexes.cxx | 10 ++------ sw/qa/api/SwXDocumentSettings.cxx | 30 +++------------------- sw/qa/api/SwXFieldEnumeration.cxx | 10 ++------ sw/qa/api/SwXFootnote.cxx | 37 ++++++++------------------- sw/qa/api/SwXFootnoteProperties.cxx | 35 +++++-------------------- sw/qa/api/SwXFootnoteText.cxx | 33 +++++------------------- sw/qa/api/SwXFootnotes.cxx | 10 ++------ sw/qa/api/SwXFrames.cxx | 10 ++------ sw/qa/api/SwXHeadFootText.cxx | 33 +++++------------------- sw/qa/api/SwXNumberingRules.cxx | 10 ++------ sw/qa/api/SwXParagraphEnumeration.cxx | 10 ++------ sw/qa/api/SwXReferenceMark.cxx | 10 ++------ sw/qa/api/SwXReferenceMarks.cxx | 10 ++------ sw/qa/api/SwXStyleFamilies.cxx | 10 ++------ sw/qa/api/SwXTableCellText.cxx | 10 ++------ sw/qa/api/SwXTextEmbeddedObjects.cxx | 10 ++------ sw/qa/api/SwXTextField.cxx | 10 ++------ sw/qa/api/SwXTextFieldMasters.cxx | 10 ++------ sw/qa/api/SwXTextFieldTypes.cxx | 17 +++--------- sw/qa/api/SwXTextFrame.cxx | 10 ++------ sw/qa/api/SwXTextSections.cxx | 10 ++------ sw/qa/api/SwXTextTable.cxx | 33 ++++++------------------ sw/qa/api/SwXTextTables.cxx | 10 ++------ 29 files changed, 103 insertions(+), 386 deletions(-) diff --git a/sw/qa/api/SwXBodyText.cxx b/sw/qa/api/SwXBodyText.cxx index 3db54633e441..7dd479c43eac 100644 --- a/sw/qa/api/SwXBodyText.cxx +++ b/sw/qa/api/SwXBodyText.cxx @@ -7,13 +7,12 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include +#include #include #include #include #include #include -#include #include @@ -32,8 +31,7 @@ namespace /** * Initial tests for SwXBodyText. */ -class SwXBodyText final : public test::BootstrapFixture, - public unotest::MacrosTest, +class SwXBodyText final : public UnoApiTest, public apitest::XElementAccess, public apitest::XTextRange, public apitest::XSimpleText, @@ -42,8 +40,6 @@ class SwXBodyText final : public test::BootstrapFixture, { public: SwXBodyText(); - virtual void setUp() override; - void tearDown() override; Reference init() override; @@ -62,37 +58,20 @@ public: CPPUNIT_TEST(testCompareRegionStarts); CPPUNIT_TEST(testCompareRegionEnds); CPPUNIT_TEST_SUITE_END(); - -private: - uno::Reference component_; }; SwXBodyText::SwXBodyText() - : XElementAccess(cppu::UnoType::get()) + : UnoApiTest(u""_ustr) + , XElementAccess(cppu::UnoType::get()) { } -void SwXBodyText::setUp() -{ - test::BootstrapFixture::setUp(); - mxDesktop.set( - frame::Desktop::create(comphelper::getComponentContext(getMultiServiceFactory()))); -} - -void SwXBodyText::tearDown() -{ - if (component_.is()) - component_->dispose(); - - test::BootstrapFixture::tearDown(); -} - Reference SwXBodyText::init() { - component_ + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr); - Reference xTextDocument(component_, UNO_QUERY_THROW); - Reference xMSF(component_, UNO_QUERY_THROW); + Reference xTextDocument(mxComponent, UNO_QUERY_THROW); + Reference xMSF(mxComponent, UNO_QUERY_THROW); Reference xText = xTextDocument->getText(); diff --git a/sw/qa/api/SwXBookmark.cxx b/sw/qa/api/SwXBookmark.cxx index f078357f36d1..a92528d6f201 100644 --- a/sw/qa/api/SwXBookmark.cxx +++ b/sw/qa/api/SwXBookmark.cxx @@ -39,16 +39,10 @@ public: { } - virtual void setUp() override - { - UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(m_xContext)); - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); - CPPUNIT_ASSERT(mxComponent.is()); - } - Reference init() override { + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, + u"com.sun.star.text.TextDocument"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXBookmarks.cxx b/sw/qa/api/SwXBookmarks.cxx index 0f1de2033509..c2f37bcc676b 100644 --- a/sw/qa/api/SwXBookmarks.cxx +++ b/sw/qa/api/SwXBookmarks.cxx @@ -42,16 +42,10 @@ public: { } - virtual void setUp() override - { - UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(m_xContext)); - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); - CPPUNIT_ASSERT(mxComponent.is()); - } - Reference init() override { + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, + u"com.sun.star.text.TextDocument"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXChapterNumbering.cxx b/sw/qa/api/SwXChapterNumbering.cxx index dfa9ef6145b3..c6e302362ddb 100644 --- a/sw/qa/api/SwXChapterNumbering.cxx +++ b/sw/qa/api/SwXChapterNumbering.cxx @@ -41,16 +41,10 @@ public: { } - virtual void setUp() override - { - UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(m_xContext)); - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); - CPPUNIT_ASSERT(mxComponent.is()); - } - Reference init() override { + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, + u"com.sun.star.text.TextDocument"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xCNSupplier(xTextDocument, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXDocumentIndex.cxx b/sw/qa/api/SwXDocumentIndex.cxx index ffe38f42eabd..7e1e5f9d673e 100644 --- a/sw/qa/api/SwXDocumentIndex.cxx +++ b/sw/qa/api/SwXDocumentIndex.cxx @@ -55,16 +55,10 @@ public: { } - virtual void setUp() override - { - UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(m_xContext)); - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); - CPPUNIT_ASSERT(mxComponent.is()); - } - Reference init() override { + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, + u"com.sun.star.text.TextDocument"_ustr); mxTextDocument = Reference(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxTextDocument, UNO_QUERY_THROW); Reference xDocumentIndex( diff --git a/sw/qa/api/SwXDocumentIndexMark.cxx b/sw/qa/api/SwXDocumentIndexMark.cxx index cb736f3d60cc..1d0e28a9e737 100644 --- a/sw/qa/api/SwXDocumentIndexMark.cxx +++ b/sw/qa/api/SwXDocumentIndexMark.cxx @@ -7,12 +7,11 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include +#include #include #include #include #include -#include #include @@ -32,22 +31,19 @@ namespace /** * Initial tests for SwXDocumentIndexMark. */ -class SwXDocumentIndexMark final : public test::BootstrapFixture, - public unotest::MacrosTest, +class SwXDocumentIndexMark final : public UnoApiTest, public apitest::XComponent, public apitest::XTextContent, public apitest::BaseIndexMark, public apitest::DocumentIndexMark { public: - virtual void setUp() override; - void tearDown() override; + SwXDocumentIndexMark(); Reference init() override; uno::Reference getTextRange() override; uno::Reference getTextContent() override; bool isAttachSupported() override { return true; } - uno::Reference getTextDocument() { return mxTextDocument; } void triggerDesktopTerminate() override { mxDesktop->terminate(); } CPPUNIT_TEST_SUITE(SwXDocumentIndexMark); @@ -61,35 +57,23 @@ public: CPPUNIT_TEST_SUITE_END(); private: - uno::Reference mxTextDocument; uno::Reference mxTextRange; uno::Reference mxTextContent; }; -void SwXDocumentIndexMark::setUp() +SwXDocumentIndexMark::SwXDocumentIndexMark() + : UnoApiTest(u""_ustr) { - test::BootstrapFixture::setUp(); - - mxDesktop.set(frame::Desktop::create(m_xContext)); - mxTextDocument = uno::Reference( - loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr), - uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(mxTextDocument.is()); -} - -void SwXDocumentIndexMark::tearDown() -{ - if (mxTextDocument.is()) - mxTextDocument->dispose(); - - test::BootstrapFixture::tearDown(); } Reference SwXDocumentIndexMark::init() { - Reference xMSF(mxTextDocument, UNO_QUERY_THROW); + mxComponent + = loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr); + Reference xTextDocument(mxComponent, UNO_QUERY_THROW); + Reference xMSF(mxComponent, UNO_QUERY_THROW); - Reference xText = getTextDocument()->getText(); + Reference xText = xTextDocument->getText(); Reference xCursor = xText->createTextCursor(); Reference xDIM( diff --git a/sw/qa/api/SwXDocumentIndexes.cxx b/sw/qa/api/SwXDocumentIndexes.cxx index 08de51571932..7ba73bba26ff 100644 --- a/sw/qa/api/SwXDocumentIndexes.cxx +++ b/sw/qa/api/SwXDocumentIndexes.cxx @@ -43,16 +43,10 @@ public: { } - virtual void setUp() override - { - UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(m_xContext)); - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); - CPPUNIT_ASSERT(mxComponent.is()); - } - Reference init() override { + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, + u"com.sun.star.text.TextDocument"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXDocumentSettings.cxx b/sw/qa/api/SwXDocumentSettings.cxx index 31fbdceef06e..f88b6a1e60a9 100644 --- a/sw/qa/api/SwXDocumentSettings.cxx +++ b/sw/qa/api/SwXDocumentSettings.cxx @@ -7,12 +7,11 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include +#include #include #include #include #include -#include #include @@ -28,22 +27,16 @@ namespace /** * Test for Java API test of file com.sun.star.comp.Writer.DocumentSettings.csv */ -class SwXDocumentSettings final : public test::BootstrapFixture, - public unotest::MacrosTest, +class SwXDocumentSettings final : public UnoApiTest, public apitest::TextDocumentSettings, public apitest::TextSettings, public apitest::TextPrinterSettings, public apitest::XServiceInfo { -private: - uno::Reference mxComponent; - public: - virtual void setUp() override; - virtual void tearDown() override; - SwXDocumentSettings() - : apitest::XServiceInfo(u"SwXDocumentSettings"_ustr, + : UnoApiTest(u""_ustr) + , apitest::XServiceInfo(u"SwXDocumentSettings"_ustr, u"com.sun.star.text.DocumentSettings"_ustr){}; uno::Reference init() override; @@ -57,21 +50,6 @@ public: CPPUNIT_TEST_SUITE_END(); }; -void SwXDocumentSettings::setUp() -{ - test::BootstrapFixture::setUp(); - - mxDesktop.set(frame::Desktop::create(m_xContext)); -} - -void SwXDocumentSettings::tearDown() -{ - if (mxComponent.is()) - mxComponent->dispose(); - - test::BootstrapFixture::tearDown(); -} - uno::Reference SwXDocumentSettings::init() { mxComponent diff --git a/sw/qa/api/SwXFieldEnumeration.cxx b/sw/qa/api/SwXFieldEnumeration.cxx index e94d43ee4a5d..cb9998a4e094 100644 --- a/sw/qa/api/SwXFieldEnumeration.cxx +++ b/sw/qa/api/SwXFieldEnumeration.cxx @@ -38,16 +38,10 @@ public: { } - virtual void setUp() override - { - UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(m_xContext)); - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); - CPPUNIT_ASSERT(mxComponent.is()); - } - Reference init() override { + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, + u"com.sun.star.text.TextDocument"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXFootnote.cxx b/sw/qa/api/SwXFootnote.cxx index f0e189e0aba2..686494312ddc 100644 --- a/sw/qa/api/SwXFootnote.cxx +++ b/sw/qa/api/SwXFootnote.cxx @@ -7,7 +7,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include +#include #include #include #include @@ -15,7 +15,6 @@ #include #include #include -#include #include @@ -35,8 +34,7 @@ namespace /** * Initial tests for SwXFootnote. */ -class SwXFootnote final : public test::BootstrapFixture, - public unotest::MacrosTest, +class SwXFootnote final : public UnoApiTest, public apitest::XComponent, public apitest::XSimpleText, public apitest::XTextRange, @@ -46,14 +44,12 @@ class SwXFootnote final : public test::BootstrapFixture, public apitest::Footnote { public: - virtual void setUp() override; - void tearDown() override; + SwXFootnote(); Reference init() override; Reference getTextRange() override; Reference getTextContent() override; bool isAttachSupported() override { return true; } - Reference getTextDocument() { return mxTextDocument; } void triggerDesktopTerminate() override {} CPPUNIT_TEST_SUITE(SwXFootnote); @@ -76,38 +72,25 @@ public: CPPUNIT_TEST_SUITE_END(); private: - Reference mxTextDocument; Reference mxTextRange; Reference mxTextContent; }; -void SwXFootnote::setUp() +SwXFootnote::SwXFootnote() + : UnoApiTest(u""_ustr) { - test::BootstrapFixture::setUp(); - - mxDesktop.set(frame::Desktop::create(m_xContext)); - mxTextDocument = Reference( - loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr), - uno::UNO_QUERY_THROW); - CPPUNIT_ASSERT(mxTextDocument.is()); -} - -void SwXFootnote::tearDown() -{ - if (mxTextDocument.is()) - mxTextDocument->dispose(); - - test::BootstrapFixture::tearDown(); } Reference SwXFootnote::init() { - Reference xMSF(mxTextDocument, UNO_QUERY_THROW); - + mxComponent + = loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr); + Reference xTextDocument(mxComponent, UNO_QUERY_THROW); + Reference xMSF(mxComponent, UNO_QUERY_THROW); Reference xFootnote(xMSF->createInstance(u"com.sun.star.text.Footnote"_ustr), UNO_QUERY_THROW); - Reference xText = getTextDocument()->getText(); + Reference xText = xTextDocument->getText(); Reference xCursor = xText->createTextCursor(); xText->insertTextContent(xCursor, xFootnote, false); diff --git a/sw/qa/api/SwXFootnoteProperties.cxx b/sw/qa/api/SwXFootnoteProperties.cxx index 69e58b4fca7e..a7572fa573ab 100644 --- a/sw/qa/api/SwXFootnoteProperties.cxx +++ b/sw/qa/api/SwXFootnoteProperties.cxx @@ -7,10 +7,9 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include +#include #include #include -#include #include @@ -31,52 +30,32 @@ namespace /** * Initial tests for SwXFootnoteProperties. */ -class SwXFootnoteProperties final : public test::BootstrapFixture, - public unotest::MacrosTest, +class SwXFootnoteProperties final : public UnoApiTest, public apitest::XElementAccess, public apitest::XIndexAccess { public: SwXFootnoteProperties(); - virtual void setUp() override; - void tearDown() override; Reference init() override; CPPUNIT_TEST_SUITE(SwXFootnoteProperties); CPPUNIT_TEST_SUITE_END(); - -private: - uno::Reference component_; }; SwXFootnoteProperties::SwXFootnoteProperties() - : XElementAccess(cppu::UnoType::get()) + : UnoApiTest(u""_ustr) + , XElementAccess(cppu::UnoType::get()) , XIndexAccess(3) { } -void SwXFootnoteProperties::setUp() -{ - test::BootstrapFixture::setUp(); - mxDesktop.set( - frame::Desktop::create(comphelper::getComponentContext(getMultiServiceFactory()))); -} - -void SwXFootnoteProperties::tearDown() -{ - if (component_.is()) - component_->dispose(); - - test::BootstrapFixture::tearDown(); -} - Reference SwXFootnoteProperties::init() { - component_ + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr); - Reference xTextDocument(component_, UNO_QUERY_THROW); - Reference xMSF(component_, UNO_QUERY_THROW); + Reference xTextDocument(mxComponent, UNO_QUERY_THROW); + Reference xMSF(mxComponent, UNO_QUERY_THROW); Reference xFootnote(xMSF->createInstance(u"com.sun.star.text.Footnote"_ustr), UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXFootnoteText.cxx b/sw/qa/api/SwXFootnoteText.cxx index 14eb0c510139..d552aa386ba3 100644 --- a/sw/qa/api/SwXFootnoteText.cxx +++ b/sw/qa/api/SwXFootnoteText.cxx @@ -7,14 +7,13 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include +#include #include #include #include #include #include #include -#include #include @@ -35,8 +34,7 @@ namespace /** * Initial tests for SwXFootnoteText. */ -class SwXFootnoteText final : public test::BootstrapFixture, - public unotest::MacrosTest, +class SwXFootnoteText final : public UnoApiTest, public apitest::XElementAccess, public apitest::XSimpleText, public apitest::XTextRange, @@ -46,8 +44,6 @@ class SwXFootnoteText final : public test::BootstrapFixture, { public: SwXFootnoteText(); - virtual void setUp() override; - void tearDown() override; Reference init() override; Reference getTextContent() override { return mxTextContent; }; @@ -70,36 +66,21 @@ public: CPPUNIT_TEST_SUITE_END(); private: - Reference component_; Reference mxTextContent; }; SwXFootnoteText::SwXFootnoteText() - : XElementAccess(cppu::UnoType::get()) + : UnoApiTest(u""_ustr) + , XElementAccess(cppu::UnoType::get()) { } -void SwXFootnoteText::setUp() -{ - test::BootstrapFixture::setUp(); - mxDesktop.set( - frame::Desktop::create(comphelper::getComponentContext(getMultiServiceFactory()))); -} - -void SwXFootnoteText::tearDown() -{ - if (component_.is()) - component_->dispose(); - - test::BootstrapFixture::tearDown(); -} - Reference SwXFootnoteText::init() { - component_ + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr); - Reference xTextDocument(component_, UNO_QUERY_THROW); - Reference xMSF(component_, UNO_QUERY_THROW); + Reference xTextDocument(mxComponent, UNO_QUERY_THROW); + Reference xMSF(mxComponent, UNO_QUERY_THROW); Reference xFootnote(xMSF->createInstance(u"com.sun.star.text.Footnote"_ustr), UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXFootnotes.cxx b/sw/qa/api/SwXFootnotes.cxx index f6ac8a7e2b53..fae9d6938587 100644 --- a/sw/qa/api/SwXFootnotes.cxx +++ b/sw/qa/api/SwXFootnotes.cxx @@ -42,16 +42,10 @@ public: { } - virtual void setUp() override - { - UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(m_xContext)); - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); - CPPUNIT_ASSERT(mxComponent.is()); - } - Reference init() override { + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, + u"com.sun.star.text.TextDocument"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXFrames.cxx b/sw/qa/api/SwXFrames.cxx index 41fa1beae80c..b9745d9af20a 100644 --- a/sw/qa/api/SwXFrames.cxx +++ b/sw/qa/api/SwXFrames.cxx @@ -43,16 +43,10 @@ public: { } - virtual void setUp() override - { - UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(m_xContext)); - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); - CPPUNIT_ASSERT(mxComponent.is()); - } - Reference init() override { + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, + u"com.sun.star.text.TextDocument"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXHeadFootText.cxx b/sw/qa/api/SwXHeadFootText.cxx index 6c873aef66bf..3059af980b33 100644 --- a/sw/qa/api/SwXHeadFootText.cxx +++ b/sw/qa/api/SwXHeadFootText.cxx @@ -7,14 +7,13 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include +#include #include #include #include #include #include #include -#include #include @@ -37,8 +36,7 @@ namespace /** * Initial tests for SwXHeadFootText. */ -class SwXHeadFootText final : public test::BootstrapFixture, - public unotest::MacrosTest, +class SwXHeadFootText final : public UnoApiTest, public apitest::XElementAccess, public apitest::XSimpleText, public apitest::XTextRange, @@ -48,8 +46,6 @@ class SwXHeadFootText final : public test::BootstrapFixture, { public: SwXHeadFootText(); - virtual void setUp() override; - void tearDown() override; Reference init() override; Reference getTextContent() override { return mxTextContent; }; @@ -72,36 +68,21 @@ public: CPPUNIT_TEST_SUITE_END(); private: - Reference component_; Reference mxTextContent; }; SwXHeadFootText::SwXHeadFootText() - : XElementAccess(cppu::UnoType::get()) + : UnoApiTest(u""_ustr) + , XElementAccess(cppu::UnoType::get()) { } -void SwXHeadFootText::setUp() -{ - test::BootstrapFixture::setUp(); - mxDesktop.set( - frame::Desktop::create(comphelper::getComponentContext(getMultiServiceFactory()))); -} - -void SwXHeadFootText::tearDown() -{ - if (component_.is()) - component_->dispose(); - - test::BootstrapFixture::tearDown(); -} - Reference SwXHeadFootText::init() { - component_ + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr); - Reference xTextDocument(component_, UNO_QUERY_THROW); - Reference xMSF(component_, UNO_QUERY_THROW); + Reference xTextDocument(mxComponent, UNO_QUERY_THROW); + Reference xMSF(mxComponent, UNO_QUERY_THROW); Reference xStyleFam(xTextDocument, UNO_QUERY_THROW); Reference xStyleFamNames = xStyleFam->getStyleFamilies(); diff --git a/sw/qa/api/SwXNumberingRules.cxx b/sw/qa/api/SwXNumberingRules.cxx index 46baadfde0b6..aecc71c9022f 100644 --- a/sw/qa/api/SwXNumberingRules.cxx +++ b/sw/qa/api/SwXNumberingRules.cxx @@ -49,16 +49,10 @@ public: { } - virtual void setUp() override - { - UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(m_xContext)); - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); - CPPUNIT_ASSERT(mxComponent.is()); - } - Reference init() override { + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, + u"com.sun.star.text.TextDocument"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xIndexAccess; diff --git a/sw/qa/api/SwXParagraphEnumeration.cxx b/sw/qa/api/SwXParagraphEnumeration.cxx index 0a8f08a17ed3..e3a2b3d45e92 100644 --- a/sw/qa/api/SwXParagraphEnumeration.cxx +++ b/sw/qa/api/SwXParagraphEnumeration.cxx @@ -39,16 +39,10 @@ public: { } - virtual void setUp() override - { - UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(m_xContext)); - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); - CPPUNIT_ASSERT(mxComponent.is()); - } - Reference init() override { + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, + u"com.sun.star.text.TextDocument"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXReferenceMark.cxx b/sw/qa/api/SwXReferenceMark.cxx index a1f0814ead7f..0f56a07c29ee 100644 --- a/sw/qa/api/SwXReferenceMark.cxx +++ b/sw/qa/api/SwXReferenceMark.cxx @@ -41,16 +41,10 @@ public: { } - virtual void setUp() override - { - UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(m_xContext)); - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); - CPPUNIT_ASSERT(mxComponent.is()); - } - Reference init() override { + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, + u"com.sun.star.text.TextDocument"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXReferenceMarks.cxx b/sw/qa/api/SwXReferenceMarks.cxx index f03f3e78002a..d359f7cdddf3 100644 --- a/sw/qa/api/SwXReferenceMarks.cxx +++ b/sw/qa/api/SwXReferenceMarks.cxx @@ -45,16 +45,10 @@ public: { } - virtual void setUp() override - { - UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(m_xContext)); - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); - CPPUNIT_ASSERT(mxComponent.is()); - } - Reference init() override { + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, + u"com.sun.star.text.TextDocument"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(xTextDocument, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXStyleFamilies.cxx b/sw/qa/api/SwXStyleFamilies.cxx index 7c30896222e6..6928896a430b 100644 --- a/sw/qa/api/SwXStyleFamilies.cxx +++ b/sw/qa/api/SwXStyleFamilies.cxx @@ -45,16 +45,10 @@ public: { } - virtual void setUp() override - { - UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(m_xContext)); - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); - CPPUNIT_ASSERT(mxComponent.is()); - } - Reference init() override { + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, + u"com.sun.star.text.TextDocument"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXTableCellText.cxx b/sw/qa/api/SwXTableCellText.cxx index 568d809a933f..6ac75ab2ac70 100644 --- a/sw/qa/api/SwXTableCellText.cxx +++ b/sw/qa/api/SwXTableCellText.cxx @@ -46,16 +46,10 @@ public: { } - virtual void setUp() override - { - UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(m_xContext)); - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); - CPPUNIT_ASSERT(mxComponent.is()); - } - Reference init() override { + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, + u"com.sun.star.text.TextDocument"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXTextEmbeddedObjects.cxx b/sw/qa/api/SwXTextEmbeddedObjects.cxx index 0ee5ed269702..27ee002c4a72 100644 --- a/sw/qa/api/SwXTextEmbeddedObjects.cxx +++ b/sw/qa/api/SwXTextEmbeddedObjects.cxx @@ -48,16 +48,10 @@ public: { } - virtual void setUp() override - { - UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(m_xContext)); - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); - CPPUNIT_ASSERT(mxComponent.is()); - } - Reference init() override { + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, + u"com.sun.star.text.TextDocument"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXTextField.cxx b/sw/qa/api/SwXTextField.cxx index fe93fc7ff141..c02de9f134cb 100644 --- a/sw/qa/api/SwXTextField.cxx +++ b/sw/qa/api/SwXTextField.cxx @@ -51,16 +51,10 @@ struct SwXTextField final : public UnoApiTest, { } - virtual void setUp() override - { - UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(m_xContext)); - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); - CPPUNIT_ASSERT(mxComponent.is()); - } - Reference init() override { + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, + u"com.sun.star.text.TextDocument"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXTextFieldMasters.cxx b/sw/qa/api/SwXTextFieldMasters.cxx index 27fe5aaee579..fb07a53933e3 100644 --- a/sw/qa/api/SwXTextFieldMasters.cxx +++ b/sw/qa/api/SwXTextFieldMasters.cxx @@ -42,16 +42,10 @@ public: { } - virtual void setUp() override - { - UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(m_xContext)); - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); - CPPUNIT_ASSERT(mxComponent.is()); - } - Reference init() override { + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, + u"com.sun.star.text.TextDocument"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xTFS; diff --git a/sw/qa/api/SwXTextFieldTypes.cxx b/sw/qa/api/SwXTextFieldTypes.cxx index f11c6620d20f..6ac1cad4749a 100644 --- a/sw/qa/api/SwXTextFieldTypes.cxx +++ b/sw/qa/api/SwXTextFieldTypes.cxx @@ -42,19 +42,11 @@ public: { } - virtual void setUp() override - { - UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(m_xContext)); - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); - CPPUNIT_ASSERT(mxComponent.is()); - } - Reference init() override { - component_ = loadFromDesktop(u"private:factory/swriter"_ustr, - u"com.sun.star.text.TextDocument"_ustr); - Reference xTextDocument(component_, UNO_QUERY_THROW); + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, + u"com.sun.star.text.TextDocument"_ustr); + Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xTFS; @@ -75,9 +67,6 @@ public: CPPUNIT_TEST(testCreateEnumeration); CPPUNIT_TEST(testRefreshListener); CPPUNIT_TEST_SUITE_END(); - -private: - Reference component_; }; CPPUNIT_TEST_SUITE_REGISTRATION(SwXTextFieldTypes); diff --git a/sw/qa/api/SwXTextFrame.cxx b/sw/qa/api/SwXTextFrame.cxx index b01d625604df..970011d64aef 100644 --- a/sw/qa/api/SwXTextFrame.cxx +++ b/sw/qa/api/SwXTextFrame.cxx @@ -36,16 +36,10 @@ public: { } - virtual void setUp() override - { - UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(m_xContext)); - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); - CPPUNIT_ASSERT(mxComponent.is()); - } - uno::Reference init() override { + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, + u"com.sun.star.text.TextDocument"_ustr); uno::Reference xMSF(mxComponent, uno::UNO_QUERY_THROW); uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY_THROW); uno::Reference xTextFrame( diff --git a/sw/qa/api/SwXTextSections.cxx b/sw/qa/api/SwXTextSections.cxx index 4bc4eb6254c9..60502dfcc801 100644 --- a/sw/qa/api/SwXTextSections.cxx +++ b/sw/qa/api/SwXTextSections.cxx @@ -46,16 +46,10 @@ public: { } - virtual void setUp() override - { - UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(m_xContext)); - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); - CPPUNIT_ASSERT(mxComponent.is()); - } - Reference init() override { + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, + u"com.sun.star.text.TextDocument"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); diff --git a/sw/qa/api/SwXTextTable.cxx b/sw/qa/api/SwXTextTable.cxx index f682789b4d1c..c0bd7226de56 100644 --- a/sw/qa/api/SwXTextTable.cxx +++ b/sw/qa/api/SwXTextTable.cxx @@ -7,9 +7,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include +#include #include -#include #include #include @@ -29,12 +28,9 @@ namespace /** * Initial tests for SwXTextTable. */ -struct SwXTextTable final : public test::BootstrapFixture, - public unotest::MacrosTest, - public apitest::XComponent +struct SwXTextTable final : public UnoApiTest, public apitest::XComponent { - virtual void setUp() override; - void tearDown() override; + SwXTextTable(); Reference init() override; void triggerDesktopTerminate() override; @@ -43,34 +39,21 @@ struct SwXTextTable final : public test::BootstrapFixture, CPPUNIT_TEST(testAddEventListener); CPPUNIT_TEST(testRemoveEventListener); CPPUNIT_TEST_SUITE_END(); - -private: - css::uno::Reference component_; }; -void SwXTextTable::setUp() +SwXTextTable::SwXTextTable() + : UnoApiTest(u""_ustr) { - test::BootstrapFixture::setUp(); - mxDesktop.set( - frame::Desktop::create(comphelper::getComponentContext(getMultiServiceFactory()))); -} - -void SwXTextTable::tearDown() -{ - if (component_.is()) - { - component_->dispose(); - } } void SwXTextTable::triggerDesktopTerminate() { mxDesktop->terminate(); } Reference SwXTextTable::init() { - component_ + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, u"com.sun.star.text.TextDocument"_ustr); - Reference xTextDocument(component_, UNO_QUERY_THROW); - Reference xMSF(component_, UNO_QUERY_THROW); + Reference xTextDocument(mxComponent, UNO_QUERY_THROW); + Reference xMSF(mxComponent, UNO_QUERY_THROW); Reference xText = xTextDocument->getText(); Reference xCursor = xText->createTextCursor(); Reference xTable(xMSF->createInstance(u"com.sun.star.text.TextTable"_ustr), diff --git a/sw/qa/api/SwXTextTables.cxx b/sw/qa/api/SwXTextTables.cxx index e9d3f135ccda..d89546805170 100644 --- a/sw/qa/api/SwXTextTables.cxx +++ b/sw/qa/api/SwXTextTables.cxx @@ -43,16 +43,10 @@ public: { } - virtual void setUp() override - { - UnoApiTest::setUp(); - mxDesktop.set(frame::Desktop::create(m_xContext)); - mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr); - CPPUNIT_ASSERT(mxComponent.is()); - } - Reference init() override { + mxComponent = loadFromDesktop(u"private:factory/swriter"_ustr, + u"com.sun.star.text.TextDocument"_ustr); Reference xTextDocument(mxComponent, UNO_QUERY_THROW); Reference xMSF(mxComponent, UNO_QUERY_THROW); From c10a40e2b7c7ae849ce0590aa784f7d770241dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sat, 6 Jul 2024 21:21:52 +0100 Subject: [PATCH 187/232] cid#1545729 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I0a811d37996e53b9a9a0bddcc265521a1125d594 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170074 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- include/oox/drawingml/shape.hxx | 4 ++-- oox/source/drawingml/shape.cxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/oox/drawingml/shape.hxx b/include/oox/drawingml/shape.hxx index 894d42ca89c3..dbde9abd4bc7 100644 --- a/include/oox/drawingml/shape.hxx +++ b/include/oox/drawingml/shape.hxx @@ -209,7 +209,7 @@ public: const basegfx::B2DHomMatrix& aTransformation, const FillProperties& rShapeOrParentShapeFillProps, ShapeIdMap* pShapeMap = nullptr, - oox::drawingml::ShapePtr pParentGroupShape = nullptr); + const oox::drawingml::ShapePtr& pParentGroupShape = nullptr); const css::uno::Reference< css::drawing::XShape > & getXShape() const { return mxShape; } @@ -296,7 +296,7 @@ protected: bool bDoNotInsertEmptyTextBody, basegfx::B2DHomMatrix& aTransformation, const FillProperties& rShapeOrParentShapeFillProps, - oox::drawingml::ShapePtr pParentGroupShape = nullptr + const oox::drawingml::ShapePtr& pParentGroupShape = nullptr ); SAL_DLLPRIVATE void addChildren( diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index 4c7de78b8817..ce94175a94aa 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -383,7 +383,7 @@ void Shape::addShape( const basegfx::B2DHomMatrix& aTransformation, const FillProperties& rShapeOrParentShapeFillProps, ShapeIdMap* pShapeMap, - oox::drawingml::ShapePtr pParentGroupShape) + const oox::drawingml::ShapePtr& pParentGroupShape) { SAL_INFO("oox.drawingml", "Shape::addShape: id='" << msId << "'"); @@ -908,7 +908,7 @@ Reference< XShape > const & Shape::createAndInsert( bool bDoNotInsertEmptyTextBody, basegfx::B2DHomMatrix& aParentTransformation, const FillProperties& rShapeOrParentShapeFillProps, - oox::drawingml::ShapePtr pParentGroupShape) + const oox::drawingml::ShapePtr& pParentGroupShape) { bool bIsEmbMedia = false; SAL_INFO("oox.drawingml", "Shape::createAndInsert: id='" << msId << "' service='" << rServiceName << "'"); From 9320cb2f78b65d0ba1898e95e617194e6031370c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sat, 6 Jul 2024 21:23:07 +0100 Subject: [PATCH 188/232] cid#1545821 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I41fd2d990c83b88138b18652d41b8b2e55aaa8e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170075 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- sw/source/uibase/shells/textsh1.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 0144b01dbfaf..7e07f1438813 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -1627,7 +1627,7 @@ void SwTextShell::Execute(SfxRequest &rReq) rReq.Ignore(); // the 'old' request is not relevant any more auto vCursors = CopyPaMRing(*pPaM); // tdf#134439 make a copy to use at later apply - pDlg->StartExecuteAsync([pDlg, &rWrtSh, pDrawModel, pRequest, nDefDist, vCursors](sal_Int32 nResult){ + pDlg->StartExecuteAsync([pDlg, &rWrtSh, pDrawModel, pRequest=std::move(pRequest), nDefDist, vCursors](sal_Int32 nResult){ if (nResult == RET_OK) { // Apply defaults if necessary. From b8e46cb2f5d7433f5ed88b02a4a9d0186409d84b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sat, 6 Jul 2024 21:25:02 +0100 Subject: [PATCH 189/232] cid#1545961 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I40a4dc9bc13bfb769b2f9f15b0ab1ff9490639da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170076 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- editeng/source/xml/xmltxtimp.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/editeng/source/xml/xmltxtimp.cxx b/editeng/source/xml/xmltxtimp.cxx index d3626e7de8e3..7d708d0d75d8 100644 --- a/editeng/source/xml/xmltxtimp.cxx +++ b/editeng/source/xml/xmltxtimp.cxx @@ -164,7 +164,8 @@ EditPaM SvxReadXML( EditEngine& rEditEngine, SvStream& rStream, const ESelection { uno::Reference xContext( ::comphelper::getProcessComponentContext() ); - uno::Reference xInputStream = new utl::OInputStreamWrapper( rStream ); + xml::sax::InputSource aParserInput; + aParserInput.aInputStream = new utl::OInputStreamWrapper(rStream); /* testcode static constexpr OUStringLiteral aURL( u"file:///e:/test.xml" ); @@ -201,8 +202,6 @@ EditPaM SvxReadXML( EditEngine& rEditEngine, SvStream& rStream, const ESelection // uno::Reference< XDocumentHandler > xHandler( new SvxXMLXTextImportComponent( xText ) ); rtl::Reference< SvxXMLXTextImportComponent > xImport( new SvxXMLXTextImportComponent( xContext, pUnoText ) ); - xml::sax::InputSource aParserInput; - aParserInput.aInputStream = xInputStream; // aParserInput.sSystemId = aMedium.GetName(); xImport->parseStream( aParserInput ); } From 578a9d4ab0fead1639bfaa432bfe6f189ddc2038 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sat, 6 Jul 2024 21:26:41 +0100 Subject: [PATCH 190/232] cid#1545993 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I3234bce1f3b71f10529d5874552566d7abcb3a95 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170077 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- vcl/source/gdi/pdfwriter_impl.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 65325a0c938d..3f6d9bbcbfdd 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -3771,13 +3771,13 @@ we check in the following sequence: } else { - INetURLObject aNewURL(rtl::Uri::convertRelToAbs( + //reassign the new target URL + aTargetURL = INetURLObject(rtl::Uri::convertRelToAbs( (m_aContext.BaseURL.getLength() > 0 ? m_aContext.BaseURL : //use dummy location if empty u"http://ahost.ax"_ustr), url)); - aTargetURL = aNewURL; //reassign the new target URL //recompute the target protocol, with the new URL //normal URL processing resumes From 5c13cfd43dff1050b046633f6ebe8dce3298680d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sat, 6 Jul 2024 21:27:39 +0100 Subject: [PATCH 191/232] cid#1546123 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I648c23c4dc739aae73e8ec39be801400cb16c79a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170078 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- framework/source/uielement/toolbarsmenucontroller.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx index 9e5055ccfd37..309b590dd642 100644 --- a/framework/source/uielement/toolbarsmenucontroller.cxx +++ b/framework/source/uielement/toolbarsmenucontroller.cxx @@ -279,11 +279,10 @@ Sequence< Sequence< css::beans::PropertyValue > > ToolbarsMenuController::getLay const sal_uInt32 nCount = aToolBarArray.size(); for ( sal_uInt32 i = 0; i < nCount; i++ ) { - Sequence< css::beans::PropertyValue > aTbSeq{ + pSeq[i] = Sequence{ comphelper::makePropertyValue(g_aPropUIName, aToolBarArray[i].aToolBarUIName), comphelper::makePropertyValue(g_aPropResourceURL, aToolBarArray[i].aToolBarResName) }; - pSeq[i] = aTbSeq; } return aSeq; From 98ae74f85e08644be95e955449f0021d2f4151c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sat, 6 Jul 2024 21:28:38 +0100 Subject: [PATCH 192/232] cid#1546189 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ia286c035d64aa1534606a7561f3b5a89d66315df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170079 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- sw/source/core/access/accpara.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index 4be4a5feb4a2..64a1e622c272 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -1525,8 +1525,7 @@ void SwAccessibleParagraph::_getDefaultAttributesImpl( { PropertyValue rPropVal; rPropVal.Name = UNO_NAME_PARA_STYLE_NAME; - uno::Any aVal( uno::Any( pTextNode->GetTextColl()->GetName() ) ); - rPropVal.Value = aVal; + rPropVal.Value <<= pTextNode->GetTextColl()->GetName(); rPropVal.Handle = -1; rPropVal.State = beans::PropertyState_DEFAULT_VALUE; From cb57efe8db91d90f45b1f31e583520e0046133aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sat, 6 Jul 2024 21:30:18 +0100 Subject: [PATCH 193/232] cid#1546226 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ie7bc7b7164f12e167fd6a102c5ed10b71077239a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170080 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- xmloff/source/text/txtflde.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index ad6cf90b3be9..d13c54c9707e 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -774,8 +774,7 @@ void XMLTextFieldExport::ExportFieldAutoStyle( // insert a list for our XText (if necessary) if (aMapIter == moUsedMasters->end()) { - std::set aSet; - (*moUsedMasters)[xOurText] = aSet; + (*moUsedMasters)[xOurText] = std::set(); aMapIter = moUsedMasters->find(xOurText); } From 07821a3516a85c4208e519d93eb018b823d33aed Mon Sep 17 00:00:00 2001 From: Andrea Gelmini Date: Sun, 7 Jul 2024 12:30:11 +0200 Subject: [PATCH 194/232] Fix typo Change-Id: I68649c1b71fa5455f2bc2edd9d773820299e60f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170095 Tested-by: Julien Nabet Reviewed-by: Julien Nabet --- include/svx/svdsnpv.hxx | 2 +- sw/source/core/undo/undraw.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/svx/svdsnpv.hxx b/include/svx/svdsnpv.hxx index a7390ad49ad6..15f2814dcfa2 100644 --- a/include/svx/svdsnpv.hxx +++ b/include/svx/svdsnpv.hxx @@ -268,7 +268,7 @@ public: void SetSlantButShear(bool bOn) { bSlantButShear=bOn; } bool IsSlantButShear() const { return bSlantButShear; } - // Don't contort objecte while Crook. persistent. Default=FALSE. (ni) + // Don't contort object while Crook. persistent. Default=FALSE. (ni) void SetCrookNoContortion(bool bOn) { bCrookNoContortion=bOn; } bool IsCrookNoContortion() const { return bCrookNoContortion; } diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx index 1838522b3bc0..2365c9b57156 100644 --- a/sw/source/core/undo/undraw.cxx +++ b/sw/source/core/undo/undraw.cxx @@ -50,7 +50,7 @@ struct SwUndoGroupObjImpl SwNodeOffset nNodeIdx; }; -// Draw-Objecte +// Draw-Object void SwDoc::AddDrawUndo( std::unique_ptr pUndo ) { From a74d99644626421fa8e4ba0728f876afe72f28e4 Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Sun, 7 Jul 2024 14:15:10 +0200 Subject: [PATCH 195/232] Update git submodules * Update helpcontent2 from branch 'master' to a1ed29aa5320041c72f025e43a9eeabe3bdc2289 - Fix dup in sbasic/shared/vba_objects.xhp Change-Id: Ia9019ca5f5129f5d2741941df19622de5ee403eb Reviewed-on: https://gerrit.libreoffice.org/c/help/+/170109 Tested-by: Jenkins Reviewed-by: Julien Nabet --- helpcontent2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpcontent2 b/helpcontent2 index ce6b950180c0..a1ed29aa5320 160000 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit ce6b950180c0174cd1b73b37b9fbf7310fe56dbf +Subproject commit a1ed29aa5320041c72f025e43a9eeabe3bdc2289 From 942864606dcb770485e8fc11fb312f12cceadace Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Sun, 7 Jul 2024 10:58:55 +0200 Subject: [PATCH 196/232] sw: simplify code by checking pointer directly Change-Id: I873e2d8856e9ceb23a5d0ca5b907c332a8238441 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170087 Tested-by: Jenkins Reviewed-by: Xisco Fauli Reviewed-by: Noel Grandin --- sw/inc/unotxdoc.hxx | 1 - sw/source/uibase/uno/unotxdoc.cxx | 17 +++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx index d938773d17dd..38d67effb9ff 100644 --- a/sw/inc/unotxdoc.hxx +++ b/sw/inc/unotxdoc.hxx @@ -181,7 +181,6 @@ private: const SfxItemPropertySet* m_pPropSet; SwDocShell* m_pDocShell; - bool m_bObjectValid; rtl::Reference m_xDrawPage; diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 0b6b2ed53191..5b4c7d055694 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -381,7 +381,6 @@ SwXTextDocument::SwXTextDocument(SwDocShell* pShell) , m_pPropSet(aSwMapProvider.GetPropertySet(PROPERTY_MAP_TEXT_DOCUMENT)), m_pDocShell(pShell), - m_bObjectValid(pShell != nullptr), m_pHiddenViewFrame(nullptr), // #i117783# m_bApplyPagePrintSettingsFromXPagePrintable( false ) @@ -390,7 +389,7 @@ SwXTextDocument::SwXTextDocument(SwDocShell* pShell) void SwXTextDocument::ThrowIfInvalid() const { - if (!m_bObjectValid) + if (!m_pDocShell) throw DisposedException(u"SwXTextDocument not valid"_ustr, const_cast(this)->getXWeak()); } @@ -442,7 +441,7 @@ SwXDocumentPropertyHelper * SwXTextDocument::GetPropertyHelper () void SwXTextDocument::GetNumberFormatter() { - if (!m_bObjectValid) + if (!m_pDocShell) return; if(!m_xNumFormatAgg.is()) @@ -529,7 +528,7 @@ Reference< XInterface > SwXTextDocument::getCurrentSelection() { SolarMutexGuard aGuard; Reference< XInterface > xRef; - if (m_bObjectValid) + if (m_pDocShell) { SwView* pView = static_cast(SfxViewShell::GetFirst(true, checkSfxViewShell)); while(pView && pView->GetObjectShell() != m_pDocShell) @@ -587,7 +586,7 @@ void SwXTextDocument::close( sal_Bool bDeliverOwnership ) m_pDocShell->CallAutomationDocumentEventSinks( u"Close"_ustr, aArgs ); } SolarMutexGuard aGuard; - if (m_bObjectValid && m_pHiddenViewFrame) + if (m_pDocShell && m_pHiddenViewFrame) lcl_DisposeView( m_pHiddenViewFrame, m_pDocShell); SfxBaseModel::close(bDeliverOwnership); } @@ -1372,7 +1371,7 @@ uno::Reference SAL_CALL SwXTextDocument::getDrawPages() void SwXTextDocument::Invalidate() { - m_bObjectValid = false; + m_pDocShell = nullptr; if(m_xNumFormatAgg.is()) { const uno::Type& rTunnelType = cppu::UnoType::get(); @@ -1387,7 +1386,6 @@ void SwXTextDocument::Invalidate() OSL_ENSURE(pNumFormat, "No number formatter available"); } InitNewDoc(); - m_pDocShell = nullptr; lang::EventObject const ev(getXWeak()); std::unique_lock aGuard(m_pImpl->m_Mutex); m_pImpl->m_RefreshListeners.disposeAndClear(aGuard, ev); @@ -1398,7 +1396,6 @@ void SwXTextDocument::Reactivate(SwDocShell* pNewDocShell) if(m_pDocShell && m_pDocShell != pNewDocShell) Invalidate(); m_pDocShell = pNewDocShell; - m_bObjectValid = true; } void SwXTextDocument::InitNewDoc() @@ -3190,7 +3187,7 @@ void SwXTextDocument::addPasteEventListener(const uno::ReferenceGetWrtShell()->GetPasteListeners().addInterface(xListener); } @@ -3199,7 +3196,7 @@ void SwXTextDocument::removePasteEventListener( { SolarMutexGuard aGuard; - if (m_bObjectValid && xListener.is()) + if (m_pDocShell && xListener.is()) m_pDocShell->GetWrtShell()->GetPasteListeners().removeInterface(xListener); } From 18da0b566d5dbcd8e26f2e6bff41249189fb05cd Mon Sep 17 00:00:00 2001 From: Olivier Hallot Date: Sun, 7 Jul 2024 17:08:24 +0200 Subject: [PATCH 197/232] Update git submodules * Update helpcontent2 from branch 'master' to f2bf7ec5f1192052bc00bdb113885a41e6fb901b - Fix example for COUPDAYS. Change-Id: Id63a3d2a80aa0c829d1507185467ff575beaac3a Reviewed-on: https://gerrit.libreoffice.org/c/help/+/170036 Reviewed-by: Olivier Hallot Tested-by: Jenkins --- helpcontent2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helpcontent2 b/helpcontent2 index a1ed29aa5320..f2bf7ec5f119 160000 --- a/helpcontent2 +++ b/helpcontent2 @@ -1 +1 @@ -Subproject commit a1ed29aa5320041c72f025e43a9eeabe3bdc2289 +Subproject commit f2bf7ec5f1192052bc00bdb113885a41e6fb901b From c8bec7d4b311723141d509cfeb74c5118661461c Mon Sep 17 00:00:00 2001 From: Regina Henschel Date: Sun, 7 Jul 2024 02:23:21 +0200 Subject: [PATCH 198/232] tdf#161483 enable chart read text rotate angle unit Without the patch chart has ignored the units in ODF attribute style:rotate-angle. The patch uses the method sax::Converter::convertAngle(), that was introduced in commit 9f62c7a0f2333d1b7d179a43b3b0341dba7554a1 Change-Id: I606dc1e64c6ba5ee7d1f77d67a936e85f437ed93 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170083 Tested-by: Jenkins Reviewed-by: Regina Henschel --- chart2/qa/extras/chart2import2.cxx | 54 + .../data/fods/tdf161483_AngleUnits.fods | 1851 +++++++++++++++++ xmloff/source/chart/PropertyMaps.cxx | 4 +- 3 files changed, 1907 insertions(+), 2 deletions(-) create mode 100644 chart2/qa/extras/data/fods/tdf161483_AngleUnits.fods diff --git a/chart2/qa/extras/chart2import2.cxx b/chart2/qa/extras/chart2import2.cxx index 75adcd12c105..4fb757cffe9a 100644 --- a/chart2/qa/extras/chart2import2.cxx +++ b/chart2/qa/extras/chart2import2.cxx @@ -888,6 +888,60 @@ CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testChartDataTableWithMultipleLegendEntr CPPUNIT_ASSERT(xDataTableShape.is()); } +namespace +{ +void lcl_assertAngles(const Reference& rAxis, const double& rExpectedLabelAngle, + const double& rExpectedTitleAngle) +{ + Reference xPS(rAxis, uno::UNO_QUERY_THROW); + double fAxisLabelAngle = 0.0; + xPS->getPropertyValue(u"TextRotation"_ustr) >>= fAxisLabelAngle; + CPPUNIT_ASSERT_DOUBLES_EQUAL(rExpectedLabelAngle, fAxisLabelAngle, 1e-10); + + Reference xAxisTitled(rAxis, uno::UNO_QUERY_THROW); + Reference xAxisTitle = xAxisTitled->getTitleObject(); + CPPUNIT_ASSERT(xAxisTitle.is()); + Reference xPropSet(xAxisTitle, uno::UNO_QUERY_THROW); + double fAxisTitleAngle = 0.0; + xPropSet->getPropertyValue(u"TextRotation"_ustr) >>= fAxisTitleAngle; + CPPUNIT_ASSERT_DOUBLES_EQUAL(rExpectedTitleAngle, fAxisTitleAngle, 1e-10); +} +} // end namespace + +CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testAngleUnits) +{ + loadFromFile(u"fods/tdf161483_AngleUnits.fods"); + double fExpXAxisLabelAngle = 344.61; // = 382.9grad = 6.01457913529766rad + double fExpXAxisTitleAngle = 342.63; // = 380.7grad = 5.98002161610817rad + double fExpYAxisLabelAngle = 15.12; // = 16.8grad = 0.263893782901543rad + double fExpYAxisTitleAngle = 14.94; // = 16.6grad = 0.260752190247953rad + double fExpZAxisLabelAngle = 344.16; // = 382.4grad = 6.00672515366369rad + double fExpZAxisTitleAngle = 60.39; // = 67.1grad = 1.05400433527938rad + + // sheet 0: no unit; sheet 1: unit deg; sheet 2: unit rad; sheet 3: unit grad + // Whithout fix, the values with unit grad and rad were read as if they are in degrees. + for (size_t i = 0; i < 4; i++) + { + uno::Reference xChartDoc = getChartDocFromSheet(i, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + + // x-axis + Reference xAxis = getAxisFromDoc(xChartDoc, 0, 0, 0); + CPPUNIT_ASSERT(xAxis.is()); + lcl_assertAngles(xAxis, fExpXAxisLabelAngle, fExpXAxisTitleAngle); + + // y-axis + xAxis = getAxisFromDoc(xChartDoc, 0, 1, 0); + CPPUNIT_ASSERT(xAxis.is()); + lcl_assertAngles(xAxis, fExpYAxisLabelAngle, fExpYAxisTitleAngle); + + //z-axis + xAxis = getAxisFromDoc(xChartDoc, 0, 2, 0); + CPPUNIT_ASSERT(xAxis.is()); + lcl_assertAngles(xAxis, fExpZAxisLabelAngle, fExpZAxisTitleAngle); + } +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/chart2/qa/extras/data/fods/tdf161483_AngleUnits.fods b/chart2/qa/extras/data/fods/tdf161483_AngleUnits.fods new file mode 100644 index 000000000000..a71fb533165a --- /dev/null +++ b/chart2/qa/extras/data/fods/tdf161483_AngleUnits.fods @@ -0,0 +1,1851 @@ + + + + + LODev_daily_installed/25.2.0.0.alpha0$Windows_X86_64 LibreOffice_project/aaf2967d74a9a7ba2d28433e1872422ce38b6244 + + Metric + Regina Henschel + 2024-07-04T20:11:31 + Regina Henschel + 2024-07-06T19:10:11 + + + + + 0 + 0 + 27494 + 13002 + + + view1 + + + 1 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 80 + 60 + true + false + false + false + false + + + 1 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 80 + 60 + true + false + false + false + false + + + 0 + 5 + 2 + 0 + 0 + 0 + 0 + 0 + 80 + 60 + true + false + false + false + false + + + 1 + 0 + 2 + 0 + 0 + 0 + 0 + 0 + 80 + 60 + true + false + false + false + false + + + noUnit + 1065 + 0 + 80 + 60 + false + true + true + true + false + true + 12632256 + 1 + true + true + true + false + false + false + 500 + 500 + 4 + 4 + true + false + false + false + false + + + + + true + true + true + 0 + true + true + false + true + false + 12632256 + true + true + 0 + false + false + true + true + false + 3 + false + false + false + 500 + 500 + 4 + 4 + true + false + false + true + true + true + true + true + 7 + true + + + Sheet1 + + + noUnit_2 + + + deg_2 + + + rad_2 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ??? + + + + + Page 1 + + + + + + + + ???(???) + + + 00.00.0000, 00:00:00 + + + + + + Page 1/ 99 + + + + + + + + + + + + + + + + LODev_daily_installed/25.2.0.0.alpha0$Windows_X86_64 LibreOffice_project/aaf2967d74a9a7ba2d28433e1872422ce38b6244 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sales 2023 + + + + + + + + + + + + + + + Quarter + + + + + + + + in 1000 EUR + + + + + + + Seller + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1st + + noUnit.B1:noUnit.E1 + + + 2nd + + + 3rd + + + 4th + + + + + + + John + + noUnit.A2:noUnit.A2 + + + 72 + + noUnit.B2:noUnit.E2 + + + 42 + + + 45 + + + 12 + + + + + Mary + + noUnit.A3:noUnit.A3 + + + 56 + + noUnit.B3:noUnit.E3 + + + 13 + + + 56 + + + 84 + + + + + Tim + + noUnit.A4:noUnit.A4 + + + 44 + + noUnit.B4:noUnit.E4 + + + 30 + + + 23 + + + 27 + + + + + Doris + + noUnit.A5:noUnit.A5 + + + 89 + + noUnit.B5:noUnit.E5 + + + 48 + + + 54 + + + 37 + + + + + + + + + + + + + + 2023 + + 1st + + 2nd + + 3rd + + 4th + + + + + + John + + + 72 + + + 42 + + + 45 + + + 12 + + + + + + Mary + + + 56 + + + 13 + + + 56 + + + 84 + + + + + + Tim + + + 44 + + + 30 + + + 23 + + + 27 + + + + + + Doris + + + 89 + + + 48 + + + 54 + + + 37 + + + + + + + + + + + + + + + + + + LODev_daily_installed/25.2.0.0.alpha0$Windows_X86_64 LibreOffice_project/aaf2967d74a9a7ba2d28433e1872422ce38b6244 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sales 2023 + + + + + + + + + + + + + + + Quarter + + + + + + + + in 1000 EUR + + + + + + + Seller + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1st + + deg.B1:deg.E1 + + + 2nd + + + 3rd + + + 4th + + + + + + + John + + deg.A2:deg.A2 + + + 72 + + deg.B2:deg.E2 + + + 42 + + + 45 + + + 12 + + + + + Mary + + deg.A3:deg.A3 + + + 56 + + deg.B3:deg.E3 + + + 13 + + + 56 + + + 84 + + + + + Tim + + deg.A4:deg.A4 + + + 44 + + deg.B4:deg.E4 + + + 30 + + + 23 + + + 27 + + + + + Doris + + deg.A5:deg.A5 + + + 89 + + deg.B5:deg.E5 + + + 48 + + + 54 + + + 37 + + + + + + + + + + + + + + 2023 + + 1st + + 2nd + + 3rd + + 4th + + + + + + John + + + 72 + + + 42 + + + 45 + + + 12 + + + + + + Mary + + + 56 + + + 13 + + + 56 + + + 84 + + + + + + Tim + + + 44 + + + 30 + + + 23 + + + 27 + + + + + + Doris + + + 89 + + + 48 + + + 54 + + + 37 + + + + + + + + + + + + + + + + + + LODev_daily_installed/25.2.0.0.alpha0$Windows_X86_64 LibreOffice_project/aaf2967d74a9a7ba2d28433e1872422ce38b6244 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sales 2023 + + + + + + + + + + + + + + + Quarter + + + + + + + + in 1000 EUR + + + + + + + Seller + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1st + + rad.B1:rad.E1 + + + 2nd + + + 3rd + + + 4th + + + + + + + John + + rad.A2:rad.A2 + + + 72 + + rad.B2:rad.E2 + + + 42 + + + 45 + + + 12 + + + + + Mary + + rad.A3:rad.A3 + + + 56 + + rad.B3:rad.E3 + + + 13 + + + 56 + + + 84 + + + + + Tim + + rad.A4:rad.A4 + + + 44 + + rad.B4:rad.E4 + + + 30 + + + 23 + + + 27 + + + + + Doris + + rad.A5:rad.A5 + + + 89 + + rad.B5:rad.E5 + + + 48 + + + 54 + + + 37 + + + + + + + + + + + + + + 2023 + + 1st + + 2nd + + 3rd + + 4th + + + + + + John + + + 72 + + + 42 + + + 45 + + + 12 + + + + + + Mary + + + 56 + + + 13 + + + 56 + + + 84 + + + + + + Tim + + + 44 + + + 30 + + + 23 + + + 27 + + + + + + Doris + + + 89 + + + 48 + + + 54 + + + 37 + + + + + + + + + + + + + + + + + + LODev_daily_installed/25.2.0.0.alpha0$Windows_X86_64 LibreOffice_project/aaf2967d74a9a7ba2d28433e1872422ce38b6244 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Sales 2023 + + + + + + + + + + + + + + + Quarter + + + + + + + + in 1000 EUR + + + + + + + Seller + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1st + + grad.B1:grad.E1 + + + 2nd + + + 3rd + + + 4th + + + + + + + John + + grad.A2:grad.A2 + + + 72 + + grad.B2:grad.E2 + + + 42 + + + 45 + + + 12 + + + + + Mary + + grad.A3:grad.A3 + + + 56 + + grad.B3:grad.E3 + + + 13 + + + 56 + + + 84 + + + + + Tim + + grad.A4:grad.A4 + + + 44 + + grad.B4:grad.E4 + + + 30 + + + 23 + + + 27 + + + + + Doris + + grad.A5:grad.A5 + + + 89 + + grad.B5:grad.E5 + + + 48 + + + 54 + + + 37 + + + + + + + + + + + + + + 2023 + + 1st + + 2nd + + 3rd + + 4th + + + + + + John + + + 72 + + + 42 + + + 45 + + + 12 + + + + + + Mary + + + 56 + + + 13 + + + 56 + + + 84 + + + + + + Tim + + + 44 + + + 30 + + + 23 + + + 27 + + + + + + Doris + + + 89 + + + 48 + + + 54 + + + 37 + + + + + + + + + + + + + + \ No newline at end of file diff --git a/xmloff/source/chart/PropertyMaps.cxx b/xmloff/source/chart/PropertyMaps.cxx index 512e629ff106..55dfe4a8fecd 100644 --- a/xmloff/source/chart/PropertyMaps.cxx +++ b/xmloff/source/chart/PropertyMaps.cxx @@ -932,8 +932,8 @@ bool XMLChartImportPropertyMapper::handleSpecialItem( { // convert from degrees (double) to 100th degrees (integer) double fVal; - ::sax::Converter::convertDouble( fVal, rValue ); - nValue = static_cast( fVal * 100.0 ); + ::sax::Converter::convertAngle(fVal, rValue, 100); + nValue = static_cast(basegfx::fround(fVal)); rProperty.maValue <<= nValue; } break; From 3c8f9d02e8d9238f6e3dd6a4c769bb26fe8e9093 Mon Sep 17 00:00:00 2001 From: Adam Seskunas Date: Thu, 13 Jun 2024 13:44:30 -0700 Subject: [PATCH 199/232] dbaccess complex/DataSource.java to extras/dataSource.cxx Port the Junit test in DataSource.java over to CppUnit. In order to port the test as written in Java the CRM Database was ported, so add a test for that here as well. Change-Id: Ib9ac369e3faaa30207b83368889763f0eb063876 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169071 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- dbaccess/JunitTest_dbaccess_complex.mk | 1 - dbaccess/qa/complex/dbaccess/DataSource.java | 68 -------------------- dbaccess/qa/unit/CRMDatabase_test.cxx | 54 ++++++++++++++++ 3 files changed, 54 insertions(+), 69 deletions(-) delete mode 100644 dbaccess/qa/complex/dbaccess/DataSource.java diff --git a/dbaccess/JunitTest_dbaccess_complex.mk b/dbaccess/JunitTest_dbaccess_complex.mk index ba333cbf3b27..99a3cd9f5cbc 100644 --- a/dbaccess/JunitTest_dbaccess_complex.mk +++ b/dbaccess/JunitTest_dbaccess_complex.mk @@ -33,7 +33,6 @@ $(eval $(call gb_JunitTest_add_sourcefiles,dbaccess_complex,\ dbaccess/qa/complex/dbaccess/CRMBasedTestCase \ dbaccess/qa/complex/dbaccess/CopyTableInterActionHandler \ dbaccess/qa/complex/dbaccess/CopyTableWizard \ - dbaccess/qa/complex/dbaccess/DataSource \ dbaccess/qa/complex/dbaccess/DatabaseApplication \ dbaccess/qa/complex/dbaccess/DatabaseDocument \ dbaccess/qa/complex/dbaccess/FileHelper \ diff --git a/dbaccess/qa/complex/dbaccess/DataSource.java b/dbaccess/qa/complex/dbaccess/DataSource.java deleted file mode 100644 index 0413a6e07b69..000000000000 --- a/dbaccess/qa/complex/dbaccess/DataSource.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -package complex.dbaccess; - -import com.sun.star.container.XNameAccess; -import com.sun.star.uno.UnoRuntime; -import com.sun.star.uno.XNamingService; -import connectivity.tools.CRMDatabase; -import connectivity.tools.HsqlDatabase; - -// ---------- junit imports ----------------- -import org.junit.Test; -import static org.junit.Assert.*; - - - -public class DataSource extends TestCase -{ - - HsqlDatabase m_database; - connectivity.tools.DataSource m_dataSource; - - - private void createTestCase() throws Exception - { - if (m_database == null) - { - final CRMDatabase database = new CRMDatabase( getMSF(), false ); - m_database = database.getDatabase(); - m_dataSource = m_database.getDataSource(); - } - } - - - @Test - public void testRegistrationName() throws Exception - { - createTestCase(); - // 1. check the existing "Bibliography" data source whether it has the proper name - String dataSourceName = "Bibliography"; - final connectivity.tools.DataSource bibliography = new connectivity.tools.DataSource(getMSF(), dataSourceName); - assertEquals("pre-registered database has a wrong name!", dataSourceName, bibliography.getName()); - // 2. register a newly created data source, and verify it has the proper name - dataSourceName = "someDataSource"; - final XNamingService dataSourceRegistrations = UnoRuntime.queryInterface( - XNamingService.class, getMSF().createInstance( "com.sun.star.sdb.DatabaseContext" ) ); - final XNameAccess existenceCheck = UnoRuntime.queryInterface( XNameAccess.class, dataSourceRegistrations ); - if ( existenceCheck.hasByName( "someDataSource" ) ) - dataSourceRegistrations.revokeObject( "someDataSource" ); - dataSourceRegistrations.registerObject("someDataSource", m_dataSource.getXDataSource()); - assertEquals("registration name of a newly registered data source is wrong", dataSourceName, m_dataSource.getName()); - } -} diff --git a/dbaccess/qa/unit/CRMDatabase_test.cxx b/dbaccess/qa/unit/CRMDatabase_test.cxx index 0f0cae5e67ef..634bd17b0b0d 100644 --- a/dbaccess/qa/unit/CRMDatabase_test.cxx +++ b/dbaccess/qa/unit/CRMDatabase_test.cxx @@ -9,13 +9,19 @@ #include "dbtest_base.cxx" +#include #include +#include +#include +#include +#include #include #include #include #include #include #include +#include using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -24,9 +30,11 @@ class CRMDBTest : public DBTestBase { public: void testCRMDatabase(); + void testRegistrationName(); CPPUNIT_TEST_SUITE(CRMDBTest); CPPUNIT_TEST(testCRMDatabase); + CPPUNIT_TEST(testRegistrationName); CPPUNIT_TEST_SUITE_END(); }; @@ -73,6 +81,52 @@ void CRMDBTest::testCRMDatabase() CPPUNIT_ASSERT_EQUAL(ColumnNames[0], u"Order No."_ustr); } +void CRMDBTest::testRegistrationName() +{ + // 1. check the existing "Bibliography" data source whether it has the proper name + Reference xNameAccess( + getMultiServiceFactory()->createInstance(u"com.sun.star.sdb.DatabaseContext"_ustr), + UNO_QUERY); + Reference xBiblioDataSource(xNameAccess->getByName(u"Bibliography"_ustr), + UNO_QUERY); + CPPUNIT_ASSERT(xBiblioDataSource.is()); + + Reference xBiblioProp(xBiblioDataSource, UNO_QUERY); + OUString sBiblioDataSourceName; + xBiblioProp->getPropertyValue(u"Name"_ustr) >>= sBiblioDataSourceName; + + CPPUNIT_ASSERT_EQUAL(u"Bibliography"_ustr, sBiblioDataSourceName); + + // 2. register a newly created data source, and verify it has the proper name + // Setup the CRMDatabase + createDBDocument(u"sdbc:embedded:hsqldb"_ustr); + uno::Reference xDocument(mxComponent, UNO_QUERY_THROW); + uno::Reference xConnection = getConnectionForDocument(xDocument); + createTables(xConnection); + + uno::Reference xDataSource = xDocument->getDataSource(); + CPPUNIT_ASSERT(xDataSource.is()); + + // Get a XDatabaseContext from XSingleService factory in order to register the DataSource + Reference xDatabaseContext(xNameAccess, UNO_QUERY_THROW); + CPPUNIT_ASSERT(xDatabaseContext.is()); + + // Register the datasource + xDatabaseContext->registerObject(u"SomeNewHsqlDataSource"_ustr, xDataSource); + + // Check the newly created data source to see if it has the proper name + Reference xProp(xDataSource, UNO_QUERY); + OUString sDataSourceName; + xProp->getPropertyValue(u"Name"_ustr) >>= sDataSourceName; + + CPPUNIT_ASSERT_EQUAL(u"SomeNewHsqlDataSource"_ustr, sDataSourceName); + + CPPUNIT_ASSERT_THROW_MESSAGE( + "Bibliography already exists", + xDatabaseContext->registerObject(u"Bibliography"_ustr, xDataSource), + container::ElementExistException); +} + CPPUNIT_TEST_SUITE_REGISTRATION(CRMDBTest); CPPUNIT_PLUGIN_IMPLEMENT(); From 7e45017b5156e2e6c5a426edc654f7f022c79863 Mon Sep 17 00:00:00 2001 From: Patrick Luby Date: Sun, 7 Jul 2024 14:17:37 -0400 Subject: [PATCH 200/232] Fix build breakage Commit 942864606dcb770485e8fc11fb312f12cceadace removed m_bObjectValid from the SwXTextDocument class but one instance of that data member was still left in the code. Change-Id: I0addd63173f62f6e8832f54ba94f526d50f22a8d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170097 Reviewed-by: Noel Grandin Reviewed-by: Xisco Fauli Tested-by: Xisco Fauli --- sw/source/uibase/uno/unotxdoc.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 5b4c7d055694..8480ce498bc2 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3270,7 +3270,7 @@ void SwXTextDocument::setClipboard(const uno::Reference Date: Sun, 7 Jul 2024 23:16:51 +0200 Subject: [PATCH 201/232] Update git submodules * Update translations from branch 'master' to 7ff3bfd58e3959a0f996a42e40de927d38600252 - Updated Slovenian translation Change-Id: Iac317055c86ee98e93a504375865f987e91fd08e --- translations | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translations b/translations index b87971d7ac97..7ff3bfd58e39 160000 --- a/translations +++ b/translations @@ -1 +1 @@ -Subproject commit b87971d7ac97460271cb13bd0e4cb2e554654a45 +Subproject commit 7ff3bfd58e3959a0f996a42e40de927d38600252 From 5f12f5b2ba3a7ee4ba1086047854929fbaabec58 Mon Sep 17 00:00:00 2001 From: Andrea Gelmini Date: Mon, 8 Jul 2024 08:46:41 +0200 Subject: [PATCH 202/232] Fix typo Change-Id: I2803d7c8ad026af902fdc4260219a397026f6f51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170136 Tested-by: Julien Nabet Reviewed-by: Julien Nabet --- chart2/qa/extras/chart2import2.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chart2/qa/extras/chart2import2.cxx b/chart2/qa/extras/chart2import2.cxx index 4fb757cffe9a..04404c0f45fa 100644 --- a/chart2/qa/extras/chart2import2.cxx +++ b/chart2/qa/extras/chart2import2.cxx @@ -919,7 +919,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ImportTest2, testAngleUnits) double fExpZAxisTitleAngle = 60.39; // = 67.1grad = 1.05400433527938rad // sheet 0: no unit; sheet 1: unit deg; sheet 2: unit rad; sheet 3: unit grad - // Whithout fix, the values with unit grad and rad were read as if they are in degrees. + // Without fix, the values with unit grad and rad were read as if they are in degrees. for (size_t i = 0; i < 4; i++) { uno::Reference xChartDoc = getChartDocFromSheet(i, mxComponent); From 2a22025e1819be82f51938ed7ab705f656ad693c Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 8 Jul 2024 08:21:19 +0200 Subject: [PATCH 203/232] svx: prefix members of SvxGrfCrop See tdf#94879 for motivation. Change-Id: Idbba42dd3af7a47db6a56c3a129a4da54af076d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170135 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- include/svx/grfcrop.hxx | 18 +++++++++--------- svx/source/items/grfitem.cxx | 28 ++++++++++++++-------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/include/svx/grfcrop.hxx b/include/svx/grfcrop.hxx index 3eed97fbab47..a8cb0e032eb3 100644 --- a/include/svx/grfcrop.hxx +++ b/include/svx/grfcrop.hxx @@ -28,7 +28,7 @@ class SVXCORE_DLLPUBLIC SvxGrfCrop : public SfxPoolItem { - sal_Int32 nLeft, nRight, nTop, nBottom; + sal_Int32 m_nLeft, m_nRight, m_nTop, m_nBottom; public: SvxGrfCrop( TypedWhichId, SfxItemType eType = SfxItemType::SvxGrfCropType ); SvxGrfCrop( sal_Int32 nLeft, sal_Int32 nRight, @@ -54,15 +54,15 @@ public: virtual bool PutValue( const css::uno::Any& rVal, sal_uInt8 nMemberId ) override; - void SetLeft( sal_Int32 nVal ) { nLeft = nVal; } - void SetRight( sal_Int32 nVal ) { nRight = nVal; } - void SetTop( sal_Int32 nVal ) { nTop = nVal; } - void SetBottom( sal_Int32 nVal ) { nBottom = nVal; } + void SetLeft( sal_Int32 nVal ) { m_nLeft = nVal; } + void SetRight( sal_Int32 nVal ) { m_nRight = nVal; } + void SetTop( sal_Int32 nVal ) { m_nTop = nVal; } + void SetBottom( sal_Int32 nVal ) { m_nBottom = nVal; } - sal_Int32 GetLeft() const { return nLeft; } - sal_Int32 GetRight() const { return nRight; } - sal_Int32 GetTop() const { return nTop; } - sal_Int32 GetBottom() const { return nBottom; } + sal_Int32 GetLeft() const { return m_nLeft; } + sal_Int32 GetRight() const { return m_nRight; } + sal_Int32 GetTop() const { return m_nTop; } + sal_Int32 GetBottom() const { return m_nBottom; } }; #endif // INCLUDED_SVX_GRFCROP_HXX diff --git a/svx/source/items/grfitem.cxx b/svx/source/items/grfitem.cxx index fcc06e2b39be..62f34094e228 100644 --- a/svx/source/items/grfitem.cxx +++ b/svx/source/items/grfitem.cxx @@ -27,14 +27,14 @@ using namespace ::com::sun::star; SvxGrfCrop::SvxGrfCrop( TypedWhichId nItemId, SfxItemType eType ) : SfxPoolItem( nItemId, eType ), - nLeft( 0 ), nRight( 0 ), nTop( 0 ), nBottom( 0 ) + m_nLeft( 0 ), m_nRight( 0 ), m_nTop( 0 ), m_nBottom( 0 ) {} SvxGrfCrop::SvxGrfCrop( sal_Int32 nL, sal_Int32 nR, sal_Int32 nT, sal_Int32 nB, TypedWhichId nItemId, SfxItemType eItemType ) : SfxPoolItem( nItemId, eItemType ), - nLeft( nL ), nRight( nR ), nTop( nT ), nBottom( nB ) + m_nLeft( nL ), m_nRight( nR ), m_nTop( nT ), m_nBottom( nB ) {} SvxGrfCrop::~SvxGrfCrop() @@ -46,10 +46,10 @@ bool SvxGrfCrop::operator==( const SfxPoolItem& rAttr ) const assert(SfxPoolItem::operator==(rAttr)); const SvxGrfCrop& rCrop = static_cast(rAttr); - return nLeft == rCrop.GetLeft() && - nRight == rCrop.GetRight() && - nTop == rCrop.GetTop() && - nBottom == rCrop.GetBottom(); + return m_nLeft == rCrop.GetLeft() && + m_nRight == rCrop.GetRight() && + m_nTop == rCrop.GetTop() && + m_nBottom == rCrop.GetBottom(); } @@ -57,10 +57,10 @@ bool SvxGrfCrop::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const { bool bConvert = 0!=(nMemberId&CONVERT_TWIPS); text::GraphicCrop aRet; - aRet.Left = nLeft; - aRet.Right = nRight; - aRet.Top = nTop; - aRet.Bottom = nBottom; + aRet.Left = m_nLeft; + aRet.Right = m_nRight; + aRet.Top = m_nTop; + aRet.Bottom = m_nBottom; if( bConvert ) { @@ -90,10 +90,10 @@ bool SvxGrfCrop::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) aVal.Bottom = o3tl::toTwips(aVal.Bottom, o3tl::Length::mm100); } - nLeft = aVal.Left ; - nRight = aVal.Right ; - nTop = aVal.Top ; - nBottom = aVal.Bottom; + m_nLeft = aVal.Left ; + m_nRight = aVal.Right ; + m_nTop = aVal.Top ; + m_nBottom = aVal.Bottom; return true; } From 427f0b402d6bc2ea2cfd796915ffb1354f9dc6dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sat, 6 Jul 2024 21:31:18 +0100 Subject: [PATCH 204/232] cid#1546429 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: If781c94f9a86ff91a64e014af5f04392e2380d3f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170081 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sw/source/uibase/shells/textsh1.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index 7e07f1438813..5bcf240026b6 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -1627,7 +1627,7 @@ void SwTextShell::Execute(SfxRequest &rReq) rReq.Ignore(); // the 'old' request is not relevant any more auto vCursors = CopyPaMRing(*pPaM); // tdf#134439 make a copy to use at later apply - pDlg->StartExecuteAsync([pDlg, &rWrtSh, pDrawModel, pRequest=std::move(pRequest), nDefDist, vCursors](sal_Int32 nResult){ + pDlg->StartExecuteAsync([pDlg, &rWrtSh, pDrawModel, pRequest=std::move(pRequest), nDefDist, vCursors=std::move(vCursors)](sal_Int32 nResult){ if (nResult == RET_OK) { // Apply defaults if necessary. From 343e9126f4930a7744e94a404004d2124582292d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sun, 7 Jul 2024 20:36:52 +0100 Subject: [PATCH 205/232] cid#1609651 Pointer to local outside scope MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit since: commit 5b57fe250108a9ea30b87e40e306af8a79043354 Date: Sun Mar 31 00:07:58 2024 +0900 vcl: clean-up and refactor GraphicFilter::ImportUnloadedGraphic Change-Id: Iea3438863df4ac23860cea403d1633a1d3892970 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170099 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- vcl/source/filter/graphicfilter.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 5a240aafd842..18bd05d107ba 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -879,10 +879,11 @@ Graphic GraphicFilter::ImportUnloadedGraphic(SvStream& rIStream, sal_uInt64 size if (nStatus == ERRCODE_NONE) { bool bAnimated = false; + Size aLogicSize; + if (eLinkType == GfxLinkType::NativeGif && !aBinaryDataContainer.isEmpty()) { std::shared_ptr pMemoryStream = aBinaryDataContainer.getAsStream(); - Size aLogicSize; bAnimated = IsGIFAnimated(*pMemoryStream, aLogicSize); if (!pSizeHint && aLogicSize.getWidth() && aLogicSize.getHeight()) { From d3aa5853552faeb277db18598767fd7add411ebf Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 8 Jul 2024 10:27:23 +0200 Subject: [PATCH 206/232] make SvxGraphicItem hashable Change-Id: I2cfca6f61c0247947855f40d6b1cdee521e8382d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170141 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/svx/svxgraphicitem.hxx | 2 ++ svx/source/dialog/svxgraphicitem.cxx | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/include/svx/svxgraphicitem.hxx b/include/svx/svxgraphicitem.hxx index 6d78b0980baa..47f8d1b59354 100644 --- a/include/svx/svxgraphicitem.hxx +++ b/include/svx/svxgraphicitem.hxx @@ -31,6 +31,8 @@ class SVX_DLLPUBLIC SvxGraphicItem final : public SfxPoolItem public: SvxGraphicItem( Graphic aGraphic); + virtual bool isHashable() const override; + virtual size_t hashCode() const override; virtual bool operator==( const SfxPoolItem& ) const override; virtual SvxGraphicItem* Clone( SfxItemPool *pPool = nullptr ) const override; diff --git a/svx/source/dialog/svxgraphicitem.cxx b/svx/source/dialog/svxgraphicitem.cxx index eb5458c3284e..d0ef1111ab08 100644 --- a/svx/source/dialog/svxgraphicitem.cxx +++ b/svx/source/dialog/svxgraphicitem.cxx @@ -27,6 +27,16 @@ SvxGraphicItem::SvxGraphicItem( Graphic _aGraphic ) } +bool SvxGraphicItem::isHashable() const +{ + return true; +} + +size_t SvxGraphicItem::hashCode() const +{ + return aGraphic.GetChecksum(); +} + bool SvxGraphicItem::operator==( const SfxPoolItem& rItem) const { return SfxPoolItem::operator==(rItem) && static_cast(rItem).aGraphic == aGraphic; From 62fb52cd43d7c0d41dd4e35a1c128947b6a14918 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 8 Jul 2024 10:46:03 +0200 Subject: [PATCH 207/232] tdf#161771 sw content controls: fix DOCX export of empty dropdown list item Open the bugdoc, save as DOCX, try to open in Word: Word refuses to open, saying that the file is corrupted. Each dropdown item has a value and a display text, it seems it's OK to omit the display text, but the value really should not be empty. Fix the problem by first trying to copy the display text to the value if the value would be empty; and if both are empty, then just omit the dropdown item. Note that the trick used at display text won't work here, omitting the value attribute (instead of writing an empty one) is still invalid DOCX. Change-Id: I4ae86aaf1a11cc8fd7c276634647f5737a9b04e4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170142 Reviewed-by: Miklos Vajna Tested-by: Jenkins --- sw/qa/filter/ww8/ww8.cxx | 44 ++++++++++++++++++++ sw/source/filter/ww8/docxattributeoutput.cxx | 13 ++++++ 2 files changed, 57 insertions(+) diff --git a/sw/qa/filter/ww8/ww8.cxx b/sw/qa/filter/ww8/ww8.cxx index 9a1d9bca8b4f..9a1b919c0cc8 100644 --- a/sw/qa/filter/ww8/ww8.cxx +++ b/sw/qa/filter/ww8/ww8.cxx @@ -14,6 +14,8 @@ #include #include +#include + #include #include #include @@ -598,6 +600,48 @@ CPPUNIT_TEST_FIXTURE(Test, testEndnotesAtSectEnd) // i.e. the default position was used: document end. CPPUNIT_ASSERT_EQUAL(u"sectEnd"_ustr, aPos); } + +CPPUNIT_TEST_FIXTURE(Test, testContentControlPDFDropDownEmptyItem) +{ + // Given a document with a dropdown content control, one item is empty, which can't be saved to + // a valid DOCX: + createSwDoc(); + uno::Reference xMSF(mxComponent, uno::UNO_QUERY); + uno::Reference xTextDocument(mxComponent, uno::UNO_QUERY); + uno::Reference xText = xTextDocument->getText(); + uno::Reference xCursor = xText->createTextCursor(); + xText->insertString(xCursor, u"test"_ustr, /*bAbsorb=*/false); + xCursor->gotoStart(/*bExpand=*/false); + xCursor->gotoEnd(/*bExpand=*/true); + uno::Reference xContentControl( + xMSF->createInstance(u"com.sun.star.text.ContentControl"_ustr), uno::UNO_QUERY); + uno::Reference xContentControlProps(xContentControl, uno::UNO_QUERY); + { + uno::Sequence aListItems = { + { + comphelper::makePropertyValue(u"DisplayText"_ustr, uno::Any(u"red"_ustr)), + comphelper::makePropertyValue(u"Value"_ustr, uno::Any(u"R"_ustr)), + }, + { + comphelper::makePropertyValue(u"DisplayText"_ustr, uno::Any(u""_ustr)), + comphelper::makePropertyValue(u"Value"_ustr, uno::Any(u""_ustr)), + }, + }; + xContentControlProps->setPropertyValue(u"ListItems"_ustr, uno::Any(aListItems)); + } + xText->insertTextContent(xCursor, xContentControl, /*bAbsorb=*/true); + + // When saving to DOCX: + save(u"Office Open XML Text"_ustr); + + // Then make sure we only emit 1 list item: + xmlDocUniquePtr pXmlDoc = parseExport(u"word/document.xml"_ustr); + // Without the accompanying fix in place, this test would have failed with: + // - Expected: 1 + // - Actual : 2 + // i.e. we emitted an empty list item, so the result can't be opened in Word. + assertXPath(pXmlDoc, "//w:dropDownList/w:listItem"_ostr, 1); +} } CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 15928d5d414f..07c7bba7ef87 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2717,12 +2717,25 @@ void DocxAttributeOutput::WriteContentControlStart() } for (const auto& rItem : m_pContentControl->GetListItems()) { + if (rItem.m_aDisplayText.isEmpty() && rItem.m_aValue.isEmpty()) + { + // Empty display text & value would be invalid DOCX, skip the item. + continue; + } + rtl::Reference xAttributes = FastSerializerHelper::createAttrList(); if (!rItem.m_aDisplayText.isEmpty()) { // If there is no display text, need to omit the attribute, not write an empty one. xAttributes->add(FSNS(XML_w, XML_displayText), rItem.m_aDisplayText); } + + OUString aValue = rItem.m_aValue; + if (aValue.isEmpty()) + { + // Empty value would be invalid DOCX, default to the display text. + aValue = rItem.m_aDisplayText; + } xAttributes->add(FSNS(XML_w, XML_value), rItem.m_aValue); m_pSerializer->singleElementNS(XML_w, XML_listItem, xAttributes); } From 6d3dd30b535f7283b8f1d8a577986b47ef5528ce Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 8 Jul 2024 11:28:31 +0200 Subject: [PATCH 208/232] make SvxB3DVectorItem hashable Change-Id: I759d5f225769d3833c6da664793a9d400a398a51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170147 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/svx/e3ditem.hxx | 2 ++ svx/source/items/e3ditem.cxx | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/include/svx/e3ditem.hxx b/include/svx/e3ditem.hxx index bad0e95c89f5..61f3dddd85c7 100644 --- a/include/svx/e3ditem.hxx +++ b/include/svx/e3ditem.hxx @@ -34,6 +34,8 @@ public: SvxB3DVectorItem( const SvxB3DVectorItem& ); virtual ~SvxB3DVectorItem() override; + virtual bool isHashable() const override; + virtual size_t hashCode() const override; virtual bool operator==( const SfxPoolItem& ) const override; virtual SvxB3DVectorItem* Clone( SfxItemPool *pPool = nullptr ) const override; diff --git a/svx/source/items/e3ditem.cxx b/svx/source/items/e3ditem.cxx index d2cd113b16bf..7e947a7670e7 100644 --- a/svx/source/items/e3ditem.cxx +++ b/svx/source/items/e3ditem.cxx @@ -19,7 +19,7 @@ #include #include - +#include #include using namespace ::com::sun::star; @@ -43,6 +43,19 @@ SvxB3DVectorItem::SvxB3DVectorItem( const SvxB3DVectorItem& rItem ) : { } +bool SvxB3DVectorItem::isHashable() const +{ + return true; +} + +size_t SvxB3DVectorItem::hashCode() const +{ + std::size_t seed = 0; + o3tl::hash_combine(seed, aVal.getX()); + o3tl::hash_combine(seed, aVal.getY()); + o3tl::hash_combine(seed, aVal.getZ()); + return seed; +} bool SvxB3DVectorItem::operator==( const SfxPoolItem &rItem ) const { @@ -73,6 +86,7 @@ bool SvxB3DVectorItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) con bool SvxB3DVectorItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; drawing::Direction3D aDirection; if(!(rVal >>= aDirection)) return false; From d05a451fcd8c985e860813183de0ec4dfdea0e02 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 8 Jul 2024 11:33:05 +0200 Subject: [PATCH 209/232] make SvxDoubleItem hashable Change-Id: Ia52a4ce4bd9390872a89bdea0182de697e209180 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170148 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/svx/chrtitem.hxx | 2 ++ svx/source/items/chrtitem.cxx | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/include/svx/chrtitem.hxx b/include/svx/chrtitem.hxx index eb6d42fde640..9cff3a00a0e1 100644 --- a/include/svx/chrtitem.hxx +++ b/include/svx/chrtitem.hxx @@ -142,6 +142,8 @@ public: MapUnit ePresMetric, OUString &rText, const IntlWrapper&) const override; + virtual bool isHashable() const override; + virtual size_t hashCode() const override; virtual bool operator == (const SfxPoolItem&) const override; virtual SvxDoubleItem* Clone(SfxItemPool *pPool = nullptr) const override; diff --git a/svx/source/items/chrtitem.cxx b/svx/source/items/chrtitem.cxx index 7001c37c30a9..253d4f259aec 100644 --- a/svx/source/items/chrtitem.cxx +++ b/svx/source/items/chrtitem.cxx @@ -21,7 +21,7 @@ #include #include #include - +#include #include using namespace ::com::sun::star; @@ -120,6 +120,18 @@ bool SvxDoubleItem::GetPresentation return true; } +bool SvxDoubleItem::isHashable() const +{ + return true; +} + +size_t SvxDoubleItem::hashCode() const +{ + std::size_t seed = 0; + o3tl::hash_combine(seed, fVal); + return seed; +} + bool SvxDoubleItem::operator == (const SfxPoolItem& rItem) const { assert(SfxPoolItem::operator==(rItem)); @@ -139,6 +151,7 @@ bool SvxDoubleItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const bool SvxDoubleItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; return rVal >>= fVal; } From 6e560140d9bbc4f593f5a67b2327b644c310551b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 8 Jul 2024 11:39:02 +0200 Subject: [PATCH 210/232] make SvxMarginItem hashable Change-Id: I9e0d23a81186231ebe314c14993b93e7c8a9d844 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170149 Reviewed-by: Noel Grandin Tested-by: Jenkins --- include/svx/algitem.hxx | 2 ++ svx/source/items/algitem.cxx | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/include/svx/algitem.hxx b/include/svx/algitem.hxx index d0245403360d..450a349f0e53 100644 --- a/include/svx/algitem.hxx +++ b/include/svx/algitem.hxx @@ -77,6 +77,8 @@ public: MapUnit ePresMetric, OUString &rText, const IntlWrapper& ) const override; + virtual bool isHashable() const override; + virtual size_t hashCode() const override; virtual bool operator==( const SfxPoolItem& ) const override; virtual SvxMarginItem* Clone( SfxItemPool *pPool = nullptr ) const override; diff --git a/svx/source/items/algitem.cxx b/svx/source/items/algitem.cxx index 3a29c103df67..6343b878b687 100644 --- a/svx/source/items/algitem.cxx +++ b/svx/source/items/algitem.cxx @@ -28,6 +28,7 @@ #include #include #include +#include #include @@ -216,6 +217,21 @@ bool SvxMarginItem::GetPresentation } +bool SvxMarginItem::isHashable() const +{ + return true; +} + +size_t SvxMarginItem::hashCode() const +{ + std::size_t seed = 0; + o3tl::hash_combine(seed, nLeftMargin); + o3tl::hash_combine(seed, nTopMargin); + o3tl::hash_combine(seed, nRightMargin); + o3tl::hash_combine(seed, nBottomMargin); + return seed; +} + bool SvxMarginItem::operator==( const SfxPoolItem& rItem ) const { assert(SfxPoolItem::operator==(rItem)); @@ -260,6 +276,7 @@ bool SvxMarginItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const bool SvxMarginItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; bool bConvert = ( ( nMemberId & CONVERT_TWIPS ) != 0 ); tools::Long nMaxVal = bConvert ? convertTwipToMm100(SHRT_MAX) : SHRT_MAX; // members are sal_Int16 sal_Int32 nVal = 0; @@ -290,24 +307,28 @@ bool SvxMarginItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId ) void SvxMarginItem::SetLeftMargin( sal_Int16 nLeft ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; nLeftMargin = nLeft; } void SvxMarginItem::SetTopMargin( sal_Int16 nTop ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; nTopMargin = nTop; } void SvxMarginItem::SetRightMargin( sal_Int16 nRight ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; nRightMargin = nRight; } void SvxMarginItem::SetBottomMargin( sal_Int16 nBottom ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; nBottomMargin = nBottom; } From 4f2389362714a6f83d9e11efe0d76d378af37348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sun, 7 Jul 2024 20:52:35 +0100 Subject: [PATCH 211/232] cid#1556123 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ib09e27591987ac1565205cff5c1396ba674c5bfb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170101 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- svgio/source/svgreader/svgstyleattributes.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx index 485142240871..e1822b52088f 100644 --- a/svgio/source/svgreader/svgstyleattributes.cxx +++ b/svgio/source/svgreader/svgstyleattributes.cxx @@ -1551,7 +1551,7 @@ namespace svgio::svgreader if(readSvgStringVector(aContent, aSvgStringVector, ',')) { - maFontFamily = aSvgStringVector; + maFontFamily = std::move(aSvgStringVector); } break; } From 698e89b4fd11947814c58adbbf001fb9f9514011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sun, 7 Jul 2024 20:54:18 +0100 Subject: [PATCH 212/232] cid#1556141 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8bc73176ab44a08553938bb0e9b236639b39a5cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170102 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- sfx2/source/doc/objserv.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 49ff18c0e4b6..555e57492801 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -732,7 +732,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) if (!rReq.IsSynchronCall()) { std::shared_ptr xReq = std::make_shared(rReq); - SfxTabDialogController::runAsync(xDlg, [xReq=std::move(xReq), aFunc](sal_Int32 nResult) + SfxTabDialogController::runAsync(xDlg, [xReq=std::move(xReq), aFunc=std::move(aFunc)](sal_Int32 nResult) { aFunc(nResult, *xReq); }); From f8480844a6a23b97a2b81381389b566a29eead97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sun, 7 Jul 2024 20:55:19 +0100 Subject: [PATCH 213/232] cid#1556887 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7e93494191e11c82af9e66ddd467a73f6bc60490 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170103 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- dbaccess/source/ui/misc/datasourceconnector.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbaccess/source/ui/misc/datasourceconnector.cxx b/dbaccess/source/ui/misc/datasourceconnector.cxx index 3331bd55930b..11fcf5ff6c1e 100644 --- a/dbaccess/source/ui/misc/datasourceconnector.cxx +++ b/dbaccess/source/ui/misc/datasourceconnector.cxx @@ -184,7 +184,7 @@ namespace dbaui { if ( _pErrorInfo ) { - *_pErrorInfo = aInfo; + *_pErrorInfo = std::move(aInfo); } else { From 22802bf3c32e0ea6e1ebf59bca824a9b6b9279ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sun, 7 Jul 2024 20:56:47 +0100 Subject: [PATCH 214/232] cid#1557639 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I02c8486503a54d1ddcdf80f9d7c7ee6389e4e05c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170104 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- dbaccess/source/sdbtools/connection/objectnames.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbaccess/source/sdbtools/connection/objectnames.cxx b/dbaccess/source/sdbtools/connection/objectnames.cxx index 6f9232f7f689..fe1caa97289a 100644 --- a/dbaccess/source/sdbtools/connection/objectnames.cxx +++ b/dbaccess/source/sdbtools/connection/objectnames.cxx @@ -313,9 +313,9 @@ namespace sdbtools if ( aMeta.supportsSubqueriesInFrom() ) pReturn = std::make_shared( pTableCheck, pQueryCheck ); else if ( _nCommandType == CommandType::TABLE ) - pReturn = pTableCheck; + pReturn = std::move(pTableCheck); else - pReturn = pQueryCheck; + pReturn = std::move(pQueryCheck); return pReturn; } From b4564b803bd00ce7b0db29725576e95538d2d980 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sun, 7 Jul 2024 20:58:37 +0100 Subject: [PATCH 215/232] cid#1608336 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I71288cc765b4bcdda35a2a1415537966018806ea Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170125 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- svx/source/gallery2/galbrws1.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx index ec18025b9b01..1dd2b13c53ee 100644 --- a/svx/source/gallery2/galbrws1.cxx +++ b/svx/source/gallery2/galbrws1.cxx @@ -1328,9 +1328,9 @@ void GalleryBrowser1::DispatchAdd( SVXGALLERYITEM_ARGNAME, aSeq) }; std::unique_ptr pInfo(new DispatchInfo); - pInfo->TargetURL = aURL; - pInfo->Arguments = aArgs; - pInfo->Dispatch = xDispatch; + pInfo->TargetURL = std::move(aURL); + pInfo->Arguments = std::move(aArgs); + pInfo->Dispatch = std::move(xDispatch); if ( Application::PostUserEvent( LINK( nullptr, GalleryBrowser1, AsyncDispatch_Impl), pInfo.get() ) ) From d9365813abe4b8213415d7aae1269a420380160d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sun, 7 Jul 2024 21:00:51 +0100 Subject: [PATCH 216/232] cid#1608463 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7f7473fa9f0f5985460bc3e5f48b2d6c413f8d04 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170126 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sc/source/ui/view/viewfunc.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index b207f7677282..7bc0a6482836 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -449,7 +449,7 @@ namespace } namespace { - void runAutoCorrectQueryAsync(std::shared_ptr context); + void runAutoCorrectQueryAsync(const std::shared_ptr& context); void performAutoFormatAndUpdate(std::u16string_view rString, const ScMarkData& rMark, SCCOL nCol, SCROW nRow, SCTAB nTab, bool bNumFmtChanged, bool bRecord, @@ -480,7 +480,7 @@ namespace lcl_PostRepaintSparkLine(rDoc.GetSparklineList(nTab), ScRange(nCol, nRow, nTab), pDocSh); } - void finalizeFormulaProcessing(std::shared_ptr context) + void finalizeFormulaProcessing(const std::shared_ptr& context) { // to be used in multiple tabs, the formula must be compiled anew // via ScFormulaCell copy-ctor because of RangeNames, @@ -636,7 +636,7 @@ namespace finalizeFormulaProcessing(context); } - void runAutoCorrectQueryAsync(std::shared_ptr context) + void runAutoCorrectQueryAsync(const std::shared_ptr& context) { auto aQueryBox = std::make_shared(context->GetViewData().GetDialogParent(), context->aCorrectedFormula); weld::DialogController::runAsync(aQueryBox, [context] (int nResult) From d6f1c2c2e837f5682996d761fd4ed1367cc3bd4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sun, 7 Jul 2024 21:14:14 +0100 Subject: [PATCH 217/232] cid#1555801 Unchecked return value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I2fbc0b65b081da5776c49962ff3b6a36b76808da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170128 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- desktop/source/lib/init.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index 999cd4351d9a..03a5457edcc8 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -8018,8 +8018,8 @@ static int lo_initialize(LibreOfficeKit* pThis, const char* pAppPath, const char #else // Fun conversion dance back and forth between URLs and system paths... OUString aAppURL; - ::osl::Module::getUrlFromAddress( reinterpret_cast< oslGenericFunction >(lo_initialize), - aAppURL); + (void)::osl::Module::getUrlFromAddress(reinterpret_cast(lo_initialize), + aAppURL); osl::FileBase::getSystemPathFromFileURL( aAppURL, aAppPath ); #endif From 6b7bd732e28de6a7a4189cf98d2a6d8897d89d83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sun, 7 Jul 2024 21:15:46 +0100 Subject: [PATCH 218/232] cid#1608145 silence Unchecked return value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit and cid#1606678 Unchecked return value cid#1607752 Unchecked return value Change-Id: Ic611e2d9db17350a5aacbfb2b7c3f933aaea4afb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170129 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sw/source/filter/html/htmlform.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index 7e055dccea28..e9d1707cc015 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -1744,7 +1744,7 @@ void SwHTMLParser::InsertInput() SvxCSS1PropertyInfo aCSS1PropInfo; if( HasStyleOptions( aStyle, aId, aClass ) ) { - ParseStyleOptions( aStyle, aId, aClass, aCSS1ItemSet, aCSS1PropInfo ); + (void)ParseStyleOptions(aStyle, aId, aClass, aCSS1ItemSet, aCSS1PropInfo); if( !aId.isEmpty() ) InsertBookmark( aId ); } @@ -2004,7 +2004,7 @@ void SwHTMLParser::NewTextArea() SvxCSS1PropertyInfo aCSS1PropInfo; if( HasStyleOptions( aStyle, aId, aClass ) ) { - ParseStyleOptions( aStyle, aId, aClass, aCSS1ItemSet, aCSS1PropInfo ); + (void)ParseStyleOptions(aStyle, aId, aClass, aCSS1ItemSet, aCSS1PropInfo); if( !aId.isEmpty() ) InsertBookmark( aId ); } @@ -2271,7 +2271,7 @@ void SwHTMLParser::NewSelect() SvxCSS1PropertyInfo aCSS1PropInfo; if( HasStyleOptions( aStyle, aId, aClass ) ) { - ParseStyleOptions( aStyle, aId, aClass, aCSS1ItemSet, aCSS1PropInfo ); + (void)ParseStyleOptions(aStyle, aId, aClass, aCSS1ItemSet, aCSS1PropInfo); if( !aId.isEmpty() ) InsertBookmark( aId ); } From 04a5eff9fa12485da54314c85f2009aff9d9cbf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sun, 7 Jul 2024 21:17:01 +0100 Subject: [PATCH 219/232] cid#1608405 silence Unchecked return value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Iceb414227a67c13efb549857c2943eb3bc495bef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170130 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sw/source/core/unocore/unosect.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index d85a90736866..db754dba86a4 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -1108,11 +1108,10 @@ SwXTextSection::Impl::GetPropertyValues_Impl( pRet[nProperty] <<= bRet; } break; - case FN_UNO_ANCHOR_TYPES: - case FN_UNO_TEXT_WRAP: - case FN_UNO_ANCHOR_TYPE: - ::sw::GetDefaultTextContentValue( - pRet[nProperty], u"", pEntry->nWID); + case FN_UNO_ANCHOR_TYPES: + case FN_UNO_TEXT_WRAP: + case FN_UNO_ANCHOR_TYPE: + (void)::sw::GetDefaultTextContentValue(pRet[nProperty], u"", pEntry->nWID); break; case FN_UNO_REDLINE_NODE_START: case FN_UNO_REDLINE_NODE_END: From 71f0883939f5851ee69478ca1a022d63963f580f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sun, 7 Jul 2024 20:42:40 +0100 Subject: [PATCH 220/232] cid#1609594 COPY_INSTEAD_OF_MOVE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ib21902ed1279710ae1cd15b6e153ff155b57d35e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170100 Reviewed-by: Caolán McNamara Tested-by: Jenkins --- sd/source/filter/eppt/epptooxml.hxx | 10 ++++++++++ sd/source/filter/eppt/pptx-epptooxml.cxx | 10 +--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/sd/source/filter/eppt/epptooxml.hxx b/sd/source/filter/eppt/epptooxml.hxx index 7d1fa57f11d3..072d16601c97 100644 --- a/sd/source/filter/eppt/epptooxml.hxx +++ b/sd/source/filter/eppt/epptooxml.hxx @@ -166,6 +166,16 @@ private: sal_Int32 nId; sal_Int32 nLastIndex; OUString sInitials; + + AuthorComments() + { + } + AuthorComments(sal_Int32 nId_, sal_Int32 nLastIndex_, OUString sInitials_) + : nId(nId_) + , nLastIndex(nLastIndex_) + , sInitials(sInitials_) + { + } }; typedef std::unordered_map< OUString, struct AuthorComments > AuthorsMap; AuthorsMap maAuthors; diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx index 6c1b8c466e01..eb5a790cc156 100644 --- a/sd/source/filter/eppt/pptx-epptooxml.cxx +++ b/sd/source/filter/eppt/pptx-epptooxml.cxx @@ -1051,15 +1051,7 @@ sal_Int32 PowerPointExport::GetAuthorIdAndLastIndex(const OUString& sAuthor, sal_Int32& nLastIndex) { if (maAuthors.count(sAuthor) <= 0) - { - struct AuthorComments aAuthorComments; - - aAuthorComments.nId = maAuthors.size(); - aAuthorComments.nLastIndex = 0; - aAuthorComments.sInitials = sInitials; - - maAuthors[ sAuthor ] = aAuthorComments; - } + maAuthors.emplace(sAuthor, AuthorComments(maAuthors.size(), 0, sInitials)); nLastIndex = ++maAuthors[ sAuthor ].nLastIndex; From 7a5d0c413f37e02356d0bd1e1da7a9445ee25fe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Mon, 8 Jul 2024 10:39:51 +0100 Subject: [PATCH 221/232] Resolves: tdf#161478 Insert button not updated on switch tabs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit regression since: commit fbd79c6125fd302dde9af2d76171dd5ca794af4d Author: Caolán McNamara Date: Wed Mar 20 11:56:03 2019 +0000 weld SwFieldDlg Change-Id: Ifb4f107bb8d4d53ae81b8ce38a87c9774112b617 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170150 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sw/source/ui/fldui/flddb.cxx | 2 +- sw/source/ui/fldui/flddinf.cxx | 2 +- sw/source/ui/fldui/fldfunc.cxx | 6 +++--- sw/source/ui/fldui/fldpage.cxx | 27 +++++++++++++++++---------- sw/source/ui/fldui/fldpage.hxx | 3 ++- sw/source/ui/fldui/fldref.cxx | 2 +- sw/source/ui/fldui/fldtdlg.cxx | 7 +++++++ sw/source/ui/fldui/fldvar.cxx | 6 +++--- sw/source/uibase/inc/fldtdlg.hxx | 1 + 9 files changed, 36 insertions(+), 20 deletions(-) diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx index 0e6374e2b45e..99af2899746b 100644 --- a/sw/source/ui/fldui/flddb.cxx +++ b/sw/source/ui/fldui/flddb.cxx @@ -441,7 +441,7 @@ void SwFieldDBPage::CheckInsert() bInsert &= bHasValue; } - EnableInsert(bInsert); + EnableInsert(bInsert, IsCurrentPage()); } IMPL_LINK(SwFieldDBPage, TreeSelectHdl, weld::TreeView&, rBox, void) diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx index 24c81eb10edb..36743339ab56 100644 --- a/sw/source/ui/fldui/flddinf.cxx +++ b/sw/source/ui/fldui/flddinf.cxx @@ -401,7 +401,7 @@ sal_Int32 SwFieldDokInfPage::FillSelectionLB(sal_uInt16 nSubType) // fill Format-Listbox SwFieldTypesEnum nTypeId = SwFieldTypesEnum::DocumentInfo; - EnableInsert(nSubType != USHRT_MAX); + EnableInsert(nSubType != USHRT_MAX, IsCurrentPage()); if (nSubType == USHRT_MAX) // Info-Text nSubType = DI_SUBTYPE_BEGIN; diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx index 0a553522985c..98fac8e93515 100644 --- a/sw/source/ui/fldui/fldfunc.cxx +++ b/sw/source/ui/fldui/fldfunc.cxx @@ -377,7 +377,7 @@ IMPL_LINK_NOARG(SwFieldFuncPage, TypeHdl, weld::TreeView&, void) m_xValueGroup->set_sensitive(bValue); m_xMacroBT->set_sensitive(bMacro); - EnableInsert( bInsert ); + EnableInsert(bInsert, IsCurrentPage()); } IMPL_LINK_NOARG(SwFieldFuncPage, SelectHdl, weld::TreeView&, void) @@ -500,7 +500,7 @@ void SwFieldFuncPage::UpdateSubType() m_xNameED->set_text(GetFieldMgr().GetMacroName()); m_xValueGroup->set_sensitive(true); } - EnableInsert(bHasMacro); + EnableInsert(bHasMacro, IsCurrentPage()); } } @@ -605,7 +605,7 @@ IMPL_LINK_NOARG(SwFieldFuncPage, ModifyHdl, weld::Entry&, void) (!nLen || nLen > MAX_COMBINED_CHARACTERS )) bEnable = false; - EnableInsert( bEnable ); + EnableInsert(bEnable, IsCurrentPage()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/fldui/fldpage.cxx b/sw/source/ui/fldui/fldpage.cxx index 11923d34ee93..0bf3fa640dc0 100644 --- a/sw/source/ui/fldui/fldpage.cxx +++ b/sw/source/ui/fldui/fldpage.cxx @@ -98,7 +98,7 @@ void SwFieldPage::Init() // newly initialise page void SwFieldPage::Activate() { - EnableInsert(m_bInsert); + EnableInsert(m_bInsert, true); } // complete reset; edit new field @@ -318,18 +318,25 @@ void SwFieldPage::InsertHdl(weld::Widget* pBtn) } } -// enable/disable "Insert"-Button -void SwFieldPage::EnableInsert(bool bEnable) +bool SwFieldPage::IsCurrentPage() const { - if (SwFieldDlg *pDlg = dynamic_cast(GetDialogController())) + if (const SwFieldDlg *pDlg = dynamic_cast(GetDialogController())) + return pDlg->GetCurTabPage() == this; + return true; +} + +// enable/disable "Insert"-Button +void SwFieldPage::EnableInsert(bool bEnable, bool bIsCurrentPage) +{ + if (bIsCurrentPage) { - if (pDlg->GetCurTabPage() == this) + if (SwFieldDlg *pDlg = dynamic_cast(GetDialogController())) pDlg->EnableInsert(bEnable); - } - else - { - SwFieldEditDlg *pEditDlg = static_cast(GetDialogController()); - pEditDlg->EnableInsert(bEnable); + else + { + SwFieldEditDlg *pEditDlg = static_cast(GetDialogController()); + pEditDlg->EnableInsert(bEnable); + } } m_bInsert = bEnable; diff --git a/sw/source/ui/fldui/fldpage.hxx b/sw/source/ui/fldui/fldpage.hxx index fbfa8cf2ba53..aad057822b6b 100644 --- a/sw/source/ui/fldui/fldpage.hxx +++ b/sw/source/ui/fldui/fldpage.hxx @@ -58,7 +58,8 @@ protected: void Init(); void SavePos( const weld::TreeView& rLst1); void RestorePos( weld::TreeView& rLst1 ); - void EnableInsert(bool bEnable); + bool IsCurrentPage() const; + void EnableInsert(bool bEnable, bool bIsCurrentPage); bool IsFieldEdit() const { return m_bFieldEdit; } // insert field diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx index 672465d713d9..334f392f476f 100644 --- a/sw/source/ui/fldui/fldref.cxx +++ b/sw/source/ui/fldui/fldref.cxx @@ -1003,7 +1003,7 @@ IMPL_LINK_NOARG(SwFieldRefPage, ModifyHdl, weld::Entry&, void) nTypeId == REFFLDFLAG_BOOKMARK))) bEnable = false; - EnableInsert(bEnable); + EnableInsert(bEnable, IsCurrentPage()); m_xSelectionLB->select_text(aName); } diff --git a/sw/source/ui/fldui/fldtdlg.cxx b/sw/source/ui/fldui/fldtdlg.cxx index f649a24416b1..8b0d334f19fd 100644 --- a/sw/source/ui/fldui/fldtdlg.cxx +++ b/sw/source/ui/fldui/fldtdlg.cxx @@ -240,6 +240,13 @@ void SwFieldDlg::Activate() } } +void SwFieldDlg::ActivatePage(const OUString& rPage) +{ + SfxTabDialogController::ActivatePage(rPage); + if (SfxTabPage* pPage = GetTabPage(rPage)) + pPage->Activate(); +} + void SwFieldDlg::EnableInsert(bool bEnable) { if( bEnable ) diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx index a950a5054529..01be468828f1 100644 --- a/sw/source/ui/fldui/fldvar.cxx +++ b/sw/source/ui/fldui/fldvar.cxx @@ -408,7 +408,7 @@ void SwFieldVarPage::SubTypeHdl(const weld::TreeView* pBox) else bFormat = false; - EnableInsert(bFormat || bNumFormat); + EnableInsert(bFormat || bNumFormat, IsCurrentPage()); } break; @@ -953,7 +953,7 @@ IMPL_LINK_NOARG(SwFieldVarPage, ModifyHdl, weld::Entry&, void) m_xNewPB->set_sensitive(bApply); m_xDelPB->set_sensitive(bDelete); - EnableInsert(bInsert); + EnableInsert(bInsert, IsCurrentPage()); } IMPL_LINK(SwFieldVarPage, TBClickHdl, weld::Button&, rBox, void) @@ -1123,7 +1123,7 @@ IMPL_LINK_NOARG(SwFieldVarPage, SeparatorHdl, weld::Entry&, void) { bool bEnable = !m_xSeparatorED->get_text().isEmpty() || m_xChapterLevelLB->get_active() == 0; - EnableInsert(bEnable); + EnableInsert(bEnable, IsCurrentPage()); } bool SwFieldVarPage::FillItemSet(SfxItemSet* ) diff --git a/sw/source/uibase/inc/fldtdlg.hxx b/sw/source/uibase/inc/fldtdlg.hxx index 0db155b3d54b..55de4a5db20c 100644 --- a/sw/source/uibase/inc/fldtdlg.hxx +++ b/sw/source/uibase/inc/fldtdlg.hxx @@ -61,6 +61,7 @@ public: virtual void Close() override; virtual void EndDialog(int nResponse) override; virtual void Activate() override; + virtual void ActivatePage(const OUString& rPage) override; }; #endif From 3d0411ef53ccd6bb0af21b69aa557f1f40beffd0 Mon Sep 17 00:00:00 2001 From: Heiko Tietze Date: Mon, 8 Jul 2024 13:58:33 +0200 Subject: [PATCH 222/232] Resolves tdf#161421 - Keep soft hyphen always visible Soft hyphen is now visible as printable character unless the non-printable is switched on together with the respective option; and soft hyphens are always black in the printout Change-Id: Ief84f986e3d1fa5b11eed827d1a94cf0aef46d10 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170158 Reviewed-by: Heiko Tietze Tested-by: Jenkins --- sw/source/core/text/txthyph.cxx | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx index f1dd3acc5b75..bf8751d6cea5 100644 --- a/sw/source/core/text/txthyph.cxx +++ b/sw/source/core/text/txthyph.cxx @@ -431,23 +431,26 @@ SwTwips SwSoftHyphPortion::GetViewWidth(const SwTextSizeInfo& rInf) const */ void SwSoftHyphPortion::Paint( const SwTextPaintInfo &rInf ) const { - if ( Width() && rInf.GetOpt().IsViewMetaChars()) + if ( Width() ) { rInf.DrawViewOpt( *this, PortionType::SoftHyphen ); SwExpandPortion::Paint( rInf ); - OUString aMarker = u"-"_ustr; - SwTextPaintInfo aInf(rInf, &aMarker); - SwTextPortion aMarkerPor; - SwPosSize aMarkerSize(rInf.GetTextSize(aMarker)); - aMarkerPor.Width(aMarkerSize.Width()); - aMarkerPor.Height(aMarkerSize.Height()); - aMarkerPor.SetAscent(GetAscent()); + if (rInf.GetOpt().IsViewMetaChars() && !rInf.GetOpt().IsPrinting()) + { + OUString aMarker = u"-"_ustr; + SwTextPaintInfo aInf(rInf, &aMarker); + SwTextPortion aMarkerPor; + SwPosSize aMarkerSize(rInf.GetTextSize(aMarker)); + aMarkerPor.Width(aMarkerSize.Width()); + aMarkerPor.Height(aMarkerSize.Height()); + aMarkerPor.SetAscent(GetAscent()); - Color colorBackup = aInf.GetFont()->GetColor(); - aInf.GetFont()->SetColor(NON_PRINTING_CHARACTER_COLOR); - aInf.DrawText(aMarkerPor, TextFrameIndex(aMarker.getLength()), true); - aInf.GetFont()->SetColor(colorBackup); + Color colorBackup = aInf.GetFont()->GetColor(); + aInf.GetFont()->SetColor(NON_PRINTING_CHARACTER_COLOR); + aInf.DrawText(aMarkerPor, TextFrameIndex(aMarker.getLength()), true); + aInf.GetFont()->SetColor(colorBackup); + } } } From 611dc34f19deab7f13d00a4058f6a6ac6b50edb2 Mon Sep 17 00:00:00 2001 From: Tibor Nagy Date: Fri, 5 Jul 2024 14:40:11 +0200 Subject: [PATCH 223/232] tdf#159900 sw: fix Figure tag placement attribute when exporting to PDF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Paragraph tag is a possible parent element for the Figure tag. Figure tag and (any structure element) may have a value of “inline” as a placement attribute and thus, may be a child of a Paragraph tag. Change-Id: Ie1e0221976dbcfbae9ff01b1c9b76dd2d2e7edcb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170015 Tested-by: Jenkins Reviewed-by: Nagy Tibor --- .../core/text/EnhancedPDFExportHelper.cxx | 16 ++++-- .../data/tdf159900_figurePlacement.odt | Bin 0 -> 34773 bytes vcl/qa/cppunit/pdfexport/pdfexport.cxx | 51 ++++++++++++++++++ 3 files changed, 63 insertions(+), 4 deletions(-) create mode 100644 vcl/qa/cppunit/pdfexport/data/tdf159900_figurePlacement.odt diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 61a6ab8d413d..9816adacea7d 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -765,10 +765,18 @@ void SwTaggedPDFHelper::SetAttributes( vcl::PDFWriter::StructElement eType ) if ( bPlacement ) { - eVal = vcl::PDFWriter::TableHeader == eType || - vcl::PDFWriter::TableData == eType ? - vcl::PDFWriter::Inline : - vcl::PDFWriter::Block; + bool bIsFigureInline = false; + if (vcl::PDFWriter::Figure == eType) + { + const SwFrame* pKeyFrame = static_cast(*pFrame).GetAnchorFrame(); + if (pKeyFrame->GetUpper()->GetType() == SwFrameType::Body) + bIsFigureInline = true; + } + + eVal = vcl::PDFWriter::TableHeader == eType || vcl::PDFWriter::TableData == eType + || bIsFigureInline + ? vcl::PDFWriter::Inline + : vcl::PDFWriter::Block; mpPDFExtOutDevData->SetStructureAttribute( vcl::PDFWriter::Placement, eVal ); } diff --git a/vcl/qa/cppunit/pdfexport/data/tdf159900_figurePlacement.odt b/vcl/qa/cppunit/pdfexport/data/tdf159900_figurePlacement.odt new file mode 100644 index 0000000000000000000000000000000000000000..0ebe292ce1607d1aa52493801a1167f587b3d913 GIT binary patch literal 34773 zcmc$_1$bP$vL@PQwqwW4%*@Qp%*@Q}*p6dnW@ct)W{5FnW@e0GoPFni?6lKT|?>wx$+l zE{=bhabl#iceFEeG;wk=G;pN**P7^mqxo5&%fHvc{2MKMJ9`)VKdS$xw7=7HayD>w z`QPx;+0M@T-+PJoH(pxU7?_zj(Fs~O+Zfn8{To;RE-S{;mNHjEqdIO+MSx?jI#WLPGx4k3Q@5PlEkS*%;Vbn3^~_(>fZPP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y z%ix!jVTL36LYV^wr6f)2qFX%ci9Uc-0Vy_BQsM;&t4Yi6H-?mM2(O)Y=QqwY(R*Er z!G|g)?5e&5L}Ui~yC?Q@`FFLQ|IETWE^Jy=mev$!l~<8rw>NXJwzP2l%`j1QvXNsi z1K`)ttp*Q-X-HYyDhq({t3QQ~+IDZ6eD_v!00L5@{Y; zvph;Q`250C*j|27Z>k%kT~6^ysmh{u6ZWQHS>i3hE4ZGK0Ne?@Bu!T~^gNM})TS(& z7M#}j_(3P%4}@RDN9Q=Yra*0nhuVk?NQw{3;Mg=yb)0HS7fo6R+khYC=H&JiT>X7A z%xo2=271>@WYCU0CnZvpz^D(s99}J<_9Ntgp|Vm`(m|(3mL6WqZ@`RAp&neN#S@;u`eOV10{qL3! zSFc`WPrNkn(l3|apw=>B$sr3>ztxf3}0PpKL(#c=tEzs#M$!Q%jM0Dl-fF&^Z? zq=&V~uOI4f?9N|3duw|OH*Y74znA)J9+JOC0LrkKq@#nS^-FgbGdF8T2Ujk3Cl|+; zFb%D)5HlC{e+TK8=E6T+80_}%knAlS-2W#iM1O*S-F5yGC{B(}?oPiz{oC67Bb>{B z0>{{pznCIa V6=8}kVGaxS*9{xbeg^%D{U0%d;mZI3 literal 0 HcmV?d00001 diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx index 054496ee4895..d4325fe267ce 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx @@ -70,6 +70,57 @@ void PdfExportTest::load(std::u16string_view rFile, vcl::filter::PDFDocument& rD CPPUNIT_ASSERT(rDocument.Read(aStream)); } +CPPUNIT_TEST_FIXTURE(PdfExportTest, testFigurePlacement) +{ + aMediaDescriptor[u"FilterName"_ustr] <<= u"impress_pdf_Export"_ustr; + + uno::Sequence aFilterData( + comphelper::InitPropertySequence({ { "UseTaggedPDF", uno::Any(true) } })); + aMediaDescriptor[u"FilterData"_ustr] <<= aFilterData; + saveAsPDF(u"tdf159900_figurePlacement.odt"); + + // Parse the export result. + vcl::filter::PDFDocument aDocument; + SvFileStream aStream(maTempFile.GetURL(), StreamMode::READ); + CPPUNIT_ASSERT(aDocument.Read(aStream)); + + // The document has one page. + std::vector aPages = aDocument.GetPages(); + CPPUNIT_ASSERT_EQUAL(static_cast(1), aPages.size()); + + for (const auto& aElement : aDocument.GetElements()) + { + auto pObject = dynamic_cast(aElement.get()); + if (!pObject) + continue; + auto pType = dynamic_cast(pObject->Lookup("Type"_ostr)); + if (pType && pType->GetValue() == "StructElem") + { + auto pS = dynamic_cast(pObject->Lookup("S"_ostr)); + if (pS && pS->GetValue() == "Figure") + { + auto pAttrDict + = dynamic_cast(pObject->Lookup("A"_ostr)); + CPPUNIT_ASSERT(pAttrDict); + auto pOwner = dynamic_cast( + pAttrDict->LookupElement("O"_ostr)); + CPPUNIT_ASSERT(pOwner); + if (pOwner->GetValue() == "Layout") + { + auto pPlacement = dynamic_cast( + pAttrDict->LookupElement("Placement"_ostr)); + CPPUNIT_ASSERT(pPlacement); + + // Without the fix in place, this test would have failed with + // Expected: Inline + // Actual: Block + CPPUNIT_ASSERT_EQUAL("Inline"_ostr, pPlacement->GetValue()); + } + } + } + } +} + /// Tests that a pdf image is roundtripped back to PDF as a vector format. CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf106059) { From 6211461c50a4b713c81fc53ccafcfdf701c7388f Mon Sep 17 00:00:00 2001 From: Christian Lohmaier Date: Mon, 8 Jul 2024 18:21:51 +0200 Subject: [PATCH 224/232] Update git submodules * Update translations from branch 'master' to a9266fc54a66142dba20625f94d196898070ca0d - update translations for 24.8.0 rc1/master and force-fix errors using pocheck Change-Id: I696fda5336e4c075c43ebbdddc1974e5f1c6fe65 --- translations | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translations b/translations index 7ff3bfd58e39..a9266fc54a66 160000 --- a/translations +++ b/translations @@ -1 +1 @@ -Subproject commit 7ff3bfd58e3959a0f996a42e40de927d38600252 +Subproject commit a9266fc54a66142dba20625f94d196898070ca0d From 9aaf21b2851410492797a7dcf9193396c8bde770 Mon Sep 17 00:00:00 2001 From: Marco Cecchetti Date: Tue, 25 Jun 2024 18:59:23 +0900 Subject: [PATCH 225/232] sd: function to return a presentation info in a JSON document The presentation info includes properties like document size, if the slide is visible, master slide information and similar. [ Miklos: don't refer to removed tools::ScopedJsonWriterArray. ] Change-Id: I5b0acff2ee0df351dd1859e02695ca249e17c391 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170155 Tested-by: Jenkins Reviewed-by: Miklos Vajna --- dbaccess/Module_dbaccess.mk | 2 +- include/tools/helpers.hxx | 16 ++- include/vcl/ITiledRenderable.hxx | 6 + sd/source/ui/inc/unomodel.hxx | 3 + sd/source/ui/unoidl/unomodel.cxx | 202 ++++++++++++++++++++++++++++++- 5 files changed, 226 insertions(+), 3 deletions(-) diff --git a/dbaccess/Module_dbaccess.mk b/dbaccess/Module_dbaccess.mk index 8cc146b8d8f3..bfe11788bd12 100644 --- a/dbaccess/Module_dbaccess.mk +++ b/dbaccess/Module_dbaccess.mk @@ -53,7 +53,7 @@ $(eval $(call gb_Module_add_check_targets,dbaccess,\ CppunitTest_dbaccess_empty_stdlib_save \ CppunitTest_dbaccess_nolib_save \ CppunitTest_dbaccess_hsqlschema_import \ - CppunitTest_dbaccess_CRMDatabase_test \ + $(if $(ENABLE_FIREBIRD_SDBC),CppunitTest_dbaccess_CRMDatabase_test) \ )) endif diff --git a/include/tools/helpers.hxx b/include/tools/helpers.hxx index 6e499a6564a0..a6617a3fafd6 100644 --- a/include/tools/helpers.hxx +++ b/include/tools/helpers.hxx @@ -7,11 +7,12 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #pragma once - +#include #include #include #include #include +#include #include inline sal_uInt32 AlignedWidth4Bytes(sal_uInt32 nWidthBits) @@ -45,4 +46,17 @@ template [[nodiscard]] inline T NormAngle360(T angle) return angle; } +// get hash from interface +// TODO: UNIT TEST +[[nodiscard]] inline +std::string GetInterfaceHash(const ::css::uno::Reference<::css::uno::XInterface>& xIf) +{ + if (xIf.is()) + { + auto ptr = reinterpret_cast(xIf.get()); + return std::to_string(ptr); + } + return {}; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx index be6c050ad36d..483176aca3b8 100644 --- a/include/vcl/ITiledRenderable.hxx +++ b/include/vcl/ITiledRenderable.hxx @@ -384,6 +384,12 @@ public: * @param pViewShell the view to get the options from, if nullptr the current view shell is used */ virtual OString getViewRenderState(SfxViewShell* = nullptr) { return rtl::OString(); } + + /** Return JSON structure filled with the information about the presentation (Impress only function) */ + virtual OString getPresentationInfo() const + { + return {}; + } }; } // namespace vcl diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx index a4dc13e775f7..28bd323dd8d4 100644 --- a/sd/source/ui/inc/unomodel.hxx +++ b/sd/source/ui/inc/unomodel.hxx @@ -287,6 +287,9 @@ public: /// @see vcl::ITiledRenderable::getViewRenderState(). SD_DLLPUBLIC OString getViewRenderState(SfxViewShell* pViewShell = nullptr) override; + /// @see vcl::ITiledRenderable::getPresentationInfo(). + OString getPresentationInfo() const override; + // XComponent /** This dispose implementation releases the resources held by the diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index b2bd3cd2f235..3c0fead65b92 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -21,6 +21,7 @@ #include +#include #include #include #include @@ -79,6 +80,8 @@ #include #include #include +#include +#include // Support creation of GraphicStorageHandler and EmbeddedObjectResolver #include @@ -191,8 +194,120 @@ private: SdrModel* mpModel; }; +class SlideBackgroundInfo +{ +public: + SlideBackgroundInfo(const uno::Reference& xDrawPage, + const uno::Reference& xMasterPage); + bool slideHasOwnBackground() const { return mbIsCustom; } + bool hasBackground() const { return bHasBackground; } + bool isSolidColor() const { return mbIsSolidColor; } + ::Color getFillColor() const; + sal_Int32 getFillTransparency() const; + OString getFillColorAsRGBA() const; +private: + bool getFillStyleImpl(const uno::Reference& xDrawPage); +private: + uno::Reference mxDrawPage; + uno::Reference mxMasterPage; + uno::Reference mxBackground; + bool mbIsCustom; + bool bHasBackground; + bool mbIsSolidColor; + drawing::FillStyle maFillStyle; +}; + +SlideBackgroundInfo::SlideBackgroundInfo( + const uno::Reference& xDrawPage, + const uno::Reference& xMasterPage) + : mxDrawPage(xDrawPage) + , mxMasterPage(xMasterPage) + , mbIsCustom(false) + , bHasBackground(false) + , mbIsSolidColor(false) + , maFillStyle(drawing::FillStyle_NONE) +{ + mbIsCustom = getFillStyleImpl(xDrawPage); + bHasBackground = mbIsCustom; + if (!bHasBackground) + { + bHasBackground = getFillStyleImpl(xMasterPage); + } + if (bHasBackground) + { + if (maFillStyle == drawing::FillStyle_SOLID) + { + OUString sGradientName; + mxBackground->getPropertyValue("FillTransparenceGradientName") >>= sGradientName; + if (sGradientName.isEmpty()) + { + mbIsSolidColor = true; + } + } + } } +sal_Int32 SlideBackgroundInfo::getFillTransparency() const +{ + if (!mxBackground.is()) + return 0; + sal_Int32 nFillTransparency = 0; + mxBackground->getPropertyValue("FillTransparence") >>= nFillTransparency; + return nFillTransparency; +} + +::Color SlideBackgroundInfo::getFillColor() const +{ + if (!mxBackground.is()) + return {}; + if (sal_Int32 nFillColor; mxBackground->getPropertyValue("FillColor") >>= nFillColor) + { + return ::Color(ColorTransparency, nFillColor & 0xffffff); + } + return {}; +} + +OString SlideBackgroundInfo::getFillColorAsRGBA() const +{ + ::Color aColor = getFillColor(); + OString sColor = aColor.AsRGBHEXString().toUtf8(); + sal_uInt32 nAlpha = std::round((100 - getFillTransparency()) * 255 / 100.0); + std::stringstream ss; + ss << std::hex << std::uppercase << std::setfill ('0') << std::setw(2) << nAlpha; + sColor += ss.str().c_str(); + return sColor; +} + +bool SlideBackgroundInfo::getFillStyleImpl(const uno::Reference& xDrawPage) +{ + if( xDrawPage.is() ) + { + uno::Reference< beans::XPropertySet > xPropSet( xDrawPage, uno::UNO_QUERY ); + if( xPropSet.is() ) + { + uno::Reference< beans::XPropertySet > xBackground; + if (xPropSet->getPropertySetInfo()->hasPropertyByName("Background")) + xPropSet->getPropertyValue( "Background" ) >>= xBackground; + if( xBackground.is() ) + { + drawing::FillStyle aFillStyle; + if( xBackground->getPropertyValue( "FillStyle" ) >>= aFillStyle ) + { + maFillStyle = aFillStyle; + if (aFillStyle != drawing::FillStyle_NONE) + { + mxBackground = xBackground; + return true; + } + } + } + } + } + return false; +} + +} // end anonymous namespace + SdUnoForbiddenCharsTable::SdUnoForbiddenCharsTable( SdrModel* pModel ) : SvxUnoForbiddenCharsTable( pModel->GetForbiddenCharsTable() ), mpModel( pModel ) { @@ -2485,7 +2600,8 @@ OUString SdXImpressDocument::getPartHash(int nPart) return OUString(); } - return OUString::number(pPage->GetUniqueID()); + uno::Reference xDrawPage(pPage->getUnoPage(), uno::UNO_QUERY); + return OUString::fromUtf8(GetInterfaceHash(xDrawPage)); } bool SdXImpressDocument::isMasterViewMode() @@ -2891,6 +3007,90 @@ void SdXImpressDocument::initializeDocument() } } +OString SdXImpressDocument::getPresentationInfo() const +{ + ::tools::JsonWriter aJsonWriter; + + try + { + uno::Reference xSlides(mxDrawPagesAccess.get(), uno::UNO_QUERY_THROW); + if (xSlides.is()) + { + // size in twips + Size aDocSize = const_cast(this)->getDocumentSize(); + aJsonWriter.put("docWidth", aDocSize.getWidth()); + aJsonWriter.put("docHeight", aDocSize.getHeight()); + + auto aSlideList = aJsonWriter.startArray("slides"); + sal_Int32 nSlideCount = xSlides->getCount(); + for (sal_Int32 i = 0; i < nSlideCount; ++i) + { + uno::Reference xSlide(xSlides->getByIndex(i), uno::UNO_QUERY_THROW); + if (xSlide.is()) + { + uno::Reference xPropSet(xSlide, uno::UNO_QUERY); + if (xPropSet.is()) + { + bool bIsVisible = true; // default visible + xPropSet->getPropertyValue("Visible") >>= bIsVisible; + if (bIsVisible) + { + auto aSlideNode = aJsonWriter.startStruct(); + std::string sSlideHash = GetInterfaceHash(xSlide); + aJsonWriter.put("hash", sSlideHash); + aJsonWriter.put("index", i); + + uno::Reference xSlideShapes(xSlide, uno::UNO_QUERY_THROW); + bool bIsDrawPageEmpty = true; + if (xSlideShapes.is()) { + bIsDrawPageEmpty = xSlideShapes->getCount() == 0; + } + aJsonWriter.put("empty", bIsDrawPageEmpty); + + uno::Reference xMasterPage; + uno::Reference xMasterPageTarget(xSlide, uno::UNO_QUERY); + if (xMasterPageTarget.is()) + { + xMasterPage = xMasterPageTarget->getMasterPage(); + if (xMasterPage.is()) + { + std::string sMPHash = GetInterfaceHash(xMasterPage); + aJsonWriter.put("masterPage", sMPHash); + + bool bBackgroundObjectsVisibility = true; // default visible + xPropSet->getPropertyValue("IsBackgroundObjectsVisible") >>= bBackgroundObjectsVisibility; + aJsonWriter.put("masterPageObjectsVisible", bBackgroundObjectsVisibility); + } + } + + bool bBackgroundVisibility = true; // default visible + xPropSet->getPropertyValue("IsBackgroundVisible") >>= bBackgroundVisibility; + if (bBackgroundVisibility) + { + SlideBackgroundInfo aSlideBackgroundInfo(xSlide, xMasterPage); + if (aSlideBackgroundInfo.hasBackground()) + { + auto aBackgroundNode = aJsonWriter.startNode("background"); + aJsonWriter.put("isCustom", aSlideBackgroundInfo.slideHasOwnBackground()); + if (aSlideBackgroundInfo.isSolidColor()) + { + aJsonWriter.put("fillColor", aSlideBackgroundInfo.getFillColorAsRGBA()); + } + } + } + } + } + } + } + } + } + catch (uno::Exception& ) + { + TOOLS_WARN_EXCEPTION( "sd", "SdXImpressDocument::getSlideShowInfo ... maybe some property can't be retrieved" ); + } + return aJsonWriter.finishAndGetAsOString(); +} + SdrModel& SdXImpressDocument::getSdrModelFromUnoModel() const { OSL_ENSURE(GetDoc(), "No SdrModel in draw/Impress, should not happen"); From a6f89b388365dab9e2df90edd1017370dc7607ea Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 8 Jul 2024 11:02:45 +0200 Subject: [PATCH 226/232] make SdrCustomShapeGeometryItem hashable Change-Id: Id27784da750e2cc9913c0d00df6e0b10d080f663 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170145 Tested-by: Jenkins Reviewed-by: Noel Grandin --- filter/source/msfilter/escherex.cxx | 2 +- include/svx/sdasitm.hxx | 2 ++ sd/qa/unit/import-tests.cxx | 3 +- .../customshapes/EnhancedCustomShape2d.cxx | 28 +++++++++---------- svx/source/items/customshapeitem.cxx | 18 ++++++++++++ 5 files changed, 36 insertions(+), 17 deletions(-) diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index 17543714ca29..3387c9bb2fd0 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -4531,7 +4531,7 @@ sal_uInt32 EscherConnectorListEntry::GetConnectorRule( bool bFirst ) *pType >>= sShapeType; MSO_SPT eSpType = EnhancedCustomShapeTypeNames::Get( sShapeType ); - uno::Any* pGluePointType = const_cast(rGeometryItem).GetPropertyValueByName( u"Path"_ustr, u"GluePointType"_ustr ); + const uno::Any* pGluePointType = rGeometryItem.GetPropertyValueByName( u"Path"_ustr, u"GluePointType"_ustr ); sal_Int16 nGluePointType = sal_Int16(); if ( !( pGluePointType && diff --git a/include/svx/sdasitm.hxx b/include/svx/sdasitm.hxx index 7821bbd2e0a8..6ec62db34e00 100644 --- a/include/svx/sdasitm.hxx +++ b/include/svx/sdasitm.hxx @@ -69,6 +69,8 @@ private: SdrCustomShapeGeometryItem & operator =(SdrCustomShapeGeometryItem const &) = delete; // due to SfxPoolItem SdrCustomShapeGeometryItem & operator =(SdrCustomShapeGeometryItem &&) = delete; // due to SfxPoolItem + virtual bool isHashable() const override; + virtual size_t hashCode() const override; SAL_DLLPRIVATE virtual bool operator==( const SfxPoolItem& ) const override; SAL_DLLPRIVATE virtual bool GetPresentation(SfxItemPresentation ePresentation, diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 7a740a2ae3ad..4d9aaa1e6ed8 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -1165,8 +1165,7 @@ CPPUNIT_TEST_FIXTURE(SdImportTest, testFdo72998) CPPUNIT_ASSERT(pObj); const SdrCustomShapeGeometryItem& rGeometryItem = pObj->GetMergedItem(SDRATTR_CUSTOMSHAPE_GEOMETRY); - const css::uno::Any* pViewBox = const_cast(rGeometryItem) - .GetPropertyValueByName(u"ViewBox"_ustr); + const css::uno::Any* pViewBox = rGeometryItem.GetPropertyValueByName(u"ViewBox"_ustr); CPPUNIT_ASSERT_MESSAGE("Missing ViewBox", pViewBox); css::awt::Rectangle aViewBox; CPPUNIT_ASSERT((*pViewBox >>= aViewBox)); diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx index 5c8ba5fb64ad..8bbd3a2bd555 100644 --- a/svx/source/customshapes/EnhancedCustomShape2d.cxx +++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx @@ -546,14 +546,14 @@ void EnhancedCustomShape2d::ApplyShapeAttributes( const SdrCustomShapeGeometryIt { // AdjustmentValues static constexpr OUStringLiteral sAdjustmentValues( u"AdjustmentValues" ); - const Any* pAny = const_cast(rGeometryItem).GetPropertyValueByName( sAdjustmentValues ); + const Any* pAny = rGeometryItem.GetPropertyValueByName( sAdjustmentValues ); if ( pAny ) *pAny >>= m_seqAdjustmentValues; // Coordsize static constexpr OUStringLiteral sViewBox( u"ViewBox" ); - const Any* pViewBox = const_cast(rGeometryItem).GetPropertyValueByName( sViewBox ); + const Any* pViewBox = rGeometryItem.GetPropertyValueByName( sViewBox ); css::awt::Rectangle aViewBox; if ( pViewBox && (*pViewBox >>= aViewBox ) ) { @@ -576,35 +576,35 @@ void EnhancedCustomShape2d::ApplyShapeAttributes( const SdrCustomShapeGeometryIt // Path/Coordinates - pAny = const_cast(rGeometryItem).GetPropertyValueByName( sPath, sCoordinates ); + pAny = rGeometryItem.GetPropertyValueByName( sPath, sCoordinates ); if ( pAny ) *pAny >>= m_seqCoordinates; // Path/GluePoints - pAny = const_cast(rGeometryItem).GetPropertyValueByName( sPath, sGluePoints ); + pAny = rGeometryItem.GetPropertyValueByName( sPath, sGluePoints ); if ( pAny ) *pAny >>= m_seqGluePoints; // Path/GluePointLeavingDirections - pAny = const_cast(rGeometryItem).GetPropertyValueByName(sPath, sGluePointLeavingDirections); + pAny = rGeometryItem.GetPropertyValueByName(sPath, sGluePointLeavingDirections); if (pAny) *pAny >>= m_seqGluePointLeavingDirections; // Path/Segments - pAny = const_cast(rGeometryItem).GetPropertyValueByName( sPath, sSegments ); + pAny = rGeometryItem.GetPropertyValueByName( sPath, sSegments ); if ( pAny ) *pAny >>= m_seqSegments; // Path/SubViewSize - pAny = const_cast(rGeometryItem).GetPropertyValueByName( sPath, sSubViewSize ); + pAny = rGeometryItem.GetPropertyValueByName( sPath, sSubViewSize ); if ( pAny ) *pAny >>= m_seqSubViewSize; // Path/StretchX - pAny = const_cast(rGeometryItem).GetPropertyValueByName( sPath, sStretchX ); + pAny = rGeometryItem.GetPropertyValueByName( sPath, sStretchX ); if ( pAny ) { sal_Int32 nStretchX = 0; @@ -614,7 +614,7 @@ void EnhancedCustomShape2d::ApplyShapeAttributes( const SdrCustomShapeGeometryIt // Path/StretchY - pAny = const_cast(rGeometryItem).GetPropertyValueByName( sPath, sStretchY ); + pAny = rGeometryItem.GetPropertyValueByName( sPath, sStretchY ); if ( pAny ) { sal_Int32 nStretchY = 0; @@ -624,19 +624,19 @@ void EnhancedCustomShape2d::ApplyShapeAttributes( const SdrCustomShapeGeometryIt // Path/TextFrames - pAny = const_cast(rGeometryItem).GetPropertyValueByName( sPath, sTextFrames ); + pAny = rGeometryItem.GetPropertyValueByName( sPath, sTextFrames ); if ( pAny ) *pAny >>= m_seqTextFrames; // Equations - pAny = const_cast(rGeometryItem).GetPropertyValueByName( sEquations ); + pAny = rGeometryItem.GetPropertyValueByName( sEquations ); if ( pAny ) *pAny >>= m_seqEquations; // Handles - pAny = const_cast(rGeometryItem).GetPropertyValueByName( sHandles ); + pAny = rGeometryItem.GetPropertyValueByName( sHandles ); if ( pAny ) *pAny >>= m_seqHandles; } @@ -2182,8 +2182,8 @@ void EnhancedCustomShape2d::CreateSubPath( { // Some shapes will need special handling, decide on property 'Type'. OUString sShpType; - SdrCustomShapeGeometryItem& rGeometryItem = const_cast(mrSdrObjCustomShape.GetMergedItem(SDRATTR_CUSTOMSHAPE_GEOMETRY)); - Any* pAny = rGeometryItem.GetPropertyValueByName(u"Type"_ustr); + const SdrCustomShapeGeometryItem& rGeometryItem = mrSdrObjCustomShape.GetMergedItem(SDRATTR_CUSTOMSHAPE_GEOMETRY); + const Any* pAny = rGeometryItem.GetPropertyValueByName(u"Type"_ustr); if (pAny) *pAny >>= sShpType; // User defined shapes in MS binary format, which contain command U or T after import diff --git a/svx/source/items/customshapeitem.cxx b/svx/source/items/customshapeitem.cxx index 6a2153251c55..4479296227ae 100644 --- a/svx/source/items/customshapeitem.cxx +++ b/svx/source/items/customshapeitem.cxx @@ -40,6 +40,7 @@ SdrCustomShapeGeometryItem::SdrCustomShapeGeometryItem( const uno::Sequence< bea css::uno::Any* SdrCustomShapeGeometryItem::GetPropertyValueByName( const OUString& rPropName ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; css::uno::Any* pRet = nullptr; PropertyHashMap::iterator aHashIter( m_aPropHashMap.find( rPropName ) ); if ( aHashIter != m_aPropHashMap.end() ) @@ -58,6 +59,7 @@ const css::uno::Any* SdrCustomShapeGeometryItem::GetPropertyValueByName( const O css::uno::Any* SdrCustomShapeGeometryItem::GetPropertyValueByName( const OUString& rSequenceName, const OUString& rPropName ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; css::uno::Any* pRet = nullptr; css::uno::Any* pSeqAny = GetPropertyValueByName( rSequenceName ); if ( pSeqAny ) @@ -94,6 +96,7 @@ const css::uno::Any* SdrCustomShapeGeometryItem::GetPropertyValueByName( const O void SdrCustomShapeGeometryItem::SetPropertyValue( const css::beans::PropertyValue& rPropVal ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; css::uno::Any* pAny = GetPropertyValueByName( rPropVal.Name ); if ( pAny ) { // property is already available @@ -132,6 +135,7 @@ void SdrCustomShapeGeometryItem::SetPropertyValue( const css::beans::PropertyVal void SdrCustomShapeGeometryItem::SetPropertyValue( const OUString& rSequenceName, const css::beans::PropertyValue& rPropVal ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; css::uno::Any* pAny = GetPropertyValueByName( rSequenceName, rPropVal.Name ); if ( pAny ) // just replacing *pAny = rPropVal.Value; @@ -181,6 +185,7 @@ void SdrCustomShapeGeometryItem::SetPropertyValue( const OUString& rSequenceName void SdrCustomShapeGeometryItem::ClearPropertyValue( const OUString& rPropName ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; if ( !m_aPropSeq.hasElements() ) return; @@ -221,6 +226,17 @@ SdrCustomShapeGeometryItem::~SdrCustomShapeGeometryItem() { } +bool SdrCustomShapeGeometryItem::isHashable() const +{ + return true; +} + +size_t SdrCustomShapeGeometryItem::hashCode() const +{ + UpdateHash(); + return m_aHashState == HashState::Valid ? m_aHash : 0; +} + bool SdrCustomShapeGeometryItem::operator==( const SfxPoolItem& rCmp ) const { if( !SfxPoolItem::operator==( rCmp )) @@ -286,6 +302,7 @@ bool SdrCustomShapeGeometryItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMember bool SdrCustomShapeGeometryItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; css::uno::Sequence< css::beans::PropertyValue > propSeq; if ( ! ( rVal >>= propSeq ) ) return false; @@ -296,6 +313,7 @@ bool SdrCustomShapeGeometryItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMe void SdrCustomShapeGeometryItem::SetPropSeq( const css::uno::Sequence< css::beans::PropertyValue >& rVal ) { + ASSERT_CHANGE_REFCOUNTED_ITEM; if( m_aPropSeq == rVal ) return; From 7e274df5d149fc272277f234bf14d558a77d4bc1 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 8 Jul 2024 12:57:33 +0200 Subject: [PATCH 227/232] make some of the SfxStringItem subclasses hashable Change-Id: I7ad748b67266926f1e4e67e843a90b5ac3fe58b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170152 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/svl/custritm.hxx | 2 ++ include/svx/postattr.hxx | 8 ++++++++ svl/source/items/custritm.cxx | 5 +++++ svx/inc/sxlayitm.hxx | 1 + svx/inc/sxmfsitm.hxx | 4 ++++ svx/source/items/postattr.cxx | 24 ++++++++++++++++++++++++ svx/source/svdraw/svdattr.cxx | 6 ++++++ sw/inc/paratr.hxx | 1 + sw/source/core/para/paratr.cxx | 6 ++++++ 9 files changed, 57 insertions(+) diff --git a/include/svl/custritm.hxx b/include/svl/custritm.hxx index 118fd0963f15..309c0ebfe48a 100644 --- a/include/svl/custritm.hxx +++ b/include/svl/custritm.hxx @@ -39,6 +39,8 @@ public: SfxPoolItem(which, eItemType), m_aValue(std::move(aTheValue)) {} + // not all of the subclasses of this are hashable, so we only define the shared hashCode function here + virtual size_t hashCode() const override; virtual bool operator ==(const SfxPoolItem & rItem) const override; virtual bool GetPresentation(SfxItemPresentation, diff --git a/include/svx/postattr.hxx b/include/svx/postattr.hxx index af980a3e5b9e..22ede7dffc92 100644 --- a/include/svx/postattr.hxx +++ b/include/svx/postattr.hxx @@ -39,6 +39,8 @@ public: OUString &rText, const IntlWrapper& ) const override; virtual SvxPostItAuthorItem* Clone( SfxItemPool *pPool = nullptr ) const override; + + virtual bool isHashable() const override; // hashCode is defined in CntUnencodedStringItem }; @@ -59,6 +61,8 @@ public: OUString &rText, const IntlWrapper& ) const override; virtual SvxPostItDateItem* Clone( SfxItemPool *pPool = nullptr ) const override; + + virtual bool isHashable() const override; // hashCode is defined in CntUnencodedStringItem }; /** The text of a note @@ -79,6 +83,8 @@ public: OUString &rText, const IntlWrapper& ) const override; virtual SvxPostItTextItem* Clone( SfxItemPool *pPool = nullptr ) const override; + + virtual bool isHashable() const override; // hashCode is defined in CntUnencodedStringItem }; @@ -93,6 +99,8 @@ public: SvxPostItIdItem( TypedWhichId nWhich ); virtual SvxPostItIdItem* Clone( SfxItemPool *pPool = nullptr ) const override; + + virtual bool isHashable() const override; // hashCode is defined in CntUnencodedStringItem }; #endif diff --git a/svl/source/items/custritm.cxx b/svl/source/items/custritm.cxx index 9f4df1892094..4cd125f1b37f 100644 --- a/svl/source/items/custritm.cxx +++ b/svl/source/items/custritm.cxx @@ -23,6 +23,11 @@ #include #include +// not all of the subclasses are hashable, so we only define the shared hashcode function here +size_t CntUnencodedStringItem::hashCode() const +{ + return m_aValue.hashCode(); +} // virtual bool CntUnencodedStringItem::operator ==(const SfxPoolItem & rItem) const diff --git a/svx/inc/sxlayitm.hxx b/svx/inc/sxlayitm.hxx index 6891f5f4c345..e2d753ba9be6 100644 --- a/svx/inc/sxlayitm.hxx +++ b/svx/inc/sxlayitm.hxx @@ -39,6 +39,7 @@ public: SdrLayerNameItem(const OUString& rStr) : SfxStringItem(SDRATTR_LAYERNAME, rStr, SfxItemType::SdrLayerNameItemType) {} virtual SdrLayerNameItem* Clone(SfxItemPool* pPool=nullptr) const override; + virtual bool isHashable() const override; // hashCode is defined in CntUnencodedStringItem }; #endif diff --git a/svx/inc/sxmfsitm.hxx b/svx/inc/sxmfsitm.hxx index f3d6f0facf9d..70b126cfa0fe 100644 --- a/svx/inc/sxmfsitm.hxx +++ b/svx/inc/sxmfsitm.hxx @@ -31,6 +31,10 @@ public: { return new SdrMeasureFormatStringItem(*this); } + virtual bool isHashable() const override // hashCode is defined in CntUnencodedStringItem + { + return true; + } }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/items/postattr.cxx b/svx/source/items/postattr.cxx index 09c3f606c03b..f04541bf67e2 100644 --- a/svx/source/items/postattr.cxx +++ b/svx/source/items/postattr.cxx @@ -65,6 +65,12 @@ SvxPostItAuthorItem* SvxPostItAuthorItem::Clone( SfxItemPool * ) const return new SvxPostItAuthorItem( *this ); } +// hashCode is defined in CntUnencodedStringItem +bool SvxPostItAuthorItem::isHashable() const +{ + return true; +} + SvxPostItDateItem::SvxPostItDateItem( TypedWhichId _nWhich ) : SfxStringItem(_nWhich, SfxItemType::SvxPostItDateItemType) { @@ -104,6 +110,12 @@ SvxPostItDateItem* SvxPostItDateItem::Clone( SfxItemPool * ) const return new SvxPostItDateItem( *this ); } +// hashCode is defined in CntUnencodedStringItem +bool SvxPostItDateItem::isHashable() const +{ + return true; +} + SvxPostItTextItem::SvxPostItTextItem( TypedWhichId _nWhich ) { SetWhich( _nWhich ); @@ -141,6 +153,12 @@ SvxPostItTextItem* SvxPostItTextItem::Clone( SfxItemPool * ) const return new SvxPostItTextItem( *this ); } +// hashCode is defined in CntUnencodedStringItem +bool SvxPostItTextItem::isHashable() const +{ + return true; +} + SvxPostItIdItem::SvxPostItIdItem( TypedWhichId _nWhich ) { SetWhich( _nWhich ); @@ -151,4 +169,10 @@ SvxPostItIdItem* SvxPostItIdItem::Clone( SfxItemPool * ) const return new SvxPostItIdItem( *this ); } +// hashCode is defined in CntUnencodedStringItem +bool SvxPostItIdItem::isHashable() const +{ + return true; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx index cb6c197dfcd4..93fbfe261fcf 100644 --- a/svx/source/svdraw/svdattr.cxx +++ b/svx/source/svdraw/svdattr.cxx @@ -2171,4 +2171,10 @@ SdrLayerNameItem* SdrLayerNameItem::Clone(SfxItemPool* /*pPool*/) const return new SdrLayerNameItem(*this); } +// hashCode is defined in CntUnencodedStringItem +bool SdrLayerNameItem::isHashable() const +{ + return true; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/inc/paratr.hxx b/sw/inc/paratr.hxx index 3a8fd5d03674..dfe9be3afe70 100644 --- a/sw/inc/paratr.hxx +++ b/sw/inc/paratr.hxx @@ -164,6 +164,7 @@ public: SwNumRuleItem(SwNumRuleItem const &) = default; // SfxPoolItem copy function dichotomy /// "pure virtual methods" of SfxPoolItem + virtual bool isHashable() const override; // hashCode is defined in CntUnencodedStringItem virtual bool operator==( const SfxPoolItem& ) const override; virtual SwNumRuleItem* Clone( SfxItemPool *pPool = nullptr ) const override; virtual bool GetPresentation( SfxItemPresentation ePres, diff --git a/sw/source/core/para/paratr.cxx b/sw/source/core/para/paratr.cxx index 0cffb932c57e..98e80499e44d 100644 --- a/sw/source/core/para/paratr.cxx +++ b/sw/source/core/para/paratr.cxx @@ -185,6 +185,12 @@ SwNumRuleItem* SwNumRuleItem::Clone( SfxItemPool * ) const return new SwNumRuleItem( *this ); } +// hashCode is defined in CntUnencodedStringItem +bool SwNumRuleItem::isHashable() const +{ + return true; +} + bool SwNumRuleItem::operator==( const SfxPoolItem& rAttr ) const { assert(SfxPoolItem::operator==(rAttr)); From 257551a929ff40c9b94bb1313da88eeb242acd36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Mon, 8 Jul 2024 08:41:08 +0100 Subject: [PATCH 228/232] cid#1606535 PA: Public Attribute MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I1ef55ce7a2ba32ae67a881505ad202fdb8873661 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170139 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- qadevOOo/tests/java/ifc/util/_XReplaceDescriptor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qadevOOo/tests/java/ifc/util/_XReplaceDescriptor.java b/qadevOOo/tests/java/ifc/util/_XReplaceDescriptor.java index 98249a9dbffa..bc6e2ff97c5a 100644 --- a/qadevOOo/tests/java/ifc/util/_XReplaceDescriptor.java +++ b/qadevOOo/tests/java/ifc/util/_XReplaceDescriptor.java @@ -35,7 +35,7 @@ import com.sun.star.util.XReplaceDescriptor; public class _XReplaceDescriptor extends MultiMethodTest { // oObj filled by MultiMethodTest - public XReplaceDescriptor oObj = null; + private XReplaceDescriptor oObj = null; /** * Test calls the method.

From 2b0a522bddff7108523c4c9754bc3084f0e238db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Mon, 8 Jul 2024 09:10:02 +0100 Subject: [PATCH 229/232] cid#1607756 PA: Public Attribute MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ib2f9bff17f865dad2574e5dfe53fba107e4aa81a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170140 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- wizards/com/sun/star/wizards/ui/WizardDialog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wizards/com/sun/star/wizards/ui/WizardDialog.java b/wizards/com/sun/star/wizards/ui/WizardDialog.java index 69fbf5ab76b2..689ae82b9e2b 100644 --- a/wizards/com/sun/star/wizards/ui/WizardDialog.java +++ b/wizards/com/sun/star/wizards/ui/WizardDialog.java @@ -53,7 +53,7 @@ public abstract class WizardDialog extends UnoDialog2 implements VetoableChangeL private String[] sRMItemLabels; private Object oRoadmap; private XSingleServiceFactory xSSFRoadmap; - public XIndexContainer xIndexContRoadmap; + protected XIndexContainer xIndexContRoadmap; private final Resource oWizardResource; private final int hid; private boolean bTerminateListenermustberemoved = true; From 7383298e141dcc3df23c8c849513b7782b0785e2 Mon Sep 17 00:00:00 2001 From: Rafael Lima Date: Thu, 27 Jun 2024 21:28:18 +0200 Subject: [PATCH 230/232] tdf#161817 Fix Autofill overlay when zoom is low Prior to this patch, the calculation of the offset to draw the outline was incorrect, which caused the two lines of the outline to overlap. This patch fixes this issue and makes the outline work at any zoom level. Change-Id: I95d0b240a53beda872cdf6f0e7d75b48966217d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169665 Reviewed-by: Rafael Lima Tested-by: Jenkins --- svx/source/sdr/overlay/overlayselection.cxx | 41 ++++++++++----------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/svx/source/sdr/overlay/overlayselection.cxx b/svx/source/sdr/overlay/overlayselection.cxx index bd00e8a7f5df..78a1421943d5 100644 --- a/svx/source/sdr/overlay/overlayselection.cxx +++ b/svx/source/sdr/overlay/overlayselection.cxx @@ -33,30 +33,22 @@ #include #include #include +#include namespace sdr::overlay { // combine ranges geometrically to a single, ORed polygon - static basegfx::B2DPolyPolygon impCombineRangesToPolyPolygon(const std::vector< basegfx::B2DRange >& rRanges, bool bOffset) + static basegfx::B2DPolyPolygon impCombineRangesToPolyPolygon(const std::vector< basegfx::B2DRange >& rRanges, bool bOffset, double fOffset) { - // Determines the offset in twips. - // The offset is only needed if the contrast outline is drawn - sal_Int32 nOffset(0); - if (bOffset) - { - Size aSize(1, 1); - aSize = o3tl::convert(aSize, o3tl::Length::px, o3tl::Length::twip); - nOffset = aSize.getWidth(); - } - const sal_uInt32 nCount(rRanges.size()); basegfx::B2DPolyPolygon aRetval; for(sal_uInt32 a(0); a < nCount; a++) { basegfx::B2DRange aRange(rRanges[a]); - aRange.grow(nOffset); + if (bOffset) + aRange.grow(fOffset); const basegfx::B2DPolygon aDiscretePolygon(basegfx::utils::createPolygonFromRect(aRange)); if(0 == a) @@ -172,15 +164,7 @@ namespace sdr::overlay if(mbBorder) { - // External outline using themed color - basegfx::B2DPolyPolygon aPolyPolygon(impCombineRangesToPolyPolygon(getRanges(), mbContrastOutline)); - const drawinglayer::primitive2d::Primitive2DReference aSelectionOutline( - new drawinglayer::primitive2d::PolyPolygonHairlinePrimitive2D( - std::move(aPolyPolygon), - aRGBColor)); - - // add both to result - aRetval = drawinglayer::primitive2d::Primitive2DContainer {aUnifiedTransparence, aSelectionOutline}; + aRetval = drawinglayer::primitive2d::Primitive2DContainer {aUnifiedTransparence}; // tdf#161204 Outline with white color to provide contrast if (mbContrastOutline) @@ -192,6 +176,21 @@ namespace sdr::overlay basegfx::BColor(1.0, 1.0, 1.0))); aRetval.append(drawinglayer::primitive2d::Primitive2DContainer{aContrastSelectionOutline}); } + + // Offset to be applied to the external outline + double fOffset(0); + if (getOverlayManager()) + fOffset = getOverlayManager()->getOutputDevice().PixelToLogic(Size(1, 1)).getWidth(); + + // External outline using themed color + basegfx::B2DPolyPolygon aPolyPolygon(impCombineRangesToPolyPolygon(getRanges(), mbContrastOutline, fOffset)); + const drawinglayer::primitive2d::Primitive2DReference aSelectionOutline( + new drawinglayer::primitive2d::PolyPolygonHairlinePrimitive2D( + std::move(aPolyPolygon), + aRGBColor)); + + // Add to result + aRetval.append(drawinglayer::primitive2d::Primitive2DContainer {aSelectionOutline}); } else { From 81f2185c111b7d8154a2de128d490a0a9e822f19 Mon Sep 17 00:00:00 2001 From: Rafael Lima Date: Tue, 25 Jun 2024 22:31:38 +0200 Subject: [PATCH 231/232] tdf#161709 Make selection rectangle symmetric at any zoom level The previous method to calculate the rectangles used to draw the cursor did not play well with fractional numbers, making them look asymmetrical at some zoom levels. This patch makes sure that the cursor is symetrical at any zoom level. Change-Id: I196177e6722772db3a8c8ad343e35c148e4772a7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169546 Reviewed-by: Rafael Lima Tested-by: Jenkins --- sc/source/ui/view/gridwin.cxx | 43 ++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 23522e47b7c3..0c38afb4f9f8 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -6625,7 +6625,8 @@ void ScGridWindow::UpdateCursorOverlay() mrViewData.GetMergeSizePixel( nX, nY, nSizeXPix, nSizeYPix ); // tdf#143733 Make cell outline wider than the cell - const double nAdjustBorder(2 + mrViewData.GetZoomX()); + const double fZoom(mrViewData.GetZoomX()); + const sal_uInt16 nAdjustBorder(2 + fZoom / 2); aScrPos.AdjustX(-nAdjustBorder); aScrPos.AdjustY(-nAdjustBorder); @@ -6690,15 +6691,35 @@ void ScGridWindow::UpdateCursorOverlay() // tdf#143733, tdf#145080 - improve border visibility // constants picked for maximum consistency at 100% and adequate response on zoom // line width = 1.5 at 100% (0.75 left +/- 0.75 right), 50% = 1, 200% = 1.25, 400% = 2.25 - const double MinSize = 0.25 * GetDPIScaleFactor(); - double fZoom(mrViewData.GetZoomX() * 0.5); - for(const tools::Rectangle & rRA : aPixelRects) - { - basegfx::B2DRange aRB(rRA.Left() - MinSize - fZoom, rRA.Top() - MinSize - fZoom, - rRA.Right() + MinSize + fZoom, rRA.Bottom() + MinSize + fZoom); - aRB.transform(aTransform); - aRanges.push_back(aRB); - } + const double fCurZoom(mrViewData.GetZoomX()); + const double fMinSize = 0.25 * GetDPIScaleFactor(); + const double fAdjust(fMinSize + mrViewData.GetZoomX() * 0.5); + int nAdjustPixel(o3tl::convert(fAdjust, o3tl::Length::pt, o3tl::Length::px)); + // If zoom level is 50% or greater the rectangles must be at least 1 pixel thick + if (fCurZoom >= 0.5) + nAdjustPixel = std::max(1, nAdjustPixel); + + // Below each rectangle is adjusted so that they have thickness of nAdjustPixel + // Left rectangle + basegfx::B2DRange aRBLeft(aPixelRects[0].Left() - nAdjustPixel, aPixelRects[0].Top() - nAdjustPixel, + aPixelRects[0].Right(), aPixelRects[0].Bottom() + nAdjustPixel); + aRBLeft.transform(aTransform); + aRanges.push_back(aRBLeft); + // Right rectangle + basegfx::B2DRange aRBRight(aPixelRects[1].Left(), aPixelRects[1].Top() - nAdjustPixel, + aPixelRects[1].Right() + nAdjustPixel, aPixelRects[1].Bottom() + nAdjustPixel); + aRBRight.transform(aTransform); + aRanges.push_back(aRBRight); + // Top rectangle + basegfx::B2DRange aRBTop(aPixelRects[2].Left() - nAdjustPixel, aPixelRects[2].Top() - nAdjustPixel, + aPixelRects[2].Right() + nAdjustPixel, aPixelRects[2].Bottom()); + aRBTop.transform(aTransform); + aRanges.push_back(aRBTop); + // Bottom rectangle + basegfx::B2DRange aRBBottom(aPixelRects[3].Left() - nAdjustPixel, aPixelRects[3].Top(), + aPixelRects[3].Right() + nAdjustPixel, aPixelRects[3].Bottom() + nAdjustPixel); + aRBBottom.transform(aTransform); + aRanges.push_back(aRBBottom); std::unique_ptr pOverlay(new sdr::overlay::OverlaySelection( sdr::overlay::OverlayType::Solid, @@ -6937,7 +6958,7 @@ void ScGridWindow::UpdateAutoFillOverlay() nY2 += pMerge->GetRowMerge() - 1; } if (nX == nX2 && nY == nY2) - nAdjustBorder = 2 + static_cast(mrViewData.GetZoomX()); + nAdjustBorder = std::round(2 + static_cast(mrViewData.GetZoomX()) / 2); if (bLayoutRTL && !comphelper::LibreOfficeKit::isActive()) aFillPos.AdjustX( -(nSizeXPix + nAdjustBorder + (aFillHandleSize.Width() / 2)) ); From 6a54d08e6e52623f9769d17d7ea7390052cb275b Mon Sep 17 00:00:00 2001 From: Jonathan Clark Date: Fri, 5 Jul 2024 15:19:23 -0600 Subject: [PATCH 232/232] tdf#56408 Writer always breaks lines at text direction change This change implements line breaking underflow for bidi portions. Previously, Writer would always treat the start of a bidi portion as a valid position to insert a line break. This caused incorrect line breaking behavior in certain situations where LTR text is followed by RTL text with no valid break position between, or vice-versa. Now, Writer will correctly insert the break at the previous valid position, rather than always breaking at the direction change. Change-Id: If4627f4d65d2c44b65653c689ee00a2e0cb4456a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170154 Tested-by: Jenkins Reviewed-by: Jonathan Clark --- sw/qa/extras/layout/data/tdf56408-ltr.fodt | 129 ++++++++++++++++++ .../layout/data/tdf56408-no-underflow.fodt | 123 +++++++++++++++++ sw/qa/extras/layout/data/tdf56408-rtl.fodt | 125 +++++++++++++++++ sw/qa/extras/layout/layout3.cxx | 44 ++++++ sw/source/core/text/pormulti.cxx | 42 +++++- 5 files changed, 457 insertions(+), 6 deletions(-) create mode 100644 sw/qa/extras/layout/data/tdf56408-ltr.fodt create mode 100644 sw/qa/extras/layout/data/tdf56408-no-underflow.fodt create mode 100644 sw/qa/extras/layout/data/tdf56408-rtl.fodt diff --git a/sw/qa/extras/layout/data/tdf56408-ltr.fodt b/sw/qa/extras/layout/data/tdf56408-ltr.fodt new file mode 100644 index 000000000000..5ce76412c080 --- /dev/null +++ b/sw/qa/extras/layout/data/tdf56408-ltr.fodt @@ -0,0 +1,129 @@ + + + Lior Kaplan2012-10-25T19:53:272024-07-08T03:20:20.348137955PT8M18S11LibreOfficeDev/25.2.0.0.alpha0$Linux_X86_64 LibreOffice_project/9452bf222f57094e3bb100c6b0b9655d9f327737 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + English English English ((((עברית)))) English + + + \ No newline at end of file diff --git a/sw/qa/extras/layout/data/tdf56408-no-underflow.fodt b/sw/qa/extras/layout/data/tdf56408-no-underflow.fodt new file mode 100644 index 000000000000..7ef7ebf605d5 --- /dev/null +++ b/sw/qa/extras/layout/data/tdf56408-no-underflow.fodt @@ -0,0 +1,123 @@ + + + Lior Kaplan2012-10-25T19:53:272024-07-08T03:21:06.304537073PT8M42S11LibreOfficeDev/25.2.0.0.alpha0$Linux_X86_64 LibreOffice_project/9452bf222f57094e3bb100c6b0b9655d9f327737 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + English English English עברית English + + + \ No newline at end of file diff --git a/sw/qa/extras/layout/data/tdf56408-rtl.fodt b/sw/qa/extras/layout/data/tdf56408-rtl.fodt new file mode 100644 index 000000000000..e68774befc5f --- /dev/null +++ b/sw/qa/extras/layout/data/tdf56408-rtl.fodt @@ -0,0 +1,125 @@ + + + Lior Kaplan2012-10-25T19:53:272024-07-08T03:38:49.126947456PT11M10S13LibreOffice/24.2.4.2$Linux_X86_64 LibreOffice_project/d29029bfb700ea4a272da1366c5f5e7c14e351b5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + עברית עברית עברית ((((English)))) עברית + + + \ No newline at end of file diff --git a/sw/qa/extras/layout/layout3.cxx b/sw/qa/extras/layout/layout3.cxx index 3ee4953e52cc..d10e0c78a2f7 100644 --- a/sw/qa/extras/layout/layout3.cxx +++ b/sw/qa/extras/layout/layout3.cxx @@ -3037,6 +3037,50 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf104209VertRTL) "portion"_ostr, u"B"_ustr); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf56408LTR) +{ + // Verify that line breaking a first bidi portion correctly underflows in LTR text + createSwDoc("tdf56408-ltr.fodt"); + auto pXmlDoc = parseLayoutDump(); + + assertXPath(pXmlDoc, "//page"_ostr, 1); + + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]"_ostr, "portion"_ostr, + u"English English English "_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]"_ostr, "portion"_ostr, + u"((((עברית)))) English"_ustr); +} + +CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf56408RTL) +{ + // Verify that line breaking a first bidi portion correctly underflows in RTL text + createSwDoc("tdf56408-rtl.fodt"); + auto pXmlDoc = parseLayoutDump(); + + assertXPath(pXmlDoc, "//page"_ostr, 1); + + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]"_ostr, "portion"_ostr, + u"עברית עברית עברית "_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]"_ostr, "portion"_ostr, + u"((((English)))) עברית"_ustr); +} + +CPPUNIT_TEST_FIXTURE(SwLayoutWriter3, TestTdf56408NoUnderflow) +{ + // The fix for tdf#56408 introduced a change to line breaking between text with + // direction changes. This test verifies behavior in the trivial case, when a + // break opportunity exists at the direction change boundary. + createSwDoc("tdf56408-no-underflow.fodt"); + auto pXmlDoc = parseLayoutDump(); + + assertXPath(pXmlDoc, "//page"_ostr, 1); + + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[1]"_ostr, "portion"_ostr, + u"English English English "_ustr); + assertXPath(pXmlDoc, "/root/page/body/txt/SwParaPortion/SwLineLayout[2]"_ostr, "portion"_ostr, + u"עברית English"_ustr); +} + } // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/core/text/pormulti.cxx b/sw/source/core/text/pormulti.cxx index df352e6aa785..e22ad78d44a1 100644 --- a/sw/source/core/text/pormulti.cxx +++ b/sw/source/core/text/pormulti.cxx @@ -32,6 +32,9 @@ #include #include #include +#include +#include +#include #include "pormulti.hxx" #include "inftxt.hxx" #include "itrpaint.hxx" @@ -1919,8 +1922,8 @@ static bool lcl_ExtractFieldFollow( SwLineLayout* pLine, SwLinePortion* &rpField // If a multi portion completely has to go to the // next line, this function is called to truncate // the rest of the remaining multi portion -static void lcl_TruncateMultiPortion( SwMultiPortion& rMulti, SwTextFormatInfo& rInf, - TextFrameIndex const nStartIdx) +static void lcl_TruncateMultiPortion(SwMultiPortion& rMulti, SwTextFormatInfo& rInf, + TextFrameIndex const nStartIdx, bool bIsBidiPortion) { rMulti.GetRoot().Truncate(); rMulti.GetRoot().SetLen(TextFrameIndex(0)); @@ -1935,6 +1938,31 @@ static void lcl_TruncateMultiPortion( SwMultiPortion& rMulti, SwTextFormatInfo& rMulti.Width( 0 ); rMulti.SetLen(TextFrameIndex(0)); rInf.SetIdx( nStartIdx ); + + if (bIsBidiPortion) + { + // The truncated portion is a bidi portion. Bidi portions contain ordinary text, and may + // potentially underflow in the case that none of the text fits on the current line. + if (auto* pPrevTextPor = dynamic_cast(rInf.GetLast()); + pPrevTextPor != nullptr) + { + // Check if the start of the bidi portion is a valid break. In that case, truncating + // the multi portion is sufficient. + css::i18n::LineBreakHyphenationOptions aHyphOptions; + css::i18n::LineBreakUserOptions aUserOptions; + css::lang::Locale aLocale; + auto aResult = g_pBreakIt->GetBreakIter()->getLineBreak( + rInf.GetText(), sal_Int32(nStartIdx), aLocale, sal_Int32(rInf.GetLineStart()), + aHyphOptions, aUserOptions); + + if (aResult.breakIndex != sal_Int32{ nStartIdx }) + { + // The start of the bidi portion is not a valid break. Instead, a break should be + // inserted into a previous text portion on this line. + rInf.SetUnderflow(pPrevTextPor); + } + } + } } // Manages the formatting of a SwMultiPortion. External, for the calling @@ -2345,7 +2373,7 @@ bool SwTextFormatter::BuildMultiPortion( SwTextFormatInfo &rInf, else { // we try to keep our ruby portion together - lcl_TruncateMultiPortion( rMulti, rInf, nStartIdx ); + lcl_TruncateMultiPortion(rMulti, rInf, nStartIdx, /*bIsBidiPortion=*/false); pTmp = nullptr; // A follow field portion may still be waiting. If nobody wants // it, we delete it. @@ -2355,7 +2383,7 @@ bool SwTextFormatter::BuildMultiPortion( SwTextFormatInfo &rInf, else if( rMulti.HasRotation() ) { // we try to keep our rotated portion together - lcl_TruncateMultiPortion( rMulti, rInf, nStartIdx ); + lcl_TruncateMultiPortion(rMulti, rInf, nStartIdx, /*bIsBidiPortion=*/false); pTmp = new SwRotatedPortion( nMultiLen + rInf.GetIdx(), rMulti.GetDirection() ); } @@ -2363,8 +2391,10 @@ bool SwTextFormatter::BuildMultiPortion( SwTextFormatInfo &rInf, // a new SwBidiPortion, this would cause a memory leak else if( rMulti.IsBidi() && ! m_pMulti ) { - if ( ! rMulti.GetLen() ) - lcl_TruncateMultiPortion( rMulti, rInf, nStartIdx ); + if (!rMulti.GetLen()) + { + lcl_TruncateMultiPortion(rMulti, rInf, nStartIdx, /*bIsBidiPortion=*/true); + } // If there is a HolePortion at the end of the bidi portion, // it has to be moved behind the bidi portion. Otherwise