connectivity/source/drivers/macab/MacabHeader.cxx | 12 connectivity/source/drivers/macab/MacabRecord.cxx | 18 connectivity/source/drivers/macab/MacabRecords.cxx | 20 connectivity/source/drivers/macab/MacabResultSet.cxx | 9 connectivity/source/drivers/macab/MacabResultSet.hxx | 1 download.lst | 16 editeng/source/rtf/rtfitem.cxx | 12 external/freetype/freetype-2.6.5.patch.1 | 4 external/freetype/ubsan.patch | 24 external/libxml2/9de92ed78d8495527c5d7a4d0cc76c1f83768195.patch.1 | 64 - external/libxml2/UnpackedTarball_libxml2.mk | 1 i18npool/CustomTarget_breakiterator.mk | 3 i18npool/qa/cppunit/test_breakiterator.cxx | 19 i18npool/source/breakiterator/data/line_cj.txt | 404 ++++++++++ i18npool/source/localedata/data/ja_JP.xml | 7 i18npool/source/localedata/data/zh_CN.xml | 7 i18npool/source/localedata/data/zh_TW.xml | 7 include/svtools/valueset.hxx | 3 include/svx/sidebar/LinePropertyPanelBase.hxx | 1 sd/source/ui/animations/SlideTransitionPane.cxx | 221 +++-- sd/source/ui/inc/SlideTransitionPane.hxx | 25 sd/uiconfig/simpress/ui/slidetransitionspanel.ui | 54 - sfx2/source/appl/shutdowniconaqua.mm | 50 - svgio/inc/svgstyleattributes.hxx | 12 svgio/qa/cppunit/SvgImportTest.cxx | 14 svgio/qa/cppunit/data/RTLtext.svg | 9 svgio/source/svgreader/svgcharacternode.cxx | 15 svgio/source/svgreader/svgstyleattributes.cxx | 35 svtools/source/control/valueset.cxx | 18 svx/source/sidebar/line/LinePropertyPanelBase.cxx | 7 sw/CppunitTest_sw_uiwriter11.mk | 18 sw/Module_sw.mk | 1 sw/inc/docsh.hxx | 3 sw/qa/extras/uiwriter/data/tdf167760_numberedPara.odt |binary sw/qa/extras/uiwriter/data/tdf168355.odt |binary sw/qa/extras/uiwriter/uiwriter11.cxx | 72 + sw/qa/extras/uiwriter/uiwriter9.cxx | 18 sw/source/core/docnode/section.cxx | 2 sw/source/core/layout/trvlfrm.cxx | 24 sw/source/core/unocore/unotext.cxx | 5 sw/source/uibase/app/docsh2.cxx | 5 sw/source/uibase/app/docst.cxx | 7 sw/source/uibase/shells/textfld.cxx | 25 sw/source/uibase/uiview/view2.cxx | 2 vcl/source/filter/GraphicFormatDetector.cxx | 24 vcl/source/filter/idxf/dxfgrprd.cxx | 2 46 files changed, 1012 insertions(+), 288 deletions(-)
New commits: commit 5cf985be07acd52aac620ecd038498ec3fc9b059 Author: Jonathan Clark <jonat...@libreoffice.org> AuthorDate: Tue Sep 16 14:21:34 2025 -0600 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Sep 19 10:18:43 2025 +0200 tdf#168424 editeng: Fix unsafe s/uint implicit cast in RTF parser The editeng RTF parser was round-tripping signed integers through a sal_uInt16 via implicit casts when populating SvxLRSpaceItem. This worked because such an implicit cast may convert signed numbers into their unsigned two's complement representation, and vice-versa. Unfortunately, a recent change to SvxLRSpaceItem replaced the final implicit uint-to-sint cast with an implicit uint-to-double one, which does not have the same properties. Change-Id: I80b1a36c47323309b33a8ddaee652c238a7530f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191052 Tested-by: Jenkins Reviewed-by: Jonathan Clark <jonat...@libreoffice.org> (cherry picked from commit c93d70db199cc7f89490cf9f34aa43ea67892c52) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191101 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/editeng/source/rtf/rtfitem.cxx b/editeng/source/rtf/rtfitem.cxx index 17aafa8a558e..b8c89be01029 100644 --- a/editeng/source/rtf/rtfitem.cxx +++ b/editeng/source/rtf/rtfitem.cxx @@ -318,12 +318,12 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) if (const TypedWhichId<SvxLRSpaceItem> wid = aPardMap[SID_ATTR_LRSPACE]) { SvxLRSpaceItem aLR(pSet->Get(wid)); - sal_uInt16 nSz = 0; + sal_Int16 nSz = 0; if( -1 != nTokenValue ) { if( IsCalcValue() ) CalcValue(); - nSz = sal_uInt16(nTokenValue); + nSz = sal_Int16(nTokenValue); } aLR.SetTextFirstLineOffset(SvxIndentValue::twips(nSz)); pSet->Put( aLR ); @@ -335,12 +335,12 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) if (const TypedWhichId<SvxLRSpaceItem> wid = aPardMap[SID_ATTR_LRSPACE]) { SvxLRSpaceItem aLR(pSet->Get(wid)); - sal_uInt16 nSz = 0; + sal_Int16 nSz = 0; if( 0 < nTokenValue ) { if( IsCalcValue() ) CalcValue(); - nSz = sal_uInt16(nTokenValue); + nSz = sal_Int16(nTokenValue); } aLR.SetTextLeft(SvxIndentValue::twips(nSz)); pSet->Put( aLR ); @@ -352,12 +352,12 @@ void SvxRTFParser::ReadAttr( int nToken, SfxItemSet* pSet ) if (const TypedWhichId<SvxLRSpaceItem> wid = aPardMap[SID_ATTR_LRSPACE]) { SvxLRSpaceItem aLR(pSet->Get(wid)); - sal_uInt16 nSz = 0; + sal_Int16 nSz = 0; if( 0 < nTokenValue ) { if( IsCalcValue() ) CalcValue(); - nSz = sal_uInt16(nTokenValue); + nSz = sal_Int16(nTokenValue); } aLR.SetRight(SvxIndentValue::twips(nSz)); pSet->Put( aLR ); commit 7508f862f14d6a0dc9929da601ef53fe6ec743f8 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Tue Sep 16 10:40:27 2025 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Sep 19 10:18:43 2025 +0200 tdf#168378: invert text anchor in RTL Change-Id: Ia9b7e526ab20cbcdb521f965a5a2dc0726894209 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191018 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191031 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> (cherry picked from commit 7de70bdfeb70075800535bdf173941ba8e5cdc38) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191097 diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index e738d8bb76e3..19295096b95c 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -2121,6 +2121,12 @@ CPPUNIT_TEST_FIXTURE(Test, testRTLtext) assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "text", u"داستان SVG 1.1 SE طولا ني است."); assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "rtl", u"true"); + + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "text", u"داستان SVG 1.2 SE طولا ني است."); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "rtl", u"true"); + + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[3]", "text", u"داستان SVG 1.3 SE طولا ني است."); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[3]", "rtl", u"true"); } CPPUNIT_TEST_FIXTURE(Test, testCssClassRedefinition) diff --git a/svgio/qa/cppunit/data/RTLtext.svg b/svgio/qa/cppunit/data/RTLtext.svg index f360fc559dc6..40dff70d904e 100644 --- a/svgio/qa/cppunit/data/RTLtext.svg +++ b/svgio/qa/cppunit/data/RTLtext.svg @@ -1,7 +1,9 @@ <svg - viewBox="0 0 600 72" + width="600 px" height="600 px" xmlns="http://www.w3.org/2000/svg" direction="rtl" font-family="DejaVu Sans"> - <text x="300" y="50" text-anchor="middle">داستان SVG 1.1 SE طولا ني است.</text> + <text x="300" y="50" text-anchor="start">داستان SVG 1.1 SE طولا ني است.</text> + <text x="300" y="100" text-anchor="middle">داستان SVG 1.2 SE طولا ني است.</text> + <text x="300" y="150" text-anchor="end">داستان SVG 1.3 SE طولا ني است.</text> </svg> diff --git a/svgio/source/svgreader/svgcharacternode.cxx b/svgio/source/svgreader/svgcharacternode.cxx index e0ef204c4452..4e7c8e4794c5 100644 --- a/svgio/source/svgreader/svgcharacternode.cxx +++ b/svgio/source/svgreader/svgcharacternode.cxx @@ -236,6 +236,8 @@ namespace svgio::svgreader // get TextAlign TextAlign aTextAlign(rSvgStyleAttributes.getTextAlign()); + bool bRTL(FontDirection::RTL == rSvgStyleAttributes.getFontDirection()); + // map TextAnchor to TextAlign, there seems not to be a difference if(TextAnchor::notset != rSvgStyleAttributes.getTextAnchor()) { @@ -243,7 +245,10 @@ namespace svgio::svgreader { case TextAnchor::start: { - aTextAlign = TextAlign::left; + if (bRTL) + aTextAlign = TextAlign::right; + else + aTextAlign = TextAlign::left; break; } case TextAnchor::middle: @@ -253,7 +258,10 @@ namespace svgio::svgreader } case TextAnchor::end: { - aTextAlign = TextAlign::right; + if (bRTL) + aTextAlign = TextAlign::left; + else + aTextAlign = TextAlign::right; break; } default: commit f604593269c4b075c1a851cef4a6052aa25b74d0 Author: Stephan Bergmann <stephan.bergm...@collabora.com> AuthorDate: Tue Sep 16 20:35:56 2025 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Sep 19 10:18:43 2025 +0200 external/freetype: Avoid signed-integer-overflow ...presumably after 981d8be918a7002ef4239244c8524dc73f0b5fd8 "freetype: upgrade to 2.14.1", causing e.g. CppunitTest_chart2_pivot_chart_test to fail with > workdir/UnpackedTarball/freetype/src/autofit/aflatin.c:3708:31: runtime error: signed integer overflow: 2161 - -9223372036854775808 cannot be represented in type 'FT_Pos' (aka 'long') > #0 in af_glyph_hints_apply_vertical_separation_adjustments at workdir/UnpackedTarball/freetype/src/autofit/aflatin.c:3708:31 > #1 in af_latin_hints_apply at workdir/UnpackedTarball/freetype/src/autofit/aflatin.c:5054:9 > #2 in af_loader_load_glyph at workdir/UnpackedTarball/freetype/src/autofit/afloader.c:411:17 > #3 in af_autofitter_load_glyph at workdir/UnpackedTarball/freetype/src/autofit/afmodule.c:498:13 > #4 in FT_Load_Glyph at workdir/UnpackedTarball/freetype/src/base/ftobjs.c:1055:19 > #5 at <null> (/lib64/libcairo.so.2 +0x9be4b) > #6 at <null> (/lib64/libcairo.so.2 +0xa0df1) > #7 at <null> (/lib64/libcairo.so.2 +0x528b6) > #8 at <null> (/lib64/libcairo.so.2 +0x57184) > #9 at <null> (/lib64/libcairo.so.2 +0x179f6) > #10 at <null> (/lib64/libcairo.so.2 +0x1a5f7) > #11 at <null> (/lib64/libcairo.so.2 +0x27459) > #12 at <null> (/lib64/libcairo.so.2 +0x701c8) > #13 at <null> (/lib64/libcairo.so.2 +0x22a8b) > #14 in cairo_show_glyphs at <null> (/lib64/libcairo.so.2 +0x78a7d) > #15 in CairoTextRender::ImplDrawTextLayout(_cairo*, Color const&, GenericSalLayout const&, CairoCommon*, bool) at vcl/unx/generic/gdi/cairotextrender.cxx:517:9 > #16 in CairoTextRender::DrawTextLayout(GenericSalLayout const&, SalGraphics const&) at vcl/unx/generic/gdi/cairotextrender.cxx:292:5 > #17 in SvpSalGraphics::DrawTextLayout(GenericSalLayout const&) at vcl/headless/svptext.cxx:74:23 > #18 in GenericSalLayout::DrawText(SalGraphics&) const at vcl/source/gdi/CommonSalLayout.cxx:314:18 > #19 in OutputDevice::ImplDrawTextDirect(SalLayout&, bool) at vcl/source/outdev/text.cxx:311:16 > #20 in OutputDevice::ImplDrawText(SalLayout&) at vcl/source/outdev/text.cxx:464:9 > #21 in OutputDevice::DrawTextArray(Point const&, rtl::OUString const&, std::span<double const, 18446744073709551615ul>, std::span<unsigned char const, 18446744073709551615ul>, int, int, SalLayoutFlags, SalLayoutGlyphs const*) at vcl/source/outdev/text.cxx:750:9 > #22 in ScOutputData::LayoutStringsImpl(bool, RowInfo*, short, int, unsigned long, std::optional<short>&, std::optional<short>&, short, std::__debug::vector<std::unique_ptr<ScPatternAttr, std::default_delete<ScPatternAttr>>, std::allocator<std::unique_ptr<ScPatternAttr, std::default_delete<ScPatternAttr>>>>&, ScPatternAttr const*&, SfxItemSet const*&, SvtScriptType&, ScDrawStringsVars&, bool&, long, long, bool, bool&, vcl::PDFExtOutDevData*, long, std::__debug::vector<double, std::allocator<double>>&) at sc/source/ui/view/output2.cxx:2248:28 > #23 in ScOutputData::LayoutStrings(bool) at sc/source/ui/view/output2.cxx:1565:17 > #24 in ScOutputData::DrawStrings(bool) at sc/source/ui/view/output2.cxx:1487:5 > #25 in ScPrintFunc::DrawToDev(ScDocument&, OutputDevice*, double, tools::Rectangle const&, ScViewData&, bool) at sc/source/ui/view/printfun.cxx:604:17 > #26 in ScDocShell::Draw(OutputDevice*, JobSetup const&, unsigned short, bool) at sc/source/ui/docshell/docsh4.cxx:2656:9 > #27 in SfxObjectShell::DoDraw_Impl(OutputDevice*, Point const&, Fraction const&, Fraction const&, JobSetup const&, unsigned short, bool) at sfx2/source/doc/objembed.cxx:204:5 > #28 in SfxObjectShell::DoDraw(OutputDevice*, Point const&, Size const&, JobSetup const&, unsigned short, bool) at sfx2/source/doc/objembed.cxx:151:9 > #29 in SfxObjectShell::CreatePreview_Impl(bool, bool, VirtualDevice*, GDIMetaFile*) const at sfx2/source/doc/objcont.cxx:201:40 > #30 in SfxObjectShell::GetPreviewBitmap() const at sfx2/source/doc/objcont.cxx:113:9 > #31 in SfxObjectShell::WriteThumbnail(bool, com::sun::star::uno::Reference<com::sun::star::io::XStream> const&) at sfx2/source/doc/objstor.cxx:4157:29 > #32 in SfxObjectShell::GenerateAndStoreThumbnail(bool, com::sun::star::uno::Reference<com::sun::star::embed::XStorage> const&) at sfx2/source/doc/objstor.cxx:4112:33 > #33 in SfxObjectShell::SaveTo_Impl(SfxMedium&, SfxItemSet const*) at sfx2/source/doc/objstor.cxx:1839:19 > #34 in SfxObjectShell::PreDoSaveAs_Impl(rtl::OUString const&, rtl::OUString const&, SfxItemSet const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/objstor.cxx:3421:39 > #35 in SfxObjectShell::CommonSaveAs_Impl(INetURLObject const&, rtl::OUString const&, SfxItemSet&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/objstor.cxx:3212:9 > #36 in SfxObjectShell::APISaveAs_Impl(std::basic_string_view<char16_t, std::char_traits<char16_t>>, SfxItemSet&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/objserv.cxx:323:19 > #37 in SfxBaseModel::impl_store(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, bool) at sfx2/source/doc/sfxbasemodel.cxx:3253:42 > #38 in SfxBaseModel::storeToURL(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at sfx2/source/doc/sfxbasemodel.cxx:1834:13 > #39 in UnoApiTest::saveWithParams(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) at test/source/unoapi_test.cxx:194:16 > #40 in UnoApiTest::save(rtl::OUString const&, char const*) at test/source/unoapi_test.cxx:178:5 > #41 in UnoApiTest::saveAndReload(rtl::OUString const&, char const*) at test/source/unoapi_test.cxx:199:5 > #42 in PivotChartTest::testRoundtrip() at chart2/qa/extras/PivotChartTest.cxx:354:5 Change-Id: I6bb42532fce1291b4208108ab1898b94dda02e68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191043 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergm...@collabora.com> (cherry picked from commit a8133d29ce58ab775319e837477c649489182d6d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191064 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit fb9337d51a3988f9b09aaca567b205a6917b9b4e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191096 diff --git a/external/freetype/ubsan.patch b/external/freetype/ubsan.patch index e915bedf7a46..f7099f110eec 100644 --- a/external/freetype/ubsan.patch +++ b/external/freetype/ubsan.patch @@ -1,3 +1,19 @@ +--- src/autofit/aflatin.c ++++ src/autofit/aflatin.c +@@ -3705,11 +3705,13 @@ + /* We also check that the y minimum of the 'other' contour */ + /* is below the high contour to avoid potential false hits */ + /* with contours enclosed in the high one. */ ++ if (max_y != FT_LONG_MIN) { + distance = high_min_y - max_y; + if ( distance < 64 && + distance < min_distance && + min_y < high_min_y ) + min_distance = distance; ++ } + } + + adjustment_amount = 64 - min_distance; --- src/truetype/ttgxvar.c +++ src/truetype/ttgxvar.c @@ -1217,7 +1217,7 @@ commit f2c60dcfabf014b003bbae700fb7656d87ed62a8 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Mon Sep 15 16:53:37 2025 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Sep 19 10:18:42 2025 +0200 tdf#168421: support RTL text direction in svg Change-Id: Iba8853d131bf88be3cc94003a73ffe545cf62004 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190978 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit 4efae74abc8e7cefe2d7d0c3c55653dc269b8727) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/191005 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/svgio/inc/svgstyleattributes.hxx b/svgio/inc/svgstyleattributes.hxx index 9a9eccb55105..52c08d2ad4c6 100644 --- a/svgio/inc/svgstyleattributes.hxx +++ b/svgio/inc/svgstyleattributes.hxx @@ -115,6 +115,13 @@ namespace svgio::svgreader lighter, }; + enum class FontDirection + { + notset, + LTR, + RTL, + }; + FontWeight getBolder(FontWeight aSource); FontWeight getLighter(FontWeight aSource); ::FontWeight getVclFontWeight(FontWeight aSource); @@ -209,6 +216,7 @@ namespace svgio::svgreader FontStretch maFontStretch; FontStyle maFontStyle; FontWeight maFontWeight; + FontDirection maFontDirection; TextAlign maTextAlign; TextDecoration maTextDecoration; TextAnchor maTextAnchor; @@ -416,6 +424,10 @@ namespace svgio::svgreader FontWeight getFontWeight() const; void setFontWeight(const FontWeight aFontWeight) { maFontWeight = aFontWeight; } + /// FontDirection content + FontDirection getFontDirection() const; + void setFontDirection(const FontDirection aFontDirection) { maFontDirection = aFontDirection; } + /// TextAlign content TextAlign getTextAlign() const; void setTextAlign(const TextAlign aTextAlign) { maTextAlign = aTextAlign; } diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index 70be705d4545..e738d8bb76e3 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -2115,6 +2115,14 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf149880) "/primitive2D/transform/mask/unhandled/mask/transform/transform/bitmap", 28); } +CPPUNIT_TEST_FIXTURE(Test, testRTLtext) +{ + xmlDocUniquePtr pDocument = dumpAndParseSvg(u"/svgio/qa/cppunit/data/RTLtext.svg"); + + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "text", u"داستان SVG 1.1 SE طولا ني است."); + assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "rtl", u"true"); +} + CPPUNIT_TEST_FIXTURE(Test, testCssClassRedefinition) { // Tests for svg css class redefinition behavior diff --git a/svgio/qa/cppunit/data/RTLtext.svg b/svgio/qa/cppunit/data/RTLtext.svg new file mode 100644 index 000000000000..f360fc559dc6 --- /dev/null +++ b/svgio/qa/cppunit/data/RTLtext.svg @@ -0,0 +1,7 @@ +<svg + viewBox="0 0 600 72" + xmlns="http://www.w3.org/2000/svg" + direction="rtl" + font-family="DejaVu Sans"> + <text x="300" y="50" text-anchor="middle">داستان SVG 1.1 SE طولا ني است.</text> +</svg> diff --git a/svgio/source/svgreader/svgcharacternode.cxx b/svgio/source/svgreader/svgcharacternode.cxx index ca1f91ebb99a..e0ef204c4452 100644 --- a/svgio/source/svgreader/svgcharacternode.cxx +++ b/svgio/source/svgreader/svgcharacternode.cxx @@ -118,6 +118,7 @@ namespace svgio::svgreader const ::FontWeight nFontWeight(getVclFontWeight(rSvgStyleAttributes.getFontWeight())); bool bItalic(FontStyle::italic == rSvgStyleAttributes.getFontStyle() || FontStyle::oblique == rSvgStyleAttributes.getFontStyle()); + bool bRTL(FontDirection::RTL == rSvgStyleAttributes.getFontDirection()); return drawinglayer::attribute::FontAttribute( aFontFamily, @@ -128,7 +129,7 @@ namespace svgio::svgreader bItalic, false/*bMonospaced*/, false/*bOutline*/, - false/*bRTL*/, + bRTL, false/*bBiDiStrong*/); } diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx index 219c0a20161e..6a9a20b56386 100644 --- a/svgio/source/svgreader/svgstyleattributes.cxx +++ b/svgio/source/svgreader/svgstyleattributes.cxx @@ -1391,6 +1391,7 @@ namespace svgio::svgreader maFontStretch(FontStretch::notset), maFontStyle(FontStyle::notset), maFontWeight(FontWeight::notset), + maFontDirection(FontDirection::notset), maTextAlign(TextAlign::notset), maTextDecoration(TextDecoration::notset), maTextAnchor(TextAnchor::notset), @@ -1401,7 +1402,7 @@ namespace svgio::svgreader maBaselineShift(BaselineShift::Baseline), maBaselineShiftNumber(0), maDominantBaseline(DominantBaseline::Auto), - maResolvingParent(34, 0), + maResolvingParent(35, 0), mbStrokeDasharraySet(false), mbUseFillFromContextFill(false), mbUseFillFromContextStroke(false), @@ -1840,6 +1841,17 @@ namespace svgio::svgreader } case SVGToken::Direction: { + if(!aContent.isEmpty()) + { + if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"ltr")) + { + setFontDirection(FontDirection::LTR); + } + else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"rtl")) + { + setFontDirection(FontDirection::RTL); + } + } break; } case SVGToken::LetterSpacing: @@ -2936,6 +2948,27 @@ namespace svgio::svgreader return FontWeight::N400; } + FontDirection SvgStyleAttributes::getFontDirection() const + { + if(maFontDirection != FontDirection::notset) + { + return maFontDirection; + } + + const SvgStyleAttributes* pSvgStyleAttributes = getCssStyleOrParentStyle(); + if (pSvgStyleAttributes && maResolvingParent[34] < nStyleDepthLimit) + { + ++maResolvingParent[34]; + auto ret = pSvgStyleAttributes->getFontDirection(); + --maResolvingParent[34]; + + return ret; + } + + // default is LTR + return FontDirection::LTR; + } + TextAlign SvgStyleAttributes::getTextAlign() const { if(maTextAlign != TextAlign::notset) commit 9494e8563f52027d73a50db4c233a6439723c2a7 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Thu Sep 11 20:26:03 2025 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Sep 19 10:18:42 2025 +0200 freetype: upgrade to 2.14.1 Downloaded from https://sourceforge.net/projects/freetype/files/freetype2/2.14.1/freetype-2.14.1.tar.xz/download Change-Id: I278d52399dbfe1e0895e481417dda493d35aeefa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190826 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Tested-by: Jenkins (cherry picked from commit 981d8be918a7002ef4239244c8524dc73f0b5fd8) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190838 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/download.lst b/download.lst index 2dec988a1e26..7e056602f9b8 100644 --- a/download.lst +++ b/download.lst @@ -370,8 +370,8 @@ FREEHAND_TARBALL := libfreehand-0.1.2.tar.xz # three static lines # so that git cherry-pick # will not run into conflicts -FREETYPE_SHA256SUM := f8dfa8f15ef0576738dfb55b2e6e6b172fd5d09b6f03785a1df03239549f64d2 -FREETYPE_TARBALL := freetype-2.14.0.tar.xz +FREETYPE_SHA256SUM := 32427e8c471ac095853212a37aef816c60b42052d4d9e48230bab3bdf2936ccc +FREETYPE_TARBALL := freetype-2.14.1.tar.xz # three static lines # so that git cherry-pick # will not run into conflicts commit 5724c52964f5182de0056c56212fb7dddfa4030b Author: Jonathan Clark <jonat...@libreoffice.org> AuthorDate: Fri Sep 12 14:28:30 2025 -0600 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Sep 19 10:18:42 2025 +0200 tdf#167873 i18npool: Port CJ brkitr customizations from ICU upstream Upstream ICU includes non-standard rule extensions for Chinese and Japanese, which add line breaking opportunities between U+201C/U+201D double quotation marks and leading/trailing CJK ideographs. This change backports those rule customizations, for correct layout of Simplified Chinese. Regression from: commit 5a03d511f46ecc05aab35bb29e714b46f5638b1b Author: Jonathan Clark <jonat...@libreoffice.org> Date: Mon Apr 7 21:37:26 2025 -0600 tdf#130592 i18npool: Fix incorrect line breaking in mixed CJK+Latin Change-Id: I3cf6c0cd23e38f9a89c98fdd6c6f665f175b676c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190904 Tested-by: Jenkins Reviewed-by: Jonathan Clark <jonat...@libreoffice.org> (cherry picked from commit 01c934f7bc6ecc18d7efcbcfb1f58f05ebda3bef) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190947 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit 6c35c61ff2e1ae0b238fbf578aff1188ba18dbf4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190956 diff --git a/i18npool/CustomTarget_breakiterator.mk b/i18npool/CustomTarget_breakiterator.mk index 095672878f3d..b5389b418888 100644 --- a/i18npool/CustomTarget_breakiterator.mk +++ b/i18npool/CustomTarget_breakiterator.mk @@ -21,7 +21,8 @@ i18npool_BRKTXTS := \ dict_word.brk \ $(call gb_Helper_optional_locale,hu,edit_word_hu.brk) \ edit_word.brk \ - line.brk + line.brk \ + line_cj.brk # 'gencmn', 'genbrk' and 'genccode' are tools generated and delivered by icu project to process icu breakiterator rules. # The output of gencmn generates warnings under Windows. We want to minimize the patches to external tools, diff --git a/i18npool/qa/cppunit/test_breakiterator.cxx b/i18npool/qa/cppunit/test_breakiterator.cxx index 9e18958762cb..658481bd4381 100644 --- a/i18npool/qa/cppunit/test_breakiterator.cxx +++ b/i18npool/qa/cppunit/test_breakiterator.cxx @@ -1730,6 +1730,25 @@ void TestBreakIterator::testChinese() auto stBreak4 = m_xBreak->getLineBreak(aTest, 4, stLocale, 0, stHyphOptions, stUserOptions); CPPUNIT_ASSERT_EQUAL(sal_Int32(4), stBreak4.breakIndex); } + + // tdf#167873: Simplified Chinese allows European-style quotation marks. The iterator + // must create break opportunities between U+201C and U+201D quotation marks and a + // trailing CJK ideograph. + { + i18n::LineBreakHyphenationOptions stHyphOptions; + i18n::LineBreakUserOptions stUserOptions; + + auto aTest = u"例例\u201C例例例例\u201D例例"_ustr; + + // Break opportunities should be outside of the quotation marks. + // U+201C is a left quotation mark, so the break opportunity should be to the left: + auto stBreak1 = m_xBreak->getLineBreak(aTest, 3, stLocale, 0, stHyphOptions, stUserOptions); + CPPUNIT_ASSERT_EQUAL(sal_Int32(2), stBreak1.breakIndex); + + // U+201D is a right quotation mark, so the break opportunity should be to the right: + auto stBreak2 = m_xBreak->getLineBreak(aTest, 8, stLocale, 0, stHyphOptions, stUserOptions); + CPPUNIT_ASSERT_EQUAL(sal_Int32(8), stBreak2.breakIndex); + } } void TestBreakIterator::testKorean() diff --git a/i18npool/source/breakiterator/data/line_cj.txt b/i18npool/source/breakiterator/data/line_cj.txt new file mode 100644 index 000000000000..8b42832edeba --- /dev/null +++ b/i18npool/source/breakiterator/data/line_cj.txt @@ -0,0 +1,404 @@ +# Copyright (C) 2016 and later: Unicode, Inc. and others. +# License & terms of use: http://www.unicode.org/copyright.html +# Copyright (c) 2002-2016 International Business Machines Corporation and +# others. All Rights Reserved. +# +# file: line.txt +# +# Line Breaking Rules +# Implement default line breaking as defined by +# Unicode Standard Annex #14 (https://www.unicode.org/reports/tr14/) +# for Unicode 14.0, with the following modification: +# +# Boundaries between hyphens and following letters are suppressed when +# there is a boundary preceding the hyphen. See rule 20.9 +# +# This corresponds to CSS line-break=strict (BCP47 -u-lb-strict). +# It sets characters of class CJ to behave like NS. +# It allows breaking before 201C and after 201D, for zh_Hans, zh_Hant, and ja. + +# +# Character Classes defined by TR 14. +# + +### BEGIN CUSTOMIZATION +### This file contains LibreOffice-specific rule customizations. +### +### To aid future maintainability: +### - The change location should be bracketed by comments of this form. +### - The original rule should be commented out, and the modified rule placed alongside. +### - By doing this, maintainers can more easily compare to an upstream baseline. +### +### END CUSTOMIZATION + +!!chain; +!!quoted_literals_only; + +$AI = [:LineBreak = Ambiguous:]; +$AL = [:LineBreak = Alphabetic:]; +$BA = [:LineBreak = Break_After:]; +$HH = [\u2010]; # \u2010 is HYPHEN, default line break is BA. +$BB = [:LineBreak = Break_Before:]; +$BK = [:LineBreak = Mandatory_Break:]; +$B2 = [:LineBreak = Break_Both:]; +$CB = [:LineBreak = Contingent_Break:]; +$CJ = [:LineBreak = Conditional_Japanese_Starter:]; +$CL = [[:LineBreak = Close_Punctuation:] \u201d]; +# $CM = [:LineBreak = Combining_Mark:]; +$CP = [:LineBreak = Close_Parenthesis:]; +$CR = [:LineBreak = Carriage_Return:]; +$EB = [:LineBreak = EB:]; +$EM = [:LineBreak = EM:]; +$EX = [:LineBreak = Exclamation:]; +$GL = [:LineBreak = Glue:]; +$HL = [:LineBreak = Hebrew_Letter:]; +$HY = [:LineBreak = Hyphen:]; +$H2 = [:LineBreak = H2:]; +$H3 = [:LineBreak = H3:]; +$ID = [:LineBreak = Ideographic:]; +$IN = [:LineBreak = Inseparable:]; +$IS = [:LineBreak = Infix_Numeric:]; +$JL = [:LineBreak = JL:]; +$JV = [:LineBreak = JV:]; +$JT = [:LineBreak = JT:]; +$LF = [:LineBreak = Line_Feed:]; +$NL = [:LineBreak = Next_Line:]; +# NS includes CJ for CSS strict line breaking. +$NS = [[:LineBreak = Nonstarter:] $CJ]; +$NU = [:LineBreak = Numeric:]; +$OP = [[:LineBreak = Open_Punctuation:] \u201c]; +$PO = [:LineBreak = Postfix_Numeric:]; +$PR = [:LineBreak = Prefix_Numeric:]; +$QU = [[:LineBreak = Quotation:] - [\u201c\u201d]]; +$RI = [:LineBreak = Regional_Indicator:]; +$SA = [:LineBreak = Complex_Context:]; +$SG = [:LineBreak = Surrogate:]; +$SP = [:LineBreak = Space:]; +$SY = [:LineBreak = Break_Symbols:]; +$WJ = [:LineBreak = Word_Joiner:]; +$XX = [:LineBreak = Unknown:]; +$ZW = [:LineBreak = ZWSpace:]; +$ZWJ = [:LineBreak = ZWJ:]; + +# OP30 and CP30 are variants of OP and CP that appear in-line in rule LB30 from UAX 14, +# without a formal name. Because ICU rules require multiple uses of the expressions, +# give them a single definition with a name + +$OP30 = [$OP - [\p{ea=F}\p{ea=W}\p{ea=H}]]; +$CP30 = [$CP - [\p{ea=F}\p{ea=W}\p{ea=H}]]; + +$ExtPictUnassigned = [\p{Extended_Pictographic} & \p{Cn}]; + +# By LB9, a ZWJ also behaves as a CM. Including it in the definition of CM avoids having to explicitly +# list it in the numerous rules that use CM. +# By LB1, SA characters with general category of Mn or Mc also resolve to CM. + +$CM = [[:LineBreak = Combining_Mark:] $ZWJ [$SA & [[:Mn:][:Mc:]]]]; +$CMX = [[$CM] - [$ZWJ]]; + +# Dictionary character set, for triggering language-based break engines. Currently +# limited to LineBreak=Complex_Context (SA). + +$dictionary = [$SA]; + +# +# Rule LB1. By default, treat AI (characters with ambiguous east Asian width), +# SA (Dictionary chars, excluding Mn and Mc) +# SG (Unpaired Surrogates) +# XX (Unknown, unassigned) +# as $AL (Alphabetic) +# +$ALPlus = [$AL $AI $SG $XX [$SA-[[:Mn:][:Mc:]]]]; + + +## ------------------------------------------------- + +# +# CAN_CM is the set of characters that may combine with CM combining chars. +# Note that Linebreak UAX 14's concept of a combining char and the rules +# for what they can combine with are _very_ different from the rest of Unicode. +# +# Note that $CM itself is left out of this set. If CM is needed as a base +# it must be listed separately in the rule. +# +$CAN_CM = [^$SP $BK $CR $LF $NL $ZW $CM]; # Bases that can take CMs +$CANT_CM = [ $SP $BK $CR $LF $NL $ZW $CM]; # Bases that can't take CMs + +# +# AL_FOLLOW set of chars that can unconditionally follow an AL +# Needed in rules where stand-alone $CM s are treated as AL. +# +$AL_FOLLOW = [$BK $CR $LF $NL $ZW $SP $CL $CP $EX $HL $IS $SY $WJ $GL $OP30 $QU $BA $HY $NS $IN $NU $PR $PO $ALPlus]; + + +# +# Rule LB 4, 5 Mandatory (Hard) breaks. +# +$LB4Breaks = [$BK $CR $LF $NL]; +$LB4NonBreaks = [^$BK $CR $LF $NL $CM]; +$CR $LF {100}; + +# +# LB 6 Do not break before hard line breaks. +# +$LB4NonBreaks? $LB4Breaks {100}; # LB 5 do not break before hard breaks. +$CAN_CM $CM* $LB4Breaks {100}; +^$CM+ $LB4Breaks {100}; + +# LB 7 x SP +# x ZW +$LB4NonBreaks [$SP $ZW]; +$CAN_CM $CM* [$SP $ZW]; +^$CM+ [$SP $ZW]; + +# +# LB 8 Break after zero width space +# ZW SP* ÷ +# +$LB8Breaks = [$LB4Breaks $ZW]; +$LB8NonBreaks = [[$LB4NonBreaks] - [$ZW]]; +$ZW $SP* / [^$SP $ZW $LB4Breaks]; + +# LB 8a ZWJ x Do not break Emoji ZWJ sequences. +# +$ZWJ [^$CM]; + +# LB 9 Combining marks. X $CM needs to behave like X, where X is not $SP, $BK $CR $LF $NL +# $CM not covered by the above needs to behave like $AL +# See definition of $CAN_CM. + +$CAN_CM $CM+; # Stick together any combining sequences that don't match other rules. +^$CM+; + +# +# LB 11 Do not break before or after WORD JOINER & related characters. +# +$CAN_CM $CM* $WJ; +$LB8NonBreaks $WJ; +^$CM+ $WJ; + +$WJ $CM* .; + +# +# LB 12 Do not break after NBSP and related characters. +# GL x +# +$GL $CM* .; + +# +# LB 12a Do not break before NBSP and related characters ... +# [^SP BA HY] x GL +# +[[$LB8NonBreaks] - [$SP $BA $HY]] $CM* $GL; +^$CM+ $GL; + + + + +# LB 13 Don't break before ']' or '!' or '/', even after spaces. +# +$LB8NonBreaks $CL; +$CAN_CM $CM* $CL; +^$CM+ $CL; # by rule 10, stand-alone CM behaves as AL + +$LB8NonBreaks $CP; +$CAN_CM $CM* $CP; +^$CM+ $CP; # by rule 10, stand-alone CM behaves as AL + +$LB8NonBreaks $EX; +$CAN_CM $CM* $EX; +^$CM+ $EX; # by rule 10, stand-alone CM behaves as AL + +$LB8NonBreaks $SY; +$CAN_CM $CM* $SY; +^$CM+ $SY; # by rule 10, stand-alone CM behaves as AL + + +# +# LB 14 Do not break after OP, even after spaces +# Note subtle interaction with "SP IS /" rules in LB14a. +# This rule consumes the SP, chaining happens on the IS, effectively overriding the SP IS rules, +# which is the desired behavior. +# +$OP $CM* $SP* .; + +$OP $CM* $SP+ $CM+ $AL_FOLLOW?; # by rule 10, stand-alone CM behaves as AL + # by rule 8, CM following a SP is stand-alone. + + +# LB 14a Force a break before start of a number with a leading decimal pt, e.g. " .23" +# Note: would be simpler to express as "$SP / $IS $CM* $NU;", but ICU rules have limitations. +# See issue ICU-20303 + + +$CanFollowIS = [$BK $CR $LF $NL $SP $ZW $WJ $GL $CL $CP $EX $IS $SY $QU $BA $HY $NS $ALPlus $HL $IN]; +$SP $IS / [^ $CanFollowIS $NU $CM]; +$SP $IS $CM* $CMX / [^ $CanFollowIS $NU $CM]; + +# +# LB 14b Do not break before numeric separators (IS), even after spaces. + +[$LB8NonBreaks - $SP] $IS; +$SP $IS $CM* [$CanFollowIS {eof}]; +$SP $IS $CM* $ZWJ [^$CM $NU]; + +$CAN_CM $CM* $IS; +^$CM+ $IS; # by rule 10, stand-alone CM behaves as AL + + +# LB 15 + +### BEGIN CUSTOMIZATION +### i#83649: Allow line break between quote and opening punctuation. +### This customization simply disables rule LB 15. +### +# $QU $CM* $SP* $OP; +### +### END CUSTOMIZATION + +# LB 16 +($CL | $CP) $CM* $SP* $NS; + +# LB 17 +$B2 $CM* $SP* $B2; + +# +# LB 18 Break after spaces. +# +$LB18NonBreaks = [$LB8NonBreaks - [$SP]]; +$LB18Breaks = [$LB8Breaks $SP]; + + +# LB 19 +# x QU +$LB18NonBreaks $CM* $QU; +^$CM+ $QU; + +# QU x +$QU $CM* .; + +# LB 20 +# <break> $CB +# $CB <break> +# +$LB20NonBreaks = [$LB18NonBreaks - $CB]; + +# LB 20.09 Don't break between Hyphens and Letters when there is a break preceding the hyphen. +# Originally added as a Finnish tailoring, now promoted to default ICU behavior. +# Note: this is not default UAX-14 behaviour. See issue ICU-8151. +# +^($HY | $HH) $CM* $ALPlus; + +# LB 21 x (BA | HY | NS) +# BB x +# +$LB20NonBreaks $CM* ($BA | $HY | $NS); + + +^$CM+ ($BA | $HY | $NS); + +$BB $CM* [^$CB]; # $BB x +$BB $CM* $LB20NonBreaks; + +# LB 21a Don't break after Hebrew + Hyphen +# HL (HY | BA) x +# +$HL $CM* ($HY | $BA) $CM* [^$CB]?; + +# LB 21b (forward) Don't break between SY and HL +# (break between HL and SY already disallowed by LB 13 above) +$SY $CM* $HL; + +# LB 22 Do not break before ellipses +# +$LB20NonBreaks $CM* $IN; +^$CM+ $IN; + + +# LB 23 +# +($ALPlus | $HL) $CM* $NU; +^$CM+ $NU; # Rule 10, any otherwise unattached CM behaves as AL +$NU $CM* ($ALPlus | $HL); + +# LB 23a +# +$PR $CM* ($ID | $EB | $EM); +($ID | $EB | $EM) $CM* $PO; + + +# +# LB 24 +# +($PR | $PO) $CM* ($ALPlus | $HL); +($ALPlus | $HL) $CM* ($PR | $PO); +^$CM+ ($PR | $PO); # Rule 10, any otherwise unattached CM behaves as AL + +# +# LB 25 Numbers. +# +(($PR | $PO) $CM*)? (($OP | $HY) $CM*)? ($IS $CM*)? $NU ($CM* ($NU | $SY | $IS))* + ($CM* ($CL | $CP))? ($CM* ($PR | $PO))?; + +### BEGIN CUSTOMIZATION +### i#83229: Allow line break after hyphen in number range context. +### The default ICU rules treat number ranges (e.g. 100-199) as a single token. This change forces +### a break opportunity after the embedded '-', but only if followed by another numeral. +### +### This customization does not replace any existing rule. +### Maintainers: note that this rule should consist of two instances of the LB 25 numbers rule, +### separated by a hyphen and an explicit break. + +((($PR | $PO) $CM*)? (($OP | $HY) $CM*)? ($IS $CM*)? $NU ($CM* ($NU | $SY | $IS))* + ($CM* ($CL | $CP))? ($CM* ($PR | $PO))?) + ($HY $CM*) / +((($PR | $PO) $CM*)? (($OP | $HY) $CM*)? ($IS $CM*)? $NU ($CM* ($NU | $SY | $IS))* + ($CM* ($CL | $CP))? ($CM* ($PR | $PO))?); + +### END CUSTOMIZATION + +### TODO +### ((PrefixNumeric | PostfixNumeric) CombMark*) ? ((OpenPunc | Hyphen) CombMark*)? +### (InfixNumeric CombMark*)? Numeric (CombMark* (Numeric | BreakSym | InfixNumeric))* +### (CombMark* (ClosePunc | CloseParen))? (CombMark* (PrefixNumeric | PostfixNumeric))? + +# LB 26 Do not break a Korean syllable +# +$JL $CM* ($JL | $JV | $H2 | $H3); +($JV | $H2) $CM* ($JV | $JT); +($JT | $H3) $CM* $JT; + +# LB 27 Treat korean Syllable Block the same as ID (don't break it) +($JL | $JV | $JT | $H2 | $H3) $CM* $PO; +$PR $CM* ($JL | $JV | $JT | $H2 | $H3); + + +# LB 28 Do not break between alphabetics +# +($ALPlus | $HL) $CM* ($ALPlus | $HL); +^$CM+ ($ALPlus | $HL); # The $CM+ is from rule 10, an unattached CM is treated as AL + +# LB 29 +$IS $CM* ($ALPlus | $HL); + +# LB 30 +($ALPlus | $HL | $NU) $CM* $OP30; +^$CM+ $OP30; # The $CM+ is from rule 10, an unattached CM is treated as AL. +$CP30 $CM* ($ALPlus | $HL | $NU); + +# LB 30a Do not break between regional indicators. Break after pairs of them. +# Tricky interaction with LB8a: ZWJ x . together with ZWJ acting like a CM. +$RI $CM* $RI / [[^$BK $CR $LF $NL $SP $ZW $WJ $CL $CP $EX $IS $SY $GL $QU $BA $HY $NS $IN $CM]]; +$RI $CM* $RI $CM* [$CM-$ZWJ] / [[^$BK $CR $LF $NL $SP $ZW $WJ $CL $CP $EX $IS $SY $GL $QU $BA $HY $NS $IN $CM]]; +$RI $CM* $RI $CM* [$BK $CR $LF $NL $SP $ZW $WJ $CL $CP $EX $IS $SY $GL $QU $BA $HY $NS $IN $ZWJ {eof}]; +# note: the preceding rule includes {eof} rather than having the last [set] term qualified with '?' +# because of the chain-out behavior difference. The rule must chain out only from the [set characters], +# not from the preceding $RI or $CM, which it would be able to do if the set were optional. + +# LB30b Do not break between an emoji base (or potential emoji) and an emoji modifier. +$EB $CM* $EM; +$ExtPictUnassigned $CM* $EM; + +# LB 31 Break everywhere else. +# Match a single code point if no other rule applies. +.; diff --git a/i18npool/source/localedata/data/ja_JP.xml b/i18npool/source/localedata/data/ja_JP.xml index 9319d07f9036..81aa087668ea 100644 --- a/i18npool/source/localedata/data/ja_JP.xml +++ b/i18npool/source/localedata/data/ja_JP.xml @@ -545,6 +545,13 @@ <Transliteration unoid="ignoreSpace_ja_JP"/> </LC_TRANSLITERATION> <LC_MISC> + <BreakIteratorRules> + <EditMode/> + <DictionaryMode/> + <WordCountMode/> + <CharacterMode/> + <LineMode>line_cj</LineMode> + </BreakIteratorRules> <ForbiddenCharacters> <ForbiddenLineBeginCharacters>!%),.:;?]}¢°’”‰′″℃、。々〉》」』】〕ぁぃぅぇぉっゃゅょゎ゛゜ゝゞァィゥェォッャュョヮヵヶ・ーヽヾ!%),.:;?]}。」、・ァィゥェォャュョッー゙゚¢</ForbiddenLineBeginCharacters> <ForbiddenLineEndCharacters>$([¥{£¥‘“〈《「『【〔$([{「£¥</ForbiddenLineEndCharacters> diff --git a/i18npool/source/localedata/data/zh_CN.xml b/i18npool/source/localedata/data/zh_CN.xml index ff943c3d091e..589509452c0e 100644 --- a/i18npool/source/localedata/data/zh_CN.xml +++ b/i18npool/source/localedata/data/zh_CN.xml @@ -406,6 +406,13 @@ <Transliteration unoid="IGNORE_WIDTH"/> </LC_TRANSLITERATION> <LC_MISC> + <BreakIteratorRules> + <EditMode/> + <DictionaryMode/> + <WordCountMode/> + <CharacterMode/> + <LineMode>line_cj</LineMode> + </BreakIteratorRules> <ForbiddenCharacters> <ForbiddenLineBeginCharacters>:!),.:;?]}¢'"、。〉》」』】〕〗〞︰︱︳﹐、﹒﹔﹕﹖﹗﹚﹜﹞!),.:;?|}︴︶︸︺︼︾﹀﹂﹄﹏、~¢々‖•·ˇˉ―--′’”</ForbiddenLineBeginCharacters> <ForbiddenLineEndCharacters>([{£¥'"‵〈《「『【〔〖([{£¥〝︵︷︹︻︽︿﹁﹃﹙﹛﹝({“‘</ForbiddenLineEndCharacters> diff --git a/i18npool/source/localedata/data/zh_TW.xml b/i18npool/source/localedata/data/zh_TW.xml index ae790e516f3f..88fe72944b21 100644 --- a/i18npool/source/localedata/data/zh_TW.xml +++ b/i18npool/source/localedata/data/zh_TW.xml @@ -510,6 +510,13 @@ <Transliteration unoid="IGNORE_WIDTH" /> </LC_TRANSLITERATION> <LC_MISC> + <BreakIteratorRules> + <EditMode/> + <DictionaryMode/> + <WordCountMode/> + <CharacterMode/> + <LineMode>line_cj</LineMode> + </BreakIteratorRules> <ForbiddenCharacters> <ForbiddenLineBeginCharacters>!),.:;?]}¢·--'"¨•′、。〉》」』】〕〞︰︱︳︴︶︸︺︼︾﹀﹂﹄﹏﹐、﹒﹔﹕﹖﹗﹚﹜﹞!),.:;?|}、</ForbiddenLineBeginCharacters> <ForbiddenLineEndCharacters>([{£¥'"‵〈《「『【〔〝︵︷︹︻︽︿﹁﹃﹙﹛﹝({</ForbiddenLineEndCharacters> commit 9e534c9c89214f57870cae17506f7d7f1e3bdab1 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Sep 11 11:49:25 2025 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Sep 19 10:18:32 2025 +0200 tdf#168355 Page break with page style with page number in table regression from commit 7d924018f3ea58050081936bde067391714a8bb5 Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Fri Jul 19 10:44:10 2024 +0200 don't use GetItemSurrogates in SwFrame::GetVirtPageNum Change-Id: Ibdc223842013ad11b56f402571f276de38a01f6a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190814 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> (cherry picked from commit 46720a15474c6c6cfbbb78ff15b446fbd004120c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190855 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190869 diff --git a/sw/qa/extras/uiwriter/data/tdf168355.odt b/sw/qa/extras/uiwriter/data/tdf168355.odt new file mode 100644 index 000000000000..bdb5a412b867 Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf168355.odt differ diff --git a/sw/qa/extras/uiwriter/uiwriter9.cxx b/sw/qa/extras/uiwriter/uiwriter9.cxx index 1969889dcfb7..2f6fa8f1d9ec 100644 --- a/sw/qa/extras/uiwriter/uiwriter9.cxx +++ b/sw/qa/extras/uiwriter/uiwriter9.cxx @@ -60,6 +60,7 @@ #include <fmtinfmt.hxx> #include <rootfrm.hxx> #include <svx/svxids.hrc> +#include <pagefrm.hxx> #include <svx/svdview.hxx> #include <svx/svdmark.hxx> @@ -1600,6 +1601,23 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testTdf108791) } } +// tdf#168355 Page break with page style with page number in table properties is wrong +CPPUNIT_TEST_FIXTURE(SwUiWriterTest9, testTdf168355) +{ + createSwDoc("tdf168355.odt"); + SwXTextDocument* pTextDoc = dynamic_cast<SwXTextDocument*>(mxComponent.get()); + CPPUNIT_ASSERT(pTextDoc); + SwDoc* pDoc = pTextDoc->GetDocShell()->GetDoc(); + const SwRootFrame* pLayout = pDoc->getIDocumentLayoutAccess().GetCurrentLayout(); + const SwPageFrame* pPageFrm = static_cast<const SwPageFrame*>(pLayout->Lower()); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), pPageFrm->GetVirtPageNum()); + pPageFrm = static_cast<const SwPageFrame*>(pPageFrm->GetNext()); + CPPUNIT_ASSERT_EQUAL(sal_uInt16(2), pPageFrm->GetVirtPageNum()); + pPageFrm = static_cast<const SwPageFrame*>(pPageFrm->GetNext()); + // this used to be page 3 + CPPUNIT_ASSERT_EQUAL(sal_uInt16(1), pPageFrm->GetVirtPageNum()); +} + } // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index 48050ce81213..b12b8df8658f 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -1894,6 +1894,30 @@ sal_uInt16 SwFrame::GetVirtPageNum() const break; } } + // might have to search tables too, they may set page number in their text flow properties + const SwLayoutFrame* pParentFrame = pContentFrame->GetUpper(); + while (pParentFrame) + { + if (const SwTabFrame* pTabFrame = pParentFrame->FindTabFrame()) + if (const SwTable* pTable = pTabFrame->GetTable()) + if (const SwTableFormat* pTableFormat = pTable->GetFrameFormat()) + { + const SwFormatPageDesc& rFormatPageDesc2 = pTableFormat->GetPageDesc(); + + if ( rFormatPageDesc2.GetNumOffset() && rFormatPageDesc2.GetDefinedIn() ) + { + const sw::BroadcastingModify* pMod = rFormatPageDesc2.GetDefinedIn(); + sw::VirtPageNumHint aHint(pPage); + pMod->CallSwClientNotify(aHint); + if(aHint.GetPage()) + { + pFoundFrame = aHint.GetFrame(); + break; + } + } + } + pParentFrame = pParentFrame->GetUpper(); + } } pPageFrameIter = static_cast<const SwPageFrame*>(pPageFrameIter->GetPrev()); } commit 9957dbb6d1483760983410f8cbfe62d49c778ffb Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sun Sep 14 19:55:01 2025 +0100 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Sep 19 10:17:10 2025 +0200 Resolves: tdf#168306 set current line width at popup time Change-Id: I82c8151566459d1429cd3b4517b43ace3fbeca60 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190934 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit 830a06afe26279edc3527ccdecb5c9e2b347cfd5) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190935 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit f8aa0ff0e7eb08d5822858688dc525ec0201b09e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190946 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> Tested-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/include/svx/sidebar/LinePropertyPanelBase.hxx b/include/svx/sidebar/LinePropertyPanelBase.hxx index f15f0de9fc2b..e2cd20995cc3 100644 --- a/include/svx/sidebar/LinePropertyPanelBase.hxx +++ b/include/svx/sidebar/LinePropertyPanelBase.hxx @@ -119,6 +119,7 @@ private: void Initialize(); DECL_DLLPRIVATE_LINK(ToolboxWidthSelectHdl, const OUString&, void); + DECL_DLLPRIVATE_LINK(ToolboxWidthToggleMenuHdl, const OUString&, void); DECL_DLLPRIVATE_LINK(ChangeTransparentHdl, weld::MetricSpinButton&, void); }; diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx index afbc03983cef..cec5d9a1dc2b 100644 --- a/svx/source/sidebar/line/LinePropertyPanelBase.cxx +++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx @@ -124,6 +124,7 @@ void LinePropertyPanelBase::Initialize() Graphic aGraf(maIMGWidthIcon[0]); mxTBWidth->set_item_image(SELECTWIDTH, aGraf.GetXGraphic()); mxTBWidth->connect_clicked(LINK(this, LinePropertyPanelBase, ToolboxWidthSelectHdl)); + mxTBWidth->connect_menu_toggled(LINK(this, LinePropertyPanelBase, ToolboxWidthToggleMenuHdl)); mxMFTransparent->connect_value_changed(LINK(this, LinePropertyPanelBase, ChangeTransparentHdl)); @@ -193,6 +194,12 @@ IMPL_LINK_NOARG(LinePropertyPanelBase, ToolboxWidthSelectHdl, const OUString&, v mxTBWidth->set_menu_item_active(SELECTWIDTH, !mxTBWidth->get_menu_item_active(SELECTWIDTH)); } +IMPL_LINK_NOARG(LinePropertyPanelBase, ToolboxWidthToggleMenuHdl, const OUString&, void) +{ + if (mxTBWidth->get_menu_item_active(SELECTWIDTH)) + mxLineWidthPopup->SetWidthSelect(mnWidthCoreValue, mbWidthValuable, meMapUnit); +} + void LinePropertyPanelBase::EndLineWidthPopup() { mxTBWidth->set_menu_item_active(SELECTWIDTH, false); commit af8606e6fa6ca927c3fa4fba8357ea5221378d73 Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Sun Sep 7 22:51:48 2025 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Sep 19 10:17:10 2025 +0200 Related tdf#168265: fix DXFGroupReader::ReadF Change-Id: I9a316a2b01b7726e679cecb0121e650ee49d6ba3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190646 Reviewed-by: Julien Nabet <serval2...@yahoo.fr> Tested-by: Jenkins (cherry picked from commit 1d6298f1c64a8ba6c6634335960d2b247d0d2f30) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190652 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit 5389294d747f8ca3d964f126cab627eb89c4ec91) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190761 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/vcl/source/filter/idxf/dxfgrprd.cxx b/vcl/source/filter/idxf/dxfgrprd.cxx index 3319882e3245..a2ab23e6867b 100644 --- a/vcl/source/filter/idxf/dxfgrprd.cxx +++ b/vcl/source/filter/idxf/dxfgrprd.cxx @@ -197,7 +197,7 @@ double DXFGroupReader::ReadF() bStatus=false; return 0.0; } - return atof(p); + return o3tl::toDouble(s); } void DXFGroupReader::ReadS() commit ed94f5dca36bcace10373324d05fdb4c95f950d9 Author: Julien Nabet <serval2...@yahoo.fr> AuthorDate: Sat Sep 6 09:30:36 2025 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Sep 19 10:17:10 2025 +0200 tdf#168265: pass comment (999) section to detect dxf file Change-Id: I6d54e4dcc578792bd122e24743f41c0049974a2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190632 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2...@yahoo.fr> (cherry picked from commit b5044aa84af207dc44944c9ad51847b50e7f43b1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190653 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit f9eacf3d535e3dac7c1f30a5f74f4ff7a77a94be) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190760 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/vcl/source/filter/GraphicFormatDetector.cxx b/vcl/source/filter/GraphicFormatDetector.cxx index 7963505f4b2e..80dfc885e39c 100644 --- a/vcl/source/filter/GraphicFormatDetector.cxx +++ b/vcl/source/filter/GraphicFormatDetector.cxx @@ -1156,6 +1156,30 @@ bool GraphicFormatDetector::checkDXF() ++i; } + // tdf#168265: pass comment section which begins with 999 + // see https://help.autodesk.com/view/OARX/2024/ENU/?guid=GUID-3F0380A5-1C15-464D-BC66-2C5F094BCFB9 + if (i < 256 - 2 && maFirstBytes[i] == '9' && maFirstBytes[i + 1] == '9' + && maFirstBytes[i + 2] == '9') + { + // we're on the 999 line + i = i + 3; + // we want to pass this line + while (i < 256 && maFirstBytes[i] <= 32) + { + ++i; + } + // we're on the comment line and we want to go until new line + while (i < 256 && maFirstBytes[i] != 10) + { + ++i; + } + // we're on the new line + while (i < 256 && maFirstBytes[i] <= 32) + { + ++i; + } + } + if (i < 256 && maFirstBytes[i] == '0') { ++i; commit 59599d239968b4a3d6a09e2b05157b545f19693d Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Mon Sep 8 14:45:52 2025 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Sep 19 10:17:09 2025 +0200 libatomic_ops: upgrade to 7.8.4 Downloaded from https://github.com/bdwgc/libatomic_ops/releases/download/v7.8.4/libatomic_ops-7.8.4.tar.gz Change-Id: If970693689dd488b2e794582ccfaffcc97388c3a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190672 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit 7ca639f67bbf1c953b8e81d5e59c031fd4bb007d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190718 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/download.lst b/download.lst index 47660d28a3f3..2dec988a1e26 100644 --- a/download.lst +++ b/download.lst @@ -477,8 +477,8 @@ LIBASSUAN_TARBALL := libassuan-3.0.2.tar.bz2 # three static lines # so that git cherry-pick # will not run into conflicts -LIBATOMIC_OPS_SHA256SUM := d305207fe207f2b3fb5cb4c019da12b44ce3fcbc593dfd5080d867b1a2419b51 -LIBATOMIC_OPS_TARBALL := libatomic_ops-7.8.2.tar.gz +LIBATOMIC_OPS_SHA256SUM := 2356e002e80ef695875e971d6a4fd8c61ca5c6fa4fd1bf31cce54a269c8bfcd5 +LIBATOMIC_OPS_TARBALL := libatomic_ops-7.8.4.tar.gz # three static lines # so that git cherry-pick # will not run into conflicts commit 4a96bf9864e040ae3afa958a76a8ec3cf7ab2487 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Tue Sep 9 17:03:13 2025 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Sep 19 10:17:09 2025 +0200 libxml2: upgrade to 2.14.6 9de92ed78d8495527c5d7a4d0cc76c1f83768195.patch.1 has been fixed upstream Downloaded from https://download.gnome.org/sources/libxml2/2.14/libxml2-2.14.6.tar.xz Change-Id: Ibfd34613bc74644830b2e45c32c16462e7c7bd32 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190720 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> (cherry picked from commit 5e9caecd24636664d3de0a1eff06df540aa70fc4) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190723 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/download.lst b/download.lst index fefdd66cfee3..47660d28a3f3 100644 --- a/download.lst +++ b/download.lst @@ -527,8 +527,8 @@ XMLSEC_TARBALL := xmlsec1-1.3.6.tar.gz # three static lines # so that git cherry-pick # will not run into conflicts -LIBXML_SHA256SUM := 03d006f3537616833c16c53addcdc32a0eb20e55443cba4038307e3fa7d8d44b -LIBXML_VERSION_MICRO := 5 +LIBXML_SHA256SUM := 7ce458a0affeb83f0b55f1f4f9e0e55735dbfc1a9de124ee86fb4a66b597203a +LIBXML_VERSION_MICRO := 6 LIBXML_TARBALL := libxml2-2.14.$(LIBXML_VERSION_MICRO).tar.xz # three static lines # so that git cherry-pick diff --git a/external/libxml2/9de92ed78d8495527c5d7a4d0cc76c1f83768195.patch.1 b/external/libxml2/9de92ed78d8495527c5d7a4d0cc76c1f83768195.patch.1 deleted file mode 100644 index 5984d25e957d..000000000000 --- a/external/libxml2/9de92ed78d8495527c5d7a4d0cc76c1f83768195.patch.1 +++ /dev/null @@ -1,64 +0,0 @@ -From 9de92ed78d8495527c5d7a4d0cc76c1f83768195 Mon Sep 17 00:00:00 2001 -From: Nick Wellnhofer <wellnho...@aevum.de> -Date: Tue, 5 Aug 2025 22:26:27 +0200 -Subject: [PATCH] tree: Guard against atype corruption - -Always remove ids if `id` member is set. - -Untested, but this should fix CVE-2025-7425 reported against libxslt: - -https://gitlab.gnome.org/GNOME/libxslt/-/issues/140 ---- - tree.c | 8 ++++---- - valid.c | 2 +- - 2 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/tree.c b/tree.c -index 2e8df00b8..ddb8bdb3b 100644 ---- a/tree.c -+++ b/tree.c -@@ -1892,8 +1892,8 @@ xmlFreeProp(xmlAttrPtr cur) { - xmlDeregisterNodeDefaultValue((xmlNodePtr)cur); - - /* Check for ID removal -> leading to invalid references ! */ -- if ((cur->doc != NULL) && (cur->atype == XML_ATTRIBUTE_ID)) { -- xmlRemoveID(cur->doc, cur); -+ if (cur->doc != NULL && cur->id != NULL) { -+ xmlRemoveID(cur->doc, cur); - } - if (cur->children != NULL) xmlFreeNodeList(cur->children); - DICT_FREE(cur->name) -@@ -2736,7 +2736,7 @@ xmlNodeSetDoc(xmlNodePtr node, xmlDocPtr doc) { - * TODO: ID attributes should also be added to the new - * document, but it's not clear how to handle clashes. - */ -- if (attr->atype == XML_ATTRIBUTE_ID) -+ if (attr->id != NULL) - xmlRemoveID(oldDoc, attr); - - break; -@@ -6919,7 +6919,7 @@ xmlSetNsProp(xmlNodePtr node, xmlNsPtr ns, const xmlChar *name, - return(NULL); - } - -- if (prop->atype == XML_ATTRIBUTE_ID) { -+ if (prop->id != NULL) { - xmlRemoveID(node->doc, prop); - prop->atype = XML_ATTRIBUTE_ID; - } -diff --git a/valid.c b/valid.c -index 34b6757cb..e625f0c1b 100644 ---- a/valid.c -+++ b/valid.c -@@ -4296,7 +4296,7 @@ xmlValidateOneAttribute(xmlValidCtxtPtr ctxt, xmlDocPtr doc, - attr->name, elem->name, NULL); - return(0); - } -- if (attr->atype == XML_ATTRIBUTE_ID) -+ if (attr->id != NULL) - xmlRemoveID(doc, attr); - attr->atype = attrDecl->atype; - --- -GitLab - diff --git a/external/libxml2/UnpackedTarball_libxml2.mk b/external/libxml2/UnpackedTarball_libxml2.mk index 593556dbc532..223577f7c037 100644 --- a/external/libxml2/UnpackedTarball_libxml2.mk +++ b/external/libxml2/UnpackedTarball_libxml2.mk @@ -23,7 +23,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,libxml2,\ $(if $(gb_Module_CURRENTMODULE_SYMBOLS_ENABLED), \ external/libxml2/libxml2-icu-sym.patch.0, \ external/libxml2/libxml2-icu.patch.0) \ - external/libxml2/9de92ed78d8495527c5d7a4d0cc76c1f83768195.patch.1 \ )) $(eval $(call gb_UnpackedTarball_add_file,libxml2,xml2-config.in,external/libxml2/xml2-config.in)) commit a3eb29294edee7dfc24e847cce62d68b1650f15c Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Mon Sep 8 12:48:25 2025 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Sep 19 10:17:09 2025 +0200 freetype: upgrade to 2.14.0 Downloaded from https://sourceforge.net/projects/freetype/files/freetype2/2.14.0/freetype-2.14.0.tar.xz/download Change-Id: If11ce5186689702496754b4668fedbaed14ab287 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190660 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Tested-by: Jenkins (cherry picked from commit b732868bd612d3b046ab395d9db69b5d92b6f984) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190667 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/download.lst b/download.lst index 0aa064c3e8f5..fefdd66cfee3 100644 --- a/download.lst +++ b/download.lst @@ -370,8 +370,8 @@ FREEHAND_TARBALL := libfreehand-0.1.2.tar.xz # three static lines # so that git cherry-pick # will not run into conflicts -FREETYPE_SHA256SUM := 0550350666d427c74daeb85d5ac7bb353acba5f76956395995311a9c6f063289 -FREETYPE_TARBALL := freetype-2.13.3.tar.xz +FREETYPE_SHA256SUM := f8dfa8f15ef0576738dfb55b2e6e6b172fd5d09b6f03785a1df03239549f64d2 +FREETYPE_TARBALL := freetype-2.14.0.tar.xz # three static lines # so that git cherry-pick # will not run into conflicts diff --git a/external/freetype/freetype-2.6.5.patch.1 b/external/freetype/freetype-2.6.5.patch.1 index 5d940b11addc..e00dbeb3b97b 100644 --- a/external/freetype/freetype-2.6.5.patch.1 +++ b/external/freetype/freetype-2.6.5.patch.1 @@ -19,13 +19,13 @@ diff -up freetype/builds/unix/configure.dt freetype/builds/unix/configure else ld_shlibs=no fi -@@ -9573,7 +9573,7 @@ _LT_EOF +@@ -9771,7 +9771,7 @@ ;; haiku*) - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $lib' - link_all_deplibs=yes + link_all_deplibs=no ;; @@ -9669,13 +9669,13 @@ _LT_EOF diff --git a/external/freetype/ubsan.patch b/external/freetype/ubsan.patch index 7e474c815942..e915bedf7a46 100644 --- a/external/freetype/ubsan.patch +++ b/external/freetype/ubsan.patch @@ -1,11 +1,11 @@ --- src/truetype/ttgxvar.c +++ src/truetype/ttgxvar.c -@@ -1045,7 +1045,7 @@ - if ( varData->longWords ) +@@ -1217,7 +1217,7 @@ per_region_size *= 2; + } - bytes = varData->deltaSet + per_region_size * innerIndex; + bytes = varData->deltaSet ? varData->deltaSet + per_region_size * innerIndex : NULL; - if ( varData->longWords ) - { + /* outer loop steps through master designs to be blended */ + for ( master = 0; master < varData->regionIdxCount; master++ ) commit 965b7b55511ec85cee481c4a779a581f93b7e253 Author: Neil Roberts <bpee...@yahoo.co.uk> AuthorDate: Tue Sep 2 12:37:56 2025 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Sep 19 10:17:09 2025 +0200 tdf#121253 Remove the default menu new document shortcut keys on MacOS The default menu on MacOS is displayed when there are no windows or on a dialog box with no parent. Previously there were hardcoded shortcut keys to create new documents. As reported in tdf#121253, one of these is ⌘A which ends up being inconvenient because that is commonly used to select all the text in a text box. This had the effect that if you tried to use that shortcut in some dialogs then the dialog would seem to disappear and be replaced by the new database wizard. The hardcoded shortcuts were added in 6efdd1444810 which is a patch from January 2025. Before that the shortcuts were generated based on the menu item title. ⌘A ends up being used for the database because ⌘D is already used for a new Draw document and it just picked the next letter along. These shortcuts were added in 2008 with ba57ba32e8054ec. This patch removes the shortcuts for the default menu in both the copied version of the start center menu and the original default menu generated in code. It seems strange to have shortcuts for these only in the specific case of there being no window or when a few select dialog boxes are focused. If they were generally useful to people then surely it would make sense to add them to the start center menu as well. For people using non-English language packs the patch from January would have effectively changed the shortcut keys. If nobody has complained then it probably means they aren’t used. Change-Id: I6065c3daa4e288caa98d73a3f286935dc5bc07ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190522 Tested-by: Jenkins Reviewed-by: Patrick Luby <guibomac...@gmail.com> (cherry picked from commit 9d2da58ec93db75d2fcfce3dc001d9db0851e3c6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190568 Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com> diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm index 9e037fe5726e..811631f21618 100644 --- a/sfx2/source/appl/shutdowniconaqua.mm +++ b/sfx2/source/appl/shutdowniconaqua.mm @@ -427,24 +427,6 @@ class RecentFilesStringLength : public ::cppu::WeakImplHelper< css::util::XStrin static RecentMenuDelegate* pRecentDelegate = nil; -static OUString getShortCut( const OUString& i_rTitle ) -{ - // create shortcut - OUString aKeyEquiv; - for( sal_Int32 nIndex = 0; nIndex < i_rTitle.getLength(); nIndex++ ) - { - OUString aShortcut( i_rTitle.copy( nIndex, 1 ).toAsciiLowerCase() ); - if( aShortcuts.find( aShortcut ) == aShortcuts.end() ) - { - aShortcuts.insert( aShortcut ); - aKeyEquiv = aShortcut; - break; - } - } - - return aKeyEquiv; -} - static void appendMenuItem( NSMenu* i_pMenu, NSMenu* i_pDockMenu, const OUString& i_rTitle, int i_nTag, const OUString& i_rKeyEquiv ) { if( ! i_rTitle.getLength() ) @@ -532,6 +514,12 @@ void setKeyEquivalent( const vcl::KeyCode &rKeyCode, NSMenuItem *pNSMenuItem ) if ( nModifier & KEY_MOD3 ) nItemModifier |= NSEventModifierFlagControl; + // Don’t allow setting the ⌘N shortcut because it would conflict + // with the “Startcenter” menu item which is added explicitly in + // getNSMenuForVCLMenu + if ( nCommandKey == 'n' && nItemModifier == NSEventModifierFlagCommand ) + return; + OUString aCommandKey( &nCommandKey, 1 ); NSString *pCommandKey = [NSString stringWithCharacters: reinterpret_cast< unichar const* >(aCommandKey.getStr()) length: aCommandKey.getLength()]; [pNSMenuItem setKeyEquivalent: pCommandKey]; @@ -601,21 +589,7 @@ static NSMenu *getNSMenuForVCLMenu( Menu *pMenu ) [pNSMenuItem setTarget: pNSMenuItem]; [pNSMenuItem setCommand: aCommand]; - // Use the default menu's special "open new file" shortcuts - if ( aCommand == WRITER_URL ) - [pNSMenuItem setKeyEquivalent: @"t"]; - else if ( aCommand == CALC_URL ) - [pNSMenuItem setKeyEquivalent: @"s"]; - else if ( aCommand == IMPRESS_WIZARD_URL ) - [pNSMenuItem setKeyEquivalent: @"p"]; - else if ( aCommand == DRAW_URL ) - [pNSMenuItem setKeyEquivalent: @"d"]; - else if ( aCommand == MATH_URL ) - [pNSMenuItem setKeyEquivalent: @"f"]; - else if ( aCommand == BASE_URL ) - [pNSMenuItem setKeyEquivalent: @"a"]; - else - setKeyEquivalent( pMenu->GetAccelKey( nId ), pNSMenuItem ); + setKeyEquivalent( pMenu->GetAccelKey( nId ), pNSMenuItem ); } [pRet addItem: pNSMenuItem]; @@ -775,9 +749,7 @@ void aqua_init_systray() // menu => also let not appear it in the quickstarter continue; - OUString aKeyEquiv( getShortCut( ShutdownIcon::GetUrlDescription( sURL ) ) ); - - appendMenuItem( pMenu, pDockMenu, ShutdownIcon::GetUrlDescription( sURL ), aMenuItems[i].nMenuTag, aKeyEquiv ); + appendMenuItem( pMenu, pDockMenu, ShutdownIcon::GetUrlDescription( sURL ), aMenuItems[i].nMenuTag, "" ); } // insert the remaining menu entries @@ -786,11 +758,9 @@ void aqua_init_systray() appendRecentMenu( pMenu, SfxResId(STR_QUICKSTART_RECENTDOC) ); OUString aTitle( SfxResId(STR_QUICKSTART_FROMTEMPLATE) ); - OUString aKeyEquiv( getShortCut( aTitle ) ); - appendMenuItem( pMenu, pDockMenu, aTitle, MI_TEMPLATE, aKeyEquiv ); + appendMenuItem( pMenu, pDockMenu, aTitle, MI_TEMPLATE, "" ); aTitle = SfxResId(STR_QUICKSTART_FILEOPEN); - aKeyEquiv = getShortCut( aTitle ); - appendMenuItem( pMenu, pDockMenu, aTitle, MI_OPEN, aKeyEquiv ); + appendMenuItem( pMenu, pDockMenu, aTitle, MI_OPEN, "" ); [pDefMenu setSubmenu: pMenu]; resetMenuBar(); commit 5e034c58a2556c637b5c149c527d7c2355830179 Author: Justin Luth <jl...@mail.com> AuthorDate: Mon Sep 1 15:51:52 2025 -0400 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Sep 19 10:17:09 2025 +0200 tdf#165852 Revert "simplify bookmark name calculation" This reverts 25.2 commit 0c6599ca14ff4ff63224a7e34e93eb30e1ce2adc, and commit bcf4b998741da342d8612dfa2ac8b9d5d95269d4. because rSh.SetCursorInHdFt can move to a different page/footer and thus rSh.GetVirtPageNum() will change value on even and odd footers. Change-Id: I2d29e5c9f7538c47c6e11c8e7432f5f8d880bf72 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190507 Tested-by: Jenkins Reviewed-by: Justin Luth <jl...@mail.com> (cherry picked from commit e16da933cdfe52382274bb9493bcaa12f85d6426) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190508 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190526 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx index cf91f5ae2b7c..7ad4dc7d783f 100644 --- a/sw/source/uibase/shells/textfld.cxx +++ b/sw/source/uibase/shells/textfld.cxx @@ -1140,14 +1140,14 @@ FIELD_INSERT: const bool bFooterAlreadyOn = rDesc.GetMaster().GetFooter().IsActive(); const bool bIsSinglePage = rDesc.GetFollow() != &rDesc; const size_t nMirrorPagesNeeded = rDesc.IsFirstShared() ? 2 : 3; - const OUString sBookmarkName = OUString::Concat("PageNumWizard_") - + (bHeader ? "HEADER" : "FOOTER") + "_" + rDesc.GetName() - + OUString::number(rSh.GetVirtPageNum()); + const OUString sBookmarkName(OUString::Concat("PageNumWizard_") + + (bHeader ? "HEADER" : "FOOTER") + "_" + rDesc.GetName()); IDocumentMarkAccess& rIDMA = *rSh.getIDocumentMarkAccess(); // Allow wizard to be re-run: delete previously wizard-inserted page number. // Try before creating non-shared header: avoid copying ODD bookmark onto EVEN page. - auto ppMark = rIDMA.findMark(sBookmarkName); + OUString sBookmarkOddPage(sBookmarkName + OUString::number(rSh.GetVirtPageNum())); + auto ppMark = rIDMA.findMark(sBookmarkOddPage); if (ppMark != rIDMA.getAllMarksEnd() && *ppMark) { SwPaM aDeleteOldPageNum((*ppMark)->GetMarkStart(), (*ppMark)->GetMarkEnd()); @@ -1338,7 +1338,9 @@ FIELD_INSERT: // Allow wizard to be re-run: delete previously wizard-inserted page number. // Now that the cursor may have moved to a different page, try delete again. - ppMark = rIDMA.findMark(sBookmarkName); + sBookmarkOddPage + = sBookmarkName + OUString::number(rSh.GetVirtPageNum()); + ppMark = rIDMA.findMark(sBookmarkOddPage); if (ppMark != rIDMA.getAllMarksEnd() && *ppMark) { SwPaM aDeleteOldPageNum((*ppMark)->GetMarkStart(), (*ppMark)->GetMarkEnd()); @@ -1403,8 +1405,8 @@ FIELD_INSERT: aNewBookmarkPaM.SetMark(); assert(aNewBookmarkPaM.GetPointContentNode() && "only SetContent on content node"); aNewBookmarkPaM.Start()->SetContent(nStartContentIndex); - sw::mark::MarkBase* pNewMark = rIDMA.makeMark(aNewBookmarkPaM, - sBookmarkName, + rIDMA.makeMark(aNewBookmarkPaM, + sBookmarkOddPage, IDocumentMarkAccess::MarkType::BOOKMARK, sw::mark::InsertMode::New); @@ -1413,9 +1415,12 @@ FIELD_INSERT: && rSh.SetCursorInHdFt(nPageDescIndex, bHeader, /*Even=*/true)) { assert(nEvenPage && "what? no even page and yet we got here?"); - if (pNewMark) + OUString sBookmarkEvenPage( + sBookmarkName + OUString::number(rSh.GetVirtPageNum())); + ppMark = rIDMA.findMark(sBookmarkEvenPage); + if (ppMark != rIDMA.getAllMarksEnd() && *ppMark) { - SwPaM aDeleteOldPageNum(pNewMark->GetMarkStart(), pNewMark->GetMarkEnd()); + SwPaM aDeleteOldPageNum((*ppMark)->GetMarkStart(), (*ppMark)->GetMarkEnd()); rDoc.getIDocumentContentOperations().DeleteAndJoin(aDeleteOldPageNum); } @@ -1457,7 +1462,7 @@ FIELD_INSERT: aNewEvenBookmarkPaM.SetMark(); aNewEvenBookmarkPaM.Start()->SetContent(nStartContentIndex); rIDMA.makeMark(aNewEvenBookmarkPaM, - sBookmarkName, + sBookmarkEvenPage, IDocumentMarkAccess::MarkType::BOOKMARK, sw::mark::InsertMode::New); } commit 51b744297962336b58982a924e91636779e4c43b Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Tue Sep 2 10:58:51 2025 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Fri Sep 19 10:17:09 2025 +0200 tdf#167753: Revert "slideshow: change transition drawing view to icon view" This reverts commit e4a1c45a0bad3677d0b131ef9c6ac6e3c4bdb03c. This patch also reverts a part of commit 5c4fac1e9f50832852e87452f3152f01b905f9e6 Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Wed Oct 16 13:19:05 2024 +0200 loplugin:unusedmethods since some methods are needed now Change-Id: If2610349ac1aaecb03d1a2f1b6e3e8005c23eb77 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190538 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <qui...@gmail.com> (cherry picked from commit 654a6dd03dc687ddca67d09e69b3d47c32e7faeb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190554 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Tested-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/include/svtools/valueset.hxx b/include/svtools/valueset.hxx index 2244dfc805af..2bece77a8773 100644 --- a/include/svtools/valueset.hxx +++ b/include/svtools/valueset.hxx @@ -265,6 +265,7 @@ private: protected: virtual css::uno::Reference<css::accessibility::XAccessible> CreateAccessible() override; + weld::ScrolledWindow* GetScrollBar() const { return mxScrolledWindow.get(); } public: ValueSet(std::unique_ptr<weld::ScrolledWindow> pScrolledWindow); @@ -351,6 +352,8 @@ public: } sal_uInt16 GetHighlightedItemId() const { return mnHighItemId; } + void RecalculateItemSizes(); + void SetItemImage( sal_uInt16 nItemId, const Image& rImage ); Image GetItemImage( sal_uInt16 nItemId ) const; void SetItemColor( sal_uInt16 nItemId, const Color& rColor ); diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx index d5fef0f84362..d8e777a96ccb 100644 --- a/sd/source/ui/animations/SlideTransitionPane.cxx +++ b/sd/source/ui/animations/SlideTransitionPane.cxx @@ -211,9 +211,6 @@ struct TransitionEffect } // namespace sd::impl -namespace sd -{ - // Local Helper Functions namespace { @@ -345,20 +342,53 @@ void lcl_FillSoundListBox( } /// Returns an offset into the list of transition presets -sd::TransitionPresetPtr getPreset(const sd::impl::TransitionEffect &rEffect) +size_t getPresetOffset( const sd::impl::TransitionEffect &rEffect ) { - const sd::TransitionPresetList& rPresetList = sd::TransitionPreset::getTransitionPresetList(); + const sd::TransitionPresetList& rPresetList = + sd::TransitionPreset::getTransitionPresetList(); - for (const auto& pPreset: rPresetList) + size_t nIdx = 0; + for( const auto& aIt: rPresetList ) { - if (rEffect.operator==(*pPreset)) - return pPreset; + if( rEffect.operator==( *aIt )) + break; + nIdx++; } - return sd::TransitionPresetPtr(); + return nIdx; } } // anonymous namespace +namespace sd +{ + +class TransitionPane : public ValueSet +{ +public: + explicit TransitionPane(std::unique_ptr<weld::ScrolledWindow> pScrolledWindow) + : ValueSet(std::move(pScrolledWindow)) + { + } + + void Recalculate() + { + GetScrollBar()->set_vpolicy(VclPolicyType::AUTOMATIC); + RecalculateItemSizes(); + } + + virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override + { + Size aSize = pDrawingArea->get_ref_device().LogicToPixel(Size(70, 88), MapMode(MapUnit::MapAppFont)); + pDrawingArea->set_size_request(aSize.Width(), aSize.Height()); + ValueSet::SetDrawingArea(pDrawingArea); + SetOutputSizePixel(aSize); + + SetStyle(GetStyle() | WB_ITEMBORDER | WB_FLATVALUESET | WB_VSCROLL); + EnableFullItemMode( false ); + SetColCount(3); + } +}; + // SlideTransitionPane SlideTransitionPane::SlideTransitionPane( weld::Widget* pParent, @@ -366,8 +396,6 @@ SlideTransitionPane::SlideTransitionPane( PanelLayout( pParent, u"SlideTransitionsPanel"_ustr, u"modules/simpress/ui/slidetransitionspanel.ui"_ustr, reinterpret_cast<sal_uInt64>(SfxViewShell::Current())), mrBase( rBase ), mpDrawDoc( rBase.GetDocShell() ? rBase.GetDocShell()->GetDoc() : nullptr ), - mxTransitionsIconView(m_xBuilder->weld_icon_view("transitions_icons")), - mxTransitionsScrollWindow(m_xBuilder->weld_scrolled_window("transitions_icons_scrolled_window")), mxRepeatAutoFrame(m_xBuilder->weld_frame("repeat_after_frame")), mbHasSelection( false ), mbUpdatingControls( false ), @@ -383,6 +411,8 @@ css::ui::LayoutSize SlideTransitionPane::GetHeightForWidth(const sal_Int32 /*nWi return css::ui::LayoutSize(nMinimumHeight, -1, nMinimumHeight); } +constexpr sal_uInt16 nNoneId = std::numeric_limits<sal_uInt16>::max(); + void SlideTransitionPane::Initialize(SdDrawDocument* pDoc) { mxLB_VARIANT = m_xBuilder->weld_combo_box(u"variant_list"_ustr); @@ -409,12 +439,22 @@ void SlideTransitionPane::Initialize(SdDrawDocument* pDoc) mxMF_REPEAT_AUTO_AFTER->set_width_chars(nWidthChars); mxCBX_duration->set_width_chars(nWidthChars); + mxVS_TRANSITION_ICONS.reset(new TransitionPane(m_xBuilder->weld_scrolled_window(u"transitions_iconswin"_ustr, true))); + mxVS_TRANSITION_ICONSWin.reset(new weld::CustomWeld(*m_xBuilder, u"transitions_icons"_ustr, *mxVS_TRANSITION_ICONS)); + if( pDoc ) mxModel = pDoc->getUnoModel(); // TODO: get correct view if( mxModel.is()) mxView.set( mxModel->getCurrentController(), uno::UNO_QUERY ); + // dummy list box of slide transitions for startup. + mxVS_TRANSITION_ICONS->InsertItem( + nNoneId, Image( StockImage::Yes, u"sd/cmd/transition-none.png"_ustr ), + SdResId( STR_SLIDETRANSITION_NONE ), + VALUESET_APPEND, /* show legend */ true ); + mxVS_TRANSITION_ICONS->Recalculate(); + // set defaults mxCB_AUTO_PREVIEW->set_active(true); // automatic preview on @@ -425,7 +465,7 @@ void SlideTransitionPane::Initialize(SdDrawDocument* pDoc) mxPB_APPLY_TO_ALL->connect_clicked( LINK( this, SlideTransitionPane, ApplyToAllButtonClicked )); mxPB_PLAY->connect_clicked( LINK( this, SlideTransitionPane, PlayButtonClicked )); - mxTransitionsIconView->connect_item_activated(LINK(this, SlideTransitionPane, TransitionSelected)); + mxVS_TRANSITION_ICONS->SetSelectHdl( LINK( this, SlideTransitionPane, TransitionSelected )); mxLB_VARIANT->connect_changed( LINK( this, SlideTransitionPane, VariantListBoxSelected )); mxCBX_duration->connect_value_changed(LINK( this, SlideTransitionPane, DurationModifiedHdl)); @@ -453,8 +493,8 @@ SlideTransitionPane::~SlideTransitionPane() { maLateInitTimer.Stop(); removeListener(); - mxTransitionsScrollWindow.reset(); - mxTransitionsIconView.reset(); + mxVS_TRANSITION_ICONSWin.reset(); + mxVS_TRANSITION_ICONS.reset(); mxRepeatAutoFrame.reset(); mxLB_VARIANT.reset(); mxCBX_duration.reset(); @@ -538,16 +578,16 @@ void SlideTransitionPane::updateControls() if( aEffect.mbEffectAmbiguous ) { SAL_WARN( "sd.transitions", "Unusual, ambiguous transition effect" ); - mxTransitionsIconView->select(0); + mxVS_TRANSITION_ICONS->SelectItem(nNoneId); } else { - // ToDo: That 0 is "no transition" is documented nowhere except in the + // ToDo: That 0 is "no transition" is documented nowhere except in the // CTOR of sdpage if( aEffect.mnType == 0 ) - mxTransitionsIconView->select(0); + mxVS_TRANSITION_ICONS->SelectItem(nNoneId); else - updateVariants(getPreset(aEffect)); + updateVariants( getPresetOffset( aEffect ) ); } if( aEffect.mbDurationAmbiguous ) @@ -645,8 +685,7 @@ void SlideTransitionPane::updateControls() void SlideTransitionPane::updateControlState() { - if (mxTransitionsScrollWindow) - mxTransitionsScrollWindow->set_sensitive(mbHasSelection); + mxVS_TRANSITION_ICONSWin->set_sensitive( mbHasSelection ); mxLB_VARIANT->set_sensitive( mbHasSelection && mxLB_VARIANT->get_count() > 0 ); mxCBX_duration->set_sensitive( mbHasSelection ); mxLB_SOUND->set_sensitive( mbHasSelection ); @@ -749,34 +788,34 @@ impl::TransitionEffect SlideTransitionPane::getTransitionEffectFromControls() co impl::TransitionEffect aResult; aResult.setAllAmbiguous(); - OUString sSelectedId = mxTransitionsIconView->get_selected_id(); - auto* pTransitionEntry = weld::fromId<TransitionEntry*>(sSelectedId); - if (!pTransitionEntry) - return aResult; - - const sd::TransitionPresetList& rPresetList = sd::TransitionPreset::getTransitionPresetList(); + bool bNoneSelected = mxVS_TRANSITION_ICONS->IsNoSelection() || mxVS_TRANSITION_ICONS->GetSelectedItemId() == nNoneId; - if (pTransitionEntry->mpPreset) + // check first (aResult might be overwritten) + if( mxVS_TRANSITION_ICONSWin->get_sensitive() && + !bNoneSelected && + mxVS_TRANSITION_ICONS->GetSelectedItemId() > 0 ) { - auto pSelectedPreset = pTransitionEntry->mpPreset; + const sd::TransitionPresetList& rPresetList = sd::TransitionPreset::getTransitionPresetList(); + auto aSelected = rPresetList.begin(); + std::advance( aSelected, mxVS_TRANSITION_ICONS->GetSelectedItemId() - 1); if (mxLB_VARIANT->get_active() == -1) { // Transition with just one effect. - aResult = impl::TransitionEffect(*pSelectedPreset); + aResult = impl::TransitionEffect( **aSelected ); aResult.setAllAmbiguous(); } else { int nVariant = 0; bool bFound = false; - for(const auto& rPreset: rPresetList) + for( const auto& aIter: rPresetList ) { - if (rPreset->getSetId() == pSelectedPreset->getSetId() ) + if( aIter->getSetId() == (*aSelected)->getSetId() ) { if( mxLB_VARIANT->get_active() == nVariant) { - aResult = impl::TransitionEffect(*rPreset); + aResult = impl::TransitionEffect( *aIter ); aResult.setAllAmbiguous(); bFound = true; break; @@ -794,7 +833,7 @@ impl::TransitionEffect SlideTransitionPane::getTransitionEffectFromControls() co } aResult.mbEffectAmbiguous = false; } - else + else if (bNoneSelected) { aResult.mbEffectAmbiguous = false; } @@ -1014,45 +1053,53 @@ IMPL_LINK_NOARG(SlideTransitionPane, PlayButtonClicked, weld::Button&, void) playCurrentEffect(); } -IMPL_LINK_NOARG(SlideTransitionPane, TransitionSelected, weld::IconView&, bool) +IMPL_LINK_NOARG(SlideTransitionPane, TransitionSelected, ValueSet*, void) { - OUString sSelectedId = mxTransitionsIconView->get_selected_id(); - auto* pTransitionEntry = weld::fromId<TransitionEntry*>(sSelectedId); - updateVariants(pTransitionEntry->mpPreset); + updateVariants( mxVS_TRANSITION_ICONS->GetSelectedItemId() - 1 ); applyToSelectedPages(); - return true; } /// we use an integer offset into the list of transition presets -void SlideTransitionPane::updateVariants(TransitionPresetPtr const& pPreset) +void SlideTransitionPane::updateVariants( size_t nPresetOffset ) { + const sd::TransitionPresetList& rPresetList = sd::TransitionPreset::getTransitionPresetList(); mxLB_VARIANT->clear(); - mxLB_VARIANT->set_sensitive(false); - mxLB_VARIANT->set_active(0); + mxVS_TRANSITION_ICONS->SelectItem(nNoneId); - if (!pPreset) + if( nPresetOffset >= rPresetList.size() ) { - mxTransitionsIconView->select(0); + mxLB_VARIANT->set_sensitive( false ); } else { - auto iterator = maTranstionMap.find(pPreset->getSetId()); - if (iterator != maTranstionMap.end()) + auto pFound = rPresetList.begin(); + std::advance( pFound, nPresetOffset ); + + // Fill in the variant listbox + size_t nFirstItem = 0, nItem = 1; + for( const auto& aIt: rPresetList ) { - auto& pTransitionEntry = iterator->second; - if (!pTransitionEntry->mnVariants.empty()) + if( aIt->getSetId() == (*pFound)->getSetId() ) { - for (OUString const& rCurrentVariant : pTransitionEntry->mnVariants) + if (!nFirstItem) + nFirstItem = nItem; + if( !aIt->getVariantLabel().isEmpty() ) { - mxLB_VARIANT->append_text(rCurrentVariant); - if (pPreset->getVariantLabel() == rCurrentVariant) - mxLB_VARIANT->set_active(mxLB_VARIANT->get_count() - 1); + mxLB_VARIANT->append_text( aIt->getVariantLabel() ); + if( *pFound == aIt ) + mxLB_VARIANT->set_active( mxLB_VARIANT->get_count()-1 ); } - mxLB_VARIANT->set_sensitive(true); } - - mxTransitionsIconView->select(pTransitionEntry->mnIndex); + nItem++; } + + if( mxLB_VARIANT->get_count() == 0 ) + mxLB_VARIANT->set_sensitive( false ); + else + mxLB_VARIANT->set_sensitive(true); + + // item has the id of the first transition from this set. + mxVS_TRANSITION_ICONS->SelectItem( nFirstItem ); } } @@ -1124,51 +1171,47 @@ IMPL_LINK_NOARG(SlideTransitionPane, AutoPreviewClicked, weld::Toggleable&, void IMPL_LINK_NOARG(SlideTransitionPane, LateInitCallback, Timer *, void) { - mxTransitionsIconView->freeze(); - - { - auto pTransition = std::make_unique<TransitionEntry>(); - const OUString aId = weld::toId(pTransition.get()); - pTransition->msIcon = u"sd/cmd/transition-none.png"_ustr; - pTransition->msLabel = SdResId(STR_SLIDETRANSITION_NONE); - pTransition->mnIndex = 0; - mxTransitionsIconView->append(aId, pTransition->msLabel, pTransition->msIcon); - maTranstionMap.emplace(u"None"_ustr, std::move(pTransition)); - } - const TransitionPresetList& rPresetList = TransitionPreset::getTransitionPresetList(); - size_t nIndex = 1; - for (TransitionPresetPtr const& pPreset: rPresetList) + + size_t nPresetOffset = 0; + for( const TransitionPresetPtr& pPreset: rPresetList ) { - const OUString aLabel = pPreset->getSetLabel(); - if (!aLabel.isEmpty()) + const OUString sLabel( pPreset->getSetLabel() ); + if( !sLabel.isEmpty() ) { - auto aIterator = maTranstionMap.find(pPreset->getSetId()); - if (aIterator == maTranstionMap.end()) + if( m_aNumVariants.find( pPreset->getSetId() ) == m_aNumVariants.end() ) { - auto pTransition = std::make_unique<TransitionEntry>(); - const OUString aId = weld::toId(pTransition.get()); - - pTransition->msIcon = u"sd/cmd/transition-"_ustr + pPreset->getSetId() + u".png"_ustr; - pTransition->msLabel = aLabel; - pTransition->mpPreset = pPreset; - if (!pPreset->getVariantLabel().isEmpty()) - pTransition->mnVariants.push_back(pPreset->getVariantLabel()); - pTransition->mnIndex = nIndex; - nIndex++; - - mxTransitionsIconView->append(aId, pTransition->msLabel, pTransition->msIcon); - maTranstionMap.emplace(pPreset->getSetId(), std::move(pTransition)); + OUString sImageName("sd/cmd/transition-" + pPreset->getSetId() + ".png"); + BitmapEx aIcon( sImageName ); + if ( aIcon.IsEmpty() ) // need a fallback + sImageName = "sd/cmd/transition-none.png"; + + mxVS_TRANSITION_ICONS->InsertItem( + nPresetOffset + 1, Image(StockImage::Yes, sImageName), sLabel, + VALUESET_APPEND, /* show legend */ true ); + + m_aNumVariants[ pPreset->getSetId() ] = 1; } else { - auto& pTransition = aIterator->second; - pTransition->mnVariants.push_back(pPreset->getVariantLabel()); + m_aNumVariants[ pPreset->getSetId() ]++; } } + nPresetOffset++; + } + mxVS_TRANSITION_ICONS->Recalculate(); + + SAL_INFO( "sd.transitions", "Item transition offsets in ValueSet:"); + for( size_t i = 0; i < mxVS_TRANSITION_ICONS->GetItemCount(); ++i ) + SAL_INFO( "sd.transitions", i << ":" << mxVS_TRANSITION_ICONS->GetItemId( i ) ); + + nPresetOffset = 0; + SAL_INFO( "sd.transitions", "Transition presets by offsets:"); + for( const auto& aIter: rPresetList ) + { + SAL_INFO( "sd.transitions", nPresetOffset++ << " " << + aIter->getPresetId() << ": " << aIter->getSetId() ); } - mxTransitionsIconView->set_size_request(0, 0); - mxTransitionsIconView->thaw(); updateSoundList(); updateControls(); diff --git a/sd/source/ui/inc/SlideTransitionPane.hxx b/sd/source/ui/inc/SlideTransitionPane.hxx index b7354025f6b9..0a732ee49652 100644 --- a/sd/source/ui/inc/SlideTransitionPane.hxx +++ b/sd/source/ui/inc/SlideTransitionPane.hxx @@ -36,7 +36,8 @@ namespace sd::tools { class EventMultiplexerEvent; } namespace sd { -class TransitionPreset; + +class TransitionPane; class ViewShellBase; namespace tools @@ -49,15 +50,6 @@ namespace impl struct TransitionEffect; } -struct TransitionEntry -{ - OUString msIcon; - OUString msLabel; - size_t mnIndex = 0; - std::vector<OUString> mnVariants; - std::shared_ptr<TransitionPreset> mpPreset; -}; - class SlideTransitionPane final : public PanelLayout , public sfx2::sidebar::ILayoutableWindow { @@ -76,7 +68,7 @@ public: private: void updateControls(); void updateControlState(); - void updateVariants(std::shared_ptr<TransitionPreset> const& pPreset); + void updateVariants(size_t nPresetOffset); void updateSoundList(); void openSoundFileDialog(); @@ -97,7 +89,7 @@ private: DECL_LINK( PlayButtonClicked, weld::Button&, void ); DECL_LINK( AutoPreviewClicked, weld::Toggleable&, void ); - DECL_LINK( TransitionSelected, weld::IconView&, bool ); + DECL_LINK( TransitionSelected, ValueSet*, void ); DECL_LINK( AdvanceSlideRadioButtonToggled, weld::Toggleable&, void ); DECL_LINK( RepeatAfterRadioButtonToggled, weld::Toggleable&, void ); DECL_LINK( AdvanceTimeModified, weld::MetricSpinButton&, void ); @@ -114,8 +106,8 @@ private: SdDrawDocument * mpDrawDoc; std::shared_ptr<sd::tools::EventMultiplexer> mpEventMultiplexer; - std::unique_ptr<weld::IconView> mxTransitionsIconView; - std::unique_ptr<weld::ScrolledWindow> mxTransitionsScrollWindow; + std::unique_ptr<TransitionPane> mxVS_TRANSITION_ICONS; + std::unique_ptr<weld::CustomWeld> mxVS_TRANSITION_ICONSWin; std::unique_ptr<weld::Frame> mxRepeatAutoFrame; std::unique_ptr<weld::ComboBox> mxLB_VARIANT; std::unique_ptr<weld::MetricSpinButton> mxCBX_duration; @@ -135,8 +127,6 @@ private: css::uno::Reference< css::drawing::XDrawView > mxView; rtl::Reference< SdXImpressDocument > mxModel; - std::unordered_map<OUString, std::unique_ptr<TransitionEntry>> maTranstionMap; - bool mbHasSelection; bool mbUpdatingControls; bool mbIsMainViewChangePending; @@ -144,6 +134,9 @@ private: std::vector<OUString> maSoundList; mutable OUString maCurrentSoundFile; + // How many variants each transition set has + std::map< OUString, int > m_aNumVariants; + Timer maLateInitTimer; }; diff --git a/sd/uiconfig/simpress/ui/slidetransitionspanel.ui b/sd/uiconfig/simpress/ui/slidetransitionspanel.ui index bc214c726714..0299141be985 100644 --- a/sd/uiconfig/simpress/ui/slidetransitionspanel.ui +++ b/sd/uiconfig/simpress/ui/slidetransitionspanel.ui @@ -17,16 +17,6 @@ <property name="can-focus">False</property> <property name="icon-name">sd/res/playblue_16.png</property> </object> - <object class="GtkTreeStore" id="liststore1"> - <columns> - <!-- column-name expander --> - <column type="GdkPixbuf"/> - <!-- column-name text --> - <column type="gchararray"/> - <!-- column-name id --> - <column type="gchararray"/> - </columns> - </object> <object class="GtkBox" id="SlideTransitionsPanel"> <property name="visible">True</property> <property name="can-focus">False</property> @@ -41,32 +31,44 @@ <property name="orientation">vertical</property> <property name="spacing">12</property> <child> - <object class="GtkScrolledWindow" id="transitions_icons_scrolled_window"> + <object class="GtkBox" id="box4"> <property name="visible">True</property> - <property name="can-focus">True</property> - <property name="hexpand">True</property> + <property name="can-focus">False</property> <property name="vexpand">True</property> - <property name="hscrollbar-policy">never</property> - <property name="shadow-type">in</property> <child> - <object class="GtkIconView" id="transitions_icons"> + <object class="GtkScrolledWindow" id="transitions_iconswin"> <property name="visible">True</property> <property name="can-focus">True</property> - <property name="margin">6</property> <property name="hexpand">True</property> <property name="vexpand">True</property> - <property name="model">liststore1</property> - <property name="pixbuf-column">0</property> - <property name="text-column">1</property> - <property name="item-width">55</property> - <property name="tooltip-column">1</property> - <property name="activate-on-single-click">True</property> - <child internal-child="accessible"> - <object class="AtkObject" id="transitions_icons-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="slidetransitionspanel|extended_tip|transitions_icons">Select the slide transition you want to use for the selected slides.</property> + <property name="hscrollbar-policy">never</property> + <property name="shadow-type">in</property> + <child> + <object class="GtkViewport"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <child> + <object class="GtkDrawingArea" id="transitions_icons"> + <property name="visible">True</property> + <property name="can-focus">True</property> + <property name="events">GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_STRUCTURE_MASK</property> + <property name="hexpand">True</property> + <property name="vexpand">True</property> + <child internal-child="accessible"> + <object class="AtkObject" id="transitions_icons-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="slidetransitionspanel|extended_tip|transitions_icons">Select the slide transition you want to use for the selected slides.</property> + </object> + </child> + </object> + </child> </object> </child> </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> -e ... etc. - the rest is truncated