sw/inc/viewsh.hxx | 3 ++- sw/source/core/doc/notxtfrm.cxx | 3 ++- sw/source/core/layout/paintfrm.cxx | 4 ++-- sw/source/core/view/viewsh.cxx | 16 ++++++++-------- 4 files changed, 14 insertions(+), 12 deletions(-)
New commits: commit 8fe92e9a17c682d577fba44479ffe412d75e8454 Author: Sahil Gautam <[email protected]> AuthorDate: Tue Aug 12 23:16:22 2025 +0530 Commit: Noel Grandin <[email protected]> CommitDate: Wed Aug 13 10:27:53 2025 +0200 refactor SwViewShell::GetReplacementBitmapSplit(bool) Change-Id: I69365d0488078f268a2b23b7c4fbb2b9d4479ae9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189446 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 8e8700ea5f37..cece0d0dfdfc 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -609,7 +609,8 @@ public: bool IsInConstructor() const { return mbInConstructor; } - const Bitmap& GetReplacementBitmap(bool bIsErrorState); + const Bitmap& GetErrorBitmap(); + const Bitmap& GetReplacementBitmap(); void DeleteReplacementBitmaps(); const SwPostItMgr* GetPostItMgr() const { return const_cast<SwViewShell*>(this)->GetPostItMgr(); } diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index fd2927d0c414..9d0175f14608 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -143,7 +143,8 @@ static void lcl_PaintReplacement( const SwRect &rRect, const OUString &rText, aFont.SetUnderline( eUnderline ); aFont.SetColor( aCol ); - const Bitmap& rBmp = const_cast<SwViewShell&>(rSh).GetReplacementBitmap(bDefect); + const Bitmap& rBmp = bDefect ? const_cast<SwViewShell&>(rSh).GetErrorBitmap() + : const_cast<SwViewShell&>(rSh).GetReplacementBitmap(); Graphic::DrawEx(*rSh.GetOut(), rText, aFont, BitmapEx(rBmp), rRect.Pos(), rRect.SSize()); } diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 43a60e563c69..eed388c8f408 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -2116,7 +2116,7 @@ void DrawGraphic( if( bReplaceGrfNum ) { - const Bitmap& rBmp = rSh.GetReplacementBitmap(false); + const Bitmap& rBmp = rSh.GetReplacementBitmap(); vcl::Font aTmp( rOutDev.GetFont() ); Graphic::DrawEx(rOutDev, OUString(), aTmp, BitmapEx(rBmp), rOrg.Pos(), rOrg.SSize()); } @@ -4101,7 +4101,7 @@ bool SwFlyFrame::IsBackgroundTransparent() const static void lcl_PaintReplacement( const SwRect &rRect, const SwViewShell &rSh ) { - const Bitmap& rBmp = const_cast<SwViewShell&>(rSh).GetReplacementBitmap(false); + const Bitmap& rBmp = const_cast<SwViewShell&>(rSh).GetReplacementBitmap(); vcl::Font aFont(rSh.GetOut()->GetFont() ); Graphic::DrawEx(*rSh.GetOut(), OUString(), aFont, BitmapEx(rBmp), rRect.Pos(), rRect.SSize()); } diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 1e9ee0218893..9985cc0e5f0b 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -2927,16 +2927,16 @@ sal_Int32 SwViewShell::GetPageNumAndSetOffsetForPDF( OutputDevice& rOut, const S return nRet; } -// --> PB 2007-05-30 #146850# -const Bitmap& SwViewShell::GetReplacementBitmap( bool bIsErrorState ) +const Bitmap& SwViewShell::GetErrorBitmap() { - if (bIsErrorState) - { - if (maErrorBmp.IsEmpty()) - maErrorBmp = Bitmap(RID_GRAPHIC_ERRORBMP); - return maErrorBmp; - } + if (maErrorBmp.IsEmpty()) + maErrorBmp = Bitmap(RID_GRAPHIC_ERRORBMP); + return maErrorBmp; +} +// --> PB 2007-05-30 #146850# +const Bitmap& SwViewShell::GetReplacementBitmap() +{ if (maReplaceBmp.IsEmpty()) maReplaceBmp = Bitmap(RID_GRAPHIC_REPLACEBMP); return maReplaceBmp;
