[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/source sc/uiconfig
sc/source/ui/condformat/condformateasydlg.cxx |8 ++-- sc/source/ui/inc/condformateasydlg.hxx|4 ++-- sc/uiconfig/scalc/ui/conditionaleasydialog.ui |4 ++-- 3 files changed, 6 insertions(+), 10 deletions(-) New commits: commit 2b8df39aea832d0521bf0d3c6b543a81709c382f Author: Szymon Kłos AuthorDate: Fri Oct 27 13:02:29 2023 +0200 Commit: Szymon Kłos CommitDate: Tue Oct 31 08:34:53 2023 +0100 Allow to enter text in simple conditional formatting dialog We have rules for test values like: "contains text". Better to use formatter which will be used only when needed. But it is possible to use Less or Greater even for text using the lexicographic order. Strings in quotes are interpreted as text. Strings without quotes are interpreted as refs to columns/rows/ranges. Change-Id: I1f63b3f4b2a878e55d405a030dd3ddf47305e220 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158559 Tested-by: Jenkins CollaboraOffice Reviewed-by: Gülşah Köse diff --git a/sc/source/ui/condformat/condformateasydlg.cxx b/sc/source/ui/condformat/condformateasydlg.cxx index 7e07b1a1dc19..d707b7c9f88d 100644 --- a/sc/source/ui/condformat/condformateasydlg.cxx +++ b/sc/source/ui/condformat/condformateasydlg.cxx @@ -64,8 +64,8 @@ ConditionalFormatEasyDialog::ConditionalFormatEasyDialog(SfxBindings* pBindings, "modules/scalc/ui/conditionaleasydialog.ui", "CondFormatEasyDlg") , mpViewData(pViewData) , mpDocument(&mpViewData->GetDocument()) -, mxNumberEntry(m_xBuilder->weld_spin_button("entryNumber")) -, mxNumberEntry2(m_xBuilder->weld_spin_button("entryNumber2")) +, mxNumberEntry(m_xBuilder->weld_entry("entryNumber")) +, mxNumberEntry2(m_xBuilder->weld_entry("entryNumber2")) , mxRangeEntry(new formula::RefEdit(m_xBuilder->weld_entry("entryRange"))) , mxButtonRangeEdit(new formula::RefButton(m_xBuilder->weld_button("rbassign"))) , mxStyles(m_xBuilder->weld_combo_box("themeCombo")) @@ -92,10 +92,6 @@ ConditionalFormatEasyDialog::ConditionalFormatEasyDialog(SfxBindings* pBindings, meMode = *pCurrentMode; } mxNumberEntry2->hide(); -mxNumberEntry->set_range(SAL_MIN_INT64, SAL_MAX_INT64); -mxNumberEntry2->set_range(SAL_MIN_INT64, SAL_MAX_INT64); -mxNumberEntry->set_increments(1, 0); -mxNumberEntry2->set_increments(1, 0); switch (meMode) { case ScConditionMode::Equal: diff --git a/sc/source/ui/inc/condformateasydlg.hxx b/sc/source/ui/inc/condformateasydlg.hxx index 9ca15a11bda9..6d6af1041b49 100644 --- a/sc/source/ui/inc/condformateasydlg.hxx +++ b/sc/source/ui/inc/condformateasydlg.hxx @@ -42,8 +42,8 @@ private: ScAddress maPosition; ScTabViewShell* mpTabViewShell; -std::unique_ptr mxNumberEntry; -std::unique_ptr mxNumberEntry2; +std::unique_ptr mxNumberEntry; +std::unique_ptr mxNumberEntry2; std::unique_ptr mxRangeEntry; std::unique_ptr mxButtonRangeEdit; std::unique_ptr mxStyles; diff --git a/sc/uiconfig/scalc/ui/conditionaleasydialog.ui b/sc/uiconfig/scalc/ui/conditionaleasydialog.ui index 2bee383956a9..077610196356 100644 --- a/sc/uiconfig/scalc/ui/conditionaleasydialog.ui +++ b/sc/uiconfig/scalc/ui/conditionaleasydialog.ui @@ -90,7 +90,7 @@ False 12 - + True True @@ -104,7 +104,7 @@ - + True True
[Libreoffice-commits] core.git: vcl/CppunitTest_vcl_pdfexport2.mk vcl/Module_vcl.mk vcl/qa
vcl/CppunitTest_vcl_pdfexport2.mk | 52 vcl/Module_vcl.mk |1 vcl/qa/cppunit/pdfexport/pdfexport.cxx | 4732 --- vcl/qa/cppunit/pdfexport/pdfexport2.cxx | 4802 4 files changed, 4856 insertions(+), 4731 deletions(-) New commits: commit a04fc307ba2706bb9e5b8441aaf4380797b5f397 Author: Xisco Fauli AuthorDate: Mon Oct 30 16:09:34 2023 +0100 Commit: Xisco Fauli CommitDate: Tue Oct 31 08:42:56 2023 +0100 CppunitTest_vcl_pdfexport: split into two It already has 109 tests Change-Id: Ic16c5ee68f020c2ee1662354786fb82aada62e0b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158667 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/vcl/CppunitTest_vcl_pdfexport2.mk b/vcl/CppunitTest_vcl_pdfexport2.mk new file mode 100644 index ..5574f515a7b0 --- /dev/null +++ b/vcl/CppunitTest_vcl_pdfexport2.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,vcl_pdfexport2)) + +$(eval $(call gb_CppunitTest_add_exception_objects,vcl_pdfexport2, \ +vcl/qa/cppunit/pdfexport/pdfexport2 \ +)) + +$(eval $(call gb_CppunitTest_use_sdk_api,vcl_pdfexport2)) + +$(eval $(call gb_CppunitTest_use_libraries,vcl_pdfexport2, \ + basegfx \ + comphelper \ + cppu \ + cppuhelper \ + sal \ + subsequenttest \ + test \ + unotest \ + utl \ + tl \ + vcl \ + xmlsecurity \ +)) + +$(eval $(call gb_CppunitTest_use_externals,vcl_pdfexport2, \ + boost_headers \ + $(if $(filter PDFIUM,$(BUILD_TYPE)),pdfium) \ +)) + +$(eval $(call gb_CppunitTest_use_sdk_api,vcl_pdfexport2)) + +$(eval $(call gb_CppunitTest_use_ure,vcl_pdfexport2)) +$(eval $(call gb_CppunitTest_use_vcl,vcl_pdfexport2)) + +$(eval $(call gb_CppunitTest_use_rdb,vcl_pdfexport2,services)) + +$(eval $(call gb_CppunitTest_use_configuration,vcl_pdfexport2)) + +# assert if font/glyph fallback occurs +$(eval $(call gb_CppunitTest_set_non_application_font_use,vcl_pdfexport2,abort)) + +$(eval $(call gb_CppunitTest_use_more_fonts,vcl_pdfexport2)) + +# vim: set noet sw=4 ts=4: diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk index dd66a86dbf73..19ab27106ad0 100644 --- a/vcl/Module_vcl.mk +++ b/vcl/Module_vcl.mk @@ -286,6 +286,7 @@ endif ifneq (,$(filter PDFIUM,$(BUILD_TYPE))) $(eval $(call gb_Module_add_slowcheck_targets,vcl,\ CppunitTest_vcl_pdfexport \ +CppunitTest_vcl_pdfexport2 \ CppunitTest_vcl_filter_ipdf \ )) endif diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx index 89e2f4990973..fdcc1730b6a8 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx @@ -11,41 +11,21 @@ #include #include -#include -#include #include -#include -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include + #include #include #include #include #include #include -#include -#include -#include -#include -#include #include #include -#include using namespace ::com::sun::star; @@ -2009,4716 +1989,6 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf115967) CPPUNIT_ASSERT_EQUAL(OUString("m=750abc"), sText); } -CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf124272) -{ -// Import the bugdoc and export as PDF. -vcl::filter::PDFDocument aDocument; -load(u"tdf124272.odt", aDocument); - -// The document has one page. -std::vector aPages = aDocument.GetPages(); -CPPUNIT_ASSERT_EQUAL(static_cast(1), aPages.size()); - -// The page has a stream. -vcl::filter::PDFObjectElement* pContents = aPages[0]->LookupObject("Contents"); -CPPUNIT_ASSERT(pContents); -vcl::filter::PDFStreamElement* pStream = pContents->GetStream(); -CPPUNIT_ASSERT(pStream); -SvMemoryStream& rObjectStream = pStream->GetMemory(); -// Uncompress it. -SvMemoryStream aUncompressed; -ZCodec aZCodec; -aZCodec.BeginCompression(); -rObjectStream.Seek(0); -aZCodec.Decompress(rObjectStream, aUncompressed); -CPPUNIT_ASSERT(aZCodec.EndCompression()); - -OString aBitmap("Q q 299.899 782.189 m\n" -"55.2 435.889 l 299.899 435.889 l 299.899 782.189 l\n" -"h"); - -auto pStart = static_cast(aUncompressed.GetData()); -const char* pEnd = pStart + aUncompressed.GetSize(); -auto it = std::search(pStart, pEnd, aBitmap.getStr(), aBitmap.getStr() + aBitmap.getLength()); -CPPUNIT_ASSERT(it != pEnd); -} - -CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf1216
[Libreoffice-commits] core.git: sw/CppunitTest_sw_ooxmlexport20.mk sw/Module_sw.mk sw/qa
sw/CppunitTest_sw_ooxmlexport20.mk | 19 sw/Module_sw.mk|1 sw/qa/extras/ooxmlexport/ooxmlexport20.cxx | 920 + sw/qa/extras/ooxmlexport/ooxmlexport5.cxx | 798 - 4 files changed, 940 insertions(+), 798 deletions(-) New commits: commit 117133575961dbce292a24f8afa1414785f2282c Author: Xisco Fauli AuthorDate: Mon Oct 30 16:22:07 2023 +0100 Commit: Xisco Fauli CommitDate: Tue Oct 31 08:43:11 2023 +0100 CppunitTest_sw_ooxmlexport5: split into two It already has 105 tests Change-Id: I06bd3740f5b3f368017fefd06fda099891834114 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158668 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sw/CppunitTest_sw_ooxmlexport20.mk b/sw/CppunitTest_sw_ooxmlexport20.mk new file mode 100644 index ..b2b778a4a12e --- /dev/null +++ b/sw/CppunitTest_sw_ooxmlexport20.mk @@ -0,0 +1,19 @@ +# -*- 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 sw_ooxmlexport_test,20)) + +$(eval $(call gb_CppunitTest_use_uiconfigs,sw_ooxmlexport5, \ +svt \ +svx \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/sw/Module_sw.mk b/sw/Module_sw.mk index 5be870597a2c..9ef1c80c84f7 100644 --- a/sw/Module_sw.mk +++ b/sw/Module_sw.mk @@ -93,6 +93,7 @@ $(eval $(call gb_Module_add_slowcheck_targets,sw,\ CppunitTest_sw_ooxmlexport17 \ CppunitTest_sw_ooxmlexport18 \ CppunitTest_sw_ooxmlexport19 \ +CppunitTest_sw_ooxmlexport20 \ CppunitTest_sw_ooxmlexport_template \ CppunitTest_sw_ooxmlfieldexport \ CppunitTest_sw_ooxmllinks \ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx new file mode 100644 index ..a8aca5ceb93a --- /dev/null +++ b/sw/qa/extras/ooxmlexport/ooxmlexport20.cxx @@ -0,0 +1,920 @@ +/* -*- 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 + +class Test : public SwModelTestBase +{ +public: +Test() +: SwModelTestBase("/sw/qa/extras/ooxmlexport/data/", "Office Open XML Text") +{ +} +}; + +CPPUNIT_TEST_FIXTURE(Test, testfdo79969_xlsb) +{ +loadAndSave("fdo79969_xlsb.docx"); +// This UT for DOCX embedded with binary excel work sheet. +xmlDocUniquePtr pXmlDoc = parseExport("[Content_Types].xml"); + +assertXPath(pXmlDoc, + "/ContentType:Types/ContentType:Override[@ContentType='application/" +"vnd.ms-excel.sheet.binary.macroEnabled.12']", +"PartName", "/word/embeddings/oleObject1.xlsb"); + +// check the rels too +xmlDocUniquePtr pXmlDocRels = parseExport("word/_rels/document.xml.rels"); +assertXPath( +pXmlDocRels, "/rels:Relationships/rels:Relationship[@Target='embeddings/oleObject1.xlsb']", +"Type", "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";); +// check the content too +xmlDocUniquePtr pXmlDocContent = parseExport("word/document.xml"); +assertXPath(pXmlDocContent, "/w:document/w:body/w:p[1]/w:r/w:object/o:OLEObject", "ProgID", +"Excel.SheetBinaryMacroEnabled.12"); +} + +CPPUNIT_TEST_FIXTURE(Test, testfdo80097) +{ +loadAndSave("fdo80097.docx"); +//fdo#76635 : Table borders are not getting preserved. + +xmlDocUniquePtr pXmlDocument = parseExport("word/document.xml"); + +//Table Cell Borders +assertXPath(pXmlDocument, + "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/" +"w:top[@w:val = 'single']", +1); +assertXPath(pXmlDocument, + "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/" +"w:top[@w:sz = 4]", +1); +assertXPath(pXmlDocument, + "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/" +"w:top[@w:space = 0]", +1); +assertXPath(pXmlDocument, + "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/" +"w:top[@w:color = '00']"
[Libreoffice-commits] core.git: 2 commits - sd/CppunitTest_sd_export_tests-ooxml4.mk sd/Module_sd.mk sd/qa sw/qa
sd/CppunitTest_sd_export_tests-ooxml4.mk | 17 sd/Module_sd.mk |1 sd/qa/unit/export-tests-ooxml3.cxx| 1047 - sd/qa/unit/export-tests-ooxml4.cxx| 1072 ++ sw/qa/extras/odfexport/data/tdf156905.odt |binary sw/qa/extras/odfexport/odfexport2.cxx |6 6 files changed, 1096 insertions(+), 1047 deletions(-) New commits: commit 33ca16e94dcd9b74f39937bafaa76c8ca9189877 Author: Xisco Fauli AuthorDate: Mon Oct 30 17:30:08 2023 +0100 Commit: Xisco Fauli CommitDate: Tue Oct 31 08:43:40 2023 +0100 related: tdf#156905: sw_odfexport2: Add unittest The sample file started to crash at import time with d8de2dc3c55a9013a71167c8058a333e7221a6a0 "xmloff: import of theme structure + import/export/round-trip tests" Later, it was fixed with 4f347ebabad6355014889f0a81b107dc774590fe "use shared_ptr for model::Theme instead of unique_ptr" but it was still crashing at export time. Finally, the export crash was fixed with 9747d9a6ea954dfca4152d36fdb28a8b77fec84b "xmloff: rename theme color names and color-table to theme-colors" Adding it as a unittest since the crashtesting didn't find it over a range of 3423 commits Change-Id: I466e3db9bc917f299afe2399b15e4d13db11e1ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158670 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sw/qa/extras/odfexport/data/tdf156905.odt b/sw/qa/extras/odfexport/data/tdf156905.odt new file mode 100644 index ..41fe7a1d8c7d Binary files /dev/null and b/sw/qa/extras/odfexport/data/tdf156905.odt differ diff --git a/sw/qa/extras/odfexport/odfexport2.cxx b/sw/qa/extras/odfexport/odfexport2.cxx index 48faa5ac5769..3a24f2896b5e 100644 --- a/sw/qa/extras/odfexport/odfexport2.cxx +++ b/sw/qa/extras/odfexport/odfexport2.cxx @@ -386,6 +386,12 @@ DECLARE_ODFEXPORT_TEST(tdf149248, "tdf149248.odt") CPPUNIT_ASSERT_EQUAL(true, getProperty(getParagraph(4), "ParaHyphenationNoLastWord")); } +DECLARE_ODFEXPORT_TEST(testThemeCrash, "tdf156905.odt") +{ +// first it started to crash at import time, later at export time +CPPUNIT_ASSERT_EQUAL(4, getPages()); +} + DECLARE_ODFEXPORT_TEST(testTdf150394, "tdf150394.odt") { // crashes at import time commit 8d6f1a644895e1a3a1a4ea1fd336125a0ccee964 Author: Xisco Fauli AuthorDate: Mon Oct 30 17:21:05 2023 +0100 Commit: Xisco Fauli CommitDate: Tue Oct 31 08:43:30 2023 +0100 CppunitTest_sd_export_tests-ooxml3: split in two it already has 93 tests Change-Id: Ic0459705255d8728f31c9c07760b2e2f07fac77e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158669 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/sd/CppunitTest_sd_export_tests-ooxml4.mk b/sd/CppunitTest_sd_export_tests-ooxml4.mk new file mode 100644 index ..273d426baa6b --- /dev/null +++ b/sd/CppunitTest_sd_export_tests-ooxml4.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 sd_export_test,-ooxml4)) + +$(call gb_CppunitTest_get_target,sd_export_tests-ooxml4): \ +$(call gb_Package_get_target,postprocess_images) + +# vim: set noet sw=4 ts=4: diff --git a/sd/Module_sd.mk b/sd/Module_sd.mk index 9c3ec45adbfe..b3a825254652 100644 --- a/sd/Module_sd.mk +++ b/sd/Module_sd.mk @@ -37,6 +37,7 @@ $(eval $(call gb_Module_add_slowcheck_targets,sd,\ CppunitTest_sd_export_tests-ooxml1 \ CppunitTest_sd_export_tests-ooxml2 \ CppunitTest_sd_export_tests-ooxml3 \ +CppunitTest_sd_export_tests-ooxml4 \ CppunitTest_sd_export_tests \ CppunitTest_sd_filters_test \ CppunitTest_sd_layout_tests \ diff --git a/sd/qa/unit/export-tests-ooxml3.cxx b/sd/qa/unit/export-tests-ooxml3.cxx index 97a90b7abaf0..409a8affc8d5 100644 --- a/sd/qa/unit/export-tests-ooxml3.cxx +++ b/sd/qa/unit/export-tests-ooxml3.cxx @@ -1,4 +1,3 @@ - /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. @@ -11,25 +10,9 @@ #include #include "sdmodeltestbase.hxx" #include -#include -#include -#include -#include #include -#include - -#include -#include -#include -#include - -#include #include -#include #include -#include -#include -#include #include @@ -985,1036 +968,6 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf135843) assertXPath(pXmlDoc, sPathStart + "/a:tr[3]/a:tc[1]/a:tcPr/a:lnB/a:solidFill"); } -CPPUNI
[Libreoffice-commits] core.git: sw/source
sw/source/filter/html/htmlplug.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit d4f4a401861e7c908b6ab7f72563d5ab911edcf0 Author: Mike Kaganski AuthorDate: Tue Oct 31 09:44:11 2023 +0300 Commit: Mike Kaganski CommitDate: Tue Oct 31 08:50:18 2023 +0100 This function takes a string view - no need in OUString literal Change-Id: I194471b1bb20a41929026c6195b8f2fd669906c4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158682 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index 8331751fe431..bc80a6475af9 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -1567,7 +1567,7 @@ static bool TrySaveFormulaAsPDF(SwHTMLWriter& rWrt, const SwFrameFormat& rFrameF return false; Graphic aGraphic(xTextContent->getReplacementGraphic()); -OUString aFileName = lcl_CalculateFileName(rWrt.GetOrigFileName(), aGraphic, u"pdf"_ustr); +OUString aFileName = lcl_CalculateFileName(rWrt.GetOrigFileName(), aGraphic, u"pdf"); utl::MediaDescriptor aDescr; aDescr[u"FilterName"_ustr] <<= u"math_pdf_Export"_ustr;
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - 2 commits - sc/qa sc/source
sc/qa/unit/subsequent_export_test.cxx | 31 +++ sc/source/filter/excel/xecontent.cxx | 17 - 2 files changed, 47 insertions(+), 1 deletion(-) New commits: commit eb889e467d64e4d131604744fe6d165bd2d9304a Author: Paris Oplopoios AuthorDate: Thu Oct 26 14:28:06 2023 +0300 Commit: Xisco Fauli CommitDate: Tue Oct 31 09:35:04 2023 +0100 sc: Test numeric conditional format text rule exports correctly Change-Id: Ib57ea44912b4cb0be7cbdb127dd7ea6f08ec8392 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158498 Tested-by: Jenkins Reviewed-by: Paris Oplopoios Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158647 diff --git a/sc/qa/unit/subsequent_export_test.cxx b/sc/qa/unit/subsequent_export_test.cxx index 1ce8ef99c926..0d69e3d18ce5 100644 --- a/sc/qa/unit/subsequent_export_test.cxx +++ b/sc/qa/unit/subsequent_export_test.cxx @@ -2133,6 +2133,37 @@ CPPUNIT_TEST_FIXTURE(ScExportTest, testSheetProtectionXLSB) CPPUNIT_ASSERT(!pTabProtect->isOptionEnabled(ScTableProtection::SELECT_LOCKED_CELLS)); } +CPPUNIT_TEST_FIXTURE(ScExportTest, testConditionalFormatNumberInTextRule) +{ +createScDoc(); + +ScDocument* pDocument = getScDoc(); +ScAddress aAddress(0, 0, 0); + +auto pFormat = std::make_unique(0, pDocument); +ScRange aCondFormatRange(aAddress); +ScRangeList aRangeList(aCondFormatRange); +pFormat->SetRange(aRangeList); +ScCondFormatEntry* pEntry += new ScCondFormatEntry(ScConditionMode::BeginsWith, "15", "", *pDocument, aAddress, ""); +pFormat->AddEntry(pEntry); +pDocument->AddCondFormat(std::move(pFormat), 0); + +saveAndReload("Calc Office Open XML"); +pDocument = getScDoc(); + +ScConditionalFormat* pCondFormat = pDocument->GetCondFormat(0, 0, 0); +CPPUNIT_ASSERT(pCondFormat); +CPPUNIT_ASSERT_EQUAL(size_t(1), pCondFormat->size()); +const ScFormatEntry* pCondFormatEntry = pCondFormat->GetEntry(0); +CPPUNIT_ASSERT(pCondFormatEntry); +CPPUNIT_ASSERT_EQUAL(ScFormatEntry::Type::Condition, pCondFormatEntry->GetType()); +const ScConditionEntry* pConditionEntry += static_cast(pCondFormatEntry); +CPPUNIT_ASSERT_EQUAL(ScConditionMode::BeginsWith, pConditionEntry->GetOperation()); +CPPUNIT_ASSERT_EQUAL(OUString("\"15\""), pConditionEntry->GetExpression(aAddress, 0)); +} + namespace { const char* toBorderName(SvxBorderLineStyle eStyle) commit 565c4acc5042cf142b0996f71dee3e511f3b0d29 Author: Paris Oplopoios AuthorDate: Thu Oct 26 12:35:23 2023 +0300 Commit: Xisco Fauli CommitDate: Tue Oct 31 09:34:51 2023 +0100 sc: Export conditional formatting expression correctly for text rules Text rules like BeginsWith would discard the expression if it was a number when exporting, which is not what is supposed to happen - as something like a conditional formatting rule BeginsWith "1" should be valid. Change-Id: I2d53754c462403f20b1991fa201184fcab3616a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158494 Tested-by: Jenkins Reviewed-by: Paris Oplopoios Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158646 diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index b1329e56f535..6f48a6f3ef96 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -1057,7 +1057,22 @@ void XclExpCFImpl::SaveXml( XclExpXmlStream& rStrm ) // the token array for that std::unique_ptr pTokenArray(mrFormatEntry.CreateFlatCopiedTokenArray(0)); if(pTokenArray->GetLen()) -aText = pTokenArray->FirstToken()->GetString().getString().toUtf8(); +{ +formula::StackVar eType = pTokenArray->FirstToken()->GetType(); +switch (eType) +{ +case formula::svDouble: +{ +aText = OString::number(pTokenArray->FirstToken()->GetDouble()); +break; +} +default: +{ +aText = pTokenArray->FirstToken()->GetString().getString().toUtf8(); +break; +} +} +} } sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sc/source
sc/source/filter/inc/orcusinterface.hxx |3 +++ sc/source/filter/orcus/interface.cxx| 15 +++ 2 files changed, 18 insertions(+) New commits: commit 21513faa972d72813a8e2932515a81341bab55a9 Author: Kohei Yoshida AuthorDate: Mon Jul 17 22:22:48 2023 -0400 Commit: Xisco Fauli CommitDate: Tue Oct 31 09:41:13 2023 +0100 Make the reference resolver really available for orcus It was there, but was never really made available. Change-Id: Id7093c4c6b52aa1831f42046a83991b923c70781 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154569 Tested-by: Jenkins Reviewed-by: Kohei Yoshida (cherry picked from commit 9a96c395d52984628b759104f9ce2a7781d0e139) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158681 Tested-by: René Engelhard Reviewed-by: Xisco Fauli diff --git a/sc/source/filter/inc/orcusinterface.hxx b/sc/source/filter/inc/orcusinterface.hxx index 44318d0b1149..ed3966a2e136 100644 --- a/sc/source/filter/inc/orcusinterface.hxx +++ b/sc/source/filter/inc/orcusinterface.hxx @@ -706,6 +706,7 @@ class ScOrcusFactory : public orcus::spreadsheet::iface::import_factory CellStoreTokensType maCellStoreTokens; ScOrcusGlobalSettings maGlobalSettings; +ScOrcusRefResolver maRefResolver; ScOrcusSharedStrings maSharedStrings; ScOrcusNamedExpression maNamedExpressions; std::vector> maSheets; @@ -726,6 +727,8 @@ public: virtual orcus::spreadsheet::iface::import_shared_strings* get_shared_strings() override; virtual orcus::spreadsheet::iface::import_named_expression* get_named_expression() override; virtual orcus::spreadsheet::iface::import_styles* get_styles() override; +virtual orcus::spreadsheet::iface::import_reference_resolver* get_reference_resolver( +orcus::spreadsheet::formula_ref_context_t cxt) override; virtual void finalize() override; ScDocumentImport& getDoc(); diff --git a/sc/source/filter/orcus/interface.cxx b/sc/source/filter/orcus/interface.cxx index e53d2d004e95..ec1250334ecd 100644 --- a/sc/source/filter/orcus/interface.cxx +++ b/sc/source/filter/orcus/interface.cxx @@ -307,6 +307,7 @@ ScOrcusFactory::CellStoreToken::CellStoreToken(const ScAddress& rPos, OUString a ScOrcusFactory::ScOrcusFactory(ScDocument& rDoc, bool bSkipDefaultStyles) : maDoc(rDoc), maGlobalSettings(maDoc), +maRefResolver(maGlobalSettings), maSharedStrings(*this), maNamedExpressions(maDoc, maGlobalSettings), maStyles(*this, bSkipDefaultStyles), @@ -406,6 +407,20 @@ orcus::spreadsheet::iface::import_styles* ScOrcusFactory::get_styles() return &maStyles; } +os::iface::import_reference_resolver* ScOrcusFactory::get_reference_resolver(os::formula_ref_context_t cxt) +{ +switch (cxt) +{ +case os::formula_ref_context_t::global: +return &maRefResolver; +case os::formula_ref_context_t::named_expression_base: +case os::formula_ref_context_t::named_range: +return nullptr; +} + +return nullptr; +} + void ScOrcusFactory::finalize() { auto toFormulaCell = [this]( const CellStoreToken& rToken ) -> std::unique_ptr
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sw/source
sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx |7 +++ 1 file changed, 7 insertions(+) New commits: commit dc01c266f09e0f77442c8e2d5df7741b6a1f6af5 Author: Miklos Vajna AuthorDate: Fri Oct 27 08:11:05 2023 +0200 Commit: Xisco Fauli CommitDate: Tue Oct 31 09:49:56 2023 +0100 tdf#99822 sw floattable: allow nomimal overlap of objects from different cells The bugdoc had a table with a single row and 2 columns, both cells had too wide content. The first column had a too wide chart and the second column had a too wide (multi-page) floating table. What happened is that SwTabFrame::Split() wanted to recalc the split row, and there the overlap detection code pushed down the 2nd shape to the next page, but that next page only contained the 2nd shape, so the shifted down shape wanted to go up to its original position and this way the "format all content lowers" iteration in SwContentFrame::CalcLowers() never returned. Fix the problem by limiting the overlap detection to the same uppers, i.e. in case two floating tables are anchored in the same cell (the anchors have the same upper) to avoid the overlap, but in case the anchors have different uppers, then don't worry about this. This seems to match what Word does. Regression from commit 5127b1961b762643d47a26704556fd9b8664c6fc (sw floattable, nesting: add DOCX import, 2023-09-13), the original problem was already solved by 63007619da7e6c4a6d0c466a8fe54324252be14b (tdf#144798 DOCX import: handle ZOrder of chart objects, 2021-10-18), it seems. Change-Id: I21b9f0ae53bbc69d54a9a9f6870580e3a748ba7f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158520 Reviewed-by: Miklos Vajna Tested-by: Jenkins (cherry picked from commit 435f1aadf7dd8087a8997924bedfccff0f496ba2) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158543 Reviewed-by: Michael Stahl diff --git a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx index 69951ba08a2c..31802ee4c184 100644 --- a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx @@ -1204,6 +1204,7 @@ void SwToContentAnchoredObjectPosition::CalcOverlap(const SwTextFrame* pAnchorFr // Get the list of objects. auto pSortedObjs = pAnchorFrameForVertPos->GetDrawObjs(); +const SwLayoutFrame* pAnchorUpper = pAnchorFrameForVertPos->GetUpper(); bool bSplitFly = false; SwFlyFrame* pFlyFrame = GetAnchoredObj().DynCastFlyFrame(); @@ -1267,6 +1268,12 @@ void SwToContentAnchoredObjectPosition::CalcOverlap(const SwTextFrame* pAnchorFr // An inner fly overlapping with its outer fly is fine. continue; } + +if (pAnchoredObjFlyAnchor && pAnchoredObjFlyAnchor->GetUpper() != pAnchorUpper) +{ +// A fly overlapping with a fly from an other upper is fine. +continue; +} } css::text::WrapTextMode eWrap = pAnchoredObj->GetFrameFormat().GetSurround().GetSurround();
[Libreoffice-commits] core.git: external/libxml2
external/libxml2/ExternalProject_libxml2.mk |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 0f4be839196bfc97a4df71cbaff16df33e7138a8 Author: Caolán McNamara AuthorDate: Mon Oct 30 20:15:01 2023 + Commit: Caolán McNamara CommitDate: Tue Oct 31 11:26:18 2023 +0100 ofz: lots of msan spam in LLVMFuzzerCustomMutator maybe this is that problem Change-Id: I646a93cf815455f3eb1176df0aac5dd6641de649 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158677 Tested-by: Jenkins Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/external/libxml2/ExternalProject_libxml2.mk b/external/libxml2/ExternalProject_libxml2.mk index 2fe0e6005724..a97f69c7eabd 100644 --- a/external/libxml2/ExternalProject_libxml2.mk +++ b/external/libxml2/ExternalProject_libxml2.mk @@ -41,7 +41,7 @@ $(call gb_ExternalProject_get_state_target,libxml2,build): $(if $(verbose),--disable-silent-rules,--enable-silent-rules) \ $(gb_CONFIGURE_PLATFORMS) \ $(if $(filter MACOSX,$(OS)),--prefix=/@.__URELIB) \ - LDFLAGS="$(call gb_ExternalProject_get_link_flags,libxml2) $(if $(SYSBASE),-L$(SYSBASE)/usr/lib)" \ + LDFLAGS="$(LDFLAGS) $(call gb_ExternalProject_get_link_flags,libxml2) $(if $(SYSBASE),-L$(SYSBASE)/usr/lib)" \ CFLAGS="$(CFLAGS) \ $(if $(SYSBASE),-I$(SYSBASE)/usr/include) \ $(call gb_ExternalProject_get_build_flags,libxml2)" \
[Libreoffice-commits] core.git: include/comphelper
include/comphelper/windowserrorstring.hxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit b3c12778aa908a147224cc05f3384b3f57d3b394 Author: Mike Kaganski AuthorDate: Tue Oct 31 11:38:02 2023 +0300 Commit: Mike Kaganski CommitDate: Tue Oct 31 11:39:14 2023 +0100 Update an URL Change-Id: Ie1b01d3d17f453ae1aa3d53c17e52cd4106e222e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158687 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/include/comphelper/windowserrorstring.hxx b/include/comphelper/windowserrorstring.hxx index 1b50f1eadb58..7b6bdb6db8b1 100644 --- a/include/comphelper/windowserrorstring.hxx +++ b/include/comphelper/windowserrorstring.hxx @@ -40,7 +40,7 @@ inline OUString WindowsErrorString(DWORD nErrorCode) inline OUString WindowsErrorStringFromHRESULT(HRESULT hr) { -// See https://blogs.msdn.microsoft.com/oldnewthing/20061103-07/?p=29133 +// See https://devblogs.microsoft.com/oldnewthing/20061103-07/?p=29133 // Also https://social.msdn.microsoft.com/Forums/vstudio/en-US/c33d9a4a-1077-4efd-99e8-0c222743d2f8 // (which refers to https://msdn.microsoft.com/en-us/library/aa382475) // explains why can't we just reinterpret_cast HRESULT to DWORD Win32 error:
[Libreoffice-commits] core.git: oox/source sd/qa sd/source
oox/source/ppt/presentationfragmenthandler.cxx |6 + sd/qa/unit/export-tests-ooxml2.cxx |6 - sd/qa/unit/export-tests-ooxml3.cxx |4 sd/source/filter/eppt/epptooxml.hxx|4 sd/source/filter/eppt/pptx-epptooxml.cxx | 128 +++-- sd/source/ui/inc/unopage.hxx |1 sd/source/ui/unoidl/unopage.cxx| 13 ++ 7 files changed, 147 insertions(+), 15 deletions(-) New commits: commit d590f094ccd28ca449eff91692c2178058d5c621 Author: Henry Castro AuthorDate: Tue Oct 17 07:42:52 2023 -0400 Commit: Henry Castro CommitDate: Tue Oct 31 12:01:43 2023 +0100 tdf#155512: sd: filter: eppt: add "SlideLayout" property to Slide Master If it is importing all Slide Master from pptx file, unfortunately it breaks the exporting to pptx due to save and reload unit test failures According to the documentation http://officeopenxml.com/prSlideLayout.php, so the file pptx has a relationship Slide -> Slide Layout -> Slide Master The Slide Layout is a template an unique to be reused with Slide Master, so exporting requires to compare the templates due to LibreOffice relation Slide -> Slide Master Adjust unit test values: SdOOXMLExportTest2::testTdf106867 revert adcde78935fb8ca2b93322aa3a558d0b3ccdbfad SdOOXMLExportTest2::testTdf112280 revert adcde78935fb8ca2b93322aa3a558d0b3ccdbfad SdOOXMLExportTest2::testThemeColors and SdOOXMLExportTest3::testTdf114848 The file tdf84205.pptx does not contain theme2.xml, and save and reload it does not caintain theme2.xml too fix "An uncaught exception of type com.sun.star.container.NoSuchElementException" Signed-off-by: Henry Castro Change-Id: I622e9d5d68c406ff520387f3903808613d1cd3d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158084 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158676 Tested-by: Jenkins diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index 8c5fbf261414..edb523161c9e 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -230,6 +230,9 @@ SlidePersistPtr PresentationFragmentHandler::importMasterSlide(const ReferencegetFragmentPathFromRelation(rEntry.second); sal_Int32 nIndex; @@ -286,6 +289,9 @@ SlidePersistPtr PresentationFragmentHandler::importMasterSlide(const ReferencecreateBackground( rFilter ); pMasterPersistPtr->createXShapes( rFilter ); +uno::Reference< beans::XPropertySet > xSet(pMasterPersistPtr->getPage(), uno::UNO_QUERY_THROW); +xSet->setPropertyValue("SlideLayout", Any(pMasterPersistPtr->getLayoutFromValueToken())); + oox::drawingml::ThemePtr pTheme = pMasterPersistPtr->getTheme(); if (pTheme) { diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index 625c04953006..30301c6e4c16 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -1313,7 +1313,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf106867) "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/" "p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:cmd/" "p:cBhvr/p:tgtEl/p:spTgt", -"spid", "491"); +"spid", "42"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf112280) @@ -1694,7 +1694,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testAccentColor) "70ad47"); xmlDocUniquePtr pXmlDocTheme2 = parseExport("ppt/theme/theme2.xml"); assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:accent6/a:srgbClr", "val", -"70ad47"); +"deb340"); // Without the accompanying fix in place, this test would have failed with: // - Expected: Motyw pakietu Office @@ -1709,7 +1709,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testThemeColors) createSdImpressDoc("pptx/tdf84205.pptx"); save("Impress Office Open XML"); -xmlDocUniquePtr pXmlDocTheme2 = parseExport("ppt/theme/theme2.xml"); +xmlDocUniquePtr pXmlDocTheme2 = parseExport("ppt/theme/theme1.xml"); assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", "val", "44546a"); assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:accent3/a:srgbClr", "val", diff --git a/sd/qa/unit/export-tests-ooxml3.cxx b/sd/qa/unit/export-tests-ooxml3.cxx index 409a8affc8d5..74bcfebb40a5 100644 --- a/sd/qa/unit/export-tests-ooxml3.cxx +++ b/sd/qa/unit/export-tests-ooxml3.cxx @@ -75,10 +75,6 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest3, testTdf114848) xmlDocUniquePtr pXmlDocTheme1 = parse
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - include/test sc/qa test/source
include/test/unoapi_test.hxx |3 +++ sc/qa/unit/subsequent_export_test2.cxx | 10 -- test/source/unoapi_test.cxx| 18 ++ 3 files changed, 29 insertions(+), 2 deletions(-) New commits: commit 3068163565e8e07bea6ab38a972ae99a47232feb Author: Henry Castro AuthorDate: Thu Sep 21 07:11:13 2023 -0400 Commit: Henry Castro CommitDate: Tue Oct 31 12:13:59 2023 +0100 sc: qa: add loadWithParams and SaveWithParams Add option to load and save with optional parameters. Signed-off-by: Henry Castro Change-Id: I2d735443da11634d072742f1bf6f38f90bced2c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157141 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157569 Tested-by: Jenkins Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158527 diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx index e329168dfe7b..4ba209c44d39 100644 --- a/include/test/unoapi_test.hxx +++ b/include/test/unoapi_test.hxx @@ -36,12 +36,15 @@ public: OUString createFileURL(std::u16string_view aFileBase); OUString createFilePath(std::u16string_view aFileBase); void load(const OUString& rURL, const char* pPassword = nullptr); +void loadWithParams(const OUString& rURL, +const css::uno::Sequence& rParams); OUString loadFromURL(std::u16string_view aFileBase, const char* pPassword = nullptr); css::uno::Any executeMacro(const OUString& rScriptURL, const css::uno::Sequence& rParams = {}); void save(const OUString& rFilter, const char* pPassword = nullptr); +void saveWithParams(const css::uno::Sequence& rParams); void saveAndReload(const OUString& rFilter, const char* pPassword = nullptr); std::unique_ptr parsePDFExport(const OString& rPassword = OString()); diff --git a/sc/qa/unit/subsequent_export_test2.cxx b/sc/qa/unit/subsequent_export_test2.cxx index 403bffc3112f..91309d9e5491 100644 --- a/sc/qa/unit/subsequent_export_test2.cxx +++ b/sc/qa/unit/subsequent_export_test2.cxx @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -698,10 +699,15 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, testHyperlinkTargetFrameODS) CPPUNIT_TEST_FIXTURE(ScExportTest2, testOpenDocumentAsReadOnly) { -createScDoc("xlsx/open-as-read-only.xlsx"); +uno::Sequence aParams = { comphelper::makePropertyValue("Silent", true) }; + +loadWithParams(createFileURL(u"xlsx/open-as-read-only.xlsx"), aParams); ScDocShell* pDocSh = getScDocShell(); CPPUNIT_ASSERT(pDocSh->IsSecurityOptOpenReadOnly()); -saveAndReload("Calc Office Open XML"); + +saveWithParams(uno::Sequence()); +loadWithParams(maTempFile.GetURL(), aParams); + pDocSh = getScDocShell(); CPPUNIT_ASSERT(pDocSh->IsSecurityOptOpenReadOnly()); } diff --git a/test/source/unoapi_test.cxx b/test/source/unoapi_test.cxx index 5c689bfe5354..464f374201bd 100644 --- a/test/source/unoapi_test.cxx +++ b/test/source/unoapi_test.cxx @@ -121,6 +121,18 @@ void UnoApiTest::load(OUString const& rURL, const char* pPassword) } } +void UnoApiTest::loadWithParams(OUString const& rURL, +const uno::Sequence& rParams) +{ +if (mxComponent.is()) +{ +mxComponent->dispose(); +mxComponent.clear(); +} + +mxComponent = loadFromDesktop(rURL, OUString(), rParams); +} + OUString UnoApiTest::loadFromURL(std::u16string_view aFileBase, const char* pPassword) { OUString aFileName = createFileURL(aFileBase); @@ -203,6 +215,12 @@ void UnoApiTest::save(const OUString& rFilter, const char* pPassword) } } +void UnoApiTest::saveWithParams(const uno::Sequence& rParams) +{ +css::uno::Reference xStorable(mxComponent, css::uno::UNO_QUERY_THROW); +xStorable->storeToURL(maTempFile.GetURL(), rParams); +} + void UnoApiTest::saveAndReload(const OUString& rFilter, const char* pPassword) { save(rFilter, pPassword);
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - include/vcl vcl/Library_vcl.mk vcl/qa vcl/source
include/vcl/checksum.hxx | 47 -- vcl/Library_vcl.mk|1 vcl/qa/cppunit/svm/svmtest.cxx| 22 ++-- vcl/source/animate/Animation.cxx |9 + vcl/source/animate/AnimationFrame.cxx | 15 +-- vcl/source/bitmap/BitmapEx.cxx|3 vcl/source/bitmap/bitmappalette.cxx |3 vcl/source/bitmap/checksum.cxx| 154 -- vcl/source/bitmap/salbmp.cxx |7 - vcl/source/filter/svm/SvmWriter.cxx | 149 vcl/source/gdi/pdfwriter_impl.cxx |3 vcl/source/gdi/vectorgraphicdata.cxx |3 vcl/source/graphic/GraphicID.cxx |5 - 13 files changed, 116 insertions(+), 305 deletions(-) New commits: commit f183050bb13de924ab008d68cdcb0b1a4bf24a8b Author: Noel Grandin AuthorDate: Fri Oct 27 11:18:13 2023 +0200 Commit: Caolán McNamara CommitDate: Tue Oct 31 13:26:31 2023 +0100 tdf#152571 speedup slow draw file save with lots of images, we seem to spend lots of time calculating CRC. Replace the vcl checksum/CRC with rtl_crc32 in sal/, which forwards to the zlib implementation, which has all kinds of nice SIMD code for performance. Change-Id: I295e2ee91b3450fa558b06e67aac0fbb20b85f52 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158529 Tested-by: Jenkins Reviewed-by: Noel Grandin (cherry picked from commit 60163a4cc3fde93de92b1ecff3fa54be6cd19cbc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158537 Tested-by: Jenkins CollaboraOffice Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/include/vcl/checksum.hxx b/include/vcl/checksum.hxx index 34d8ed77ad0f..ea2c9adb2e51 100644 --- a/include/vcl/checksum.hxx +++ b/include/vcl/checksum.hxx @@ -16,18 +16,15 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - - -#ifndef INCLUDED_VCL_INC_CHECKSUM_HXX -#define INCLUDED_VCL_INC_CHECKSUM_HXX +#pragma once #include #include #include -#define BITMAP_CHECKSUM_SIZE 8 +#define BITMAP_CHECKSUM_SIZE 4 -typedef sal_uInt64 BitmapChecksum; +typedef sal_uInt32 BitmapChecksum; typedef sal_uInt8 BitmapChecksumOctetArray[BITMAP_CHECKSUM_SIZE]; template< sal_uInt8 N = 0 > @@ -43,42 +40,4 @@ inline void BCToBCOA< BITMAP_CHECKSUM_SIZE >( BitmapChecksum, BitmapChecksumOcte return; } -extern "C" { - -/* - * - * vcl_crc64 interface. - * - *==*/ -/** Evaluate CRC64 over given data. - -This function evaluates the CRC polynomial 0xEDB88320. - -@param Crc[in] CRC64 over previous data or zero. -@param Data [in] data buffer. -@param DatLen [in] data buffer length. -@return new CRC64 value. - */ -VCL_DLLPUBLIC sal_uInt64 vcl_crc64 ( -sal_uInt64 Crc, -const void *Data, sal_uInt32 DatLen -) SAL_THROW_EXTERN_C(); - - -const sal_uInt64* vcl_get_crc64_table(); - -} - -inline BitmapChecksum vcl_get_checksum ( -BitmapChecksum Checksum, -const void *Data, -sal_uInt32 DatLen -) -{ -return static_cast(vcl_crc64( Checksum, Data, DatLen )); -} - - -#endif // INCLUDED_VCL_INC_CHECKSUM_HXX - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 07ac815daf35..d430c649366f 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -370,7 +370,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/bitmap/BitmapColorQuantizationFilter \ vcl/source/bitmap/BitmapSimpleColorQuantizationFilter \ vcl/source/bitmap/BitmapTools \ -vcl/source/bitmap/checksum \ vcl/source/bitmap/Octree \ vcl/source/bitmap/salbmp \ vcl/source/image/Image \ diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx index a1d3560a2e84..bbfad90af460 100644 --- a/vcl/qa/cppunit/svm/svmtest.cxx +++ b/vcl/qa/cppunit/svm/svmtest.cxx @@ -942,11 +942,11 @@ void SvmTest::checkBitmaps(const GDIMetaFile& rMetaFile) #if defined OSL_BIGENDIAN "5e01ddcc" #else -"b8dee5da" +"469f0820" #endif }}); assertXPathAttrs(pDoc, "/metafile/bmpscale[1]", { -{"x", "1"}, {"y", "2"}, {"width", "3"}, {"height", "4"}, {"crc", "281fc589"} +{"x", "1"}, {"y", "2"}, {"width", "3"}, {"height", "4"}, {"crc", "4937e32d"} }); assertXPathAttrs(pDoc, "/metafile/bmpscalepart[1]", { {"destx", "1"}, {"desty", "2"}, {"destwidth", "3"}, {"destheight", "4"}, @@ -955,7 +955,7 @@ void SvmTest::checkBitmaps(const GDIMetaFile& rMetaFile) #if defined OSL_BIGENDIAN "b8dee5da" #else - "5e01ddcc" + "3789377b" #endif } }); @@ -1018,14 +1018,14 @@ void SvmTest::checkBitmapExs(const GDIMetaFile& rMetaFile) "33b4a
[Libreoffice-commits] core.git: officecfg/registry sc/source sc/uiconfig
officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu | 15 +- sc/source/ui/condformat/condformateasydlg.cxx | 24 -- sc/uiconfig/scalc/popupmenu/conditional_easy.xml |1 3 files changed, 35 insertions(+), 5 deletions(-) New commits: commit c8da023efe26efcb166c3525ca73fe62f26e154c Author: offtkp AuthorDate: Mon Oct 30 14:28:12 2023 +0200 Commit: Paris Oplopoios CommitDate: Tue Oct 31 14:23:05 2023 +0100 tdf#157930 Add Contains Text rule to easy conditional format dialog Contains Text is another commonly used conditional formatting rule that could be of use here Change-Id: I67a3f711c57f9917be26fa21badd2f5a0d133747 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158657 Tested-by: Jenkins Reviewed-by: Paris Oplopoios diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu index 7bd5215d627e..fe726492ffb4 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu @@ -666,7 +666,7 @@ - Conditional Formatting: Condition Less Than + Conditional Formatting: Less Than Less than... @@ -677,7 +677,7 @@ - Conditional Formatting: Condition Equals + Conditional Formatting: Equals Equals... @@ -697,6 +697,17 @@ 1 + + + Conditional Formatting: Contains Text + + + Containing text... + + + 1 + + Conditional Formatting: More Rules diff --git a/sc/source/ui/condformat/condformateasydlg.cxx b/sc/source/ui/condformat/condformateasydlg.cxx index 0fee5ea15b36..6ecf98e87e21 100644 --- a/sc/source/ui/condformat/condformateasydlg.cxx +++ b/sc/source/ui/condformat/condformateasydlg.cxx @@ -208,9 +208,27 @@ IMPL_LINK(ConditionalFormatEasyDialog, ButtonPressed, weld::Button&, rButton, vo if (&rButton == mxButtonOk.get()) { std::unique_ptr pFormat(new ScConditionalFormat(0, mpDocument)); + +OUString sExpression1 = mxNumberEntry->get_text(); +OUString sExpression2 = mxNumberEntry2->get_text(); + +switch (meMode) +{ +case ScConditionMode::ContainsText: +case ScConditionMode::NotContainsText: +case ScConditionMode::BeginsWith: +case ScConditionMode::EndsWith: +sExpression1 = "\"" + sExpression1 + "\""; +sExpression2 = "\"" + sExpression2 + "\""; +break; +default: +break; +} + ScFormatEntry* pEntry -= new ScCondFormatEntry(meMode, mxNumberEntry->get_text(), mxNumberEntry2->get_text(), -*mpDocument, maPosition, mxStyles->get_active_text()); += new ScCondFormatEntry(meMode, sExpression1, sExpression2, *mpDocument, maPosition, +mxStyles->get_active_text()); + ScRangeList aRange; ScRefFlags nFlags = aRange.Parse(mxRangeEntry->GetText(), mpViewData->GetDocument(), @@ -229,4 +247,4 @@ IMPL_LINK(ConditionalFormatEasyDialog, ButtonPressed, weld::Button&, rButton, vo m_xDialog->response(RET_CANCEL); } -} // namespace sc \ No newline at end of file +} // namespace sc diff --git a/sc/uiconfig/scalc/popupmenu/conditional_easy.xml b/sc/uiconfig/scalc/popupmenu/conditional_easy.xml index 3346fa9441bb..70bd311d4480 100644 --- a/sc/uiconfig/scalc/popupmenu/conditional_easy.xml +++ b/sc/uiconfig/scalc/popupmenu/conditional_easy.xml @@ -12,6 +12,7 @@ +
[Libreoffice-commits] core.git: sc/source
sc/source/core/data/column2.cxx | 12 ++-- sc/source/core/data/column4.cxx |2 +- sc/source/ui/docshell/docfunc.cxx |2 +- sc/source/ui/docshell/docsh4.cxx |6 +++--- sc/source/ui/inc/docsh.hxx|2 +- sc/source/ui/undo/undocell.cxx|4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) New commits: commit f1d2442662a1c593c0ed47391156719ffdf9385f Author: Caolán McNamara AuthorDate: Tue Oct 31 10:55:13 2023 + Commit: Caolán McNamara CommitDate: Tue Oct 31 15:10:05 2023 +0100 we always have a ScDocument so pass by reference Change-Id: Ic82c71ea6d0490d17fcca07afe4f7da9441a5794 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158715 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index a2f8ca5ea25a..e7ca588a0b34 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -1945,7 +1945,7 @@ public: ScPostIt* pNew = p->Clone(aSrcPos, mrDestCol.GetDoc(), aDestPos, mbCloneCaption).release(); miPos = mrDestNotes.set(miPos, nDestRow, pNew); // Notify our LOK clients also -ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Add, &mrDestCol.GetDoc(), aDestPos, pNew); +ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Add, mrDestCol.GetDoc(), aDestPos, pNew); } }; @@ -2230,13 +2230,13 @@ void ScColumn::SetCellNote(SCROW nRow, std::unique_ptr pNote) namespace { class CellNoteHandler { -const ScDocument* m_pDocument; +const ScDocument& m_rDocument; const ScAddress m_aAddress; // 'incomplete' address consisting of tab, column const bool m_bForgetCaptionOwnership; public: -CellNoteHandler(const ScDocument* pDocument, const ScAddress& rPos, bool bForgetCaptionOwnership) : -m_pDocument(pDocument), +CellNoteHandler(const ScDocument& rDocument, const ScAddress& rPos, bool bForgetCaptionOwnership) : +m_rDocument(rDocument), m_aAddress(rPos), m_bForgetCaptionOwnership(bForgetCaptionOwnership) {} @@ -2249,7 +2249,7 @@ namespace { ScAddress aAddr(m_aAddress); aAddr.SetRow(nRow); // Notify our LOK clients -ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Remove, m_pDocument, aAddr, p); +ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Remove, m_rDocument, aAddr, p); } }; } // anonymous namespace @@ -2257,7 +2257,7 @@ namespace { void ScColumn::CellNotesDeleting(SCROW nRow1, SCROW nRow2, bool bForgetCaptionOwnership) { ScAddress aAddr(nCol, 0, nTab); -CellNoteHandler aFunc(&GetDoc(), aAddr, bForgetCaptionOwnership); +CellNoteHandler aFunc(GetDoc(), aAddr, bForgetCaptionOwnership); sc::ParseNote(maCellNotes.begin(), maCellNotes, nRow1, nRow2, aFunc); } diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx index be0fc4f201c3..8e22b13a8e1e 100644 --- a/sc/source/core/data/column4.cxx +++ b/sc/source/core/data/column4.cxx @@ -362,7 +362,7 @@ void ScColumn::CopyOneCellFromClip( sc::CopyFromClipContext& rCxt, SCROW nRow1, aDestPosition.SetRow(nRow1); for (size_t i = 0; i < nDestSize; ++i) { -ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Add, &rDocument, aDestPosition, aNotes[i]); +ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Add, rDocument, aDestPosition, aNotes[i]); aDestPosition.IncRow(); } } diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 5691a67b9780..7ad32d4963b9 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -1396,7 +1396,7 @@ void ScDocFunc::ReplaceNote( const ScAddress& rPos, const OUString& rNoteText, c if (pNewNote) { ScDocShell::LOKCommentNotify(hadOldNote ? LOKCommentNotificationType::Modify : LOKCommentNotificationType::Add, - &rDoc, rPos, pNewNote); + rDoc, rPos, pNewNote); } } else if (!bApi) diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 0ef5be3c50e8..f8a33f91d1e8 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -2535,9 +2535,9 @@ bool ScDocShell::DdeSetData( const OUString& rItem, return pObj; } -void ScDocShell::LOKCommentNotify(LOKCommentNotificationType nType, const ScDocument* pDocument, const ScAddress& rPos, const ScPostIt* pNote) +void ScDocShell::LOKCommentNotify(LOKCommentNotificationType nType, const ScDocument& rDocument, const ScAddress& rPos, const ScPostIt* pNote) { -if ( !pDocument->IsDocVisible() || // don't want callbacks until document load +if ( !rDocument.IsDocVisible() || // don't want callback
[Libreoffice-commits] core.git: sc/source svtools/source
sc/source/ui/view/tabview.cxx |3 ++- svtools/source/control/tabbar.cxx |4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) New commits: commit a90d89d5b2dae2b4c3fd6a411de2160a3bf20779 Author: Andreas Heinisch AuthorDate: Mon Oct 30 20:29:05 2023 +0100 Commit: Andreas Heinisch CommitDate: Tue Oct 31 15:37:57 2023 +0100 tdf#100584, tdff#157784 - Arrange sheets depending on the RTL settings The tab bar's position should be determined globally based on the RTL settings, rather than being individually set for each sheet. Change-Id: I0906f85058a5b4250540dda07740eec61f46d299 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158675 Tested-by: Andreas Heinisch Reviewed-by: Andreas Heinisch diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index d158516fdb0a..25d60abc2946 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -280,7 +280,8 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner ) if (bHasHint) RemoveHintWindow(); -bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( aViewData.GetTabNo() ); +// tdf#100584 - arrange sheets depending on the RTL settings +bool bLayoutRTL = AllSettings::GetLayoutRTL(); tools::Long nTotalWidth = rSize.Width(); if ( bLayoutRTL ) nTotalWidth += 2*rOffset.X(); diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index 1690269ba234..02a23b8aea33 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -715,9 +715,7 @@ void TabBar::ImplFormat() const size_t nItemListSize = mpImpl->maItemList.size(); for (size_t nItemIndex = 0; nItemIndex < nItemListSize; nItemIndex++) { -// tdf#100584 - arrange sheets depending on the RTL settings -auto& rItem = mbMirrored ? mpImpl->maItemList[nItemListSize - nItemIndex - 1] - : mpImpl->maItemList[nItemIndex]; +auto& rItem = mpImpl->maItemList[nItemIndex]; // At all non-visible tabs an empty rectangle is set if ((nItemIndex + 1 < mnFirstPos) || (x > mnLastOffX))
[Libreoffice-commits] core.git: sc/source svtools/source
sc/source/ui/view/tabview.cxx |3 +-- svtools/source/control/tabbar.cxx |4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) New commits: commit 3be361d00eb1d61543e2c8c6953e63c149fb1eb0 Author: Andreas Heinisch AuthorDate: Tue Oct 31 15:39:13 2023 +0100 Commit: Andreas Heinisch CommitDate: Tue Oct 31 15:40:01 2023 +0100 Revert "tdf#100584, tdff#157784 - Arrange sheets depending on the RTL settings" This reverts commit a90d89d5b2dae2b4c3fd6a411de2160a3bf20779. Reason for revert: Typo in the commit message Change-Id: I58f184e2733d91aa827396868fb4f7b8e9d47a48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158693 Tested-by: Andreas Heinisch Reviewed-by: Andreas Heinisch diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 25d60abc2946..d158516fdb0a 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -280,8 +280,7 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner ) if (bHasHint) RemoveHintWindow(); -// tdf#100584 - arrange sheets depending on the RTL settings -bool bLayoutRTL = AllSettings::GetLayoutRTL(); +bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( aViewData.GetTabNo() ); tools::Long nTotalWidth = rSize.Width(); if ( bLayoutRTL ) nTotalWidth += 2*rOffset.X(); diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index 02a23b8aea33..1690269ba234 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -715,7 +715,9 @@ void TabBar::ImplFormat() const size_t nItemListSize = mpImpl->maItemList.size(); for (size_t nItemIndex = 0; nItemIndex < nItemListSize; nItemIndex++) { -auto& rItem = mpImpl->maItemList[nItemIndex]; +// tdf#100584 - arrange sheets depending on the RTL settings +auto& rItem = mbMirrored ? mpImpl->maItemList[nItemListSize - nItemIndex - 1] + : mpImpl->maItemList[nItemIndex]; // At all non-visible tabs an empty rectangle is set if ((nItemIndex + 1 < mnFirstPos) || (x > mnLastOffX))
[Libreoffice-commits] core.git: desktop/source
desktop/source/lib/init.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit a269f52d2016ef72f51e8b73574b6cbd0f448e33 Author: Marco Cecchetti AuthorDate: Thu Oct 26 20:22:17 2023 +0200 Commit: Caolán McNamara CommitDate: Tue Oct 31 15:44:24 2023 +0100 lok a11y: calc: make possible to enable accessibility for spreadsheets Change-Id: I462b2d386b58a895bd4c45d4bd61a049404d3848 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158512 Reviewed-by: Andras Timar Tested-by: Andras Timar (cherry picked from commit e5481fdaf33a3921ef0624e8a62e28e2f68086da) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158691 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index ab4987376f4f..78e8eeaf2180 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -7179,7 +7179,7 @@ static void doc_setAccessibilityState(SAL_UNUSED_PARAMETER LibreOfficeKitDocumen SolarMutexGuard aGuard; int nDocType = getDocumentType(pThis); -if (!(nDocType == LOK_DOCTYPE_TEXT || nDocType == LOK_DOCTYPE_PRESENTATION)) +if (!(nDocType == LOK_DOCTYPE_TEXT || nDocType == LOK_DOCTYPE_PRESENTATION || nDocType == LOK_DOCTYPE_SPREADSHEET)) return; SfxLokHelper::setAccessibilityState(nId, nEnabled);
[Libreoffice-commits] core.git: sc/source svtools/source
sc/source/ui/view/tabview.cxx |3 ++- svtools/source/control/tabbar.cxx |4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) New commits: commit 4f1b3c16f5530a2a190cab07c07c7bf63acf42c7 Author: Andreas Heinisch AuthorDate: Tue Oct 31 15:48:44 2023 +0100 Commit: Andreas Heinisch CommitDate: Tue Oct 31 15:51:59 2023 +0100 tdf#100584, tdf#157784 - Arrange sheets depending on the RTL settings The tab bar's position should be determined globally based on the RTL settings, rather than being individually set for each sheet. Change-Id: I0690b01c842d2da6d49b57d1adad0a8e0844087f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158730 Tested-by: Andreas Heinisch Reviewed-by: Andreas Heinisch diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index d158516fdb0a..25d60abc2946 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -280,7 +280,8 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner ) if (bHasHint) RemoveHintWindow(); -bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( aViewData.GetTabNo() ); +// tdf#100584 - arrange sheets depending on the RTL settings +bool bLayoutRTL = AllSettings::GetLayoutRTL(); tools::Long nTotalWidth = rSize.Width(); if ( bLayoutRTL ) nTotalWidth += 2*rOffset.X(); diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index 1690269ba234..02a23b8aea33 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -715,9 +715,7 @@ void TabBar::ImplFormat() const size_t nItemListSize = mpImpl->maItemList.size(); for (size_t nItemIndex = 0; nItemIndex < nItemListSize; nItemIndex++) { -// tdf#100584 - arrange sheets depending on the RTL settings -auto& rItem = mbMirrored ? mpImpl->maItemList[nItemListSize - nItemIndex - 1] - : mpImpl->maItemList[nItemIndex]; +auto& rItem = mpImpl->maItemList[nItemIndex]; // At all non-visible tabs an empty rectangle is set if ((nItemIndex + 1 < mnFirstPos) || (x > mnLastOffX))
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - oox/source sd/qa sd/source
oox/source/ppt/presentationfragmenthandler.cxx |6 + sd/qa/unit/export-tests-ooxml2.cxx |6 - sd/qa/unit/export-tests-ooxml3.cxx |4 sd/source/filter/eppt/epptooxml.hxx|4 sd/source/filter/eppt/pptx-epptooxml.cxx | 128 +++-- sd/source/ui/inc/unopage.hxx |1 sd/source/ui/unoidl/unopage.cxx| 13 ++ 7 files changed, 147 insertions(+), 15 deletions(-) New commits: commit a1b3d8d6e90923f2cd03a556afd09edc2d084475 Author: Henry Castro AuthorDate: Tue Oct 17 07:42:52 2023 -0400 Commit: Henry Castro CommitDate: Tue Oct 31 15:56:19 2023 +0100 tdf#155512: sd: filter: eppt: add "SlideLayout" property to Slide Master If it is importing all Slide Master from pptx file, unfortunately it breaks the exporting to pptx due to save and reload unit test failures According to the documentation http://officeopenxml.com/prSlideLayout.php, so the file pptx has a relationship Slide -> Slide Layout -> Slide Master The Slide Layout is a template an unique to be reused with Slide Master, so exporting requires to compare the templates due to LibreOffice relation Slide -> Slide Master Adjust unit test values: SdOOXMLExportTest2::testTdf106867 revert adcde78935fb8ca2b93322aa3a558d0b3ccdbfad SdOOXMLExportTest2::testTdf112280 revert adcde78935fb8ca2b93322aa3a558d0b3ccdbfad SdOOXMLExportTest2::testThemeColors and SdOOXMLExportTest3::testTdf114848 The file tdf84205.pptx does not contain theme2.xml, and save and reload it does not caintain theme2.xml too fix "An uncaught exception of type com.sun.star.container.NoSuchElementException" Signed-off-by: Henry Castro Change-Id: I622e9d5d68c406ff520387f3903808613d1cd3d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158084 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158676 Tested-by: Jenkins Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158717 diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index 09c39902a66a..dab9648cb025 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -230,6 +230,9 @@ SlidePersistPtr PresentationFragmentHandler::importMasterSlide(const ReferencegetFragmentPathFromRelation(rEntry.second); sal_Int32 nIndex; @@ -286,6 +289,9 @@ SlidePersistPtr PresentationFragmentHandler::importMasterSlide(const ReferencecreateBackground( rFilter ); pMasterPersistPtr->createXShapes( rFilter ); +uno::Reference< beans::XPropertySet > xSet(pMasterPersistPtr->getPage(), uno::UNO_QUERY_THROW); +xSet->setPropertyValue("SlideLayout", Any(pMasterPersistPtr->getLayoutFromValueToken())); + oox::drawingml::ThemePtr pTheme = pMasterPersistPtr->getTheme(); if (pTheme) { diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index 754ee0d3035e..ed6568d0bc1f 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -1313,7 +1313,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf106867) "/p:sld/p:timing/p:tnLst/p:par/p:cTn/p:childTnLst/p:seq/p:cTn/p:childTnLst/p:par/" "p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:par/p:cTn/p:childTnLst/p:cmd/" "p:cBhvr/p:tgtEl/p:spTgt", -"spid", "491"); +"spid", "42"); } CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testTdf112280) @@ -1694,7 +1694,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testAccentColor) "70ad47"); xmlDocUniquePtr pXmlDocTheme2 = parseExport("ppt/theme/theme2.xml"); assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:accent6/a:srgbClr", "val", -"70ad47"); +"deb340"); // Without the accompanying fix in place, this test would have failed with: // - Expected: Motyw pakietu Office @@ -1709,7 +1709,7 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExportTest2, testThemeColors) createSdImpressDoc("pptx/tdf84205.pptx"); save("Impress Office Open XML"); -xmlDocUniquePtr pXmlDocTheme2 = parseExport("ppt/theme/theme2.xml"); +xmlDocUniquePtr pXmlDocTheme2 = parseExport("ppt/theme/theme1.xml"); assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:dk2/a:srgbClr", "val", "44546a"); assertXPath(pXmlDocTheme2, "/a:theme/a:themeElements/a:clrScheme/a:accent3/a:srgbClr", "val", diff --git a/sd/qa/unit/export-tests-ooxml3.cxx b/sd/qa/unit/export-tests-ooxml3.cxx index 5b33feacea63..3d630db22aa3 100644 --- a/sd/qa/unit/export-tests-ooxml3.cxx +++ b/sd/qa/unit/export-tests-ooxml3.cxx @@ -92,10 +92,6 @@ CPPUNIT_TEST_FIXTURE(SdOOXMLExport
[Libreoffice-commits] core.git: sw/source
sw/source/core/doc/docredln.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit bfeb6375a96d75ed7117f1581b0a0d7cb0d236ca Author: Attila Szűcs AuthorDate: Thu Oct 26 23:11:03 2023 +0200 Commit: Caolán McNamara CommitDate: Tue Oct 31 16:27:25 2023 +0100 tdf#157662 SW: fix connected area calculation Reset pRedline to its origin value between the 2 loops, because the 1. loop may change it. without this fix, if it discover neightbours in the 1. direction, it will not discover them in the other direction. Change-Id: Ia1ab357ada17cb7574907a3aa1bf0dd4d7a90255 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158517 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158721 Tested-by: Jenkins diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 0472343d8eb3..8ef699787b3f 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -846,6 +846,7 @@ void SwRedlineTable::getConnectedArea(size_type nPosOrigin, size_type& rPosStart rPosStart--; pRedline = pOther; } +pRedline = pOrigin; while (rPosEnd + 1 < size() && (pOther = (*this)[rPosEnd + 1]) && lcl_CanCombineWithRange(pOrigin, pRedline, pOther, false, bCheckChilds)) {
New Defects reported by Coverity Scan for LibreOffice
Hi, Please find the latest report on new defect(s) introduced to LibreOffice found with Coverity Scan. 1 new defect(s) introduced to LibreOffice found with Coverity Scan. New defect(s) Reported-by: Coverity Scan Showing 1 of 1 defect(s) ** CID 1548365: Control flow issues (DEADCODE) /emfio/source/reader/wmfreader.cxx: 1734 in emfio::WmfReader::GetPlaceableBound(tools::Rectangle &, SvStream *)() *** CID 1548365: Control flow issues (DEADCODE) /emfio/source/reader/wmfreader.cxx: 1734 in emfio::WmfReader::GetPlaceableBound(tools::Rectangle &, SvStream *)() 1728 { 1729 break; 1730 } 1731 1732 switch( nFunction ) 1733 { >>> CID 1548365: Control flow issues (DEADCODE) >>> Execution cannot reach this statement: "case ::W_META_EOF:". 1734 case W_META_EOF: 1735 { 1736 return; 1737 } 1738 1739 case W_META_SETWINDOWORG: To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypSs1kiFPuCn2xFdlMIFBirii0zZ9j2-2F9F2XPBcBm2BNnPiSHxWPOELPnIxzXoBNaw-3DAnJ6_OTq2XUZbbipYjyLSo6GRo-2FpVxQ9OzkDINu9UTS-2FQhSdO0F0jQniitrGlNxDIzPJiKGkF6HBw-2FpBOebamfVB-2FC-2FYWEsF-2Bt54fTgKMdEOunqpco7zCbOsMIwmIosn-2FvPdc7k8Js77uLMhzVL1CoyRA5kAPVVRymXtt-2FaIY4DkrjTOeRPcnovTzsN-2Fn6wHm8-2F5zV-2BmqAFkWVKHDzSfdcUIqgvaGssRkj0M-2FEm6WKlwAEuM-3D
[Libreoffice-commits] core.git: sc/inc sc/source
sc/inc/column.hxx |2 +- sc/source/core/data/column.cxx | 28 ++-- sc/source/core/data/table2.cxx |2 +- 3 files changed, 24 insertions(+), 8 deletions(-) New commits: commit c15c1d87fceb782d76b5984f576d03a63c609ae5 Author: Caolán McNamara AuthorDate: Tue Oct 31 11:33:56 2023 + Commit: Caolán McNamara CommitDate: Tue Oct 31 17:15:30 2023 +0100 tell client when the cell for the comment changed when a row/column is inserted/deleted, etc the cell the comments are associated with changes, so broadcast that change to the clients. https://github.com/CollaboraOnline/online/issues/7334 Change-Id: I8a3e5fc151b6ba99e68b32c3fe8804de9ba2baf4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158720 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 0f30f64cb672..26ef79da2e6d 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -714,7 +714,7 @@ public: void DuplicateNotes(SCROW nStartRow, size_t nDataSize, ScColumn& rDestCol, sc::ColumnBlockPosition& rDestBlockPos, bool bCloneCaption, SCROW nRowOffsetDest = 0) const; -void UpdateNoteCaptions( SCROW nRow1, SCROW nRow2 ); +void UpdateNoteCaptions( SCROW nRow1, SCROW nRow2, bool bAddressChanged = true ); void UpdateDrawObjects( std::vector>& pObjects, SCROW nRowStart, SCROW nRowEnd ); void UpdateDrawObjectsForRow( std::vector& pObjects, SCCOL nTargetCol, SCROW nTargetRow ); diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index fea2f84e5be0..7ffd5ae9c735 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -1808,22 +1809,37 @@ void resetColumnPosition(sc::CellStoreType& rCells, SCCOL nCol) class NoteCaptionUpdater { -SCCOL mnCol; -SCTAB mnTab; +const ScDocument& m_rDocument; +const ScAddress m_aAddress; // 'incomplete' address consisting of tab, column +bool m_bAddressChanged; // false if the cell anchor address is unchanged public: -NoteCaptionUpdater( SCCOL nCol, SCTAB nTab ) : mnCol(nCol), mnTab(nTab) {} +NoteCaptionUpdater(const ScDocument& rDocument, const ScAddress& rPos, bool bAddressChanged) +: m_rDocument(rDocument) +, m_aAddress(rPos) +, m_bAddressChanged(bAddressChanged) +{ +} void operator() ( size_t nRow, ScPostIt* p ) { -p->UpdateCaptionPos(ScAddress(mnCol,nRow,mnTab)); +// Create a 'complete' address object +ScAddress aAddr(m_aAddress); +aAddr.SetRow(nRow); + +p->UpdateCaptionPos(aAddr); + +// Notify our LOK clients +if (m_bAddressChanged) +ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Modify, m_rDocument, aAddr, p); } }; } -void ScColumn::UpdateNoteCaptions( SCROW nRow1, SCROW nRow2 ) +void ScColumn::UpdateNoteCaptions( SCROW nRow1, SCROW nRow2, bool bAddressChanged ) { -NoteCaptionUpdater aFunc(nCol, nTab); +ScAddress aAddr(nCol, 0, nTab); +NoteCaptionUpdater aFunc(GetDoc(), aAddr, bAddressChanged); sc::ProcessNote(maCellNotes.begin(), maCellNotes, nRow1, nRow2, aFunc); } diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 31a0d6f1dd1e..978bd00ecbac 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -1491,7 +1491,7 @@ void ScTable::CopyCaptionsToTable( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW for (SCCOL i = nCol1; i <= nCol2; i++) { aCol[i].CopyCellNotesToDocument(nRow1, nRow2, pDestTab->CreateColumnIfNotExists(i), bCloneCaption); -pDestTab->aCol[i].UpdateNoteCaptions(nRow1, nRow2); +pDestTab->aCol[i].UpdateNoteCaptions(nRow1, nRow2, false /* address unchanged from initial create */); } }
[Libreoffice-commits] core.git: vcl/qa
vcl/qa/cppunit/pdfexport/data/tdf157679.pptx |binary vcl/qa/cppunit/pdfexport/pdfexport.cxx | 28 +++ 2 files changed, 28 insertions(+) New commits: commit d0f521132c43fea1ca18e18d3e31c6d868e4ebd6 Author: Xisco Fauli AuthorDate: Tue Oct 31 13:43:32 2023 +0100 Commit: Xisco Fauli CommitDate: Tue Oct 31 17:24:31 2023 +0100 tdf#157679: vcl_pdfexport: Add unittest Change-Id: I31aa7f683e8d9f9a227ba88c58e7fdba94c83bb5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158725 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/vcl/qa/cppunit/pdfexport/data/tdf157679.pptx b/vcl/qa/cppunit/pdfexport/data/tdf157679.pptx new file mode 100644 index ..ca82491c21f3 Binary files /dev/null and b/vcl/qa/cppunit/pdfexport/data/tdf157679.pptx differ diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx index fdcc1730b6a8..192d559f9c74 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx @@ -1692,6 +1692,34 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf105954) CPPUNIT_ASSERT_LESS(static_cast(250), aMeta.getWidth()); } +CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf157679) +{ +// Import the bugdoc and export as PDF. +aMediaDescriptor["FilterName"] <<= OUString("impress_pdf_Export"); +saveAsPDF(u"tdf157679.pptx"); +std::unique_ptr pPdfDocument = parsePDFExport(); + +// The document has one page. +CPPUNIT_ASSERT_EQUAL(1, pPdfDocument->getPageCount()); + +std::unique_ptr pPdfPage = pPdfDocument->openPage(/*nIndex=*/0); +CPPUNIT_ASSERT(pPdfPage); + +// Without the fix in place, this test would have failed with +// - Expected: 3 +// - Actual : 5 +CPPUNIT_ASSERT_EQUAL(3, pPdfPage->getObjectCount()); + +std::unique_ptr pTextPage = pPdfPage->getTextPage(); +int nPageObjectCount = pPdfPage->getObjectCount(); +for (int i = 0; i < nPageObjectCount; ++i) +{ +// Check there are not Text objects +std::unique_ptr pPageObject = pPdfPage->getObject(i); +CPPUNIT_ASSERT(pPageObject->getType() != vcl::pdf::PDFPageObjectType::Text); +} +} + CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf128445) { // Import the bugdoc and export as PDF.
[Libreoffice-commits] core.git: include/svx svx/source
include/svx/svdoattr.hxx |4 +--- include/svx/svdobj.hxx |2 +- include/svx/svdovirt.hxx |3 +++ svx/source/svdraw/svdoattr.cxx |5 - svx/source/svdraw/svdobj.cxx | 10 +- svx/source/svdraw/svdovirt.cxx |6 ++ 6 files changed, 16 insertions(+), 14 deletions(-) New commits: commit 5d0748b0c44649c422980a2b2f5554846c47ac9c Author: Noel Grandin AuthorDate: Tue Oct 31 12:09:56 2023 +0200 Commit: Noel Grandin CommitDate: Tue Oct 31 18:09:53 2023 +0100 SdrAttrObj and SdrObject are abstract so push the CreateObjectSpecificProperties implementation down to the concrete subclasses. Change-Id: If2c9545aada3e9f2c2f2a0140b6d880bdfef111d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158711 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/svx/svdoattr.hxx b/include/svx/svdoattr.hxx index 3933caa3f3f5..26990a193b46 100644 --- a/include/svx/svdoattr.hxx +++ b/include/svx/svdoattr.hxx @@ -29,15 +29,13 @@ class SdrOutliner; class SfxItemSet; class SfxItemPool; -// SdrAttrObj +// SdrAttrObj. This is an abstract class, we only instantiate its subclasses. class SVXCORE_DLLPUBLIC SdrAttrObj : public SdrObject { private: friend classSdrOutliner; protected: -virtual std::unique_ptr CreateObjectSpecificProperties() override; - tools::Rectangle maSnapRect; protected: diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx index 631a5973bb7b..892beb56668c 100644 --- a/include/svx/svdobj.hxx +++ b/include/svx/svdobj.hxx @@ -917,7 +917,7 @@ protected: virtual ~SdrObject() override; -virtual std::unique_ptr CreateObjectSpecificProperties(); +virtual std::unique_ptr CreateObjectSpecificProperties() = 0; virtual std::unique_ptr CreateObjectSpecificViewContact(); diff --git a/include/svx/svdovirt.hxx b/include/svx/svdovirt.hxx index 8ccddce4d263..17c869313067 100644 --- a/include/svx/svdovirt.hxx +++ b/include/svx/svdovirt.hxx @@ -34,6 +34,9 @@ public: virtual sdr::properties::BaseProperties& GetProperties() const override; protected: +virtual std::unique_ptr +CreateObjectSpecificProperties() override; + virtual std::unique_ptr CreateObjectSpecificViewContact() override; rtl::Reference mxRefObj; // Referenced drawing object diff --git a/svx/source/svdraw/svdoattr.cxx b/svx/source/svdraw/svdoattr.cxx index 2c1b208d314d..ae4f59baa5cf 100644 --- a/svx/source/svdraw/svdoattr.cxx +++ b/svx/source/svdraw/svdoattr.cxx @@ -29,11 +29,6 @@ using namespace com::sun::star; -std::unique_ptr SdrAttrObj::CreateObjectSpecificProperties() -{ -return std::make_unique(*this); -} - SdrAttrObj::SdrAttrObj(SdrModel& rSdrModel) : SdrObject(rSdrModel) { diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index c5741f5007c1..f4d13219db0d 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -211,11 +211,6 @@ const std::shared_ptr< svx::diagram::IDiagramHelper >& SdrObject::getDiagramHelp // BaseProperties section -std::unique_ptr SdrObject::CreateObjectSpecificProperties() -{ -return std::make_unique(*this); -} - sdr::properties::BaseProperties& SdrObject::GetProperties() const { if(!mpProperties) @@ -3245,6 +3240,11 @@ public: return new EmptyObject(rTargetModel, *this); } +virtual std::unique_ptr CreateObjectSpecificProperties() override +{ +return std::make_unique(*this); +} + SdrInventor GetObjInventor() const override { return OBJECT_INVENTOR; diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx index 25a38804a78b..b1fe6f5cb9bb 100644 --- a/svx/source/svdraw/svdovirt.cxx +++ b/svx/source/svdraw/svdovirt.cxx @@ -18,6 +18,7 @@ */ +#include #include #include #include @@ -31,6 +32,11 @@ sdr::properties::BaseProperties& SdrVirtObj::GetProperties() const } +std::unique_ptr SdrVirtObj::CreateObjectSpecificProperties() +{ +return std::make_unique(*this); +} + // #i27224# std::unique_ptr SdrVirtObj::CreateObjectSpecificViewContact() {
[Libreoffice-commits] core.git: include/svx svx/source
include/svx/sdr/properties/defaultproperties.hxx|4 +-- svx/source/sdr/properties/attributeproperties.cxx | 20 +++ svx/source/sdr/properties/captionproperties.cxx |6 ++-- svx/source/sdr/properties/circleproperties.cxx |6 ++-- svx/source/sdr/properties/customshapeproperties.cxx |4 +-- svx/source/sdr/properties/defaultproperties.cxx | 26 ++-- svx/source/sdr/properties/e3dcompoundproperties.cxx |6 ++-- svx/source/sdr/properties/e3dsceneproperties.cxx| 20 +++ svx/source/sdr/properties/graphicproperties.cxx | 20 +++ svx/source/sdr/properties/measureproperties.cxx | 12 - svx/source/sdr/properties/textproperties.cxx| 18 ++--- svx/source/table/cell.cxx |2 - 12 files changed, 72 insertions(+), 72 deletions(-) New commits: commit 525a4732c74baf0c8638353d32bf4220bbb77623 Author: Noel Grandin AuthorDate: Tue Oct 31 12:36:17 2023 +0200 Commit: Noel Grandin CommitDate: Tue Oct 31 18:10:13 2023 +0100 rename mxItemSet->moItemSet in DefaultProperties because it reduces the noise in an upcoming patch Change-Id: I67d7b719609271f626e38596416eb511fbd40b07 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158714 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/include/svx/sdr/properties/defaultproperties.hxx b/include/svx/sdr/properties/defaultproperties.hxx index bec1fbe27320..410fa593ac92 100644 --- a/include/svx/sdr/properties/defaultproperties.hxx +++ b/include/svx/sdr/properties/defaultproperties.hxx @@ -38,7 +38,7 @@ namespace sdr::properties { protected: // the to be used ItemSet -mutable std::optional mxItemSet; +mutable std::optional moItemSet; // create a new object specific itemset with object specific ranges. virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& pPool) override; @@ -60,7 +60,7 @@ namespace sdr::properties virtual void ItemSetChanged(std::span< const SfxPoolItem* const > aChangedItems, sal_uInt16 nDeletedWhich); // check if SfxItemSet exists -bool HasSfxItemSet() const { return bool(mxItemSet); } +bool HasSfxItemSet() const { return bool(moItemSet); } public: // basic constructor diff --git a/svx/source/sdr/properties/attributeproperties.cxx b/svx/source/sdr/properties/attributeproperties.cxx index 37bdc9cfa05a..3fc050f825f9 100644 --- a/svx/source/sdr/properties/attributeproperties.cxx +++ b/svx/source/sdr/properties/attributeproperties.cxx @@ -55,7 +55,7 @@ namespace sdr::properties { if(SfxItemState::SET == aIter.GetItemState()) { -mxItemSet->ClearItem(nWhich); +moItemSet->ClearItem(nWhich); } nWhich = aIter.NextWhich(); @@ -63,7 +63,7 @@ namespace sdr::properties } // set new stylesheet as parent -mxItemSet->SetParent(&mpStyleSheet->GetItemSet()); +moItemSet->SetParent(&mpStyleSheet->GetItemSet()); } else { @@ -110,7 +110,7 @@ namespace sdr::properties // reset parent of ItemSet if(HasSfxItemSet()) { -mxItemSet->SetParent(nullptr); +moItemSet->SetParent(nullptr); } SdrObject& rObj = GetSdrObject(); @@ -272,7 +272,7 @@ namespace sdr::properties } } -return *mxItemSet; +return *moItemSet; } void AttributeProperties::ItemSetChanged(std::span< const SfxPoolItem* const > /*aChangedItems*/, sal_uInt16 /*nDeletedWhich*/) @@ -339,11 +339,11 @@ namespace sdr::properties if(pResultItem) { // force ItemSet -mxItemSet->Put(std::move(pResultItem)); +moItemSet->Put(std::move(pResultItem)); } else { -mxItemSet->Put(*pNewItem); +moItemSet->Put(*pNewItem); } } else @@ -351,7 +351,7 @@ namespace sdr::properties // clear item if ItemSet exists if(HasSfxItemSet()) { -mxItemSet->ClearItem(nWhich); +moItemSet->ClearItem(nWhich); } } } @@ -384,7 +384,7 @@ namespace sdr::properties GetObjectItemSet(); // prepare copied, new itemset, but WITHOUT parent -SfxItemSet aDestItemSet(*mxItemSet); +SfxItemSet aDestItemSet(*moItemSet);
[Libreoffice-commits] core.git: configmgr/source
configmgr/source/access.cxx | 81 configmgr/source/access.hxx |3 + 2 files changed, 55 insertions(+), 29 deletions(-) New commits: commit 300763ddf666b8f2e428231ffa892ecd4efb2eae Author: Noel Grandin AuthorDate: Tue Oct 31 15:54:18 2023 +0200 Commit: Noel Grandin CommitDate: Tue Oct 31 18:10:30 2023 +0100 reduce reference counting traffic in configmgr no need to construct a vector when iterating over children Change-Id: I717e92be3c576a6e5d877f4333264a5bed9daadf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158728 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx index 46657374030a..4bb66cb5f025 100644 --- a/configmgr/source/access.cxx +++ b/configmgr/source/access.cxx @@ -354,7 +354,7 @@ sal_Bool Access::hasElements() { assert(thisIs(IS_ANY)); osl::MutexGuard g(*lock_); checkLocalizedPropertyAccess(); -return !getAllChildren().empty(); //TODO: optimize +return !isAllChildrenEmpty(); } bool Access::getByNameFast(const OUString & name, css::uno::Any & value) @@ -410,14 +410,13 @@ css::uno::Sequence< OUString > Access::getElementNames() assert(thisIs(IS_ANY)); osl::MutexGuard g(*lock_); checkLocalizedPropertyAccess(); -std::vector< rtl::Reference< ChildAccess > > children(getAllChildren()); -css::uno::Sequence names(children.size()); -OUString* pArray = names.getArray(); -for (auto const& child : children) +std::vector childNames; +forAllChildren([&childNames] (ChildAccess& rChild) { -*pArray++ = child->getNameInternal(); -} -return names; +childNames.push_back(rChild.getNameInternal()); +return true; +}); +return comphelper::containerToSequence(childNames); } sal_Bool Access::hasByName(OUString const & aName) @@ -537,13 +536,12 @@ css::uno::Sequence< css::beans::Property > Access::getProperties() { assert(thisIs(IS_GROUP)); osl::MutexGuard g(*lock_); -std::vector< rtl::Reference< ChildAccess > > children(getAllChildren()); std::vector< css::beans::Property > properties; -properties.reserve(children.size()); -for (auto const& child : children) +forAllChildren([&properties] (ChildAccess& rChild) { -properties.push_back(child->asProperty()); -} +properties.push_back(rChild.asProperty()); +return true; +}); return comphelper::containerToSequence(properties); } @@ -1423,19 +1421,22 @@ rtl::Reference< ChildAccess > Access::getChild(OUString const & name) { locale = locale.copy(0, i); } assert(!locale.isEmpty()); -std::vector< rtl::Reference< ChildAccess > > children( -getAllChildren()); -for (auto const& child : children) +rtl::Reference< ChildAccess > foundChild; +forAllChildren([&foundChild, &locale] (ChildAccess& rChild) { -const OUString & name2(child->getNameInternal()); +const OUString & name2(rChild.getNameInternal()); if (name2.startsWith(locale) && (name2.getLength() == locale.getLength() || name2[locale.getLength()] == '-' || name2[locale.getLength()] == '_')) { -return child; +foundChild = &rChild; +return false; } -} +return true; +}); +if (foundChild) +return foundChild; } // Defaults are the "en-US" locale, the "en" locale, the empty string locale, the first child (if // any, and if the property is non-nillable), or a null ChildAccess, in that order: @@ -1452,9 +1453,15 @@ rtl::Reference< ChildAccess > Access::getChild(OUString const & name) { return child; } if (!static_cast(getNode().get())->isNillable()) { -std::vector< rtl::Reference< ChildAccess > > children(getAllChildren()); -if (!children.empty()) { -return children.front(); +// look for first child in list +rtl::Reference< ChildAccess > foundChild; +forAllChildren([&foundChild] (ChildAccess& rChild) +{ +foundChild = &rChild; +return false; +}); +if (foundChild) { +return foundChild; } } return rtl::Reference< ChildAccess >(); @@ -1464,14 +1471,14 @@ rtl::Reference< ChildAccess > Access::getChild(OUString const & name) { ? getUnmodifiedChild(name) : getModifiedChild(i); } -std::vector< rtl::Reference< ChildAccess > > Access::getAllChildren() { -std::vector< rtl::Reference< ChildAccess > > vec; +void Access::forAllChildren(const
[Libreoffice-commits] core.git: configmgr/source
configmgr/source/access.cxx | 14 +++--- configmgr/source/access.hxx |2 +- configmgr/source/childaccess.cxx |2 +- configmgr/source/childaccess.hxx |2 +- configmgr/source/rootaccess.cxx |2 +- configmgr/source/rootaccess.hxx |2 +- 6 files changed, 12 insertions(+), 12 deletions(-) New commits: commit 0e08992f99bfd4aaa57a6b30b9e8a32ee5dc4a98 Author: Noel Grandin AuthorDate: Tue Oct 31 15:55:44 2023 +0200 Commit: Noel Grandin CommitDate: Tue Oct 31 18:11:02 2023 +0100 reduce ref-counting traffic in configmgr we can return by const& from getNode Change-Id: If93c43fd2e910e2fb69d9bd0a9e3dc587133dfa8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158729 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx index 4bb66cb5f025..668192fee63c 100644 --- a/configmgr/source/access.cxx +++ b/configmgr/source/access.cxx @@ -132,7 +132,7 @@ void Access::releaseNondeleting() { } bool Access::isValue() { -rtl::Reference< Node > p(getNode()); +const rtl::Reference< Node > & p(getNode()); switch (p->kind()) { case Node::KIND_PROPERTY: case Node::KIND_LOCALIZED_VALUE: @@ -331,7 +331,7 @@ css::uno::Type Access::getElementType() { assert(thisIs(IS_ANY)); osl::MutexGuard g(*lock_); checkLocalizedPropertyAccess(); -rtl::Reference< Node > p(getNode()); +const rtl::Reference< Node > & p(getNode()); switch (p->kind()) { case Node::KIND_LOCALIZED_PROPERTY: return mapType( @@ -625,7 +625,7 @@ void Access::setName(OUString const & aName) { rtl::Reference< Access > parent(getParentAccess()); if (parent.is()) { -rtl::Reference< Node > node(getNode()); +const rtl::Reference< Node > & node(getNode()); if (! node->getTemplateName().isEmpty()) { rtl::Reference< ChildAccess > other( parent->getChild(aName)); @@ -1164,7 +1164,7 @@ void Access::removeByName(OUString const & aName) aName, getXWeak()); } if (getNode()->kind() == Node::KIND_GROUP) { -rtl::Reference< Node > p(child->getNode()); +const rtl::Reference< Node >& p(child->getNode()); if (p->kind() != Node::KIND_PROPERTY || !static_cast< PropertyNode * >(p.get())->isExtension()) { @@ -2048,7 +2048,7 @@ rtl::Reference< ChildAccess > Access::getSubChild(OUString const & path) { return rtl::Reference< ChildAccess >(); } if (setElement) { -rtl::Reference< Node > p(parent->getNode()); +const rtl::Reference< Node >& p(parent->getNode()); switch (p->kind()) { case Node::KIND_LOCALIZED_PROPERTY: if (!Components::allLocales(getRootAccess()->getLocale()) || @@ -2100,7 +2100,7 @@ css::beans::Property Access::asProperty() { css::uno::Type type; bool nillable; bool removable; -rtl::Reference< Node > p(getNode()); +const rtl::Reference< Node >& p(getNode()); switch (p->kind()) { case Node::KIND_PROPERTY: { @@ -2225,7 +2225,7 @@ rtl::Reference< Access > Access::getNotificationRoot() { #if !defined NDEBUG bool Access::thisIs(int what) { osl::MutexGuard g(*lock_); -rtl::Reference< Node > p(getNode()); +const rtl::Reference< Node >& p(getNode()); Node::Kind k(p->kind()); return (k != Node::KIND_PROPERTY && k != Node::KIND_LOCALIZED_VALUE && ((what & IS_GROUP) == 0 || k == Node::KIND_GROUP) && diff --git a/configmgr/source/access.hxx b/configmgr/source/access.hxx index 7b59e81cfdc8..daa5f1d1f6be 100644 --- a/configmgr/source/access.hxx +++ b/configmgr/source/access.hxx @@ -111,7 +111,7 @@ public: virtual std::vector getRelativePath() = 0; virtual OUString getRelativePathRepresentation() = 0; -virtual rtl::Reference< Node > getNode() = 0; +virtual const rtl::Reference< Node > & getNode() = 0; virtual bool isFinalized() = 0; diff --git a/configmgr/source/childaccess.cxx b/configmgr/source/childaccess.cxx index 8a8d581dd8d6..e0a9f9ac6cee 100644 --- a/configmgr/source/childaccess.cxx +++ b/configmgr/source/childaccess.cxx @@ -107,7 +107,7 @@ OUString ChildAccess::getRelativePathRepresentation() { return path.makeStringAndClear(); } -rtl::Reference< Node > ChildAccess::getNode() { +const rtl::Reference< Node > & ChildAccess::getNode() { return node_; } diff --git a/configmgr/source/childaccess.hxx b/configmgr/source/childaccess.hxx index 6f060c2de827..f3948a08ab50 100644 --- a/configmgr/source/childaccess.hxx +++ b/configmgr/source/childaccess.hxx @@ -64,7 +64,7 @@ public: virtual std::vector getRelativePath() override; virtual OUString getRelativePathRepresentation() override; -virtual rtl::Re
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - sc/inc sc/source
sc/inc/column.hxx |2 +- sc/source/core/data/column.cxx | 28 ++-- sc/source/core/data/table2.cxx |2 +- 3 files changed, 24 insertions(+), 8 deletions(-) New commits: commit 981061e0870ac7d963d496a51238fe1f4d5d2b7c Author: Caolán McNamara AuthorDate: Tue Oct 31 11:33:56 2023 + Commit: Michael Meeks CommitDate: Tue Oct 31 19:08:23 2023 +0100 tell client when the cell for the comment changed when a row/column is inserted/deleted, etc the cell the comments are associated with changes, so broadcast that change to the clients. https://github.com/CollaboraOnline/online/issues/7334 Change-Id: I8a3e5fc151b6ba99e68b32c3fe8804de9ba2baf4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158718 Tested-by: Jenkins CollaboraOffice Reviewed-by: Michael Meeks diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 87d3dc730a9f..cbdf82edecbc 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -712,7 +712,7 @@ public: void DuplicateNotes(SCROW nStartRow, size_t nDataSize, ScColumn& rDestCol, sc::ColumnBlockPosition& rDestBlockPos, bool bCloneCaption, SCROW nRowOffsetDest = 0) const; -void UpdateNoteCaptions( SCROW nRow1, SCROW nRow2 ); +void UpdateNoteCaptions( SCROW nRow1, SCROW nRow2, bool bAddressChanged = true ); void UpdateDrawObjects( std::vector>& pObjects, SCROW nRowStart, SCROW nRowEnd ); void UpdateDrawObjectsForRow( std::vector& pObjects, SCCOL nTargetCol, SCROW nTargetRow ); diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index d2506074070b..45a307931347 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -1810,22 +1811,37 @@ void resetColumnPosition(sc::CellStoreType& rCells, SCCOL nCol) class NoteCaptionUpdater { -SCCOL mnCol; -SCTAB mnTab; +const ScDocument* m_pDocument; +const ScAddress m_aAddress; // 'incomplete' address consisting of tab, column +bool m_bAddressChanged; // false if the cell anchor address is unchanged public: -NoteCaptionUpdater( SCCOL nCol, SCTAB nTab ) : mnCol(nCol), mnTab(nTab) {} +NoteCaptionUpdater(const ScDocument* pDocument, const ScAddress& rPos, bool bAddressChanged) +: m_pDocument(pDocument) +, m_aAddress(rPos) +, m_bAddressChanged(bAddressChanged) +{ +} void operator() ( size_t nRow, ScPostIt* p ) { -p->UpdateCaptionPos(ScAddress(mnCol,nRow,mnTab)); +// Create a 'complete' address object +ScAddress aAddr(m_aAddress); +aAddr.SetRow(nRow); + +p->UpdateCaptionPos(aAddr); + +// Notify our LOK clients +if (m_bAddressChanged) +ScDocShell::LOKCommentNotify(LOKCommentNotificationType::Modify, m_pDocument, aAddr, p); } }; } -void ScColumn::UpdateNoteCaptions( SCROW nRow1, SCROW nRow2 ) +void ScColumn::UpdateNoteCaptions( SCROW nRow1, SCROW nRow2, bool bAddressChanged ) { -NoteCaptionUpdater aFunc(nCol, nTab); +ScAddress aAddr(nCol, 0, nTab); +NoteCaptionUpdater aFunc(&GetDoc(), aAddr, bAddressChanged); sc::ProcessNote(maCellNotes.begin(), maCellNotes, nRow1, nRow2, aFunc); } diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index 53ba083929c4..21c33b222825 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -1496,7 +1496,7 @@ void ScTable::CopyCaptionsToTable( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW for (SCCOL i = nCol1; i <= nCol2; i++) { aCol[i].CopyCellNotesToDocument(nRow1, nRow2, pDestTab->CreateColumnIfNotExists(i), bCloneCaption); -pDestTab->aCol[i].UpdateNoteCaptions(nRow1, nRow2); +pDestTab->aCol[i].UpdateNoteCaptions(nRow1, nRow2, false /* address unchanged from initial create */); } }
[Libreoffice-commits] core.git: 2 commits - svx/source
svx/source/sdr/properties/captionproperties.cxx |3 --- svx/source/sdr/properties/circleproperties.cxx |3 --- svx/source/sdr/properties/graphicproperties.cxx |3 --- svx/source/sdr/properties/measureproperties.cxx |3 --- svx/source/sdr/properties/textproperties.cxx|3 --- svx/source/table/cell.cxx |1 + 6 files changed, 1 insertion(+), 15 deletions(-) New commits: commit 4b1acf7d1a0a2515a5f781b702c22c6233caecc8 Author: Noel Grandin AuthorDate: Tue Oct 31 15:28:30 2023 +0200 Commit: Noel Grandin CommitDate: Tue Oct 31 20:20:52 2023 +0100 no need to call GetObjectItemSet inside ForceDefaultAttributes ForceDefaultAttributes is only called after an itemset has been created Change-Id: I0ef8df039ed7a238b673c3770ee884a58dd62772 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158735 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/sdr/properties/captionproperties.cxx b/svx/source/sdr/properties/captionproperties.cxx index 31bb62268521..3de1da6d65b9 100644 --- a/svx/source/sdr/properties/captionproperties.cxx +++ b/svx/source/sdr/properties/captionproperties.cxx @@ -89,9 +89,6 @@ namespace sdr::properties // call parent RectangleProperties::ForceDefaultAttributes(); -// force ItemSet -GetObjectItemSet(); - // this was set by TextProperties::ForceDefaultAttributes(), // reset to default if (static_cast(GetSdrObject()).GetSpecialTextBoxShadow()) diff --git a/svx/source/sdr/properties/circleproperties.cxx b/svx/source/sdr/properties/circleproperties.cxx index 6f589f67548f..643c297eb043 100644 --- a/svx/source/sdr/properties/circleproperties.cxx +++ b/svx/source/sdr/properties/circleproperties.cxx @@ -98,9 +98,6 @@ namespace sdr::properties if(eKind != SdrCircKind::Full) { -// force ItemSet -GetObjectItemSet(); - moItemSet->Put(SdrCircKindItem(eKind)); if(rObj.GetStartAngle()) diff --git a/svx/source/sdr/properties/graphicproperties.cxx b/svx/source/sdr/properties/graphicproperties.cxx index 3346c5d80048..a43ee5bd9fbb 100644 --- a/svx/source/sdr/properties/graphicproperties.cxx +++ b/svx/source/sdr/properties/graphicproperties.cxx @@ -132,9 +132,6 @@ namespace sdr::properties // call parent RectangleProperties::ForceDefaultAttributes(); -// force ItemSet -GetObjectItemSet(); - moItemSet->Put( SdrGrafLuminanceItem( 0 ) ); moItemSet->Put( SdrGrafContrastItem( 0 ) ); moItemSet->Put( SdrGrafRedItem( 0 ) ); diff --git a/svx/source/sdr/properties/measureproperties.cxx b/svx/source/sdr/properties/measureproperties.cxx index 44cdae798899..a6f4b7fd7c81 100644 --- a/svx/source/sdr/properties/measureproperties.cxx +++ b/svx/source/sdr/properties/measureproperties.cxx @@ -105,9 +105,6 @@ namespace sdr::properties // call parent TextProperties::ForceDefaultAttributes(); -// force ItemSet -GetObjectItemSet(); - //#71958# by default, the show units Bool-Item is set as hard // attribute to sal_True to avoid confusion when copying SdrMeasureObj's // from one application to another diff --git a/svx/source/sdr/properties/textproperties.cxx b/svx/source/sdr/properties/textproperties.cxx index b2bb7b746ab9..55b366bdc03b 100644 --- a/svx/source/sdr/properties/textproperties.cxx +++ b/svx/source/sdr/properties/textproperties.cxx @@ -374,9 +374,6 @@ namespace sdr::properties bool bTextFrame(rObj.IsTextFrame()); -// force ItemSet -GetObjectItemSet(); - if(bTextFrame) { moItemSet->Put(XLineStyleItem(drawing::LineStyle_NONE)); commit ba85e9f54809dd2c7eb817ead90f9fac0add6e06 Author: Noel Grandin AuthorDate: Tue Oct 31 15:08:44 2023 +0200 Commit: Noel Grandin CommitDate: Tue Oct 31 20:20:43 2023 +0100 add comment to CellProperties::ForceDefaultAttributes Change-Id: Iea65e06b886d47ea18fa1dc81a6df0cd8b995776 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158734 Tested-by: Jenkins Reviewed-by: Noel Grandin diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx index 98e46842e414..c617129f3fd2 100644 --- a/svx/source/table/cell.cxx +++ b/svx/source/table/cell.cxx @@ -181,6 +181,7 @@ SdrText* CellTextProvider::getText(sal_Int32 nIndex) const void CellProperties::ForceDefaultAttributes() { +// deliberately do not run superclass ForceDefaultAttributes, we don't want any default attributes } void CellProperties::ItemSetChanged(std::span< const SfxPoolItem* const > aChangedItems, sal_uInt16 nDeletedWhich)
[Libreoffice-commits] core.git: sdext/source
sdext/source/pdfimport/pdfparse/pdfparse.cxx | 76 --- 1 file changed, 76 deletions(-) New commits: commit 046e9545956d8ad1d69345d6b4a4c0a33714d179 Author: Mike Kaganski AuthorDate: Tue Oct 31 20:09:35 2023 +0300 Commit: Mike Kaganski CommitDate: Tue Oct 31 21:01:10 2023 +0100 Try to revert to use of file_iterator from boost on Windows It was disabled in commit ef8d59c5b909d5a9b956934ab1120f90b90a4e10 (vcl108: #i106853# work around broken file_iterator on Windows, 2009-12-01), referencing boost 1.39. It seems to work fine now, so let's revert it, and hope it doesn't break something. Change-Id: I208aa87eca146a29ffc2f36a48810ecda5df0f00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158736 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sdext/source/pdfimport/pdfparse/pdfparse.cxx b/sdext/source/pdfimport/pdfparse/pdfparse.cxx index 7cef299e8eaa..baa322c1aa3c 100644 --- a/sdext/source/pdfimport/pdfparse/pdfparse.cxx +++ b/sdext/source/pdfimport/pdfparse/pdfparse.cxx @@ -558,83 +558,8 @@ public: } -#ifdef _WIN32 -std::unique_ptr PDFReader::read( const char* pBuffer, unsigned int nLen ) -{ -PDFGrammar aGrammar( pBuffer ); - -try -{ -#if OSL_DEBUG_LEVEL > 0 -boost::spirit::classic::parse_info aInfo = -#endif -boost::spirit::classic::parse( pBuffer, - pBuffer+nLen, - aGrammar, - boost::spirit::classic::space_p ); -#if OSL_DEBUG_LEVEL > 0 -SAL_INFO("sdext.pdfimport.pdfparse", "parseinfo: stop = " << aInfo.stop << " (buff=" << pBuffer << ", offset = " << aInfo.stop - pBuffer << "), hit = " << (aInfo.hit ? OUString("true") : OUString("false")) << ", full = " << (aInfo.full ? OUString("true") : OUString("false")) << ", length = " << static_cast(aInfo.length) ); -#endif -} -catch( const parser_error& rError ) -{ -#if OSL_DEBUG_LEVEL > 0 -OString aTmp; -unsigned int nElem = aGrammar.m_aObjectStack.size(); -for( unsigned int i = 0; i < nElem; i++ ) -aTmp += OString::Concat(" ") + typeid( *(aGrammar.m_aObjectStack[i]) ).name(); - -SAL_WARN("sdext.pdfimport.pdfparse", "parse error: " << rError.descriptor << " at buffer pos " << rError.where - pBuffer << ", object stack: " << aTmp); -#else -(void)rError; -#endif -} - -std::unique_ptr pRet; -unsigned int nEntries = aGrammar.m_aObjectStack.size(); -if( nEntries == 1 ) -{ -pRet.reset(aGrammar.m_aObjectStack.back()); -aGrammar.m_aObjectStack.pop_back(); -} -#if OSL_DEBUG_LEVEL > 0 -else if( nEntries > 1 ) -SAL_WARN("sdext.pdfimport.pdfparse", "error got " << nEntries << " stack objects in parse" ); -#endif - -return pRet; -} -#endif - std::unique_ptr PDFReader::read( const char* pFileName ) { -#ifdef _WIN32 -/* #i106583# - since converting to boost 1.39 file_iterator does not work anymore on all Windows systems - C++ stdlib istream_iterator does not allow "-" apparently - using spirit 2.0 doesn't work in our environment with the MSC - - So for the time being bite the bullet and read the whole file. - FIXME: give Spirit 2.x another try when we upgrade boost again. -*/ -std::unique_ptr pRet; -FILE* fp = fopen( pFileName, "rb" ); -if( fp ) -{ -fseek( fp, 0, SEEK_END ); -unsigned int nLen = static_cast(ftell( fp )); -fseek( fp, 0, SEEK_SET ); -char* pBuf = static_cast(std::malloc( nLen )); -if( pBuf ) -{ -fread( pBuf, 1, nLen, fp ); -pRet = read( pBuf, nLen ); -std::free( pBuf ); -} -fclose( fp ); -} -return pRet; -#else file_iterator<> file_start( pFileName ); if( ! file_start ) return nullptr; @@ -692,7 +617,6 @@ std::unique_ptr PDFReader::read( const char* pFileName ) } #endif return pRet; -#endif // WIN32 } #if defined(_MSC_VER)
[Libreoffice-commits] core.git: include/oox oox/source
include/oox/ppt/presentationfragmenthandler.hxx |8 ++-- oox/source/ppt/presentationfragmenthandler.cxx | 42 2 files changed, 26 insertions(+), 24 deletions(-) New commits: commit f2ae8b934aaac7c444e8493ed5e8189c6ce63328 Author: Henry Castro AuthorDate: Mon Oct 9 07:34:02 2023 -0400 Commit: Henry Castro CommitDate: Tue Oct 31 21:09:19 2023 +0100 tdf#155512: oox: ppt: fix import master slides, follow up Import all master slides. Signed-off-by: Henry Castro Change-Id: Ieac68bacf15c75e4c23ec692aadcb16033cdd092 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157701 Tested-by: Jenkins CollaboraOffice Reviewed-by: Caolán McNamara Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158716 Tested-by: Jenkins diff --git a/include/oox/ppt/presentationfragmenthandler.hxx b/include/oox/ppt/presentationfragmenthandler.hxx index 29204b282bdb..20fc521ae8c5 100644 --- a/include/oox/ppt/presentationfragmenthandler.hxx +++ b/include/oox/ppt/presentationfragmenthandler.hxx @@ -52,10 +52,10 @@ private: void importSlide( const ::oox::core::FragmentHandlerRef& rSlideFragmentHandler, const oox::ppt::SlidePersistPtr& rPersist ); void importSlide(sal_uInt32 nSlide, bool bFirstSlide, bool bImportNotes); -oox::ppt::SlidePersistPtr importMasterSlide(const ::com::sun::star::uno::Reference<::com::sun::star::frame::XModel>& xModel, -::oox::ppt::PowerPointImport& rFilter, -std::u16string_view rLayoutFragmentPath, -std::u16string_view rMasterFragmentPath); +void importMasterSlides(); +void importMasterSlide(const ::com::sun::star::uno::Reference<::com::sun::star::frame::XModel>& xModel, + ::oox::ppt::PowerPointImport& rFilter, + const OUString& rMasterFragmentPath); void saveThemeToGrabBag(const oox::drawingml::ThemePtr& pThemePtr, sal_Int32 nThemeIdx); void importCustomSlideShow(std::vector& rCustomShowList); static void importSlideNames(::oox::core::XmlFilterBase& rFilter, const std::vector& rSlidePersist); diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx index edb523161c9e..2e0f48bbae98 100644 --- a/oox/source/ppt/presentationfragmenthandler.cxx +++ b/oox/source/ppt/presentationfragmenthandler.cxx @@ -215,18 +215,16 @@ void PresentationFragmentHandler::importCustomSlideShow(std::vector& } } -SlidePersistPtr PresentationFragmentHandler::importMasterSlide(const Reference& xModel, - PowerPointImport& rFilter, - std::u16string_view rLayoutFragmentPath, - std::u16string_view rMasterFragmentPath) +void PresentationFragmentHandler::importMasterSlide(const Reference& xModel, +PowerPointImport& rFilter, +const OUString& rMasterFragmentPath) { OUString aLayoutFragmentPath; -OUString aMasterFragmentPath(rMasterFragmentPath); -SlidePersistPtr pMasterPersistPtr, pMasterPtr; +SlidePersistPtr pMasterPersistPtr; Reference< drawing::XDrawPage > xMasterPage; Reference< drawing::XMasterPagesSupplier > xMPS( xModel, uno::UNO_QUERY_THROW ); Reference< drawing::XDrawPages > xMasterPages( xMPS->getMasterPages(), uno::UNO_SET_THROW ); -RelationsRef xMasterRelations = rFilter.importRelations( aMasterFragmentPath ); +RelationsRef xMasterRelations = rFilter.importRelations( rMasterFragmentPath ); for (const auto& rEntry : *xMasterRelations) { @@ -252,7 +250,7 @@ SlidePersistPtr PresentationFragmentHandler::importMasterSlide(const ReferencesetLayoutPath( aLayoutFragmentPath ); rFilter.getMasterPages().push_back( pMasterPersistPtr ); rFilter.setActualSlidePersist( pMasterPersistPtr ); -FragmentHandlerRef xMasterFragmentHandler( new SlideFragmentHandler( rFilter, aMasterFragmentPath, pMasterPersistPtr, Master ) ); +FragmentHandlerRef xMasterFragmentHandler( new SlideFragmentHandler( rFilter, rMasterFragmentPath, pMasterPersistPtr, Master ) ); // set the correct theme OUString aThemeFragmentPath = xMasterFragmentHandler->getFragmentPathFromFirstTypeFromOfficeDoc( u"theme" ); @@ -297,14 +295,7 @@ SlidePersistPtr PresentationFragmentHandler::importMasterSlide(const ReferenceaddTheme(pMasterPersistPtr->getPage()); } - -if (pMasterPersistPtr->getLayoutPath() == rLayoutFragmentPath) -{ -pMasterPtr = pMasterPersistPtr; -} } - -return pMasterPtr; } void PresentationFragmentHandler:
[Libreoffice-commits] core.git: sdext/source
sdext/source/pdfimport/pdfparse/pdfparse.cxx | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) New commits: commit ba26d5f5e0529d7accf6f268559b8d659ba7c6c2 Author: Mike Kaganski AuthorDate: Tue Oct 31 20:43:52 2023 +0300 Commit: Mike Kaganski CommitDate: Tue Oct 31 21:11:34 2023 +0100 tdf#106057: Don't fail PDFReader::read, when several entries in stack It may happen in case of several trailers, which is OK. The calling code will check the type of the returned object anyway. Change-Id: I17b2f4b7cf0e0640f949565291ee5a905ef2411e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158737 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sdext/source/pdfimport/pdfparse/pdfparse.cxx b/sdext/source/pdfimport/pdfparse/pdfparse.cxx index baa322c1aa3c..cdd3ac13ff35 100644 --- a/sdext/source/pdfimport/pdfparse/pdfparse.cxx +++ b/sdext/source/pdfimport/pdfparse/pdfparse.cxx @@ -601,21 +601,26 @@ std::unique_ptr PDFReader::read( const char* pFileName ) pRet.reset(aGrammar.m_aObjectStack.back()); aGrammar.m_aObjectStack.pop_back(); } -#if OSL_DEBUG_LEVEL > 0 else if( nEntries > 1 ) { +// It is possible that there are multiple trailers, which is OK. +// But still keep the warnings, just in case. SAL_WARN("sdext.pdfimport.pdfparse", "error got " << nEntries << " stack objects in parse"); -for( unsigned int i = 0; i < nEntries; i++ ) +for (;;) { -SAL_WARN("sdext.pdfimport.pdfparse", typeid(*aGrammar.m_aObjectStack[i]).name()); -PDFObject* pObj = dynamic_cast(aGrammar.m_aObjectStack[i]); +PDFEntry* pEntry = aGrammar.m_aObjectStack.back(); +aGrammar.m_aObjectStack.pop_back(); +SAL_WARN("sdext.pdfimport.pdfparse", typeid(*pEntry).name()); +PDFObject* pObj = dynamic_cast(pEntry); if( pObj ) SAL_WARN("sdext.pdfimport.pdfparse", " -> object " << pObj->m_nNumber << " generation " << pObj->m_nGeneration); -else -SAL_WARN("sdext.pdfimport.pdfparse", "(type " << typeid(*aGrammar.m_aObjectStack[i]).name() << ")"); +if (aGrammar.m_aObjectStack.empty()) +{ +pRet.reset(pEntry); // The first entry references all others - see PDFGrammar dtor +break; +} } } -#endif return pRet; }
[Libreoffice-commits] core.git: emfio/source
emfio/source/reader/wmfreader.cxx |5 - 1 file changed, 5 deletions(-) New commits: commit c2d4f8900150ae109700b873d781461ef96ab091 Author: Caolán McNamara AuthorDate: Tue Oct 31 16:19:13 2023 + Commit: Caolán McNamara CommitDate: Tue Oct 31 21:20:38 2023 +0100 cid#1548365 Logically dead code since: commit c75cac85230d3899fe9f5f5086c117e4e1e5d330 Date: Sat Jun 17 02:57:42 2023 +0200 tdf#155887 WMF Fix displaying images with size of EOF other that 3 Change-Id: I326593cc556319d947bd9f3aef32b4ff6264c68f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158731 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/emfio/source/reader/wmfreader.cxx b/emfio/source/reader/wmfreader.cxx index b419fb3e5745..1b5739b3b190 100644 --- a/emfio/source/reader/wmfreader.cxx +++ b/emfio/source/reader/wmfreader.cxx @@ -1731,11 +1731,6 @@ namespace emfio switch( nFunction ) { -case W_META_EOF: -{ -return; -} - case W_META_SETWINDOWORG: { aWinOrg = ReadYX();
[Libreoffice-commits] core.git: officecfg/registry
officecfg/registry/data/org/openoffice/Office/Accelerators.xcu | 31 +- 1 file changed, 29 insertions(+), 2 deletions(-) New commits: commit 2d37ac2ca3a93cd7f05867ba7256c9e232192983 Author: Gökay Şatır AuthorDate: Wed May 24 14:39:12 2023 +0300 Commit: Caolán McNamara CommitDate: Tue Oct 31 21:21:16 2023 +0100 Added & modified some shortcuts for general compatibility. Signed-off-by: Gökay Şatır Change-Id: Ibfcfbc3a75aca392acc4626e6169f2f3abcc4970 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152196 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158673 Tested-by: Jenkins Reviewed-by: Caolán McNamara diff --git a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu index 5152341a0800..d510adf0bc2a 100644 --- a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu @@ -711,14 +711,20 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing I10N SHORTCUTS - NO TRANSLATE .uno:Shrink -.uno:Shrink +.uno:HideColumn I10N SHORTCUTS - NO TRANSLATE .uno:Grow -.uno:Grow +.uno:HideRow + + + + +I10 SHORTCUTS - No TRANSLATE +.uno:Zoom100Percent @@ -887,6 +893,24 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing .uno:Ungroup + + +I10N SHORTCUTS - NO TRANSLATE +.uno:Ungroup + + + + +I10N SHORTCUTS - NO TRANSLATE +.uno:Group + + + + +I10N SHORTCUTS - NO TRANSLATE +.uno:InsertAnnotation + + I10N SHORTCUTS - NO TRANSLATE @@ -951,6 +975,7 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing I10N SHORTCUTS - NO TRANSLATE .uno:InsertCurrentTime +.uno:Shrink @@ -1015,6 +1040,7 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing .uno:RepeatSearch .uno:Save .uno:Bold +.uno:FocusCellAddress @@ -1453,6 +1479,7 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing I10N SHORTCUTS - NO TRANSLATE .uno:MarkPrecedents +.uno:Zoom100Percent
[Libreoffice-commits] core.git: officecfg/registry
officecfg/registry/data/org/openoffice/Office/Accelerators.xcu |7 +++ 1 file changed, 7 insertions(+) New commits: commit f5ae03b235766070b1c1e5bf46d0cb86a8196b10 Author: Gökay Şatır AuthorDate: Thu May 25 10:32:55 2023 +0300 Commit: Caolán McNamara CommitDate: Tue Oct 31 21:22:09 2023 +0100 Writer German shortcuts compatibility improvements. Signed-off-by: Gökay Şatır Change-Id: Icfcdf3f629442da339c846f9eaa577ff7b779290 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152261 Tested-by: Jenkins CollaboraOffice Reviewed-by: Andras Timar (cherry picked from commit 7b168fbe4e4a5feecdd946fef9c5c3e5107dc050) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158722 Tested-by: Jenkins Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara diff --git a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu index d510adf0bc2a..0f8c292fb2ac 100644 --- a/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Accelerators.xcu @@ -6167,6 +6167,13 @@ Ctrl+Shift+e aka E_SHIFT_MOD1 under GTK/IBUS is for some emoji thing I10N SHORTCUTS - NO TRANSLATE .uno:InsertZWSP +.uno:DefaultNumbering + + + + +I10N SHORTCUTS - NO TRANSLATE +.uno:DefaultBullet
[Libreoffice-commits] core.git: sw/qa sw/source
sw/qa/extras/uiwriter/uiwriter6.cxx | 43 ++ sw/source/core/doc/DocumentContentOperationsManager.cxx | 68 2 files changed, 96 insertions(+), 15 deletions(-) New commits: commit 4cf8de89bad9143a5b2dd3d6351080bf62b76029 Author: László Németh AuthorDate: Tue Oct 31 15:51:09 2023 +0100 Commit: László Németh CommitDate: Tue Oct 31 23:07:01 2023 +0100 tdf#157667 sw track changes: fix cycle case on multiple words Fix tracked cycle case on multiple selected words. Follow up to commit dc748d7dbd114fbf663752258dbaf003af2926c3 "tdf#141198 sw: fix cycle case with change tracking" and commit 79435eb55ef226fb0e3507aabdc2f8af062680f6 "tdf#157988 sw track changes: fix cycle case on a selected word". Change-Id: I81566f8be0cf6f4af6ed4af031116bd19e3884d7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158732 Tested-by: Jenkins Reviewed-by: László Németh diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx b/sw/qa/extras/uiwriter/uiwriter6.cxx index 83bc43f6d866..8e6b91043b0b 100644 --- a/sw/qa/extras/uiwriter/uiwriter6.cxx +++ b/sw/qa/extras/uiwriter/uiwriter6.cxx @@ -759,6 +759,49 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf157988) CPPUNIT_ASSERT(getParagraph(1)->getString().startsWith("Integer sodales tincidunt")); } +CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf157667) +{ +createSwDoc("tdf130088.docx"); +SwDoc* pDoc = getSwDoc(); +SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell(); + +// select the first three words +pWrtShell->Right(SwCursorSkipMode::Chars, /*bSelect=*/true, 25, /*bBasicCall=*/false); + +// enable redlining +dispatchCommand(mxComponent, ".uno:TrackChanges", {}); +CPPUNIT_ASSERT_MESSAGE("redlining should be on", + pDoc->getIDocumentRedlineAccess().IsRedlineOn()); + +// show changes +CPPUNIT_ASSERT_MESSAGE( +"redlines should be visible", + IDocumentRedlineAccess::IsShowChanges(pDoc->getIDocumentRedlineAccess().GetRedlineFlags())); + +// cycle case with change tracking + +dispatchCommand(mxComponent, ".uno:ChangeCaseRotateCase", {}); + +CPPUNIT_ASSERT(getParagraph(1)->getString().startsWith( +"Integer sodalesSodales tinciduntTincidunt tristique.")); + +dispatchCommand(mxComponent, ".uno:ChangeCaseRotateCase", {}); + +// This was false (missing revert of the tracked change) +CPPUNIT_ASSERT(getParagraph(1)->getString().startsWith("Integer sodales tincidunt tristique.")); + +dispatchCommand(mxComponent, ".uno:ChangeCaseRotateCase", {}); + +CPPUNIT_ASSERT(getParagraph(1)->getString().startsWith( +"Integer sodalesINTEGER SODALES tincidunt tristique.")); + +dispatchCommand(mxComponent, ".uno:ChangeCaseRotateCase", {}); +dispatchCommand(mxComponent, ".uno:ChangeCaseRotateCase", {}); +dispatchCommand(mxComponent, ".uno:ChangeCaseRotateCase", {}); + +CPPUNIT_ASSERT(getParagraph(1)->getString().startsWith("Integer sodales tincidunt tristique.")); +} + CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf108048) { createSwDoc(); diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 54b29b9b766c..d51565c5eaee 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -2984,7 +2984,8 @@ void DocumentContentOperationsManager::TransliterateText( sal_Int32 nEndCnt = pEnd->GetContentIndex(); SwTextNode* pTNd = pStt->GetNode().GetTextNode(); -if( (pStt == pEnd) && pTNd ) // no selection? +bool bNoSelection = (pStt == pEnd) && pTNd; // no selection? +if ( bNoSelection ) { /* Check if cursor is inside of a word */ assert(g_pBreakIt && g_pBreakIt->GetBreakIter().is()); @@ -3061,27 +3062,52 @@ void DocumentContentOperationsManager::TransliterateText( rIDRA.GetRedlineTable().FindAtPosition( aPos, n ); if ( pFnd && RedlineType::Insert == pFnd->GetType() && n > 0 ) { -const SwRangeRedline* pFnd2 = rIDRA.GetRedlineTable()[n-1]; -if ( RedlineType::Delete == pFnd2->GetType() && - m_rDoc.getIDocumentLayoutAccess().GetCurrentViewShell() && - *pFnd2->End() == *pFnd->Start() && - pFnd->GetAuthor() == pFnd2->GetAuthor() ) +SwWrtShell *pWrtShell = dynamic_cast( + m_rDoc.getIDocumentLayoutAccess().GetCurrentViewShell()); + +sal_Int32 nRejectedCharacters = 0; +SwRangeRedline* pFnd2 = rIDRA.GetRedlineTable()[--n]; +// loop on all redlines of a case changing, and reject them +while ( ( ( RedlineType::Insert == pFnd->GetType() && +RedlineType::Delete == pFnd2->GetType() )
[Libreoffice-commits] core.git: sw/source
sw/source/filter/ww8/rtfattributeoutput.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit e8228e0994610fed8af090ff30ffc08bfecb7261 Author: Justin Luth AuthorDate: Tue Oct 31 16:26:50 2023 -0400 Commit: Justin Luth CommitDate: Wed Nov 1 02:28:15 2023 +0100 tdf#108318 rtfexport: no hyperlink target for clipboard This fixes copying hyperlinks from Writer to the other apps like Calc or even to editeng components within Writer. External apps never seem to call for RTF clipboard. Certainly firefox doesn't - and everything I tested seems to just request plain text URL strings. I don't see anywhere in the RTF specification that a \fldinst can take formatting parameters along with the URL. That is likely only a DOCX thing. But since RTF shares import code with DOCX, it gets the parsing for free, so we explicitly use it to round-trip targets in RTF. See commit 31de0ac30d6c521ad663db78feb936688be5bccb Author: Miklos Vajna on Tue Feb 14 09:32:25 2017 +0100 RTF import: handle target of hyperlink Alternatively I could have had editeng parse the flags on clipboard RTF import, but handling it at export seemed cleaner to me. Change-Id: Ic34bcf99edf7bd3fb404ed312c07acae0ef814e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158744 Tested-by: Jenkins Reviewed-by: Justin Luth diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index c3ec71eaaa30..afcdbdf0e761 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -561,7 +561,9 @@ bool RtfAttributeOutput::StartURL(const OUString& rUrl, const OUString& rTarget) m_aRun->append(msfilter::rtfutil::OutString(rUrl, m_rExport.GetCurrentEncoding())); m_aRun->append("\" "); -if (!rTarget.isEmpty()) +// Adding the target is likely a LO embellishment. +// Don't export it to clipboard, since editeng and other RTF readers won't understand it. +if (!rTarget.isEmpty() && !m_rExport.m_rDoc.IsClipBoard()) { m_aRun->append("t \""); m_aRun->append(msfilter::rtfutil::OutString(rTarget, m_rExport.GetCurrentEncoding()));
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sc/source svtools/source
sc/source/ui/view/tabview.cxx |3 ++- svtools/source/control/tabbar.cxx |4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) New commits: commit 7a062cdd9b91c577b2296bfe1f81ea78e0b75168 Author: Andreas Heinisch AuthorDate: Tue Oct 31 15:48:44 2023 +0100 Commit: Adolfo Jayme Barrientos CommitDate: Wed Nov 1 05:58:04 2023 +0100 tdf#100584, tdf#157784 - Arrange sheets depending on the RTL settings The tab bar's position should be determined globally based on the RTL settings, rather than being individually set for each sheet. Change-Id: I0690b01c842d2da6d49b57d1adad0a8e0844087f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158730 Tested-by: Andreas Heinisch Reviewed-by: Andreas Heinisch (cherry picked from commit 4f1b3c16f5530a2a190cab07c07c7bf63acf42c7) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158696 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index b6c7a2bd8e66..56776d2d9b49 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -280,7 +280,8 @@ void ScTabView::DoResize( const Point& rOffset, const Size& rSize, bool bInner ) if (bHasHint) RemoveHintWindow(); -bool bLayoutRTL = aViewData.GetDocument().IsLayoutRTL( aViewData.GetTabNo() ); +// tdf#100584 - arrange sheets depending on the RTL settings +bool bLayoutRTL = AllSettings::GetLayoutRTL(); tools::Long nTotalWidth = rSize.Width(); if ( bLayoutRTL ) nTotalWidth += 2*rOffset.X(); diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index 1690269ba234..02a23b8aea33 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -715,9 +715,7 @@ void TabBar::ImplFormat() const size_t nItemListSize = mpImpl->maItemList.size(); for (size_t nItemIndex = 0; nItemIndex < nItemListSize; nItemIndex++) { -// tdf#100584 - arrange sheets depending on the RTL settings -auto& rItem = mbMirrored ? mpImpl->maItemList[nItemListSize - nItemIndex - 1] - : mpImpl->maItemList[nItemIndex]; +auto& rItem = mpImpl->maItemList[nItemIndex]; // At all non-visible tabs an empty rectangle is set if ((nItemIndex + 1 < mnFirstPos) || (x > mnLastOffX))
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - 2 commits - sc/source
sc/source/core/data/markdata.cxx | 12 +++-- sc/source/core/data/markmulti.cxx | 47 -- sc/source/core/tool/address.cxx | 42 +++-- sc/source/ui/docshell/docfunc.cxx |8 +++--- sc/source/ui/view/viewfunc.cxx| 28 -- 5 files changed, 68 insertions(+), 69 deletions(-) New commits: commit 04e4a565c154d170686c2163ffcd64f1ab0d194c Author: Gökay Şatır AuthorDate: Mon Oct 30 12:37:23 2023 +0300 Commit: Gökay ŞATIR CommitDate: Wed Nov 1 07:08:43 2023 +0100 Fix row deletion bug. When multiple users are editing a Calc document: * If one user selects a whole row and another one deletes a range of rows including or above the selected row, app crashes. * This PR fixes the crash. * Also when multiple rows are deleted, other user's selected row is moved only one row. This PR moves the selected row according to the deleted row count. * The cursor position was also causing a crash, fixed. Signed-off-by: Gökay Şatır Change-Id: Ie4b893fee7192492efacbb167b747434336384e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158650 Reviewed-by: Marco Cecchetti Tested-by: Marco Cecchetti Tested-by: Jenkins CollaboraOffice diff --git a/sc/source/core/data/markdata.cxx b/sc/source/core/data/markdata.cxx index afc875983ab1..98a3aebe5c8b 100644 --- a/sc/source/core/data/markdata.cxx +++ b/sc/source/core/data/markdata.cxx @@ -670,13 +670,11 @@ void ScMarkData::ShiftCols(const ScDocument& rDoc, SCCOL nStartCol, sal_Int32 nC void ScMarkData::ShiftRows(const ScDocument& rDoc, SCROW nStartRow, sal_Int32 nRowOffset) { if (bMarked) -{ aMarkRange.IncRowIfNotLessThan(rDoc, nStartRow, nRowOffset); -} -else if (bMultiMarked) +if (bMultiMarked) { -aMultiSel.ShiftRows(nStartRow, nRowOffset); aMultiRange.IncRowIfNotLessThan(rDoc, nStartRow, nRowOffset); +aMultiSel.ShiftRows(nStartRow, nRowOffset); } } diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index 7780e12185c5..09396d0c46b6 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -2406,17 +2406,30 @@ void ScRange::IncColIfNotLessThan(const ScDocument& rDoc, SCCOL nStartCol, SCCOL void ScRange::IncRowIfNotLessThan(const ScDocument& rDoc, SCROW nStartRow, SCROW nOffset) { -if (aStart.Row() >= nStartRow) +SCROW offset; +if (aStart.Row() > nStartRow) { -aStart.IncRow(nOffset); +offset = nOffset; +if (nStartRow + nOffset > aStart.Row()) +offset = aStart.Row() - nStartRow; +else if (nStartRow - nOffset > aStart.Row()) +offset = -1 * (aStart.Row() - nStartRow); + +aStart.IncRow(offset); if (aStart.Row() < 0) aStart.SetRow(0); else if(aStart.Row() > rDoc.MaxRow()) aStart.SetRow(rDoc.MaxRow()); } -if (aEnd.Row() >= nStartRow) +if (aEnd.Row() > nStartRow) { -aEnd.IncRow(nOffset); +offset = nOffset; +if (nStartRow + nOffset > aEnd.Row()) +offset = aEnd.Row() - nStartRow; +else if (nStartRow - nOffset > aEnd.Row()) +offset = -1 * (aEnd.Row() - nStartRow); + +aEnd.IncRow(offset); if (aEnd.Row() < 0) aEnd.SetRow(0); else if(aEnd.Row() > rDoc.MaxRow()) diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 84a5435845b9..be844634ea25 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -2259,7 +2259,7 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark, if (bInsertRows) { -pViewSh->OnLOKInsertDeleteRow(rRange.aStart.Row(), 1); +pViewSh->OnLOKInsertDeleteRow(rRange.aStart.Row() - (eCmd == INS_INSROWS_BEFORE ? 1: 0), 1); } } @@ -2839,7 +2839,7 @@ bool ScDocFunc::DeleteCells( const ScRange& rRange, const ScMarkData* pTabMark, } if (eCmd == DelCellCmd::Rows) { -pViewSh->OnLOKInsertDeleteRow(rRange.aStart.Row(), -1); +pViewSh->OnLOKInsertDeleteRow(rRange.aStart.Row(), -1 * (rRange.aEnd.Row() - rRange.aStart.Row() + 1)); } } diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index a35433fee24a..13eb71acef52 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1666,11 +1666,17 @@ void ScViewFunc::OnLOKInsertDeleteRow(SCROW nStartRow, tools::Long nOffset) if (pTabViewShell->getPart() == nCurrentTabIndex) { SCROW nY = pTabViewShell->GetViewData().GetCurY(); -if (nY > nStartRow || (nY == nStartRow && nOffset > 0)) +if (nY > nStartRow) { +tool
[Libreoffice-commits] core.git: Branch 'distro/vector/vector-7.5' - 10 commits - filter/source starmath/inc starmath/source sw/qa sw/source
filter/source/pdf/pdfexport.cxx| 30 + starmath/inc/document.hxx |4 starmath/inc/view.hxx | 19 - starmath/source/document.cxx | 309 starmath/source/unomodel.cxx | 37 +- starmath/source/view.cxx | 317 - sw/qa/extras/htmlexport/data/embedded_formula.fodt | 30 + sw/qa/extras/htmlexport/htmlexport.cxx | 66 ++-- sw/source/filter/html/htmlplug.cxx | 184 +++- sw/source/filter/html/wrthtml.cxx |6 sw/source/filter/html/wrthtml.hxx |3 11 files changed, 563 insertions(+), 442 deletions(-) New commits: commit cc539b1c2f3db9f868ad1c3b4292c8454ac5a79d Author: Mike Kaganski AuthorDate: Mon Oct 30 17:14:47 2023 +0300 Commit: Mike Kaganski CommitDate: Tue Oct 31 12:00:47 2023 +0300 ReqIF: introduce ExportFormulasAsPDF HTML export filter option Change-Id: Id400bd5571d0a192d854620abe83d862e0512434 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158663 Tested-by: Jenkins Reviewed-by: Mike Kaganski diff --git a/sw/qa/extras/htmlexport/data/embedded_formula.fodt b/sw/qa/extras/htmlexport/data/embedded_formula.fodt new file mode 100644 index ..46e5391223c0 --- /dev/null +++ b/sw/qa/extras/htmlexport/data/embedded_formula.fodt @@ -0,0 +1,30 @@ + + + + + + Formula: + + http://www.w3.org/1998/Math/MathML"; display="block"> + + + + e + + i + π + + + + + 1 + = + 0 + +{ func e ^ { i %pi } + 1 } = 0 + + + + + + + \ No newline at end of file diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx index 7c74a27161ee..6b8de215d27c 100644 --- a/sw/qa/extras/htmlexport/htmlexport.cxx +++ b/sw/qa/extras/htmlexport/htmlexport.cxx @@ -13,6 +13,7 @@ #include #include +#include #include #include #include @@ -265,9 +266,10 @@ public: { } +OUString GetObjectPath(const OUString& ext); /// Get the .ole path, assuming maTempFile is an XHTML export result. -OUString GetOlePath(); -OUString GetPngPath(); +OUString GetOlePath() { return GetObjectPath(".ole"); } +OUString GetPngPath() { return GetObjectPath(".png"); } /// Parse the ole1 data out of an RTF fragment URL. void ParseOle1FromRtfUrl(const OUString& rRtfUrl, SvMemoryStream& rOle1); /// Export using the C++ HTML export filter, with xhtmlns=reqif-xhtml. @@ -276,35 +278,19 @@ public: void ImportFromReqif(const OUString& rUrl); }; -OUString SwHtmlDomExportTest::GetOlePath() +OUString SwHtmlDomExportTest::GetObjectPath(const OUString& ext) { +assert(ext.startsWith(".")); SvMemoryStream aStream; WrapReqifFromTempFile(aStream); xmlDocUniquePtr pDoc = parseXmlStream(&aStream); CPPUNIT_ASSERT(pDoc); OUString aOlePath = getXPath( pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p/reqif-xhtml:object", "data"); -OUString aOleSuffix(".ole"); -CPPUNIT_ASSERT(aOlePath.endsWith(aOleSuffix)); +CPPUNIT_ASSERT(aOlePath.endsWith(ext)); INetURLObject aUrl(maTempFile.GetURL()); -aUrl.setBase(aOlePath.subView(0, aOlePath.getLength() - aOleSuffix.getLength())); -aUrl.setExtension(u"ole"); -return aUrl.GetMainURL(INetURLObject::DecodeMechanism::NONE); -} - -OUString SwHtmlDomExportTest::GetPngPath() -{ -SvMemoryStream aStream; -WrapReqifFromTempFile(aStream); -xmlDocUniquePtr pDoc = parseXmlStream(&aStream); -CPPUNIT_ASSERT(pDoc); -OUString aPngPath = getXPath( -pDoc, "/reqif-xhtml:html/reqif-xhtml:div/reqif-xhtml:p/reqif-xhtml:object", "data"); -OUString aPngSuffix(".png"); -CPPUNIT_ASSERT(aPngPath.endsWith(aPngSuffix)); -INetURLObject aUrl(maTempFile.GetURL()); -aUrl.setBase(aPngPath.subView(0, aPngPath.getLength() - aPngSuffix.getLength())); -aUrl.setExtension(u"png"); +aUrl.setBase(aOlePath.subView(0, aOlePath.getLength() - ext.getLength())); +aUrl.setExtension(ext.subView(1)); return aUrl.GetMainURL(INetURLObject::DecodeMechanism::NONE); } @@ -2830,6 +2816,40 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIF_PreserveSpaces) CPPUNIT_ASSERT_EQUAL(paraText, getParagraph(1)->getString()); } +CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqIF_ExportFormulasAsPDF) +{ +// Given a document with a formula: +createSwDoc("embedded_formula.fodt"); + +// When exporting to reqif with ExportFormulasAsPDF=true: +uno::Reference xStorable(mxComponent, uno::UNO_QUERY_THROW); +uno::Sequence aStoreProperties = { +comphelper::makePropertyValue("FilterName", OUString("HTML (StarWriter)")), +comphelper::makePropertyValue("FilterO