core.git: Branch 'libreoffice-24-2' - vcl/source
vcl/source/gdi/pdfwriter_impl.cxx | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) New commits: commit af319f4122aab98d44e88e8d582c109096c57049 Author: Khaled Hosny AuthorDate: Sat May 18 17:23:19 2024 +0300 Commit: Xisco Fauli CommitDate: Mon May 20 10:45:50 2024 +0200 tdf#160884: Apply scale to position of embedded images in Type 3 fonts Regression from: commit bc3f6c3a47411a3b5dafadca4e5c55cd24e30662 Author: Khaled Hosny Date: Tue Aug 22 10:47:33 2023 +0300 tdf#155610: Workaround Acrobat bug with Type 3 fonts and unusual UPEM Change-Id: I5e352292268d19fb8348a038d251f2d395a0be46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167830 Reviewed-by: Stéphane Guillou Reviewed-by: خالد حسني Tested-by: Jenkins (cherry picked from commit 44f2bc12779645bce1000289caf9c66804ecb14e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167815 Reviewed-by: Xisco Fauli diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index ff7383d7be99..16b0b5e23501 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2746,15 +2746,11 @@ bool PDFWriterImpl::emitType3Font(const vcl::font::PhysicalFontFace* pFace, appendDouble(aRect.GetWidth() * fScale, aContents); aContents.append(" 0 0 "); appendDouble(aRect.GetHeight() * fScale, aContents); -aContents.append( -+ " " -+ OString::number(aRect.getX()) -+ " " -+ OString::number(aRect.getY()) -+ " cm " - "/Im" -+ OString::number(nObject) -+ " Do Q "); +aContents.append(" "); +appendDouble(aRect.getX() * fScale, aContents); +aContents.append(" "); +appendDouble(aRect.getY() * fScale, aContents); +aContents.append(" cm /Im" + OString::number(nObject) + " Do Q "); } const auto& rOutline = rGlyph.getOutline();
core.git: vcl/source
vcl/source/gdi/pdfwriter_impl.cxx | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) New commits: commit 44f2bc12779645bce1000289caf9c66804ecb14e Author: Khaled Hosny AuthorDate: Sat May 18 17:23:19 2024 +0300 Commit: خالد حسني CommitDate: Sun May 19 09:30:06 2024 +0200 tdf#160884: Apply scale to position of embedded images in Type 3 fonts Regression from: commit bc3f6c3a47411a3b5dafadca4e5c55cd24e30662 Author: Khaled Hosny Date: Tue Aug 22 10:47:33 2023 +0300 tdf#155610: Workaround Acrobat bug with Type 3 fonts and unusual UPEM Change-Id: I5e352292268d19fb8348a038d251f2d395a0be46 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167830 Reviewed-by: Stéphane Guillou Reviewed-by: خالد حسني Tested-by: Jenkins diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 3474c94c8a72..9d4cd6c51bf0 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2746,15 +2746,11 @@ bool PDFWriterImpl::emitType3Font(const vcl::font::PhysicalFontFace* pFace, appendDouble(aRect.GetWidth() * fScale, aContents); aContents.append(" 0 0 "); appendDouble(aRect.GetHeight() * fScale, aContents); -aContents.append( -+ " " -+ OString::number(aRect.getX()) -+ " " -+ OString::number(aRect.getY()) -+ " cm " - "/Im" -+ OString::number(nObject) -+ " Do Q "); +aContents.append(" "); +appendDouble(aRect.getX() * fScale, aContents); +aContents.append(" "); +appendDouble(aRect.getY() * fScale, aContents); +aContents.append(" cm /Im" + OString::number(nObject) + " Do Q "); } const auto& rOutline = rGlyph.getOutline();
core.git: Branch 'libreoffice-24-2' - include/vcl vcl/source
include/vcl/rendercontext/State.hxx |2 -- vcl/source/gdi/mtfxmldump.cxx |2 -- vcl/source/outdev/stack.cxx |6 -- 3 files changed, 10 deletions(-) New commits: commit fb3b8d1c82dbbccf0bc456662a2a2d7e24da5fdd Author: Khaled Hosny AuthorDate: Mon Feb 26 17:47:59 2024 +0200 Commit: Xisco Fauli CommitDate: Tue Feb 27 12:42:19 2024 +0100 tdf#159251: Revert "vcl: Allow pushing/popping OutputDevice’s RTLEnabled ...state" This reverts commit 611694b707eb43e4c0f20b781f6869016a3ba099. Change-Id: I044e6a1fb08f482c6b494e87f9c23e2303b97fd1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163951 Tested-by: Jenkins Reviewed-by: خالد حسني Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164019 diff --git a/include/vcl/rendercontext/State.hxx b/include/vcl/rendercontext/State.hxx index 33970dcccb7f..0a3d4327af8f 100644 --- a/include/vcl/rendercontext/State.hxx +++ b/include/vcl/rendercontext/State.hxx @@ -53,7 +53,6 @@ enum class PushFlags TEXTLAYOUTMODE = 0x0800, TEXTLANGUAGE = 0x1000, OVERLINECOLOR = 0x2000, -RTLENABLED = 0x4000, ALL = 0x }; } @@ -115,7 +114,6 @@ struct State LanguageType meTextLanguage = LANGUAGE_SYSTEM; PushFlags mnFlags = PushFlags::NONE; bool mbMapActive = false; -bool mbRTLEnabled = false; }; } diff --git a/vcl/source/gdi/mtfxmldump.cxx b/vcl/source/gdi/mtfxmldump.cxx index e6b1adc80eac..2792297feeca 100644 --- a/vcl/source/gdi/mtfxmldump.cxx +++ b/vcl/source/gdi/mtfxmldump.cxx @@ -63,8 +63,6 @@ OUString collectPushFlags(vcl::PushFlags nFlags) aStrings.emplace_back("PushTextLanguage"); if (nFlags & vcl::PushFlags::OVERLINECOLOR) aStrings.emplace_back("PushOverlineColor"); -if (nFlags & vcl::PushFlags::RTLENABLED) -aStrings.emplace_back("PushRTLEnabled"); OUString aString; diff --git a/vcl/source/outdev/stack.cxx b/vcl/source/outdev/stack.cxx index 129348051e3d..72ef63af551d 100644 --- a/vcl/source/outdev/stack.cxx +++ b/vcl/source/outdev/stack.cxx @@ -84,9 +84,6 @@ void OutputDevice::Push(vcl::PushFlags nFlags) if (nFlags & vcl::PushFlags::REFPOINT && mbRefPoint) rState.mpRefPoint = maRefPoint; -if (nFlags & vcl::PushFlags::RTLENABLED) -rState.mbRTLEnabled = IsRTLEnabled(); - if (mpAlphaVDev) mpAlphaVDev->Push(); } @@ -187,9 +184,6 @@ void OutputDevice::Pop() SetRefPoint(); } -if ( rState.mnFlags & vcl::PushFlags::RTLENABLED ) -EnableRTL( rState.mbRTLEnabled ); - maOutDevStateStack.pop_back(); mpMetaFile = pOldMetaFile;
core.git: Branch 'libreoffice-24-2' - 2 commits - include/vcl starmath/source
include/vcl/rendercontext/State.hxx |2 +- starmath/source/document.cxx| 10 ++ 2 files changed, 7 insertions(+), 5 deletions(-) New commits: commit 672378476d214290a10cdaaa03f591bdd4a8ecf5 Author: Khaled Hosny AuthorDate: Mon Feb 26 17:46:42 2024 +0200 Commit: Xisco Fauli CommitDate: Tue Feb 27 12:22:55 2024 +0100 tdf#159251: Don’t use vcl::PushFlags::RTLENABLED I’m going to remove it. Change-Id: I23af5c67633069b7bb6b15c88bdea757815816ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163950 Tested-by: Jenkins Reviewed-by: خالد حسني Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164018 diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index ff28f448cbbd..2c5399ba1c99 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -263,10 +263,10 @@ void SmDocShell::ArrangeFormula() const SmFormat &rFormat = GetFormat(); mpTree->Prepare(rFormat, *this, 0); -pOutDev->Push(vcl::PushFlags::TEXTLAYOUTMODE | vcl::PushFlags::TEXTLANGUAGE | - vcl::PushFlags::RTLENABLED); +pOutDev->Push(vcl::PushFlags::TEXTLAYOUTMODE | vcl::PushFlags::TEXTLANGUAGE); // We want the device to always be LTR, we handle RTL formulas ourselves. +bool bOldRTL = pOutDev->IsRTLEnabled(); pOutDev->EnableRTL(false); // For RTL formulas, we want the brackets to be mirrored. @@ -279,6 +279,7 @@ void SmDocShell::ArrangeFormula() mpTree->Arrange(*pOutDev, rFormat); +pOutDev->EnableRTL(bOldRTL); pOutDev->Pop(); SetFormulaArranged(true); @@ -353,10 +354,10 @@ void SmDocShell::DrawFormula(OutputDevice &rDev, Point &rPosition, bool bDrawSel bRestoreDrawMode = true; } -rDev.Push(vcl::PushFlags::TEXTLAYOUTMODE | vcl::PushFlags::TEXTLANGUAGE | - vcl::PushFlags::RTLENABLED); +rDev.Push(vcl::PushFlags::TEXTLAYOUTMODE | vcl::PushFlags::TEXTLANGUAGE); // We want the device to always be LTR, we handle RTL formulas ourselves. +bool bOldRTL = rDev.IsRTLEnabled(); if (rDev.GetOutDevType() == OUTDEV_WINDOW) rDev.EnableRTL(bRTL); else @@ -385,6 +386,7 @@ void SmDocShell::DrawFormula(OutputDevice &rDev, Point &rPosition, bool bDrawSel //Drawing using visitor SmDrawingVisitor(rDev, aPosition, mpTree.get(), GetFormat()); +rDev.EnableRTL(bOldRTL); rDev.Pop(); if (bRestoreDrawMode) commit 9393b6fcd08db7cb7776388393bb42d318b8a87b Author: Khaled Hosny AuthorDate: Sat Feb 24 11:18:04 2024 +0200 Commit: Xisco Fauli CommitDate: Tue Feb 27 12:22:49 2024 +0100 tdf#159251: Blind fix Hopefully fixes regression introduced in: commit 611694b707eb43e4c0f20b781f6869016a3ba099 Author: Khaled Hosny Date: Thu Aug 17 17:39:29 2023 +0300 vcl: Allow pushing/popping OutputDevice’s RTLEnabled state Change-Id: I9236bd6951d83a512390934127031204d94d14bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163877 Tested-by: Jenkins Reviewed-by: خالد حسني Signed-off-by: Xisco Fauli Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164017 diff --git a/include/vcl/rendercontext/State.hxx b/include/vcl/rendercontext/State.hxx index 0359a486e4b2..33970dcccb7f 100644 --- a/include/vcl/rendercontext/State.hxx +++ b/include/vcl/rendercontext/State.hxx @@ -67,7 +67,7 @@ template <> struct typed_flags : is_typed_flags
core.git: include/vcl vcl/source
include/vcl/rendercontext/State.hxx |2 -- vcl/source/gdi/mtfxmldump.cxx |2 -- vcl/source/outdev/stack.cxx |6 -- 3 files changed, 10 deletions(-) New commits: commit 1c7886d5d80389a876330a1d4a3a350a57126480 Author: Khaled Hosny AuthorDate: Mon Feb 26 17:47:59 2024 +0200 Commit: خالد حسني CommitDate: Mon Feb 26 19:27:40 2024 +0100 tdf#159251: Revert "vcl: Allow pushing/popping OutputDevice’s RTLEnabled ...state" This reverts commit 611694b707eb43e4c0f20b781f6869016a3ba099. Change-Id: I044e6a1fb08f482c6b494e87f9c23e2303b97fd1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163951 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/include/vcl/rendercontext/State.hxx b/include/vcl/rendercontext/State.hxx index 33970dcccb7f..0a3d4327af8f 100644 --- a/include/vcl/rendercontext/State.hxx +++ b/include/vcl/rendercontext/State.hxx @@ -53,7 +53,6 @@ enum class PushFlags TEXTLAYOUTMODE = 0x0800, TEXTLANGUAGE = 0x1000, OVERLINECOLOR = 0x2000, -RTLENABLED = 0x4000, ALL = 0x }; } @@ -115,7 +114,6 @@ struct State LanguageType meTextLanguage = LANGUAGE_SYSTEM; PushFlags mnFlags = PushFlags::NONE; bool mbMapActive = false; -bool mbRTLEnabled = false; }; } diff --git a/vcl/source/gdi/mtfxmldump.cxx b/vcl/source/gdi/mtfxmldump.cxx index e6b1adc80eac..2792297feeca 100644 --- a/vcl/source/gdi/mtfxmldump.cxx +++ b/vcl/source/gdi/mtfxmldump.cxx @@ -63,8 +63,6 @@ OUString collectPushFlags(vcl::PushFlags nFlags) aStrings.emplace_back("PushTextLanguage"); if (nFlags & vcl::PushFlags::OVERLINECOLOR) aStrings.emplace_back("PushOverlineColor"); -if (nFlags & vcl::PushFlags::RTLENABLED) -aStrings.emplace_back("PushRTLEnabled"); OUString aString; diff --git a/vcl/source/outdev/stack.cxx b/vcl/source/outdev/stack.cxx index 129348051e3d..72ef63af551d 100644 --- a/vcl/source/outdev/stack.cxx +++ b/vcl/source/outdev/stack.cxx @@ -84,9 +84,6 @@ void OutputDevice::Push(vcl::PushFlags nFlags) if (nFlags & vcl::PushFlags::REFPOINT && mbRefPoint) rState.mpRefPoint = maRefPoint; -if (nFlags & vcl::PushFlags::RTLENABLED) -rState.mbRTLEnabled = IsRTLEnabled(); - if (mpAlphaVDev) mpAlphaVDev->Push(); } @@ -187,9 +184,6 @@ void OutputDevice::Pop() SetRefPoint(); } -if ( rState.mnFlags & vcl::PushFlags::RTLENABLED ) -EnableRTL( rState.mbRTLEnabled ); - maOutDevStateStack.pop_back(); mpMetaFile = pOldMetaFile;
core.git: starmath/source
starmath/source/document.cxx | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) New commits: commit 17d147952564e5cdfff035ead943b3816e998b96 Author: Khaled Hosny AuthorDate: Mon Feb 26 17:46:42 2024 +0200 Commit: خالد حسني CommitDate: Mon Feb 26 18:38:34 2024 +0100 tdf#159251: Don’t use vcl::PushFlags::RTLENABLED I’m going to remove it. Change-Id: I23af5c67633069b7bb6b15c88bdea757815816ce Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163950 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index d269f2aeaa1c..6da2c96e4265 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -263,10 +263,10 @@ void SmDocShell::ArrangeFormula() const SmFormat &rFormat = GetFormat(); mpTree->Prepare(rFormat, *this, 0); -pOutDev->Push(vcl::PushFlags::TEXTLAYOUTMODE | vcl::PushFlags::TEXTLANGUAGE | - vcl::PushFlags::RTLENABLED); +pOutDev->Push(vcl::PushFlags::TEXTLAYOUTMODE | vcl::PushFlags::TEXTLANGUAGE); // We want the device to always be LTR, we handle RTL formulas ourselves. +bool bOldRTL = pOutDev->IsRTLEnabled(); pOutDev->EnableRTL(false); // For RTL formulas, we want the brackets to be mirrored. @@ -279,6 +279,7 @@ void SmDocShell::ArrangeFormula() mpTree->Arrange(*pOutDev, rFormat); +pOutDev->EnableRTL(bOldRTL); pOutDev->Pop(); SetFormulaArranged(true); @@ -353,10 +354,10 @@ void SmDocShell::DrawFormula(OutputDevice &rDev, Point &rPosition, bool bDrawSel bRestoreDrawMode = true; } -rDev.Push(vcl::PushFlags::TEXTLAYOUTMODE | vcl::PushFlags::TEXTLANGUAGE | - vcl::PushFlags::RTLENABLED); +rDev.Push(vcl::PushFlags::TEXTLAYOUTMODE | vcl::PushFlags::TEXTLANGUAGE); // We want the device to always be LTR, we handle RTL formulas ourselves. +bool bOldRTL = rDev.IsRTLEnabled(); if (rDev.GetOutDevType() == OUTDEV_WINDOW) rDev.EnableRTL(bRTL); else @@ -385,6 +386,7 @@ void SmDocShell::DrawFormula(OutputDevice &rDev, Point &rPosition, bool bDrawSel //Drawing using visitor SmDrawingVisitor(rDev, aPosition, mpTree.get(), GetFormat()); +rDev.EnableRTL(bOldRTL); rDev.Pop(); if (bRestoreDrawMode)
core.git: Branch 'libreoffice-24-2' - download.lst external/more_fonts
download.lst|4 ++-- external/more_fonts/ExternalPackage_noto_kufi_arabic.mk |4 ++-- external/more_fonts/UnpackedTarball_noto_kufi_arabic.mk |2 +- 3 files changed, 5 insertions(+), 5 deletions(-) New commits: commit 4f4003ea7d9292d4b57ff88f6f44bed31337f0a5 Author: Khaled Hosny AuthorDate: Sat Feb 24 11:27:27 2024 +0200 Commit: Xisco Fauli CommitDate: Mon Feb 26 09:35:26 2024 +0100 tdf#124591: upgrade NotoKufiArabic to v2.109 https://github.com/notofonts/arabic/releases/tag/NotoKufiArabic-v2.109 Change-Id: Ifc6d9b6ec3e41dac27406b7582734c2cfd173a5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163878 Tested-by: خالد حسني Reviewed-by: خالد حسني (cherry picked from commit a7e2f44d64e729027fac0cfeaa896d5d76385a6a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163842 Tested-by: Jenkins Reviewed-by: Xisco Fauli diff --git a/download.lst b/download.lst index 04a407c104df..eaaac398e452 100644 --- a/download.lst +++ b/download.lst @@ -162,8 +162,8 @@ FONT_LINLIBERTINEG_TARBALL := e7a384790b13c29113e22e596ade9687-LinLibertineG-201 # three static lines # so that git cherry-pick # will not run into conflicts -FONT_NOTO_KUFI_ARABIC_SHA256SUM := 29acc15a4c4d6b51201ba5d60f303dfbc2e5acbfdb70413c9ae1ed34fa259994 -FONT_NOTO_KUFI_ARABIC_TARBALL := noto-fonts-20171024.tar.gz +FONT_NOTO_KUFI_ARABIC_SHA256SUM := 1b6880e4b8df09c3b9e246d6084bfd94bf32a060cf2dcffd3622d0e2d79f +FONT_NOTO_KUFI_ARABIC_TARBALL := NotoKufiArabic-v2.109.zip # three static lines # so that git cherry-pick # will not run into conflicts diff --git a/external/more_fonts/ExternalPackage_noto_kufi_arabic.mk b/external/more_fonts/ExternalPackage_noto_kufi_arabic.mk index 300e0c8efb53..2a9a053b4874 100644 --- a/external/more_fonts/ExternalPackage_noto_kufi_arabic.mk +++ b/external/more_fonts/ExternalPackage_noto_kufi_arabic.mk @@ -10,8 +10,8 @@ $(eval $(call gb_ExternalPackage_ExternalPackage,fonts_noto_kufi_arabic,font_noto_kufi_arabic)) $(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_noto_kufi_arabic,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ - NotoKufiArabic-Bold.ttf \ - NotoKufiArabic-Regular.ttf \ + NotoKufiArabic/full/ttf/NotoKufiArabic-Bold.ttf \ + NotoKufiArabic/full/ttf/NotoKufiArabic-Regular.ttf \ )) # vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/UnpackedTarball_noto_kufi_arabic.mk b/external/more_fonts/UnpackedTarball_noto_kufi_arabic.mk index 482727dd6246..f5e70d0c5e7a 100644 --- a/external/more_fonts/UnpackedTarball_noto_kufi_arabic.mk +++ b/external/more_fonts/UnpackedTarball_noto_kufi_arabic.mk @@ -9,6 +9,6 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,font_noto_kufi_arabic)) -$(eval $(call gb_UnpackedTarball_set_tarball,font_noto_kufi_arabic,$(FONT_NOTO_KUFI_ARABIC_TARBALL))) +$(eval $(call gb_UnpackedTarball_set_tarball,font_noto_kufi_arabic,$(FONT_NOTO_KUFI_ARABIC_TARBALL),0)) # vim: set noet sw=4 ts=4:
core.git: download.lst external/more_fonts
download.lst|4 ++-- external/more_fonts/ExternalPackage_noto_kufi_arabic.mk |4 ++-- external/more_fonts/UnpackedTarball_noto_kufi_arabic.mk |2 +- 3 files changed, 5 insertions(+), 5 deletions(-) New commits: commit a7e2f44d64e729027fac0cfeaa896d5d76385a6a Author: Khaled Hosny AuthorDate: Sat Feb 24 11:27:27 2024 +0200 Commit: خالد حسني CommitDate: Sun Feb 25 13:21:02 2024 +0100 tdf#124591: upgrade NotoKufiArabic to v2.109 https://github.com/notofonts/arabic/releases/tag/NotoKufiArabic-v2.109 Change-Id: Ifc6d9b6ec3e41dac27406b7582734c2cfd173a5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163878 Tested-by: خالد حسني Reviewed-by: خالد حسني diff --git a/download.lst b/download.lst index b5baf0eaab33..8368b51258dd 100644 --- a/download.lst +++ b/download.lst @@ -162,8 +162,8 @@ FONT_LINLIBERTINEG_TARBALL := e7a384790b13c29113e22e596ade9687-LinLibertineG-201 # three static lines # so that git cherry-pick # will not run into conflicts -FONT_NOTO_KUFI_ARABIC_SHA256SUM := 29acc15a4c4d6b51201ba5d60f303dfbc2e5acbfdb70413c9ae1ed34fa259994 -FONT_NOTO_KUFI_ARABIC_TARBALL := noto-fonts-20171024.tar.gz +FONT_NOTO_KUFI_ARABIC_SHA256SUM := 1b6880e4b8df09c3b9e246d6084bfd94bf32a060cf2dcffd3622d0e2d79f +FONT_NOTO_KUFI_ARABIC_TARBALL := NotoKufiArabic-v2.109.zip # three static lines # so that git cherry-pick # will not run into conflicts diff --git a/external/more_fonts/ExternalPackage_noto_kufi_arabic.mk b/external/more_fonts/ExternalPackage_noto_kufi_arabic.mk index 300e0c8efb53..2a9a053b4874 100644 --- a/external/more_fonts/ExternalPackage_noto_kufi_arabic.mk +++ b/external/more_fonts/ExternalPackage_noto_kufi_arabic.mk @@ -10,8 +10,8 @@ $(eval $(call gb_ExternalPackage_ExternalPackage,fonts_noto_kufi_arabic,font_noto_kufi_arabic)) $(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_noto_kufi_arabic,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ - NotoKufiArabic-Bold.ttf \ - NotoKufiArabic-Regular.ttf \ + NotoKufiArabic/full/ttf/NotoKufiArabic-Bold.ttf \ + NotoKufiArabic/full/ttf/NotoKufiArabic-Regular.ttf \ )) # vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/UnpackedTarball_noto_kufi_arabic.mk b/external/more_fonts/UnpackedTarball_noto_kufi_arabic.mk index 482727dd6246..f5e70d0c5e7a 100644 --- a/external/more_fonts/UnpackedTarball_noto_kufi_arabic.mk +++ b/external/more_fonts/UnpackedTarball_noto_kufi_arabic.mk @@ -9,6 +9,6 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,font_noto_kufi_arabic)) -$(eval $(call gb_UnpackedTarball_set_tarball,font_noto_kufi_arabic,$(FONT_NOTO_KUFI_ARABIC_TARBALL))) +$(eval $(call gb_UnpackedTarball_set_tarball,font_noto_kufi_arabic,$(FONT_NOTO_KUFI_ARABIC_TARBALL),0)) # vim: set noet sw=4 ts=4:
core.git: include/vcl
include/vcl/rendercontext/State.hxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 6cad38dece31eb035a9685ed8d123a74a0b69637 Author: Khaled Hosny AuthorDate: Sat Feb 24 11:18:04 2024 +0200 Commit: خالد حسني CommitDate: Sat Feb 24 13:40:42 2024 +0100 tdf#159251: Blind fix Hopefully fixes regression introduced in: commit 611694b707eb43e4c0f20b781f6869016a3ba099 Author: Khaled Hosny Date: Thu Aug 17 17:39:29 2023 +0300 vcl: Allow pushing/popping OutputDevice’s RTLEnabled state Change-Id: I9236bd6951d83a512390934127031204d94d14bb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163877 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/include/vcl/rendercontext/State.hxx b/include/vcl/rendercontext/State.hxx index 0359a486e4b2..33970dcccb7f 100644 --- a/include/vcl/rendercontext/State.hxx +++ b/include/vcl/rendercontext/State.hxx @@ -67,7 +67,7 @@ template <> struct typed_flags : is_typed_flags
[Libreoffice-commits] core.git: vcl/source
vcl/source/gdi/CommonSalLayout.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit fdbf404073bd4a59dc0378418cad297a547d5dd4 Author: Khaled Hosny AuthorDate: Thu Nov 30 12:32:23 2023 +0200 Commit: خالد حسني CommitDate: Thu Nov 30 13:18:02 2023 +0100 vcl: Fix comment The comment is saying the opposite of what the code is doing. Change-Id: I16cc44b56f90f622cedb87b9107d17b940665896 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160144 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index da2c898c8b24..bcf6f54639e8 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -192,8 +192,8 @@ bool GenericSalLayout::HasVerticalAlternate(sal_UCS4 aChar, sal_UCS4 aVariationS hb_ot_layout_collect_lookups(pHbFace, HB_OT_TAG_GSUB, nullptr, nullptr, pFeatures, pLookups); if (!hb_set_is_empty(pLookups)) { -// Find the output glyphs in each lookup (i.e. the glyphs that -// would result from applying this lookup). +// Find the input glyphs in each lookup (i.e. the glyphs that +// this lookup applies to). hb_codepoint_t nIdx = HB_SET_VALUE_INVALID; while (hb_set_next(pLookups, &nIdx)) {
Re: New test failure with harfbuzz 8.2
> On 29 Sep 2023, at 10:00 AM, Mattia Verga > wrote: > > Hi, > > Fedora upgraded harfbuzz from version 8.1 to 8.2 and as a result this > test started to fail: This is an upstream regression, see https://github.com/harfbuzz/harfbuzz/issues/4414. Regards, Khaled
[Libreoffice-commits] core.git: 2 commits - starmath/inc starmath/source
starmath/inc/strings.hxx | 601 +++--- starmath/inc/token.hxx|3 starmath/source/ElementsDockingWindow.cxx | 55 ++ starmath/source/parse5.cxx| 33 + 4 files changed, 388 insertions(+), 304 deletions(-) New commits: commit fb0ecd64011922bc47716f77d4225bca3a8b0858 Author: Khaled Hosny AuthorDate: Thu Sep 28 12:08:20 2023 +0300 Commit: خالد حسني CommitDate: Thu Sep 28 14:34:43 2023 +0200 starmath: Add Arabic functions to elements panel Change-Id: I9aa1bdd344dbca078aec683b5fcd93fd07d98521 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157365 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/inc/strings.hxx b/starmath/inc/strings.hxx index 4be4f1d144f5..cf8e7d5de2ce 100644 --- a/starmath/inc/strings.hxx +++ b/starmath/inc/strings.hxx @@ -20,294 +20,319 @@ inline constexpr OUStringLiteral RID_UNDOFORMATNAME = u"Format"; // clang-format off -#define RID_PLUSX "+ " -#define RID_MINUSX "- " -#define RID_PLUSMINUSX "+- " -#define RID_MINUSPLUSX "-+ " -#define RID_NEGX"neg " -#define RID_XPLUSY " + " -#define RID_XMINUSY " - " -#define RID_XCDOTY " cdot " -#define RID_XTIMESY " times " -#define RID_XSYMTIMESY " * " -#define RID_XSYMDIVIDEY " / " -#define RID_XDIVY " div " -#define RID_XOVERY "{} over {} " -#define RID_FRACXY "frac {} {} " -#define RID_XODIVIDEY " odivide " -#define RID_XODOTY " odot " -#define RID_XOMINUSY" ominus " -#define RID_XOPLUSY " oplus " -#define RID_XOTIMESY" otimes " -#define RID_XANDY " and " -#define RID_XORY" or " -#define RID_XEQY" = " -#define RID_XNEQY " <> " -#define RID_XLTY" < " -#define RID_XGTY" > " -#define RID_XLEY" <= " -#define RID_XGEY" >= " -#define RID_XLESLANTY " leslant " -#define RID_XGESLANTY " geslant " -#define RID_XLLY" << " -#define RID_XGGY" >> " -#define RID_XDEFY " def " -#define RID_XEQUIVY " equiv " -#define RID_XAPPROXY" approx " -#define RID_XSIMY " sim " -#define RID_XSIMEQY " simeq " -#define RID_XPROPY " prop " -#define RID_XORTHOY " ortho " -#define RID_XPARALLELY " parallel " -#define RID_XTOWARDY" toward " -#define RID_XTRANSLY" transl " -#define RID_XTRANSRY" transr " -#define RID_XINY" in " -#define RID_XNOTINY " notin " -#define RID_XOWNSY " owns " -#define RID_XUNIONY " union " -#define RID_XINTERSECTIONY " intersection " -#define RID_XSETMINUSY " setminus " -#define RID_XSETQUOTIENTY " setquotient " -#define RID_XSUBSETY" subset " -#define RID_XSUBSETEQY " subseteq " -#define RID_XSUPSETY" supset " -#define RID_XSUPSETEQY " supseteq " -#define RID_XNSUBSETY " nsubset " -#define RID_XNSUBSETEQY " nsubseteq " -#define RID_XNSUPSETY " nsupset " -#define RID_XNSUPSETEQY " nsupseteq " -#define RID_FUNCX "func () " -#define RID_ABSX"abs{} " -#define RID_FACTX "fact{} " -#define RID_SQRTX "sqrt{} " -#define RID_NROOTXY "nroot{}{} " -#define RID_EX "func e^{} " -#define RID_EXPX"exp() " -#define RID_LNX "ln() " -#define RID_LOGX"log() " -#define RID_SINX"sin() " -#define RID_COSX"cos() " -#define RID_TANX"tan() " -#define RID_COTX"cot() " -#define RID_ARCSINX "arcsin() " -#define RID_ARCCOSX "arccos() " -#define RID_ARCTANX "arctan() " -#define RID_ARCCOTX "arcco
[Libreoffice-commits] core.git: 3 commits - starmath/CppunitTest_starmath_export.mk starmath/CppunitTest_starmath_qa_cppunit.mk starmath/inc starmath/Library_sm.mk starmath/source
starmath/CppunitTest_starmath_export.mk |1 starmath/CppunitTest_starmath_qa_cppunit.mk |5 + starmath/Library_sm.mk |1 starmath/inc/dialog.hxx |6 +- starmath/inc/node.hxx |2 starmath/source/dialog.cxx | 33 +-- starmath/source/node.cxx| 80 +--- 7 files changed, 87 insertions(+), 41 deletions(-) New commits: commit ff28544c5310870cd98402d89ba53cfa7b7f598d Author: Khaled Hosny AuthorDate: Thu Sep 28 10:41:41 2023 +0300 Commit: خالد حسني CommitDate: Thu Sep 28 14:34:28 2023 +0200 starmath: Arabic text should always be upright Change-Id: Ibe9f3092432ae4ffd81903df8672daf90947000c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157349 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 695e1b4e3a8c..1a89b52c4110 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -1868,8 +1868,24 @@ void SmTextNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell, i // special handling for ':' where it is a token on its own and is likely // to be used for mathematical notations. (E.g. a:b = 2:3) // In that case it should not be displayed in italic. -if (GetToken().aText.getLength() == 1 && GetToken().aText[0] == ':') +if (maText.getLength() == 1 && GetToken().aText[0] == ':') Attributes() &= ~FontAttribute::Italic; + +// Arabic text should not be italic, so we check for any charcter in Arabic script and +// remove italic attribute. +if (!maText.isEmpty()) +{ +sal_Int32 nIndex = 0; +while (nIndex < maText.getLength()) +{ +sal_uInt32 cChar = maText.iterateCodePoints(&nIndex); +if (u_getIntPropertyValue(cChar, UCHAR_SCRIPT) == USCRIPT_ARABIC) +{ +Attributes() &= ~FontAttribute::Italic; +break; +} +} +} }; commit c7f20a1dad66a7d3241c103546cd268152bc778f Author: Khaled Hosny AuthorDate: Thu Sep 28 10:15:03 2023 +0300 Commit: خالد حسني CommitDate: Thu Sep 28 14:34:22 2023 +0200 tdf#142095: Render symbols in Math Symbols Catalogue using document settings Use the document format to resolve the font and style of the symbol. This makes the symbols use the current document font, as well as apply settings like GreekCharStyle. Change-Id: I668e582704b7e011e032f8b9e1dfb509e0d00d3e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157348 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx index bed55f9ddabf..66db01d295f4 100644 --- a/starmath/inc/dialog.hxx +++ b/starmath/inc/dialog.hxx @@ -247,6 +247,7 @@ public: class SmShowSymbolSet final : public weld::CustomWidgetController { +SmViewShell &m_rViewShell; Size m_aOldSize; SymbolPtrVec_t aSymbolSet; Link aSelectHdlLink; @@ -268,7 +269,7 @@ class SmShowSymbolSet final : public weld::CustomWidgetController DECL_LINK(ScrollHdl, weld::ScrolledWindow&, void); public: -SmShowSymbolSet(std::unique_ptr pScrolledWindow); +SmShowSymbolSet(std::unique_ptr pScrolledWindow, SmViewShell &rViewShell); virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override { @@ -291,6 +292,7 @@ public: class SmShowSymbol final : public weld::CustomWidgetController { private: +SmViewShell &m_rViewShell; vcl::Font m_aFont; OUString m_aText; @@ -302,7 +304,7 @@ private: void setFontSize(vcl::Font &rFont) const; public: -SmShowSymbol(); +SmShowSymbol(SmViewShell &rViewShell); virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override { diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index c87b987660e4..585f5a0df475 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -85,6 +85,24 @@ public: const OUString& GetStyleName(sal_uInt16 nIdx) const; }; +vcl::Font lclGetSymbolFont(const SmViewShell& rViewShell, const SmSym &rSymbol) +{ +const SmDocShell* pDoc = rViewShell.GetDoc(); +if (pDoc) +{ +// If we have a document, we want to render the symbol useing the font and style used in +// the documnet, so we do that by creating a node and preparing it, then get the resolved +// font and style from it. +SmToken token(TSPECIAL, '\0', "%" + rSymbol.GetUiName()); +SmSpecialNode aNode(token); +aNode.Prepare(pDoc->GetFormat(), *pDoc, 1); +aNode.PrepareAttributes(); +return aNode.GetFont(); +} + +return rSymbol.GetFace(); +} + } // end anonymous namespace SmFontS
[Libreoffice-commits] core.git: 3 commits - download.lst external/more_fonts Makefile.fetch vcl/qa
Makefile.fetch |3 +- download.lst |9 ++- external/more_fonts/ExternalPackage_noto_kufi_arabic.mk |7 -- external/more_fonts/ExternalPackage_noto_naskh_arabic.mk | 17 +++ external/more_fonts/Module_more_fonts.mk |6 +++-- external/more_fonts/UnpackedTarball_noto_kufi_arabic.mk |4 +-- external/more_fonts/UnpackedTarball_noto_naskh_arabic.mk | 14 vcl/qa/cppunit/complextext.cxx | 14 ++-- 8 files changed, 54 insertions(+), 20 deletions(-) New commits: commit 2902ab24ecc5ffbf4907ea83b2028508b9de6364 Author: Khaled Hosny AuthorDate: Tue Sep 26 16:11:27 2023 +0300 Commit: خالد حسني CommitDate: Tue Sep 26 22:00:56 2023 +0200 tdf#124591: Rename *noto.mk to *noto_kufi_arabic.mk Since it is the only one left in this package. Still using the old tarball, though, since there does not exist any releases upstream (yet): https://github.com/notofonts/arabic Change-Id: I9a21fda5519bbf184af9b2e70b8cf65e3046a724 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157283 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/Makefile.fetch b/Makefile.fetch index 1a91c7f785c9..41d6a85d13c0 100644 --- a/Makefile.fetch +++ b/Makefile.fetch @@ -179,7 +179,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_$(gb_Side).mk $(SRCDIR)/download.lst $(S $(call fetch_Optional,MORE_FONTS,FONT_LIBERATION_NARROW_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_LIBERATION_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_LINLIBERTINEG_TARBALL) \ - $(call fetch_Optional,MORE_FONTS,FONT_NOTO_TARBALL) \ + $(call fetch_Optional,MORE_FONTS,FONT_NOTO_KUFI_ARABIC_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_NOTO_SANS_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_NOTO_SERIF_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_NOTO_SANS_ARABIC_TARBALL) \ diff --git a/download.lst b/download.lst index e06dbad101f6..20b9e5d754aa 100644 --- a/download.lst +++ b/download.lst @@ -157,8 +157,8 @@ FONT_LINLIBERTINEG_TARBALL := e7a384790b13c29113e22e596ade9687-LinLibertineG-201 # three static lines # so that git cherry-pick # will not run into conflicts -FONT_NOTO_SHA256SUM := 29acc15a4c4d6b51201ba5d60f303dfbc2e5acbfdb70413c9ae1ed34fa259994 -FONT_NOTO_TARBALL := noto-fonts-20171024.tar.gz +FONT_NOTO_KUFI_ARABIC_SHA256SUM := 29acc15a4c4d6b51201ba5d60f303dfbc2e5acbfdb70413c9ae1ed34fa259994 +FONT_NOTO_KUFI_ARABIC_TARBALL := noto-fonts-20171024.tar.gz # three static lines # so that git cherry-pick # will not run into conflicts diff --git a/external/more_fonts/ExternalPackage_noto.mk b/external/more_fonts/ExternalPackage_noto_kufi_arabic.mk similarity index 96% rename from external/more_fonts/ExternalPackage_noto.mk rename to external/more_fonts/ExternalPackage_noto_kufi_arabic.mk index c9b25163b888..ed6b9fea3f85 100644 --- a/external/more_fonts/ExternalPackage_noto.mk +++ b/external/more_fonts/ExternalPackage_noto_kufi_arabic.mk @@ -7,7 +7,7 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # -$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_noto,font_noto)) +$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_noto,font_noto_kufi_arabic)) $(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_noto,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ NotoKufiArabic-Bold.ttf \ diff --git a/external/more_fonts/Module_more_fonts.mk b/external/more_fonts/Module_more_fonts.mk index f37a5c34fbc0..e17af9a15141 100644 --- a/external/more_fonts/Module_more_fonts.mk +++ b/external/more_fonts/Module_more_fonts.mk @@ -21,7 +21,7 @@ $(eval $(call gb_Module_add_targets,more_fonts,\ ExternalPackage_liberation_narrow \ ExternalPackage_libertineg \ ExternalPackage_libre_hebrew \ - ExternalPackage_noto \ + ExternalPackage_noto_kufi_arabic \ ExternalPackage_noto_naskh_arabic \ ExternalPackage_noto_sans \ ExternalPackage_noto_sans_arabic \ @@ -48,7 +48,7 @@ $(eval $(call gb_Module_add_targets,more_fonts,\ UnpackedTarball_liberation_narrow \ UnpackedTarball_libertineg \ UnpackedTarball_libre_hebrew \ - UnpackedTarball_noto \ + UnpackedTarball_noto_kufi_arabic \ UnpackedTarball_noto_naskh_arabic \ UnpackedTarball_noto_sans \ UnpackedTarball_noto_sans_arabic \ diff --git a/external/more_fonts/UnpackedTarball_noto.mk b/external/more_fonts/UnpackedTarball_noto_kufi_arabic.mk similarity index 66% rename from external/more_fonts/UnpackedTarball_noto.mk rename to external/more_fonts/UnpackedTarball_noto_kufi_arabic.mk index ee6f223f8cad..482727dd6246 100644 --- a/external/more_fonts/UnpackedTarball_noto.mk +++ b/external/more_fonts
[Libreoffice-commits] core.git: 3 commits - download.lst external/more_fonts Makefile.fetch
Makefile.fetch|3 +++ download.lst | 15 +++ external/more_fonts/ExternalPackage_noto.mk |5 - external/more_fonts/ExternalPackage_noto_sans_lao.mk | 17 + external/more_fonts/ExternalPackage_noto_sans_lisu.mk | 17 + external/more_fonts/ExternalPackage_noto_serif_lao.mk | 17 + external/more_fonts/Module_more_fonts.mk |6 ++ external/more_fonts/UnpackedTarball_noto_sans_lao.mk | 14 ++ external/more_fonts/UnpackedTarball_noto_sans_lisu.mk | 14 ++ external/more_fonts/UnpackedTarball_noto_serif_lao.mk | 14 ++ 10 files changed, 117 insertions(+), 5 deletions(-) New commits: commit 00db8423d18d75f982b337744ec39c4b7269a433 Author: Khaled Hosny AuthorDate: Tue Sep 26 13:15:29 2023 +0300 Commit: خالد حسني CommitDate: Tue Sep 26 22:00:38 2023 +0200 tdf#124591: Update Noto Sans Lisu to v2.102 from: https://github.com/notofonts/lisu/releases/tag/NotoSansLisu-v2.102 Change-Id: I205cf05d6f33e1083e30193d7ed775d9775af2f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157280 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/Makefile.fetch b/Makefile.fetch index 7d089de612ed..c8ea14b3a6bc 100644 --- a/Makefile.fetch +++ b/Makefile.fetch @@ -191,6 +191,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_$(gb_Side).mk $(SRCDIR)/download.lst $(S $(call fetch_Optional,MORE_FONTS,FONT_NOTO_SERIF_GEORGIAN_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_NOTO_SANS_LAO_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_NOTO_SERIF_LAO_TARBALL) \ + $(call fetch_Optional,MORE_FONTS,FONT_NOTO_SANS_LISU_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_CULMUS_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_LIBRE_HEBREW_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_ALEF_TARBALL) \ diff --git a/download.lst b/download.lst index 06a7ac8e2f52..b470064253a0 100644 --- a/download.lst +++ b/download.lst @@ -217,6 +217,11 @@ FONT_NOTO_SERIF_LAO_TARBALL := NotoSerifLao-v2.003.zip # three static lines # so that git cherry-pick # will not run into conflicts +FONT_NOTO_SANS_LISU_SHA256SUM := b12a1ff762680681b7ce4d98dd29a7f54d90f5bcadd10c955afc640a27b3a268 +FONT_NOTO_SANS_LISU_TARBALL := NotoSansLisu-v2.102.zip +# three static lines +# so that git cherry-pick +# will not run into conflicts FONT_CULMUS_SHA256SUM := c0c6873742d07544f6bacf2ad52eb9cb392974d56427938dc1dfbc8399c64d05 FONT_CULMUS_TARBALL := culmus-0.133.tar.gz # three static lines diff --git a/external/more_fonts/ExternalPackage_noto.mk b/external/more_fonts/ExternalPackage_noto.mk index f953ec31646a..d5bfe4cf8b88 100644 --- a/external/more_fonts/ExternalPackage_noto.mk +++ b/external/more_fonts/ExternalPackage_noto.mk @@ -17,7 +17,6 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_noto,$(LIBO_SHARE_FOLD NotoNaskhArabic-Regular.ttf \ NotoNaskhArabicUI-Bold.ttf \ NotoNaskhArabicUI-Regular.ttf \ - NotoSansLisu-Regular.ttf \ )) # vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/ExternalPackage_noto_sans_lisu.mk b/external/more_fonts/ExternalPackage_noto_sans_lisu.mk new file mode 100644 index ..9200e5698741 --- /dev/null +++ b/external/more_fonts/ExternalPackage_noto_sans_lisu.mk @@ -0,0 +1,17 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_noto,font_noto_sans_lisu)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_noto,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + NotoSansLisu/full/ttf/NotoSansLisu-Bold.ttf \ + NotoSansLisu/full/ttf/NotoSansLisu-Regular.ttf \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/Module_more_fonts.mk b/external/more_fonts/Module_more_fonts.mk index ac4031bedcf6..12bcabcc604d 100644 --- a/external/more_fonts/Module_more_fonts.mk +++ b/external/more_fonts/Module_more_fonts.mk @@ -28,6 +28,7 @@ $(eval $(call gb_Module_add_targets,more_fonts,\ ExternalPackage_noto_sans_georgian \ ExternalPackage_noto_sans_hebrew \ ExternalPackage_noto_sans_lao \ + ExternalPackage_noto_sans_lisu \ ExternalPackage_noto_serif \ ExternalPackage_noto_serif_armenian \ ExternalPackage_noto_serif_georgian \ @@ -53,6 +54,7 @@ $(eval $(call gb_Module_add_targets,more_fonts,\ UnpackedTarball_noto_sans_georgian \ UnpackedTarball_noto_sans_hebrew
[Libreoffice-commits] core.git: 3 commits - download.lst external/more_fonts Makefile.fetch
Makefile.fetch |3 ++ download.lst | 15 +++ external/more_fonts/ExternalPackage_noto.mk|6 external/more_fonts/ExternalPackage_noto_sans_georgian.mk | 17 + external/more_fonts/ExternalPackage_noto_serif_armenian.mk | 17 + external/more_fonts/ExternalPackage_noto_serif_georgian.mk | 17 + external/more_fonts/Module_more_fonts.mk |6 external/more_fonts/UnpackedTarball_noto_sans_georgian.mk | 14 ++ external/more_fonts/UnpackedTarball_noto_serif_armenian.mk | 14 ++ external/more_fonts/UnpackedTarball_noto_serif_georgian.mk | 14 ++ 10 files changed, 117 insertions(+), 6 deletions(-) New commits: commit 0d49ac1ba30e2cb6247a77e75383176a4624adfd Author: Khaled Hosny AuthorDate: Tue Sep 26 12:56:53 2023 +0300 Commit: خالد حسني CommitDate: Tue Sep 26 21:54:19 2023 +0200 tdf#124591: Update Noto Serif Georgian to v2.003 from: https://github.com/notofonts/georgian/releases/tag/NotoSerifGeorgian-v2.003 Change-Id: I230b8eed49f024e2361e27df963424d7113e52fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157277 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/Makefile.fetch b/Makefile.fetch index 6f1e8a8b4bdc..52b272a2f31f 100644 --- a/Makefile.fetch +++ b/Makefile.fetch @@ -188,6 +188,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_$(gb_Side).mk $(SRCDIR)/download.lst $(S $(call fetch_Optional,MORE_FONTS,FONT_NOTO_SANS_ARMENIAN_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_NOTO_SERIF_ARMENIAN_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_NOTO_SANS_GEORGIAN_TARBALL) \ + $(call fetch_Optional,MORE_FONTS,FONT_NOTO_SERIF_GEORGIAN_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_CULMUS_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_LIBRE_HEBREW_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_ALEF_TARBALL) \ diff --git a/download.lst b/download.lst index d89d86fbe62f..b1797173b71f 100644 --- a/download.lst +++ b/download.lst @@ -202,6 +202,11 @@ FONT_NOTO_SANS_GEORGIAN_TARBALL := NotoSansGeorgian-v2.003.zip # three static lines # so that git cherry-pick # will not run into conflicts +FONT_NOTO_SERIF_GEORGIAN_SHA256SUM := cfb41a264b97d463bab6807a5be937ba4a6ddcfa93d519a21b98b0ba73ca27d4 +FONT_NOTO_SERIF_GEORGIAN_TARBALL := NotoSerifGeorgian-v2.003.zip +# three static lines +# so that git cherry-pick +# will not run into conflicts FONT_CULMUS_SHA256SUM := c0c6873742d07544f6bacf2ad52eb9cb392974d56427938dc1dfbc8399c64d05 FONT_CULMUS_TARBALL := culmus-0.133.tar.gz # three static lines diff --git a/external/more_fonts/ExternalPackage_noto.mk b/external/more_fonts/ExternalPackage_noto.mk index 3b622aa65114..76e6dab93ebb 100644 --- a/external/more_fonts/ExternalPackage_noto.mk +++ b/external/more_fonts/ExternalPackage_noto.mk @@ -20,8 +20,6 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_noto,$(LIBO_SHARE_FOLD NotoSansLao-Bold.ttf \ NotoSansLao-Regular.ttf \ NotoSansLisu-Regular.ttf \ - NotoSerifGeorgian-Bold.ttf \ - NotoSerifGeorgian-Regular.ttf \ NotoSerifLao-Bold.ttf \ NotoSerifLao-Regular.ttf \ )) diff --git a/external/more_fonts/ExternalPackage_noto_serif_georgian.mk b/external/more_fonts/ExternalPackage_noto_serif_georgian.mk new file mode 100644 index ..8210e620bbc8 --- /dev/null +++ b/external/more_fonts/ExternalPackage_noto_serif_georgian.mk @@ -0,0 +1,17 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_noto,font_noto_serif_georgian)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_noto,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + NotoSerifGeorgian/full/ttf/NotoSerifGeorgian-Bold.ttf \ + NotoSerifGeorgian/full/ttf/NotoSerifGeorgian-Regular.ttf \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/Module_more_fonts.mk b/external/more_fonts/Module_more_fonts.mk index 00f65930408f..d99dcaf618a6 100644 --- a/external/more_fonts/Module_more_fonts.mk +++ b/external/more_fonts/Module_more_fonts.mk @@ -29,6 +29,7 @@ $(eval $(call gb_Module_add_targets,more_fonts,\ ExternalPackage_noto_sans_hebrew \ ExternalPackage_noto_serif \ ExternalPackage_noto_serif_armenian \ + ExternalPackage_noto_serif_georgian \ ExternalPackage_noto_serif_hebrew \ ExternalPackage_reem \ ExternalPackage_scheherazade \ @@ -51,6 +52,7
[Libreoffice-commits] core.git: 3 commits - download.lst external/more_fonts Makefile.fetch
Makefile.fetch|3 ++ download.lst | 15 external/more_fonts/ExternalPackage_noto.mk |6 external/more_fonts/ExternalPackage_noto_sans_armenian.mk | 17 ++ external/more_fonts/ExternalPackage_noto_sans_hebrew.mk | 17 ++ external/more_fonts/ExternalPackage_noto_serif_hebrew.mk | 17 ++ external/more_fonts/Module_more_fonts.mk |6 external/more_fonts/UnpackedTarball_noto_sans_armenian.mk | 14 +++ external/more_fonts/UnpackedTarball_noto_sans_hebrew.mk | 14 +++ external/more_fonts/UnpackedTarball_noto_serif_hebrew.mk | 14 +++ 10 files changed, 117 insertions(+), 6 deletions(-) New commits: commit d69317ca8f4b39c7fe62e9404f93d5d43e5495d6 Author: Khaled Hosny AuthorDate: Tue Sep 26 12:28:42 2023 +0300 Commit: خالد حسني CommitDate: Tue Sep 26 21:54:00 2023 +0200 tdf#124591: Update Noto Sans Armenian to v2.008 from: https://github.com/notofonts/armenian/releases/tag/NotoSansArmenian-v2.008 Change-Id: I92bd6f05e9022b6c1f25ac460e64b12209016297 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157274 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/Makefile.fetch b/Makefile.fetch index 1f7306941de6..3daedcb32695 100644 --- a/Makefile.fetch +++ b/Makefile.fetch @@ -185,6 +185,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_$(gb_Side).mk $(SRCDIR)/download.lst $(S $(call fetch_Optional,MORE_FONTS,FONT_NOTO_SANS_ARABIC_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_NOTO_SANS_HEBREW_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_NOTO_SERIF_HEBREW_TARBALL) \ + $(call fetch_Optional,MORE_FONTS,FONT_NOTO_SANS_ARMENIAN_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_CULMUS_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_LIBRE_HEBREW_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_ALEF_TARBALL) \ diff --git a/download.lst b/download.lst index 1a3a1f2e0af3..f62fedfcddcf 100644 --- a/download.lst +++ b/download.lst @@ -187,6 +187,11 @@ FONT_NOTO_SANS_HEBREW_TARBALL := NotoSansHebrew-v2.003.zip # three static lines # so that git cherry-pick # will not run into conflicts +FONT_NOTO_SANS_ARMENIAN_SHA256SUM := eab89b99e134177ca6a3f9f0412a7cb812aafceb13175d686b4c45cb237f64ac +FONT_NOTO_SANS_ARMENIAN_TARBALL := NotoSansArmenian-v2.008.zip +# three static lines +# so that git cherry-pick +# will not run into conflicts FONT_CULMUS_SHA256SUM := c0c6873742d07544f6bacf2ad52eb9cb392974d56427938dc1dfbc8399c64d05 FONT_CULMUS_TARBALL := culmus-0.133.tar.gz # three static lines diff --git a/external/more_fonts/ExternalPackage_noto.mk b/external/more_fonts/ExternalPackage_noto.mk index dfb3b170e187..514b17933e43 100644 --- a/external/more_fonts/ExternalPackage_noto.mk +++ b/external/more_fonts/ExternalPackage_noto.mk @@ -17,8 +17,6 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_noto,$(LIBO_SHARE_FOLD NotoNaskhArabic-Regular.ttf \ NotoNaskhArabicUI-Bold.ttf \ NotoNaskhArabicUI-Regular.ttf \ - NotoSansArmenian-Bold.ttf \ - NotoSansArmenian-Regular.ttf \ NotoSansGeorgian-Bold.ttf \ NotoSansGeorgian-Regular.ttf \ NotoSansLao-Bold.ttf \ diff --git a/external/more_fonts/ExternalPackage_noto_sans_armenian.mk b/external/more_fonts/ExternalPackage_noto_sans_armenian.mk new file mode 100644 index ..d6b7a12753c2 --- /dev/null +++ b/external/more_fonts/ExternalPackage_noto_sans_armenian.mk @@ -0,0 +1,17 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_noto,font_noto_sans_armenian)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_noto,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + NotoSansArmenian/full/ttf/NotoSansArmenian-Bold.ttf \ + NotoSansArmenian/full/ttf/NotoSansArmenian-Regular.ttf \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/Module_more_fonts.mk b/external/more_fonts/Module_more_fonts.mk index 464b8ab74142..d5ed948db7ff 100644 --- a/external/more_fonts/Module_more_fonts.mk +++ b/external/more_fonts/Module_more_fonts.mk @@ -24,6 +24,7 @@ $(eval $(call gb_Module_add_targets,more_fonts,\ ExternalPackage_noto \ ExternalPackage_noto_sans \ ExternalPackage_noto_sans_arabic \ + ExternalPackage_noto_sans_armenian \ ExternalPackage_noto_sans_hebrew \ ExternalPackage_noto_serif \ ExternalPackage_noto_serif_hebrew
[Libreoffice-commits] core.git: 4 commits - download.lst external/more_fonts Makefile.fetch svgio/qa svgio/source
Makefile.fetch |3 ++ download.lst| 15 ++ external/more_fonts/ExternalPackage_noto.mk | 24 external/more_fonts/ExternalPackage_noto_sans.mk| 19 external/more_fonts/ExternalPackage_noto_sans_arabic.mk | 17 +++ external/more_fonts/ExternalPackage_noto_serif.mk | 19 external/more_fonts/Module_more_fonts.mk|6 external/more_fonts/UnpackedTarball_noto_sans.mk| 14 + external/more_fonts/UnpackedTarball_noto_sans_arabic.mk | 14 + external/more_fonts/UnpackedTarball_noto_serif.mk | 14 + svgio/qa/cppunit/SvgImportTest.cxx | 24 svgio/qa/cppunit/data/tdf97710.svg |8 + svgio/source/svgreader/svgstyleattributes.cxx |3 -- 13 files changed, 154 insertions(+), 26 deletions(-) New commits: commit 9998c242c6c2ece5f240db2f6ffdf04e7ca7cbb4 Author: Khaled Hosny AuthorDate: Tue Sep 26 11:47:19 2023 +0300 Commit: خالد حسني CommitDate: Tue Sep 26 21:53:36 2023 +0200 tdf#124591: Update Noto Sans Arabic to v2.010 from: https://github.com/notofonts/arabic/releases/tag/NotoSansArabic-v2.010 Change-Id: Icb4a2932c84884180eed7f391ecd7285311299b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157270 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/Makefile.fetch b/Makefile.fetch index 829323fa8496..efb24f1b1280 100644 --- a/Makefile.fetch +++ b/Makefile.fetch @@ -182,6 +182,7 @@ $(WORKDIR)/download: $(BUILDDIR)/config_$(gb_Side).mk $(SRCDIR)/download.lst $(S $(call fetch_Optional,MORE_FONTS,FONT_NOTO_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_NOTO_SANS_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_NOTO_SERIF_TARBALL) \ + $(call fetch_Optional,MORE_FONTS,FONT_NOTO_SANS_ARABIC_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_CULMUS_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_LIBRE_HEBREW_TARBALL) \ $(call fetch_Optional,MORE_FONTS,FONT_ALEF_TARBALL) \ diff --git a/download.lst b/download.lst index 4aec2aed751b..1de6ee0cb02c 100644 --- a/download.lst +++ b/download.lst @@ -172,6 +172,11 @@ FONT_NOTO_SERIF_TARBALL := NotoSerif-v2.012.zip # three static lines # so that git cherry-pick # will not run into conflicts +FONT_NOTO_SANS_ARABIC_SHA256SUM := a5a34ac1ea01d0d71c083f99440ebfb1f64224474a0d88bb7ef0e2f8d9a996d2 +FONT_NOTO_SANS_ARABIC_TARBALL := NotoSansArabic-v2.010.zip +# three static lines +# so that git cherry-pick +# will not run into conflicts FONT_CULMUS_SHA256SUM := c0c6873742d07544f6bacf2ad52eb9cb392974d56427938dc1dfbc8399c64d05 FONT_CULMUS_TARBALL := culmus-0.133.tar.gz # three static lines diff --git a/external/more_fonts/ExternalPackage_noto.mk b/external/more_fonts/ExternalPackage_noto.mk index 1b66ef631857..14af61b6221a 100644 --- a/external/more_fonts/ExternalPackage_noto.mk +++ b/external/more_fonts/ExternalPackage_noto.mk @@ -17,10 +17,6 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_noto,$(LIBO_SHARE_FOLD NotoNaskhArabic-Regular.ttf \ NotoNaskhArabicUI-Bold.ttf \ NotoNaskhArabicUI-Regular.ttf \ - NotoSansArabic-Bold.ttf \ - NotoSansArabic-Regular.ttf \ - NotoSansArabicUI-Bold.ttf \ - NotoSansArabicUI-Regular.ttf \ NotoSansArmenian-Bold.ttf \ NotoSansArmenian-Regular.ttf \ NotoSansGeorgian-Bold.ttf \ diff --git a/external/more_fonts/ExternalPackage_noto_sans_arabic.mk b/external/more_fonts/ExternalPackage_noto_sans_arabic.mk new file mode 100644 index ..259167b72673 --- /dev/null +++ b/external/more_fonts/ExternalPackage_noto_sans_arabic.mk @@ -0,0 +1,17 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +$(eval $(call gb_ExternalPackage_ExternalPackage,fonts_noto,font_noto_sans_arabic)) + +$(eval $(call gb_ExternalPackage_add_unpacked_files,fonts_noto,$(LIBO_SHARE_FOLDER)/fonts/truetype,\ + NotoSansArabic/full/ttf/NotoSansArabic-Bold.ttf \ + NotoSansArabic/full/ttf/NotoSansArabic-Regular.ttf \ +)) + +# vim: set noet sw=4 ts=4: diff --git a/external/more_fonts/Module_more_fonts.mk b/external/more_fonts/Module_more_fonts.mk index 9114dd7ae7b5..335a2bc6c3af 100644 --- a/external/more_fonts/Module_more_fonts.mk +++ b/external/more_fonts/Module_more_fonts.mk @@ -23,6 +23,7 @@ $(eval $(call gb_Module_add_targets,more_fonts,\ ExternalPackage_libre_hebrew \ ExternalPackage_noto
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - svx/source
svx/source/styles/CommonStylePreviewRenderer.cxx | 16 1 file changed, 8 insertions(+), 8 deletions(-) New commits: commit 0cdb364d0f8b30f857da212e6c663f36b91087d1 Author: Khaled Hosny AuthorDate: Sun Sep 24 18:10:21 2023 +0300 Commit: Michael Stahl CommitDate: Mon Sep 25 13:33:41 2023 +0200 tdf#157067: Fix missing background color in style preview Set the colors after setting the font not before as otherwise they seem to get overridden. Change-Id: I258cb762fd2328369bd8adae63e94ec87c666bb7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157208 Tested-by: Jenkins Reviewed-by: خالد حسني (cherry picked from commit d9eed9b489d8ad208df307588595f3a8d3b7539b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157212 Reviewed-by: Michael Stahl diff --git a/svx/source/styles/CommonStylePreviewRenderer.cxx b/svx/source/styles/CommonStylePreviewRenderer.cxx index c23861e92a72..d92aac21d89c 100644 --- a/svx/source/styles/CommonStylePreviewRenderer.cxx +++ b/svx/source/styles/CommonStylePreviewRenderer.cxx @@ -335,12 +335,6 @@ bool CommonStylePreviewRenderer::render(const tools::Rectangle& aRectangle, Rend mrOutputDev.DrawRect(aRectangle); } -if (maFontColor != COL_AUTO) -mrOutputDev.SetTextColor(maFontColor); - -if (maHighlightColor != COL_AUTO) -mrOutputDev.SetTextFillColor(maHighlightColor); - Point aFontDrawPosition = aRectangle.TopLeft(); aFontDrawPosition.AdjustY(mnBaseLine); if (eRenderAlign == RenderAlign::CENTER) @@ -376,10 +370,16 @@ bool CommonStylePreviewRenderer::render(const tools::Rectangle& aRectangle, Rend mrOutputDev.Push(vcl::PushFlags::FONT); if (oFont) -{ mrOutputDev.SetFont(*oFont); + +if (maFontColor != COL_AUTO) +mrOutputDev.SetTextColor(maFontColor); + +if (maHighlightColor != COL_AUTO) +mrOutputDev.SetTextFillColor(maHighlightColor); + +if (oFont) oFont->QuickDrawText(&mrOutputDev, aFontDrawPosition, rText, nStart, nEnd - nStart, {}); -} else mrOutputDev.DrawText(aFontDrawPosition, rText, nStart, nEnd - nStart);
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - svx/source
svx/source/styles/CommonStylePreviewRenderer.cxx | 16 1 file changed, 8 insertions(+), 8 deletions(-) New commits: commit b44af80f0aa1ce93193f0edb107f17edbabba17a Author: Khaled Hosny AuthorDate: Sun Sep 24 18:10:21 2023 +0300 Commit: Michael Stahl CommitDate: Mon Sep 25 13:33:15 2023 +0200 tdf#157067: Fix missing background color in style preview Set the colors after setting the font not before as otherwise they seem to get overridden. Change-Id: I258cb762fd2328369bd8adae63e94ec87c666bb7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157208 Tested-by: Jenkins Reviewed-by: خالد حسني (cherry picked from commit 841d4634d3c1be48e8106899275f0ef176a377ce) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157211 Reviewed-by: Michael Stahl diff --git a/svx/source/styles/CommonStylePreviewRenderer.cxx b/svx/source/styles/CommonStylePreviewRenderer.cxx index c23861e92a72..d92aac21d89c 100644 --- a/svx/source/styles/CommonStylePreviewRenderer.cxx +++ b/svx/source/styles/CommonStylePreviewRenderer.cxx @@ -335,12 +335,6 @@ bool CommonStylePreviewRenderer::render(const tools::Rectangle& aRectangle, Rend mrOutputDev.DrawRect(aRectangle); } -if (maFontColor != COL_AUTO) -mrOutputDev.SetTextColor(maFontColor); - -if (maHighlightColor != COL_AUTO) -mrOutputDev.SetTextFillColor(maHighlightColor); - Point aFontDrawPosition = aRectangle.TopLeft(); aFontDrawPosition.AdjustY(mnBaseLine); if (eRenderAlign == RenderAlign::CENTER) @@ -376,10 +370,16 @@ bool CommonStylePreviewRenderer::render(const tools::Rectangle& aRectangle, Rend mrOutputDev.Push(vcl::PushFlags::FONT); if (oFont) -{ mrOutputDev.SetFont(*oFont); + +if (maFontColor != COL_AUTO) +mrOutputDev.SetTextColor(maFontColor); + +if (maHighlightColor != COL_AUTO) +mrOutputDev.SetTextFillColor(maHighlightColor); + +if (oFont) oFont->QuickDrawText(&mrOutputDev, aFontDrawPosition, rText, nStart, nEnd - nStart, {}); -} else mrOutputDev.DrawText(aFontDrawPosition, rText, nStart, nEnd - nStart);
[Libreoffice-commits] core.git: svx/source
svx/source/styles/CommonStylePreviewRenderer.cxx | 16 1 file changed, 8 insertions(+), 8 deletions(-) New commits: commit d9eed9b489d8ad208df307588595f3a8d3b7539b Author: Khaled Hosny AuthorDate: Sun Sep 24 18:10:21 2023 +0300 Commit: خالد حسني CommitDate: Sun Sep 24 18:23:47 2023 +0200 tdf#157067: Fix missing background color in style preview Set the colors after setting the font not before as otherwise they seem to get overridden. Change-Id: I258cb762fd2328369bd8adae63e94ec87c666bb7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157208 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/svx/source/styles/CommonStylePreviewRenderer.cxx b/svx/source/styles/CommonStylePreviewRenderer.cxx index c23861e92a72..d92aac21d89c 100644 --- a/svx/source/styles/CommonStylePreviewRenderer.cxx +++ b/svx/source/styles/CommonStylePreviewRenderer.cxx @@ -335,12 +335,6 @@ bool CommonStylePreviewRenderer::render(const tools::Rectangle& aRectangle, Rend mrOutputDev.DrawRect(aRectangle); } -if (maFontColor != COL_AUTO) -mrOutputDev.SetTextColor(maFontColor); - -if (maHighlightColor != COL_AUTO) -mrOutputDev.SetTextFillColor(maHighlightColor); - Point aFontDrawPosition = aRectangle.TopLeft(); aFontDrawPosition.AdjustY(mnBaseLine); if (eRenderAlign == RenderAlign::CENTER) @@ -376,10 +370,16 @@ bool CommonStylePreviewRenderer::render(const tools::Rectangle& aRectangle, Rend mrOutputDev.Push(vcl::PushFlags::FONT); if (oFont) -{ mrOutputDev.SetFont(*oFont); + +if (maFontColor != COL_AUTO) +mrOutputDev.SetTextColor(maFontColor); + +if (maHighlightColor != COL_AUTO) +mrOutputDev.SetTextFillColor(maHighlightColor); + +if (oFont) oFont->QuickDrawText(&mrOutputDev, aFontDrawPosition, rText, nStart, nEnd - nStart, {}); -} else mrOutputDev.DrawText(aFontDrawPosition, rText, nStart, nEnd - nStart);
[Libreoffice-commits] core.git: starmath/source
starmath/source/symbol.cxx |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit d31cc3545ba05d5a45d38d8e72c2428af91cb784 Author: Khaled Hosny AuthorDate: Thu Sep 21 13:47:08 2023 +0300 Commit: خالد حسني CommitDate: Thu Sep 21 16:40:30 2023 +0200 starmath: No need for the OUString copy here Change-Id: I71e6fd6ff9f5420899ece59b97b81b5e837f919b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157142 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx index b4309dad586f..4bb854f1236f 100644 --- a/starmath/source/symbol.cxx +++ b/starmath/source/symbol.cxx @@ -140,12 +140,11 @@ SmSym *SmSymbolManager::GetSymbolByUiName(std::u16string_view rSymbolName) SmSym* SmSymbolManager::GetSymbolByExportName(std::u16string_view rSymbolName) { -OUString aSymbolName(rSymbolName); SmSym* pRes = nullptr; for (auto& rPair : m_aSymbols) { SmSym& rSymbol = rPair.second; -if (rSymbol.GetExportName() == aSymbolName) +if (rSymbol.GetExportName() == rSymbolName) { pRes = &rSymbol; break;
[Libreoffice-commits] core.git: starmath/inc starmath/source
starmath/inc/symbol.hxx |4 ++-- starmath/source/cfgitem.cxx |2 +- starmath/source/dialog.cxx | 18 +- starmath/source/parse5.cxx |2 +- starmath/source/symbol.cxx | 18 +- starmath/source/unomodel.cxx |4 ++-- 6 files changed, 24 insertions(+), 24 deletions(-) New commits: commit 899522378bfb754af757c1a4a0f6bce699ac8721 Author: Khaled Hosny AuthorDate: Thu Sep 21 12:37:17 2023 +0300 Commit: خالد حسني CommitDate: Thu Sep 21 13:19:28 2023 +0200 starmath: Rename SmSym::GetName() -> GetUiName() To make it obvious this is the UI (localized) name. Change-Id: Id0dbffeaa9c331ce90dee3e7fbc88f93fab1b654 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157138 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/inc/symbol.hxx b/starmath/inc/symbol.hxx index a7d5bcad6697..f337a0dfac21 100644 --- a/starmath/inc/symbol.hxx +++ b/starmath/inc/symbol.hxx @@ -38,7 +38,7 @@ class SmSym { private: SmFace m_aFace; -OUStringm_aName; +OUStringm_aUiName; OUStringm_aExportName; OUStringm_aSetName; sal_UCS4m_cChar; @@ -54,7 +54,7 @@ public: const vcl::Font& GetFace(const SmFormat* pFormat = nullptr) const; sal_UCS4GetCharacter() const { return m_cChar; } -const OUString& GetName() const { return m_aName; } +const OUString& GetUiName() const { return m_aUiName; } boolIsPredefined() const{ return m_bPredefined; } const OUString& GetSymbolSetName() const{ return m_aSetName; } diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx index 8906474c9f35..5287b05e018d 100644 --- a/starmath/source/cfgitem.cxx +++ b/starmath/source/cfgitem.cxx @@ -740,7 +740,7 @@ void SmMathConfig::StripFontFormatList( const std::vector< SmSym > &rSymbols ) SmFontFormatList aUsedList; for (i = 0; i < rSymbols.size(); ++i) { -OSL_ENSURE( rSymbols[i].GetName().getLength() > 0, "non named symbol" ); +OSL_ENSURE( !rSymbols[i].GetUiName().isEmpty(), "non named symbol" ); aUsedList.GetFontFormatId( SmFontFormat( rSymbols[i].GetFace() ) , true ); } const SmFormat & rStdFmt = GetStandardFormat(); diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index c5e38f6cb684..f06cb60bc929 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -1325,7 +1325,7 @@ IMPL_LINK_NOARG(SmSymbolDialog, GetClickHdl, weld::Button&, void) const SmSym *pSym = GetSymbol(); if (pSym) { -OUString aText = "%" + pSym->GetName() + " "; +OUString aText = "%" + pSym->GetUiName() + " "; rViewSh.GetViewFrame().GetDispatcher()->ExecuteList( SID_INSERTSPECIAL, SfxCallMode::RECORD, @@ -1409,7 +1409,7 @@ void SmSymbolDialog::SelectSymbol(sal_uInt16 nSymbolNo) m_xSymbolSetDisplay->SelectSymbol(nSymbolNo); m_aSymbolDisplay.SetSymbol(pSym); -m_xSymbolName->set_label(pSym ? pSym->GetName() : OUString()); +m_xSymbolName->set_label(pSym ? pSym->GetUiName() : OUString()); } const SmSym* SmSymbolDialog::GetSymbol() const @@ -1491,7 +1491,7 @@ void SmSymDefineDialog::FillSymbols(weld::ComboBox& rComboBox, bool bDeleteText) weld::ComboBox& rBox = &rComboBox == m_xOldSymbols.get() ? *m_xOldSymbolSets : *m_xSymbolSets; SymbolPtrVec_t aSymSet(m_aSymbolMgrCopy.GetSymbolSet(rBox.get_active_text())); for (const SmSym* i : aSymSet) -rComboBox.append_text(i->GetName()); +rComboBox.append_text(i->GetUiName()); } void SmSymDefineDialog::FillSymbolSets(weld::ComboBox& rComboBox, bool bDeleteText) @@ -1657,7 +1657,7 @@ IMPL_LINK( SmSymDefineDialog, AddClickHdl, weld::Button&, rButton, void ) // update display of new symbol m_aSymbolDisplay.SetSymbol( &aNewSymbol ); -m_xSymbolName->set_label(aNewSymbol.GetName()); +m_xSymbolName->set_label(aNewSymbol.GetUiName()); m_xSymbolSetName->set_label(aNewSymbol.GetSymbolSetName()); // update list box entries @@ -1693,7 +1693,7 @@ IMPL_LINK( SmSymDefineDialog, ChangeClickHdl, weld::Button&, rButton, void ) // update display of new symbol m_aSymbolDisplay.SetSymbol(&aNewSymbol); -m_xSymbolName->set_label(aNewSymbol.GetName()); +m_xSymbolName->set_label(aNewSymbol.GetUiName()); m_xSymbolSetName->set_label(aNewSymbol.GetSymbolSetName()); // update list box entries @@ -1713,7 +1713,7 @@ IMPL_LINK(SmSymDefineDialog, DeleteClickHdl, weld::Button&, rButton, void) if (m_xOrigSymbol) { -m_aSymbolMgrCopy.RemoveSymbol(m_xOrigSymbol->GetName()); +m_aSymbolMgrCopy.RemoveSymbol(m_xOrigSymbo
[Libreoffice-commits] core.git: starmath/inc starmath/source
starmath/inc/symbol.hxx|8 +++- starmath/source/dialog.cxx |8 starmath/source/node.cxx |6 ++ starmath/source/parse5.cxx | 18 ++ starmath/source/symbol.cxx | 35 --- 5 files changed, 47 insertions(+), 28 deletions(-) New commits: commit 7de4c6b95da7d187c403ee478786bb74467c1eb5 Author: Khaled Hosny AuthorDate: Thu Sep 21 12:20:07 2023 +0300 Commit: خالد حسني CommitDate: Thu Sep 21 12:33:19 2023 +0200 tdf#62174: Fix saving of localized iGreek symbols When saving symbols we use the non-localized name, but iGreek symbols are a bit of a hack since they are added at runtime and don’t have localizations of there own but use the Greek symbols names with an “i” prefix. Instead of looking directly for localized names, we now go through the symbol manager that already knows about iGreek and use the export name of the symbol. We have to also make sure the iGreek symbols has non-localized export name. Change-Id: Ia3e38579abba56ae12ade126f564f8c6f9c3229a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157137 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/inc/symbol.hxx b/starmath/inc/symbol.hxx index 321dbb500e03..a7d5bcad6697 100644 --- a/starmath/inc/symbol.hxx +++ b/starmath/inc/symbol.hxx @@ -93,11 +93,9 @@ public: boolAddOrReplaceSymbol( const SmSym & rSymbol, bool bForceChange = false ); voidRemoveSymbol( const OUString & rSymbolName ); -SmSym * GetSymbolByName(const OUString& rSymbolName); -const SmSym * GetSymbolByName(const OUString& rSymbolName) const -{ -return const_cast(this)->GetSymbolByName(rSymbolName); -} +SmSym* GetSymbolByName(std::u16string_view rSymbolName); +SmSym* GetSymbolByUiName(std::u16string_view rSymbolName); +SmSym* GetSymbolByExportName(std::u16string_view rSymbolName); boolIsModified() const { return m_bModified; } voidSetModified(bool bModify) { m_bModified = bModify; } diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 8625072c90e8..c5e38f6cb684 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -1544,7 +1544,7 @@ void SmSymDefineDialog::FillStyles() SmSym* SmSymDefineDialog::GetSymbol(const weld::ComboBox& rComboBox) { assert((&rComboBox == m_xOldSymbols.get() || &rComboBox == m_xSymbols.get()) && "Sm : wrong combobox"); -return m_aSymbolMgrCopy.GetSymbolByName(rComboBox.get_active_text()); +return m_aSymbolMgrCopy.GetSymbolByUiName(rComboBox.get_active_text()); } IMPL_LINK(SmSymDefineDialog, OldSymbolChangeHdl, weld::ComboBox&, rComboBox, void) @@ -1652,7 +1652,7 @@ IMPL_LINK( SmSymDefineDialog, AddClickHdl, weld::Button&, rButton, void ) // add symbol const SmSym aNewSymbol(m_xSymbols->get_active_text(), m_xCharsetDisplay->GetFont(), m_xCharsetDisplay->GetSelectCharacter(), m_xSymbolSets->get_active_text()); -//OSL_ENSURE( m_aSymbolMgrCopy.GetSymbolByName(aTmpSymbolName) == NULL, "symbol already exists" ); +//OSL_ENSURE( m_aSymbolMgrCopy.GetSymbolByUiName(aTmpSymbolName) == NULL, "symbol already exists" ); m_aSymbolMgrCopy.AddOrReplaceSymbol( aNewSymbol ); // update display of new symbol @@ -1750,7 +1750,7 @@ void SmSymDefineDialog::UpdateButtons() && m_xCharsetDisplay->GetSelectCharacter() == m_xOrigSymbol->GetCharacter(); // only add it if there isn't already a symbol with the same name -bAdd= m_aSymbolMgrCopy.GetSymbolByName(aTmpSymbolName) == nullptr; +bAdd= m_aSymbolMgrCopy.GetSymbolByUiName(aTmpSymbolName) == nullptr; // only delete it if all settings are equal bDelete = bool(m_xOrigSymbol); @@ -1982,7 +1982,7 @@ bool SmSymDefineDialog::SelectSymbol(weld::ComboBox& rComboBox, OUString aTmpOldSymbolSetName; if (nPos != -1) { -pOldSymbol= m_aSymbolMgrCopy.GetSymbolByName(aNormName); +pOldSymbol= m_aSymbolMgrCopy.GetSymbolByUiName(aNormName); aTmpOldSymbolSetName = m_xOldSymbolSets->get_active_text(); } SetOrigSymbol(pOldSymbol, aTmpOldSymbolSetName); diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 01b14c177e43..b0b91dabe99e 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -2155,8 +2155,7 @@ static bool lcl_IsFromGreekSymbolSet( std::u16string_view aTokenText ) // valid symbol name needs to have a '%' at pos 0 and at least an additional char if (aTokenText.size() > 2 && aTokenText[0] == u'%') { -OUString aName( aTokenText.substr(1) ); -
[Libreoffice-commits] core.git: starmath/sdi starmath/source starmath/uiconfig
starmath/sdi/smslots.sdi|5 + starmath/source/view.cxx| 25 + starmath/uiconfig/smath/menubar/menubar.xml |1 + 3 files changed, 31 insertions(+) New commits: commit 6ae1c47fa1033619bf191a0f4228394ff90f5df6 Author: Khaled Hosny AuthorDate: Wed Sep 20 11:28:38 2023 +0300 Commit: خالد حسني CommitDate: Wed Sep 20 12:21:43 2023 +0200 tdf#32418: Add Tools -> Special Character... to Math Change-Id: I0f4e12f82a3b8e7be2459f4ccfa91f7d30d67f78 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157095 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/sdi/smslots.sdi b/starmath/sdi/smslots.sdi index 64586466cea1..2cf17fa342f4 100644 --- a/starmath/sdi/smslots.sdi +++ b/starmath/sdi/smslots.sdi @@ -282,6 +282,11 @@ interface FormulaView ExecMethod = Execute ; StateMethod = GetState ; ] +SID_CHARMAP //idlpp ole : no , status : no +[ +ExecMethod = Execute ; +StateMethod = GetState ; +] SID_ATTR_PARA_LEFT_TO_RIGHT [ ExecMethod = Execute ; diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index eb7074c2d811..a2f1b53c19b4 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -2107,6 +2107,31 @@ void SmViewShell::Execute(SfxRequest& rReq) } break; +case SID_CHARMAP: +{ +const SfxItemSet* pArgs = rReq.GetArgs(); +const SfxStringItem* pItem = nullptr; +if (pArgs && SfxItemState::SET == pArgs->GetItemState(SID_CHARMAP, true, &pItem)) +{ +if (IsInlineEditEnabled()) +GetDoc()->GetCursor().InsertText(pItem->GetValue()); +else if (pWin) +pWin->InsertText(pItem->GetValue()); +break; +} + +SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); +SfxAllItemSet aSet(GetViewFrame().GetObjectShell()->GetPool()); +aSet.Put(SfxBoolItem(FN_PARAM_1, false)); +aSet.Put(SfxStringItem(SID_FONT_NAME, + GetDoc()->GetFormat().GetFont(FNT_VARIABLE).GetFamilyName())); +ScopedVclPtr pDialog( +pFact->CreateCharMapDialog(pWin ? pWin->GetFrameWeld() : nullptr, aSet, + GetViewFrame().GetFrame().GetFrameInterface())); +pDialog->Execute(); +} +break; + case SID_ATTR_PARA_LEFT_TO_RIGHT: case SID_ATTR_PARA_RIGHT_TO_LEFT: { diff --git a/starmath/uiconfig/smath/menubar/menubar.xml b/starmath/uiconfig/smath/menubar/menubar.xml index c3b7865f6449..903ba7189664 100644 --- a/starmath/uiconfig/smath/menubar/menubar.xml +++ b/starmath/uiconfig/smath/menubar/menubar.xml @@ -122,6 +122,7 @@ +
[Libreoffice-commits] core.git: starmath/source
starmath/source/unomodel.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 8bf38cc394f96a1f1592a7bbd62e1f7db03f3db6 Author: Khaled Hosny AuthorDate: Wed Sep 20 09:26:33 2023 +0300 Commit: خالد حسني CommitDate: Wed Sep 20 10:12:00 2023 +0200 starmath: Don’t set empty font name when reading font format from file If a setting is missing, e.g. math font when reading old file, we would set it to an empty font instead of using the default. Regression from: commit 626d17a8ec270937575e9684a325eb0669327a25 Author: Khaled Hosny Date: Thu Aug 31 14:54:52 2023 +0300 tdf#143213: Fix reading math font settings from file Change-Id: Ib8b3cede3d4bea7e03a146b7e5f39ad2c7dfa363 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157094 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx index 4e02783b5ebb..0f3d5b4464e0 100644 --- a/starmath/source/unomodel.cxx +++ b/starmath/source/unomodel.cxx @@ -674,6 +674,9 @@ void SmModel::_setPropertyValues(const PropertyMapEntry** ppEntries, const Any* for (sal_uInt16 nFontDesc = FNT_BEGIN; nFontDesc <= FNT_END; ++nFontDesc) { const SmFace& rFont = maFonts[nFontDesc]; +if (rFont.GetFamilyName().isEmpty()) +continue; + if (aFormat.GetFont(nFontDesc).GetFamilyName() != rFont.GetFamilyName()) { const SmFace rOld = aFormat.GetFont(nFontDesc);
[Libreoffice-commits] core.git: starmath/inc starmath/qa starmath/source
starmath/inc/utility.hxx |8 starmath/qa/extras/mmlimport-test.cxx |4 ++-- starmath/source/visitors.cxx | 17 - 3 files changed, 6 insertions(+), 23 deletions(-) New commits: commit 9e92a17cb6e03beedeeca40bfc8524c2623d31eb Author: Khaled Hosny AuthorDate: Tue Sep 19 10:56:35 2023 +0300 Commit: خالد حسني CommitDate: Tue Sep 19 14:22:32 2023 +0200 starmath: Improve glyph positioning Using twips everywhere and not rounding to pixels seems to improve positioning (at least on hipdi displays). Hopefully the issue that required rounding is no longer relevant. Change-Id: I0ee4a4453b2a3d8e06be56d586761f7960a2d4d0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157044 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/inc/utility.hxx b/starmath/inc/utility.hxx index 83f3cc124dc1..feaae1fedb40 100644 --- a/starmath/inc/utility.hxx +++ b/starmath/inc/utility.hxx @@ -22,7 +22,6 @@ #include #include "smdllapi.hxx" -#include #include #include #include @@ -117,14 +116,15 @@ public: virtual voidInsert(const vcl::Font &rFont) override; }; -// Math uses 100ths of MM by default, but lok needs twips everywhere +// Math used to use 100ths of MM by default, but now uses twips +// which seems to improve (subpixel) positioning. inline MapUnit SmMapUnit() { -return comphelper::LibreOfficeKit::isActive() ? MapUnit::MapTwip : MapUnit::Map100thMM; +return MapUnit::MapTwip; } inline o3tl::Length SmO3tlLengthUnit() { -return comphelper::LibreOfficeKit::isActive() ? o3tl::Length::twip : o3tl::Length::mm100; +return o3tl::Length::twip; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/starmath/qa/extras/mmlimport-test.cxx b/starmath/qa/extras/mmlimport-test.cxx index 2fcb1de13744..c6edd0b6481e 100644 --- a/starmath/qa/extras/mmlimport-test.cxx +++ b/starmath/qa/extras/mmlimport-test.cxx @@ -168,9 +168,9 @@ void Test::testTdf151842() SmFormat aFormat = pDocShell->GetFormat(); // Without the fix in place, this test would have failed with -// - Expected: 4233 +// - Expected: 2400 // - Actual : 423 -CPPUNIT_ASSERT_EQUAL(tools::Long(4233), aFormat.GetBaseSize().Height()); +CPPUNIT_ASSERT_EQUAL(tools::Long(2400), aFormat.GetBaseSize().Height()); } void Test::testMathmlEntities() diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx index c2c4717df299..3e11201ebef2 100644 --- a/starmath/source/visitors.cxx +++ b/starmath/source/visitors.cxx @@ -441,13 +441,6 @@ void SmDrawingVisitor::Visit( SmRootSymbolNode* pNode ) if (mrFormat.IsRightToLeft() && mrDev.GetOutDevType() != OUTDEV_WINDOW) mrDev.ReMirror(aBar); -//! avoid GROWING AND SHRINKING of drawn rectangle when constantly -//! increasing zoomfactor. -// This is done by shifting its output-position to a point that -// corresponds exactly to a pixel on the output device. -Point aDrawPos( mrDev.PixelToLogic( mrDev.LogicToPixel( aBar.TopLeft( ) ) ) ); -aBar.SetPos( aDrawPos ); - mrDev.DrawRect( aBar ); } @@ -500,13 +493,6 @@ void SmDrawingVisitor::Visit( SmRectangleNode* pNode ) if (mrFormat.IsRightToLeft() && mrDev.GetOutDevType() != OUTDEV_WINDOW) mrDev.ReMirror(aTmp); -//! avoid GROWING AND SHRINKING of drawn rectangle when constantly -//! increasing zoomfactor. -// This is done by shifting its output-position to a point that -// corresponds exactly to a pixel on the output device. -Point aPos ( mrDev.PixelToLogic( mrDev.LogicToPixel( aTmp.TopLeft( ) ) ) ); -aTmp.SetPos( aPos ); - mrDev.DrawRect( aTmp ); } @@ -524,9 +510,6 @@ void SmDrawingVisitor::DrawTextNode( SmTextNode* pNode ) if (mrFormat.IsRightToLeft() && mrDev.GetOutDevType() != OUTDEV_WINDOW) mrDev.ReMirror(aPos); -// round to pixel coordinate -aPos = mrDev.PixelToLogic( mrDev.LogicToPixel( aPos ) ); - mrDev.DrawStretchText( aPos, pNode->GetWidth( ), pNode->GetText( ) ); }
[Libreoffice-commits] core.git: starmath/inc starmath/source
starmath/inc/symbol.hxx|3 ++- starmath/source/node.cxx |5 + starmath/source/symbol.cxx |8 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) New commits: commit 37f91706e6efd36074187234530f8c8ee8a3edd8 Author: Khaled Hosny AuthorDate: Tue Sep 19 10:22:37 2023 +0300 Commit: خالد حسني CommitDate: Tue Sep 19 14:22:11 2023 +0200 starmath: Get the font from current format for special symbols We want to use the current format when using the symbol in a document, and fallback for stabdard format when rendering the symbol in symbols dialog. Fixup for the following two commits: commit f28b043b4eb40e90b330721fc43d19ae6c06951e Author: Khaled Hosny Date: Mon Sep 18 19:00:02 2023 +0300 starmath: Fix editing symbols in the Symbols Catalogue commit 32d2e001bb056e7d98aa143b222f2721967337dc Author: Khaled Hosny Date: Tue Sep 12 18:35:46 2023 +0300 tdf#101174: Don’t hard-code OpenSymbol font for predefined special symbols Change-Id: Id3730749a49015120ecf9719027f932fd90c605a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157043 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/inc/symbol.hxx b/starmath/inc/symbol.hxx index a3d08b37d522..321dbb500e03 100644 --- a/starmath/inc/symbol.hxx +++ b/starmath/inc/symbol.hxx @@ -28,6 +28,7 @@ #include #include +#include "format.hxx" #include "utility.hxx" @@ -51,7 +52,7 @@ public: SmSym& operator = (const SmSym& rSymbol); -const vcl::Font& GetFace() const; +const vcl::Font& GetFace(const SmFormat* pFormat = nullptr) const; sal_UCS4GetCharacter() const { return m_cChar; } const OUString& GetName() const { return m_aName; } diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 92eafe8dbccb..01b14c177e43 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -2192,10 +2192,7 @@ void SmSpecialNode::Prepare(const SmFormat &rFormat, const SmDocShell &rDocShell sal_UCS4 cChar = pSym->GetCharacter(); OUString aTmp( &cChar, 1 ); SetText( aTmp ); -if (pSym->GetFace().GetFamilyName().isEmpty()) -GetFont() = rFormat.GetFont(FNT_VARIABLE); -else -GetFont() = pSym->GetFace(); +GetFont() = pSym->GetFace(&rFormat); } else { diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx index 7bff8d995d5c..a75b6a912670 100644 --- a/starmath/source/symbol.cxx +++ b/starmath/source/symbol.cxx @@ -81,10 +81,14 @@ bool SmSym::IsEqualInUI( const SmSym& rSymbol ) const m_cChar == rSymbol.m_cChar; } -const vcl::Font& SmSym::GetFace() const +const vcl::Font& SmSym::GetFace(const SmFormat* pFormat) const { if (m_aFace.GetFamilyName().isEmpty()) -return SM_MOD()->GetConfig()->GetStandardFormat().GetFont(FNT_MATH); +{ +if (!pFormat) +pFormat = &SM_MOD()->GetConfig()->GetStandardFormat(); +return pFormat->GetFont(FNT_VARIABLE); +} return m_aFace; }
[Libreoffice-commits] core.git: officecfg/registry uitest/math_tests
officecfg/registry/data/org/openoffice/Office/Math.xcu | 1606 + uitest/math_tests/tdf147755.py |6 2 files changed, 1609 insertions(+), 3 deletions(-) New commits: commit 5416c9183384d46f9eb347871541c6ee1e30c28b Author: Khaled Hosny AuthorDate: Mon Sep 18 21:05:05 2023 +0300 Commit: خالد حسني CommitDate: Mon Sep 18 23:05:23 2023 +0200 tdf#111705: Add Arabic math symbols to the symbols catalogue Change-Id: Ieabf4d3173a7ce985a9164db8b2de4c8b6d0da36 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157029 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/officecfg/registry/data/org/openoffice/Office/Math.xcu b/officecfg/registry/data/org/openoffice/Office/Math.xcu index 02e5e94acfcb..6a2378a1b065 100644 --- a/officecfg/registry/data/org/openoffice/Office/Math.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Math.xcu @@ -788,5 +788,1611 @@ true + + +126464 + + +Arabic + + +true + + + + +126465 + + +Arabic + + +true + + + + +126466 + + +Arabic + + +true + + + + +126467 + + +Arabic + + +true + + + + +126469 + + +Arabic + + +true + + + + +126470 + + +Arabic + + +true + + + + +126471 + + +Arabic + + +true + + + + +126472 + + +Arabic + + +true + + + + +126473 + + +Arabic + + +true + + + + +126474 + + +Arabic + + +true + + + + +126475 + + +Arabic + + +true + + + + +126476 + + +Arabic + + +true + + + + +126477 + + +Arabic + + +true + + + + +126478 + + +Arabic + + +true + + + + +126479 + + +Arabic + + +true + + + + +126480 + + +Arabic + + +true + + + + +126481 + + +Arabic + + +true + + + + +126482 + + +Arabic + + +true + + + + +126483 + + +Arabic + + +true + + + + +126484 + + +Arabic + + +true + + + + +126485 + + +Arabic + + +true + + + + +126486 + + +Arabic + + +true + + + + +126487 + + +Arabic + + +true + + + + +126488 + + +Arabic + + +true + + + + +126489 + + +Arabic + + +true + + + + +126490 + + +Arabic + + +true + + + + +126491 + + +Arabic + + +true + + + + +126492 + + +Arabic + + +true + + + + +126493 + + +Arabic + + +true + + + + +126494 + + +Arabic + + +true + + + + +126495 + + +Arabic + + +true + + + + +126497 + + +Arabic + + +true + + + + +126498 + + +Arabic + + +true + + + + +126500 + + +Arabic + + +true + + + + +126503 + + +Arabic + + +true + + + + +126505 + + +Arabic + + +true + + + + +126506 + + +Arabic + + +true + + + + +126507 + + +Arabic + + +true
[Libreoffice-commits] core.git: starmath/inc starmath/source
starmath/inc/symbol.hxx|2 +- starmath/source/symbol.cxx |8 2 files changed, 9 insertions(+), 1 deletion(-) New commits: commit f28b043b4eb40e90b330721fc43d19ae6c06951e Author: Khaled Hosny AuthorDate: Mon Sep 18 19:00:02 2023 +0300 Commit: خالد حسني CommitDate: Mon Sep 18 19:09:34 2023 +0200 starmath: Fix editing symbols in the Symbols Catalogue Fallout from: commit 32d2e001bb056e7d98aa143b222f2721967337dc Author: Khaled Hosny Date: Tue Sep 12 18:35:46 2023 +0300 tdf#101174: Don’t hard-code OpenSymbol font for predefined special symbols Change-Id: I1f440dccc920b24010160dbeee58795ffd8f85ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157025 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/inc/symbol.hxx b/starmath/inc/symbol.hxx index 39ce0be6e38c..a3d08b37d522 100644 --- a/starmath/inc/symbol.hxx +++ b/starmath/inc/symbol.hxx @@ -51,7 +51,7 @@ public: SmSym& operator = (const SmSym& rSymbol); -const vcl::Font& GetFace() const { return m_aFace; } +const vcl::Font& GetFace() const; sal_UCS4GetCharacter() const { return m_cChar; } const OUString& GetName() const { return m_aName; } diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx index 3baf79702faf..7bff8d995d5c 100644 --- a/starmath/source/symbol.cxx +++ b/starmath/source/symbol.cxx @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -80,6 +81,13 @@ bool SmSym::IsEqualInUI( const SmSym& rSymbol ) const m_cChar == rSymbol.m_cChar; } +const vcl::Font& SmSym::GetFace() const +{ +if (m_aFace.GetFamilyName().isEmpty()) +return SM_MOD()->GetConfig()->GetStandardFormat().GetFont(FNT_MATH); +return m_aFace; +} + /**/
[Libreoffice-commits] core.git: officecfg/registry uitest/math_tests
officecfg/registry/data/org/openoffice/Office/Views.xcu |2 +- uitest/math_tests/start.py |6 -- uitest/math_tests/tdf128610.py |2 -- uitest/math_tests/tdf147755.py |2 -- 4 files changed, 1 insertion(+), 11 deletions(-) New commits: commit e472b5b557d2b43b41e488c83db2b188de499610 Author: Khaled Hosny AuthorDate: Mon Sep 18 01:23:57 2023 +0300 Commit: خالد حسني CommitDate: Mon Sep 18 02:32:39 2023 +0200 starmath: Show editing window by default again We are not ready to get rid of it (e.g. undo does not work when it is hidden). This flips the default introduced in: commit e9cc014be4150a5adc9950f366c9bdfa50420dcf Author: Khaled Hosny Date: Tue Sep 12 16:41:37 2023 +0300 starmath: Hide editing window by default and add a menu item to show Change-Id: If84b25d186c8d133a9fa5cfc0c3d91162c66b389 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157004 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/officecfg/registry/data/org/openoffice/Office/Views.xcu b/officecfg/registry/data/org/openoffice/Office/Views.xcu index e903532e9c8f..205183a0012c 100644 --- a/officecfg/registry/data/org/openoffice/Office/Views.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Views.xcu @@ -48,7 +48,7 @@ -false +true diff --git a/uitest/math_tests/start.py b/uitest/math_tests/start.py index 0d085374f6b4..7504387a16f7 100644 --- a/uitest/math_tests/start.py +++ b/uitest/math_tests/start.py @@ -19,7 +19,6 @@ class SimpleMathTest(UITestCase): def test_math_unoCommand(self): with self.ui_test.create_doc_in_start_center("math"): -self.xUITest.executeCommand(".uno:CommandWindow") xMathDoc = self.xUITest.getTopFocusWindow() # tdf#140386 @@ -28,12 +27,10 @@ class SimpleMathTest(UITestCase): xEditView = xMathDoc.getChild("editview") self.assertEqual("backepsilon", get_state_as_dict(xEditView)["Text"]) -self.xUITest.executeCommand(".uno:CommandWindow") def test_math_edit(self): with self.ui_test.create_doc_in_start_center("math"): -self.xUITest.executeCommand(".uno:CommandWindow") xMathDoc = self.xUITest.getTopFocusWindow() xEditView = xMathDoc.getChild("editview") @@ -41,12 +38,10 @@ class SimpleMathTest(UITestCase): type_text(xEditView, "E=mc^2") self.assertEqual("E=mc^2", get_state_as_dict(xEditView)["Text"]) -self.xUITest.executeCommand(".uno:CommandWindow") def test_complete_math(self): with self.ui_test.create_doc_in_start_center("math"): -self.xUITest.executeCommand(".uno:CommandWindow") xMathDoc = self.xUITest.getTopFocusWindow() xList = xMathDoc.getChild("categorylist") @@ -68,6 +63,5 @@ class SimpleMathTest(UITestCase): type_text(xEditView, "2") self.assertEqual("{ 1 <> 2 }", get_state_as_dict(xEditView)["Text"]) -self.xUITest.executeCommand(".uno:CommandWindow") # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/uitest/math_tests/tdf128610.py b/uitest/math_tests/tdf128610.py index efb008f7bb45..29b7d5ac4564 100644 --- a/uitest/math_tests/tdf128610.py +++ b/uitest/math_tests/tdf128610.py @@ -20,7 +20,6 @@ class Tdf128610(UITestCase): with self.ui_test.load_empty_file("math"): -self.xUITest.executeCommand(".uno:CommandWindow") self.xUITest.executeCommand('.uno:ImportMathMLClipboard') xMathDoc = self.xUITest.getTopFocusWindow() @@ -29,6 +28,5 @@ class Tdf128610(UITestCase): # Without the fix in place, this test would have failed with # AssertionError: '{ f _ c = frac { 1 } { K _ m } }' != '' self.assertEqual("{ f _ c = { frac { 1 } { K _ m } } }", get_state_as_dict(xEditView)["Text"]) -self.xUITest.executeCommand(".uno:CommandWindow") # vim: set shiftwidth=4 softtabstop=4 expandtab: diff --git a/uitest/math_tests/tdf147755.py b/uitest/math_tests/tdf147755.py index a53e255092d6..755efbe6b51d 100644 --- a/uitest/math_tests/tdf147755.py +++ b/uitest/math_tests/tdf147755.py @@ -22,13 +22,11 @@ class Tdf147755(UITestCase): xOk = xDialog.getChild("ok") xOk.executeAction("CLICK", tuple()) -self.xUITest.executeCommand(".uno:CommandWindow") xMathDoc = self.xUITest.getTopFocusWindow() xEditView = xMa
[Libreoffice-commits] core.git: 2 commits - starmath/inc starmath/qa starmath/source
starmath/inc/mathml/starmathdatabase.hxx| 26 +--- starmath/inc/token.hxx | 10 + starmath/inc/types.hxx |2 + starmath/qa/extras/data/hadd.mml| 11 ++ starmath/qa/extras/data/maj.mml | 18 starmath/qa/extras/mmlexport-test.cxx | 30 starmath/qa/extras/mmlimport-test.cxx | 28 ++ starmath/source/mathml/mathmlexport.cxx | 20 ++ starmath/source/mathml/mathmlimport.cxx | 22 +--- starmath/source/mathml/starmathdatabase.cxx | 19 ++--- starmath/source/parse5.cxx | 13 ++-- 11 files changed, 152 insertions(+), 47 deletions(-) New commits: commit 9023cbc96c3538995f0ef9042aebcad14711cd60 Author: Khaled Hosny AuthorDate: Sun Sep 17 19:31:27 2023 +0300 Commit: خالد حسني CommitDate: Mon Sep 18 02:32:15 2023 +0200 tdf#111705: Add support of Persian limits operator (U+1EEF1) Change-Id: I9936a206b2ce6c8d195967d1e14596c5903c1ef5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156995 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/inc/token.hxx b/starmath/inc/token.hxx index a47e741a4358..8409af89dd8a 100644 --- a/starmath/inc/token.hxx +++ b/starmath/inc/token.hxx @@ -84,6 +84,7 @@ enum SmTokenType TIM,TRE,THBAR, TLAMBDABAR, // Complex and constants TPLUSMINUS, TMINUSPLUS, TSIM, TSIMEQ, // +- -+ ~ ~= TLIM, TLIMSUP,TLIMINF,TTOWARD,// Limits +THADD, TOVER, TTIMES, TCDOT, TDIV, // Product type TSLASH, TBACKSLASH, TWIDESLASH, TWIDEBACKSLASH, //Slash TFRAC, TIT,// mathml related diff --git a/starmath/inc/types.hxx b/starmath/inc/types.hxx index 597f6dcd187f..e91d6da7f363 100644 --- a/starmath/inc/types.hxx +++ b/starmath/inc/types.hxx @@ -126,6 +126,7 @@ sal_Unicode const MS_PROD = 0x220F; sal_Unicode const MS_COPROD = 0x2210; sal_Unicode const MS_SUM = 0x2211; sal_uInt32 const MS_MAJ = 0x1EEF0; +sal_uInt32 const MS_HADD = 0x1EEF1; sal_Unicode const MS_SQRT = 0x221A; sal_Unicode const MS_INT = 0x222B; sal_Unicode const MS_IINT = 0x222C; diff --git a/starmath/qa/extras/data/hadd.mml b/starmath/qa/extras/data/hadd.mml new file mode 100644 index ..b6ebd374a57f --- /dev/null +++ b/starmath/qa/extras/data/hadd.mml @@ -0,0 +1,11 @@ + +http://www.w3.org/1998/Math/MathML"; display="block"> + + + 𞻱 + 𞹎 + 𞹎 + + 𞹎 + + diff --git a/starmath/qa/extras/mmlexport-test.cxx b/starmath/qa/extras/mmlexport-test.cxx index 01528199086f..615dcd7dfa98 100644 --- a/starmath/qa/extras/mmlexport-test.cxx +++ b/starmath/qa/extras/mmlexport-test.cxx @@ -32,12 +32,14 @@ public: void testTdf97049(); void testTdf101022(); void testMaj(); +void testHadd(); CPPUNIT_TEST_SUITE(MathMLExportTest); CPPUNIT_TEST(testBlank); CPPUNIT_TEST(testTdf97049); CPPUNIT_TEST(testTdf101022); CPPUNIT_TEST(testMaj); +CPPUNIT_TEST(testHadd); CPPUNIT_TEST_SUITE_END(); protected: @@ -132,6 +134,18 @@ void MathMLExportTest::testMaj() assertXPathContent(pDoc, "/m:math/m:semantics/m:mrow/m:munderover/m:mo", u"\U0001EEF0"); } +void MathMLExportTest::testHadd() +{ +mxComponent = loadFromDesktop("private:factory/smath"); +SfxBaseModel* pModel = dynamic_cast(mxComponent.get()); +SmDocShell* pDocShell = static_cast(pModel->GetObjectShell()); +pDocShell->SetText(u"hadd to { \U0001EE4E } from { \U0001EE4E } \U0001EE4E"); +save("MathML XML (Math)"); +xmlDocUniquePtr pDoc = parseXml(maTempFile); +CPPUNIT_ASSERT(pDoc); +assertXPathContent(pDoc, "/m:math/m:semantics/m:mrow/m:munderover/m:mi", u"\U0001EEF1"); +} + CPPUNIT_TEST_SUITE_REGISTRATION(MathMLExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/starmath/qa/extras/mmlimport-test.cxx b/starmath/qa/extras/mmlimport-test.cxx index 03f5e7bcfac5..2fcb1de13744 100644 --- a/starmath/qa/extras/mmlimport-test.cxx +++ b/starmath/qa/extras/mmlimport-test.cxx @@ -37,6 +37,7 @@ public: void testTdf151842(); void testMathmlEntities(); void testMaj(); +void testHadd(); CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST(testColor); @@ -51,6 +52,7 @@ public: CPPUNIT_TEST(testTdf151842); CPPUNIT_TEST(testMathmlEntities); CPPUNIT_TEST(testMaj); +CPPUNIT_TEST(testHadd); CPPUNIT_TEST_SUITE_END(); }; @@ -191,6 +193,18 @@ void Test::testMaj() pDocShell->GetText()); } +void Test::testHadd() +{ +loadFromURL(u"hadd.mml"); +SfxBaseModel* pModel = dy
[Libreoffice-commits] core.git: starmath/source
starmath/source/node.cxx |6 ++ 1 file changed, 6 insertions(+) New commits: commit a15762233047a75588f8c5da1cee1134f1259417 Author: Khaled Hosny AuthorDate: Thu Sep 14 20:03:36 2023 +0300 Commit: خالد حسني CommitDate: Fri Sep 15 12:44:05 2023 +0200 starmath: Improve root rendering for fonts other than OpenSymbol The radical glyph in OpenSymbol is aligned to the font ascender, which is not essentially true for other fonts, so we now use the bounding rectangle of the glyph to get accurate positioning. Change-Id: I83c21cd21de25f23f96f819e168f43aa9ab22351 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156926 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/source/node.cxx b/starmath/source/node.cxx index 1572d5f8e67e..92eafe8dbccb 100644 --- a/starmath/source/node.cxx +++ b/starmath/source/node.cxx @@ -769,6 +769,12 @@ void SmRootNode::Arrange(OutputDevice &rDev, const SmFormat &rFormat) pRootSym->Arrange(rDev, rFormat); +// Set the top and bottom of the root symbol to the top and bottom of its glyph bounding rect, +// to get accurate position of the root symbol. +SmRect rRootSymRect = pRootSym->AsGlyphRect(); +pRootSym->SetTop(rRootSymRect.GetTop()); +pRootSym->SetBottom(rRootSymRect.GetBottom()); + Point aPos = pRootSym->AlignTo(*pBody, RectPos::Left, RectHorAlign::Center, RectVerAlign::Baseline); //! override calculated vertical position aPos.setY( pRootSym->GetTop() + pBody->GetBottom() - pRootSym->GetBottom() );
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - vcl/source
vcl/source/gdi/pdfwriter_impl.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 8497b2f5837bcd7a047d0bd2de842d4b2ef1101b Author: Khaled Hosny AuthorDate: Thu Sep 7 07:59:49 2023 +0300 Commit: Michael Stahl CommitDate: Thu Sep 14 18:33:51 2023 +0200 tdf#157112: fix off-by-one error in /LastChar of PDF Type 3 fonts It should be the index of the last glyph in the subset, so nGlyphs - 1. Change-Id: I62853a27b602d7b3e6b626542dd417438fcc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156630 Tested-by: Jenkins Reviewed-by: خالد حسني (cherry picked from commit d93f3243d51438e2492ca6f450ae3f1f63b617b1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156603 Reviewed-by: Michael Stahl diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 06e16eb2455f..c3db7ff872ce 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2614,7 +2614,7 @@ bool PDFWriterImpl::emitType3Font(const vcl::font::PhysicalFontFace* pFace, "/FirstChar 0\n" "/LastChar " -+ OString::number(nGlyphs) ++ OString::number(nGlyphs - 1) + "\n" "/Widths[");
[Libreoffice-commits] core.git: officecfg/registry starmath/source
officecfg/registry/data/org/openoffice/Office/Math.xcu | 198 - starmath/source/cfgitem.cxx|2 starmath/source/node.cxx |5 3 files changed, 4 insertions(+), 201 deletions(-) New commits: commit 32d2e001bb056e7d98aa143b222f2721967337dc Author: Khaled Hosny AuthorDate: Tue Sep 12 18:35:46 2023 +0300 Commit: خالد حسني CommitDate: Wed Sep 13 12:54:40 2023 +0200 tdf#101174: Don’t hard-code OpenSymbol font for predefined special symbols Leave the format empty and use the variables font instead. Change-Id: I3e3cdf40dc285dee7375054e85b4a2bed352eb66 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156855 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/officecfg/registry/data/org/openoffice/Office/Math.xcu b/officecfg/registry/data/org/openoffice/Office/Math.xcu index 96e6653615d7..02e5e94acfcb 100644 --- a/officecfg/registry/data/org/openoffice/Office/Math.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Math.xcu @@ -72,9 +72,6 @@ true - -Id2 - @@ -86,9 +83,6 @@ true - -Id2 - @@ -100,9 +94,6 @@ true - -Id2 - @@ -114,9 +105,6 @@ true - -Id2 - @@ -128,9 +116,6 @@ true - -Id2 - @@ -142,9 +127,6 @@ true - -Id2 - @@ -156,9 +138,6 @@ true - -Id2 - @@ -170,9 +149,6 @@ true - -Id2 - @@ -184,9 +160,6 @@ true - -Id2 - @@ -198,9 +171,6 @@ true - -Id2 - @@ -212,9 +182,6 @@ true - -Id2 - @@ -226,9 +193,6 @@ true - -Id2 - @@ -240,9 +204,6 @@ true - -Id2 - @@ -254,9 +215,6 @@ true - -Id2 - @@ -268,9 +226,6 @@ true - -Id2 - @@ -282,9 +237,6 @@ true - -Id2 - @@ -296,9 +248,6 @@ true - -Id2 - @@ -310,9 +259,6 @@ true - -Id2 - @@ -324,9 +270,6 @@ true - -Id2 - @@ -338,9 +281,6 @@ true - -Id2 - @@ -352,9 +292,6 @@ true - -Id2 - @@ -366,9 +303,6 @@ true - -Id2 - @@ -380,9 +314,6 @@ true - -Id2 - @@ -394,9 +325,6 @@ true - -Id2 - @@ -408,9 +336,6 @@ true - -Id2 - @@ -422,9 +347,6 @@ true - -Id2 - @@ -436,9 +358,6 @@ true - -Id2 - @@ -450,9 +369,6 @@ true - -Id2 - @@ -464,9 +380,6 @@ true - -Id2 - @@ -478,9 +391,6 @@ true - -Id2 - @@ -492,9 +402,6 @@ true - -Id2 - @@ -506,9 +413,6 @@ true - -Id2 - @@ -520,9 +424,6 @@ true - -Id2 - @@ -534,9 +435,6 @@ true - -Id2 - @@ -548,9 +446,6 @@ true - -Id2 - @@ -562,9 +457,6 @@ true - -Id2 - @@ -576,9 +468,6 @@ true - -Id2 - @@ -590,9 +479,6 @@ true - -Id2 - @@ -604,9 +490,6 @@ true - -Id2 - @@ -618,9 +501,6 @@ true - -Id2
[Libreoffice-commits] core.git: officecfg/registry starmath/sdi starmath/source starmath/uiconfig uitest/math_tests
officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu |5 +++ officecfg/registry/data/org/openoffice/Office/Views.xcu |6 +++ starmath/sdi/smslots.sdi |4 +- starmath/source/view.cxx | 16 ++ starmath/uiconfig/smath/menubar/menubar.xml |1 uitest/math_tests/start.py|6 +++ uitest/math_tests/tdf128610.py|2 + uitest/math_tests/tdf147755.py|2 + 8 files changed, 40 insertions(+), 2 deletions(-) New commits: commit e9cc014be4150a5adc9950f366c9bdfa50420dcf Author: Khaled Hosny AuthorDate: Tue Sep 12 16:41:37 2023 +0300 Commit: خالد حسني CommitDate: Wed Sep 13 12:54:14 2023 +0200 starmath: Hide editing window by default and add a menu item to show We are enabling inline editing bu default, so this window is of no interest by default. Change-Id: I66fe988790fe4f174f6cb4f691af69888b0b05b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156852 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu index edf6b520fb9f..b8bade9b3e4f 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/MathCommands.xcu @@ -128,6 +128,11 @@ 1 + + + Command Window + + Elements diff --git a/officecfg/registry/data/org/openoffice/Office/Views.xcu b/officecfg/registry/data/org/openoffice/Office/Views.xcu index d6c0fbfade10..e903532e9c8f 100644 --- a/officecfg/registry/data/org/openoffice/Office/Views.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Views.xcu @@ -45,6 +45,12 @@ true + + + +false + + true diff --git a/starmath/sdi/smslots.sdi b/starmath/sdi/smslots.sdi index 3f998e8b182b..64586466cea1 100644 --- a/starmath/sdi/smslots.sdi +++ b/starmath/sdi/smslots.sdi @@ -265,8 +265,8 @@ interface FormulaView //idlpp no menu entry, so no texts SID_CMDBOXWINDOW //idlpp ole : no , status : no [ -ExecMethod = NoExec ; -StateMethod = NoState ; +ExecMethod = Execute ; +StateMethod = GetState ; ] SID_ELEMENTSDOCKINGWINDOW [ diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index c9a6303ba0e1..eb7074c2d811 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -2039,6 +2039,13 @@ void SmViewShell::Execute(SfxRequest& rReq) } break; +case SID_CMDBOXWINDOW: +{ +GetViewFrame().ToggleChildWindow(SID_CMDBOXWINDOW); +GetViewFrame().GetBindings().Invalidate(SID_CMDBOXWINDOW); +} +break; + case SID_UNICODE_NOTATION_TOGGLE: { EditEngine* pEditEngine = nullptr; @@ -2202,6 +2209,15 @@ void SmViewShell::GetState(SfxItemSet &rSet) rSet.Put(SfxBoolItem(SID_ELEMENTSDOCKINGWINDOW, bState)); } break; +case SID_CMDBOXWINDOW: +{ +bool bState = false; +auto pCmdWin = GetViewFrame().GetChildWindow(SID_CMDBOXWINDOW); +if (pCmdWin) +bState = pCmdWin->IsVisible(); +rSet.Put(SfxBoolItem(SID_CMDBOXWINDOW, bState)); +} +break; case SID_ATTR_PARA_LEFT_TO_RIGHT: rSet.Put(SfxBoolItem(nWh, !GetDoc()->GetFormat().IsRightToLeft())); break; diff --git a/starmath/uiconfig/smath/menubar/menubar.xml b/starmath/uiconfig/smath/menubar/menubar.xml index b9ed1026283a..c3b7865f6449 100644 --- a/starmath/uiconfig/smath/menubar/menubar.xml +++ b/starmath/uiconfig/smath/menubar/menubar.xml @@ -87,6 +87,7 @@ + diff --git a/uitest/math_tests/start.py b/uitest/math_tests/start.py index 7504387a16f7..0d085374f6b4 100644 --- a/uitest/math_tests/start.py +++ b/uitest/math_tests/start.py @@ -19,6 +19,7 @@ class SimpleMathTest(UITestCase): def test_math_unoCommand(self): with self.ui_test.create_doc_in_start_center("math"): +self.xUITest.executeCommand(".uno:CommandWindow") xMathDoc = self.xUITest.getTopFocusWindow() # tdf#140386 @@ -27,10 +28,12 @@ class SimpleMathTest(UITestCase): xEditView = xMathDoc.getChild("editview") self.assertEqual("backepsilon", get_state_as_dict(xEditView)["Text"]) +self.xUITest.executeCommand(".uno:CommandWindow") def t
[Libreoffice-commits] core.git: qadevOOo/Jar_OOoRunner.mk qadevOOo/objdsc qadevOOo/tests starmath/qa starmath/source
qadevOOo/Jar_OOoRunner.mk |1 qadevOOo/objdsc/sm/com.sun.star.comp.unknown.SmEditAccessible.csv | 22 - qadevOOo/tests/java/mod/_sm/SmEditAccessible.java | 129 -- starmath/qa/unoapi/sm.sce |1 starmath/source/view.cxx |6 5 files changed, 3 insertions(+), 156 deletions(-) New commits: commit aa396ee162ee0eb223c90ab4f9bd55014cf94775 Author: Khaled Hosny AuthorDate: Tue Sep 5 20:37:25 2023 +0300 Commit: خالد حسني CommitDate: Tue Sep 12 14:14:52 2023 +0200 starmath: Keep focus on math widget when inline editing is enabled Since originally all editing happened in the edit window, it was made to grab focus instead of the math widget, but we don’t want that anymore when inline editing is enable as we want to edit everything in the math widget. This also removes ancient test that is now failing. We will eventually drop the edit window altogether. Change-Id: Ia1628a454bbbdd923ff582564eca1ab4ec830f38 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156579 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk index 65ed25b15758..365ea75bc71b 100644 --- a/qadevOOo/Jar_OOoRunner.mk +++ b/qadevOOo/Jar_OOoRunner.mk @@ -1000,7 +1000,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\ qadevOOo/tests/java/mod/_simreg/SimpleRegistry \ qadevOOo/tests/java/mod/_smgr/OServiceManager \ qadevOOo/tests/java/mod/_smplmail/SimpleSystemMail \ -qadevOOo/tests/java/mod/_sm/SmEditAccessible \ qadevOOo/tests/java/mod/_sm/SmGraphicAccessible \ qadevOOo/tests/java/mod/_sm/SmModel \ qadevOOo/tests/java/mod/_sm/XMLExporter \ diff --git a/qadevOOo/objdsc/sm/com.sun.star.comp.unknown.SmEditAccessible.csv b/qadevOOo/objdsc/sm/com.sun.star.comp.unknown.SmEditAccessible.csv deleted file mode 100644 index 58e85c7c7973.. --- a/qadevOOo/objdsc/sm/com.sun.star.comp.unknown.SmEditAccessible.csv +++ /dev/null @@ -1,22 +0,0 @@ -"SmEditAccessible";"com::sun::star::accessibility::XAccessibleEventBroadcaster";"addEventListener()" -"SmEditAccessible";"com::sun::star::accessibility::XAccessibleEventBroadcaster";"removeEventListener()" -"SmEditAccessible";"com::sun::star::accessibility::XAccessibleComponent";"containsPoint()" -"SmEditAccessible";"com::sun::star::accessibility::XAccessibleComponent";"getAccessibleAtPoint()" -"SmEditAccessible";"com::sun::star::accessibility::XAccessibleComponent";"getBounds()" -"SmEditAccessible";"com::sun::star::accessibility::XAccessibleComponent";"getLocation()" -"SmEditAccessible";"com::sun::star::accessibility::XAccessibleComponent";"getLocationOnScreen()" -"SmEditAccessible";"com::sun::star::accessibility::XAccessibleComponent";"getSize()" -"SmEditAccessible";"com::sun::star::accessibility::XAccessibleComponent";"grabFocus()" -"SmEditAccessible";"com::sun::star::accessibility::XAccessibleComponent";"getForeground()" -"SmEditAccessible";"com::sun::star::accessibility::XAccessibleComponent";"getBackground()" -"SmEditAccessible";"com::sun::star::accessibility::XAccessible";"getAccessibleContext()" -"SmEditAccessible";"com::sun::star::accessibility::XAccessibleContext";"getAccessibleChildCount()" -"SmEditAccessible";"com::sun::star::accessibility::XAccessibleContext";"getAccessibleChild()" -"SmEditAccessible";"com::sun::star::accessibility::XAccessibleContext";"getAccessibleParent()" -"SmEditAccessible";"com::sun::star::accessibility::XAccessibleContext";"getAccessibleIndexInParent()" -"SmEditAccessible";"com::sun::star::accessibility::XAccessibleContext";"getAccessibleRole()" -"SmEditAccessible";"com::sun::star::accessibility::XAccessibleContext";"getAccessibleDescription()" -"SmEditAccessible";"com::sun::star::accessibility::XAccessibleContext";"getAccessibleName()" -"SmEditAccessible";"com::sun::star::accessibility::XAccessibleContext";"getAccessibleRelationSet()" -"SmEditAccessible";"com::sun::star::accessibility::XAccessibleContext";"getAccessibleStateSet()" -"SmEditAccessible";"com::sun::star::accessibility::XAccessibleContext";"getLocale()" diff --git a/qadevOOo/tests/java/mod/_sm/SmEditAccessible.java b/qadevOOo/tests/java/mo
[Libreoffice-commits] core.git: starmath/qa starmath/source
starmath/qa/cppunit/test_cursor.cxx | 20 starmath/source/visitors.cxx|7 +-- 2 files changed, 25 insertions(+), 2 deletions(-) New commits: commit d52feb11c7eab0adf82c1fb410adfd3127bf9497 Author: Khaled Hosny AuthorDate: Mon Sep 11 20:32:22 2023 +0300 Commit: خالد حسني CommitDate: Mon Sep 11 21:24:57 2023 +0200 starmath: Fix selection of surrogate pairs in inline editing Don’t split nodes in the middle of surrogate pairs. Change-Id: I3ce8cf19d4c331e2ead73ed375745e8866b3d7a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156827 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/qa/cppunit/test_cursor.cxx b/starmath/qa/cppunit/test_cursor.cxx index d76b446e6a41..f5be3f5beeaa 100644 --- a/starmath/qa/cppunit/test_cursor.cxx +++ b/starmath/qa/cppunit/test_cursor.cxx @@ -39,12 +39,14 @@ public: void testCopySelectPaste(); void testCutPaste(); void testCutSelectPaste(); +void testSelectSurrogatePairs(); CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST(testCopyPaste); CPPUNIT_TEST(testCopySelectPaste); CPPUNIT_TEST(testCutPaste); CPPUNIT_TEST(testCutSelectPaste); +CPPUNIT_TEST(testSelectSurrogatePairs); CPPUNIT_TEST_SUITE_END(); private: @@ -172,6 +174,24 @@ void Test::testCutSelectPaste() #endif } +void Test::testSelectSurrogatePairs() +{ +auto xTree = SmParser5().Parse(u"\U0001EE4E"); +xTree->Prepare(xDocShRef->GetFormat(), *xDocShRef, 0); + +SmCursor aCursor(xTree.get(), xDocShRef.get()); +ScopedVclPtrInstance pOutputDevice; + +// selct the first character, cut, then paste +aCursor.Move(pOutputDevice, MoveRight, false); +aCursor.Cut(); +aCursor.Paste(); + +#ifndef _WIN32 // FIXME: on Windows clipboard does not work in tests for some reason +CPPUNIT_ASSERT_EQUAL(OUString(u"\U0001EE4E"), xDocShRef->GetText()); +#endif +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); } diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx index 936097ccef3f..c2c4717df299 100644 --- a/starmath/source/visitors.cxx +++ b/starmath/source/visitors.cxx @@ -1040,8 +1040,11 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmTextNode* pNode ) { SAL_WARN_IF( pNode->GetText().isEmpty(), "starmath", "Empty SmTextNode is bad" ); -int size = pNode->GetText().getLength(); -for( int i = 1; i <= size; i++ ){ +OUString& aText = pNode->GetText(); +sal_Int32 i = 0; +while (i < aText.getLength()) +{ +aText.iterateCodePoints(&i); SmCaretPosGraphEntry* pRight = mpRightMost; mpRightMost = mpGraph->Add( SmCaretPos( pNode, i ), pRight ); pRight->SetRight( mpRightMost );
[Libreoffice-commits] core.git: starmath/inc starmath/qa starmath/source
starmath/inc/cursor.hxx | 10 -- starmath/qa/cppunit/test_cursor.cxx | 10 +- starmath/source/cursor.cxx | 36 ++-- starmath/source/view.cxx| 12 ++-- starmath/source/visitors.cxx|2 ++ 5 files changed, 51 insertions(+), 19 deletions(-) New commits: commit 3c24177104dfa5b8d68d74bf1735839964e93ba6 Author: Khaled Hosny AuthorDate: Thu Sep 7 18:10:30 2023 +0300 Commit: خالد حسني CommitDate: Fri Sep 8 04:24:48 2023 +0200 tdf#88744: Use real clipboard when inline editing is enabled Instead of using a fake clipboard that works only inside the same formula. Change-Id: Ia1e97028e1aafa15912bc9b4397d66afb0d23ec7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156671 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/inc/cursor.hxx b/starmath/inc/cursor.hxx index 0a8a35071f10..a44c9ed61340 100644 --- a/starmath/inc/cursor.hxx +++ b/starmath/inc/cursor.hxx @@ -158,15 +158,15 @@ public: void InsertBrackets(SmBracketType eBracketType); /** Copy the current selection */ -void Copy(); +void Copy(vcl::Window* pWindow = nullptr); /** Cut the current selection */ -void Cut() +void Cut(vcl::Window* pWindow = nullptr) { -Copy(); +Copy(pWindow); Delete(); } /** Paste the clipboard */ -void Paste(); +void Paste(vcl::Window* pWindow = nullptr); /** Returns true if more than one node is selected * @@ -201,8 +201,6 @@ private: SmDocShell* mpDocShell; /** Graph over caret position in the current tree */ std::unique_ptr mpGraph; -/** Clipboard holder */ -SmClipboard maClipboard; /** Returns a node that is selected, if any could be found */ SmNode* FindSelectedNode(SmNode* pNode); diff --git a/starmath/qa/cppunit/test_cursor.cxx b/starmath/qa/cppunit/test_cursor.cxx index bbdebf503153..d76b446e6a41 100644 --- a/starmath/qa/cppunit/test_cursor.cxx +++ b/starmath/qa/cppunit/test_cursor.cxx @@ -87,7 +87,9 @@ void Test::testCopyPaste() aCursor.Move(pOutputDevice, MoveRight); aCursor.Paste(); +#ifndef _WIN32 // FIXME: on Windows clipboard does not work in tests for some reason CPPUNIT_ASSERT_EQUAL(OUString("{ { a * b } + { c * b } }"), xDocShRef->GetText()); +#endif } void Test::testCopySelectPaste() @@ -113,7 +115,9 @@ void Test::testCopySelectPaste() aCursor.Move(pOutputDevice, MoveRight, false); aCursor.Paste(); +#ifndef _WIN32 // FIXME: on Windows clipboard does not work in tests for some reason CPPUNIT_ASSERT_EQUAL(OUString("{ { b + { c * b } } + c }"), xDocShRef->GetText()); +#endif } void Test::testCutPaste() @@ -135,7 +139,9 @@ void Test::testCutPaste() aCursor.Move(pOutputDevice, MoveRight); aCursor.Paste(); +#ifndef _WIN32 // FIXME: on Windows clipboard does not work in tests for some reason CPPUNIT_ASSERT_EQUAL(OUString("{ a + { c * b } }"), xDocShRef->GetText()); +#endif } void Test::testCutSelectPaste() @@ -161,7 +167,9 @@ void Test::testCutSelectPaste() aCursor.Move(pOutputDevice, MoveRight, false); aCursor.Paste(); -CPPUNIT_ASSERT_EQUAL(OUString("{ b + { c * } }"), xDocShRef->GetText()); +#ifndef _WIN32 // FIXME: on Windows clipboard does not work in tests for some reason +CPPUNIT_ASSERT_EQUAL(OUString("{ b + { c * {} } }"), xDocShRef->GetText()); +#endif } CPPUNIT_TEST_SUITE_REGISTRATION(Test); diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx index e8623517bcd7..ef4853cb22a4 100644 --- a/starmath/source/cursor.cxx +++ b/starmath/source/cursor.cxx @@ -16,6 +16,8 @@ #include #include #include +#include +#include void SmCursor::Move(OutputDevice* pDev, SmMovementDirection direction, bool bMoveAnchor){ SmCaretPosGraphEntry* NewPos = nullptr; @@ -1047,7 +1049,8 @@ void SmCursor::InsertCommandText(const OUString& aCommandText) { EndEdit(); } -void SmCursor::Copy(){ +void SmCursor::Copy(vcl::Window* pWindow) +{ if(!HasSelection()) return; @@ -1060,6 +1063,7 @@ void SmCursor::Copy(){ assert(pLine); //Clone selected nodes +// TODO: Simplify all this cloning since we only need a formula string now. SmClipboard aClipboard; if(IsLineCompositionNode(pLine)) CloneLineToClipboard(static_cast(pLine), &aClipboard); @@ -1079,17 +1083,37 @@ void SmCursor::Copy(){ } } +// Parse list of nodes to a tree +SmNodeListParser parser; +SmNode* pTree(parser.Parse(CloneList(aClipboard).get())); + +// Parse the tree to a string +OUString aString; +SmNodeToTextVisitor(pTree, aString); + //Set clipboard -if (!aClipboard.empty()) -maClipboard = std::move(aClipboard); +auto xClipboard(pWindow ? pWindow->GetClipboard() : GetS
[Libreoffice-commits] core.git: starmath/inc starmath/source
starmath/inc/cursor.hxx|1 - starmath/inc/view.hxx |2 ++ starmath/source/cursor.cxx |7 --- starmath/source/edit.cxx |5 + starmath/source/view.cxx | 28 +++- 5 files changed, 14 insertions(+), 29 deletions(-) New commits: commit beaea2e992912b4747d790070b26371f557b1f57 Author: Khaled Hosny AuthorDate: Thu Sep 7 19:19:56 2023 +0300 Commit: خالد حسني CommitDate: Thu Sep 7 23:54:46 2023 +0200 starmath: Properly update the state to copy/cut/paste buttons Invalidate the slots explicitly instead of implicitly by updating the edit window. Followup to: commit 065609f86f730d4eedc6b7ae28382dc7daea11ac Author: Khaled Hosny Date: Mon Sep 4 13:22:04 2023 +0300 starmath: Make cut/copy/paste buttons work with inline editing Change-Id: If0648c249d6145475202e1a48364d7fe142a5e35 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156674 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/inc/cursor.hxx b/starmath/inc/cursor.hxx index 7e1f8ec83c53..0a8a35071f10 100644 --- a/starmath/inc/cursor.hxx +++ b/starmath/inc/cursor.hxx @@ -85,7 +85,6 @@ public: /** True, if the cursor has a selection */ bool HasSelection() const { return mpAnchor != mpPosition; } -const ESelection& GetSelection(); /** Move the position of this cursor */ void Move(OutputDevice* pDev, SmMovementDirection direction, bool bMoveAnchor = true); diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx index 4a79b94e4f02..a896cd41bf2d 100644 --- a/starmath/inc/view.hxx +++ b/starmath/inc/view.hxx @@ -321,6 +321,8 @@ public: void SendCaretToLOK() const; +void InvalidateSlots(); + private: /// SfxInterface initializer. static void InitInterface_Impl(); diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx index 41506dff3109..e8623517bcd7 100644 --- a/starmath/source/cursor.cxx +++ b/starmath/source/cursor.cxx @@ -1141,13 +1141,6 @@ SmNode* SmCursor::FindSelectedNode(SmNode* pNode){ return nullptr; } -const ESelection& SmCursor::GetSelection() { -const SmNode* pNode = FindSelectedNode(mpTree); -if (!pNode) -return mpTree->GetSelection(); -return pNode->GetSelection(); -} - void SmCursor::LineToList(SmStructureNode* pLine, SmNodeList& list){ for(auto pChild : *pLine) { diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx index 90cb6cd5498a..77ab710fab69 100644 --- a/starmath/source/edit.cxx +++ b/starmath/source/edit.cxx @@ -160,10 +160,7 @@ void SmEditTextWindow::StartCursorMove() void SmEditWindow::InvalidateSlots() { -SfxBindings& rBind = GetView()->GetViewFrame().GetBindings(); -rBind.Invalidate(SID_COPY); -rBind.Invalidate(SID_CUT); -rBind.Invalidate(SID_DELETE); +GetView()->InvalidateSlots(); } SmViewShell * SmEditWindow::GetView() diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index eacab22901ad..2800e06ba387 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -371,10 +371,8 @@ bool SmGraphicWidget::MouseButtonDown(const MouseEvent& rMEvt) SmEditWindow* pEdit = GetView().GetEditWindow(); if (SmViewShell::IsInlineEditEnabled()) { -SmCursor& rCursor = GetCursor(); -rCursor.MoveTo(&rDevice, aPos, !rMEvt.IsShift()); -if (pEdit) -pEdit->SetSelection(rCursor.GetSelection()); +GetCursor().MoveTo(&rDevice, aPos, !rMEvt.IsShift()); +GetView().InvalidateSlots(); // 'on grab' window events are missing in lok, do it explicitly if (comphelper::LibreOfficeKit::isActive()) SetIsCursorVisible(true); @@ -715,7 +713,6 @@ bool SmGraphicWidget::KeyInput(const KeyEvent& rKEvt) return GetView().KeyInput(rKEvt); bool bConsumed = true; -bool bSetSelection = false; SmCursor& rCursor = GetCursor(); switch (rKEvt.GetKeyCode().GetFunction()) @@ -740,32 +737,24 @@ bool SmGraphicWidget::KeyInput(const KeyEvent& rKEvt) { case KEY_LEFT: rCursor.Move(&GetOutputDevice(), MoveLeft, !rKEvt.GetKeyCode().IsShift()); -bSetSelection = true; break; case KEY_RIGHT: rCursor.Move(&GetOutputDevice(), MoveRight, !rKEvt.GetKeyCode().IsShift()); -bSetSelection = true; break; case KEY_UP: rCursor.Move(&GetOutputDevice(), MoveUp, !rKEvt.GetKeyCode().IsShift()); -bSetSelection = true; break; case KEY_DOWN: rCursor.Move(&GetOutputDevice(), MoveDown, !rKEvt.GetKeyCode().IsShift()); -bSetSelection = true; break; case KEY_RETURN: if (!rK
[Libreoffice-commits] core.git: starmath/qa starmath/source
starmath/qa/cppunit/test_cursor.cxx | 10 +- starmath/qa/cppunit/test_nodetotextvisitors.cxx |4 ++-- starmath/source/visitors.cxx|4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) New commits: commit 8c982bf86ff9ca5a4ed86505ec1133cc183f1b58 Author: Khaled Hosny AuthorDate: Thu Sep 7 10:21:24 2023 +0300 Commit: خالد حسني CommitDate: Thu Sep 7 16:18:28 2023 +0200 tdf#130741: Insert brackets around horizontal binary nodes more generously When converting node tree creating with visual editor back to text for the command editor, try to always insert brackets around binary expressions. It might look redundant at times but it is safer, and the code is not supposed to be edited by hand anymore so doesn’t have to look pretty. Change-Id: Ifff574494c9e8f8b948e432f6832d88c334aba00 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156640 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/qa/cppunit/test_cursor.cxx b/starmath/qa/cppunit/test_cursor.cxx index 5f4c551675a1..bbdebf503153 100644 --- a/starmath/qa/cppunit/test_cursor.cxx +++ b/starmath/qa/cppunit/test_cursor.cxx @@ -87,7 +87,7 @@ void Test::testCopyPaste() aCursor.Move(pOutputDevice, MoveRight); aCursor.Paste(); -CPPUNIT_ASSERT_EQUAL(OUString("{ a * b + c * b }"), xDocShRef->GetText()); +CPPUNIT_ASSERT_EQUAL(OUString("{ { a * b } + { c * b } }"), xDocShRef->GetText()); } void Test::testCopySelectPaste() @@ -113,7 +113,7 @@ void Test::testCopySelectPaste() aCursor.Move(pOutputDevice, MoveRight, false); aCursor.Paste(); -CPPUNIT_ASSERT_EQUAL(OUString("{ b + c * b + c }"), xDocShRef->GetText()); +CPPUNIT_ASSERT_EQUAL(OUString("{ { b + { c * b } } + c }"), xDocShRef->GetText()); } void Test::testCutPaste() @@ -130,12 +130,12 @@ void Test::testCutPaste() aCursor.Move(pOutputDevice, MoveRight, false); aCursor.Move(pOutputDevice, MoveRight, false); aCursor.Cut(); -// go to the left end and then paste +// go to the right end and then paste aCursor.Move(pOutputDevice, MoveRight); aCursor.Move(pOutputDevice, MoveRight); aCursor.Paste(); -CPPUNIT_ASSERT_EQUAL(OUString("{ a + c * b }"), xDocShRef->GetText()); +CPPUNIT_ASSERT_EQUAL(OUString("{ a + { c * b } }"), xDocShRef->GetText()); } void Test::testCutSelectPaste() @@ -161,7 +161,7 @@ void Test::testCutSelectPaste() aCursor.Move(pOutputDevice, MoveRight, false); aCursor.Paste(); -CPPUNIT_ASSERT_EQUAL(OUString("{ b + c * }"), xDocShRef->GetText()); +CPPUNIT_ASSERT_EQUAL(OUString("{ b + { c * } }"), xDocShRef->GetText()); } CPPUNIT_TEST_SUITE_REGISTRATION(Test); diff --git a/starmath/qa/cppunit/test_nodetotextvisitors.cxx b/starmath/qa/cppunit/test_nodetotextvisitors.cxx index 11ef5affcc4c..aba582e281d3 100644 --- a/starmath/qa/cppunit/test_nodetotextvisitors.cxx +++ b/starmath/qa/cppunit/test_nodetotextvisitors.cxx @@ -528,7 +528,7 @@ void Test::testBinomInBinHor() aCursor.InsertElement(PlusElement); aCursor.InsertText("d"); -sExpected += "{ { binom a b + c } + d }"; +sExpected += "{ { binom a { b + c } } + d }"; CPPUNIT_ASSERT_EQUAL_MESSAGE("Binom Node in BinHor Node", sExpected, xDocShRef->GetText()); } @@ -623,7 +623,7 @@ void Test::testUnaryInMixedNumberAsNumerator() aCursor.InsertText("4"); CPPUNIT_ASSERT_EQUAL_MESSAGE("Unary in mixed number as Numerator", - OUString("{ 2 { - 1 over 2 } + 4 }"), xDocShRef->GetText()); + OUString("{ 2 { { - 1 over 2 } + 4 } }"), xDocShRef->GetText()); } void Test::testMiscEquivalent() diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx index 732c27f9840f..b205e710b72f 100644 --- a/starmath/source/visitors.cxx +++ b/starmath/source/visitors.cxx @@ -2189,7 +2189,7 @@ void SmNodeToTextVisitor::Visit( SmUnHorNode* pNode ) void SmNodeToTextVisitor::Visit( SmBinHorNode* pNode ) { const SmNode *pParent = pNode->GetParent(); -bool bBraceNeeded = pParent && pParent->GetType() == SmNodeType::Font; +bool bBraceNeeded = pParent; SmNode *pLeft = pNode->LeftOperand(), *pOper = pNode->Symbol(), *pRight = pNode->RightOperand(); @@ -2598,7 +2598,7 @@ void SmNodeToTextVisitor::Visit( SmLineNode* pNode ) void SmNodeToTextVisitor::Visit( SmExpressionNode* pNode ) { -bool bracketsNeeded = pNode->GetNumSubNodes() != 1 || pNode->GetSubNode(0)->GetType() == SmNodeType::BinHor; +bool bracketsNeeded = pNode->GetNumSubNodes() != 1; if (!bracketsNeeded) { const SmNode *pParent = pNode->GetParent();
[Libreoffice-commits] core.git: vcl/source
vcl/source/gdi/pdfwriter_impl.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit d93f3243d51438e2492ca6f450ae3f1f63b617b1 Author: Khaled Hosny AuthorDate: Thu Sep 7 07:59:49 2023 +0300 Commit: خالد حسني CommitDate: Thu Sep 7 09:01:43 2023 +0200 tdf#157112: fix off-by-one error in /LastChar of PDF Type 3 fonts It should be the index of the last glyph in the subset, so nGlyphs - 1. Change-Id: I62853a27b602d7b3e6b626542dd417438fcc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156630 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index ff2de852f4a8..64dfc809fccc 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2627,7 +2627,7 @@ bool PDFWriterImpl::emitType3Font(const vcl::font::PhysicalFontFace* pFace, "/FirstChar 0\n" "/LastChar " -+ OString::number(nGlyphs) ++ OString::number(nGlyphs - 1) + "\n" "/Widths[");
Re: Confusing unit test error
> On 6 Sep 2023, at 10:41 AM, Xisco Fauli wrote: > > Hello, > > That failure is not related to your patch, see the discussion in > https://gerrit.libreoffice.org/c/core/+/156563. > This should be fixed in master, so I rebased the change and the build is passing now. Regards, Khaled
[Libreoffice-commits] core.git: starmath/inc starmath/source uitest/math_tests
starmath/inc/view.hxx | 14 -- starmath/source/edit.cxx |4 starmath/source/view.cxx | 29 + uitest/math_tests/start.py |3 ++- uitest/math_tests/tdf147755.py |4 ++-- 5 files changed, 17 insertions(+), 37 deletions(-) New commits: commit ee187f6ed7873f3ebc1f845a4384a84713be1e9c Author: Khaled Hosny AuthorDate: Tue Sep 5 20:24:13 2023 +0300 Commit: خالد حسني CommitDate: Tue Sep 5 20:28:34 2023 +0200 starmath: Always insert using SmCursor when inline editing is enabled Choosing which code path based on which widget has focus is not a very good idea, and leads to unreliable UI tests as each code path inserts the text slightly differently (one code path inserts plain text then parses the whole equation again, while the other parses the new text then inserts the parsed node directly). Change-Id: Ib2ca942c537e466f6ff100be7f95adaead99f1d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156578 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/inc/view.hxx b/starmath/inc/view.hxx index dc42dde2fdc9..4a79b94e4f02 100644 --- a/starmath/inc/view.hxx +++ b/starmath/inc/view.hxx @@ -249,11 +249,6 @@ class SmViewShell final : public SfxViewShell SmGraphicController maGraphicController; OUString maStatusText; bool mbPasteState; -/** Used to determine whether insertions using SID_INSERTSPECIAL and SID_INSERTCOMMANDTEXT - * should be inserted into SmEditWindow or directly into the SmDocShell as done if the - * visual editor was last to have focus. - */ -bool mbInsertIntoEditWindow; DECL_LINK( DialogClosedHdl, sfx2::FileDialogHelper*, void ); virtual voidNotify( SfxBroadcaster& rBC, const SfxHint& rHint ) override; @@ -337,15 +332,6 @@ public: void Impl_Print( OutputDevice &rOutDev, const SmPrintUIOptions &rPrintUIOptions, tools::Rectangle aOutRect ); -/** Set bInsertIntoEditWindow so we know where to insert - * - * This method is called whenever SmGraphicWidget or SmEditWindow gets focus, - * so that when text is inserted from catalog or elsewhere we know whether to - * insert for the visual editor, or the text editor. - */ -void SetInsertIntoEditWindow(bool bEditWindowHadFocusLast){ -mbInsertIntoEditWindow = bEditWindowHadFocusLast; -} static bool IsInlineEditEnabled(); // Opens the main help page for the Math module diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx index 4cb4f6532f64..90cb6cd5498a 100644 --- a/starmath/source/edit.cxx +++ b/starmath/source/edit.cxx @@ -556,10 +556,6 @@ void SmEditTextWindow::GetFocus() EditEngine *pEditEngine = GetEditEngine(); if (pEditEngine) pEditEngine->SetStatusEventHdl(LINK(this, SmEditTextWindow, EditStatusHdl)); - -//Let SmViewShell know we got focus -if (mrEditWindow.GetView() && SmViewShell::IsInlineEditEnabled()) -mrEditWindow.GetView()->SetInsertIntoEditWindow(true); } void SmEditTextWindow::LoseFocus() diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 22ca4e575d3b..eacab22901ad 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -424,8 +424,6 @@ void SmGraphicWidget::GetFocus() return; if (SmEditWindow* pEdit = GetView().GetEditWindow()) pEdit->Flush(); -//Let view shell know what insertions should be done in visual editor -GetView().SetInsertIntoEditWindow(false); SetIsCursorVisible(true); ShowLine(true); CaretBlinkStart(); @@ -1784,7 +1782,7 @@ void SmViewShell::Execute(SfxRequest& rReq) case SID_CUT: -if (IsInlineEditEnabled() && !mbInsertIntoEditWindow) +if (IsInlineEditEnabled()) { GetDoc()->GetCursor().Cut(); GetGraphicWidget().GrabFocus(); @@ -1794,7 +1792,7 @@ void SmViewShell::Execute(SfxRequest& rReq) break; case SID_COPY: -if (IsInlineEditEnabled() && !mbInsertIntoEditWindow) +if (IsInlineEditEnabled()) { GetDoc()->GetCursor().Copy(); GetGraphicWidget().GrabFocus(); @@ -1814,7 +1812,7 @@ void SmViewShell::Execute(SfxRequest& rReq) case SID_PASTE: { -if (IsInlineEditEnabled() && !mbInsertIntoEditWindow) +if (IsInlineEditEnabled()) { GetDoc()->GetCursor().Paste(); GetGraphicWidget().GrabFocus(); @@ -1847,7 +1845,7 @@ void SmViewShell::Execute(SfxRequest& rReq) break; case SID_DELETE: -if (IsInlineEditEnabled() && !mbInsertIntoEditWindow) +if (IsInlineEditEnabled()) {
[Libreoffice-commits] core.git: starmath/inc starmath/source
starmath/inc/cursor.hxx|1 starmath/source/cursor.cxx |7 starmath/source/view.cxx | 64 - 3 files changed, 66 insertions(+), 6 deletions(-) New commits: commit 065609f86f730d4eedc6b7ae28382dc7daea11ac Author: Khaled Hosny AuthorDate: Mon Sep 4 13:22:04 2023 +0300 Commit: خالد حسني CommitDate: Mon Sep 4 19:29:45 2023 +0200 starmath: Make cut/copy/paste buttons work with inline editing Check for visual cursor selection when in inline editing mode, and update edit window when updating visual cursor. Change-Id: Id1a259b67db47eea0b36b55d08ef5dc5f8aa8246 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156513 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/inc/cursor.hxx b/starmath/inc/cursor.hxx index 0a8a35071f10..7e1f8ec83c53 100644 --- a/starmath/inc/cursor.hxx +++ b/starmath/inc/cursor.hxx @@ -85,6 +85,7 @@ public: /** True, if the cursor has a selection */ bool HasSelection() const { return mpAnchor != mpPosition; } +const ESelection& GetSelection(); /** Move the position of this cursor */ void Move(OutputDevice* pDev, SmMovementDirection direction, bool bMoveAnchor = true); diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx index e8623517bcd7..41506dff3109 100644 --- a/starmath/source/cursor.cxx +++ b/starmath/source/cursor.cxx @@ -1141,6 +1141,13 @@ SmNode* SmCursor::FindSelectedNode(SmNode* pNode){ return nullptr; } +const ESelection& SmCursor::GetSelection() { +const SmNode* pNode = FindSelectedNode(mpTree); +if (!pNode) +return mpTree->GetSelection(); +return pNode->GetSelection(); +} + void SmCursor::LineToList(SmStructureNode* pLine, SmNodeList& list){ for(auto pChild : *pLine) { diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 85dccb711ec6..22ca4e575d3b 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -368,8 +368,13 @@ bool SmGraphicWidget::MouseButtonDown(const MouseEvent& rMEvt) if (!pTree) return true; +SmEditWindow* pEdit = GetView().GetEditWindow(); + if (SmViewShell::IsInlineEditEnabled()) { -GetCursor().MoveTo(&rDevice, aPos, !rMEvt.IsShift()); +SmCursor& rCursor = GetCursor(); +rCursor.MoveTo(&rDevice, aPos, !rMEvt.IsShift()); +if (pEdit) +pEdit->SetSelection(rCursor.GetSelection()); // 'on grab' window events are missing in lok, do it explicitly if (comphelper::LibreOfficeKit::isActive()) SetIsCursorVisible(true); @@ -383,7 +388,6 @@ bool SmGraphicWidget::MouseButtonDown(const MouseEvent& rMEvt) if (!pNode) return true; -SmEditWindow* pEdit = GetView().GetEditWindow(); if (!pEdit) return true; @@ -713,6 +717,7 @@ bool SmGraphicWidget::KeyInput(const KeyEvent& rKEvt) return GetView().KeyInput(rKEvt); bool bConsumed = true; +bool bSetSelection = false; SmCursor& rCursor = GetCursor(); switch (rKEvt.GetKeyCode().GetFunction()) @@ -737,24 +742,32 @@ bool SmGraphicWidget::KeyInput(const KeyEvent& rKEvt) { case KEY_LEFT: rCursor.Move(&GetOutputDevice(), MoveLeft, !rKEvt.GetKeyCode().IsShift()); +bSetSelection = true; break; case KEY_RIGHT: rCursor.Move(&GetOutputDevice(), MoveRight, !rKEvt.GetKeyCode().IsShift()); +bSetSelection = true; break; case KEY_UP: rCursor.Move(&GetOutputDevice(), MoveUp, !rKEvt.GetKeyCode().IsShift()); +bSetSelection = true; break; case KEY_DOWN: rCursor.Move(&GetOutputDevice(), MoveDown, !rKEvt.GetKeyCode().IsShift()); +bSetSelection = true; break; case KEY_RETURN: if (!rKEvt.GetKeyCode().IsShift()) +{ rCursor.InsertRow(); +bSetSelection = true; +} break; case KEY_DELETE: if (!rCursor.HasSelection()) { rCursor.Move(&GetOutputDevice(), MoveRight, false); +bSetSelection = true; if (rCursor.HasComplexSelection()) break; } @@ -762,12 +775,17 @@ bool SmGraphicWidget::KeyInput(const KeyEvent& rKEvt) break; case KEY_BACKSPACE: rCursor.DeletePrev(&GetOutputDevice()); +bSetSelection = true; break; default: if (!CharInput(rKEvt.GetCharCode(), rCursor, GetOutputDevice())) bConsumed = GetView().KeyInpu
[Libreoffice-commits] core.git: starmath/inc starmath/source
starmath/inc/visitors.hxx|2 +- starmath/source/document.cxx | 24 ++-- starmath/source/visitors.cxx |8 3 files changed, 23 insertions(+), 11 deletions(-) New commits: commit f80c2c70756e3620daed6675c8546caca4153d4b Author: Khaled Hosny AuthorDate: Tue Aug 29 20:51:06 2023 +0300 Commit: خالد حسني CommitDate: Mon Sep 4 18:18:37 2023 +0200 tdf#134193: Fix inline editing with RTL direction Change-Id: I65d3ed0d7c56839ce3674318144269719b043ba5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156261 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/inc/visitors.hxx b/starmath/inc/visitors.hxx index c1a2a8983286..338e93432ba1 100644 --- a/starmath/inc/visitors.hxx +++ b/starmath/inc/visitors.hxx @@ -219,7 +219,7 @@ public: , maPosition( position ) , mrFormat( rFormat ) { -if (mrFormat.IsRightToLeft()) +if (mrFormat.IsRightToLeft() && mrDev.GetOutDevType() != OUTDEV_WINDOW) mrDev.ReMirror(maPosition); pTree->Accept( this ); } diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index 9bdaad7530e6..8f8e184470a0 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -332,8 +332,10 @@ void SmDocShell::DrawFormula(OutputDevice &rDev, Point &rPosition, bool bDrawSel rPosition.AdjustY(maFormat.GetDistance( DIS_TOPSPACE ) ); Point aPosition(rPosition); -if (bRTL) -aPosition.AdjustX(GetSize().Width() - maFormat.GetDistance(DIS_LEFTSPACE) - maFormat.GetDistance(DIS_RIGHTSPACE)); +if (bRTL && rDev.GetOutDevType() != OUTDEV_WINDOW) +aPosition.AdjustX(GetSize().Width() + - maFormat.GetDistance(DIS_LEFTSPACE) + - maFormat.GetDistance(DIS_RIGHTSPACE)); //! in case of high contrast-mode (accessibility option!) //! the draw mode needs to be set to default, because when embedding @@ -353,11 +355,21 @@ void SmDocShell::DrawFormula(OutputDevice &rDev, Point &rPosition, bool bDrawSel vcl::PushFlags::RTLENABLED); // We want the device to always be LTR, we handle RTL formulas ourselves. -rDev.EnableRTL(false); +if (rDev.GetOutDevType() == OUTDEV_WINDOW) +rDev.EnableRTL(bRTL); +else +rDev.EnableRTL(false); -// For RTL formulas, we want the brackets to be mirrored. -rDev.SetLayoutMode(bRTL ? vcl::text::ComplexTextLayoutFlags::BiDiRtl -: vcl::text::ComplexTextLayoutFlags::Default); +auto nLayoutFlags = vcl::text::ComplexTextLayoutFlags::Default; +if (bRTL) +{ +// For RTL formulas, we want the brackets to be mirrored. +nLayoutFlags |= vcl::text::ComplexTextLayoutFlags::BiDiRtl; +if (rDev.GetOutDevType() == OUTDEV_WINDOW) +nLayoutFlags |= vcl::text::ComplexTextLayoutFlags::TextOriginLeft; +} + +rDev.SetLayoutMode(nLayoutFlags); // Numbers should not be converted, for now. rDev.SetDigitLanguage( LANGUAGE_ENGLISH ); diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx index cece754de276..732c27f9840f 100644 --- a/starmath/source/visitors.cxx +++ b/starmath/source/visitors.cxx @@ -438,7 +438,7 @@ void SmDrawingVisitor::Visit( SmRootSymbolNode* pNode ) tools::Rectangle aBar( aBarPos, Size( nBarWidth, nBarHeight ) ); -if (mrFormat.IsRightToLeft()) +if (mrFormat.IsRightToLeft() && mrDev.GetOutDevType() != OUTDEV_WINDOW) mrDev.ReMirror(aBar); //! avoid GROWING AND SHRINKING of drawn rectangle when constantly @@ -465,7 +465,7 @@ void SmDrawingVisitor::Visit( SmPolyLineNode* pNode ) + Point( nBorderwidth, nBorderwidth ) ), aPos ( maPosition + aOffset ); -if (mrFormat.IsRightToLeft()) +if (mrFormat.IsRightToLeft() && mrDev.GetOutDevType() != OUTDEV_WINDOW) mrDev.ReMirror(aPos); pNode->GetPolygon( ).Move( aPos.X( ), aPos.Y( ) );//Works because Polygon wraps a pointer @@ -497,7 +497,7 @@ void SmDrawingVisitor::Visit( SmRectangleNode* pNode ) SAL_WARN_IF( aTmp.IsEmpty(), "starmath", "Empty rectangle" ); -if (mrFormat.IsRightToLeft()) +if (mrFormat.IsRightToLeft() && mrDev.GetOutDevType() != OUTDEV_WINDOW) mrDev.ReMirror(aTmp); //! avoid GROWING AND SHRINKING of drawn rectangle when constantly @@ -521,7 +521,7 @@ void SmDrawingVisitor::DrawTextNode( SmTextNode* pNode ) Point aPos ( maPosition ); aPos.AdjustY(pNode->GetBaselineOffset( ) ); -if (mrFormat.IsRightToLeft()) +if (mrFormat.IsRightToLeft() && mrDev.GetOutDevType() != OUTDEV_WINDOW) mrDev.ReMirror(aPos); // round to pixel coordinate
[Libreoffice-commits] core.git: starmath/source
starmath/source/view.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit fe3098b4c4b5b8099e43279044db9ae7a1e0999d Author: Khaled Hosny AuthorDate: Sun Aug 27 15:06:14 2023 +0300 Commit: خالد حسني CommitDate: Mon Sep 4 18:18:16 2023 +0200 tdf#134193: Fix RTL selection and cursor handling Change-Id: Ib9d7dd56d884aaca9b88a8b9403aeef30a9917d5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156167 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 6505031f13ba..85dccb711ec6 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -310,6 +310,7 @@ void SmGraphicWidget::SetDrawingArea(weld::DrawingArea* pDrawingArea) OutputDevice& rDevice = GetOutputDevice(); +rDevice.EnableRTL(GetDoc()->GetFormat().IsRightToLeft()); rDevice.SetBackground(SM_MOD()->GetColorConfig().GetColorValue(svtools::DOCCOLOR).nColor); if (comphelper::LibreOfficeKit::isActive()) @@ -2073,6 +2074,7 @@ void SmViewShell::Execute(SfxRequest& rReq) { bool bRTL = rReq.GetSlot() == SID_ATTR_PARA_RIGHT_TO_LEFT; GetDoc()->SetRightToLeft(bRTL); + GetGraphicWindow().GetGraphicWidget().GetOutputDevice().EnableRTL(bRTL); GetViewFrame().GetBindings().Invalidate(bRTL ? SID_ATTR_PARA_LEFT_TO_RIGHT : SID_ATTR_PARA_RIGHT_TO_LEFT); } break;
[Libreoffice-commits] core.git: starmath/sdi starmath/source starmath/uiconfig
starmath/sdi/smslots.sdi| 10 ++ starmath/source/view.cxx| 16 starmath/uiconfig/smath/toolbar/toolbar.xml |3 +++ 3 files changed, 29 insertions(+) New commits: commit b6c30b3d35eb01205acf0271d0192921c60eb73b Author: Khaled Hosny AuthorDate: Wed Aug 16 16:08:49 2023 +0300 Commit: خالد حسني CommitDate: Mon Sep 4 18:17:45 2023 +0200 tdf#134193: Allow setting math direction Add LTR/RTL buttons to the toolbar and make them change the IsRightToLeft property. Change-Id: I8ae793a9899c50b6dfaf3563a7c22c1f1eab8c8d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155739 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/sdi/smslots.sdi b/starmath/sdi/smslots.sdi index 47468ce5f11d..3f998e8b182b 100644 --- a/starmath/sdi/smslots.sdi +++ b/starmath/sdi/smslots.sdi @@ -282,6 +282,16 @@ interface FormulaView ExecMethod = Execute ; StateMethod = GetState ; ] +SID_ATTR_PARA_LEFT_TO_RIGHT +[ +ExecMethod = Execute ; +StateMethod = GetState ; +] +SID_ATTR_PARA_RIGHT_TO_LEFT +[ +ExecMethod = Execute ; +StateMethod = GetState ; +] } shell SmViewShell diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index a71438bc82b5..6505031f13ba 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -2067,6 +2067,15 @@ void SmViewShell::Execute(SfxRequest& rReq) aDialog.run(); } break; + +case SID_ATTR_PARA_LEFT_TO_RIGHT: +case SID_ATTR_PARA_RIGHT_TO_LEFT: +{ +bool bRTL = rReq.GetSlot() == SID_ATTR_PARA_RIGHT_TO_LEFT; +GetDoc()->SetRightToLeft(bRTL); +GetViewFrame().GetBindings().Invalidate(bRTL ? SID_ATTR_PARA_LEFT_TO_RIGHT : SID_ATTR_PARA_RIGHT_TO_LEFT); +} +break; } rReq.Done(); } @@ -2155,6 +2164,13 @@ void SmViewShell::GetState(SfxItemSet &rSet) rSet.Put(SfxBoolItem(SID_ELEMENTSDOCKINGWINDOW, bState)); } break; +case SID_ATTR_PARA_LEFT_TO_RIGHT: +rSet.Put(SfxBoolItem(nWh, !GetDoc()->GetFormat().IsRightToLeft())); +break; + +case SID_ATTR_PARA_RIGHT_TO_LEFT: +rSet.Put(SfxBoolItem(nWh, GetDoc()->GetFormat().IsRightToLeft())); +break; } } } diff --git a/starmath/uiconfig/smath/toolbar/toolbar.xml b/starmath/uiconfig/smath/toolbar/toolbar.xml index 7501380c4383..2a093f9bb6e0 100644 --- a/starmath/uiconfig/smath/toolbar/toolbar.xml +++ b/starmath/uiconfig/smath/toolbar/toolbar.xml @@ -26,4 +26,7 @@ + + +
[Libreoffice-commits] core.git: include/vcl starmath/inc starmath/source
include/vcl/outdev.hxx|6 ++-- starmath/inc/visitors.hxx |7 - starmath/source/ElementsDockingWindow.cxx |2 - starmath/source/document.cxx | 41 ++ starmath/source/visitors.cxx | 15 ++ 5 files changed, 56 insertions(+), 15 deletions(-) New commits: commit fb43c497f2cc71c988a967fa0126c27561f8c16d Author: Khaled Hosny AuthorDate: Wed Aug 16 15:17:41 2023 +0300 Commit: خالد حسني CommitDate: Mon Sep 4 18:17:15 2023 +0200 tdf#134193: Support rendering math in RTL mode Respect IsRightToLeft property and render accordingly. This also fixes math rendering in RTL UI, which was incorrectly rendered RTL. Change-Id: Id8520930f09a21daa1c70e40a765ac25572ea994 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155738 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 898939978daa..f2fdf7ab7db7 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -1217,9 +1217,9 @@ public: // tells whether this output device is RTL in an LTR UI or LTR in a RTL UI SAL_DLLPRIVATE bool ImplIsAntiparallel() const ; -SAL_DLLPRIVATE void ReMirror( Point &rPoint ) const; -SAL_DLLPRIVATE void ReMirror( tools::Rectangle &rRect ) const; -SAL_DLLPRIVATE void ReMirror( vcl::Region &rRegion ) const; + void ReMirror( Point &rPoint ) const; + void ReMirror( tools::Rectangle &rRect ) const; + void ReMirror( vcl::Region &rRegion ) const; SAL_DLLPRIVATE bool ImplIsRecordLayout() const; virtual boolHasMirroredGraphics() const; std::unique_ptr diff --git a/starmath/inc/visitors.hxx b/starmath/inc/visitors.hxx index eaf329034c7d..c1a2a8983286 100644 --- a/starmath/inc/visitors.hxx +++ b/starmath/inc/visitors.hxx @@ -211,12 +211,16 @@ public: * @param rDevice Device to draw on * @param position Offset on device to draw the formula * @param pTree Formula tree to draw + * @param rFormat Formula formatting settings * @remarks This constructor will do the drawing, no need to anything more. */ -SmDrawingVisitor( OutputDevice &rDevice, Point position, SmNode* pTree ) +SmDrawingVisitor( OutputDevice &rDevice, Point position, SmNode* pTree, const SmFormat& rFormat ) : mrDev( rDevice ) , maPosition( position ) +, mrFormat( rFormat ) { +if (mrFormat.IsRightToLeft()) +mrDev.ReMirror(maPosition); pTree->Accept( this ); } virtual ~SmDrawingVisitor() {} @@ -265,6 +269,7 @@ private: so if needed cache it locally on the stack. */ Point maPosition; +const SmFormat& mrFormat; }; // SmSetSelectionVisitor diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx index 7fdfb3b3ec49..d1feabd921a9 100644 --- a/starmath/source/ElementsDockingWindow.cxx +++ b/starmath/source/ElementsDockingWindow.cxx @@ -546,7 +546,7 @@ void SmElementsControl::addElement(const OUString& aElementVisual, const OUStrin Size aSize = pDevice->LogicToPixel(Size(pNode->GetWidth(), pNode->GetHeight())); aSize.extendBy(10, 0); // Add 5 pixels from both sides to accommodate extending parts of italics pDevice->SetOutputSizePixel(aSize); -SmDrawingVisitor(*pDevice, pDevice->PixelToLogic(Point(5, 0)), pNode.get()); +SmDrawingVisitor(*pDevice, pDevice->PixelToLogic(Point(5, 0)), pNode.get(), maFormat); maItemDatas.push_back(std::make_unique(aElementSource, aHelpText)); const OUString aId(weld::toId(maItemDatas.back().get())); diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index c0f28ac18190..9bdaad7530e6 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -261,10 +261,18 @@ void SmDocShell::ArrangeFormula() const SmFormat &rFormat = GetFormat(); mpTree->Prepare(rFormat, *this, 0); -// format/draw formulas always from left to right, -// and numbers should not be converted -pOutDev->Push(vcl::PushFlags::TEXTLAYOUTMODE | vcl::PushFlags::TEXTLANGUAGE); -pOutDev->SetLayoutMode( vcl::text::ComplexTextLayoutFlags::Default ); +pOutDev->Push(vcl::PushFlags::TEXTLAYOUTMODE | vcl::PushFlags::TEXTLANGUAGE | + vcl::PushFlags::RTLENABLED); + +// We want the device to always be LTR, we handle RTL formulas ourselves. +pOutDev->EnableRTL(false); + +// For RTL formulas, we want the brackets to be mirrored. +bool bRTL = GetFormat().IsRightToLeft(); +pOutDev->SetLayoutMode(bRTL ? vcl::text::ComplexTextLayoutFlags::BiDiRtl +: vcl::tex
[Libreoffice-commits] core.git: offapi/com starmath/inc starmath/source
offapi/com/sun/star/formula/FormulaProperties.idl |6 ++ starmath/inc/document.hxx |2 ++ starmath/inc/format.hxx |4 starmath/source/cfgitem.cxx |7 +++ starmath/source/document.cxx | 18 ++ starmath/source/format.cxx|4 +++- starmath/source/mathml/mathmlexport.cxx | 21 - starmath/source/unomodel.cxx | 10 ++ 8 files changed, 66 insertions(+), 6 deletions(-) New commits: commit 5c5c71266ff14493975f20ff5807f31565a3f909 Author: Khaled Hosny AuthorDate: Wed Aug 16 15:08:33 2023 +0300 Commit: خالد حسني CommitDate: Mon Sep 4 18:15:50 2023 +0200 tdf#134193: Add the ability to set RTL math direction This adds a new IsRightToLeft document property, reads/writes it, and sets dir="rtl" on the top level MathML element if set to true. Rendering will be handled in next commits. Change-Id: Ia3078b8a269fef7c3f037a2f1b7799744df2680b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155737 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/offapi/com/sun/star/formula/FormulaProperties.idl b/offapi/com/sun/star/formula/FormulaProperties.idl index 204e06f50ba0..79ab4e7244bc 100644 --- a/offapi/com/sun/star/formula/FormulaProperties.idl +++ b/offapi/com/sun/star/formula/FormulaProperties.idl @@ -282,6 +282,12 @@ published service FormulaProperties @since OOo 3.4 */ [property, optional] shortBaseLine; + +/** switches into right-to-left layout. + +@since LibreOffice 24.2 + */ +[property, optional] boolean IsRightToLeft; }; diff --git a/starmath/inc/document.hxx b/starmath/inc/document.hxx index bf9477b30f11..45321614385a 100644 --- a/starmath/inc/document.hxx +++ b/starmath/inc/document.hxx @@ -222,6 +222,8 @@ public: mathml::SmMlIteratorFree(m_pMlElementTree); m_pMlElementTree = pMlElementTree; } + +void SetRightToLeft(bool bRTL); }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/starmath/inc/format.hxx b/starmath/inc/format.hxx index 23dc04d290cf..5845d148e7fa 100644 --- a/starmath/inc/format.hxx +++ b/starmath/inc/format.hxx @@ -98,6 +98,7 @@ class SM_DLLPUBLIC SmFormat final : public SfxBroadcaster SmHorAlign eHorAlign; sal_Int16 nGreekCharStyle; boolbIsTextmode, +bIsRightToLeft, bScaleNormalBrackets; public: @@ -126,6 +127,9 @@ public: boolIsTextmode() const { return bIsTextmode; } voidSetTextmode(bool bVal) { bIsTextmode = bVal; } +boolIsRightToLeft() const { return bIsRightToLeft; } +voidSetRightToLeft(bool bVal) { bIsRightToLeft = bVal; } + sal_Int16 GetGreekCharStyle() const { return nGreekCharStyle; } voidSetGreekCharStyle(sal_Int16 nVal) { nGreekCharStyle = nVal; } diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx index 2146c366cd1e..6e27a0168e8b 100644 --- a/starmath/source/cfgitem.cxx +++ b/starmath/source/cfgitem.cxx @@ -91,6 +91,7 @@ static Sequence< OUString > lcl_GetFormatPropertyNames() //! see respective load/save routines here return Sequence< OUString > { "StandardFormat/Textmode", +"StandardFormat/RightToLeft", "StandardFormat/GreekCharStyle", "StandardFormat/ScaleNormalBracket", "StandardFormat/HorizontalAlignment", @@ -983,6 +984,10 @@ void SmMathConfig::LoadFormat() if (pVal->hasValue() && (*pVal >>= bTmp)) pFormat->SetTextmode( bTmp ); ++pVal; +// StandardFormat/RightToLeft +if (pVal->hasValue() && (*pVal >>= bTmp)) +pFormat->SetRightToLeft( bTmp ); +++pVal; // StandardFormat/GreekCharStyle if (pVal->hasValue() && (*pVal >>= nTmp16)) pFormat->SetGreekCharStyle( nTmp16 ); @@ -1061,6 +1066,8 @@ void SmMathConfig::SaveFormat() // StandardFormat/Textmode *pValue++ <<= pFormat->IsTextmode(); +// StandardFormat/RightToLeft +*pValue++ <<= pFormat->IsRightToLeft(); // StandardFormat/GreekCharStyle *pValue++ <<= pFormat->GetGreekCharStyle(); // StandardFormat/ScaleNormalBracket diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index 5c09cf40d3c0..c0f28ac18190 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -1219,4 +1219,22 @@ bool SmDocShell::WriteAsMathType3( SfxMedium& rMedium ) return aEquation.ConvertFromStarMath( rMedium ); } +void SmDocShell::SetRi
[Libreoffice-commits] core.git: starmath/source
starmath/source/view.cxx | 36 +--- 1 file changed, 17 insertions(+), 19 deletions(-) New commits: commit 03c43d303b6d32dc4c39bd273d446b66a3e6c42d Author: Khaled Hosny AuthorDate: Thu Aug 31 11:55:22 2023 +0300 Commit: خالد حسني CommitDate: Mon Sep 4 11:58:15 2023 +0200 Math: enable in-place editing on desktop Move the code outside the else block as it doesn’t get hit for me on desktop otherwise, and use SmViewShell::IsInlineEditEnabled() instead of comphelper::LibreOfficeKit::isActive() (which is included in the former). Followup to: commit 737a270c61cd2038ede7911b7d7b4afcf020f53c Date: Mon Jan 17 17:15:46 2022 +0300 lok: enable in-place editing of math equations Change-Id: Ie604f152344b83479eaf6024b6d58e374abb39b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156331 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 97332a4810c1..a71438bc82b5 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -835,26 +835,24 @@ bool SmGraphicWidget::Command(const CommandEvent& rCEvt) default: break; } } -else + +switch (rCEvt.GetCommand()) { -switch (rCEvt.GetCommand()) -{ -case CommandEventId::ExtTextInput: -if (comphelper::LibreOfficeKit::isActive()) -{ -const CommandExtTextInputData* pData = rCEvt.GetExtTextInputData(); -assert(pData); -const OUString& rText = pData->GetText(); -SmCursor& rCursor = GetCursor(); -OutputDevice& rDevice = GetOutputDevice(); -for (sal_Int32 i = 0; i < rText.getLength();) -CharInput(rText.iterateCodePoints(&i), rCursor, rDevice); -bCallBase = false; -} -break; -default: -break; -} +case CommandEventId::ExtTextInput: +if (SmViewShell::IsInlineEditEnabled()) +{ +const CommandExtTextInputData* pData = rCEvt.GetExtTextInputData(); +assert(pData); +const OUString& rText = pData->GetText(); +SmCursor& rCursor = GetCursor(); +OutputDevice& rDevice = GetOutputDevice(); +for (sal_Int32 i = 0; i < rText.getLength();) +CharInput(rText.iterateCodePoints(&i), rCursor, rDevice); +bCallBase = false; +} +break; +default: +break; } return !bCallBase; }
[Libreoffice-commits] core.git: starmath/source
starmath/source/view.cxx |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) New commits: commit cc7d6211bc01e5ec84dbad542605d2e93dea925c Author: Khaled Hosny AuthorDate: Sun Sep 3 19:00:22 2023 +0300 Commit: خالد حسني CommitDate: Sun Sep 3 23:26:07 2023 +0200 starmath: Disable formula cursor toolbar button when inline editing is enabled It is ignore when inline editing is enable, so better disable it to make it clear. Change-Id: Ie79a1c16109109e213658d44a6ffc0bff2291c7a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156487 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 3e1e4909ea1d..97332a4810c1 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -2144,8 +2144,10 @@ void SmViewShell::GetState(SfxItemSet &rSet) case SID_FORMULACURSOR: { -SmModule *pp = SM_MOD(); -rSet.Put(SfxBoolItem(nWh, pp->GetConfig()->IsShowFormulaCursor())); +if (IsInlineEditEnabled()) +rSet.DisableItem(nWh); +else +rSet.Put(SfxBoolItem(nWh, SM_MOD()->GetConfig()->IsShowFormulaCursor())); } break; case SID_ELEMENTSDOCKINGWINDOW:
[Libreoffice-commits] core.git: 2 commits - officecfg/registry starmath/inc starmath/source starmath/uiconfig
officecfg/registry/schema/org/openoffice/Office/Math.xcs |6 starmath/inc/cfgitem.hxx |2 starmath/inc/dialog.hxx |1 starmath/inc/starmath.hrc|1 starmath/source/cfgitem.cxx | 35 +++ starmath/source/dialog.cxx |3 starmath/source/document.cxx |3 starmath/source/smmod.cxx|3 starmath/source/unomodel.cxx |3 starmath/source/view.cxx |2 starmath/uiconfig/smath/ui/smathsettings.ui | 159 --- 11 files changed, 142 insertions(+), 76 deletions(-) New commits: commit 2d47c824cd31294899fa24989b3d7bd4f98dcdee Author: Khaled Hosny AuthorDate: Sun Sep 3 18:46:37 2023 +0300 Commit: خالد حسني CommitDate: Sun Sep 3 23:25:59 2023 +0200 starmath: Graduate inline (visual) editing from experimental features It has been experimental for as long as LibreOffice existed, lets make it non-experimental but add an option to disable it. If it turns to be a disaster, we can flip the option and disable it by default. Change-Id: I63672c054d1ead269863079e7f9c118a44b3ba19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156486 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/officecfg/registry/schema/org/openoffice/Office/Math.xcs b/officecfg/registry/schema/org/openoffice/Office/Math.xcs index c4466e0da278..7c052633bad0 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Math.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Math.xcs @@ -297,6 +297,12 @@ Contains miscellaneous settings. + + + Enables inline (visual) editing mode. + +true + Ignores spacing symbols at the end of a line. diff --git a/starmath/inc/cfgitem.hxx b/starmath/inc/cfgitem.hxx index c81e9d086aed..1dfbd3ef9dd4 100644 --- a/starmath/inc/cfgitem.hxx +++ b/starmath/inc/cfgitem.hxx @@ -186,6 +186,8 @@ public: void SetSaveOnlyUsedSymbols(bool bVal); bool IsAutoCloseBrackets() const; void SetAutoCloseBrackets(bool bVal); +bool IsInlineEditEnable() const; +void SetInlineEditEnable(bool bVal); bool IsIgnoreSpacesRight() const; void SetIgnoreSpacesRight(bool bVal); bool IsAutoRedraw() const; diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx index ad283920a0d7..bed55f9ddabf 100644 --- a/starmath/inc/dialog.hxx +++ b/starmath/inc/dialog.hxx @@ -46,6 +46,7 @@ class SmPrintOptionsTabPage final : public SfxTabPage std::unique_ptr m_xSizeScaled; std::unique_ptr m_xSizeZoomed; std::unique_ptr m_xZoom; +std::unique_ptr m_xEnableInlineEdit; std::unique_ptr m_xNoRightSpaces; std::unique_ptr m_xSaveOnlyUsedSymbols; std::unique_ptr m_xAutoCloseBrackets; diff --git a/starmath/inc/starmath.hrc b/starmath/inc/starmath.hrc index 378aca8bc838..1127e6660cbd 100644 --- a/starmath/inc/starmath.hrc +++ b/starmath/inc/starmath.hrc @@ -73,5 +73,6 @@ class SfxUInt16Item; #define SID_AUTO_CLOSE_BRACKETS TypedWhichId(SID_SMA_START + 127) #define SID_SMEDITWINDOWZOOMTypedWhichId(SID_SMA_START + 129) #define SID_DEFAULT_SM_SYNTAX_VERSION TypedWhichId(SID_SMA_START + 130) +#define SID_INLINE_EDIT_ENABLE TypedWhichId(SID_SMA_START + 131) /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx index 3bf170c0afe4..2146c366cd1e 100644 --- a/starmath/source/cfgitem.cxx +++ b/starmath/source/cfgitem.cxx @@ -73,6 +73,7 @@ static Sequence lcl_GetOtherPropertyNames() "Misc/AutoCloseBrackets", "Misc/DefaultSmSyntaxVersion", "Misc/IgnoreSpacesRight", + "Misc/InlineEditEnable", "Misc/SmEditWindowZoomFactor", "Print/FormulaText", "Print/Frame", @@ -144,6 +145,7 @@ struct SmCfgOther boolbPrintFrame; boolbIsSaveOnlyUsedSymbols; boolbIsAutoCloseBrackets; +boolbInlineEditEnable; boolbIgnoreSpacesRight; boolbToolboxVisible; boolbAutoRedraw; @@ -165,6 +167,7 @@ SmCfgOther::SmCfgOther() , bPrintFrame(true) , bIsSaveOnlyUsedSymbols(true) , bIsAutoCloseBrackets(true) +, bInlineEditEnable(true) , bIgnoreSpacesRight(true) , bToolboxVisible(true) , bAutoRedraw(true) @@ -793,6 +796,10 @@ void SmMathConfig::LoadOther() if (sal_Int16 nTmp; pVal->
[Libreoffice-commits] core.git: starmath/CppunitTest_starmath_import.mk starmath/inc starmath/qa starmath/source
starmath/CppunitTest_starmath_import.mk |1 starmath/inc/unomodel.hxx|4 + starmath/qa/cppunit/data/font-styles.odf |binary starmath/qa/cppunit/test_import.cxx | 91 +++ starmath/source/unomodel.cxx | 57 +-- 5 files changed, 136 insertions(+), 17 deletions(-) New commits: commit 626d17a8ec270937575e9684a325eb0669327a25 Author: Khaled Hosny AuthorDate: Thu Aug 31 14:54:52 2023 +0300 Commit: خالد حسني CommitDate: Thu Aug 31 20:41:00 2023 +0200 tdf#143213: Fix reading math font settings from file The order of reading the settings is significant, e.g. if font italic was read first then font name, font name would set a new font overriding the italic setting. We now collect all font settings and apply them at once. Change-Id: Idb32d7d416607011bc325eff0b73c03b2d12e7d3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156352 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/CppunitTest_starmath_import.mk b/starmath/CppunitTest_starmath_import.mk index 15c9053facfb..0139b590bac6 100644 --- a/starmath/CppunitTest_starmath_import.mk +++ b/starmath/CppunitTest_starmath_import.mk @@ -19,6 +19,7 @@ $(eval $(call gb_CppunitTest_use_external,starmath_import,boost_headers)) $(eval $(call gb_CppunitTest_use_sdk_api,starmath_import)) $(eval $(call gb_CppunitTest_add_exception_objects,starmath_import,\ +starmath/qa/cppunit/test_import \ starmath/qa/extras/mmlimport-test \ )) diff --git a/starmath/inc/unomodel.hxx b/starmath/inc/unomodel.hxx index 6c2ecbbdd4b0..6292b2825508 100644 --- a/starmath/inc/unomodel.hxx +++ b/starmath/inc/unomodel.hxx @@ -27,6 +27,8 @@ #include #include +#include "format.hxx" + inline constexpr OUStringLiteral PRTUIOPT_TITLE_ROW = u"TitleRow"; inline constexpr OUStringLiteral PRTUIOPT_FORMULA_TEXT = u"FormulaText"; inline constexpr OUStringLiteral PRTUIOPT_BORDER = u"Border"; @@ -48,6 +50,8 @@ class SmModel final : public SfxBaseModel, { std::unique_ptr m_pPrintUIOptions; +SmFace maFonts[FNT_END + 1]; + virtual void _setPropertyValues( const comphelper::PropertyMapEntry** ppEntries, const css::uno::Any* pValues ) override; virtual void _getPropertyValues( const comphelper::PropertyMapEntry** ppEntries, css::uno::Any* pValue ) override; public: diff --git a/starmath/qa/cppunit/data/font-styles.odf b/starmath/qa/cppunit/data/font-styles.odf new file mode 100644 index ..3b58386c2f1d Binary files /dev/null and b/starmath/qa/cppunit/data/font-styles.odf differ diff --git a/starmath/qa/cppunit/test_import.cxx b/starmath/qa/cppunit/test_import.cxx new file mode 100644 index ..5486dfe43e0c --- /dev/null +++ b/starmath/qa/cppunit/test_import.cxx @@ -0,0 +1,91 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include +#include + +#include + +#include +#include + +using namespace ::com::sun::star; + +namespace +{ +class Test : public UnoApiTest +{ +public: +Test() +: UnoApiTest("starmath/qa/cppunit/data/") +{ +} + +void testFontStyles(); + +CPPUNIT_TEST_SUITE(Test); +CPPUNIT_TEST(testFontStyles); +CPPUNIT_TEST_SUITE_END(); +}; + +void Test::testFontStyles() +{ +// tdf#143213 +loadFromURL(u"font-styles.odf"); +SfxBaseModel* pModel = dynamic_cast(mxComponent.get()); +SmDocShell* pDocShell = static_cast(pModel->GetObjectShell()); + +const SmFormat& aFormat = pDocShell->GetFormat(); + +CPPUNIT_ASSERT_EQUAL(ITALIC_NORMAL, aFormat.GetFont(FNT_MATH).GetItalic()); +CPPUNIT_ASSERT_EQUAL(WEIGHT_BOLD, aFormat.GetFont(FNT_MATH).GetWeight()); +CPPUNIT_ASSERT_EQUAL(aFormat.GetBaseSize().Height(), + aFormat.GetFont(FNT_MATH).GetFontSize().Height()); + +CPPUNIT_ASSERT_EQUAL(ITALIC_NORMAL, aFormat.GetFont(FNT_VARIABLE).GetItalic()); +CPPUNIT_ASSERT_EQUAL(WEIGHT_BOLD, aFormat.GetFont(FNT_VARIABLE).GetWeight()); +CPPUNIT_ASSERT_EQUAL(aFormat.GetBaseSize().Height(), + aFormat.GetFont(FNT_VARIABLE).GetFontSize().Height()); + +CPPUNIT_ASSERT_EQUAL(ITALIC_NORMAL, aFormat.GetFont(FNT_FUNCTION).GetItalic()); +CPPUNIT_ASSERT_EQUAL(WEIGHT_BOLD, aFormat.GetFont(FNT_FUNCTION).GetWeight()); +CPPUNIT_ASSERT_EQUAL(aFormat.GetBaseSize().Height(), + aFormat.GetFont(FNT_FUNCTION).GetFontSize().Height()); + +CPPUNIT_ASSERT_EQUAL(ITALIC_NORMAL, aFormat.GetFont(FNT_NUMBER).GetItalic()); +CPPUNIT_ASSERT_EQUAL(WEIGHT_BOLD, aFormat.GetFont(FNT_NUMBER
[Libreoffice-commits] core.git: Branch 'distro/collabora/co-23.05' - configure.ac
configure.ac |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit eb4027b14d035693898e3f8fa78478ff37e446d5 Author: Khaled Hosny AuthorDate: Sun Jun 4 21:47:32 2023 +0300 Commit: Aron Budea CommitDate: Mon Aug 28 22:50:36 2023 +0200 Fix ccache cache size detection I have ccache 4.8.1 and it reports: (/home/khaled/.config/ccache/ccache.conf) max_size = 30.0 GB With a space between the number and the unit and the configure check with then see a unit-less 30 and will warn: ccache's cache size is less than 1GB using it is counter-productive: Disabling auto-ccache detection Change-Id: I12bad9204feddfe06be7207d9367586da871a5e5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152592 Tested-by: Jenkins Reviewed-by: خالد حسني (cherry picked from commit 45f6b03349b2626c5e75008bccd4e094f96e2769) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156209 Reviewed-by: Andras Timar Tested-by: Jenkins CollaboraOffice diff --git a/configure.ac b/configure.ac index 4ea290ad2084..6f5b60ee8360 100644 --- a/configure.ac +++ b/configure.ac @@ -3319,8 +3319,9 @@ AC_SUBST(CCACHE_DEPEND_MODE) # sccache defaults are good enough if test "$CCACHE" != "" -a -z "$SCCACHE"; then # e.g. (/home/rene/.config/ccache/ccache.conf) max_size = 20.0G +# or (...) max_size = 20.0 G # -p works with both 4.2 and 4.4 -ccache_size_msg=$([$CCACHE -p | $AWK /max_size/'{ print $4 }' | sed -e 's/\.[0-9]*//']) +ccache_size_msg=$([$CCACHE -p | $AWK /max_size/'{ print $4 $5 }' | sed -e 's/\.[0-9]*//']) ccache_size=$(echo "$ccache_size_msg" | grep "G" | sed -e 's/G.*$//') if test "$ccache_size" = ""; then ccache_size=$(echo "$ccache_size_msg" | grep "M" | sed -e 's/\ M.*$//')
[Libreoffice-commits] core.git: starmath/inc starmath/source starmath/uiconfig
starmath/inc/cfgitem.hxx |2 starmath/inc/dialog.hxx |1 starmath/source/dialog.cxx |9 +++ starmath/source/unomodel.cxx | 12 + starmath/uiconfig/smath/ui/fonttypedialog.ui | 61 ++- 5 files changed, 73 insertions(+), 12 deletions(-) New commits: commit 900ce2fa32ae1726f64fc6959010650e93854ab3 Author: Khaled Hosny AuthorDate: Thu Aug 24 16:30:43 2023 +0300 Commit: خالد حسني CommitDate: Fri Aug 25 08:56:21 2023 +0200 tdf#101174: Add the ability to change math font in Math The math font (default is OpenSymbol) can now be changed from the fonts dialog like other fonts (variables, numbers, etc). Change-Id: I57f416173abf7bef8bb66b5e5e393dd928e30652 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156053 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/inc/cfgitem.hxx b/starmath/inc/cfgitem.hxx index 607f92d4e1b0..c81e9d086aed 100644 --- a/starmath/inc/cfgitem.hxx +++ b/starmath/inc/cfgitem.hxx @@ -102,7 +102,7 @@ class SmMathConfig final : public utl::ConfigItem, public SfxBroadcaster std::unique_ptr pSymbolMgr; bool bIsOtherModified; bool bIsFormatModified; -SmFontPickList vFontPickList[7]; +SmFontPickList vFontPickList[8]; sal_Int32 m_nCommitLock = 0; SmMathConfig(const SmMathConfig&) = delete; diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx index a595917d450d..f8fa5a9d66fa 100644 --- a/starmath/inc/dialog.hxx +++ b/starmath/inc/dialog.hxx @@ -131,6 +131,7 @@ class SmFontTypeDialog final : public weld::GenericDialogController { VclPtr pFontListDev; +std::unique_ptr m_xMathFont; std::unique_ptr m_xVariableFont; std::unique_ptr m_xFunctionFont; std::unique_ptr m_xNumberFont; diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 03bbc60da66a..7d8a837be77f 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -430,7 +430,9 @@ IMPL_LINK(SmFontTypeDialog, MenuSelectHdl, const OUString&, rIdent, void) SmFontPickListBox *pActiveListBox; bool bHideCheckboxes = false; -if (rIdent == "variables") +if (rIdent == "math") +pActiveListBox = m_xMathFont.get(); +else if (rIdent == "variables") pActiveListBox = m_xVariableFont.get(); else if (rIdent == "functions") pActiveListBox = m_xFunctionFont.get(); @@ -481,6 +483,7 @@ IMPL_LINK_NOARG(SmFontTypeDialog, DefaultButtonClickHdl, weld::Button&, void) SmFontTypeDialog::SmFontTypeDialog(weld::Window* pParent, OutputDevice *pFntListDevice) : GenericDialogController(pParent, "modules/smath/ui/fonttypedialog.ui", "FontsDialog") , pFontListDev(pFntListDevice) +, m_xMathFont(new SmFontPickListBox(m_xBuilder->weld_combo_box("mathCB"))) , m_xVariableFont(new SmFontPickListBox(m_xBuilder->weld_combo_box("variableCB"))) , m_xFunctionFont(new SmFontPickListBox(m_xBuilder->weld_combo_box("functionCB"))) , m_xNumberFont(new SmFontPickListBox(m_xBuilder->weld_combo_box("numberCB"))) @@ -503,6 +506,7 @@ void SmFontTypeDialog::ReadFrom(const SmFormat &rFormat) { SmModule *pp = SM_MOD(); +*m_xMathFont = pp->GetConfig()->GetFontPickList(FNT_MATH); *m_xVariableFont = pp->GetConfig()->GetFontPickList(FNT_VARIABLE); *m_xFunctionFont = pp->GetConfig()->GetFontPickList(FNT_FUNCTION); *m_xNumberFont = pp->GetConfig()->GetFontPickList(FNT_NUMBER); @@ -511,6 +515,7 @@ void SmFontTypeDialog::ReadFrom(const SmFormat &rFormat) *m_xSansFont = pp->GetConfig()->GetFontPickList(FNT_SANS); *m_xFixedFont= pp->GetConfig()->GetFontPickList(FNT_FIXED); +m_xMathFont->Insert( rFormat.GetFont(FNT_MATH) ); m_xVariableFont->Insert( rFormat.GetFont(FNT_VARIABLE) ); m_xFunctionFont->Insert( rFormat.GetFont(FNT_FUNCTION) ); m_xNumberFont->Insert( rFormat.GetFont(FNT_NUMBER) ); @@ -525,6 +530,7 @@ void SmFontTypeDialog::WriteTo(SmFormat &rFormat) const { SmModule *pp = SM_MOD(); +pp->GetConfig()->GetFontPickList(FNT_MATH) = *m_xMathFont; pp->GetConfig()->GetFontPickList(FNT_VARIABLE) = *m_xVariableFont; pp->GetConfig()->GetFontPickList(FNT_FUNCTION) = *m_xFunctionFont; pp->GetConfig()->GetFontPickList(FNT_NUMBER) = *m_xNumberFont; @@ -533,6 +539,7 @@ void SmFontTypeDialog::WriteTo(SmFormat &rFormat) const pp->GetConfig()->GetFontPickList(FNT_SANS) = *m_xSansFont; pp->GetConfig()->GetFontPickList(FNT_FIXED)= *m_xFixedFont; +rFormat.SetFont( FNT_MATH, m_xMathFont->Get() ); rFormat.SetFont( FNT_VARIABLE, m_xVariableFont->Get() ); rFormat.SetFont( FNT_
[Libreoffice-commits] core.git: vcl/unx
vcl/unx/generic/fontmanager/fontconfig.cxx | 10 ++ 1 file changed, 10 insertions(+) New commits: commit 5ca5acdd6e12fec08927743b60899100bc89af4d Author: Khaled Hosny AuthorDate: Thu Aug 24 10:49:42 2023 + Commit: خالد حسني CommitDate: Thu Aug 24 22:22:17 2023 +0200 tdf#140881: Ignore WOFF/WOFF2 fonts with FontConfig FC_FONT_WRAPPER requires unreleased FontConfig, but lets have this in so it works when FontConfig have it. Change-Id: I8f48ac1f68a3af6e1853e9eb1925d382b57136c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156049 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx index 113171445760..ae190ab96e58 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/unx/generic/fontmanager/fontconfig.cxx @@ -187,6 +187,10 @@ FontCfgWrapper::FontCfgWrapper() FcInit(); } +#ifndef FC_FONT_WRAPPER +#define FC_FONT_WRAPPER "fontwrapper" +#endif + void FontCfgWrapper::addFontSet( FcSetName eSetName ) { // Add only acceptable fonts to our config, for future fontconfig use. @@ -212,6 +216,12 @@ void FontCfgWrapper::addFontSet( FcSetName eSetName ) if ((eFormatRes == FcResultMatch) && (strcmp(reinterpret_cast(pFormat), "Type 1") == 0)) continue; +// Ignore any other non-SFNT wrapper format, including WOFF and WOFF2, too. +FcChar8* pWrapper = nullptr; +FcResult eWrapperRes = FcPatternGetString(pPattern, FC_FONT_WRAPPER, 0, &pWrapper); +if ((eWrapperRes == FcResultMatch) && (strcmp(reinterpret_cast(pWrapper), "SFNT") != 0)) +continue; + FcPatternReference( pPattern ); FcFontSetAdd( m_pFontSet, pPattern ); }
[Libreoffice-commits] core.git: 2 commits - include/vcl starmath/source vcl/source
include/vcl/rendercontext/State.hxx |4 +++- starmath/source/document.cxx| 13 - vcl/source/gdi/mtfxmldump.cxx |2 ++ vcl/source/outdev/stack.cxx |6 ++ 4 files changed, 15 insertions(+), 10 deletions(-) New commits: commit 611694b707eb43e4c0f20b781f6869016a3ba099 Author: Khaled Hosny AuthorDate: Thu Aug 17 17:39:29 2023 +0300 Commit: خالد حسني CommitDate: Thu Aug 24 13:17:49 2023 +0200 vcl: Allow pushing/popping OutputDevice’s RTLEnabled state Change-Id: Icafdc307c5c9df768f00c3ac0d128936607bf3e6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155794 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/include/vcl/rendercontext/State.hxx b/include/vcl/rendercontext/State.hxx index a433dbd8fb05..042eb2deca7a 100644 --- a/include/vcl/rendercontext/State.hxx +++ b/include/vcl/rendercontext/State.hxx @@ -53,6 +53,7 @@ enum class PushFlags TEXTLAYOUTMODE = 0x0800, TEXTLANGUAGE = 0x1000, OVERLINECOLOR = 0x2000, +RTLENABLED = 0x4000, ALL = 0x }; } @@ -66,7 +67,7 @@ template <> struct typed_flags : is_typed_flagsPush(); } @@ -184,6 +187,9 @@ void OutputDevice::Pop() SetRefPoint(); } +if ( rState.mnFlags & vcl::PushFlags::RTLENABLED ) +EnableRTL( rState.mbRTLEnabled ); + maOutDevStateStack.pop_back(); mpMetaFile = pOldMetaFile; commit a21ae72ab208b60bfd284d4630295f06e21c3481 Author: Khaled Hosny AuthorDate: Wed Aug 23 15:30:28 2023 +0300 Commit: خالد حسني CommitDate: Thu Aug 24 13:17:39 2023 +0200 starmath: Use OutputDevice::Push()/Pop() instead of doing it manually Change-Id: I628385cd64f3d65a1a567590bce754693b4d0684 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155795 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index a62d1e949d1a..cafd291fe14e 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -263,15 +263,13 @@ void SmDocShell::ArrangeFormula() // format/draw formulas always from left to right, // and numbers should not be converted -vcl::text::ComplexTextLayoutFlags nLayoutMode = pOutDev->GetLayoutMode(); +pOutDev->Push(vcl::PushFlags::TEXTLAYOUTMODE | vcl::PushFlags::TEXTLANGUAGE); pOutDev->SetLayoutMode( vcl::text::ComplexTextLayoutFlags::Default ); -LanguageType nDigitLang = pOutDev->GetDigitLanguage(); pOutDev->SetDigitLanguage( LANGUAGE_ENGLISH ); mpTree->Arrange(*pOutDev, rFormat); -pOutDev->SetLayoutMode( nLayoutMode ); -pOutDev->SetDigitLanguage( nDigitLang ); +pOutDev->Pop(); SetFormulaArranged(true); @@ -339,9 +337,8 @@ void SmDocShell::DrawFormula(OutputDevice &rDev, Point &rPosition, bool bDrawSel // format/draw formulas always from left to right // and numbers should not be converted -vcl::text::ComplexTextLayoutFlags nLayoutMode = rDev.GetLayoutMode(); +rDev.Push(vcl::PushFlags::TEXTLAYOUTMODE | vcl::PushFlags::TEXTLANGUAGE); rDev.SetLayoutMode( vcl::text::ComplexTextLayoutFlags::Default ); -LanguageType nDigitLang = rDev.GetDigitLanguage(); rDev.SetDigitLanguage( LANGUAGE_ENGLISH ); //Set selection if any @@ -353,9 +350,7 @@ void SmDocShell::DrawFormula(OutputDevice &rDev, Point &rPosition, bool bDrawSel //Drawing using visitor SmDrawingVisitor(rDev, rPosition, mpTree.get()); - -rDev.SetLayoutMode( nLayoutMode ); -rDev.SetDigitLanguage( nDigitLang ); +rDev.Pop(); if (bRestoreDrawMode) rDev.SetDrawMode( nOldDrawMode );
[Libreoffice-commits] core.git: vcl/source
vcl/source/gdi/pdfwriter_impl.cxx | 39 +- 1 file changed, 22 insertions(+), 17 deletions(-) New commits: commit bc3f6c3a47411a3b5dafadca4e5c55cd24e30662 Author: Khaled Hosny AuthorDate: Tue Aug 22 10:47:33 2023 +0300 Commit: خالد حسني CommitDate: Tue Aug 22 11:45:31 2023 +0200 tdf#155610: Workaround Acrobat bug with Type 3 fonts and unusual UPEM Adobe Acrobat seems to have a bug with Type 3 fonts with unusual UPEM, the common 1000 and 2048 UPEM work fine, but Sitka has 2250 UPEM and Acrobat handles the advance widths in this case incorrectly and everything gets cramped up with gaps when we re-start glyph positioning. Workaround this by always using 0.001 scale in FontMatrix (equivalent to 1000 UPEM) and scale everything if the font’s UPEM is different. Change-Id: I80d25a16456f04bb00304b22b967688fa8260a83 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155935 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 4cda5a09b287..fe93cabe0897 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2580,13 +2580,14 @@ bool PDFWriterImpl::emitType3Font(const vcl::font::PhysicalFontFace* pFace, + OString::number(aSubsetInfo.m_aFontBBox.Bottom() + 1) + "]\n"); -auto nScale = 1. / pFace->UnitsPerEm(); -aLine.append( -"/FontMatrix[" -+ OString::number(nScale) -+ " 0 0 " -+ OString::number(nScale) -+ " 0 0]\n"); +// tdf#155610 +// Adobe Acrobat does not seem to like certain UPEMs, so instead of +// setting the FontMatrix scale relative to the UPEM, we always set to +// 0.001 (1000 UPEM) and scale everything if the font’s UPEM is +// different. +double fScale = 1000. / pFace->UnitsPerEm(); + +aLine.append("/FontMatrix[0.001 0 0 0.001 0 0]\n"); sal_Int32 pGlyphStreams[256] = {}; aLine.append("/CharProcs<<\n"); @@ -2615,7 +2616,8 @@ bool PDFWriterImpl::emitType3Font(const vcl::font::PhysicalFontFace* pFace, "/Widths["); for (auto i = 0u; i < nGlyphs; i++) { -aLine.append(OString::number(pWidths[i]) + " "); +appendDouble(pWidths[i] * fScale, aLine); +aLine.append(" "); } aLine.append("]\n"); @@ -2645,8 +2647,8 @@ bool PDFWriterImpl::emitType3Font(const vcl::font::PhysicalFontFace* pFace, std::list aOutputStreams; // Scale for glyph outlines. -double fScaleX = GetDPIX() / 72.; -double fScaleY = GetDPIY() / 72.; +double fScaleX = (GetDPIX() / 72.) * fScale; +double fScaleY = (GetDPIY() / 72.) * fScale; for (auto i = 1u; i < nGlyphs; i++) { @@ -2654,7 +2656,8 @@ bool PDFWriterImpl::emitType3Font(const vcl::font::PhysicalFontFace* pFace, if (!updateObject(nStream)) return false; OStringBuffer aContents(1024); -aContents.append(OString::number(pWidths[i]) + " 0 d0\n"); +appendDouble(pWidths[i] * fScale, aContents); +aContents.append(" 0 d0\n"); const auto& rGlyph = rSubset.m_aMapping.find(pGlyphIds[i])->second; const auto& rLayers = rGlyph.getColorLayers(); @@ -2691,8 +2694,10 @@ bool PDFWriterImpl::emitType3Font(const vcl::font::PhysicalFontFace* pFace, } aContents.append( "BT " -"/F" + OString::number(rLayer.m_nFontID) + " " -+ OString::number(pFace->UnitsPerEm()) + " Tf " +"/F" + OString::number(rLayer.m_nFontID) + " "); +appendDouble(pFace->UnitsPerEm() * fScale, aContents); +aContents.append( +" Tf " "<"); appendHex(rLayer.m_nSubsetGlyphID, aContents); aContents.append( @@ -2712,11 +2717,11 @@ bool PDFWriterImpl::emitType3Font(const vcl::font::PhysicalFontFace* pFace, aUsedBitmaps, aResourceDict, aOutputStreams); auto nObject = aBitmapEmit.m_aReferenceXObject.getObject(); +aContents.append("q "); +appendDouble(aRect.GetWidth() * fScale, aContents); +aContents.append(" 0 0 "); +appendDouble(aRect.GetHeight() * fScale, aContents); aContents.append( -"q " -+ OString::number(aRect.GetWidth()) -+ " 0 0 " -+ OString::number(aRect.GetHeight()) + " " + OString::number(aRect.getX()) + " "
[Libreoffice-commits] core.git: vcl/qa vcl/source
vcl/qa/cppunit/svm/svmtest.cxx |4 ++-- vcl/source/gdi/mtfxmldump.cxx | 32 2 files changed, 26 insertions(+), 10 deletions(-) New commits: commit 77dab2ac3a4dfdc6f51fdfc31078fb828e8164fa Author: Khaled Hosny AuthorDate: Thu Aug 17 17:19:09 2023 +0300 Commit: خالد حسني CommitDate: Tue Aug 22 10:52:58 2023 +0200 vcl: Fix dumping meta file layout flags to XML These are bit flags, so we were always writing #, so now it does bitwise check for the flags and while at it write the names of the flags not the numeric values. Change-Id: I13cae38c0e549b2da1f834a264e3a3255bfa5c5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155793 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/qa/cppunit/svm/svmtest.cxx b/vcl/qa/cppunit/svm/svmtest.cxx index 5161f4cce960..d89f2f93118d 100644 --- a/vcl/qa/cppunit/svm/svmtest.cxx +++ b/vcl/qa/cppunit/svm/svmtest.cxx @@ -2298,11 +2298,11 @@ void SvmTest::checkLayoutMode(const GDIMetaFile& rMetaFile) xmlDocUniquePtr pDoc = dumpMeta(rMetaFile); assertXPathAttrs(pDoc, "/metafile/layoutmode[1]", { -{"textlayout", "#0004"} +{"textlayout", "TextOriginLeft"} }); assertXPathAttrs(pDoc, "/metafile/layoutmode[2]", { -{"textlayout", "#0001"} +{"textlayout", "BiDiRtl"} }); } diff --git a/vcl/source/gdi/mtfxmldump.cxx b/vcl/source/gdi/mtfxmldump.cxx index 8726316324de..c26a44310774 100644 --- a/vcl/source/gdi/mtfxmldump.cxx +++ b/vcl/source/gdi/mtfxmldump.cxx @@ -439,17 +439,33 @@ OUString convertPixelFormatToString(vcl::PixelFormat ePixelFormat) return OUString(); } -OUString convertComplexTestLayoutFlags(vcl::text::ComplexTextLayoutFlags eComplexTestLayoutFlags) +OUString convertComplexTestLayoutFlags(vcl::text::ComplexTextLayoutFlags nFlags) { -switch(eComplexTestLayoutFlags) +if (nFlags == vcl::text::ComplexTextLayoutFlags::Default) +return "Default"; + +std::vector aStrings; + +if (nFlags & vcl::text::ComplexTextLayoutFlags::BiDiRtl) +aStrings.emplace_back("BiDiRtl"); +if (nFlags & vcl::text::ComplexTextLayoutFlags::BiDiStrong) +aStrings.emplace_back("BiDiStrong"); +if (nFlags & vcl::text::ComplexTextLayoutFlags::TextOriginLeft) +aStrings.emplace_back("TextOriginLeft"); +if (nFlags & vcl::text::ComplexTextLayoutFlags::TextOriginRight) +aStrings.emplace_back("TextOriginRight"); + +OUString aString; + +if (aStrings.empty()) +return aString; + +aString = aStrings[0]; +for (size_t i = 1; i < aStrings.size(); ++i) { -default: -case vcl::text::ComplexTextLayoutFlags::Default: return "#"; -case vcl::text::ComplexTextLayoutFlags::BiDiRtl: return "#0001"; -case vcl::text::ComplexTextLayoutFlags::BiDiStrong: return "#0002"; -case vcl::text::ComplexTextLayoutFlags::TextOriginLeft: return "#0004"; -case vcl::text::ComplexTextLayoutFlags::TextOriginRight: return "#0008"; +aString += ", " + aStrings[i]; } +return aString; } OUString convertGfxLinkTypeToString(GfxLinkType eGfxLinkType)
[Libreoffice-commits] core.git: vcl/source
vcl/source/gdi/pdfwriter_impl.cxx | 10 ++ vcl/source/gdi/pdfwriter_impl2.cxx | 30 ++ 2 files changed, 12 insertions(+), 28 deletions(-) New commits: commit 3e20c3e73cbd10e8323f0997e3a6536abd11e2bd Author: Khaled Hosny AuthorDate: Tue Aug 22 06:13:10 2023 + Commit: خالد حسني CommitDate: Tue Aug 22 09:55:27 2023 +0200 tdf#156853: Fix PDF export of bitmap color fonts Move the alpha inversion down to createBitmapEmit() so that it gets applied to any bitmap embedded in the PDF, especially since embedded color bitmap glyphs don't go through the higher level code path. Regression from: commit 81994cb2b8b32453a92bcb011830fcb884f22ff3 Date: Fri Apr 16 20:33:10 2021 +0200 Convert internal vcl bitmap formats transparency->alpha (II) Change-Id: I68601a7a0d9ac01f5e8054f074f8e18fcbdea1be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155930 Reviewed-by: Noel Grandin Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 429efe3aa639..4cda5a09b287 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -9799,6 +9799,16 @@ void PDFWriterImpl::drawBitmap( const Point& rDestPoint, const Size& rDestSize, const BitmapEmit& PDFWriterImpl::createBitmapEmit(const BitmapEx& i_rBitmap, const Graphic& rGraphic, std::list& rBitmaps, ResourceDict& rResourceDict, std::list& rOutputStreams) { BitmapEx aBitmap( i_rBitmap ); + +// When rendering an image with an alpha mask during PDF export, the alpha +// mask needs to be inverted +if (aBitmap.IsAlpha()) +{ +AlphaMask aAlpha = aBitmap.GetAlphaMask(); +aAlpha.Invert(); +aBitmap = BitmapEx(aBitmap.GetBitmap(), aAlpha); +} + auto ePixelFormat = aBitmap.GetBitmap().getPixelFormat(); if( m_aContext.ColorMode == PDFWriter::DrawGreyscale ) aBitmap.Convert(BmpConversion::N8BitGreys); diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 54ff2201ead9..a9b2a1238000 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -763,15 +763,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa { const MetaBmpExAction* pA = static_cast(pAction); -// When rendering an image with an alpha mask during PDF -// export, the alpha mask needs to be inverted -BitmapEx aBitmapEx( pA->GetBitmapEx() ); -if ( aBitmapEx.IsAlpha()) -{ -AlphaMask aAlpha = aBitmapEx.GetAlphaMask(); -aAlpha.Invert(); -aBitmapEx = BitmapEx(aBitmapEx.GetBitmap(), aAlpha); -} +const BitmapEx& aBitmapEx( pA->GetBitmapEx() ); Size aSize( OutputDevice::LogicToLogic( aBitmapEx.GetPrefSize(), aBitmapEx.GetPrefMapMode(), pDummyVDev->GetMapMode() ) ); @@ -784,18 +776,8 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa { const MetaBmpExScaleAction* pA = static_cast(pAction); -// When rendering an image with an alpha mask during PDF -// export, the alpha mask needs to be inverted -BitmapEx aBitmapEx( pA->GetBitmapEx() ); -if ( aBitmapEx.IsAlpha()) -{ -AlphaMask aAlpha = aBitmapEx.GetAlphaMask(); -aAlpha.Invert(); -aBitmapEx = BitmapEx(aBitmapEx.GetBitmap(), aAlpha); -} - Graphic aGraphic = i_pOutDevData ? i_pOutDevData->GetCurrentGraphic() : Graphic(); -implWriteBitmapEx( pA->GetPoint(), pA->GetSize(), aBitmapEx, aGraphic, pDummyVDev, i_rContext ); +implWriteBitmapEx( pA->GetPoint(), pA->GetSize(), pA->GetBitmapEx(), aGraphic, pDummyVDev, i_rContext ); } break; @@ -803,15 +785,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa { const MetaBmpExScalePartAction* pA = static_cast(pAction); -// When rendering an image with an alpha mask during PDF -// export, the alpha mask needs to be inverted BitmapEx aBitmapEx( pA->GetBitmapEx() ); -if ( aBitmapEx.IsAlpha()) -{ -AlphaMask aAlpha = aBitmapEx.GetAlphaMask(); -aAl
Re: Getting started
> On 17 Aug 2023, at 12:38 AM, Chris Tapp wrote: > > I am definitely interested in any ideas you have to handle this. I wrote my current findings on the bugzilla issue (https://bugs.documentfoundation.org/show_bug.cgi?id=105298).
Re: Machine learning is used in gerrit build
> On 18 Aug 2023, at 6:21 PM, Baole Fang wrote: > > Hi Noel, > > The reason to choose it is that it is most likely to fail among all the > builds. If it fails, then there is no need to run others. This assumes it is failing because something in the change being built, but it often fails for random reasons, so it is not doing the developer any service not running the other job. Choosing a more reliable job would at least increase the chance of catching actual issues in the change quicker. Regards, Khaled
Re: Getting started
> On 16 Aug 2023, at 5:44 PM, Chris Tapp wrote: > > Hi Guys, > > I’m supporting an organisation that is using LO to create pdfs that are used > as inputs to a print-on-demand service, and we have identified a couple of > issues that I would like to have a go at resolving: > > 1) The handling of font names differs between the Windows and MacOS builds, > resulting in the rendering differing between the platforms; This is https://bugs.documentfoundation.org/show_bug.cgi?id=105298, I had a stap at it recently on https://gerrit.libreoffice.org/c/core/+/155455, but it is a complicated issue since macOS have no way of giving us the names we need for windows compatibility, and if we start to read the font name ourselves (like in the change above), more system API become useless (e.g. if we ask for font fallback, we will get names that is different from what we now have on our font list). I have some ideas to how to handle this, if you are still interested. Regards, Khaled
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - starmath/source
starmath/source/ElementsDockingWindow.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit ec7065bafc0a805b03a2b4d5522026f829c25522 Author: Khaled Hosny AuthorDate: Thu Aug 10 10:11:22 2023 +0300 Commit: Michael Stahl CommitDate: Fri Aug 11 13:25:48 2023 +0200 tdf#80467: Fix math rendering in elements dock with RTL UI Make sure to disable RTL on the OutputDevice, otherwise the math will be rendered right-to-left without even mirroring the parenthesis. Change-Id: Iea43dbc0d7efe914120d5cc1605522254344b4fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155538 Tested-by: Jenkins Reviewed-by: خالد حسني (cherry picked from commit f681d37d7aab768b507ea48d34a985b8dc49391a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155486 Reviewed-by: Michael Stahl diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx index b2186a7ecbf9..7fdfb3b3ec49 100644 --- a/starmath/source/ElementsDockingWindow.cxx +++ b/starmath/source/ElementsDockingWindow.cxx @@ -532,6 +532,7 @@ void SmElementsControl::addElement(const OUString& aElementVisual, const OUStrin pDevice->SetDrawMode(DrawModeFlags::Default); pDevice->SetLayoutMode(vcl::text::ComplexTextLayoutFlags::Default); pDevice->SetDigitLanguage(LANGUAGE_ENGLISH); +pDevice->EnableRTL(false); pDevice->SetBackground(GetControlBackground()); pDevice->SetTextColor(GetTextColor());
[Libreoffice-commits] core.git: starmath/source
starmath/source/symbol.cxx | 11 +++ 1 file changed, 11 insertions(+) New commits: commit 25b2e4a4e2f9b2191bdd80cca5a015e5b6089399 Author: Khaled Hosny AuthorDate: Thu Aug 10 14:19:45 2023 +0300 Commit: خالد حسني CommitDate: Thu Aug 10 15:43:47 2023 +0200 tdf#32415: Always accept English symbol names in math If symbol name does not match localized names, try to find a match using English (export) names. Change-Id: Id668ee68b07c8431c2780b78e26e07d3aef043aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/13 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/source/symbol.cxx b/starmath/source/symbol.cxx index 5dcf17309372..1523543d0a43 100644 --- a/starmath/source/symbol.cxx +++ b/starmath/source/symbol.cxx @@ -115,6 +115,17 @@ SmSym *SmSymbolManager::GetSymbolByName(const OUString& rSymbolName) SymbolMap_t::iterator aIt( m_aSymbols.find( rSymbolName ) ); if (aIt != m_aSymbols.end()) pRes = &aIt->second; +else +{ +for (auto& [_, rSymbol] : m_aSymbols) +{ +if (rSymbol.GetExportName() == rSymbolName) +{ +pRes = &rSymbol; +break; +} +} +} return pRes; }
[Libreoffice-commits] core.git: starmath/source
starmath/source/ElementsDockingWindow.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit ca78e610e1a4d20021d204c3d7857e6edb591fa6 Author: Khaled Hosny AuthorDate: Thu Aug 10 10:11:22 2023 +0300 Commit: خالد حسني CommitDate: Thu Aug 10 12:23:37 2023 +0200 tdf#80467: Fix math rendering in elements dock with RTL UI Make sure to disable RTL on the OutputDevice, otherwise the math will be rendered right-to-left without even mirroring the parenthesis. Change-Id: Iea43dbc0d7efe914120d5cc1605522254344b4fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155538 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx index b2186a7ecbf9..7fdfb3b3ec49 100644 --- a/starmath/source/ElementsDockingWindow.cxx +++ b/starmath/source/ElementsDockingWindow.cxx @@ -532,6 +532,7 @@ void SmElementsControl::addElement(const OUString& aElementVisual, const OUStrin pDevice->SetDrawMode(DrawModeFlags::Default); pDevice->SetLayoutMode(vcl::text::ComplexTextLayoutFlags::Default); pDevice->SetDigitLanguage(LANGUAGE_ENGLISH); +pDevice->EnableRTL(false); pDevice->SetBackground(GetControlBackground()); pDevice->SetTextColor(GetTextColor());
[Libreoffice-commits] core.git: solenv/clang-format vcl/inc vcl/Library_vcl.mk vcl/Library_vclplug_osx.mk vcl/osx vcl/quartz vcl/skia
solenv/clang-format/excludelist |2 vcl/Library_vcl.mk |4 vcl/Library_vclplug_osx.mk |4 vcl/inc/quartz/CoreTextFont.hxx | 74 ++ vcl/inc/quartz/CoreTextFontFace.hxx | 69 + vcl/inc/quartz/SystemFontList.hxx | 50 ++- vcl/inc/quartz/salgdi.h | 73 -- vcl/osx/saldata.cxx |1 vcl/quartz/CoreTextFont.cxx | 235 + vcl/quartz/CoreTextFontFace.cxx | 98 ++ vcl/quartz/SystemFontList.cxx | 251 vcl/quartz/salgdi.cxx | 22 --- vcl/skia/osx/gdiimpl.cxx|3 13 files changed, 536 insertions(+), 350 deletions(-) New commits: commit 3b7eb222411da48a9b7a585b39ef7a240f6222bc Author: Khaled Hosny AuthorDate: Wed Aug 9 12:03:06 2023 +0300 Commit: خالد حسني CommitDate: Wed Aug 9 12:42:57 2023 +0200 vcl: Organize CoreText font code a bit The code was all over the place with classes split between files or grouped in some files and I couldn’t make a head or tail of it. Move each class to a dedicated source/header file. Change-Id: I35daa05b4684c13339c637819dc30fa47a60cf65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155503 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist index 64eded82acab..ce890e04fb61 100644 --- a/solenv/clang-format/excludelist +++ b/solenv/clang-format/excludelist @@ -14558,7 +14558,7 @@ vcl/qa/cppunit/graphicfilter/filters-tga-test.cxx vcl/qa/cppunit/lifecycle.cxx vcl/qa/cppunit/svm/svmtest.cxx vcl/qa/cppunit/timer.cxx -vcl/quartz/ctfonts.cxx +vcl/quartz/SystemFontList.cxx vcl/quartz/salbmp.cxx vcl/quartz/salgdi.cxx vcl/quartz/salgdicommon.cxx diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index c29801fe58a3..f56c913f656f 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -688,7 +688,9 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/ios/iOSTransferable \ vcl/ios/DataFlavorMapping \ vcl/ios/HtmlFmtFlt \ -vcl/quartz/ctfonts \ +vcl/quartz/CoreTextFont \ +vcl/quartz/CoreTextFontFace \ +vcl/quartz/SystemFontList \ vcl/quartz/salbmp \ vcl/quartz/salgdi \ vcl/quartz/salgdicommon \ diff --git a/vcl/Library_vclplug_osx.mk b/vcl/Library_vclplug_osx.mk index fbb0e68ec904..0545af8dd33a 100644 --- a/vcl/Library_vclplug_osx.mk +++ b/vcl/Library_vclplug_osx.mk @@ -134,7 +134,9 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_osx,\ vcl/osx/salsys \ vcl/osx/saltimer \ vcl/osx/service_entry \ -vcl/quartz/ctfonts \ +vcl/quartz/CoreTextFont \ +vcl/quartz/CoreTextFontFace \ +vcl/quartz/SystemFontList \ vcl/quartz/salbmp \ vcl/quartz/salgdi \ vcl/quartz/salgdicommon \ diff --git a/vcl/inc/quartz/CoreTextFont.hxx b/vcl/inc/quartz/CoreTextFont.hxx new file mode 100644 index ..90cf6416772c --- /dev/null +++ b/vcl/inc/quartz/CoreTextFont.hxx @@ -0,0 +1,74 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#pragma once + +#include + +#include +#ifdef MACOSX +#include +#include +#include +#else +#include +#include +#endif +#include + +#ifdef IOS +// iOS defines a different Point class so include salgeom.hxx after postmac.h +// so that it will use the Point class in tools/gen.hxx +#include "salgeom.hxx" +#endif + +#include +#include +#include + +#include + +#include +#include + +class CoreTextFont final : public LogicalFontInstance +{ +friend rtl::Reference +CoreTextFontFace::CreateFontInstance(const vcl::font::FontSelectPattern&) const; + +public: +~CoreTextFont() override; + +void GetFontMetric(FontMetricDataRef const&); +bool GetGlyphOutline(sal_GlyphId, basegfx::B2DPolyPolygon&, bool) const override; + +CTFontRef GetCTFont() const { return mpCTFont; } + +/// <1.0: font is squeezed, >1.0 font is stretched, else 1.0 +float mfFontStretch; +/// text rotati
[Libreoffice-commits] core.git: officecfg/registry
officecfg/registry/data/org/openoffice/VCL.xcu | 24 1 file changed, 12 insertions(+), 12 deletions(-) New commits: commit 1e13ee5273848306cc6000d90e9f48593ea39bd8 Author: Khaled Hosny AuthorDate: Tue Aug 8 13:09:46 2023 + Commit: خالد حسني CommitDate: Tue Aug 8 18:19:21 2023 +0200 Revert "UI Workaround for tdf#146653: change localized Source Han {Sans,Serif} CN..." This reverts commit 22c7ce6c8e7d5b7f8b37ad6c519c2b8ca4853724. Not needed any more as we now get the style from FontConfig, since: commit 0b5e88bc88df6f0cd47e84cbd8bc53b649678f8b Author: Khaled Hosny Date: Thu Aug 3 13:44:43 2023 + tdf#114192: Speed up populating font list when FontConfig is used Change-Id: If6a51ffe681896a7ffda1a06da02585e8141c81e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155458 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/officecfg/registry/data/org/openoffice/VCL.xcu b/officecfg/registry/data/org/openoffice/VCL.xcu index c9063d713b53..2d472da4d2e5 100644 --- a/officecfg/registry/data/org/openoffice/VCL.xcu +++ b/officecfg/registry/data/org/openoffice/VCL.xcu @@ -261,19 +261,19 @@ 思源黑体 HW;Source Han Sans HW SC;Noto Sans Mono CJK SC;新宋体;NSimSun;Liberation Mono;Menlo;Courier New;Monospaced -思源黑体 Normal;Source Han Sans SC;思源黑体 CN Normal;Source Han Sans CN;Noto Sans SC;Noto Sans CJK SC;微软雅黑;Microsoft Yahei;新宋体;NSimSun;萍方-简;PingFang SC;华文细黑;STXihei;Arial Unicode MS;Tahoma +思源黑体;Source Han Sans SC;思源黑体 CN;Source Han Sans CN;Noto Sans SC;Noto Sans CJK SC;微软雅黑;Microsoft Yahei;新宋体;NSimSun;萍方-简;PingFang SC;华文细黑;STXihei;Arial Unicode MS;Tahoma -思源黑体 Normal;Source Han Sans SC;思源黑体 CN Normal;Source Han Sans CN;Noto Sans SC;Noto Sans CJK SC;微软雅黑;Microsoft Yahei;新宋体;NSimSun;萍方-简;PingFang SC;华文细黑;STXihei;Arial Unicode MS;Tahoma +思源黑体;Source Han Sans SC;思源黑体 CN;Source Han Sans CN;Noto Sans SC;Noto Sans CJK SC;微软雅黑;Microsoft Yahei;新宋体;NSimSun;萍方-简;PingFang SC;华文细黑;STXihei;Arial Unicode MS;Tahoma -思源黑体 Normal;Source Han Sans SC;思源黑体 CN Normal;Source Han Sans CN;Noto Sans SC;Noto Sans CJK SC;微软雅黑;Microsoft Yahei;新宋体;NSimSun;萍方-简;PingFang SC;华文细黑;STXihei;Arial Unicode MS;Tahoma +思源黑体;Source Han Sans SC;思源黑体 CN;Source Han Sans CN;Noto Sans SC;Noto Sans CJK SC;微软雅黑;Microsoft Yahei;新宋体;NSimSun;萍方-简;PingFang SC;华文细黑;STXihei;Arial Unicode MS;Tahoma -思源黑体 Normal;Source Han Sans SC;思源黑体 CN Normal;Source Han Sans CN;Noto Sans SC;Noto Sans CJK SC;微软雅黑;Microsoft Yahei;新宋体;NSimSun;萍方-简;PingFang SC;华文细黑;STXihei;Arial Unicode MS;Tahoma +思源黑体;Source Han Sans SC;思源黑体 CN;Source Han Sans CN;Noto Sans SC;Noto Sans CJK SC;微软雅黑;Microsoft Yahei;新宋体;NSimSun;萍方-简;PingFang SC;华文细黑;STXihei;Arial Unicode MS;Tahoma -思源宋体 Medium;Source Han Serif SC;思源宋体 CN Medium;Source Han Serif CN;Noto Serif SC;Noto Serif CJK SC;新宋体;NSimSun;宋体;SimSun;华文宋体;Songti SC;STSong;Arial Unicode MS;Tahoma +思源宋体;Source Han Serif SC;思源宋体 CN;Source Han Serif CN;Noto Serif SC;Noto Serif CJK SC;新宋体;NSimSun;宋体;SimSun;华文宋体;Songti SC;STSong;Arial Unicode MS;Tahoma 思源黑体 HW;Source Han Sans HW SC;Noto Sans Mono CJK SC;新宋体;NSimSun;Liberation Mono;Menlo;Courier New;Monospaced @@ -282,7 +282,7 @@ 思源黑体 HW;Source Han Sans HW SC;Noto Sans Mono CJK SC;新宋体;NSimSun;Liberation Mono;Menlo;Courier New;Monospaced -思源黑体 Normal;Source Han Sans SC;思源黑体 CN Normal;Source Han Sans CN;Noto Sans SC;Noto Sans CJK SC;微软雅黑;Microsoft Yahei;新宋体;NSimSun;宋体;SimSun;萍方-简;PingFang SC;华文细黑;STXihei;Segoe UI;Tahoma;San Francisco;Lucida Grande;Sans Serif +思源黑体;Source Han Sans SC;思源黑体 CN;Source Han Sans CN;Noto Sans SC;Noto Sans CJK SC;微软雅黑;Microsoft Yahei;新宋体;NSimSun;宋体;SimSun;萍方-简;PingFang SC;华文细黑;STXihei;Segoe UI;Tahoma;San Francisco;Lucida Grande;Sans Serif @@ -377,19 +377,19 @@ 思源黑体 HW;Source Han Sans HW SC;思源黑体 CN;Source Han Sans CN;Noto Sans Mono CJK SC;新宋体;NSimSun;Liberation Mono;Menlo;Courier New;Monospaced -思源黑体 Normal;Source Han Sans SC;思源黑体 CN Normal;Source Han Sans CN;Noto Sans SC;Noto Sans CJK SC;微软雅黑;Microsoft Yahei;新宋体;NSimSun;萍方-简;PingFang SC;华文细黑;STXihei;Arial Unicode MS;Tahoma +思源黑体;Source Han Sans SC;思源黑体 CN;Source Han Sans CN;Noto Sans SC;Noto Sans CJK SC;微软雅黑;Microsoft Yahei;新宋体;NSimSun;萍方-简;PingFang SC;华文细黑;STXihei;Arial Unicode MS;Tahoma -思源黑体 Normal;Source Han Sans SC;思源黑体 CN Normal;Source Han Sans CN;Noto Sans SC;Noto Sans CJK SC;微软雅黑;Microsoft Yahei;新宋体;NSimSun;萍方-简;PingFang SC;华文细黑;STXihei;Arial Unicode MS;Tahoma +思源黑体;Source Han Sans SC;思源黑体 CN;Source Han Sans CN;Noto Sans SC;Noto Sans CJK SC;微软雅黑;Microsoft Yahei;新宋体;NSimSun;萍方-简;PingFang SC;华文细黑;STXihei;Arial Unicode
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - filter/source sw/source
filter/source/pdf/impdialog.cxx | 13 +++-- sw/source/core/view/printdata.cxx |3 +-- 2 files changed, 4 insertions(+), 12 deletions(-) New commits: commit e319bfb07b3b1f07322434a1f407df4db48ff0ae Author: Khaled Hosny AuthorDate: Mon Aug 7 12:59:40 2023 +0300 Commit: Michael Stahl CommitDate: Tue Aug 8 11:10:50 2023 +0200 tdf#139164: Revert "tdf#54908 Make selection active if there's a selection (Writer)" This reverts commit 87d5c863109f7991e3f2f3a1eb970c00d5a27bd5. Making Writer print selection only by default is not something people expect, and it is not the default in any other application. Judging by the number of duplicates, it seems to have caught a lot of people by surprise, which is not a good UX. Change-Id: Ia7c8928c474d3390d7f7fee6e0c2e504a41d51b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155422 Tested-by: Jenkins Reviewed-by: خالد حسني (cherry picked from commit fed82c416aba3380b8c8931f7d8e0ec359e52a2c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155400 Reviewed-by: Michael Stahl diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index 5e92d3c3260b..6618d4cc3d18 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -565,9 +565,8 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent) mxRbAll->connect_toggled( LINK( this, ImpPDFTabGeneralPage, ToggleAllHdl ) ); TogglePagesHdl(); -const bool bSelectionPresent = pParent->mbSelectionPresent; -mxRbSelection->set_sensitive( bSelectionPresent ); -if ( bSelectionPresent ) +mxRbSelection->set_sensitive( pParent->mbSelectionPresent ); +if ( pParent->mbSelectionPresent ) mxRbSelection->connect_toggled( LINK( this, ImpPDFTabGeneralPage, ToggleSelectionHdl ) ); mbIsPresentation = pParent->mbIsPresentation; mbIsWriter = pParent->mbIsWriter; @@ -678,13 +677,7 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent) } mxCbExportPlaceholders->set_visible(mbIsWriter); -if( mbIsWriter ) -{ -// tdf#54908 Make selection active if there is a selection in Writer's version -mxRbSelection->set_active( bSelectionPresent ); -mxCbExportNotesInMargin->set_active(pParent->mbExportNotesInMargin); -} -else +if( !mbIsWriter ) { mxCbExportPlaceholders->set_active(false); mxCbExportNotesInMargin->set_active(false); diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx index 95504f6b1b79..13e1ea5aed18 100644 --- a/sw/source/core/view/printdata.cxx +++ b/sw/source/core/view/printdata.cxx @@ -283,8 +283,7 @@ SwPrintUIOptions::SwPrintUIOptions( uno::Sequence< OUString > aWidgetIds{ "rbAllPages", "rbRangePages", "rbRangeSelection" }; m_aUIProperties[nIdx++].Value = setChoiceRadiosControlOpt(aWidgetIds, OUString(), aHelpIds, aPrintRangeName, -aChoices, -bHasSelection ? 2 : 0, +aChoices, 0 /* always default to 'All pages' */, aChoicesDisabled); // show an Edit dependent on "Pages" selected
[Libreoffice-commits] core.git: filter/source sw/source
filter/source/pdf/impdialog.cxx | 13 +++-- sw/source/core/view/printdata.cxx |3 +-- 2 files changed, 4 insertions(+), 12 deletions(-) New commits: commit fed82c416aba3380b8c8931f7d8e0ec359e52a2c Author: Khaled Hosny AuthorDate: Mon Aug 7 12:59:40 2023 +0300 Commit: خالد حسني CommitDate: Mon Aug 7 13:38:27 2023 +0200 tdf#139164: Revert "tdf#54908 Make selection active if there's a selection (Writer)" This reverts commit 87d5c863109f7991e3f2f3a1eb970c00d5a27bd5. Making Writer print selection only by default is not something people expect, and it is not the default in any other application. Judging by the number of duplicates, it seems to have caught a lot of people by surprise, which is not a good UX. Change-Id: Ia7c8928c474d3390d7f7fee6e0c2e504a41d51b8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155422 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx index 3279581eedd5..755f530eee27 100644 --- a/filter/source/pdf/impdialog.cxx +++ b/filter/source/pdf/impdialog.cxx @@ -586,9 +586,8 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent) mxRbAll->connect_toggled( LINK( this, ImpPDFTabGeneralPage, ToggleAllHdl ) ); TogglePagesHdl(); -const bool bSelectionPresent = pParent->mbSelectionPresent; -mxRbSelection->set_sensitive( bSelectionPresent ); -if ( bSelectionPresent ) +mxRbSelection->set_sensitive( pParent->mbSelectionPresent ); +if ( pParent->mbSelectionPresent ) mxRbSelection->connect_toggled( LINK( this, ImpPDFTabGeneralPage, ToggleSelectionHdl ) ); mbIsPresentation = pParent->mbIsPresentation; mbIsWriter = pParent->mbIsWriter; @@ -707,13 +706,7 @@ void ImpPDFTabGeneralPage::SetFilterConfigItem(ImpPDFTabDialog* pParent) } mxCbExportPlaceholders->set_visible(mbIsWriter); -if( mbIsWriter ) -{ -// tdf#54908 Make selection active if there is a selection in Writer's version -mxRbSelection->set_active( bSelectionPresent ); -mxCbExportNotesInMargin->set_active(pParent->mbExportNotesInMargin); -} -else +if( !mbIsWriter ) { mxCbExportPlaceholders->set_active(false); mxCbExportNotesInMargin->set_active(false); diff --git a/sw/source/core/view/printdata.cxx b/sw/source/core/view/printdata.cxx index 62a2780f9c58..7cf3017eeec7 100644 --- a/sw/source/core/view/printdata.cxx +++ b/sw/source/core/view/printdata.cxx @@ -284,8 +284,7 @@ SwPrintUIOptions::SwPrintUIOptions( uno::Sequence< OUString > aWidgetIds{ "rbAllPages", "rbRangePages", "rbRangeSelection" }; m_aUIProperties[nIdx++].Value = setChoiceRadiosControlOpt(aWidgetIds, OUString(), aHelpIds, aPrintRangeName, -aChoices, -bHasSelection ? 2 : 0, +aChoices, 0 /* always default to 'All pages' */, aChoicesDisabled); // show an Edit dependent on "Pages" selected
[Libreoffice-commits] core.git: vcl/unx
vcl/unx/generic/fontmanager/fontconfig.cxx | 143 - 1 file changed, 43 insertions(+), 100 deletions(-) New commits: commit 0b5e88bc88df6f0cd47e84cbd8bc53b649678f8b Author: Khaled Hosny AuthorDate: Thu Aug 3 13:44:43 2023 + Commit: خالد حسني CommitDate: Thu Aug 3 19:56:08 2023 +0200 tdf#114192: Speed up populating font list when FontConfig is used Instead of calling psp::PrintFontManager::analyzeFontFile() get the font names and metadata, use the values taken from FontConfig which nowadays provides everything we need. This speeds up startup time significantly, especially when there is a large number of fonts installed. This also uses the correct style name, we were mixing name id 1 (family) with name id 17 (typographic subfamily) while we should have been using name id 2 (subfamily). The name ids 1, 2 and 16, 17 should be used together not mixed and matched, and we need the former because it is compatible with the R/I/B/BI model we (and the other office suite) use. So instead of "Foo Black, Black", we now get "Foo Black, Regular". On a system with 6616 fonts installed. Before: $ export OOO_EXIT_POST_STARTUP=1 $ time ./instdir/program/soffice.bin --headless real0m4.744s user0m1.672s sys 0m2.547s after: $ export OOO_EXIT_POST_STARTUP=1 $ time ./instdir/program/soffice.bin --headless real0m1.377s user0m0.563s sys 0m0.297s Change-Id: Ib7e358f16530c2daabc7ef677ef6a148fdf08e6e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155313 Reviewed-by: Caolán McNamara Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx index 7ceb42226d55..113171445760 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/unx/generic/fontmanager/fontconfig.cxx @@ -446,6 +446,11 @@ FcResult FontCfgWrapper::LocalizedElementFromPattern(FcPattern const * pPattern, if (!m_pLanguageTag) m_pLanguageTag.reset(new LanguageTag(SvtSysLocaleOptions().GetRealUILanguageTag())); +// FontConfig orders Typographic Family/Subfamily before old +// R/B/I/BI-compatible ones, but we want the later, so reverse the +// names to match them first. +std::reverse(lang_and_elements.begin(), lang_and_elements.end()); + *element = bestname(lang_and_elements, *m_pLanguageTag); //if this element is a fontname, map the other names to this best-name @@ -545,19 +550,6 @@ namespace } } -//FontConfig doesn't come with a way to remove an element from a FontSet as far -//as I can see -static void lcl_FcFontSetRemove(FcFontSet* pFSet, int i) -{ -FcPatternDestroy(pFSet->fonts[i]); - -int nTail = pFSet->nfont - (i + 1); ---pFSet->nfont; -if (!nTail) -return; -memmove(pFSet->fonts + i, pFSet->fonts + i + 1, nTail*sizeof(FcPattern*)); -} - namespace { // for variable fonts, FC_INDEX has been changed such that the lower half is now the @@ -594,6 +586,7 @@ void PrintFontManager::countFontconfigFonts() int weight = 0; int width = 0; int spacing = 0; +int symbol = 0; int nEntryId = -1; FcBool scalable = false; @@ -607,10 +600,11 @@ void PrintFontManager::countFontconfigFonts() FcResult eWidthRes= FcPatternGetInteger(pFSet->fonts[i], FC_WIDTH, 0, &width); FcResult eSpacRes = FcPatternGetInteger(pFSet->fonts[i], FC_SPACING, 0, &spacing); FcResult eScalableRes = FcPatternGetBool(pFSet->fonts[i], FC_SCALABLE, 0, &scalable); +FcResult eSymbolRes = FcPatternGetBool(pFSet->fonts[i], FC_SYMBOL, 0, &symbol); FcResult eIndexRes= FcPatternGetInteger(pFSet->fonts[i], FC_INDEX, 0, &nEntryId); FcResult eFormatRes = FcPatternGetString(pFSet->fonts[i], FC_FONTFORMAT, 0, &format); -if( eFileRes != FcResultMatch || eFamilyRes != FcResultMatch || eScalableRes != FcResultMatch ) +if( eFileRes != FcResultMatch || eFamilyRes != FcResultMatch || eScalableRes != FcResultMatch || eStyleRes != FcResultMatch ) continue; SAL_INFO( @@ -623,11 +617,12 @@ void PrintFontManager::countFontconfigFonts() << (eSpacRes == FcResultMatch ? spacing : -1) << ", scalable = " << (eScalableRes == FcResultMatch ? scalable : -1) << ", format " << (eFormatRes == FcResultMatch -? reinterpret_cast(format) : "")); +? reinterpret_cast(format) : "")
[Libreoffice-commits] core.git: configure.ac vcl/unx
configure.ac |2 +- vcl/unx/generic/fontmanager/fontconfig.cxx | 13 - 2 files changed, 5 insertions(+), 10 deletions(-) New commits: commit 803747fa9cb9a47e2f392d55b72033185c905e22 Author: Khaled Hosny AuthorDate: Thu Aug 3 14:39:37 2023 + Commit: خالد حسني CommitDate: Thu Aug 3 19:55:43 2023 +0200 Raise minimum FontConfig version to 2.12.0 I want to use FC_SYMBOL and this the first stable version to have it, and our baseline has 2.13.x already. Change-Id: I606b99190020085cdf20a52788a021543c365fca Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155312 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/configure.ac b/configure.ac index e7beaf945fb7..667e3748cc7c 100644 --- a/configure.ac +++ b/configure.ac @@ -6091,7 +6091,7 @@ fi AC_SUBST(ENABLE_CUPS) -libo_CHECK_SYSTEM_MODULE([fontconfig],[FONTCONFIG],[fontconfig >= 2.4.1],,system,TRUE) +libo_CHECK_SYSTEM_MODULE([fontconfig],[FONTCONFIG],[fontconfig >= 2.12.0],,system,TRUE) dnl whether to find & fetch external tarballs? dnl === diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx index ad9bf6c268ab..7ceb42226d55 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/unx/generic/fontmanager/fontconfig.cxx @@ -859,11 +859,12 @@ static void addtopattern(FcPattern *pPattern, namespace { -//Someday fontconfig will hopefully use bcp47, see fdo#19869 -//In the meantime try something that will fit to workaround fdo#35118 +//Someday fontconfig will hopefully use bcp47, see: +//https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/50 +//In the meantime try something that will fit to workaround, see: +//https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/30 OString mapToFontConfigLangTag(const LanguageTag &rLangTag) { -#if defined(FC_VERSION) && (FC_VERSION >= 20492) std::shared_ptr xLangSet(FcGetLangs(), FcStrSetDestroy); OString sLangAttrib; @@ -897,12 +898,6 @@ namespace } return OString(); -#else -OString sLangAttrib = OUStringToOString(rLangTag.getLanguageAndScript(), RTL_TEXTENCODING_UTF8).toAsciiLowerCase(); -if (sLangAttrib.equalsIgnoreAsciiCase("pa-in")) -sLangAttrib = "pa"; -return sLangAttrib; -#endif } bool isEmoji(sal_uInt32 nCurrentChar)
[Libreoffice-commits] core.git: vcl/inc vcl/unx
vcl/inc/unx/fontmanager.hxx |2 vcl/unx/generic/fontmanager/fontmanager.cxx | 68 ++-- 2 files changed, 15 insertions(+), 55 deletions(-) New commits: commit 790ccec0bdb65adca32e7cde6d1b42c59ca6d567 Author: Khaled Hosny AuthorDate: Tue Aug 1 17:45:53 2023 + Commit: خالد حسني CommitDate: Wed Aug 2 11:58:10 2023 +0200 vcl: Simplify analyzeSfntFamilyName We only need a family name not a set of name, and drop a work around for a broken font that is probably long obsolete. Change-Id: I219ec58e65826250d08b3e88462fdcc1e2e2b7f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155195 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/inc/unx/fontmanager.hxx b/vcl/inc/unx/fontmanager.hxx index a81975f21931..1a1421aef77a 100644 --- a/vcl/inc/unx/fontmanager.hxx +++ b/vcl/inc/unx/fontmanager.hxx @@ -92,8 +92,6 @@ class VCL_PLUGIN_PUBLIC PrintFontManager OString getFontFile(const PrintFont& rFont) const; std::vector analyzeFontFile(int nDirID, const OString& rFileName, const char *pFormat=nullptr) const; -static OUString convertSfntName( const vcl::NameRecord& rNameRecord ); // format font subsetting code -static void analyzeSfntFamilyName( void const * pTTFont, std::vector< OUString >& rnames ); // actually a TrueTypeFont* from font subsetting code bool analyzeSfntFile(PrintFont& rFont) const; // finds the font id for the nFaceIndex face in this font file // There may be multiple font ids for font collections diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx index a3d77c6ae99e..c60495d5b905 100644 --- a/vcl/unx/generic/fontmanager/fontmanager.cxx +++ b/vcl/unx/generic/fontmanager/fontmanager.cxx @@ -287,7 +287,9 @@ std::vector PrintFontManager::findFontFileIDs( int nDirID, const OString return aIds; } -OUString PrintFontManager::convertSfntName( const NameRecord& rNameRecord ) +namespace { + +OUString convertSfntName( const NameRecord& rNameRecord ) { OUString aValue; if( @@ -413,36 +415,10 @@ OUString PrintFontManager::convertSfntName( const NameRecord& rNameRecord ) return aValue; } -//fdo#33349.There exists an archaic Berling Antiqua font which has a "Times New -//Roman" name field in it. We don't want the "Times New Roman" name to take -//precedence in this case. We take Berling Antiqua as a higher priority name, -//and erase the "Times New Roman" name -namespace -{ -bool isBadTNR(std::u16string_view rName, ::std::set< OUString >& rSet) -{ -bool bRet = false; -if ( rName == u"Berling Antiqua" ) -{ -::std::set< OUString >::iterator aEnd = rSet.end(); -::std::set< OUString >::iterator aI = rSet.find("Times New Roman"); -if (aI != aEnd) -{ -bRet = true; -rSet.erase(aI); -} -} -return bRet; -} -} - -void PrintFontManager::analyzeSfntFamilyName( void const * pTTFont, ::std::vector< OUString >& rNames ) +OUString analyzeSfntFamilyName(void const * pTTFont) { OUString aFamily; -rNames.clear(); -::std::set< OUString > aSet; - std::vector aNameRecords; GetTTNameRecords( static_cast(pTTFont), aNameRecords ); if( !aNameRecords.empty() ) @@ -482,23 +458,17 @@ void PrintFontManager::analyzeSfntFamilyName( void const * pTTFont, ::std::vecto nMatch = 1000; } OUString aName = convertSfntName( aNameRecords[i] ); -aSet.insert( aName ); -if (aName.isEmpty()) -continue; -if( nMatch > nLastMatch || isBadTNR(aName, aSet) ) +if (!(aName.isEmpty()) && nMatch > nLastMatch) { nLastMatch = nMatch; aFamily = aName; } } } -if( !aFamily.isEmpty() ) -{ -rNames.push_back( aFamily ); -for (auto const& elem : aSet) -if( elem != aFamily ) -rNames.push_back(elem); -} + +return aFamily; +} + } bool PrintFontManager::analyzeSfntFile( PrintFont& rFont ) const @@ -519,26 +489,18 @@ bool PrintFontManager::analyzeSfntFile( PrintFont& rFont ) const if (rDFA.GetFamilyName().isEmpty()) { -::std::vector< OUString > aNames; -analyzeSfntFamilyName( pTTFont, aNames ); - -if( !aNames.empty() ) +OUString aFamily = analyzeSfntFamilyName(pTTFont); +if (aFamily.isEmpty()) { -rDFA.SetFamilyName(aNames.front()); -aNames.erase(aNames.begin()); -} -else -{ - sal_Int3
[Libreoffice-commits] core.git: 2 commits - vcl/inc vcl/qa vcl/qt5 vcl/unx
vcl/inc/fontattributes.hxx | 19 vcl/inc/unx/fontmanager.hxx | 62 ++-- vcl/inc/unx/genpspgraphics.h|4 - vcl/qa/cppunit/physicalfontfamily.cxx |3 vcl/qt5/QtFrame.cxx | 39 -- vcl/qt5/QtGraphics_Text.cxx | 19 ++-- vcl/unx/generic/fontmanager/fontconfig.cxx | 40 ++ vcl/unx/generic/fontmanager/fontmanager.cxx | 108 vcl/unx/generic/gdi/freetypetextrender.cxx | 39 +- vcl/unx/generic/print/genpspgraphics.cxx| 27 --- vcl/unx/gtk3/salnativewidgets-gtk.cxx | 68 + 11 files changed, 152 insertions(+), 276 deletions(-) New commits: commit 444e246535a7cf56b94143823845ec4bd2628236 Author: Khaled Hosny AuthorDate: Tue Aug 1 16:38:14 2023 + Commit: خالد حسني CommitDate: Wed Aug 2 11:58:01 2023 +0200 vcl: Drop the PrintFont -> FastPrintFontInfo -> FontAttributes indirection We want FontAttributes at the end, so lets have them up front instead of the intermediary structures. Change-Id: Iafdf17f4a7615f0c3d972e6080cebea0183840b7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155191 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/inc/unx/fontmanager.hxx b/vcl/inc/unx/fontmanager.hxx index 8010c17aabd8..a81975f21931 100644 --- a/vcl/inc/unx/fontmanager.hxx +++ b/vcl/inc/unx/fontmanager.hxx @@ -59,31 +59,6 @@ class PPDParser; typedef int fontID; -struct FastPrintFontInfo -{ -fontID m_nID; // FontID - -// font attributes -OUString m_aFamilyName; -OUString m_aStyleName; -FontFamily m_eFamilyStyle; -FontItalic m_eItalic; -FontWidth m_eWidth; -FontWeight m_eWeight; -FontPitch m_ePitch; -rtl_TextEncoding m_aEncoding; - -FastPrintFontInfo() -: m_nID(0) -, m_eFamilyStyle(FAMILY_DONTKNOW) -, m_eItalic(ITALIC_DONTKNOW) -, m_eWidth(WIDTH_DONTKNOW) -, m_eWeight(WEIGHT_DONTKNOW) -, m_ePitch(PITCH_DONTKNOW) -, m_aEncoding(RTL_TEXTENCODING_DONTKNOW) -{} -}; - // a class to manage printable fonts class VCL_PLUGIN_PUBLIC PrintFontManager @@ -93,15 +68,7 @@ class VCL_PLUGIN_PUBLIC PrintFontManager struct VCL_DLLPRIVATE PrintFont { -// font attributes -OUString m_aFamilyName; -OUString m_aStyleName; -FontFamilym_eFamilyStyle; -FontItalicm_eItalic; -FontWidth m_eWidth; -FontWeightm_eWeight; -FontPitch m_ePitch; -rtl_TextEncoding m_aEncoding; +FontAttributesm_aFontAttributes; int m_nDirectory; // atom containing system dependent path OString m_aFontFile;// relative to directory @@ -137,13 +104,6 @@ class VCL_PLUGIN_PUBLIC PrintFontManager static FontFamily matchFamilyName( std::u16string_view rFamily ); -const PrintFont* getFont( fontID nID ) const -{ -auto it = m_aFonts.find( nID ); -return it == m_aFonts.end() ? nullptr : &it->second; -} -static void fillPrintFontInfo(const PrintFont& rFont, FastPrintFontInfo& rInfo); - OString getDirectory( int nAtom ) const; int getDirectoryAtom( const OString& rDirectory ); @@ -184,12 +144,15 @@ public: void initialize(); +const PrintFont* getFont( fontID nID ) const +{ +auto it = m_aFonts.find( nID ); +return it == m_aFonts.end() ? nullptr : &it->second; +} + // returns the ids of all managed fonts. void getFontList( std::vector< fontID >& rFontIDs ); -// get fast font info for a specific font -bool getFontFastInfo( fontID nFontID, FastPrintFontInfo& rInfo ) const; - // routines to get font info in small pieces // get a specific fonts system dependent filename @@ -211,16 +174,15 @@ public: matchFont matches a pattern of font characteristics and returns the closest match if possible. If a match was found -the FastPrintFontInfo passed in as parameter -will be update to the found matching font. +it will update rDFA to the found matching font. implementation note: currently the function is only implemented for fontconfig. -@param rInfo -out of the FastPrintFontInfo structure the following +@param rDFA +out of the FontAttributes structure the following fields will be used for the match: family name @@ -235,7 +197,7 @@ public: locale will be used for font matching also; e.g. "Sans" can result in different fonts in e.g. english and japanes
[Libreoffice-commits] core.git: 2 commits - vcl/inc vcl/qa vcl/source vcl/unx
vcl/inc/font/PhysicalFontFamily.hxx|2 vcl/inc/unx/genpspgraphics.h |6 -- vcl/qa/cppunit/physicalfontfamily.cxx |4 - vcl/source/font/PhysicalFontFamily.cxx |1 vcl/unx/generic/gdi/freetypetextrender.cxx | 66 +--- vcl/unx/generic/print/genpspgraphics.cxx | 67 - 6 files changed, 60 insertions(+), 86 deletions(-) New commits: commit aa53ccd834adcd4dde36dcf36b620984b18711b3 Author: Khaled Hosny AuthorDate: Tue Aug 1 18:16:15 2023 +0300 Commit: خالد حسني CommitDate: Wed Aug 2 11:57:34 2023 +0200 vcl: Drop unused PhysicalFontFamily::GetAliasNames() Change-Id: Ide306f0656230460f976daef0ed213f734136030 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155167 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/inc/font/PhysicalFontFamily.hxx b/vcl/inc/font/PhysicalFontFamily.hxx index bcb8c9dedbb9..c5e38a293488 100644 --- a/vcl/inc/font/PhysicalFontFamily.hxx +++ b/vcl/inc/font/PhysicalFontFamily.hxx @@ -74,7 +74,6 @@ public: const OUString& GetFamilyName() const { return maFamilyName; } const OUString& GetSearchName() const { return maSearchName; } -const OUString& GetAliasNames() const { return maMapNames; } int GetMinQuality() const { return mnMinQuality; } FontTypeFaces GetTypeFaces() const { return mnTypeFaces; } @@ -99,7 +98,6 @@ private: OUString maFamilyName; // original font family name OUString maSearchName; // normalized font family name -OUString maMapNames; // fontname aliases FontTypeFaces mnTypeFaces; // Typeface Flags FontFamily meFamily; FontPitch mePitch; diff --git a/vcl/qa/cppunit/physicalfontfamily.cxx b/vcl/qa/cppunit/physicalfontfamily.cxx index 8b771822c6db..d54ce8be6a1e 100644 --- a/vcl/qa/cppunit/physicalfontfamily.cxx +++ b/vcl/qa/cppunit/physicalfontfamily.cxx @@ -52,7 +52,6 @@ void VclPhysicalFontFamilyTest::testCreateFontFamily() CPPUNIT_ASSERT_EQUAL_MESSAGE("Family name", OUString(""), aFamily.GetFamilyName()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Search name", OUString("Test font face"), aFamily.GetSearchName()); -CPPUNIT_ASSERT_EQUAL_MESSAGE("Alias names", OUString(""), aFamily.GetAliasNames()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Min quality", -1, aFamily.GetMinQuality()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Type faces", FontTypeFaces::NONE, aFamily.GetTypeFaces()); @@ -71,7 +70,6 @@ void VclPhysicalFontFamilyTest::testAddFontFace_Default() CPPUNIT_ASSERT_EQUAL_MESSAGE("Family name", OUString(""), aFamily.GetFamilyName()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Search name", OUString("Test font face"), aFamily.GetSearchName()); -CPPUNIT_ASSERT_EQUAL_MESSAGE("Alias names", OUString(""), aFamily.GetAliasNames()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Min quality", 0, aFamily.GetMinQuality()); FontTypeFaces eTypeFace = FontTypeFaces::Scalable | FontTypeFaces::NoneSymbol | FontTypeFaces::NoneItalic; @@ -98,7 +96,6 @@ void VclPhysicalFontFamilyTest::testAddOneFontFace() aFamily.GetFamilyName()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Search name", OUString("Test font face"), aFamily.GetSearchName()); -CPPUNIT_ASSERT_EQUAL_MESSAGE("Alias names", OUString("Alias name"), aFamily.GetAliasNames()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Min quality", 10, aFamily.GetMinQuality()); FontTypeFaces eTypeFace = FontTypeFaces::Scalable | FontTypeFaces::NoneSymbol | FontTypeFaces::Bold | FontTypeFaces::NoneItalic; @@ -136,7 +133,6 @@ void VclPhysicalFontFamilyTest::testAddTwoFontFaces() aFamily.GetFamilyName()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Search name", OUString("Test font face"), aFamily.GetSearchName()); -CPPUNIT_ASSERT_EQUAL_MESSAGE("Alias names", OUString("Alias name"), aFamily.GetAliasNames()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Min quality", 5, aFamily.GetMinQuality()); FontTypeFaces eTypeFace = FontTypeFaces::Scalable | FontTypeFaces::NoneSymbol | FontTypeFaces::Light | FontTypeFaces::Bold diff --git a/vcl/source/font/PhysicalFontFamily.cxx b/vcl/source/font/PhysicalFontFamily.cxx index 16bb35c50100..6956394a5912 100644 --- a/vcl/source/font/PhysicalFontFamily.cxx +++ b/vcl/source/font/PhysicalFontFamily.cxx @@ -113,7 +113,6 @@ void PhysicalFontFamily::AddFontFace( PhysicalFontFace* pNewFontFace ) if( maFontFaces.empty() ) { maFamilyName = pNewFontFace->GetFamilyName(); -
[Libreoffice-commits] core.git: vcl/qa
vcl/qa/cppunit/complextext.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit 21f13b90295edf84f87125791e05810666058a1c Author: Khaled Hosny AuthorDate: Tue Aug 1 14:49:12 2023 +0300 Commit: خالد حسني CommitDate: Tue Aug 1 18:43:58 2023 +0200 Fix reversed expected and actual unit test results Change-Id: Ie7eaec7ce9ad6f85b02edc831f1d138f45c18220 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155152 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/qa/cppunit/complextext.cxx b/vcl/qa/cppunit/complextext.cxx index ec6ce0ccd0e2..a0ab0c4c00bc 100644 --- a/vcl/qa/cppunit/complextext.cxx +++ b/vcl/qa/cppunit/complextext.cxx @@ -566,10 +566,10 @@ CPPUNIT_TEST_FIXTURE(VclComplexTextTest, testTdf107612) // Assert that U+202F is included in the fallback run. // Without the fix this fails with: -// - Expected: { 2 } -// - Actual : { 1, 2 } +// - Expected: { 1, 2 } +// - Actual : { 2 } std::vector aExpctedFallbacks = { 1, 2 }; -CPPUNIT_ASSERT_EQUAL(aFallbacks, aExpctedFallbacks); +CPPUNIT_ASSERT_EQUAL(aExpctedFallbacks, aExpctedFallbacks); #endif }
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - vcl/inc vcl/qa vcl/source
vcl/inc/sallayout.hxx |4 +++- vcl/qa/cppunit/complextext.cxx | 33 + vcl/source/gdi/CommonSalLayout.cxx | 15 +++ 3 files changed, 51 insertions(+), 1 deletion(-) New commits: commit 0f67027dbf3774687a558127427ff26796f00328 Author: Khaled Hosny AuthorDate: Sun Jul 30 07:12:53 2023 +0300 Commit: Caolán McNamara CommitDate: Mon Jul 31 22:15:10 2023 +0200 tdf#107612: Include NNBSP and Mongolian characters in the same fallback run When a Mongolian character is preceded by a Narrow No Break Space (NNBSP), it is used to trigger special letter forms, but when we do font fallback NNBSP is always taken from the main font (HarfBuzz synthesises it when missing from the font, so we almost never use font fallback for it). We now check if the start of the fallback run is a Mongolian character and the previous is NNBSP and extend the fallback run to include it. Change-Id: I7607dba37ee51ff62bc9e86c3dbc555cd77e8d5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155060 Tested-by: Jenkins Reviewed-by: خالد حسني (cherry picked from commit 3aac74005230500e2d0cb72b3a1198d07e985e84) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155037 Reviewed-by: Caolán McNamara diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx index d48edaaf67f2..e54a73b62894 100644 --- a/vcl/inc/sallayout.hxx +++ b/vcl/inc/sallayout.hxx @@ -57,7 +57,7 @@ namespace vcl::text { class TextLayoutCache; } -class MultiSalLayout final : public SalLayout +class VCL_DLLPUBLIC MultiSalLayout final : public SalLayout { public: voidDrawText(SalGraphics&) const override; @@ -86,6 +86,8 @@ public: vcl::text::ImplLayoutArgs& rMultiArgs, const double* pMultiDXArray); +SAL_DLLPRIVATE ImplLayoutRuns* GetFallbackRuns() { return maFallbackRuns; } + virtual ~MultiSalLayout() override; private: diff --git a/vcl/qa/cppunit/complextext.cxx b/vcl/qa/cppunit/complextext.cxx index bcf96cb4f99b..5c6297ec108e 100644 --- a/vcl/qa/cppunit/complextext.cxx +++ b/vcl/qa/cppunit/complextext.cxx @@ -531,4 +531,37 @@ CPPUNIT_TEST_FIXTURE(VclComplexTextTest, testTdf107718) #endif } +CPPUNIT_TEST_FIXTURE(VclComplexTextTest, testTdf107612) +{ +#if HAVE_MORE_FONTS +vcl::Font aFont(u"DejaVu Sans", u"Book", Size(0, 72)); + +ScopedVclPtrInstance pOutDev; +pOutDev->SetFont(aFont); + +auto pLayout = pOutDev->ImplLayout(u"a\u202F\u1823", 0, -1, Point(0, 0), 0, {}, {}); + +// If font fallback happened, then the returned layout must be a +// MultiSalLayout instance. +auto pMultiLayout = dynamic_cast(pLayout.get()); +CPPUNIT_ASSERT(pMultiLayout); + +auto pFallbackRuns = pMultiLayout->GetFallbackRuns(); +CPPUNIT_ASSERT(!pFallbackRuns->IsEmpty()); + +bool bRTL; +int nCharPos = -1; +std::vector aFallbacks; +while (pFallbackRuns->GetNextPos(&nCharPos, &bRTL)) +aFallbacks.push_back(nCharPos); + +// Assert that U+202F is included in the fallback run. +// Without the fix this fails with: +// - Expected: { 2 } +// - Actual : { 1, 2 } +std::vector aExpctedFallbacks = { 1, 2 }; +CPPUNIT_ASSERT_EQUAL(aFallbacks, aExpctedFallbacks); +#endif +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index 7ea3ba687485..944587f17c8c 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -170,6 +170,21 @@ void GenericSalLayout::SetNeedFallback(vcl::text::ImplLayoutArgs& rArgs, sal_Int mxBreak->previousCharacters(rArgs.mrStr, nCharPos, aLocale, i18n::CharacterIteratorMode::SKIPCELL, 1, nDone); +// tdf#107612 +// If the start of the fallback run is Mongolian character and the previous +// character is NNBSP, we want to include the NNBSP in the fallback since +// it has special uses in Mongolian and have to be in the same text run to +// work. +sal_Int32 nTempPos = nGraphemeStartPos; +if (nGraphemeStartPos > 0) +{ +auto nCurrChar = rArgs.mrStr.iterateCodePoints(&nTempPos, 0); +auto nPrevChar = rArgs.mrStr.iterateCodePoints(&nTempPos, -1); +if (nPrevChar == 0x202F +&& u_getIntPropertyValue(nCurrChar, UCHAR_SCRIPT) == USCRIPT_MONGOLIAN) +nGraphemeStartPos = nTempPos; +} + //stay inside the Layout range (e.g. with tdf124116-1.odt) nGraphemeStartPos = std::max(rArgs.mnMinCharPos, nGraphemeStartPos); nGraphemeEndPos = std::min(rArgs.mnEndCharPos, nGraphemeEndPos);
[Libreoffice-commits] core.git: editeng/source sw/qa sw/source
editeng/source/editeng/impedit2.cxx |3 +-- sw/qa/core/text/data/scriptinfo-surrogate-pairs.fodt |1 + sw/qa/core/text/text.cxx | 13 +++-- sw/source/core/text/porlay.cxx |2 +- 4 files changed, 14 insertions(+), 5 deletions(-) New commits: commit 5526c523bc9fda890e15eacd45f280b0827f8ea0 Author: Khaled Hosny AuthorDate: Sat Jul 29 01:01:58 2023 +0300 Commit: Michael Stahl CommitDate: Mon Jul 31 12:32:17 2023 +0200 Fix surrogate pairs handling when tweaking script info Followup to: commit 3af30bafbedb8eb481024efb35cb7876c63d26dc Author: Khaled Hosny Date: Thu Jul 27 19:03:28 2023 +0300 sw: Handle surrogate pairs when tweaking script info and: commit d6efe8c302b81886706e18640148c51cf7883bbf Author: Khaled Hosny Date: Thu Jul 27 20:39:22 2023 +0300 tdf#112594: Group NNBSP with the Mongolian characters after it Change-Id: Ie273c457e4f3ed31a3372bc8eb0eb0055c1b97b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155053 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index d67c49b072b8..8d4960069cc8 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -1742,8 +1742,7 @@ void ImpEditEngine::InitScriptTypes( sal_Int32 nPara ) (nPrevChar == 0x202F /* NNBSP, tdf#112594 */ && u_getIntPropertyValue(nChar, UCHAR_SCRIPT) == USCRIPT_MONGOLIAN)) { ---nPos; -rTypes.back().nEndPos--; +rTypes.back().nEndPos = nPos = nPrevPos; break; } } diff --git a/sw/qa/core/text/data/scriptinfo-surrogate-pairs.fodt b/sw/qa/core/text/data/scriptinfo-surrogate-pairs.fodt index c14997a80741..5b54fc9e8601 100644 --- a/sw/qa/core/text/data/scriptinfo-surrogate-pairs.fodt +++ b/sw/qa/core/text/data/scriptinfo-surrogate-pairs.fodt @@ -287,6 +287,7 @@ 11◌𐻽 + 11𝐀َ \ No newline at end of file diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx index 9d9e99f8d99b..123be460df8c 100644 --- a/sw/qa/core/text/text.cxx +++ b/sw/qa/core/text/text.cxx @@ -1475,9 +1475,18 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testScriptinfosurrogatePairs) // Without the fix it fails with: // - Expected: 11 // - Actual : 11◌ -assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion[1]", "portion", u"11"); -assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion[2]", "portion", +assertXPath(pXmlDoc, "//txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "portion", u"11"); +assertXPath(pXmlDoc, "//txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "portion", u"\u25CC\U00010EFD"); + +// Without the fix this would crash because we got a lone surrogate that +// can’t be converted to UTF-8, but if it were not for that it might fail +// with something like: +// - Expected: 11 +// - Actual : 11𝐀 +assertXPath(pXmlDoc, "//txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "portion", u"11"); +assertXPath(pXmlDoc, "//txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "portion", +u"\U0001D400\u064E"); } CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf112594) diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 7d406a86df0c..567026d5b77a 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -1457,7 +1457,7 @@ void SwScriptInfo::InitScriptInfo(const SwTextNode& rNode, (nPrevChar == CHAR_NNBSP && u_getIntPropertyValue(nChar, UCHAR_SCRIPT) == USCRIPT_MONGOLIAN)) { ---nPos; +nPos = nPrevPos; } } m_ScriptChanges.emplace_back(TextFrameIndex(nPos), nScript);
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - editeng/source sw/qa sw/source
editeng/source/editeng/impedit2.cxx |3 +-- sw/qa/core/text/data/scriptinfo-surrogate-pairs.fodt |1 + sw/qa/core/text/text.cxx | 13 +++-- sw/source/core/text/porlay.cxx |2 +- 4 files changed, 14 insertions(+), 5 deletions(-) New commits: commit 314a648b1fcc29335e86d0a9cc1b55fd32b2147c Author: Khaled Hosny AuthorDate: Sat Jul 29 01:01:58 2023 +0300 Commit: Michael Stahl CommitDate: Mon Jul 31 12:29:31 2023 +0200 Fix surrogate pairs handling when tweaking script info Followup to: commit 3af30bafbedb8eb481024efb35cb7876c63d26dc Author: Khaled Hosny Date: Thu Jul 27 19:03:28 2023 +0300 sw: Handle surrogate pairs when tweaking script info and: commit d6efe8c302b81886706e18640148c51cf7883bbf Author: Khaled Hosny Date: Thu Jul 27 20:39:22 2023 +0300 tdf#112594: Group NNBSP with the Mongolian characters after it Change-Id: Ie273c457e4f3ed31a3372bc8eb0eb0055c1b97b1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155036 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index a82ed33a1292..6b1f226d90cc 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -1742,8 +1742,7 @@ void ImpEditEngine::InitScriptTypes( sal_Int32 nPara ) (nPrevChar == 0x202F /* NNBSP, tdf#112594 */ && u_getIntPropertyValue(nChar, UCHAR_SCRIPT) == USCRIPT_MONGOLIAN)) { ---nPos; -rTypes.back().nEndPos--; +rTypes.back().nEndPos = nPos = nPrevPos; break; } } diff --git a/sw/qa/core/text/data/scriptinfo-surrogate-pairs.fodt b/sw/qa/core/text/data/scriptinfo-surrogate-pairs.fodt index c14997a80741..5b54fc9e8601 100644 --- a/sw/qa/core/text/data/scriptinfo-surrogate-pairs.fodt +++ b/sw/qa/core/text/data/scriptinfo-surrogate-pairs.fodt @@ -287,6 +287,7 @@ 11◌𐻽 + 11𝐀َ \ No newline at end of file diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx index d8fe33b83a51..d398bddd4992 100644 --- a/sw/qa/core/text/text.cxx +++ b/sw/qa/core/text/text.cxx @@ -1336,9 +1336,18 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testScriptinfosurrogatePairs) // Without the fix it fails with: // - Expected: 11 // - Actual : 11◌ -assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion[1]", "portion", u"11"); -assertXPath(pXmlDoc, "//SwParaPortion/SwLineLayout/SwLinePortion[2]", "portion", +assertXPath(pXmlDoc, "//txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "portion", u"11"); +assertXPath(pXmlDoc, "//txt[1]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "portion", u"\u25CC\U00010EFD"); + +// Without the fix this would crash because we got a lone surrogate that +// can’t be converted to UTF-8, but if it were not for that it might fail +// with something like: +// - Expected: 11 +// - Actual : 11𝐀 +assertXPath(pXmlDoc, "//txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[1]", "portion", u"11"); +assertXPath(pXmlDoc, "//txt[2]/SwParaPortion/SwLineLayout/SwLinePortion[2]", "portion", +u"\U0001D400\u064E"); } CPPUNIT_TEST_FIXTURE(SwCoreTextTest, testTdf112594) diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 890ec2b81f2f..50a8489b5088 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -1467,7 +1467,7 @@ void SwScriptInfo::InitScriptInfo(const SwTextNode& rNode, (nPrevChar == CHAR_NNBSP && u_getIntPropertyValue(nChar, UCHAR_SCRIPT) == USCRIPT_MONGOLIAN)) { ---nPos; +nPos = nPrevPos; } } m_ScriptChanges.emplace_back(TextFrameIndex(nPos), nScript);
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - editeng/source sd/qa sw/qa sw/source
editeng/source/editeng/impedit2.cxx | 16 sd/qa/unit/data/odp/Tdf112594.fodp | 853 sd/qa/unit/layout-tests.cxx | 16 sw/qa/core/text/data/tdf112594.fodt | 301 sw/qa/core/text/text.cxx| 16 sw/source/core/text/porlay.cxx | 11 6 files changed, 1205 insertions(+), 8 deletions(-) New commits: commit a319e879d80182d32de1f0b2aab9d581904e58aa Author: Khaled Hosny AuthorDate: Thu Jul 27 20:39:22 2023 +0300 Commit: Michael Stahl CommitDate: Mon Jul 31 12:29:13 2023 +0200 tdf#112594: Group NNBSP with the Mongolian characters after it Narrow No Break Space has special uses in Mongolian, so we want to make sure it is in the same portion as the Mongolian text, even when it comes after text from another script group. We limit this to Mongolian to minimize potential side effects. Change-Id: Idb4c64cec8581e56acfe9bbb8adf4ddc213aaf19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155000 Tested-by: Jenkins Reviewed-by: خالد حسني (cherry picked from commit d6efe8c302b81886706e18640148c51cf7883bbf) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154964 Reviewed-by: Michael Stahl diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 3a000cb7e911..a82ed33a1292 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -1730,12 +1730,18 @@ void ImpEditEngine::InitScriptTypes( sal_Int32 nPara ) } else { -if ( _xBI->getScriptType( aText, nPos - 1 ) == i18n::ScriptType::WEAK ) +auto nPrevPos = nPos; +auto nPrevChar = aText.iterateCodePoints(&nPrevPos, -1); +if (_xBI->getScriptType(aText, nPrevPos) == i18n::ScriptType::WEAK) { -switch ( u_charType(aText.iterateCodePoints(&nPos, 0) ) ) { -case U_NON_SPACING_MARK: -case U_ENCLOSING_MARK: -case U_COMBINING_SPACING_MARK: +auto nChar = aText.iterateCodePoints(&nPos, 0); +auto nType = unicode::getUnicodeType(nChar); +if (nType == css::i18n::UnicodeType::NON_SPACING_MARK || +nType == css::i18n::UnicodeType::ENCLOSING_MARK || +nType == css::i18n::UnicodeType::COMBINING_SPACING_MARK || +(nPrevChar == 0x202F /* NNBSP, tdf#112594 */ && + u_getIntPropertyValue(nChar, UCHAR_SCRIPT) == USCRIPT_MONGOLIAN)) +{ --nPos; rTypes.back().nEndPos--; break; diff --git a/sd/qa/unit/data/odp/Tdf112594.fodp b/sd/qa/unit/data/odp/Tdf112594.fodp new file mode 100644 index ..ff3e5fc4b639 --- /dev/null +++ b/sd/qa/unit/data/odp/Tdf112594.fodp @@ -0,0 +1,853 @@ + + +http://www.w3.org/TR/css3-text/"; xmlns:grddl="http://www.w3.org/2003/g/data-view#"; xmlns:xhtml="http://www.w3.org/1999/xhtml"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xforms="http://www.w3.org/2002/xforms"; xmlns:dom="http://www.w3.org/2001/xml-events"; xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML"; xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:number="urn:oasis:names:tc:opendocument :xmlns:datastyle:1.0" xmlns:officeooo="http://openoffice.org/2009/office"; xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:rpt="http://openoffice.org/2005/report"; xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:tableooo="http://openoffice.org/2009/table"; xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/"; xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:oooc="http://openoffice.org/2004/calc"; xmlns:xlink="http://www.
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sw/qa sw/source
sw/qa/core/text/data/scriptinfo-surrogate-pairs.fodt | 292 +++ sw/qa/core/text/text.cxx | 17 + sw/source/core/text/porlay.cxx | 23 - 3 files changed, 319 insertions(+), 13 deletions(-) New commits: commit 9122a0dd2a9a31431ae92bf96b3d27d4fcc88b9c Author: Khaled Hosny AuthorDate: Thu Jul 27 19:03:28 2023 +0300 Commit: Michael Stahl CommitDate: Mon Jul 31 12:28:54 2023 +0200 sw: Handle surrogate pairs when tweaking script info Change-Id: I18e8358657303571d5d90e5162dbb68cbe067980 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154995 Tested-by: Jenkins Reviewed-by: خالد حسني (cherry picked from commit 3af30bafbedb8eb481024efb35cb7876c63d26dc) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154963 Reviewed-by: Michael Stahl diff --git a/sw/qa/core/text/data/scriptinfo-surrogate-pairs.fodt b/sw/qa/core/text/data/scriptinfo-surrogate-pairs.fodt new file mode 100644 index ..c14997a80741 --- /dev/null +++ b/sw/qa/core/text/data/scriptinfo-surrogate-pairs.fodt @@ -0,0 +1,292 @@ + + +http://www.w3.org/TR/css3-text/"; xmlns:grddl="http://www.w3.org/2003/g/data-view#"; xmlns:xhtml="http://www.w3.org/1999/xhtml"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xforms="http://www.w3.org/2002/xforms"; xmlns:dom="http://www.w3.org/2001/xml-events"; xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML"; xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:officeooo="http://openoffice.org/2009/office"; xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:formx="u rn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:rpt="http://openoffice.org/2005/report"; xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:tableooo="http://openoffice.org/2009/table"; xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/"; xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:oooc="http://openoffice.org/2004/calc"; xmlns:xlink="http://www.w3.org/1999/xlink"; xmlns:drawooo="http://openoffice.org/2010/draw"; xmlns:ooow="http://openoffice.org/2004/writer"; xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:ooo="http:/ /openoffice.org/2004/office" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" office:version="1.3" office:mimetype="application/vnd.oasis.opendocument.text"> + 2023-07-27T18:43:02.5378016242023-07-27T18:43:53.298342476PT51S1LibreOfficeDev/24.2.0.0.alpha0$MacOSX_X86_64 LibreOffice_project/cf8f7b91f41821b79495c0388359c4cb1156ea67 + + + 0 + 0 + 17805 + 9950 + true + false + + + view2 + 3332 + 2501 + 0 + 0 + 17803 + 9948 + 0 + 1 + false + 200 + false + false + false + false + false + false + + + + + true + true + true + false + + false + false + true + true + true + false + false + false + false + false + false + true + false + false + 0 + 0 + false + false + false + false + false + true + false + false + true + false + false + + false + false + + true + false + false + false + false + false + false + true + true + false + false + false + false + true + true + false + + false + false + false + false + false + false + 0 + false + false + false + false + false + true + false + false + false + false + false + false + false + + true + true + true + true
[Libreoffice-commits] core.git: vcl/inc vcl/unx
vcl/inc/unx/fontmanager.hxx | 13 - vcl/unx/generic/fontmanager/fontmanager.cxx | 67 2 files changed, 80 deletions(-) New commits: commit 3e563f6ed42224e5c7fbb11428604a7719e178af Author: Khaled Hosny AuthorDate: Sun Jul 30 14:59:19 2023 + Commit: خالد حسني CommitDate: Sun Jul 30 20:45:18 2023 +0200 Drop freshly unused PrintFontManager Change-Id: If4cec80eaf1301907d144ecb8518a4de5acdeefb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155070 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/inc/unx/fontmanager.hxx b/vcl/inc/unx/fontmanager.hxx index a7817652d9ae..1a9ef6e3be21 100644 --- a/vcl/inc/unx/fontmanager.hxx +++ b/vcl/inc/unx/fontmanager.hxx @@ -96,7 +96,6 @@ class VCL_PLUGIN_PUBLIC PrintFontManager // font attributes OUString m_aFamilyName; std::vector m_aAliases; -OUString m_aPSName; OUString m_aStyleName; FontFamilym_eFamilyStyle; FontItalicm_eItalic; @@ -104,9 +103,6 @@ class VCL_PLUGIN_PUBLIC PrintFontManager FontWeightm_eWeight; FontPitch m_ePitch; rtl_TextEncoding m_aEncoding; -int m_nAscend; -int m_nDescend; -int m_nLeading; int m_nDirectory; // atom containing system dependent path OString m_aFontFile;// relative to directory @@ -202,9 +198,6 @@ public: // routines to get font info in small pieces -// get a specific fonts PSName name -OUString getPSName( fontID nFontID ); - // get a specific fonts system dependent filename OString getFontFileSysPath( fontID nFontID ) const { @@ -217,12 +210,6 @@ public: // get the ttc face variation int getFontFaceVariation( fontID nFontID ) const; -// get a specific fonts ascend -int getFontAscend( fontID nFontID ); - -// get a specific fonts descent -int getFontDescend( fontID nFontID ); - // font administration functions /* system dependent font matching diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx index d7b6a211df13..1927071bb802 100644 --- a/vcl/unx/generic/fontmanager/fontmanager.cxx +++ b/vcl/unx/generic/fontmanager/fontmanager.cxx @@ -87,9 +87,6 @@ PrintFontManager::PrintFont::PrintFont() , m_eWeight(WEIGHT_DONTKNOW) , m_ePitch(PITCH_DONTKNOW) , m_aEncoding(RTL_TEXTENCODING_DONTKNOW) -, m_nAscend(0) -, m_nDescend(0) -, m_nLeading(0) , m_nDirectory(0) , m_nCollectionEntry(0) , m_nVariationEntry(0) @@ -563,12 +560,6 @@ bool PrintFontManager::analyzeSfntFile( PrintFont& rFont ) const if( !aInfo.usubfamily.isEmpty() ) rFont.m_aStyleName = aInfo.usubfamily; -SAL_WARN_IF( aInfo.psname.isEmpty(), "vcl.fonts", "No PostScript name in font:" << aFile ); - -rFont.m_aPSName = !aInfo.psname.isEmpty() ? -OStringToOUString(aInfo.psname, aEncoding) : -rFont.m_aFamilyName; // poor font does not have a postscript name - rFont.m_eFamilyStyle = matchFamilyName(rFont.m_aFamilyName); switch( aInfo.weight ) @@ -610,33 +601,6 @@ bool PrintFontManager::analyzeSfntFile( PrintFont& rFont ) const rFont.m_aEncoding = aInfo.microsoftSymbolEncoded ? RTL_TEXTENCODING_SYMBOL : RTL_TEXTENCODING_UCS2; -if( aInfo.ascender && aInfo.descender ) -{ -rFont.m_nLeading = aInfo.linegap; -rFont.m_nAscend= aInfo.ascender; -rFont.m_nDescend = -aInfo.descender; -} -else if( aInfo.typoAscender && aInfo.typoDescender ) -{ -rFont.m_nLeading = aInfo.typoLineGap; -rFont.m_nAscend= aInfo.typoAscender; -rFont.m_nDescend = -aInfo.typoDescender; -} -else if( aInfo.winAscent && aInfo.winDescent ) -{ -rFont.m_nAscend= aInfo.winAscent; -rFont.m_nDescend = aInfo.winDescent; -rFont.m_nLeading = rFont.m_nAscend + rFont.m_nDescend - 1000; -} - -// last try: font bounding box -if( rFont.m_nAscend == 0 ) -rFont.m_nAscend = aInfo.yMax; -if( rFont.m_nDescend == 0 ) -rFont.m_nDescend = -aInfo.yMin; -if( rFont.m_nLeading == 0 ) -rFont.m_nLeading = 15 * (rFont.m_nAscend+rFont.m_nDescend) / 100; - CloseTTFont( pTTFont ); bSuccess = true; } @@ -846,35 +810,4 @@ OString PrintFontManager::getFontFile(const PrintFont& rFont) const return aPath; } -OUString PrintFontManager::getPSName( fontID nFontID ) -{ -PrintFont* pFont = getFont( nFontID ); -if (pFont && pFont->m_aPSName.isEmpty()) -{ -analyzeS
[Libreoffice-commits] core.git: 3 commits - vcl/inc vcl/Library_vcl.mk vcl/source vcl/unx
vcl/Library_vcl.mk |6 vcl/inc/fontsubset.hxx |5 vcl/inc/jobdata.hxx|2 vcl/inc/sft.hxx| 47 vcl/inc/unx/printergfx.hxx | 346 -- vcl/inc/unx/printerjob.hxx | 129 -- vcl/source/fontsubset/fontsubset.cxx | 63 - vcl/source/fontsubset/sft.cxx | 710 vcl/unx/generic/print/bitmap_gfx.cxx | 674 vcl/unx/generic/print/common_gfx.cxx | 1152 - vcl/unx/generic/print/glyphset.cxx | 297 - vcl/unx/generic/print/glyphset.hxx | 81 - vcl/unx/generic/print/printerjob.cxx | 969 - vcl/unx/generic/print/psputil.cxx | 184 --- vcl/unx/generic/print/psputil.hxx | 55 - vcl/unx/generic/print/text_gfx.cxx | 158 -- vcl/unx/generic/printer/configuration/psprint.conf |5 vcl/unx/generic/printer/jobdata.cxx| 12 vcl/unx/generic/printer/printerinfomanager.cxx |8 19 files changed, 2 insertions(+), 4901 deletions(-) New commits: commit 3a01df55db376ecbed0d89ebb4dd9d2d2f4b520f Author: Khaled Hosny AuthorDate: Sun Jul 30 14:23:58 2023 + Commit: خالد حسني CommitDate: Sun Jul 30 20:45:12 2023 +0200 Drop freshly unused font subsetting code These output font formats were for PostScript that is now gone. Change-Id: Ib29f921fe25432aaa558ba842ee77fe1e8023d47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155069 Reviewed-by: خالد حسني Tested-by: خالد حسني diff --git a/vcl/inc/fontsubset.hxx b/vcl/inc/fontsubset.hxx index a1ba31aa58d8..1b218ed2e389 100644 --- a/vcl/inc/fontsubset.hxx +++ b/vcl/inc/fontsubset.hxx @@ -38,8 +38,6 @@ enum class FontType { TYPE1_PFA = 1<<3, ///< PSType1 Postscript Font Ascii TYPE1_PFB = 1<<4, ///< PSType1 Postscript Font Binary CFF_FONT= 1<<5, ///< CFF-container with PSType2 glyphs -TYPE3_FONT = 1<<6, ///< PSType3 Postscript font -TYPE42_FONT = 1<<7, ///< PSType42 wrapper for an SFNT_TTF ANY_SFNT= SFNT_TTF | SFNT_CFF, ANY_TYPE1 = TYPE1_PFA | TYPE1_PFB }; @@ -55,7 +53,6 @@ public: voidLoadFont( FontType eInFontType, const unsigned char* pFontBytes, int nByteLength ); -voidLoadFont( vcl::TrueTypeFont* pSftTrueTypeFont ); boolCreateFontSubset( FontType nOutFontTypeMask, SvStream* pOutFile, const char* pOutFontName, @@ -77,7 +74,6 @@ private: unsigned const char*mpInFontBytes; int mnInByteLength; FontTypemeInFontType; ///< allowed mask of input font-types -vcl::TrueTypeFont* mpSftTTFont; // subset-request details FontTypemnReqFontTypeMask; ///< allowed subset-target font types @@ -88,7 +84,6 @@ private: int mnReqGlyphCount; boolCreateFontSubsetFromCff(); -boolCreateFontSubsetFromSfnt(); }; int VCL_DLLPUBLIC TestFontSubset(const void* data, sal_uInt32 size); diff --git a/vcl/inc/sft.hxx b/vcl/inc/sft.hxx index b5fc71b44530..339914e4fb73 100644 --- a/vcl/inc/sft.hxx +++ b/vcl/inc/sft.hxx @@ -61,7 +61,7 @@ namespace vcl typedef sal_Int32 F16Dot16; /**< fixed: 16.16 */ /*@}*/ -/** Return value of OpenTTFont() and CreateT3FromTTGlyphs() */ +/** Return value of OpenTTFont() */ enum class SFErrCodes { Ok, /**< no error */ BadFile, /**< file not found */ @@ -565,25 +565,6 @@ class TrueTypeFont; void GetTTNameRecords(AbstractTrueTypeFont const *ttf, std::vector& nr); -/** - * Generates a new PostScript Type 3 font and dumps it to outf file. - * This function substitutes glyph 0 for all glyphIDs that are not found in the font. - * @param ttf pointer to the TrueTypeFont structure - * @param outfthe resulting font is written to this stream - * @param fname font name for the new font. If it is NULL the PostScript name of the - *original font will be used - * @param glyphArray pointer to an array of glyphs that are to be extracted from ttf - * @param encodingarray of encoding values. encoding[i] specifies the position of the glyph - *glyphArray[i] in the encoding vector of the resulting Type3 font - * @param nGlyphs number of glyph IDs in glyphArray and encoding values in encoding - * @param wmode writing mod
[Libreoffice-commits] core.git: 3 commits - vcl/headless vcl/inc vcl/Library_vcl.mk vcl/unx
vcl/Library_vcl.mk |1 vcl/headless/svpprn.cxx|1 vcl/inc/salprn.hxx |2 vcl/inc/unx/GenPspGfxBackend.hxx | 126 vcl/inc/unx/genprn.h |3 vcl/inc/unx/genpspgraphics.h | 16 - vcl/unx/generic/app/sm.cxx |1 vcl/unx/generic/print/GenPspGfxBackend.cxx | 410 - vcl/unx/generic/print/genprnpsp.cxx|4 vcl/unx/generic/print/genpspgraphics.cxx | 120 vcl/unx/gtk3/gtkinst.cxx |1 11 files changed, 28 insertions(+), 657 deletions(-) New commits: commit 4998de76ed1da4039e30718941d50d6f1dfe4f82 Author: Khaled Hosny AuthorDate: Sun Jul 30 07:40:48 2023 + Commit: خالد حسني CommitDate: Sun Jul 30 20:44:50 2023 +0200 tdf#156230: Drop freshly unused GenPspGfxBackend Change-Id: Idfc4364b99ed605462aae58391e98960be6021b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155064 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 1c18f470cfeb..6293e292b25e 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -564,7 +564,6 @@ vcl_headless_freetype_code=\ vcl/unx/generic/print/glyphset \ vcl/unx/generic/print/printerjob \ vcl/unx/generic/print/psputil \ -vcl/unx/generic/print/GenPspGfxBackend \ vcl/unx/generic/print/genpspgraphics \ vcl/unx/generic/print/genprnpsp \ vcl/unx/generic/print/prtsetup \ diff --git a/vcl/inc/unx/GenPspGfxBackend.hxx b/vcl/inc/unx/GenPspGfxBackend.hxx deleted file mode 100644 index 31d85290361c.. --- a/vcl/inc/unx/GenPspGfxBackend.hxx +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - */ - -#pragma once - -#include - -namespace psp -{ -class PrinterGfx; -} - -class GenPspGfxBackend final : public SalGraphicsImpl -{ -private: -psp::PrinterGfx* m_pPrinterGfx; - -public: -GenPspGfxBackend(psp::PrinterGfx* pPrinterGfx); -~GenPspGfxBackend() override; - -void Init() override; -void freeResources() override; -OUString getRenderBackendName() const override { return "genpsp"; } - -void setClipRegion(vcl::Region const& rRegion) override; -void ResetClipRegion() override; - -sal_uInt16 GetBitCount() const override; - -tools::Long GetGraphicsWidth() const override; - -void SetLineColor() override; -void SetLineColor(Color nColor) override; -void SetFillColor() override; -void SetFillColor(Color nColor) override; -void SetXORMode(bool bSet, bool bInvertOnly) override; -void SetROPLineColor(SalROPColor nROPColor) override; -void SetROPFillColor(SalROPColor nROPColor) override; - -void drawPixel(tools::Long nX, tools::Long nY) override; -void drawPixel(tools::Long nX, tools::Long nY, Color nColor) override; - -void drawLine(tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2) override; -void drawRect(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight) override; -void drawPolyLine(sal_uInt32 nPoints, const Point* pPointArray) override; -void drawPolygon(sal_uInt32 nPoints, const Point* pPointArray) override; -void drawPolyPolygon(sal_uInt32 nPoly, const sal_uInt32* pPoints, - const Point** pPointArray) override; - -bool drawPolyPolygon(const basegfx::B2DHomMatrix& rObjectToDevice, - const basegfx::B2DPolyPolygon&, double fTransparency) override; - -bool drawPolyLine(const basegfx::B2DHomMatrix& rObjectToDevice, const basegfx::B2DPolygon&, - double fTransparency, double fLineWidth, const std::vector* pStroke, - basegfx::B2DLineJoin, css::drawing::LineCap, double fMiterMinimumAngle, - bool bPixelSnapHairline) override; - -bool drawPolyLineBezier(sal_uInt32 nPoints, const Point* pPointArray, -const PolyFlags* pFlagArray) override; - -bool drawPolygonBezier(sal_uInt32 nPoints, const Point* pPointArray, - const PolyFlags* pFlagArray) override; - -bool drawPolyPolygonBezier(sal_uInt32 nPoly, const sal_uInt32* pPoints, - const Point* const* pPointArray, - const PolyFlags* const* pFlagArray) override; - -void copyArea(tools::Long nDestX, tools::Long nDestY, tools::Long nSrcX, tools::Long nSrcY, - tools::Long nSrcWidth, tools::Long nSrcHeight, bool bWindowInvalidate) override; - -
[Libreoffice-commits] core.git: 3 commits - bin/find-can-be-private-symbols.functions.results include/vcl officecfg/registry svtools/source vcl/inc vcl/source vcl/unx
bin/find-can-be-private-symbols.functions.results |2 include/vcl/printer/Options.hxx|4 officecfg/registry/schema/org/openoffice/Office/Common.xcs | 12 svtools/source/config/printoptions.cxx |6 vcl/inc/jobdata.hxx|4 vcl/inc/unx/genprn.h |3 vcl/source/printer/Options.cxx |2 vcl/unx/generic/print/genprnpsp.cxx| 222 - vcl/unx/generic/printer/cpdmgr.cxx |3 vcl/unx/generic/printer/cupsmgr.cxx|9 vcl/unx/generic/printer/jobdata.cxx| 55 --- vcl/unx/generic/printer/printerinfomanager.cxx | 11 12 files changed, 24 insertions(+), 309 deletions(-) New commits: commit 4a0c8c722289f9a94e87cbc90eca17e1b865be64 Author: Khaled Hosny AuthorDate: Wed Jul 26 15:13:56 2023 + Commit: خالد حسني CommitDate: Sun Jul 30 20:44:29 2023 +0200 tdf#156230: Drop freshly dead PspSalPrinter code Change-Id: I272c8f3a4d70ef9d5d03eecc8c91ee8423c52ccc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154976 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/inc/unx/genprn.h b/vcl/inc/unx/genprn.h index 0c92446d5286..67bf42bf9547 100644 --- a/vcl/inc/unx/genprn.h +++ b/vcl/inc/unx/genprn.h @@ -22,7 +22,6 @@ #include #include -#include #include class GenPspGraphics; @@ -59,8 +58,6 @@ public: OUString m_aFileName; OUString m_aTmpFile; SalInfoPrinter* m_pInfoPrinter; -std::unique_ptr m_xGraphics; -psp::PrinterJob m_aPrintJob; psp::JobDatam_aJobData; psp::PrinterGfx m_aPrinterGfx; sal_uInt32 m_nCopies; diff --git a/vcl/unx/generic/print/genprnpsp.cxx b/vcl/unx/generic/print/genprnpsp.cxx index 84de26e1f9cc..560f0f4ec62f 100644 --- a/vcl/unx/generic/print/genprnpsp.cxx +++ b/vcl/unx/generic/print/genprnpsp.cxx @@ -243,93 +243,6 @@ static void copyJobDataToJobSetup( ImplJobSetup* pJobSetup, JobData& rData ) pJobSetup->SetPapersizeFromSetup( rData.m_bPapersizeFromSetup ); } -// Needs a cleaner abstraction ... -static bool passFileToCommandLine( const OUString& rFilename, const OUString& rCommandLine ) -{ -bool bSuccess = false; - -rtl_TextEncoding aEncoding = osl_getThreadTextEncoding(); -OString aCmdLine(OUStringToOString(rCommandLine, aEncoding)); -OString aFilename(OUStringToOString(rFilename, aEncoding)); - -bool bPipe = aCmdLine.indexOf( "(TMP)" ) == -1; - -// setup command line for exec -if( ! bPipe ) -aCmdLine = aCmdLine.replaceAll("(TMP)", aFilename); - -#if OSL_DEBUG_LEVEL > 1 -SAL_INFO("vcl.unx.print", (bPipe ? "piping to" : "executing") -<< " commandline: \"" << aCmdLine << "\"."); -struct stat aStat; -SAL_WARN_IF(stat( aFilename.getStr(), &aStat ), -"vcl.unx.print", "stat( " << aFilename << " ) failed."); -SAL_INFO("vcl.unx.print", "Tmp file " << aFilename -<< " has modes: " -<< std::showbase << std::oct -<< (long)aStat.st_mode); -#endif -const char* argv[4]; -if( ! ( argv[ 0 ] = getenv( "SHELL" ) ) ) -argv[ 0 ] = "/bin/sh"; -argv[ 1 ] = "-c"; -argv[ 2 ] = aCmdLine.getStr(); -argv[ 3 ] = nullptr; - -bool bHavePipes = false; -int pid, fd[2]; - -if( bPipe ) -bHavePipes = pipe( fd ) == 0; -if( ( pid = fork() ) > 0 ) -{ -if( bPipe && bHavePipes ) -{ -close( fd[0] ); -char aBuffer[ 2048 ]; -FILE* fp = fopen( aFilename.getStr(), "r" ); -while (fp && !feof(fp)) -{ -size_t nBytesRead = fread(aBuffer, 1, sizeof( aBuffer ), fp); -if (nBytesRead ) -{ -size_t nBytesWritten = write(fd[1], aBuffer, nBytesRead); -OSL_ENSURE(nBytesWritten == nBytesRead, "short write"); -if (nBytesWritten != nBytesRead) -break; -} -} -fclose( fp ); -close( fd[ 1 ] ); -} -int status = 0; -if(waitpid( pid, &status, 0 ) != -1) -{ -if( ! status ) -bSuccess = true; -} -} -else if( ! pid ) -{ -if( bPipe && bHavePipes ) -{ -close( fd[1] ); -if( fd[0] != STDIN_FILENO ) // not probable, but who knows :) -
[Libreoffice-commits] core.git: vcl/inc vcl/qa vcl/source
vcl/inc/sallayout.hxx |4 +++- vcl/qa/cppunit/complextext.cxx | 33 + vcl/source/gdi/CommonSalLayout.cxx | 15 +++ 3 files changed, 51 insertions(+), 1 deletion(-) New commits: commit d4653fa961b1aa1cd4bf568e7d1fe50ae97df484 Author: Khaled Hosny AuthorDate: Sun Jul 30 07:12:53 2023 +0300 Commit: خالد حسني CommitDate: Sun Jul 30 09:50:11 2023 +0200 tdf#107612: Include NNBSP and Mongolian characters in the same fallback run When a Mongolian character is preceded by a Narrow No Break Space (NNBSP), it is used to trigger special letter forms, but when we do font fallback NNBSP is always taken from the main font (HarfBuzz synthesises it when missing from the font, so we almost never use font fallback for it). We now check if the start of the fallback run is a Mongolian character and the previous is NNBSP and extend the fallback run to include it. Change-Id: I7607dba37ee51ff62bc9e86c3dbc555cd77e8d5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155060 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx index dbe3000f8a83..94f0086b1517 100644 --- a/vcl/inc/sallayout.hxx +++ b/vcl/inc/sallayout.hxx @@ -57,7 +57,7 @@ namespace vcl::text { class TextLayoutCache; } -class MultiSalLayout final : public SalLayout +class VCL_DLLPUBLIC MultiSalLayout final : public SalLayout { public: voidDrawText(SalGraphics&) const override; @@ -86,6 +86,8 @@ public: vcl::text::ImplLayoutArgs& rMultiArgs, const double* pMultiDXArray); +SAL_DLLPRIVATE ImplLayoutRuns* GetFallbackRuns() { return maFallbackRuns; } + virtual ~MultiSalLayout() override; private: diff --git a/vcl/qa/cppunit/complextext.cxx b/vcl/qa/cppunit/complextext.cxx index bcb0c9622361..ec6ce0ccd0e2 100644 --- a/vcl/qa/cppunit/complextext.cxx +++ b/vcl/qa/cppunit/complextext.cxx @@ -540,4 +540,37 @@ CPPUNIT_TEST_FIXTURE(VclComplexTextTest, testTdf107718) #endif } +CPPUNIT_TEST_FIXTURE(VclComplexTextTest, testTdf107612) +{ +#if HAVE_MORE_FONTS +vcl::Font aFont(u"DejaVu Sans", u"Book", Size(0, 72)); + +ScopedVclPtrInstance pOutDev; +pOutDev->SetFont(aFont); + +auto pLayout = pOutDev->ImplLayout(u"a\u202F\u1823", 0, -1, Point(0, 0), 0, {}, {}); + +// If font fallback happened, then the returned layout must be a +// MultiSalLayout instance. +auto pMultiLayout = dynamic_cast(pLayout.get()); +CPPUNIT_ASSERT(pMultiLayout); + +auto pFallbackRuns = pMultiLayout->GetFallbackRuns(); +CPPUNIT_ASSERT(!pFallbackRuns->IsEmpty()); + +bool bRTL; +int nCharPos = -1; +std::vector aFallbacks; +while (pFallbackRuns->GetNextPos(&nCharPos, &bRTL)) +aFallbacks.push_back(nCharPos); + +// Assert that U+202F is included in the fallback run. +// Without the fix this fails with: +// - Expected: { 2 } +// - Actual : { 1, 2 } +std::vector aExpctedFallbacks = { 1, 2 }; +CPPUNIT_ASSERT_EQUAL(aFallbacks, aExpctedFallbacks); +#endif +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index 3a5fdbef0ad0..79f1a0d2c40c 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -128,6 +128,21 @@ void GenericSalLayout::SetNeedFallback(vcl::text::ImplLayoutArgs& rArgs, sal_Int mxBreak->previousCharacters(rArgs.mrStr, nCharPos, aLocale, i18n::CharacterIteratorMode::SKIPCELL, 1, nDone); +// tdf#107612 +// If the start of the fallback run is Mongolian character and the previous +// character is NNBSP, we want to include the NNBSP in the fallback since +// it has special uses in Mongolian and have to be in the same text run to +// work. +sal_Int32 nTempPos = nGraphemeStartPos; +if (nGraphemeStartPos > 0) +{ +auto nCurrChar = rArgs.mrStr.iterateCodePoints(&nTempPos, 0); +auto nPrevChar = rArgs.mrStr.iterateCodePoints(&nTempPos, -1); +if (nPrevChar == 0x202F +&& u_getIntPropertyValue(nCurrChar, UCHAR_SCRIPT) == USCRIPT_MONGOLIAN) +nGraphemeStartPos = nTempPos; +} + //stay inside the Layout range (e.g. with tdf124116-1.odt) nGraphemeStartPos = std::max(rArgs.mnMinCharPos, nGraphemeStartPos); nGraphemeEndPos = std::min(rArgs.mnEndCharPos, nGraphemeEndPos);
[Libreoffice-commits] core.git: 2 commits - editeng/source sd/qa sw/qa sw/source
editeng/source/editeng/impedit2.cxx | 16 sd/qa/unit/data/odp/Tdf112594.fodp | 853 +++ sd/qa/unit/layout-tests.cxx | 16 sw/qa/core/text/data/scriptinfo-surrogate-pairs.fodt | 292 ++ sw/qa/core/text/data/tdf112594.fodt | 301 ++ sw/qa/core/text/text.cxx | 33 sw/source/core/text/porlay.cxx | 32 7 files changed, 1523 insertions(+), 20 deletions(-) New commits: commit d6efe8c302b81886706e18640148c51cf7883bbf Author: Khaled Hosny AuthorDate: Thu Jul 27 20:39:22 2023 +0300 Commit: خالد حسني CommitDate: Thu Jul 27 23:49:28 2023 +0200 tdf#112594: Group NNBSP with the Mongolian characters after it Narrow No Break Space has special uses in Mongolian, so we want to make sure it is in the same portion as the Mongolian text, even when it comes after text from another script group. We limit this to Mongolian to minimize potential side effects. Change-Id: Idb4c64cec8581e56acfe9bbb8adf4ddc213aaf19 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155000 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index c976ebf93cb2..d67c49b072b8 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -1730,12 +1730,18 @@ void ImpEditEngine::InitScriptTypes( sal_Int32 nPara ) } else { -if ( _xBI->getScriptType( aText, nPos - 1 ) == i18n::ScriptType::WEAK ) +auto nPrevPos = nPos; +auto nPrevChar = aText.iterateCodePoints(&nPrevPos, -1); +if (_xBI->getScriptType(aText, nPrevPos) == i18n::ScriptType::WEAK) { -switch (unicode::getUnicodeType(aText.iterateCodePoints(&nPos, 0))) { -case css::i18n::UnicodeType::NON_SPACING_MARK: -case css::i18n::UnicodeType::ENCLOSING_MARK: -case css::i18n::UnicodeType::COMBINING_SPACING_MARK: +auto nChar = aText.iterateCodePoints(&nPos, 0); +auto nType = unicode::getUnicodeType(nChar); +if (nType == css::i18n::UnicodeType::NON_SPACING_MARK || +nType == css::i18n::UnicodeType::ENCLOSING_MARK || +nType == css::i18n::UnicodeType::COMBINING_SPACING_MARK || +(nPrevChar == 0x202F /* NNBSP, tdf#112594 */ && + u_getIntPropertyValue(nChar, UCHAR_SCRIPT) == USCRIPT_MONGOLIAN)) +{ --nPos; rTypes.back().nEndPos--; break; diff --git a/sd/qa/unit/data/odp/Tdf112594.fodp b/sd/qa/unit/data/odp/Tdf112594.fodp new file mode 100644 index ..ff3e5fc4b639 --- /dev/null +++ b/sd/qa/unit/data/odp/Tdf112594.fodp @@ -0,0 +1,853 @@ + + +http://www.w3.org/TR/css3-text/"; xmlns:grddl="http://www.w3.org/2003/g/data-view#"; xmlns:xhtml="http://www.w3.org/1999/xhtml"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xforms="http://www.w3.org/2002/xforms"; xmlns:dom="http://www.w3.org/2001/xml-events"; xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML"; xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:number="urn:oasis:names:tc:opendocument :xmlns:datastyle:1.0" xmlns:officeooo="http://openoffice.org/2009/office"; xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:rpt="http://openoffice.org/2005/report"; xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:tableooo="http://openoffice.org/2009/table"; xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/"; xmlns:calcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:oooc="http://openoffice.org/20
[Libreoffice-commits] core.git: officecfg/registry
officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu | 24 ++ 1 file changed, 24 insertions(+) New commits: commit 82e263550b81267611f90aecd1aeef163d47ed8a Author: Khaled Hosny AuthorDate: Wed Jul 26 14:14:11 2023 +0300 Commit: خالد حسني CommitDate: Wed Jul 26 16:21:18 2023 +0200 Add short ContextLabel for special character commands Restore the “Insert” in full labels, and add short ContextLabel without it. Followup to: commit a9180786cf39c12b9000c7372e7c30cd2ee8501e Author: Khaled Hosny Date: Tue Jul 25 12:11:48 2023 +0300 tdf#107447: Align special character names with Unicode names Change-Id: Iea8c45cbe8acb4497b515ecbf7fe0d46803d18bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154939 Tested-by: Jenkins Reviewed-by: Heiko Tietze diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu index 4cdd7005b301..92c5c95357e9 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -6994,6 +6994,9 @@ bit 3 (0x8): #define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8 + Insert Non-br~eaking Hyphen + + Non-br~eaking Hyphen @@ -7002,6 +7005,9 @@ bit 3 (0x8): #define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8 + Insert S~oft Hyphen + + S~oft Hyphen @@ -7010,6 +7016,9 @@ bit 3 (0x8): #define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8 + Insert ~No-break Space + + ~No-break Space @@ -7018,6 +7027,9 @@ bit 3 (0x8): #define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8 + Insert N~arrow No-break Space + + N~arrow No-break Space @@ -7026,6 +7038,9 @@ bit 3 (0x8): #define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8 + Insert Zero ~Width Space + + Zero ~Width Space @@ -7034,6 +7049,9 @@ bit 3 (0x8): #define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8 + Insert Word ~Joiner + + Word ~Joiner @@ -7042,6 +7060,9 @@ bit 3 (0x8): #define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8 + Insert ~Left-to-Right Mark + + ~Left-to-Right Mark @@ -7050,6 +7071,9 @@ bit 3 (0x8): #define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8 + Insert ~Right-to-Left Mark + + ~Right-to-Left Mark
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - sw/source
sw/source/core/edit/edfcol.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 88db6f673e7e9ade442ff08f1e5ddace47d475df Author: Khaled Hosny AuthorDate: Tue Jul 25 17:18:48 2023 +0300 Commit: خالد حسني CommitDate: Wed Jul 26 13:13:05 2023 +0200 tdf#156368: Fix setting watermark font for CJK/CTL text We were setting only Western font when getting the shape, so if there is no Western characters in the text the default font would be used. There is no separate setting for CJK/CTL fonts, so we sets the same font for all the three. Change-Id: If2ba2a206f95e0efe9139b9d092b1d6dbf05967c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154894 Tested-by: Jenkins Reviewed-by: خالد حسني (cherry picked from commit 24d0a62bd75b9a895c419aa165da648ab18f134d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154920 Reviewed-by: Michael Stahl diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx index 47b4eb61684d..9ac72b6a2902 100644 --- a/sw/source/core/edit/edfcol.cxx +++ b/sw/source/core/edit/edfcol.cxx @@ -1577,6 +1577,8 @@ static void lcl_placeWatermarkInHeader(const SfxWatermarkItem& rWatermark, xPropertySet->setPropertyValue(UNO_NAME_HORI_ORIENT_RELATION, uno::Any(text::RelOrientation::PAGE_PRINT_AREA)); xPropertySet->setPropertyValue(UNO_NAME_VERT_ORIENT_RELATION, uno::Any(text::RelOrientation::PAGE_PRINT_AREA)); xPropertySet->setPropertyValue(UNO_NAME_CHAR_FONT_NAME, uno::Any(sFont)); +xPropertySet->setPropertyValue(UNO_NAME_CHAR_FONT_NAME_ASIAN, uno::Any(sFont)); +xPropertySet->setPropertyValue(UNO_NAME_CHAR_FONT_NAME_COMPLEX, uno::Any(sFont)); xPropertySet->setPropertyValue(UNO_NAME_CHAR_HEIGHT, uno::Any(WATERMARK_AUTO_SIZE)); xPropertySet->setPropertyValue("Transformation", uno::Any(aMatrix));
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - sw/source
sw/source/core/edit/edfcol.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 1889b5f6d69224185b74f435e52f540ab2a7512a Author: Khaled Hosny AuthorDate: Tue Jul 25 17:18:48 2023 +0300 Commit: Michael Stahl CommitDate: Wed Jul 26 09:59:50 2023 +0200 tdf#156368: Fix setting watermark font for CJK/CTL text We were setting only Western font when getting the shape, so if there is no Western characters in the text the default font would be used. There is no separate setting for CJK/CTL fonts, so we sets the same font for all the three. Change-Id: If2ba2a206f95e0efe9139b9d092b1d6dbf05967c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154894 Tested-by: Jenkins Reviewed-by: خالد حسني (cherry picked from commit 04cf5feb81c179ef58707ff0e71068208a47a2b2) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154919 Reviewed-by: Michael Stahl diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx index 1be771b89174..18e0055c9324 100644 --- a/sw/source/core/edit/edfcol.cxx +++ b/sw/source/core/edit/edfcol.cxx @@ -1578,6 +1578,8 @@ static void lcl_placeWatermarkInHeader(const SfxWatermarkItem& rWatermark, xPropertySet->setPropertyValue(UNO_NAME_HORI_ORIENT_RELATION, uno::Any(text::RelOrientation::PAGE_PRINT_AREA)); xPropertySet->setPropertyValue(UNO_NAME_VERT_ORIENT_RELATION, uno::Any(text::RelOrientation::PAGE_PRINT_AREA)); xPropertySet->setPropertyValue(UNO_NAME_CHAR_FONT_NAME, uno::Any(sFont)); +xPropertySet->setPropertyValue(UNO_NAME_CHAR_FONT_NAME_ASIAN, uno::Any(sFont)); +xPropertySet->setPropertyValue(UNO_NAME_CHAR_FONT_NAME_COMPLEX, uno::Any(sFont)); xPropertySet->setPropertyValue(UNO_NAME_CHAR_HEIGHT, uno::Any(WATERMARK_AUTO_SIZE)); xPropertySet->setPropertyValue("Transformation", uno::Any(aMatrix));
[Libreoffice-commits] core.git: sw/source
sw/source/core/edit/edfcol.cxx |2 ++ 1 file changed, 2 insertions(+) New commits: commit 24d0a62bd75b9a895c419aa165da648ab18f134d Author: Khaled Hosny AuthorDate: Tue Jul 25 17:18:48 2023 +0300 Commit: خالد حسني CommitDate: Wed Jul 26 04:19:12 2023 +0200 tdf#156368: Fix setting watermark font for CJK/CTL text We were setting only Western font when getting the shape, so if there is no Western characters in the text the default font would be used. There is no separate setting for CJK/CTL fonts, so we sets the same font for all the three. Change-Id: If2ba2a206f95e0efe9139b9d092b1d6dbf05967c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154894 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx index 2d7f1e4f5884..9462de2f16bb 100644 --- a/sw/source/core/edit/edfcol.cxx +++ b/sw/source/core/edit/edfcol.cxx @@ -1578,6 +1578,8 @@ static void lcl_placeWatermarkInHeader(const SfxWatermarkItem& rWatermark, xPropertySet->setPropertyValue(UNO_NAME_HORI_ORIENT_RELATION, uno::Any(text::RelOrientation::PAGE_PRINT_AREA)); xPropertySet->setPropertyValue(UNO_NAME_VERT_ORIENT_RELATION, uno::Any(text::RelOrientation::PAGE_PRINT_AREA)); xPropertySet->setPropertyValue(UNO_NAME_CHAR_FONT_NAME, uno::Any(sFont)); +xPropertySet->setPropertyValue(UNO_NAME_CHAR_FONT_NAME_ASIAN, uno::Any(sFont)); +xPropertySet->setPropertyValue(UNO_NAME_CHAR_FONT_NAME_COMPLEX, uno::Any(sFont)); xPropertySet->setPropertyValue(UNO_NAME_CHAR_HEIGHT, uno::Any(WATERMARK_AUTO_SIZE)); xPropertySet->setPropertyValue("Transformation", uno::Any(aMatrix));
[Libreoffice-commits] core.git: officecfg/registry
officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu | 14 +- 1 file changed, 7 insertions(+), 7 deletions(-) New commits: commit a9180786cf39c12b9000c7372e7c30cd2ee8501e Author: Khaled Hosny AuthorDate: Tue Jul 25 12:11:48 2023 +0300 Commit: خالد حسني CommitDate: Tue Jul 25 18:24:10 2023 +0200 tdf#107447: Align special character names with Unicode names Unicode names are recognizable more prevalent, no need to invent our own names. * Non-breaking Space → No-break Space (aligns also with Narrow No-break Space) * No-width Optional Break → Zero Width Space * Remove redundant “Insert” Change-Id: I005c3fefd24045eb4b5c2054d82638b3f2d5f59f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154886 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu index b840300c29d9..4cdd7005b301 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -6994,7 +6994,7 @@ bit 3 (0x8): #define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8 - Insert Non-br~eaking Hyphen + Non-br~eaking Hyphen 1 @@ -7002,7 +7002,7 @@ bit 3 (0x8): #define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8 - Insert S~oft Hyphen + S~oft Hyphen 1 @@ -7010,7 +7010,7 @@ bit 3 (0x8): #define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8 - Insert ~Non-breaking Space + ~No-break Space 1 @@ -7018,7 +7018,7 @@ bit 3 (0x8): #define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8 - Insert N~arrow No-break Space + N~arrow No-break Space 1 @@ -7026,7 +7026,7 @@ bit 3 (0x8): #define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8 - No-~width Optional Break + Zero ~Width Space 1 @@ -7042,7 +7042,7 @@ bit 3 (0x8): #define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8 - ~Left-to-right Mark + ~Left-to-Right Mark 1 @@ -7050,7 +7050,7 @@ bit 3 (0x8): #define UICOMMANDDESCRIPTION_PROPERTIES_TOGGLEBUTTON 8 - ~Right-to-left Mark + ~Right-to-Left Mark 1
[Libreoffice-commits] core.git: Branch 'libreoffice-7-5' - vcl/source
vcl/source/fontsubset/fontsubset.cxx |4 1 file changed, 4 insertions(+) New commits: commit 8568fd0f8d00d0ac4f4f87253fe3aa81b2f2d7fe Author: Khaled Hosny AuthorDate: Tue Jul 25 03:14:37 2023 +0300 Commit: Michael Stahl CommitDate: Tue Jul 25 10:49:13 2023 +0200 tdf#156437: Fix missing name inside embedded Type 1 font in PDF Regression from: commit 7415ce2b9795a78f836bc5e5bffb4b56eee26b21 Author: Khaled Hosny Date: Mon Dec 5 20:52:13 2022 +0200 tdf#113048: Fix PDF ascender and descender of some fonts We were setting the font in PDF /Font dictionary, but not inside the font itself. Change-Id: I1936f615f62fd7afa8f31d66d35dbded879328c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154880 Tested-by: Jenkins Reviewed-by: خالد حسني (cherry picked from commit 42f0422d19c4d0a2fb09654fb6d1d92e50f6dd5c) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154864 Reviewed-by: Michael Stahl diff --git a/vcl/source/fontsubset/fontsubset.cxx b/vcl/source/fontsubset/fontsubset.cxx index 4e6e03c04baf..1ecd358727bf 100644 --- a/vcl/source/fontsubset/fontsubset.cxx +++ b/vcl/source/fontsubset/fontsubset.cxx @@ -79,6 +79,10 @@ bool FontSubsetInfo::CreateFontSubset( mpReqEncodedIds = pReqEncodedIds; mnReqGlyphCount = nReqGlyphCount; +OString aPSName = m_aPSName.toUtf8(); +if (!mpReqFontName) +mpReqFontName = aPSName.getStr(); + // TODO: move the glyphid/encid/notdef reshuffling from the callers to here // dispatch to underlying subsetters
[Libreoffice-commits] core.git: Branch 'libreoffice-7-6' - vcl/source
vcl/source/fontsubset/fontsubset.cxx |4 1 file changed, 4 insertions(+) New commits: commit cca6fe148c3b69b7626c72f39599b9af67712496 Author: Khaled Hosny AuthorDate: Tue Jul 25 03:14:37 2023 +0300 Commit: Michael Stahl CommitDate: Tue Jul 25 10:49:04 2023 +0200 tdf#156437: Fix missing name inside embedded Type 1 font in PDF Regression from: commit 7415ce2b9795a78f836bc5e5bffb4b56eee26b21 Author: Khaled Hosny Date: Mon Dec 5 20:52:13 2022 +0200 tdf#113048: Fix PDF ascender and descender of some fonts We were setting the font in PDF /Font dictionary, but not inside the font itself. Change-Id: I1936f615f62fd7afa8f31d66d35dbded879328c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154880 Tested-by: Jenkins Reviewed-by: خالد حسني (cherry picked from commit 75f25198376991937c76774afff35996143d570a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154863 Reviewed-by: Michael Stahl diff --git a/vcl/source/fontsubset/fontsubset.cxx b/vcl/source/fontsubset/fontsubset.cxx index 4e6e03c04baf..1ecd358727bf 100644 --- a/vcl/source/fontsubset/fontsubset.cxx +++ b/vcl/source/fontsubset/fontsubset.cxx @@ -79,6 +79,10 @@ bool FontSubsetInfo::CreateFontSubset( mpReqEncodedIds = pReqEncodedIds; mnReqGlyphCount = nReqGlyphCount; +OString aPSName = m_aPSName.toUtf8(); +if (!mpReqFontName) +mpReqFontName = aPSName.getStr(); + // TODO: move the glyphid/encid/notdef reshuffling from the callers to here // dispatch to underlying subsetters
[Libreoffice-commits] core.git: vcl/source
vcl/source/fontsubset/fontsubset.cxx |4 1 file changed, 4 insertions(+) New commits: commit 42f0422d19c4d0a2fb09654fb6d1d92e50f6dd5c Author: Khaled Hosny AuthorDate: Tue Jul 25 03:14:37 2023 +0300 Commit: خالد حسني CommitDate: Tue Jul 25 04:16:11 2023 +0200 tdf#156437: Fix missing name inside embedded Type 1 font in PDF Regression from: commit 7415ce2b9795a78f836bc5e5bffb4b56eee26b21 Author: Khaled Hosny Date: Mon Dec 5 20:52:13 2022 +0200 tdf#113048: Fix PDF ascender and descender of some fonts We were setting the font in PDF /Font dictionary, but not inside the font itself. Change-Id: I1936f615f62fd7afa8f31d66d35dbded879328c5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154880 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/vcl/source/fontsubset/fontsubset.cxx b/vcl/source/fontsubset/fontsubset.cxx index 4e6e03c04baf..1ecd358727bf 100644 --- a/vcl/source/fontsubset/fontsubset.cxx +++ b/vcl/source/fontsubset/fontsubset.cxx @@ -79,6 +79,10 @@ bool FontSubsetInfo::CreateFontSubset( mpReqEncodedIds = pReqEncodedIds; mnReqGlyphCount = nReqGlyphCount; +OString aPSName = m_aPSName.toUtf8(); +if (!mpReqFontName) +mpReqFontName = aPSName.getStr(); + // TODO: move the glyphid/encid/notdef reshuffling from the callers to here // dispatch to underlying subsetters
[Libreoffice-commits] core.git: 2 commits - editeng/source i18nutil/source include/i18nutil
editeng/source/editeng/impedit2.cxx | 22 -- i18nutil/source/utility/unicode.cxx | 12 +++- include/i18nutil/unicode.hxx| 10 +- 3 files changed, 24 insertions(+), 20 deletions(-) New commits: commit 529dce3d5b695637a1ccc8b4b697d87c5db0d3a2 Author: Khaled Hosny AuthorDate: Mon Jul 24 22:07:25 2023 +0300 Commit: خالد حسني CommitDate: Tue Jul 25 02:15:05 2023 +0200 editeng: Call unicode::getUnicodeType() on UTF-32 code units By using OUString::iterateCodePoints() instead of accessing individual UTF-16 code units that might be surrogate pairs. Change-Id: I5e3e513a788f0c939f96b0521fed16fe4848a053 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154875 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 664c8f5d18f0..c976ebf93cb2 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -1732,10 +1732,10 @@ void ImpEditEngine::InitScriptTypes( sal_Int32 nPara ) { if ( _xBI->getScriptType( aText, nPos - 1 ) == i18n::ScriptType::WEAK ) { -switch ( u_charType(aText.iterateCodePoints(&nPos, 0) ) ) { -case U_NON_SPACING_MARK: -case U_ENCLOSING_MARK: -case U_COMBINING_SPACING_MARK: +switch (unicode::getUnicodeType(aText.iterateCodePoints(&nPos, 0))) { +case css::i18n::UnicodeType::NON_SPACING_MARK: +case css::i18n::UnicodeType::ENCLOSING_MARK: +case css::i18n::UnicodeType::COMBINING_SPACING_MARK: --nPos; rTypes.back().nEndPos--; break; @@ -2761,7 +2761,9 @@ EditPaM ImpEditEngine::ImpInsertText(const EditSelection& aCurSel, const OUStrin sal_Int32 nPos = nMaxNewChars; while (nPos-- > 0 && (nMaxNewChars - nPos) <= 84) { -switch (unicode::getUnicodeType(aLine[nPos])) +auto nNextPos = nPos; +const auto c = aLine.iterateCodePoints(&nNextPos); +switch (unicode::getUnicodeType(c)) { case css::i18n::UnicodeType::UPPERCASE_LETTER: case css::i18n::UnicodeType::LOWERCASE_LETTER: @@ -2775,24 +2777,24 @@ EditPaM ImpEditEngine::ImpInsertText(const EditSelection& aCurSel, const OUStrin break; default: { -const sal_Unicode c = aLine[nPos]; // Ignore NO-BREAK spaces, NBSP, NNBSP, ZWNBSP. if (c == 0x00A0 || c == 0x202F || c == 0xFEFF) break; -if (c == '-' && nPos + 1 < nMaxNewChars) +const auto n = aLine.iterateCodePoints(&nNextPos, 0); +if (c == '-' && nNextPos < nMaxNewChars) { // Keep HYPHEN-MINUS with a number to the right. -const sal_Int16 t = unicode::getUnicodeType(aLine[nPos+1]); +const sal_Int16 t = unicode::getUnicodeType(n); if (t == css::i18n::UnicodeType::DECIMAL_DIGIT_NUMBER || t == css::i18n::UnicodeType::LETTER_NUMBER || t == css::i18n::UnicodeType::OTHER_NUMBER) nMaxNewChars = nPos;// line break before else -nMaxNewChars = nPos + 1;// line break after +nMaxNewChars = nNextPos;// line break after } else { -nMaxNewChars = nPos + 1;// line break after +nMaxNewChars = nNextPos;// line break after } nPos = 0; // will break loop } commit 2e6e40b7453e2005d46ba7866feff2f2caa1f100 Author: Khaled Hosny AuthorDate: Mon Jul 24 20:52:44 2023 +0300 Commit: خالد حسني CommitDate: Tue Jul 25 02:14:56 2023 +0200 i18nutil: Make unicode::getUnicodeType() take a UTF-32 code point Still need to fix call sites to handles surrogate pairs. Change-Id: I3ba896714fc6a90596c041148a3c9d965f60f4a1 Reviewed-on: https://gerrit.libreoffice.org/c/core
[Libreoffice-commits] core.git: i18nutil/source
i18nutil/source/utility/casefolding.cxx| 21 +-- i18nutil/source/utility/casefolding_data.h | 195 - 2 files changed, 11 insertions(+), 205 deletions(-) New commits: commit 89229524298398ca1b5239c2a7ca798900733f5d Author: Khaled Hosny AuthorDate: Mon Jul 24 18:45:38 2023 +0300 Commit: خالد حسني CommitDate: Tue Jul 25 01:02:30 2023 +0200 i18nutil: Fix ICU case folding of surrogate pairs It can’t be easily made to work when mixing our case folding data (which seems to work on individual surrogates) and ICU functions, so port it over completely to ICU. Change-Id: I0e12b81b23a053a2a9a299e51908930a3d0b82d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154843 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/i18nutil/source/utility/casefolding.cxx b/i18nutil/source/utility/casefolding.cxx index d4f79927c131..52dbeb1ca1c5 100644 --- a/i18nutil/source/utility/casefolding.cxx +++ b/i18nutil/source/utility/casefolding.cxx @@ -94,18 +94,20 @@ const Mapping& casefolding::getConditionalValue(const sal_Unicode* str, sal_Int3 Mapping casefolding::getValue(const sal_Unicode* str, sal_Int32 pos, sal_Int32 len, Locale const & aLocale, MappingType nMappingType) { +if (pos > 0 && rtl::isHighSurrogate(str[pos-1]) && rtl::isLowSurrogate(str[pos])) +return { 0, 0, { 0, 0, 0 } }; + Mapping dummy = { 0, 1, { str[pos], 0, 0 } }; sal_uInt32 c; -if (pos > 0 && rtl::isHighSurrogate(str[pos-1]) && rtl::isLowSurrogate(str[pos])) { -c = rtl::combineSurrogates(str[pos-1], str[pos]); -if (c >= SAL_N_ELEMENTS(CaseMappingIndex) * 256) -return dummy; -} else { +if (pos + 1 < len && rtl::isHighSurrogate(str[pos]) && rtl::isLowSurrogate(str[pos + 1])) +c = rtl::combineSurrogates(str[pos], str[pos + 1]); +else c = str[pos]; -} -sal_Int16 address = CaseMappingIndex[c >> 8]; +sal_Int16 address = -1; +if (c < SAL_N_ELEMENTS(CaseMappingIndex) * 256) +address = CaseMappingIndex[c >> 8]; if (address >= 0) { address = (address << 8) + (c & 0xFF); @@ -142,7 +144,7 @@ Mapping casefolding::getValue(const sal_Unicode* str, sal_Int32 pos, sal_Int32 l // using ustring.h APIs, which work on the whole string not character // by character. // TODO: what is the difference between ToLower and UpperToLower etc.? -sal_uInt32 value = 0; +sal_uInt32 value = c; switch (nMappingType) { case MappingType::ToLower: @@ -163,8 +165,7 @@ Mapping casefolding::getValue(const sal_Unicode* str, sal_Int32 pos, sal_Int32 l default: break; } -if (value && value != c) -dummy.nmap = rtl::splitSurrogates(value, dummy.map); +dummy.nmap = rtl::splitSurrogates(value, dummy.map); return dummy; } diff --git a/i18nutil/source/utility/casefolding_data.h b/i18nutil/source/utility/casefolding_data.h index f3f22c734e24..174fdc066ed9 100644 --- a/i18nutil/source/utility/casefolding_data.h +++ b/i18nutil/source/utility/casefolding_data.h @@ -56,36 +56,6 @@ const sal_Int8 CaseMappingIndex[] = { -1, -1, -1, -1, -1, -1, -1, -1, // e800 - efff -1, -1, -1, -1, -1, -1, -1, -1, // f000 - f7ff -1, -1, -1, 0x0b, -1, -1, -1, 0x0c, // f800 - - -1, -1, -1, -1, 0x0d, -1, -1, -1, // 1 - 107ff - -1, -1, -1, -1, 0x0e, -1, -1, -1, // 10800 - 10fff - -1, -1, -1, -1, -1, -1, -1, -1, // 11000 - 117ff -0x0f, -1, -1, -1, -1, -1, -1, -1, // 11800 - 11fff - -1, -1, -1, -1, -1, -1, -1, -1, // 12000 - 127ff - -1, -1, -1, -1, -1, -1, -1, -1, // 12800 - 12fff - -1, -1, -1, -1, -1, -1, -1, -1, // 13000 - 137ff - -1, -1, -1, -1, -1, -1, -1, -1, // 13800 - 13fff - -1, -1, -1, -1, -1, -1, -1, -1, // 14000 - 147ff - -1, -1, -1, -1, -1, -1, -1, -1, // 14800 - 14fff - -1, -1, -1, -1, -1, -1, -1, -1, // 15000 - 157ff - -1, -1, -1, -1, -1, -1, -1, -1, // 15800 - 15fff - -1, -1, -1, -1, -1, -1, -1, -1, // 16000 - 167ff - -1, -1, -1, -1, -1, -1, 0x10, -1, // 16800 - 16fff - -1, -1, -1, -1, -1, -1, -1, -1, // 17000 - 177ff - -1, -1, -1, -1, -1, -1, -1, -1, // 17800 - 17fff - -1, -1, -1, -1, -1, -1, -1, -1, // 18000 - 187ff - -1, -1, -1, -1, -1, -1, -1, -1, // 18800 - 18fff - -1, -1, -1, -1, -1, -1, -1, -1, // 19000 - 197ff - -1, -1, -1, -1, -1, -1, -1, -1, // 19800 - 19fff - -1, -1, -1, -1, -1, -1, -1, -1, // 1a000 - 1a7ff - -1, -1, -1, -1, -1,
[Libreoffice-commits] core.git: i18nutil/source
i18nutil/source/utility/unicode.cxx| 99 +++ i18nutil/source/utility/unicode_data.h | 880 - 2 files changed, 94 insertions(+), 885 deletions(-) New commits: commit 851f0dc7cd85eb146b205027cadc8decce0e5bed Author: Khaled Hosny AuthorDate: Mon Jul 24 20:39:12 2023 +0300 Commit: خالد حسني CommitDate: Mon Jul 24 21:19:53 2023 +0200 i18nutil: Port unicode::getUnicodeType() to ICU One-less Unicode data table to forget to update. Change-Id: Icf64e55ec322578b2eefb9065842c218d6f3e061 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154873 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/i18nutil/source/utility/unicode.cxx b/i18nutil/source/utility/unicode.cxx index 19a6bdf0b416..dbb81a8240f1 100644 --- a/i18nutil/source/utility/unicode.cxx +++ b/i18nutil/source/utility/unicode.cxx @@ -74,11 +74,100 @@ unicode::getUnicodeType( const sal_Unicode ch ) { if (ch == c) return r; else c = ch; -sal_Int16 address = UnicodeTypeIndex[ch >> 8]; -r = static_cast( -(address < UnicodeTypeNumberBlock) -? UnicodeTypeBlockValue[address] -: UnicodeTypeValue[((address - UnicodeTypeNumberBlock) << 8) + (ch & 0xff)]); +switch (u_charType(ch)) +{ +case U_UNASSIGNED: +r = css::i18n::UnicodeType::UNASSIGNED; +break; +case U_UPPERCASE_LETTER: +r = css::i18n::UnicodeType::UPPERCASE_LETTER; +break; +case U_LOWERCASE_LETTER: +r = css::i18n::UnicodeType::LOWERCASE_LETTER; +break; +case U_TITLECASE_LETTER: +r = css::i18n::UnicodeType::TITLECASE_LETTER; +break; +case U_MODIFIER_LETTER: +r = css::i18n::UnicodeType::MODIFIER_LETTER; +break; +case U_OTHER_LETTER: +r = css::i18n::UnicodeType::OTHER_LETTER; +break; +case U_NON_SPACING_MARK: +r = css::i18n::UnicodeType::NON_SPACING_MARK; +break; +case U_ENCLOSING_MARK: +r = css::i18n::UnicodeType::ENCLOSING_MARK; +break; +case U_COMBINING_SPACING_MARK: +r = css::i18n::UnicodeType::COMBINING_SPACING_MARK; +break; +case U_DECIMAL_DIGIT_NUMBER: +r = css::i18n::UnicodeType::DECIMAL_DIGIT_NUMBER; +break; +case U_LETTER_NUMBER: +r = css::i18n::UnicodeType::LETTER_NUMBER; +break; +case U_OTHER_NUMBER: +r = css::i18n::UnicodeType::OTHER_NUMBER; +break; +case U_SPACE_SEPARATOR: +r = css::i18n::UnicodeType::SPACE_SEPARATOR; +break; +case U_LINE_SEPARATOR: +r = css::i18n::UnicodeType::LINE_SEPARATOR; +break; +case U_PARAGRAPH_SEPARATOR: +r = css::i18n::UnicodeType::PARAGRAPH_SEPARATOR; +break; +case U_CONTROL_CHAR: +r = css::i18n::UnicodeType::CONTROL; +break; +case U_FORMAT_CHAR: +r = css::i18n::UnicodeType::FORMAT; +break; +case U_PRIVATE_USE_CHAR: +r = css::i18n::UnicodeType::PRIVATE_USE; +break; +case U_SURROGATE: +r = css::i18n::UnicodeType::SURROGATE; +break; +case U_DASH_PUNCTUATION: +r = css::i18n::UnicodeType::DASH_PUNCTUATION; +break; +case U_INITIAL_PUNCTUATION: +r = css::i18n::UnicodeType::INITIAL_PUNCTUATION; +break; +case U_FINAL_PUNCTUATION: +r = css::i18n::UnicodeType::FINAL_PUNCTUATION; +break; +case U_CONNECTOR_PUNCTUATION: +r = css::i18n::UnicodeType::CONNECTOR_PUNCTUATION; +break; +case U_OTHER_PUNCTUATION: +r = css::i18n::UnicodeType::OTHER_PUNCTUATION; +break; +case U_MATH_SYMBOL: +r = css::i18n::UnicodeType::MATH_SYMBOL; +break; +case U_CURRENCY_SYMBOL: +r = css::i18n::UnicodeType::CURRENCY_SYMBOL; +break; +case U_MODIFIER_SYMBOL: +r = css::i18n::UnicodeType::MODIFIER_SYMBOL; +break; +case U_OTHER_SYMBOL: +r = css::i18n::UnicodeType::OTHER_SYMBOL; +break; +case U_START_PUNCTUATION: +r = css::i18n::UnicodeType::START_PUNCTUATION; +break; +case U_END_PUNCTUATION: +r = css::i18n::UnicodeType::END_PUNCTUATION; +break; +} + return r; } diff --git a/i18nutil/source/utility/unicode_data.h b/i18nutil/source/utility/unicode_data.h index 1c909605b6df..af23f9548892 100644 --- a/i18nutil/source/utility/unicode_data.h +++ b/i18nutil/source/utility/unicode_data.h @@ -23,886 +23,6 @@ #include -#define UnicodeTypeNumberBlock 5 - -const sal_Int8 UnicodeTypeIndex[]
[Libreoffice-commits] core.git: i18npool/qa
i18npool/qa/cppunit/test_characterclassification.cxx | 55 +++ 1 file changed, 55 insertions(+) New commits: commit d592e502488857871c44ba5d6e06043b1b6a63c4 Author: Khaled Hosny AuthorDate: Mon Jul 24 20:28:56 2023 +0300 Commit: خالد حسني CommitDate: Mon Jul 24 21:07:02 2023 +0200 i18npool: Test case folding of surrogate pairs Change-Id: I3097651927b85aaa46fc4fc59badf22d24fcb928 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154872 Tested-by: Jenkins Reviewed-by: خالد حسني diff --git a/i18npool/qa/cppunit/test_characterclassification.cxx b/i18npool/qa/cppunit/test_characterclassification.cxx index 206bcec83882..78397029b71f 100644 --- a/i18npool/qa/cppunit/test_characterclassification.cxx +++ b/i18npool/qa/cppunit/test_characterclassification.cxx @@ -217,6 +217,61 @@ CPPUNIT_TEST_FIXTURE(TestCharacterClassification, testTdf97152) } } +CPPUNIT_TEST_FIXTURE(TestCharacterClassification, testSurrogatePairs) +{ +{ +// No case mapping +OUString sTest(u"\U0001F600"); +OUString sLowerCase = m_xCC->toLower(sTest, 0, sTest.getLength(), {}); +CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be lower", OUString(u"\U0001F600"), sLowerCase); +OUString sUpperCase = m_xCC->toUpper(sLowerCase, 0, sLowerCase.getLength(), {}); +CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be upper", sTest, sUpperCase); +} + +{ +// Case mapping +OUString sTest(u"\U00010400"); +OUString sLowerCase = m_xCC->toLower(sTest, 0, sTest.getLength(), {}); +CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be lower", OUString(u"\U00010428"), sLowerCase); +OUString sUpperCase = m_xCC->toUpper(sLowerCase, 0, sLowerCase.getLength(), {}); +CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be upper", sTest, sUpperCase); +} +} + +CPPUNIT_TEST_FIXTURE(TestCharacterClassification, testAdlam) +{ +OUString sUpper(u"𞤀𞤁𞤂𞤃𞤄𞤅𞤆𞤇𞤈𞤉𞤊𞤋𞤌𞤍𞤎𞤏𞤐𞤑𞤒𞤓𞤔𞤕𞤖𞤗𞤘𞤙𞤚𞤛𞤜𞤝𞤞𞤟𞤠𞤡"); +OUString sLower(u"𞤢𞤣𞤤𞤥𞤦𞤧𞤨𞤩𞤪𞤫𞤬𞤭𞤮𞤯𞤰𞤱𞤲𞤳𞤴𞤵𞤶𞤷𞤸𞤹𞤺𞤻𞤼𞤽𞤾𞤿𞥀𞥁𞥂𞥃"); +OUString sTitle = sLower; // Adlam doesn’t have title case? +{ +// From upper case +OUString sLowerRes = m_xCC->toLower(sUpper, 0, sUpper.getLength(), {}); +CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be lower", sLower, sLowerRes); +OUString sUpperRes = m_xCC->toUpper(sLowerRes, 0, sLower.getLength(), {}); +CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be upper", sUpper, sUpperRes); +} + +{ +// From lower case +OUString sTitleRes = m_xCC->toTitle(sLower, 0, sLower.getLength(), {}); +CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be title", sTitle, sTitleRes); +OUString sUpperRes = m_xCC->toUpper(sLower, 0, sLower.getLength(), {}); +CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be upper", sUpper, sUpperRes); +OUString sLowerRes = m_xCC->toLower(sUpperRes, 0, sUpperRes.getLength(), {}); +CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be lower", sLower, sLowerRes); +} + +{ +// From title case +OUString sTitleRes = m_xCC->toTitle(sTitle, 0, sTitle.getLength(), {}); +CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be title", sTitle, sTitleRes); +OUString sUpperRes = m_xCC->toUpper(sTitle, 0, sTitle.getLength(), {}); +CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be upper", sUpper, sUpperRes); +OUString sLowerRes = m_xCC->toLower(sTitle, 0, sTitle.getLength(), {}); +CPPUNIT_ASSERT_EQUAL_MESSAGE("Should be lower", sLower, sLowerRes); +} +} + void TestCharacterClassification::setUp() { BootstrapFixtureBase::setUp();