sw/source/core/text/porexp.cxx |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

New commits:
commit 8716f10f8a3b59ceb8b7673d6c5948b882830167
Author:     Vojtěch Doležal <dolez...@cvut.cz>
AuthorDate: Sun May 28 03:10:07 2023 +0200
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Tue May 30 11:25:15 2023 +0200

    Fix gray shade for NBSPs
    
    28675af broke field shading for NBSPs, showing it only when non-printing 
characters are enabled.
    
    This commit reverts the behaviour to the original state, where field shade 
is independent on whether the non-printing characters are enabled.
    
    Change-Id: Ica44937a82d6c3742716e9aa934ab87e7f8b5168
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152349
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sw/source/core/text/porexp.cxx b/sw/source/core/text/porexp.cxx
index de435df5ae54..8fc8d7b17fc9 100644
--- a/sw/source/core/text/porexp.cxx
+++ b/sw/source/core/text/porexp.cxx
@@ -208,13 +208,14 @@ bool SwBlankPortion::Format( SwTextFormatInfo &rInf )
 
 void SwBlankPortion::Paint( const SwTextPaintInfo &rInf ) const
 {
+    // Draw field shade (can be disabled individually)
+    if (!m_bMulti) // No gray background for multiportion brackets
+        rInf.DrawViewOpt(*this, PortionType::Blank);
+
     if (m_cChar == CHAR_HARDBLANK)
     {
         if (rInf.GetOpt().IsBlank())
         {
-            // Draw background
-            rInf.DrawViewOpt(*this, PortionType::Blank);
-
             // Draw tilde or degree sign
             OUString aMarker = 
(rInf.GetTextFrame()->GetDoc().getIDocumentSettingAccess()
                                     
.get(DocumentSettingId::USE_VARIABLE_WIDTH_NBSP)
@@ -243,9 +244,6 @@ void SwBlankPortion::Paint( const SwTextPaintInfo &rInf ) 
const
     }
     else
     {
-        if (!m_bMulti) // No gray background for multiportion brackets
-            rInf.DrawViewOpt(*this, PortionType::Blank);
-
         SwExpandPortion::Paint(rInf);
     }
 }

Reply via email to