sw/source/core/text/porrst.cxx |   12 ++++++++++++
 1 file changed, 12 insertions(+)

New commits:
commit d1320c634817e4edb0d76da26178f323c6c675f2
Author:     Oliver Specht <oliver.spe...@cib.de>
AuthorDate: Mon Feb 5 09:41:05 2024 +0100
Commit:     Thorsten Behrens <thorsten.behr...@allotropia.de>
CommitDate: Thu Feb 8 15:17:34 2024 +0100

    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.ext...@allotropia.de>
    Tested-by: Gabor Kelemen <gabor.kelemen.ext...@allotropia.de>

diff --git a/sw/source/core/text/porrst.cxx b/sw/source/core/text/porrst.cxx
index b9d4e5ab3fcb..ff1e029ae141 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()).

Reply via email to