sw/source/core/text/porexp.cxx |   41 ++++-------------------------------------
 sw/source/core/text/portxt.cxx |   10 ++--------
 2 files changed, 6 insertions(+), 45 deletions(-)

New commits:
commit 88004761916bffd780bd5a1d6e0f744c23d5be4f
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Wed Nov 29 13:30:40 2023 +0100
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Nov 29 17:45:44 2023 +0100

    tdf#157768: revert missing parts in 7.6 branch
    
    This code was added with 28675af84ae8e2342bd78be3696dc09de6ce5cc5
    "tdf#41652: Variable width NBSP" but not reverted in
    a344f4ef39e59b8be5007531b6dd776d156c297e
    "Revert variable width NBSP for 7.6"
    
    Change-Id: Ied29a6e684eac89d79028e004b73c332c9a30d0a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160083
    Tested-by: Jenkins
    Tested-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sw/source/core/text/porexp.cxx b/sw/source/core/text/porexp.cxx
index 41b10a3c72f2..08a4258f1b23 100644
--- a/sw/source/core/text/porexp.cxx
+++ b/sw/source/core/text/porexp.cxx
@@ -207,47 +207,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 degree sign
-            OUString aMarker = u"°";
-
-            SwPosSize aMarkerSize(rInf.GetTextSize(aMarker));
-            Point aPos(rInf.GetPos());
-
-            std::shared_ptr<SwRect> pPortionRect = std::make_shared<SwRect>();
-            rInf.CalcRect(*this, pPortionRect.get());
-            aPos.AdjustX((pPortionRect->Width() / 2) - (aMarkerSize.Width() / 
2));
-
-            SwTextPaintInfo aInf(rInf, &aMarker);
-            aInf.SetPos(aPos);
-            SwTextPortion aMarkerPor;
-            aMarkerPor.Width(aMarkerSize.Width());
-            aMarkerPor.Height(aMarkerSize.Height());
-            aMarkerPor.SetAscent(GetAscent());
-
-            Color colorBackup = aInf.GetFont()->GetColor();
-            aInf.GetFont()->SetColor(NON_PRINTING_CHARACTER_COLOR);
-            aInf.DrawText(aMarkerPor, TextFrameIndex(aMarker.getLength()), 
true);
-            aInf.GetFont()->SetColor(colorBackup);
-        }
-    }
-    else
-    {
-        SwExpandPortion::Paint(rInf);
-    }
+    if( !m_bMulti ) // No gray background for multiportion brackets
+        rInf.DrawViewOpt( *this, PortionType::Blank );
+    SwExpandPortion::Paint( rInf );
 }
 
-bool SwBlankPortion::GetExpText( const SwTextSizeInfo& /*rInf*/, OUString 
&rText ) const
+bool SwBlankPortion::GetExpText( const SwTextSizeInfo&, OUString &rText ) const
 {
     rText = OUString(m_cChar);
-
     return true;
 }
 
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index 99595c1a71f7..e11d11d044b5 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -589,10 +589,7 @@ TextFrameIndex SwTextPortion::GetSpaceCnt(const 
SwTextSizeInfo &rInf,
 
     if ( InExpGrp() || PortionType::InputField == GetWhichPor() )
     {
-        if (OUString ExpOut;
-            (!IsBlankPortion()
-             || (GetExpText(rInf, ExpOut) && OUStringChar(CH_BLANK) == ExpOut))
-            && !InNumberGrp() && !IsCombinedPortion())
+        if( !IsBlankPortion() && !InNumberGrp() && !IsCombinedPortion() )
         {
             // OnWin() likes to return a blank instead of an empty string from
             // time to time. We cannot use that here at all, however.
@@ -629,10 +626,7 @@ tools::Long SwTextPortion::CalcSpacing( tools::Long 
nSpaceAdd, const SwTextSizeI
 
     if ( InExpGrp() || PortionType::InputField == GetWhichPor() )
     {
-        if (OUString ExpOut;
-            (!IsBlankPortion()
-             || (GetExpText(rInf, ExpOut) && OUStringChar(CH_BLANK) == ExpOut))
-            && !InNumberGrp() && !IsCombinedPortion())
+        if( !IsBlankPortion() && !InNumberGrp() && !IsCombinedPortion() )
         {
             // OnWin() likes to return a blank instead of an empty string from
             // time to time. We cannot use that here at all, however.

Reply via email to