diff options
author | Oliver Specht <oliver.specht@cib.de> | 2024-02-05 09:41:05 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2024-02-09 20:09:41 +0100 |
commit | 461142ba2f4dd5527ca97b5a3b89c62e8f6a72fd (patch) | |
tree | cf6d34fef4f35dae48869818d7cfda47ceb7be52 | |
parent | d6ff51a16600af97522a9afae4fe463118653c71 (diff) |
tdf#159560 paragraph break should be shown as pilcrow sign
When non-printing characters are switched on at the end of the paragraph
a pilcrow sign is shown. This is displayed using the font at the end of
the character. If a symbol font is used that would result in a random symbol
instead of the pilcrow sign (0x00b6). This is fixed here.
Change-Id: I0d4ae9f439d2e34ca774d4e2cb188e94290808a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162983
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
Tested-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
(cherry picked from commit 297b47a7e0c191be22f90ab799b4b8bb8bdbaf59)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163142
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
-rw-r--r-- | sw/source/core/text/porrst.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx index 029adca75336..a4a0d3c713d3 100644 --- a/sw/source/core/text/porrst.cxx +++ b/sw/source/core/text/porrst.cxx @@ -22,6 +22,7 @@ #include <editeng/escapementitem.hxx> #include <editeng/lrspitem.hxx> #include <editeng/pgrditem.hxx> +#include <editeng/fontitem.hxx> #include <vcl/svapp.hxx> #include <comphelper/scopeguard.hxx> @@ -47,6 +48,7 @@ #include <IDocumentRedlineAccess.hxx> #include <IDocumentSettingAccess.hxx> #include <IDocumentDeviceAccess.hxx> +#include <IDocumentLayoutAccess.hxx> #include <crsrsh.hxx> #include <swtypes.hxx> @@ -74,6 +76,16 @@ void SwTmpEndPortion::Paint( const SwTextPaintInfo &rInf ) const SwFont aFont(*pOldFnt); + const SwDoc& rDoc = rInf.GetTextFrame()->GetDoc(); + if (aFont.IsSymbol(rDoc.getIDocumentLayoutAccess().GetCurrentViewShell())) + { + const SvxFontItem& rFontItem = rDoc.GetDefault(RES_CHRATR_FONT); + aFont.SetName( rFontItem.GetFamilyName(), SwFontScript::Latin ); + aFont.SetStyleName( rFontItem.GetStyleName(), SwFontScript::Latin ); + aFont.SetFamily( rFontItem.GetFamily(), SwFontScript::Latin ); + aFont.SetPitch( rFontItem.GetPitch(), SwFontScript::Latin ); + aFont.SetCharSet( rFontItem.GetCharSet(), SwFontScript::Latin ); + } // Paint strikeout/underline based on redline color and settings // (with an extra pilcrow in the background, because there is // no SetStrikeoutColor(), also SetUnderColor() doesn't work()). |