Makefile.in | 1 android/source/res/values-eo/strings.xml | 73 ++ avmedia/source/qt6/QtFrameGrabber.cxx | 6 basctl/uiconfig/basicide/ui/sortmenu.ui | 2 configure.ac | 2 cui/source/customize/acccfg.cxx | 7 cui/source/customize/cfg.cxx | 1 download.lst | 12 drawinglayer/inc/texture/texture3d.hxx | 4 drawinglayer/source/texture/texture3d.cxx | 29 editeng/source/editeng/impedit3.cxx | 1 filter/qa/unit/data/fit-to-size-text.fodg | 35 + filter/qa/unit/svg.cxx | 16 filter/source/svg/svgfilter.cxx | 38 - filter/source/svg/svgfilter.hxx | 1 filter/source/svg/svgwriter.cxx | 29 filter/source/svg/svgwriter.hxx | 4 include/vcl/qt/QtUtils.hxx | 6 package/qa/cppunit/data/tdf166862.odt |binary package/qa/cppunit/test_zippackage.cxx | 18 package/source/zipapi/ZipFile.cxx | 11 sc/qa/unit/data/fods/lostRowStyle.fods | 25 sc/qa/unit/data/ods/autostyle-name-is-single-char.ods |binary sc/qa/unit/subsequent_export_test4.cxx | 39 + sc/source/filter/xml/XMLStylesExportHelper.cxx | 28 sc/source/ui/Accessibility/AccessibleCsvControl.cxx | 9 sc/source/ui/dbgui/scuiasciiopt.cxx | 298 +++------- sfx2/source/dialog/backingwindow.cxx | 2 sw/qa/extras/layout/data/many-paragraphs-per-page-in-6-columns.odt |binary sw/qa/extras/layout/data/table-with-hidden-section.fodt | 57 + sw/qa/extras/layout/layout5.cxx | 46 + sw/qa/extras/ooxmlexport/ooxmlexport12.cxx | 2 sw/qa/uitest/writer_tests8/tdf145158.py | 1 sw/source/core/doc/docfld.cxx | 53 - sw/source/core/layout/laycache.cxx | 101 --- sw/source/core/layout/layhelp.hxx | 2 sw/source/core/layout/tabfrm.cxx | 4 vcl/inc/qt5/QtTools.hxx | 7 vcl/source/treelist/transfer.cxx | 1 vcl/win/gdi/salnativewidgets-luna.cxx | 1 40 files changed, 550 insertions(+), 422 deletions(-)
New commits: commit 049a5ed9fa691c27d0a2c1b0956c07d3c2f42fad Author: Oscar Megía López <[email protected]> AuthorDate: Sat May 31 21:18:31 2025 +0200 Commit: Andras Timar <[email protected]> CommitDate: Thu Jun 12 12:38:32 2025 +0200 tdf#166740 On Customize/Keyboard shortcuts added I have same issue in my spanish keyboard. I added all symbol keys that I could and now only a few symbols aren't recognized. I tested with: $ setxkbmap jp $ setxkbmap us $ setxkbmap es and now most of symbols work. Sometimes libreoffice goes to symbol on top instead key because shift key is pressed and symbol is key with shift. Change-Id: I4f0f663838ab4f9ee38644b6c687f1862d2cf8dd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186096 Reviewed-by: Heiko Tietze <[email protected]> Tested-by: Jenkins (cherry picked from commit ea377c8ee35ce5511baadcfc75f1994c9abc33d9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186367 (cherry picked from commit a493a9c5b8b3dea76dbb1ad73dd6a2d1a7a9df3c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186391 Reviewed-by: Adolfo Jayme Barrientos <[email protected]> diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index a83cc24e520e..24ac9d5e2a69 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -284,6 +284,13 @@ const sal_uInt16 KEYCODE_ARRAY[] = { KEY_F1, KEY_SHIFT | KEY_MOD1 | KEY_COMMA, KEY_SHIFT | KEY_MOD1 | KEY_TILDE, KEY_SHIFT | KEY_MOD1 | KEY_TAB, + KEY_SHIFT | KEY_MOD1 | KEY_DIVIDE, + KEY_SHIFT | KEY_MOD1 | KEY_ADD, + KEY_SHIFT | KEY_MOD1 | KEY_SUBTRACT, + KEY_SHIFT | KEY_MOD1 | KEY_MULTIPLY, + KEY_SHIFT | KEY_MOD1 | KEY_LESS, + KEY_SHIFT | KEY_MOD1 | KEY_GREATER, + KEY_SHIFT | KEY_MOD1 | KEY_OPEN, KEY_SHIFT | KEY_MOD1 | KEY_F1, KEY_SHIFT | KEY_MOD1 | KEY_F2, commit ea219786019577427a185f6fc8ee873ae8880f7c Author: Mike Kaganski <[email protected]> AuthorDate: Wed Jun 11 16:15:46 2025 +0500 Commit: Andras Timar <[email protected]> CommitDate: Thu Jun 12 12:38:32 2025 +0200 tdf#166939: Fix error in commit 36c41573ec7e47bd8c2b0f78210319c96088f164 The order of arguments of std::distance is the opposite. Change-Id: Ia125f071449f0bba4375204413736267cee5f57d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186370 Reviewed-by: Mike Kaganski <[email protected]> Tested-by: Jenkins (cherry picked from commit 1ba380bc625f6a846b80bfdf2e2678788df49447) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186376 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sc/qa/unit/data/fods/lostRowStyle.fods b/sc/qa/unit/data/fods/lostRowStyle.fods new file mode 100644 index 000000000000..0ac7e64c7d80 --- /dev/null +++ b/sc/qa/unit/data/fods/lostRowStyle.fods @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" office:version="1.4" office:mimetype="application/vnd.oasis.opendocument.spreadsheet"> + <office:automatic-styles> + <style:style style:name="r_1" style:family="table-row"> + <style:table-row-properties style:row-height="1cm"/> + </style:style> + <style:style style:name="r_2" style:family="table-row"> + <style:table-row-properties style:row-height="2cm"/> + </style:style> + </office:automatic-styles> + <office:body> + <office:spreadsheet> + <table:table table:name="Sheet1"> + <table:table-column/> + <table:table-row table:style-name="r_1"> + <table:table-cell office:value-type="string" office:string-value="A1"/> + </table:table-row> + <table:table-row table:style-name="r_2"> + <table:table-cell office:value-type="string" office:string-value="A2"/> + </table:table-row> + </table:table> + </office:spreadsheet> + </office:body> +</office:document> \ No newline at end of file diff --git a/sc/qa/unit/subsequent_export_test4.cxx b/sc/qa/unit/subsequent_export_test4.cxx index 491743a6c87f..2bd47c95359a 100644 --- a/sc/qa/unit/subsequent_export_test4.cxx +++ b/sc/qa/unit/subsequent_export_test4.cxx @@ -2274,6 +2274,29 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf166939) assertXPath(pXmlDoc, "//office:automatic-styles/style:style[@style:name='a']", 1); } +CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf166939_1) +{ + // Check that the autostyles are stored correctly, when autostyle names are not standard (are + // not like "ro1"; the chosen names are "r_1", "r_2"). A mistake had made a function return + // existing style's index negative, and that wasn't caught in tests... + loadWithParams(createFileURL(u"fods/lostRowStyle.fods"), + { comphelper::makePropertyValue(u"AsTemplate"_ustr, true) }); + // Saving it must keep the autostyles + save(u"calc8"_ustr); + xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath( + pXmlDoc, + "//office:automatic-styles/style:style[@style:family='table-row'][@style:name='r_1']", 1); + assertXPath( + pXmlDoc, + "//office:automatic-styles/style:style[@style:family='table-row'][@style:name='r_2']", 1); + assertXPath(pXmlDoc, "//table:table/table:table-row[1]", "style-name", u"r_1"); + // When the bug was introduced, this failed with + // - In <>, XPath '//table:table/table:table-row[2]' no attribute 'style-name' exist + assertXPath(pXmlDoc, "//table:table/table:table-row[2]", "style-name", u"r_2"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx index 1203e660465c..b6d0a510419d 100644 --- a/sc/source/filter/xml/XMLStylesExportHelper.cxx +++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx @@ -916,7 +916,7 @@ sal_Int32 ScColumnRowStylesBase::GetIndexOfStyleName(std::u16string_view rString } if (auto i = std::find(aStyleNames.begin(), aStyleNames.end(), rString); i != aStyleNames.end()) - return std::distance(i, aStyleNames.begin()); + return std::distance(aStyleNames.begin(), i); return -1; } commit f672a9078863da09a27edd5a7e4e01803ba36a0d Author: Xisco Fauli <[email protected]> AuthorDate: Mon Jun 9 09:31:24 2025 +0200 Commit: Andras Timar <[email protected]> CommitDate: Thu Jun 12 12:38:32 2025 +0200 libffi: upgrade to 3.5.0 Downloaded from https://github.com/libffi/libffi/releases/download/v3.5.0/libffi-3.5.0.tar.gz Change-Id: Idf49997af9ec99b55fb4b09d71572d284be0ad73 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186282 Reviewed-by: Xisco Fauli <[email protected]> Tested-by: Jenkins (cherry picked from commit 0daa3aa3400eabdb39bde43575358491e4cca5f0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186297 diff --git a/download.lst b/download.lst index adf0632a2b41..e1d287fe71a4 100644 --- a/download.lst +++ b/download.lst @@ -492,8 +492,8 @@ LIBEXTTEXTCAT_TARBALL := libexttextcat-3.4.7.tar.xz # three static lines # so that git cherry-pick # will not run into conflicts -LIBFFI_SHA256SUM := bc9842a18898bfacb0ed1252c4febcc7e78fa139fd27fdc7a3e30d9d9356119b -LIBFFI_TARBALL := libffi-3.4.8.tar.gz +LIBFFI_SHA256SUM := 8c72678628a5dd8782f08ad421d5a441e42c1c5c1b33e0bc211cbfcf1f3b3978 +LIBFFI_TARBALL := libffi-3.5.0.tar.gz # three static lines # so that git cherry-pick # will not run into conflicts commit 9f996e7f6ff49b877add1dc955c2e05c9586ecbf Author: Stephan Bergmann <[email protected]> AuthorDate: Tue Jun 10 13:58:37 2025 +0200 Commit: Andras Timar <[email protected]> CommitDate: Thu Jun 12 12:38:32 2025 +0200 distclean generated sysui/desktop/macosx/LaunchConstraint.plist ...introduced with 22ab2bec717b44e85e110cd67175c2f3599264c2 "mac: add parent launch-constraint to packaged framework/helpers" Change-Id: I3305be40b6166586b23cb1c5976ef920af4f0ab1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186327 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <[email protected]> (cherry picked from commit 6696e63b9f05e1df1308cabb71c3a2840f5411da) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186354 Reviewed-by: Christian Lohmaier <[email protected]> diff --git a/Makefile.in b/Makefile.in index 36a81704ab88..74044594d157 100644 --- a/Makefile.in +++ b/Makefile.in @@ -237,6 +237,7 @@ distclean : clean compilerplugins-clean mac-app-store-package.clean $(BUILDDIR)/solenv/lockfile/autoconf.h \ $(BUILDDIR)/lo.xcent \ $(BUILDDIR)/sysui/desktop/macosx/Info.plist \ + $(BUILDDIR)/sysui/desktop/macosx/LaunchConstraint.plist \ $(BUILDDIR)/vs-code*.code-workspace* \ $(BUILDDIR)/extensions/source/macosx/quicklookpreview/appex/Info.plist \ $(BUILDDIR)/extensions/source/macosx/quicklookthumbnail/appex/Info.plist commit 8c6b98d191112fbda6d2cc87e8fc6fd14410167a Author: Mike Kaganski <[email protected]> AuthorDate: Tue Jun 10 17:53:02 2025 +0500 Commit: Andras Timar <[email protected]> CommitDate: Thu Jun 12 12:38:32 2025 +0200 tdf#166939: Don't pass invalid starting index when creating a view A style name can be as short as one character; a two-character prefix can already be too long. Change-Id: I041894d8c68942a49aef399edaccbcd48522ae83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186328 Reviewed-by: Mike Kaganski <[email protected]> Tested-by: Jenkins (cherry picked from commit faab5ca6174e3e581661784216410e2bc88da081) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186344 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sc/qa/unit/data/ods/autostyle-name-is-single-char.ods b/sc/qa/unit/data/ods/autostyle-name-is-single-char.ods new file mode 100644 index 000000000000..2ed461e173cb Binary files /dev/null and b/sc/qa/unit/data/ods/autostyle-name-is-single-char.ods differ diff --git a/sc/qa/unit/subsequent_export_test4.cxx b/sc/qa/unit/subsequent_export_test4.cxx index 824215619e10..491743a6c87f 100644 --- a/sc/qa/unit/subsequent_export_test4.cxx +++ b/sc/qa/unit/subsequent_export_test4.cxx @@ -35,6 +35,7 @@ #include <editeng/flditem.hxx> #include <editeng/justifyitem.hxx> #include <comphelper/scopeguard.hxx> +#include <comphelper/propertyvalue.hxx> #include <formula/grammar.hxx> #include <tools/fldunit.hxx> #include <tools/UnitConversion.hxx> @@ -2258,6 +2259,21 @@ CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf166712) assertXPath(pConn, "/x:connections/x:connection/x:olapPr", 0); } +CPPUNIT_TEST_FIXTURE(ScExportTest4, testTdf166939) +{ + // Given a document with a column autostyle name equal to "a" (it could be any single-character + // name). Load it as template, to keep streams valid (see ScDocShell::SaveAs) to reuse existing + // autostyle names (see ScXMLExport::collectAutoStyles). + loadWithParams(createFileURL(u"ods/autostyle-name-is-single-char.ods"), + { comphelper::makePropertyValue(u"AsTemplate"_ustr, true) }); + // Saving it must not crash / fail an assertion! + save(u"calc8"_ustr); + // Check that we tested the codepath preserving existing names - otherwise test makes no sense + xmlDocUniquePtr pXmlDoc = parseExport(u"content.xml"_ustr); + CPPUNIT_ASSERT(pXmlDoc); + assertXPath(pXmlDoc, "//office:automatic-styles/style:style[@style:name='a']", 1); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx index 9d81eb609436..1203e660465c 100644 --- a/sc/source/filter/xml/XMLStylesExportHelper.cxx +++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx @@ -908,27 +908,17 @@ sal_Int32 ScColumnRowStylesBase::AddStyleName(const OUString & rString) sal_Int32 ScColumnRowStylesBase::GetIndexOfStyleName(std::u16string_view rString, std::u16string_view rPrefix) { - sal_Int32 nPrefixLength(rPrefix.size()); - std::u16string_view sTemp(rString.substr(nPrefixLength)); - sal_Int32 nIndex(o3tl::toInt32(sTemp)); - if (nIndex > 0 && o3tl::make_unsigned(nIndex-1) < aStyleNames.size() && aStyleNames.at(nIndex - 1) == rString) - return nIndex - 1; - else + if (std::u16string_view rest; o3tl::starts_with(rString, rPrefix, &rest)) { - sal_Int32 i(0); - bool bFound(false); - while (!bFound && o3tl::make_unsigned(i) < aStyleNames.size()) - { - if (aStyleNames.at(i) == rString) - bFound = true; - else - ++i; - } - if (bFound) - return i; - else - return -1; + sal_Int32 nIndex(o3tl::toInt32(rest)); + if (nIndex > 0 && o3tl::make_unsigned(nIndex - 1) < aStyleNames.size() && aStyleNames[nIndex - 1] == rString) + return nIndex - 1; } + + if (auto i = std::find(aStyleNames.begin(), aStyleNames.end(), rString); i != aStyleNames.end()) + return std::distance(i, aStyleNames.begin()); + + return -1; } OUString& ScColumnRowStylesBase::GetStyleNameByIndex(const sal_Int32 nIndex) commit 8c67a8185b51542e399ff0947e77d7b00b92ed7e Author: Caolán McNamara <[email protected]> AuthorDate: Fri Jun 6 11:49:49 2025 +0100 Commit: Andras Timar <[email protected]> CommitDate: Thu Jun 12 12:38:32 2025 +0200 null deref of empty AlphaMask (gdb) print mpReadTransparence.moAccess._M_payload._M_payload._M_value.mpBuffer $18 = (BitmapBuffer *) 0x0 #0 BitmapReadAccess::GetScanline (this=<optimized out>, nY=<optimized out>) at /opt/rh/devtoolset-12/root/usr/include/c++/12/optional:484 #1 BitmapReadAccess::GetPixel (nX=<optimized out>, nY=<optimized out>, this=<optimized out>) at include/vcl/BitmapReadAccess.hxx:83 #2 drawinglayer::texture::GeoTexSvxBitmapEx::impGetAlpha (this=this@entry=0x3a073610, rX=rX@entry=60, rY=rY@entry=420) at drawinglayer/source/texture/texture3d.cxx:111 #3 0x00007f4cc4baba0e in drawinglayer::texture::GeoTexSvxBitmapEx::impGetAlpha (rY=420, rX=<optimized out>, this=0x3a073610) at drawinglayer/source/texture/texture3d.cxx:152 #4 drawinglayer::texture::GeoTexSvxBitmapEx::modifyBColor (this=0x3a073610, rUV=..., rBColor=..., rfOpacity=@0x7f4cabbba638: 1) at drawinglayer/source/texture/texture3d.cxx:152 #5 0x00007f4cc4ba9a31 in ZBufferRasterConverter3D::decideColorAndOpacity (this=this@entry=0x39db6260, rColor=...) at drawinglayer/source/processor3d/zbufferprocessor3d.cxx:119 #6 0x00007f4cc4ba4d9c in ZBufferRasterConverter3D::processLineSpan (this=0x39db6260, rA=..., rB=..., nLine=<optimized out>, nSpanCount=<optimized out>) at drawinglayer/source/processor3d/zbufferprocessor3d.cxx:305 #7 0x00007f4cc438d5f6 in basegfx::RasterConverter3D::rasterconvertB3DArea(int, int) () at basegfx/source/raster/rasterconvert3d.cxx:129 #8 0x00007f4cc4ba0ac7 in drawinglayer::processor3d::DefaultProcessor3D::impRenderPolyPolygonMaterialPrimitive3D(drawinglayer::primitive3d::PolyPolygonMaterialPrimitive3D const&) const () at drawinglayer/source/processor3d/defaultprocessor3d.cxx:448 #9 0x00007f4cc4b9fcc9 in drawinglayer::processor3d::BaseProcessor3D::process (this=this@entry=0x39da04c0, rSource=...) at /opt/rh/devtoolset-12/root/usr/include/c++/12/bits/stl_deque.h:263 #10 0x00007f4cc4ba1ca0 in drawinglayer::processor3d::DefaultProcessor3D::impRenderBitmapTexturePrimitive3D(drawinglayer::primitive3d::BitmapTexturePrimitive3D const&) () at drawinglayer/source/processor3d/defaultprocessor3d.cxx:263 #11 0x00007f4cc4b9fcc9 in drawinglayer::processor3d::BaseProcessor3D::process (this=this@entry=0x39da04c0, rSource=...) at /opt/rh/devtoolset-12/root/usr/include/c++/12/bits/stl_deque.h:263 #12 0x00007f4cc4ba2846 in drawinglayer::processor3d::DefaultProcessor3D::processBasePrimitive3D(drawinglayer::primitive3d::BasePrimitive3D const&) () at include/drawinglayer/processor3d/baseprocessor3d.hxx:63 #13 0x00007f4cc4b9fcc9 in drawinglayer::processor3d::BaseProcessor3D::process (this=0x39da04c0, rSource=...) at /opt/rh/devtoolset-12/root/usr/include/c++/12/bits/stl_deque.h:263 #14 0x00007f4cc4b3a225 in drawinglayer::primitive2d::ScenePrimitive2D::Executor::doWork (this=0x39e13950) at /opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:461 #15 0x00007f4cc4868fe7 in comphelper::ThreadTask::exec() () at comphelper/source/misc/threadpool.cxx:319 #16 0x00007f4cc4869c61 in comphelper::ThreadPool::ThreadWorker::execute (this=0x39e13aa0) at /opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:461 #17 0x00007f4cc144f33f in salhelper::Thread::run() () at salhelper/source/thread.cxx:39 #18 0x00007f4cc144fe94 in osl::threadFunc (param=0x39e13ab0) at include/osl/thread.hxx:189 #19 0x00007f4cc14e0563 in osl_thread_start_Impl (pData=0x39120800) at sal/osl/unx/thread.cxx:237 #20 0x00007f4ccae5f6db in start_thread (arg=0x7f4cabbcb700) at pthread_create.c:463 #21 0x00007f4ccab8874f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95 Change-Id: Ic30b38dc1c53c9df551a282c6a057d042265419e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186222 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> (cherry picked from commit b926ef35afb8b4c6372723a4ae407025750ee6f2) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186322 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/drawinglayer/inc/texture/texture3d.hxx b/drawinglayer/inc/texture/texture3d.hxx index 1ec4df70734c..324c204ed526 100644 --- a/drawinglayer/inc/texture/texture3d.hxx +++ b/drawinglayer/inc/texture/texture3d.hxx @@ -62,11 +62,9 @@ namespace drawinglayer::texture double mfMulX; double mfMulY; - bool mbIsAlpha : 1; - // helpers bool impIsValid(const basegfx::B2DPoint& rUV, sal_Int32& rX, sal_Int32& rY) const; - sal_uInt8 impGetAlpha(sal_Int32 rX, sal_Int32 rY) const; + static sal_uInt8 impGetAlpha(const BitmapReadAccess& readTransparence, sal_Int32 rX, sal_Int32 rY); public: GeoTexSvxBitmapEx( diff --git a/drawinglayer/source/texture/texture3d.cxx b/drawinglayer/source/texture/texture3d.cxx index 4cbcab9d1c5d..9566e73abd03 100644 --- a/drawinglayer/source/texture/texture3d.cxx +++ b/drawinglayer/source/texture/texture3d.cxx @@ -65,18 +65,19 @@ namespace drawinglayer::texture maTopLeft(rRange.getMinimum()), maSize(rRange.getRange()), mfMulX(0.0), - mfMulY(0.0), - mbIsAlpha(maBitmapEx.IsAlpha()) + mfMulY(0.0) { + bool bIsAlpha(maBitmapEx.IsAlpha()); if(vcl::bitmap::convertBitmap32To24Plus8(maBitmapEx,maBitmapEx)) - mbIsAlpha = maBitmapEx.IsAlpha(); + bIsAlpha = maBitmapEx.IsAlpha(); // #121194# Todo: use alpha channel, too (for 3d) maBitmap = maBitmapEx.GetBitmap(); - if(mbIsAlpha) + if (bIsAlpha) { maTransparence = rBitmapEx.GetAlphaMask().GetBitmap(); mpReadTransparence = maTransparence; + OSL_ENSURE(mpReadTransparence, "OOps, transparence type Bitmap, but no read access created in the constructor (?)"); } if (!maBitmap.IsEmpty()) @@ -103,15 +104,11 @@ namespace drawinglayer::texture { } - sal_uInt8 GeoTexSvxBitmapEx::impGetAlpha(sal_Int32 rX, sal_Int32 rY) const + //static + sal_uInt8 GeoTexSvxBitmapEx::impGetAlpha(const BitmapReadAccess& readTransparence, sal_Int32 rX, sal_Int32 rY) { - if(mbIsAlpha) - { - OSL_ENSURE(mpReadTransparence, "OOps, transparence type Bitmap, but no read access created in the constructor (?)"); - const BitmapColor aBitmapColor(mpReadTransparence->GetPixel(rY, rX)); - return aBitmapColor.GetIndex(); - } - return 0; + const BitmapColor aBitmapColor(readTransparence.GetPixel(rY, rX)); + return aBitmapColor.GetIndex(); } bool GeoTexSvxBitmapEx::impIsValid(const basegfx::B2DPoint& rUV, sal_Int32& rX, sal_Int32& rY) const @@ -146,10 +143,10 @@ namespace drawinglayer::texture rBColor = aBSource; - if(mbIsAlpha) + if (mpReadTransparence) { // when we have alpha, make use of it - const sal_uInt8 aAlpha(impGetAlpha(nX, nY)); + const sal_uInt8 aAlpha(impGetAlpha(*mpReadTransparence, nX, nY)); rfOpacity = (static_cast<double>(aAlpha) * (1.0 / 255.0)); } @@ -170,10 +167,10 @@ namespace drawinglayer::texture if(impIsValid(rUV, nX, nY)) { - if(mbIsAlpha) + if (mpReadTransparence) { // this texture has an alpha part, use it - const sal_uInt8 aAlpha(impGetAlpha(nX, nY)); + const sal_uInt8 aAlpha(impGetAlpha(*mpReadTransparence, nX, nY)); const double fNewOpacity(static_cast<double>(aAlpha) * (1.0 / 255.0)); rfOpacity = 1.0 - ((1.0 - fNewOpacity) * (1.0 - rfOpacity)); commit e1764c309319347cfc4810fe8cd781e390191aea Author: Xisco Fauli <[email protected]> AuthorDate: Mon Jun 9 20:25:34 2025 +0200 Commit: Andras Timar <[email protected]> CommitDate: Thu Jun 12 12:38:32 2025 +0200 UITest_writer_tests8: use wait_until_property_is_updated in test_tdf145158 According to https://bugs.documentfoundation.org/show_bug.cgi?id=145158#c20 the issue is still reproducible after commit eb000710c54fcd6d00735bc74b0ffcc0f54c70e0 Author: Christian Lohmaier <[email protected]> Date: Sun Jun 8 21:01:47 2025 +0200 workaround timing issue in UITest_writer_tests8 test_tdf145158 Change-Id: If771cd1ab795b7ea6690ddd8f41c9d98bd13ce50 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186301 Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> Tested-by: René Engelhard <[email protected]> (cherry picked from commit 7442c8463faea5a78af32972bc7283bb44eff78f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186311 Signed-off-by: Xisco Fauli <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186321 diff --git a/sw/qa/uitest/writer_tests8/tdf145158.py b/sw/qa/uitest/writer_tests8/tdf145158.py index 50ef8575da94..41dc0f193cd1 100644 --- a/sw/qa/uitest/writer_tests8/tdf145158.py +++ b/sw/qa/uitest/writer_tests8/tdf145158.py @@ -22,6 +22,7 @@ class tdf145158(UITestCase): xFontsize = xMainWindow.getChild("fontsizecombobox") + self.ui_test.wait_until_property_is_updated(xFontsize, "Text", "12 pt") self.assertEqual("12 pt", get_state_as_dict(xFontsize)['Text']) select_by_text(xFontsize, "10.5 pt") commit 962e898633320ca0e9a57f9ef795dc77bd2aa832 Author: Mike Kaganski <[email protected]> AuthorDate: Fri Jun 6 02:05:21 2025 +0500 Commit: Andras Timar <[email protected]> CommitDate: Thu Jun 12 12:38:31 2025 +0200 tdf#166871: drop mnMaxParaPerPage hack It was there since commit 84a3db80b4fd66c6854b3135b5f69b61fd828e62 (initial import, 2000-09-18); and its idea was to use some heuristics to predict the likely number of pages (when there was no metadata, to use that number for progress indicator), and, most importantly, to predict the page breaks (where a paragraph must be moved to the next page, just because there are many paragraphs on this page already; it likely was considered an optimization). But that hack, in fact, creates page breaks in random places, and then requires moving stuff back; in some cases, the resulting layout was instable, and layout loop control triggered. And that broke the most straightforward way of arranging pages, from start to end. This change removes that hack. The speedup that the hack could potentially provide would be negligible, if at all; and the damage is real. I don't know if the following part of documentation comment for the constructor of SwLayHelper is still relevant after this change: "If there's no layout cache, the distribution to the pages is more a guess, but a guess with statistical background." testObjectCrossReference needed a fields update, for unclear reason. SwTabFrame::Split needed to be improvedto fix failing TestTdf150606, where a zero-height column body tried to layout its table; in this case, in SwTabFrame::Split pRow was pointing to Lower(), nRowCount was 0, nRepeat was 0, and bSplitRowAllowed was false -> it chose "bKeepNextRow" path, moved pRow to its next, split it, and a wrong single-cell table appeared on page 3. This seems to pre-exist, and only happened to be manifested in a test by the change. Change-Id: I2d203055e67b0155bcd719efb1f8a8b6a82b1156 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186243 Reviewed-by: Mike Kaganski <[email protected]> Tested-by: Jenkins Signed-off-by: Xisco Fauli <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186289 diff --git a/sw/qa/extras/layout/data/many-paragraphs-per-page-in-6-columns.odt b/sw/qa/extras/layout/data/many-paragraphs-per-page-in-6-columns.odt new file mode 100644 index 000000000000..83f8943e1db9 Binary files /dev/null and b/sw/qa/extras/layout/data/many-paragraphs-per-page-in-6-columns.odt differ diff --git a/sw/qa/extras/layout/layout5.cxx b/sw/qa/extras/layout/layout5.cxx index 91456defc00e..5de4f1d29932 100644 --- a/sw/qa/extras/layout/layout5.cxx +++ b/sw/qa/extras/layout/layout5.cxx @@ -1740,6 +1740,40 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter5, testTdf166691) assertXPath(pXmlDoc, "//page", 1); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter5, testTdf166871) +{ + // Given a document with 6-column-layout pages, having hundreds of small paragraphs per page + // (normal and headings); its metadata has the number of pages, paragraphs, etc.: + createSwDoc("many-paragraphs-per-page-in-6-columns.odt"); + auto pXmlDoc = parseLayoutDump(); + + // Check the layout - i.e., the count of paragraphs per column per page. + // The metadata in the document must not prevent the correct layout. + + assertXPath(pXmlDoc, "//page", 12); + + // The first 11 pages have the same paragraph count in each column + for (int page = 1; page <= 11; ++page) + { + OString Xpath1 = "//page[" + OString::number(page) + "]/body/column"; + assertXPath(pXmlDoc, Xpath1, 6); + for (int column = 1; column <= 6; ++column) + { + OString Xpath2 = Xpath1 + "[" + OString::number(column) + "]/body/txt"; + assertXPath(pXmlDoc, Xpath2, 47); + } + } + + // Check the last page + assertXPath(pXmlDoc, "//page[12]/body/column", 6); + assertXPath(pXmlDoc, "//page[12]/body/column[1]/body/txt", 14); + assertXPath(pXmlDoc, "//page[12]/body/column[2]/body/txt", 0); + assertXPath(pXmlDoc, "//page[12]/body/column[3]/body/txt", 0); + assertXPath(pXmlDoc, "//page[12]/body/column[4]/body/txt", 0); + assertXPath(pXmlDoc, "//page[12]/body/column[5]/body/txt", 0); + assertXPath(pXmlDoc, "//page[12]/body/column[6]/body/txt", 0); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx index af32d3ebf216..2423e22e93a7 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport12.cxx @@ -18,6 +18,7 @@ #include <com/sun/star/text/XTextTablesSupplier.hpp> #include <com/sun/star/text/XTextTable.hpp> #include <com/sun/star/document/XViewDataSupplier.hpp> +#include <com/sun/star/util/XRefreshable.hpp> #include <o3tl/string_view.hxx> class Test : public SwModelTestBase @@ -468,6 +469,7 @@ CPPUNIT_TEST_FIXTURE(Test, testObjectCrossReference) uno::Reference<text::XTextFieldsSupplier> xTextFieldsSupplier(mxComponent, uno::UNO_QUERY); uno::Reference<container::XEnumerationAccess> xFieldsAccess( xTextFieldsSupplier->getTextFields()); + xFieldsAccess.queryThrow<util::XRefreshable>()->refresh(); uno::Reference<container::XEnumeration> xFields(xFieldsAccess->createEnumeration()); CPPUNIT_ASSERT(xFields->hasMoreElements()); diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx index 75ccf1ac4686..79be4e2147af 100644 --- a/sw/source/core/layout/laycache.cxx +++ b/sw/source/core/layout/laycache.cxx @@ -528,8 +528,6 @@ SwLayHelper::SwLayHelper( SwDoc *pD, SwFrame* &rpF, SwFrame* &rpP, SwPageFrame* , mrpActualSection( rpA ) , mbBreakAfter(false) , mpDoc(pD) - , mnMaxParaPerPage( 25 ) - , mnParagraphCnt( bCache ? 0 : USHRT_MAX ) , mnFlyIdx( 0 ) , mbFirst( bCache ) { @@ -541,7 +539,6 @@ SwLayHelper::SwLayHelper( SwDoc *pD, SwFrame* &rpF, SwFrame* &rpP, SwPageFrame* { mnIndex = 0; mnStartOfContent = rNodes.GetEndOfContent().StartOfSectionNode()->GetIndex(); - mnMaxParaPerPage = 1000; } else { @@ -600,28 +597,8 @@ sal_uLong SwLayHelper::CalcPageCount() if ( nTmp > SwNodeOffset(0) ) nNdCount = sal_Int32(nTmp); } - if ( nNdCount > 100 ) // no estimation below this value - { - if ( nPgCount > 0 ) - { // tdf#129529 avoid 0... - mnMaxParaPerPage = std::max<sal_uLong>(3, nNdCount / nPgCount); - } - else - { - mnMaxParaPerPage = std::max( sal_uLong(20), - sal_uLong(20 + nNdCount / 1000 * 3) ); - const sal_uLong nMax = 53; - mnMaxParaPerPage = std::min( mnMaxParaPerPage, nMax ); - nPgCount = nNdCount / mnMaxParaPerPage; - } - if ( nNdCount < 1000 ) - nPgCount = 0;// no progress bar for small documents - SwViewShell *pSh = nullptr; - if( mrpLay && mrpLay->getRootFrame() ) - pSh = mrpLay->getRootFrame()->GetCurrShell(); - if( pSh && pSh->GetViewOptions()->getBrowseMode() ) - mnMaxParaPerPage *= 6; - } + if ( nNdCount < 1000 ) + nPgCount = 0;// no progress bar for small documents } return nPgCount; } @@ -721,13 +698,10 @@ bool SwLayHelper::CheckInsertPage( bool SwLayHelper::CheckInsert( SwNodeOffset nNodeIndex ) { bool bRet = false; - bool bLongTab = false; - sal_uLong nMaxRowPerPage( 0 ); nNodeIndex -= mnStartOfContent; sal_uInt16 nRows( 0 ); if( mrpFrame->IsTabFrame() ) { - //Inside a table counts every row as a paragraph SwFrame *pLow = static_cast<SwTabFrame*>(mrpFrame)->Lower(); nRows = 0; do @@ -735,89 +709,47 @@ bool SwLayHelper::CheckInsert( SwNodeOffset nNodeIndex ) ++nRows; pLow = pLow->GetNext(); } while ( pLow ); - mnParagraphCnt += nRows; - if( !mpImpl && mnParagraphCnt > mnMaxParaPerPage + 10 ) - { - // OD 09.04.2003 #108698# - improve heuristics: - // Assume that a table, which has more than three times the quantity - // of maximal paragraphs per page rows, consists of rows, which have - // the height of a normal paragraph. Thus, allow as much rows per page - // as much paragraphs are allowed. - if ( nRows > ( 3*mnMaxParaPerPage ) ) - { - nMaxRowPerPage = mnMaxParaPerPage; - } - else - { - SwFrame *pTmp = static_cast<SwTabFrame*>(mrpFrame)->Lower(); - if( pTmp->GetNext() ) - pTmp = pTmp->GetNext(); - pTmp = static_cast<SwRowFrame*>(pTmp)->Lower(); - sal_uInt16 nCnt = 0; - do - { - ++nCnt; - pTmp = pTmp->GetNext(); - } while( pTmp ); - nMaxRowPerPage = std::max( sal_uLong(2), mnMaxParaPerPage / nCnt ); - } - bLongTab = true; - } } - else - ++mnParagraphCnt; if( mbFirst && mpImpl && mnIndex < mpImpl->size() && mpImpl->GetBreakIndex( mnIndex ) == nNodeIndex && ( mpImpl->GetBreakOfst( mnIndex ) < COMPLETE_STRING || ( ++mnIndex < mpImpl->size() && mpImpl->GetBreakIndex( mnIndex ) == nNodeIndex ) ) ) mbFirst = false; - // OD 09.04.2003 #108698# - always split a big tables. - if ( !mbFirst || - ( mrpFrame->IsTabFrame() && bLongTab ) - ) + if (!mbFirst) { sal_Int32 nRowCount = 0; do { - if( mpImpl || bLongTab ) + if (mpImpl) { sal_Int32 nOfst = COMPLETE_STRING; sal_uInt16 nType = SW_LAYCACHE_IO_REC_PAGES; - if( bLongTab ) + while( mnIndex < mpImpl->size() && + mpImpl->GetBreakIndex(mnIndex) < nNodeIndex) + ++mnIndex; + if( mnIndex < mpImpl->size() && + mpImpl->GetBreakIndex(mnIndex) == nNodeIndex ) { + nType = mpImpl->GetBreakType( mnIndex ); + nOfst = mpImpl->GetBreakOfst( mnIndex++ ); mbBreakAfter = true; - nOfst = static_cast<sal_Int32>(nRowCount + nMaxRowPerPage); - } - else - { - while( mnIndex < mpImpl->size() && - mpImpl->GetBreakIndex(mnIndex) < nNodeIndex) - ++mnIndex; - if( mnIndex < mpImpl->size() && - mpImpl->GetBreakIndex(mnIndex) == nNodeIndex ) - { - nType = mpImpl->GetBreakType( mnIndex ); - nOfst = mpImpl->GetBreakOfst( mnIndex++ ); - mbBreakAfter = true; - } } if( nOfst < COMPLETE_STRING ) { bool bSplit = false; sal_uInt16 nRepeat( 0 ); - if( !bLongTab && mrpFrame->IsTextFrame() && + if( mrpFrame->IsTextFrame() && SW_LAYCACHE_IO_REC_PARA == nType && nOfst < static_cast<SwTextFrame*>(mrpFrame)->GetText().getLength()) bSplit = true; else if( mrpFrame->IsTabFrame() && nRowCount < nOfst && - ( bLongTab || SW_LAYCACHE_IO_REC_TABLE == nType ) ) + ( SW_LAYCACHE_IO_REC_TABLE == nType ) ) { nRepeat = static_cast<SwTabFrame*>(mrpFrame)-> GetTable()->GetRowsToRepeat(); bSplit = nOfst < nRows && nRowCount + nRepeat < nOfst; - bLongTab = bLongTab && bSplit; } if( bSplit ) { @@ -891,7 +823,7 @@ bool SwLayHelper::CheckInsert( SwNodeOffset nNodeIndex ) } SwPageFrame* pLastPage = mrpPage; - if (CheckInsertPage(mrpPage, mrpLay, mrpFrame, mbBreakAfter, mnMaxParaPerPage < mnParagraphCnt)) + if (CheckInsertPage(mrpPage, mrpLay, mrpFrame, mbBreakAfter, false)) { CheckFlyCache_( pLastPage ); if( mrpPrv && mrpPrv->IsTextFrame() && !mrpPrv->isFrameAreaSizeValid() ) @@ -902,7 +834,6 @@ bool SwLayHelper::CheckInsert( SwNodeOffset nNodeIndex ) bRet = true; mrpPrv = nullptr; - mnParagraphCnt = 0; if ( mrpActualSection ) { @@ -941,8 +872,8 @@ bool SwLayHelper::CheckInsert( SwNodeOffset nNodeIndex ) mrpLay = mrpLay->GetNextLayoutLeaf(); } } - } while( bLongTab || ( mpImpl && mnIndex < mpImpl->size() && - mpImpl->GetBreakIndex( mnIndex ) == nNodeIndex ) ); + } while( mpImpl && mnIndex < mpImpl->size() && + mpImpl->GetBreakIndex( mnIndex ) == nNodeIndex ); } mbFirst = false; return bRet; diff --git a/sw/source/core/layout/layhelp.hxx b/sw/source/core/layout/layhelp.hxx index 1ac325cfac82..a53f3ca3de09 100644 --- a/sw/source/core/layout/layhelp.hxx +++ b/sw/source/core/layout/layhelp.hxx @@ -114,8 +114,6 @@ class SwLayHelper bool mbBreakAfter; SwDoc* mpDoc; SwLayCacheImpl* mpImpl; - sal_uLong mnMaxParaPerPage; - sal_uLong mnParagraphCnt; SwNodeOffset mnStartOfContent; size_t mnIndex; ///< the index in the page break array size_t mnFlyIdx; ///< the index in the fly cache array diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index efb471d6784c..34e04c4be3c7 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -1119,6 +1119,10 @@ bool SwTabFrame::Split(const SwTwips nCutPos, bool bTryToSplit, // and compare with the available height SwTwips nRemainingSpaceForLastRow = aRectFnSet.YDiff(nCutPos, aRectFnSet.GetPrtTop(*this)); nRemainingSpaceForLastRow -= aRectFnSet.GetBottomMargin(*this); + + if (nRemainingSpaceForLastRow <= 0) + return false; // upper has no space for this table at all + auto getRemainingAfter = [aRectFnSet, nAvailable = nRemainingSpaceForLastRow, nFirstRowTop = aRectFnSet.GetTop(pRow->getFrameArea())](SwFrame* p) { return nAvailable + (p ? aRectFnSet.BottomDist(p->getFrameArea(), nFirstRowTop) : 0); }; commit 85924aa516e0b0cd11858b0c279f3ca90a3398f7 Author: Andreas Heinisch <[email protected]> AuthorDate: Wed May 21 14:29:02 2025 +0200 Commit: Andras Timar <[email protected]> CommitDate: Thu Jun 12 12:38:31 2025 +0200 tdf#166349 - Reload recent documents to show pinned items After clearing the recent document list, reload the start center in order to show pinned items. Change-Id: I248d28aaf8f4f9a823aab7630e37e8a410848433 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185608 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <[email protected]> (cherry picked from commit f7e781292fc97b1d5e845c219c59bd01833da5ee) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185643 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sfx2/source/dialog/backingwindow.cxx b/sfx2/source/dialog/backingwindow.cxx index 08c0620158c0..aa99605cefc9 100644 --- a/sfx2/source/dialog/backingwindow.cxx +++ b/sfx2/source/dialog/backingwindow.cxx @@ -815,5 +815,7 @@ void BackingWindow::dispatchURL( const OUString& i_rURL, void BackingWindow::clearRecentFileList() { mxAllRecentThumbnails->Clear(); + // tdf#166349 - reload recent documents to show pinned items + mxAllRecentThumbnails->Reload(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab:*/ commit d6b625ee54ead03bff5d2befaa947ca5c6d283b6 Author: Caolán McNamara <[email protected]> AuthorDate: Fri Jun 6 21:09:44 2025 +0100 Commit: Andras Timar <[email protected]> CommitDate: Thu Jun 12 12:38:31 2025 +0200 Resolves: tdf#146256 Base toolbar customization page displays wrong scope Customization for Base "Standard" toolbar is stored in document when the scope of "Base" appears to be selected in the UI. A regression from: commit ccb2b0078f07194befa61f1e3fd88e53ff236871 CommitDate: Mon Mar 11 10:00:31 2019 +0100 weld SvxMenuConfigPage/SvxToolbarConfigPage Change-Id: I18966e34ccd79c6eecb6e1b4c216caaef453f501 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186232 Reviewed-by: Xisco Fauli <[email protected]> Tested-by: Jenkins diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index 3aaa07d6bb15..174830e8797f 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -1139,6 +1139,7 @@ void SvxConfigPage::Reset( const SfxItemSet* ) { OUString sId(weld::toId(pDocData)); m_xSaveInListBox->append(sId, aTitle); + nPos = m_xSaveInListBox->get_count() - 1; } } commit 8d877ac9ee790e1828468498670bc6a45896bd0d Author: Mike Kaganski <[email protected]> AuthorDate: Thu Jun 5 14:35:36 2025 +0500 Commit: Andras Timar <[email protected]> CommitDate: Thu Jun 12 12:38:31 2025 +0200 tdf#166862: fix reading data for CRC calculation Commit a6ad198d097fb4a503c8d5831d484ff46721134b made the size read from the grabber wrong for the last chunk: it wasn't decreased to the remaining size, but was still equal to nBlockSize. The grabber could read past the chunk, and the CRC was wrong. No idea why did that only hit this file - it seemed that any file larger than 32K and that was stored (i.e., any image) would trigger that path? Change-Id: I980dd701e54c4ed565173b5b90ed301bf9b5f719 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186241 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> (cherry picked from commit 9727cf785945218a4f06562f4edb657551d25436) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186280 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/package/qa/cppunit/data/tdf166862.odt b/package/qa/cppunit/data/tdf166862.odt new file mode 100644 index 000000000000..814bebe670d7 Binary files /dev/null and b/package/qa/cppunit/data/tdf166862.odt differ diff --git a/package/qa/cppunit/test_zippackage.cxx b/package/qa/cppunit/test_zippackage.cxx index f296802e4524..94b8c616400f 100644 --- a/package/qa/cppunit/test_zippackage.cxx +++ b/package/qa/cppunit/test_zippackage.cxx @@ -483,6 +483,24 @@ CPPUNIT_TEST_FIXTURE(ZipPackageTest, testDataDescriptorDirectory) CPPUNIT_ASSERT_EQUAL(sal_Int64(899), xStream->getPropertyValue(u"Size"_ustr).get<sal_Int64>()); } +CPPUNIT_TEST_FIXTURE(ZipPackageTest, testTdf166862) +{ + // This package is broken; but the actual issue was incorrect CRC calculation for an image + OUString aURL = m_directories.getURLFromSrc(u"/package/qa/cppunit/data/tdf166862.odt"); + uno::Sequence<uno::Any> args{ uno::Any(aURL), uno::Any(beans::NamedValue{ u"RepairPackage"_ustr, + uno::Any(true) }) }; + + auto xMgr = m_xContext->getServiceManager(); + + auto xZip(xMgr->createInstanceWithArgumentsAndContext(ZipPackage, args, m_xContext) + .queryThrow<container::XHierarchicalNameAccess>()); + static constexpr OUString picURL = u"Pictures/1000000000000596000000AE0BDDB537.jpg"_ustr; + CPPUNIT_ASSERT(xZip->hasByHierarchicalName(picURL)); + auto aPic = xZip->getByHierarchicalName(picURL).queryThrow<beans::XPropertySet>(); + // Before the fix, this was 0: the size was reset because of unmatched CRC + CPPUNIT_ASSERT_EQUAL(sal_Int64(43886), aPic->getPropertyValue(u"Size"_ustr).get<sal_Int64>()); +} + //CPPUNIT_TEST_SUITE_REGISTRATION(...); //CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx index 46c8ad11ee0d..934930e943a1 100644 --- a/package/source/zipapi/ZipFile.cxx +++ b/package/source/zipapi/ZipFile.cxx @@ -1939,12 +1939,13 @@ sal_Int32 ZipFile::getCRC( sal_Int64 nOffset, sal_Int64 nSize ) std::vector<sal_Int8> aBuffer(nBlockSize); aGrabber.seek( nOffset ); - sal_Int32 nRead; - for (sal_Int64 ind = 0; - (nRead = aGrabber.readBytes( aBuffer.data(), nBlockSize )) && ind * nBlockSize < nSize; - ++ind) + sal_Int64 nRead = 0; + while (nRead < nSize) { - aCRC.updateSegment(aBuffer.data(), nRead); + sal_Int64 nToRead = std::min(nSize - nRead, nBlockSize); + sal_Int64 nReadThisTime = aGrabber.readBytes(aBuffer.data(), nToRead); + aCRC.updateSegment(aBuffer.data(), nReadThisTime); + nRead += nReadThisTime; } return aCRC.getValue(); commit 58c14da497905ba490239f4d1b6d7ffca82ded95 Author: Mike Kaganski <[email protected]> AuthorDate: Wed Jun 4 08:17:25 2025 +0200 Commit: Andras Timar <[email protected]> CommitDate: Thu Jun 12 12:38:31 2025 +0200 Avoid reading out of bounds ScAccessibleCsvRuler::getTextRange was implemented using raw pointers and offsets; that would allow reading beyond the buffer end. Change-Id: I6acb696f540146b99953b272c2f70963d10f5b51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186161 Reviewed-by: Mike Kaganski <[email protected]> Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins (cherry picked from commit f393f38aac87da33df563f04cb5d035a067238ba) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186193 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx index 9852d4897e85..8280d9dcc51a 100644 --- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx +++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx @@ -431,7 +431,7 @@ OUString SAL_CALL ScAccessibleCsvRuler::getTextRange( sal_Int32 nStartIndex, sal SolarMutexGuard aGuard; ensureAlive(); ensureValidRange( nStartIndex, nEndIndex ); - return OUString( maBuffer.getStr() + nStartIndex, nEndIndex - nStartIndex ); + return OUString(std::u16string_view(maBuffer).substr(nStartIndex, nEndIndex - nStartIndex )); } TextSegment SAL_CALL ScAccessibleCsvRuler::getTextAtIndex( sal_Int32 nIndex, sal_Int16 nTextType ) @@ -664,7 +664,8 @@ void ScAccessibleCsvRuler::ensureValidRange( sal_Int32& rnStartIndex, sal_Int32& { if( rnStartIndex > rnEndIndex ) ::std::swap( rnStartIndex, rnEndIndex ); - if( (rnStartIndex < 0) || (rnEndIndex > implGetTextLength()) ) + if ((rnStartIndex < 0) || (rnStartIndex > maBuffer.getLength()) + || (rnEndIndex > implGetTextLength()) || (rnEndIndex > maBuffer.getLength())) throw IndexOutOfBoundsException(); } commit 5ac5888726c17ad119f53a30fdc57b3ec7459bbd Author: Mike Kaganski <[email protected]> AuthorDate: Sun Jun 1 13:31:55 2025 +0500 Commit: Andras Timar <[email protected]> CommitDate: Thu Jun 12 12:38:31 2025 +0200 tdf#166811: let CHILDREN_ON_DEMAND entries draw collapsed in vcl/win This broke after commit dad7593cf6bb91ecf95153e983723dd2cd03b469 (GetDontKnowNodeBmp is always empty, 2022-05-11), before which, the value of `ButtonValue::DontKnow` was never set to entries. Of course, if `GetDontKnowNodeBmp` had been implemented to return a value back then, the problem would show there, too. Change-Id: I13895fb83b8864adabdf4b66c81346c20d15c042 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186106 Reviewed-by: Mike Kaganski <[email protected]> Tested-by: Jenkins (cherry picked from commit 54802cdceb9ff3903b4be1b81638b75fdbfb21f4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186125 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/vcl/win/gdi/salnativewidgets-luna.cxx b/vcl/win/gdi/salnativewidgets-luna.cxx index d0aa805284b8..6fd613acfaf0 100644 --- a/vcl/win/gdi/salnativewidgets-luna.cxx +++ b/vcl/win/gdi/salnativewidgets-luna.cxx @@ -1390,6 +1390,7 @@ static bool ImplDrawNativeControl( HDC hDC, HTHEME hTheme, RECT rc, iState = GLPS_OPENED; break; case ButtonValue::Off: + case ButtonValue::DontKnow: // SvTLEntryFlags::CHILDREN_ON_DEMAND iState = GLPS_CLOSED; break; default: commit bc78f521d5601fa0374baac795d6cc6d92ca14a9 Author: Mike Kaganski <[email protected]> AuthorDate: Wed Jun 4 08:03:26 2025 +0200 Commit: Andras Timar <[email protected]> CommitDate: Thu Jun 12 12:38:31 2025 +0200 Fix a failed assertion Seen when interacting with CSV import dialog, and selecting fixed width: ucrtbased.dll!_wassert(const wchar_t * expression, const wchar_t * file_name, unsigned int line_number) Line 444 sclo.dll!rtl::OUStringBuffer::subView(long beginIndex, long count) Line 1671 sclo.dll!ScAccessibleCsvRuler::getText() Line 424 winaccessibility.dll!AccObject::SetValue(com::sun::star::uno::Any pAny) Line 379 winaccessibility.dll!AccObject::UpdateValue() Line 349 winaccessibility.dll!AccObject::UpdateAccessibleInfoFromUnoToMSAA() Line 759 winaccessibility.dll!AccObjectWinManager::InsertAccObj(com::sun::star::accessibility::XAccessible * pXAcc, com::sun::star::accessibility::XAccessible * pParentXAcc, HWND__ * pWnd) Line 683 winaccessibility.dll!AccEventListener::HandleChildChangedEvent(com::sun::star::uno::Any oldValue, com::sun::star::uno::Any newValue) Line 108 winaccessibility.dll!AccEventListener::notifyEvent(const com::sun::star::accessibility::AccessibleEventObject & aEvent) Line 63 winaccessibility.dll!AccContainerEventListener::notifyEvent(const com::sun::star::accessibility::AccessibleEventObject & aEvent) Line 94 comphelper.dll!comphelper::AccessibleEventNotifier::addEvent(const unsigned long _nClient, const com::sun::star::accessibility::AccessibleEventObject & _rEvent) Line 256 comphelper.dll!comphelper::OAccessibleComponentHelper::NotifyAccessibleEvent(const short _nEventId, const com::sun::star::uno::Any & _rOldValue, const com::sun::star::uno::Any & _rNewValue, long nIndexHint) Line 126 vcllo.dll!VCLXAccessibleComponent::ProcessWindowChildEvent(const VclWindowEvent & rVclWindowEvent) Line 155 vcllo.dll!VCLXAccessibleComponent::WindowChildEventListener(VclWindowEvent & rEvent) Line 114 vcllo.dll!VCLXAccessibleComponent::LinkStubWindowChildEventListener(void * instance, VclWindowEvent & data) Line 104 vcllo.dll!Link<VclWindowEvent &,void>::Call(VclWindowEvent & data) Line 105 vcllo.dll!vcl::Window::CallEventListeners(VclEventId nEvent, void * pData) Line 299 vcllo.dll!vcl::Window::ImplSetReallyVisible() Line 1329 vcllo.dll!vcl::Window::Show(bool bVisible, ShowFlags nFlags) Line 2338 vcllo.dll!SalInstanceWidget::show() Line 404 vcllo.dll!weld::CustomWidgetController::Show() Line 65 sclo.dll!ScCsvTableBox::InitControls() Line 118 sclo.dll!ScCsvTableBox::Refresh() Line 77 sclo.dll!ScCsvTableBox::SetFixedWidthMode() Line 104 scuilo.dll!ScImportAsciiDlg::RbSepFix() Line 882 scuilo.dll!ScImportAsciiDlg::RbSepFixHdl(weld::Toggleable & rButton) Line 891 scuilo.dll!ScImportAsciiDlg::LinkStubRbSepFixHdl(void * instance, weld::Toggleable & data) Line 887 vcllo.dll!Link<weld::Toggleable &,void>::Call(weld::Toggleable & data) Line 105 vcllo.dll!weld::Toggleable::signal_toggled() Line 1595 vcllo.dll!SalInstanceRadioButton::ToggleHdl(RadioButton & __formal) Line 3195 Change-Id: I168fb05d91d42ccde22fa718787c22089d54d2cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186159 Reviewed-by: Mike Kaganski <[email protected]> Tested-by: Jenkins (cherry picked from commit e8aec9a7c33b827be06bad5155b4d820924885c0) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186179 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx index af0fb44c256a..9852d4897e85 100644 --- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx +++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx @@ -421,7 +421,9 @@ OUString SAL_CALL ScAccessibleCsvRuler::getText() { SolarMutexGuard aGuard; ensureAlive(); - return OUString(maBuffer.subView( 0, implGetTextLength() )); + // OUStringBuffer.subView asserts on count being not more than available characters; + // better use u16string_view::substr, which allows count greater than available + return OUString(std::u16string_view(maBuffer).substr(0, implGetTextLength())); } OUString SAL_CALL ScAccessibleCsvRuler::getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) commit 2db4a4c51d419bd7f3a0200e9d8f24b3b8c7bc8b Author: Mike Kaganski <[email protected]> AuthorDate: Wed Jun 4 17:40:30 2025 +0500 Commit: Andras Timar <[email protected]> CommitDate: Thu Jun 12 12:38:31 2025 +0200 Related: tdf#166208 Drop bBeforeDetection It was intended to detect the first use of the text import dialog after introduction of the automatic encoding detection feature. But since the schema for SeparatorType property, which was used for the detection, defined it as non-nillable, the property has a value always, so the detection is impossible. It means that the detection code may be removed. The detection, if it worked, would prevent tdf#166208; it would select automatic encoding detection, and prevent the shift of the old selection by one. Change-Id: I1ba661476531987633e0ed0a100bf798aa01a9f6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186239 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> (cherry picked from commit 58dc72c6f29a3ad4cbea09803d6c568b96f80c08) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186245 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx index 05d3f6ac9c33..01ed46b0d90b 100644 --- a/sc/source/ui/dbgui/scuiasciiopt.cxx +++ b/sc/source/ui/dbgui/scuiasciiopt.cxx @@ -75,7 +75,6 @@ enum SeparatorType constexpr OUString CSVIO_MergeDelimiters = u"MergeDelimiters"_ustr; constexpr OUString CSVIO_Separators = u"Separators"_ustr; constexpr OUString CSVIO_TextSeparators = u"TextSeparators"_ustr; -constexpr OUString CSVIO_FixedWidth = u"FixedWidth"_ustr; constexpr OUString CSVIO_RemoveSpace = u"RemoveSpace"_ustr; constexpr OUString CSVIO_EvaluateFormulas = u"EvaluateFormulas"_ustr; constexpr OUString CSVIO_SeparatorType = u"SeparatorType"_ustr; @@ -161,14 +160,12 @@ static void lcl_LoadSeparators(ScImportAsciiCall eCall, OUString& rFieldSeparato bool& rMergeDelimiters, bool& rQuotedAsText, bool& rDetectSpecialNum, bool& rDetectScientificNum, SeparatorType& rSepType, sal_Int32& rFromRow, sal_Int32& rCharSet, sal_Int32& rLanguage, bool& rSkipEmptyCells, bool& rRemoveSpace, - bool& rEvaluateFormulas, bool& rBeforeDetection) + bool& rEvaluateFormulas) { ScLinkConfigItem aItem(lcl_GetConfigPath(eCall)); const Sequence<OUString> aNames = aItem.GetNodeNames({}); const Sequence<Any> aValues = aItem.GetProperties(aNames); - rBeforeDetection = true; - for (sal_Int32 i = 0; i < aNames.getLength(); ++i) { const OUString& name = aNames[i]; @@ -184,15 +181,7 @@ static void lcl_LoadSeparators(ScImportAsciiCall eCall, OUString& rFieldSeparato else if (name == CSVIO_TextSeparators) value >>= rTextSeparators; else if (name == CSVIO_SeparatorType) - { - rBeforeDetection = false; rSepType = static_cast<SeparatorType>(ScUnoHelpFunctions::GetInt16FromAny(value)); - } - else if (name == CSVIO_FixedWidth) - { - if (rBeforeDetection && ScUnoHelpFunctions::GetBoolFromAny(value)) - rSepType = SeparatorType::FIXED; - } else if (name == CSVIO_EvaluateFormulas) rEvaluateFormulas = ScUnoHelpFunctions::GetBoolFromAny(value); else if (name == CSVIO_FromRow) @@ -325,15 +314,13 @@ ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, std::u16string_view aD bool bEvaluateFormulas = (meCall != SC_IMPORTFILE); bool bSkipEmptyCells = true; bool bRemoveSpace = false; - bool bBeforeDetection = false; sal_Int32 nFromRow = 1; sal_Int32 nCharSet = -1; sal_Int32 nLanguage = 0; lcl_LoadSeparators ( meCall, sFieldSeparators, sTextSeparators, bMergeDelimiters, bQuotedFieldAsText, bDetectSpecialNum, bDetectScientificNum, eSepType, nFromRow, - nCharSet, nLanguage, bSkipEmptyCells, bRemoveSpace, bEvaluateFormulas, - bBeforeDetection); + nCharSet, nLanguage, bSkipEmptyCells, bRemoveSpace, bEvaluateFormulas); maFieldSeparators = sFieldSeparators; @@ -434,7 +421,7 @@ ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, std::u16string_view aD if (ePreselectUnicode != RTL_TEXTENCODING_DONTKNOW) mxLbCharSet->SelectTextEncoding( ePreselectUnicode ); - else if (nCharSet >= 0 && !bBeforeDetection) + else if (nCharSet >= 0) mxLbCharSet->set_active(nCharSet); else mxLbCharSet->SelectTextEncoding(RTL_TEXTENCODING_USER_DETECTED); commit c51ade10ddd8b422e7029c06816b93003cb7c19a Author: Mike Kaganski <[email protected]> AuthorDate: Wed Jun 4 14:40:18 2025 +0500 Commit: Andras Timar <[email protected]> CommitDate: Thu Jun 12 12:38:31 2025 +0200 Related: tdf#166208 Avoid C-style array and fixed index madness Here we deal with conditional length and set of elements in the two sequences (names, values). This required a complex logic to handle them; and all the changes required accurate synchronization both in the code, and with the schema. An example of a confusion from this is commit 19f3b72f34c487dc97d582712d21734a7e055fd5, which increased the size of the sequence returned from lcl_CreatePropertiesNames. Instead, use ConfigItem::GetNodeNames to get the defined names from schema. This unifies the code for all eCall cases, by only reading and writing those values that exist in the respective config node's schema. Change-Id: I90fdaa603bb12dc554a4c2947dd7f3415af31f24 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186236 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> (cherry picked from commit e8027d47d516e74b0631d99c584bc7bb301a3efb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186244 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx index b35cf24ba7fb..05d3f6ac9c33 100644 --- a/sc/source/ui/dbgui/scuiasciiopt.cxx +++ b/sc/source/ui/dbgui/scuiasciiopt.cxx @@ -38,6 +38,7 @@ #include <osl/diagnose.h> #include <vcl/svapp.hxx> #include <comphelper/lok.hxx> +#include <comphelper/sequence.hxx> #include <o3tl/string_view.hxx> #include <unicode/ucsdet.h> @@ -59,30 +60,6 @@ using namespace com::sun::star::uno; namespace { -// Defines - CSV Import Preserve Options -// For usage of index order see lcl_CreatePropertiesNames() below. -enum CSVImportOptionsIndex -{ - CSVIO_MergeDelimiters = 0, - CSVIO_Separators, - CSVIO_TextSeparators, - CSVIO_FixedWidth, - CSVIO_RemoveSpace, - CSVIO_EvaluateFormulas, - CSVIO_SeparatorType, - // Settings for *all* dialog invocations above. - // Settings not for SC_TEXTTOCOLUMNS below. - CSVIO_FromRow, - CSVIO_Text2ColSkipEmptyCells = CSVIO_FromRow, - CSVIO_CharSet, - CSVIO_QuotedAsText, - CSVIO_DetectSpecialNum, - CSVIO_DetectScientificNum, - CSVIO_Language, - // Plus one not for SC_IMPORTFILE. - CSVIO_PasteSkipEmptyCells -}; - enum SeparatorType { FIXED, @@ -95,33 +72,20 @@ enum SeparatorType // Config items for all three paths are defined in // officecfg/registry/schema/org/openoffice/Office/Calc.xcs // If not, options are neither loaded nor saved. -const ::std::vector<OUString> CSVImportOptionNames = -{ - u"MergeDelimiters"_ustr, - u"Separators"_ustr, - u"TextSeparators"_ustr, - u"FixedWidth"_ustr, - u"RemoveSpace"_ustr, - u"EvaluateFormulas"_ustr, - u"SeparatorType"_ustr, - u"FromRow"_ustr, - u"CharSet"_ustr, - u"QuotedFieldAsText"_ustr, - u"DetectSpecialNumbers"_ustr, - u"DetectScientificNumbers"_ustr, - u"Language"_ustr, - u"SkipEmptyCells"_ustr -}; -constexpr OUStringLiteral aSep_Path = u"Office.Calc/Dialogs/CSVImport"; -constexpr OUStringLiteral aSep_Path_Clpbrd = u"Office.Calc/Dialogs/ClipboardTextImport"; -constexpr OUStringLiteral aSep_Path_Text2Col = u"Office.Calc/Dialogs/TextToColumnsImport"; - -namespace { -CSVImportOptionsIndex getSkipEmptyCellsIndex( ScImportAsciiCall eCall ) -{ - return eCall == SC_TEXTTOCOLUMNS ? CSVIO_Text2ColSkipEmptyCells : CSVIO_PasteSkipEmptyCells; -} -} +constexpr OUString CSVIO_MergeDelimiters = u"MergeDelimiters"_ustr; +constexpr OUString CSVIO_Separators = u"Separators"_ustr; +constexpr OUString CSVIO_TextSeparators = u"TextSeparators"_ustr; +constexpr OUString CSVIO_FixedWidth = u"FixedWidth"_ustr; +constexpr OUString CSVIO_RemoveSpace = u"RemoveSpace"_ustr; +constexpr OUString CSVIO_EvaluateFormulas = u"EvaluateFormulas"_ustr; +constexpr OUString CSVIO_SeparatorType = u"SeparatorType"_ustr; +constexpr OUString CSVIO_FromRow = u"FromRow"_ustr; +constexpr OUString CSVIO_CharSet = u"CharSet"_ustr; +constexpr OUString CSVIO_QuotedAsText = u"QuotedFieldAsText"_ustr; +constexpr OUString CSVIO_DetectSpecialNum = u"DetectSpecialNumbers"_ustr; +constexpr OUString CSVIO_DetectScientificNum = u"DetectScientificNumbers"_ustr; +constexpr OUString CSVIO_Language = u"Language"_ustr; +constexpr OUString CSVIO_SkipEmptyCells = u"SkipEmptyCells"_ustr; static void lcl_FillCombo(weld::ComboBox& rCombo, std::u16string_view rList, sal_Unicode cSelect) { @@ -179,158 +143,115 @@ static sal_Unicode lcl_CharFromCombo(const weld::ComboBox& rCombo, std::u16strin return c; } -static void lcl_CreatePropertiesNames ( OUString& rSepPath, Sequence<OUString>& rNames, ScImportAsciiCall eCall ) +static OUString lcl_GetConfigPath(ScImportAsciiCall eCall) { - sal_Int32 nProperties = 0; - switch(eCall) { case SC_IMPORTFILE: - rSepPath = aSep_Path; - nProperties = 13; - break; + return u"Office.Calc/Dialogs/CSVImport"_ustr; case SC_PASTETEXT: - rSepPath = aSep_Path_Clpbrd; - nProperties = 14; - break; + return u"Office.Calc/Dialogs/ClipboardTextImport"_ustr; case SC_TEXTTOCOLUMNS: default: - rSepPath = aSep_Path_Text2Col; - nProperties = 8; - break; - } - rNames.realloc( nProperties ); - OUString* pNames = rNames.getArray(); - pNames[ CSVIO_MergeDelimiters ] = CSVImportOptionNames[ CSVIO_MergeDelimiters ]; - pNames[ CSVIO_Separators ] = CSVImportOptionNames[ CSVIO_Separators ]; - pNames[ CSVIO_TextSeparators ] = CSVImportOptionNames[ CSVIO_TextSeparators ]; - pNames[ CSVIO_FixedWidth ] = CSVImportOptionNames[ CSVIO_FixedWidth ]; - pNames[ CSVIO_RemoveSpace ] = CSVImportOptionNames[ CSVIO_RemoveSpace ]; - pNames[ CSVIO_EvaluateFormulas ] = CSVImportOptionNames[ CSVIO_EvaluateFormulas ]; - pNames[ CSVIO_SeparatorType ] = CSVImportOptionNames[ CSVIO_SeparatorType ]; - if (eCall != SC_TEXTTOCOLUMNS) - { - pNames[ CSVIO_FromRow ] = CSVImportOptionNames[ CSVIO_FromRow ]; - pNames[ CSVIO_CharSet ] = CSVImportOptionNames[ CSVIO_CharSet ]; - pNames[ CSVIO_QuotedAsText ] = CSVImportOptionNames[ CSVIO_QuotedAsText ]; - pNames[ CSVIO_DetectSpecialNum ] = CSVImportOptionNames[ CSVIO_DetectSpecialNum ]; - pNames[ CSVIO_DetectScientificNum ] = CSVImportOptionNames[ CSVIO_DetectScientificNum ]; - pNames[ CSVIO_Language ] = CSVImportOptionNames[ CSVIO_Language ]; - } - if (eCall != SC_IMPORTFILE) - { - const sal_Int32 nSkipEmptyCells = getSkipEmptyCellsIndex(eCall); - assert( nSkipEmptyCells < rNames.getLength()); - pNames[ nSkipEmptyCells ] = CSVImportOptionNames[ CSVIO_PasteSkipEmptyCells ]; + return u"Office.Calc/Dialogs/TextToColumnsImport"_ustr; } } -static void lcl_LoadSeparators( OUString& rFieldSeparators, OUString& rTextSeparators, +static void lcl_LoadSeparators(ScImportAsciiCall eCall, OUString& rFieldSeparators, OUString& rTextSeparators, bool& rMergeDelimiters, bool& rQuotedAsText, bool& rDetectSpecialNum, bool& rDetectScientificNum, SeparatorType& rSepType, sal_Int32& rFromRow, sal_Int32& rCharSet, sal_Int32& rLanguage, bool& rSkipEmptyCells, bool& rRemoveSpace, - bool& rEvaluateFormulas, ScImportAsciiCall eCall, bool& rBeforeDetection ) + bool& rEvaluateFormulas, bool& rBeforeDetection) { - Sequence<Any>aValues; - const Any *pProperties; - Sequence<OUString> aNames; - OUString aSepPath; - lcl_CreatePropertiesNames ( aSepPath, aNames, eCall); - ScLinkConfigItem aItem( aSepPath ); - aValues = aItem.GetProperties( aNames ); - pProperties = aValues.getConstArray(); - - if( pProperties[ CSVIO_MergeDelimiters ].hasValue() ) - rMergeDelimiters = ScUnoHelpFunctions::GetBoolFromAny( pProperties[ CSVIO_MergeDelimiters ] ); - - if( pProperties[ CSVIO_RemoveSpace ].hasValue() ) - rRemoveSpace = ScUnoHelpFunctions::GetBoolFromAny( pProperties[ CSVIO_RemoveSpace ] ); - - if( pProperties[ CSVIO_Separators ].hasValue() ) - pProperties[ CSVIO_Separators ] >>= rFieldSeparators; - - if( pProperties[ CSVIO_TextSeparators ].hasValue() ) - pProperties[ CSVIO_TextSeparators ] >>= rTextSeparators; + ScLinkConfigItem aItem(lcl_GetConfigPath(eCall)); + const Sequence<OUString> aNames = aItem.GetNodeNames({}); + const Sequence<Any> aValues = aItem.GetProperties(aNames); rBeforeDetection = true; - if( pProperties[ CSVIO_SeparatorType ].hasValue() ) - { - rBeforeDetection = false; - rSepType = static_cast<SeparatorType>(ScUnoHelpFunctions::GetInt16FromAny( pProperties[ CSVIO_SeparatorType ] )); - } - else if( pProperties[ CSVIO_FixedWidth ].hasValue() ) - rSepType = (ScUnoHelpFunctions::GetBoolFromAny( pProperties[ CSVIO_FixedWidth ] ) ? SeparatorType::FIXED : SeparatorType::DETECT_SEPARATOR); - - if( pProperties[ CSVIO_EvaluateFormulas ].hasValue() ) - rEvaluateFormulas = ScUnoHelpFunctions::GetBoolFromAny( pProperties[ CSVIO_EvaluateFormulas ] ); - - if (eCall != SC_TEXTTOCOLUMNS) - { - if( pProperties[ CSVIO_FromRow ].hasValue() ) - pProperties[ CSVIO_FromRow ] >>= rFromRow; - - if( pProperties[ CSVIO_CharSet ].hasValue() ) - pProperties[ CSVIO_CharSet ] >>= rCharSet; - - if ( pProperties[ CSVIO_QuotedAsText ].hasValue() ) - pProperties[ CSVIO_QuotedAsText ] >>= rQuotedAsText; - if ( pProperties[ CSVIO_DetectSpecialNum ].hasValue() ) - pProperties[ CSVIO_DetectSpecialNum ] >>= rDetectSpecialNum; - - if ( pProperties[ CSVIO_DetectScientificNum ].hasValue() ) - pProperties[ CSVIO_DetectScientificNum ] >>= rDetectScientificNum; - - if ( pProperties[ CSVIO_Language ].hasValue() ) - pProperties[ CSVIO_Language ] >>= rLanguage; - } - if (eCall != SC_IMPORTFILE) - { - const sal_Int32 nSkipEmptyCells = getSkipEmptyCellsIndex(eCall); - assert( nSkipEmptyCells < aValues.getLength()); - if ( pProperties[nSkipEmptyCells].hasValue() ) - rSkipEmptyCells = ScUnoHelpFunctions::GetBoolFromAny( pProperties[nSkipEmptyCells] ); - } -} - -static void lcl_SaveSeparators( + for (sal_Int32 i = 0; i < aNames.getLength(); ++i) + { + const OUString& name = aNames[i]; + const Any& value = aValues[i]; + if (!value.hasValue()) + continue; + if (name == CSVIO_MergeDelimiters) + rMergeDelimiters = ScUnoHelpFunctions::GetBoolFromAny(value); + else if (name == CSVIO_RemoveSpace) + rRemoveSpace = ScUnoHelpFunctions::GetBoolFromAny(value); + else if (name == CSVIO_Separators) + value >>= rFieldSeparators; + else if (name == CSVIO_TextSeparators) + value >>= rTextSeparators; + else if (name == CSVIO_SeparatorType) + { + rBeforeDetection = false; + rSepType = static_cast<SeparatorType>(ScUnoHelpFunctions::GetInt16FromAny(value)); + } + else if (name == CSVIO_FixedWidth) + { + if (rBeforeDetection && ScUnoHelpFunctions::GetBoolFromAny(value)) + rSepType = SeparatorType::FIXED; + } + else if (name == CSVIO_EvaluateFormulas) + rEvaluateFormulas = ScUnoHelpFunctions::GetBoolFromAny(value); + else if (name == CSVIO_FromRow) + value >>= rFromRow; + else if (name == CSVIO_CharSet) + value >>= rCharSet; + else if (name == CSVIO_QuotedAsText) + value >>= rQuotedAsText; + else if (name == CSVIO_DetectSpecialNum) + value >>= rDetectSpecialNum; + else if (name == CSVIO_DetectScientificNum) + value >>= rDetectScientificNum; + else if (name == CSVIO_Language) + value >>= rLanguage; + else if (name == CSVIO_SkipEmptyCells) + rSkipEmptyCells = ScUnoHelpFunctions::GetBoolFromAny(value); + } +} + +static void lcl_SaveSeparators(ScImportAsciiCall eCall, const OUString& sFieldSeparators, const OUString& sTextSeparators, bool bMergeDelimiters, bool bQuotedAsText, bool bDetectSpecialNum, bool bDetectScientificNum, SeparatorType rSepType, sal_Int32 nFromRow, - sal_Int32 nCharSet, sal_Int32 nLanguage, bool bSkipEmptyCells, bool bRemoveSpace, bool bEvaluateFormulas, - ScImportAsciiCall eCall ) -{ - Sequence<Any> aValues; - Any *pProperties; - Sequence<OUString> aNames; - OUString aSepPath; - lcl_CreatePropertiesNames ( aSepPath, aNames, eCall ); - ScLinkConfigItem aItem( aSepPath ); - aValues = aItem.GetProperties( aNames ); - pProperties = aValues.getArray(); - - pProperties[ CSVIO_MergeDelimiters ] <<= bMergeDelimiters; - pProperties[ CSVIO_RemoveSpace ] <<= bRemoveSpace; - pProperties[ CSVIO_Separators ] <<= sFieldSeparators; - pProperties[ CSVIO_TextSeparators ] <<= sTextSeparators; - pProperties[ CSVIO_EvaluateFormulas ] <<= bEvaluateFormulas; - pProperties[ CSVIO_SeparatorType ] <<= static_cast<sal_Int16>(rSepType); - if (eCall != SC_TEXTTOCOLUMNS) - { - pProperties[ CSVIO_FromRow ] <<= nFromRow; - pProperties[ CSVIO_CharSet ] <<= nCharSet; - pProperties[ CSVIO_QuotedAsText ] <<= bQuotedAsText; - pProperties[ CSVIO_DetectSpecialNum ] <<= bDetectSpecialNum; - pProperties[ CSVIO_DetectScientificNum ] <<= bDetectScientificNum; - pProperties[ CSVIO_Language ] <<= nLanguage; - } - if (eCall != SC_IMPORTFILE) - { - const sal_Int32 nSkipEmptyCells = getSkipEmptyCellsIndex(eCall); - assert( nSkipEmptyCells < aValues.getLength()); - pProperties[ nSkipEmptyCells ] <<= bSkipEmptyCells; - } - - aItem.PutProperties(aNames, aValues); + sal_Int32 nCharSet, sal_Int32 nLanguage, bool bSkipEmptyCells, bool bRemoveSpace, bool bEvaluateFormulas) +{ + ScLinkConfigItem aItem(lcl_GetConfigPath(eCall)); + std::unordered_map<OUString, Any> properties; + + for (const OUString& name : aItem.GetNodeNames({})) + { + if (name == CSVIO_MergeDelimiters) + properties[name] <<= bMergeDelimiters; + else if (name == CSVIO_RemoveSpace) + properties[name] <<= bRemoveSpace; + else if (name == CSVIO_Separators) + properties[name] <<= sFieldSeparators; + else if (name == CSVIO_TextSeparators) + properties[name] <<= sTextSeparators; + else if (name == CSVIO_EvaluateFormulas) + properties[name] <<= bEvaluateFormulas; + else if (name == CSVIO_SeparatorType) + properties[name] <<= static_cast<sal_Int16>(rSepType); + else if (name == CSVIO_FromRow) + properties[name] <<= nFromRow; + else if (name == CSVIO_CharSet) + properties[name] <<= nCharSet; + else if (name == CSVIO_QuotedAsText) + properties[name] <<= bQuotedAsText; + else if (name == CSVIO_DetectSpecialNum) + properties[name] <<= bDetectSpecialNum; + else if (name == CSVIO_DetectScientificNum) + properties[name] <<= bDetectScientificNum; + else if (name == CSVIO_Language) + properties[name] <<= nLanguage; + else if (name == CSVIO_SkipEmptyCells) + properties[name] <<= bSkipEmptyCells; + } + + aItem.PutProperties(comphelper::mapKeysToSequence(properties), + comphelper::mapValuesToSequence(properties)); } ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, std::u16string_view aDatName, @@ -409,9 +330,9 @@ ScImportAsciiDlg::ScImportAsciiDlg(weld::Window* pParent, std::u16string_view aD sal_Int32 nCharSet = -1; sal_Int32 nLanguage = 0; - lcl_LoadSeparators (sFieldSeparators, sTextSeparators, bMergeDelimiters, + lcl_LoadSeparators ( meCall, sFieldSeparators, sTextSeparators, bMergeDelimiters, bQuotedFieldAsText, bDetectSpecialNum, bDetectScientificNum, eSepType, nFromRow, - nCharSet, nLanguage, bSkipEmptyCells, bRemoveSpace, bEvaluateFormulas, meCall, + nCharSet, nLanguage, bSkipEmptyCells, bRemoveSpace, bEvaluateFormulas, bBeforeDetection); maFieldSeparators = sFieldSeparators; @@ -682,14 +603,14 @@ void ScImportAsciiDlg::GetOptions( ScAsciiOptions& rOpt ) void ScImportAsciiDlg::SaveParameters() { - lcl_SaveSeparators( GetSeparators(), mxCbTextSep->get_active_text(), mxCkbAsOnce->get_active(), + lcl_SaveSeparators(meCall, GetSeparators(), mxCbTextSep->get_active_text(), mxCkbAsOnce->get_active(), mxCkbQuotedAsText->get_active(), mxCkbDetectNumber->get_active(), mxCkbDetectScientificNumber->get_active(), mxRbFixed->get_active() ? FIXED : (mxRbDetectSep->get_active() ? DETECT_SEPARATOR : SEPARATOR), mxNfRow->get_value(), mxLbCharSet->get_active(), static_cast<sal_uInt16>(mxLbCustomLang->get_active_id()), mxCkbSkipEmptyCells->get_active(), mxCkbRemoveSpace->get_active(), - mxCkbEvaluateFormulas->get_active(), meCall ); + mxCkbEvaluateFormulas->get_active()); } void ScImportAsciiDlg::SetSeparators( sal_Unicode cSep ) commit be342d763a7273f9c644dca3b01d6abd8fef3d0b Author: Xisco Fauli <[email protected]> AuthorDate: Wed Jun 4 10:05:32 2025 +0200 Commit: Andras Timar <[email protected]> CommitDate: Thu Jun 12 12:38:31 2025 +0200 curl: upgrade to 8.14.1 Downloaded from https://curl.se/download/curl-8.14.1.tar.xz Change-Id: I1ca0df875c21de4ce713433beabb79ab9e6ae7ca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186176 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <[email protected]> diff --git a/download.lst b/download.lst index 1820a725f981..adf0632a2b41 100644 --- a/download.lst +++ b/download.lst @@ -80,8 +80,8 @@ CPPUNIT_TARBALL := cppunit-1.15.1.tar.gz # three static lines # so that git cherry-pick # will not run into conflicts -CURL_SHA256SUM := b3634cfc538c72c9c6ca794ef4c73d7fdbd171e8dee2db837d83a5e45231002a -CURL_TARBALL := curl-8.14.0.tar.xz +CURL_SHA256SUM := f4619a1e2474c4bbfedc88a7c2191209c8334b48fa1f4e53fd584cc12e9120dd +CURL_TARBALL := curl-8.14.1.tar.xz # three static lines # so that git cherry-pick # will not run into conflicts commit 8c8fda9cd930ec0f1281afa8bd368b0f03093fc8 Author: Xisco Fauli <[email protected]> AuthorDate: Wed Jun 4 09:45:48 2025 +0200 Commit: Andras Timar <[email protected]> CommitDate: Thu Jun 12 12:38:31 2025 +0200 python3: upgrade to 3.10.18 downloaded from https://www.python.org/ftp/python/3.10.18/Python-3.10.18.tar.xz Change-Id: I357030626861fcc078129868c39a11d4795c8363 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186165 Reviewed-by: Christian Lohmaier <[email protected]> Tested-by: Jenkins diff --git a/configure.ac b/configure.ac index 3bd4d65aa494..b76a3bb6c781 100644 --- a/configure.ac +++ b/configure.ac @@ -10505,7 +10505,7 @@ if test \( "$cross_compiling" = yes -a -z "$PYTHON_FOR_BUILD" \) -o "$enable_pyt SYSTEM_PYTHON= PYTHON_VERSION_MAJOR=3 PYTHON_VERSION_MINOR=10 - PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.17 + PYTHON_VERSION=${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}.18 if ! grep -q -i python.*${PYTHON_VERSION} ${SRC_ROOT}/download.lst; then AC_MSG_ERROR([PYTHON_VERSION ${PYTHON_VERSION} but no matching file in download.lst]) fi diff --git a/download.lst b/download.lst index e03e766cfb9e..1820a725f981 100644 --- a/download.lst +++ b/download.lst @@ -658,8 +658,8 @@ POSTGRESQL_TARBALL := postgresql-14.18.tar.bz2 # three static lines # so that git cherry-pick # will not run into conflicts -PYTHON_SHA256SUM := 4c68050f049d1b4ac5aadd0df5f27941c0350d2a9e7ab0907ee5eb5225d9d6b0 -PYTHON_TARBALL := Python-3.10.17.tar.xz +PYTHON_SHA256SUM := ae665bc678abd9ab6a6e1573d2481625a53719bc517e9a634ed2b9fefae3817f +PYTHON_TARBALL := Python-3.10.18.tar.xz # three static lines # so that git cherry-pick # will not run into conflicts commit 38a5705112491e2c6cbb044439d7052e27ceb51b Author: Michael Weghorn <[email protected]> AuthorDate: Tue Jun 3 12:01:12 2025 +0200 Commit: Andras Timar <[email protected]> CommitDate: Thu Jun 12 12:38:31 2025 +0200 basctl: Set menu item ID to fix gtk4 crash ConvertMenu in vcl/unx/gtk4/convert3to4.cxx assumes that each GtkMenuItem has an "id" attribute set. Therefore, set one here as well, to fix a crash seen for the following scenario in Writer with the gtk4 VCL plugin: * "Macros" -> "Organize Macros" -> "Basic" * right-click on entry in the "Existing Macros In: <module>" treeview Backtrace: 1 __pthread_kill_implementation pthread_kill.c 44 0x7ffff789e95c 2 __pthread_kill_internal pthread_kill.c 89 0x7ffff789e9ff 3 __GI_raise raise.c 26 0x7ffff7849cc2 4 __GI_abort abort.c 73 0x7ffff78324ac 5 __assert_fail_base assert.c 118 0x7ffff7832420 6 com::sun::star::uno::Reference<com::sun::star::xml::dom::XNode>::operator-> Reference.h 387 0x7fffe6263f7b 7 (anonymous namespace)::ConvertMenu convert3to4.cxx 239 0x7fffe625fda7 8 (anonymous namespace)::ConvertMenu convert3to4.cxx 221 0x7fffe625fb3a 9 (anonymous namespace)::Convert3To4 convert3to4.cxx 978 0x7fffe6256a15 10 (anonymous namespace)::Convert3To4 convert3to4.cxx 1010 0x7fffe625726f 11 builder_add_from_gtk3_file convert3to4.cxx 1578 0x7fffe624e6c2 12 (anonymous namespace)::load_ui_file gtkinst.cxx 23922 0x7fffe62a886d 13 (anonymous namespace)::GtkInstanceBuilder::GtkInstanceBuilder gtkinst.cxx 24338 0x7fffe62a852d 14 std::make_unique<(anonymous namespace)::GtkInstanceBuilder, _GtkWidget *&, rtl::OUString const&, rtl::OUString const&, decltype(nullptr), bool>(_GtkWidget *&, rtl::OUString const&, rtl::OUString const&, decltype(nullptr)&&, bool&&) unique_ptr.h 1077 0x7fffe629221a 15 GtkInstance::CreateBuilder gtkinst.cxx 25007 0x7fffe629211f 16 Application::CreateBuilder builder.cxx 206 0x7fffee20c881 17 basctl::MacroChooser::ContextMenuHdl macrodlg.cxx 788 0x7fff0d0a30b0 18 basctl::MacroChooser::LinkStubContextMenuHdl macrodlg.cxx 783 0x7fff0d09cbbd 19 Link<CommandEvent const&, bool>::Call link.hxx 105 0x7fffe6399886 20 (anonymous namespace)::GtkInstanceTreeView::signal_popup_menu gtkinst.cxx 14297 0x7fffe62e367b 21 (anonymous namespace)::GtkInstanceWidget::signal_button gtkinst.cxx 2957 0x7fffe62a1035 22 (anonymous namespace)::GtkInstanceWidget::signalButtonPress gtkinst.cxx 2931 0x7fffe62a0e7a [...] At least a simple `git grep GtkMenuItem | grep -v 'id='` doesn't reveal any other cases with the same problem. Change-Id: I9d67ff638ee59a6e57a96a2a3ec24095be31d6fa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186145 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins (cherry picked from commit 616a3177da38d3db342593149ab2a9a94799cfe8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186172 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/basctl/uiconfig/basicide/ui/sortmenu.ui b/basctl/uiconfig/basicide/ui/sortmenu.ui index bd40fcb8f123..22094bb26047 100644 --- a/basctl/uiconfig/basicide/ui/sortmenu.ui +++ b/basctl/uiconfig/basicide/ui/sortmenu.ui @@ -6,7 +6,7 @@ <property name="visible">True</property> <property name="can-focus">False</property> <child> - <object class="GtkMenuItem"> + <object class="GtkMenuItem" id="sortmenuitem"> <property name="visible">True</property> <property name="can-focus">False</property> <property name="label" translatable="yes" context="sortmenu|macrosort">_Sorting</property> commit bb289ad1dd53b2992e4ecbc7f1947d3a667eafbd Author: Michael Weghorn <[email protected]> AuthorDate: Mon Jun 2 17:37:59 2025 +0200 Commit: Andras Timar <[email protected]> CommitDate: Thu Jun 12 12:38:31 2025 +0200 [25-2 only] Use o3tl::cmp_less instead of std::cmp_less While o3tl::cmp_less was dropped for master in commit 8e0ffffe60f1e9c97d7937ffe7d206fb62900357 AuthorDate: Thu Oct 26 22:40:24 2023 +0200 CommitDate: Thu Apr 24 10:07:03 2025 +0200 Directly use std::cmp_*, drop o3tl::cmp_* , Android NDK 25 - the maximum NDK version supported on the libreoffice-25-2 branch - doesn't support std::cmp_less, so switch this use of std::cmp_less to o3tl::cmp_less on that branch only. Fixes this Android build error: .../editeng/source/editeng/impedit3.cxx:2427:44: error: no member named 'cmp_less' in namespace 'std'; did you mean 'o3tl::cmp_less'? while (aKashidaArray.size() > i && std::cmp_less(nGapSize, nEmRequiredSize)) ^~~~~~~~~~~~~ o3tl::cmp_less .../include/o3tl/intcmp.hxx:57:52: note: 'o3tl::cmp_less' declared here template <typename T1, typename T2> constexpr bool cmp_less(T1 value1, T2 value2) noexcept Change-Id: I02ca2e75c321ad981b78e2473a035915187877cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186135 Reviewed-by: Xisco Fauli <[email protected]> Tested-by: Jenkins diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 53786670e7cc..7f5cf45bffb2 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -75,6 +75,7 @@ #include <comphelper/lok.hxx> #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> +#include <o3tl/intcmp.hxx> #include <o3tl/safeint.hxx> #include <o3tl/sorted_vector.hxx> #include <osl/diagnose.h> commit 778015b8af80dc53f7b39ae3129b560513bbc4c7 Author: Michael Weghorn <[email protected]> AuthorDate: Fri Apr 11 17:19:20 2025 +0200 Commit: Andras Timar <[email protected]> CommitDate: Thu Jun 12 12:38:31 2025 +0200 qt: Consolidate to one toOUString helper Instead of having one for vcl in vcl/inc/qt5/QtTools.hxx and one in avmedia/source/qt6/QtFrameGrabber.cxx, move the existing implementation to include/vcl/qt/QtUtils.hxx and use it everywhere. Change-Id: I8576ab0fe2fd12bb25ae262e59acb8412ef8be0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184057 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> (cherry picked from commit d023035acf83ee1b61dfc03333bfc6e612bb58f6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186133 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/avmedia/source/qt6/QtFrameGrabber.cxx b/avmedia/source/qt6/QtFrameGrabber.cxx index a9cf99fadc7f..b82b02005d9a 100644 --- a/avmedia/source/qt6/QtFrameGrabber.cxx +++ b/avmedia/source/qt6/QtFrameGrabber.cxx @@ -14,6 +14,7 @@ #include <vcl/filter/PngImageReader.hxx> #include <vcl/graph.hxx> #include <vcl/image.hxx> +#include <vcl/qt/QtUtils.hxx> #include <vcl/scheduler.hxx> #include "QtFrameGrabber.hxx" @@ -23,11 +24,6 @@ using namespace ::com::sun::star; namespace { -inline OUString toOUString(const QString& s) -{ - return OUString(reinterpret_cast<const sal_Unicode*>(s.data()), s.length()); -} - uno::Reference<css::graphic::XGraphic> toXGraphic(const QImage& rImage) { QByteArray aData; diff --git a/include/vcl/qt/QtUtils.hxx b/include/vcl/qt/QtUtils.hxx index 87f21d96315c..3ab5f19f02cb 100644 --- a/include/vcl/qt/QtUtils.hxx +++ b/include/vcl/qt/QtUtils.hxx @@ -31,6 +31,12 @@ inline QString toQString(const OUString& rStr) return QString::fromUtf16(rStr.getStr(), rStr.getLength()); } +inline OUString toOUString(const QString& s) +{ + // QString stores UTF16, just like OUString + return OUString(reinterpret_cast<const sal_Unicode*>(s.data()), s.length()); +} + inline QPixmap toQPixmap(const BitmapEx& rBitmapEx) { SvMemoryStream aMemoryStream; diff --git a/vcl/inc/qt5/QtTools.hxx b/vcl/inc/qt5/QtTools.hxx index c1b2b75fff5f..b090ba3718c8 100644 --- a/vcl/inc/qt5/QtTools.hxx +++ b/vcl/inc/qt5/QtTools.hxx @@ -33,6 +33,7 @@ #include <tools/color.hxx> #include <tools/gen.hxx> #include <vcl/bitmap/BitmapTypes.hxx> +#include <vcl/qt/QtUtils.hxx> #include <vcl/vclenum.hxx> #include <com/sun/star/uno/Sequence.hxx> @@ -43,12 +44,6 @@ class Image; class QImage; -inline OUString toOUString(const QString& s) -{ - // QString stores UTF16, just like OUString - return OUString(reinterpret_cast<const sal_Unicode*>(s.data()), s.length()); -} - inline QRect toQRect(const tools::Rectangle& rRect) { return QRect(rRect.Left(), rRect.Top(), rRect.GetWidth(), rRect.GetHeight()); commit 4146934a220f5c84e9f1c5a94113978b9233168c Author: Mike Kaganski <[email protected]> AuthorDate: Sun Jun 1 16:06:42 2025 +0500 Commit: Andras Timar <[email protected]> CommitDate: Thu Jun 12 12:38:30 2025 +0200 tdf#166691: don't unhide sections temporarily to create their frames Commit 0c96119895b347f8eb5bb89f393351bd3c02b9f1 (tdf#159565 prerequisite: make hidden sections have zero-height frames, 2024-02-14) made hidden sections have frames. This removes the need to unhide them to get their frames, which happened in SwDocUpdateField::MakeFieldList_. Commit 6db63bb533a5c7436793eab86e83f92322b37044 (tdf#166210: invalidate parent's size when hiding section, 2025-04-28) started to invalidate the section frame's parent size on section hidden state change. This created a loop, where a calculation of the condition, that made a section hidden, caused the section to unhide then hide, invalidating parent frame; that caused repagination, and then another recalculation (because the number of pages may affect the conditions). This change drops the code in SwDocUpdateField::MakeFieldList_, that did the work to unhide then hide sections again, as obsolete. Change-Id: Ia144835548defaa38d53f03520ac0cc550bdfc23 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186108 Reviewed-by: Mike Kaganski <[email protected]> Tested-by: Jenkins (cherry picked from commit ca3e88728f29422ad9e4bd7f9bec08b59cdf4192) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186124 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sw/qa/extras/layout/data/table-with-hidden-section.fodt b/sw/qa/extras/layout/data/table-with-hidden-section.fodt new file mode 100644 index 000000000000..1360b872aef2 --- /dev/null +++ b/sw/qa/extras/layout/data/table-with-hidden-section.fodt @@ -0,0 +1,57 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:ooow="http://openoffice.org/2004/writer" office:version="1.4" office:mimetype="application/vnd.oasis.opendocument.text"> + <office:font-face-decls> + <style:font-face style:name="Liberation Serif" svg:font-family="'Liberation Serif'" style:font-family-generic="roman" style:font-pitch="variable"/> + </office:font-face-decls> + <office:styles> + <style:default-style style:family="paragraph"> + <style:paragraph-properties fo:orphans="2" fo:widows="2" style:text-autospace="ideograph-alpha" style:punctuation-wrap="hanging" style:line-break="strict" style:writing-mode="page"/> + <style:text-properties style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="zxx" fo:country="none" style:letter-kerning="true" fo:hyphenate="false"/> + </style:default-style> + <style:style style:name="Standard" style:family="paragraph" style:class="text"/> + </office:styles> + <office:automatic-styles> + <style:style style:name="Table1" style:family="table"> + <style:table-properties table:align="margins" style:may-break-between-rows="false"/> + </style:style> + <style:style style:name="Table1.1" style:family="table-row"> + <style:table-row-properties fo:keep-together="always"/> + </style:style> + <style:style style:name="Table1.A1" style:family="table-cell"> + <style:table-cell-properties fo:padding="1mm" fo:border="0.5pt solid #000000"/> + </style:style> + <style:page-layout style:name="pm1"> + <style:page-layout-properties fo:page-width="210mm" fo:page-height="297mm" style:print-orientation="portrait" fo:margin-top="2cm" fo:margin-bottom="2cm" fo:margin-left="2cm" fo:margin-right="2cm" style:writing-mode="lr-tb"/> + </style:page-layout> + </office:automatic-styles> + <office:master-styles> + <style:master-page style:name="Standard" style:page-layout-name="pm1"/> + </office:master-styles> + <office:body> + <office:text> + <text:user-field-decls> + <text:user-field-decl office:value-type="float" office:value="1" text:name="MyVariable"/> + </text:user-field-decls> + <text:p>User variable used in section's hide condition: <text:user-field-get style:data-style-name="N0" text:name="MyVariable">1</text:user-field-get></text:p> + <text:p>He heard quiet steps behind him. That didn't bode well. Who could be following him this late at night and in this deadbeat part of town? And at this particular moment, just after he pulled off the big time and was making off with the greenbacks. Was there another crook who'd had the same idea, and was now watching him and waiting for a chance to grab the fruit of his labour? Or did the steps behind him mean that one of many law officers in town was on to him and just waiting to pounce and snap those cuffs on his wrists? He nervously looked all around. Suddenly he saw the alley. Like lightning he darted off to the left and disappeared between the two warehouses almost falling over the bin lying in the middle of the pavement. He tried to nervously tap his way along in the inky darkness and suddenly stiffened: it was a dead-end, he would have to go back the way he had come. The steps got louder and louder, he saw the black outline of a figure coming around the corn er. Is this the end of the line? he thought pressing himself back against the wall trying to make himself invisible in the dark, was all that planning and energy wasted? He was dripping with sweat now, cold and wet, he could smell the fear coming off his clothes. Suddenly next to him, with a barely noticeable squeak, a door swung quietly to and fro in the night's breeze. Could this be the haven he'd prayed for? Slowly he slid toward the door, pressing himself more and more into the wall, into the dark, away from his enemy. Would this door save his hide?</text:p> + <table:table table:name="Table1" table:style-name="Table1"> + <table:table-column/> + <table:table-row table:style-name="Table1.1"> + <table:table-cell table:style-name="Table1.A1" office:value-type="string"> + <text:p>Some text in the cell above the hidden section. The total height of the single table cell, when the inner section is unhidden, is tall enough to not fit to the first page; and since the table rows aren't allowed to split across pages, the whole table would move to page 2. But with the section hidden, the cell is short enough to fit to the first page, and must appear there immediately below the dummy text.</text:p> + <text:section text:name="Section1" text:condition="ooow:MyVariable" text:is-hidden="true" text:display="condition"> + <text:p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum consequat mi quis pretium semper. Proin luctus orci ac neque venenatis, quis commodo dolor posuere. Curabitur dignissim sapien quis cursus egestas. Donec blandit auctor arcu, nec pellentesque eros molestie eget. In consectetur aliquam hendrerit. Sed cursus mauris vitae ligula pellentesque, non pellentesque urna aliquet. Fusce placerat mauris enim, nec rutrum purus semper vel. Praesent tincidunt neque eu pellentesque pharetra. Fusce pellentesque est orci.</text:p> + <text:p>Integer sodales tincidunt tristique. Sed a metus posuere, adipiscing nunc et, viverra odio. Donec auctor molestie sem, sit amet tristique lectus hendrerit sed. Cras sodales nisl sed orci mattis iaculis. Nunc eget dolor accumsan, pharetra risus a, vestibulum mauris. Nunc vulputate lobortis mollis. Vivamus nec tellus faucibus, tempor magna nec, facilisis felis. Donec commodo enim a vehicula pellentesque. Nullam vehicula vestibulum est vel ultricies.</text:p> + <text:p>Aliquam velit massa, laoreet vel leo nec, volutpat facilisis eros. Donec consequat arcu ut diam tempor luctus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Praesent vitae lacus vel leo sodales pharetra a a nibh. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nam luctus tempus nibh, fringilla dictum augue consectetur eget. Curabitur at ante sit amet tortor pharetra molestie eu nec ante. Mauris tincidunt, nibh eu sollicitudin molestie, dolor sapien congue tortor, a pulvinar sapien turpis sed ante. Donec nec est elementum, euismod nulla in, mollis nunc.</text:p> + </text:section> + <text:p>Some text in the cell below the hidden section.</text:p> + <text:p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum consequat mi quis pretium semper. Proin luctus orci ac neque venenatis, quis commodo dolor posuere. Curabitur dignissim sapien quis cursus egestas. Donec blandit auctor arcu, nec pellentesque eros molestie eget. In consectetur aliquam hendrerit. Sed cursus mauris vitae ligula pellentesque, non pellentesque urna aliquet. Fusce placerat mauris enim, nec rutrum purus semper vel. Praesent tincidunt neque eu pellentesque pharetra. Fusce pellentesque est orci.</text:p> + <text:p>Integer sodales tincidunt tristique. Sed a metus posuere, adipiscing nunc et, viverra odio. Donec auctor molestie sem, sit amet tristique lectus hendrerit sed. Cras sodales nisl sed orci mattis iaculis. Nunc eget dolor accumsan, pharetra risus a, vestibulum mauris. Nunc vulputate lobortis mollis. Vivamus nec tellus faucibus, tempor magna nec, facilisis felis. Donec commodo enim a vehicula pellentesque. Nullam vehicula vestibulum est vel ultricies.</text:p> + <text:p>Aliquam velit massa, laoreet vel leo nec, volutpat facilisis eros. Donec consequat arcu ut diam tempor luctus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Praesent vitae lacus vel leo sodales pharetra a a nibh. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nam luctus tempus nibh, fringilla dictum augue consectetur eget. Curabitur at ante sit amet tortor pharetra molestie eu nec ante. Mauris tincidunt, nibh eu sollicitudin molestie, dolor sapien congue tortor, a pulvinar sapien turpis sed ante. Donec nec est elementum, euismod nulla in, mollis nunc.</text:p> + </table:table-cell> + </table:table-row> + </table:table> + </office:text> + </office:body> +</office:document> \ No newline at end of file diff --git a/sw/qa/extras/layout/layout5.cxx b/sw/qa/extras/layout/layout5.cxx index 801800462704..91456defc00e 100644 --- a/sw/qa/extras/layout/layout5.cxx +++ b/sw/qa/extras/layout/layout5.cxx @@ -1728,6 +1728,18 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter5, testTdf165094) assertXPath(pXmlDoc, "//page[3]/body/tab", 1); } +CPPUNIT_TEST_FIXTURE(SwLayoutWriter5, testTdf166691) +{ + // Given a document with a table which disallows breaking across pages, and that has a cell + // with an inner section with hide condition (evaluated to true), such as to have the cell -e ... etc. - the rest is truncated
