sw/qa/core/text/text.cxx       |   12 ++++++------
 sw/source/core/text/porexp.cxx |    5 +----
 2 files changed, 7 insertions(+), 10 deletions(-)

New commits:
commit 78872cc81bf4b1377c9cae8f9040a2443d0690c0
Author:     László Németh <nem...@numbertext.org>
AuthorDate: Tue Nov 28 19:39:16 2023 +0100
Commit:     László Németh <nem...@numbertext.org>
CommitDate: Wed Nov 29 10:16:28 2023 +0100

    tdf#157768 sw: fix lost character background of NBSP
    
    Regression from commit 28675af84ae8e2342bd78be3696dc09de6ce5cc5
    "tdf#41652: Variable width NBSP".
    
    Change-Id: I066ecadac8961b182f8580147b197f13dd0daae4
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160054
    Tested-by: Jenkins
    Reviewed-by: László Németh <nem...@numbertext.org>

diff --git a/sw/qa/core/text/text.cxx b/sw/qa/core/text/text.cxx
index 8951b9fb6a82..7340a151d1f4 100644
--- a/sw/qa/core/text/text.cxx
+++ b/sw/qa/core/text/text.cxx
@@ -1263,9 +1263,9 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, 
testTdf41652NBSPWidth)
         xmlDocUniquePtr pXmlDoc = dumpAndParse(aDumper, *xMetaFile);
 
         nSectionAfterNBSPX_legacy_leftAligned
-            = getXPath(pXmlDoc, "//textarray[3]"_ostr, "x"_ostr).toInt32();
+            = getXPath(pXmlDoc, "//textarray[4]"_ostr, "x"_ostr).toInt32();
         nSectionAfterNBSPX_legacy_justified
-            = getXPath(pXmlDoc, "//textarray[8]"_ostr, "x"_ostr).toInt32();
+            = getXPath(pXmlDoc, "//textarray[10]"_ostr, "x"_ostr).toInt32();
     }
 
     // Measure the X of sections after NBSPs in a file with the option enabled
@@ -1278,9 +1278,9 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, 
testTdf41652NBSPWidth)
         xmlDocUniquePtr pXmlDoc = dumpAndParse(aDumper, *xMetaFile);
 
         nSectionAfterNBSPX_optionDisabled_leftAligned
-            = getXPath(pXmlDoc, "//textarray[3]"_ostr, "x"_ostr).toInt32();
+            = getXPath(pXmlDoc, "//textarray[4]"_ostr, "x"_ostr).toInt32();
         nSectionAfterNBSPX_optionDisabled_justified
-            = getXPath(pXmlDoc, "//textarray[8]"_ostr, "x"_ostr).toInt32();
+            = getXPath(pXmlDoc, "//textarray[10]"_ostr, "x"_ostr).toInt32();
     }
 
     // Measure the X of the sections after NBSPs in a file with the option 
enabled
@@ -1293,9 +1293,9 @@ CPPUNIT_TEST_FIXTURE(SwCoreTextTest, 
testTdf41652NBSPWidth)
         xmlDocUniquePtr pXmlDoc = dumpAndParse(aDumper, *xMetaFile);
 
         nSectionAfterNBSPX_optionEnabled_leftAligned
-            = getXPath(pXmlDoc, "//textarray[3]"_ostr, "x"_ostr).toInt32();
+            = getXPath(pXmlDoc, "//textarray[4]"_ostr, "x"_ostr).toInt32();
         nSectionAfterNBSPX_optionEnabled_justified
-            = getXPath(pXmlDoc, "//textarray[8]"_ostr, "x"_ostr).toInt32();
+            = getXPath(pXmlDoc, "//textarray[10]"_ostr, "x"_ostr).toInt32();
     }
 
     // Assert left aligned NBSP for the legacy file is larger than zero
diff --git a/sw/source/core/text/porexp.cxx b/sw/source/core/text/porexp.cxx
index 56e3d7c34265..0884db6fce76 100644
--- a/sw/source/core/text/porexp.cxx
+++ b/sw/source/core/text/porexp.cxx
@@ -211,6 +211,7 @@ 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);
+    SwExpandPortion::Paint(rInf);
 
     if (m_cChar == CHAR_HARDBLANK)
     {
@@ -242,10 +243,6 @@ void SwBlankPortion::Paint( const SwTextPaintInfo &rInf ) 
const
             aInf.GetFont()->SetColor(colorBackup);
         }
     }
-    else
-    {
-        SwExpandPortion::Paint(rInf);
-    }
 }
 
 bool SwBlankPortion::GetExpText( const SwTextSizeInfo& rInf, OUString &rText ) 
const

Reply via email to