[Libreoffice-commits] core.git: editeng/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed May 19 07:47:00 UTC 2021


 editeng/source/editeng/impedit.hxx  |    2 +-
 editeng/source/editeng/impedit2.cxx |    2 +-
 editeng/source/editeng/impedit3.cxx |   14 +++++++-------
 3 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 5aa4139416d6417564e38e9db0f0062e72ce6130
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue May 18 16:43:47 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed May 19 09:46:13 2021 +0200

    ImplInitLayoutMode always deferences its OutputDevice* arg
    
    Change-Id: I3a0041c702690c495d3f245c4ac00a2f4adf3988
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115760
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 284c55bc029c..e0c61a590bd1 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -702,7 +702,7 @@ private:
                                                   tools::Long* pDXArray, sal_uInt16 n100thPercentFromMax, bool bManipulateDXArray );
     void                ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* pParaPortion, tools::Long nRemainingWidth );
 
-    void                ImplInitLayoutMode( OutputDevice* pOutDev, sal_Int32 nPara, sal_Int32 nIndex );
+    void                ImplInitLayoutMode(OutputDevice& rOutDev, sal_Int32 nPara, sal_Int32 nIndex);
     LanguageType        ImplCalcDigitLang(LanguageType eCurLang) const;
     void                ImplInitDigitMode(OutputDevice* pOutDev, LanguageType eLang);
     static OUString     convertDigits(const OUString &rString, sal_Int32 nStt, sal_Int32 nLen, LanguageType eDigitLang);
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index 012342ce4d06..88b4711baf8d 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -3157,7 +3157,7 @@ sal_uInt32 ImpEditEngine::CalcLineWidth( ParaPortion* pPortion, EditLine* pLine,
     // potentially changing both)
     GetRefDevice()->Push( PushFlags::TEXTLAYOUTMODE|PushFlags::TEXTLANGUAGE );
 
-    ImplInitLayoutMode( GetRefDevice(), nPara, -1 );
+    ImplInitLayoutMode(*GetRefDevice(), nPara, -1);
 
     SvxAdjust eJustification = GetJustification( nPara );
 
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index efc0e30ea90b..19444b9c75c0 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -691,7 +691,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
     // Saving both layout mode and language (since I'm potentially changing both)
     GetRefDevice()->Push( PushFlags::TEXTLAYOUTMODE|PushFlags::TEXTLANGUAGE );
 
-    ImplInitLayoutMode( GetRefDevice(), nPara, -1 );
+    ImplInitLayoutMode(*GetRefDevice(), nPara, -1);
 
     sal_Int32 nRealInvalidStart = nInvalidStart;
 
@@ -755,7 +755,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
     EditLine aSaveLine( *pLine );
     SvxFont aTmpFont( pNode->GetCharAttribs().GetDefFont() );
 
-    ImplInitLayoutMode( GetRefDevice(), nPara, nIndex );
+    ImplInitLayoutMode(*GetRefDevice(), nPara, nIndex);
 
     std::unique_ptr<tools::Long[]> pBuf(new tools::Long[ pNode->Len() ]);
 
@@ -3194,7 +3194,7 @@ void ImpEditEngine::Paint( OutputDevice& rOutDev, tools::Rectangle aClipRect, Po
                                 // #114278# Saving both layout mode and language (since I'm
                                 // potentially changing both)
                                 rOutDev.Push( PushFlags::TEXTLAYOUTMODE|PushFlags::TEXTLANGUAGE );
-                                ImplInitLayoutMode( &rOutDev, n, nIndex );
+                                ImplInitLayoutMode(rOutDev, n, nIndex);
                                 ImplInitDigitMode(&rOutDev, aTmpFont.GetLanguage());
 
                                 OUString aText;
@@ -4280,7 +4280,7 @@ void ImpEditEngine::ImplInitDigitMode(OutputDevice* pOutDev, LanguageType eCurLa
         pOutDev->SetDigitLanguage(ImplCalcDigitLang(eCurLang));
 }
 
-void ImpEditEngine::ImplInitLayoutMode( OutputDevice* pOutDev, sal_Int32 nPara, sal_Int32 nIndex )
+void ImpEditEngine::ImplInitLayoutMode(OutputDevice& rOutDev, sal_Int32 nPara, sal_Int32 nIndex)
 {
     bool bCTL = false;
     bool bR2L = false;
@@ -4299,7 +4299,7 @@ void ImpEditEngine::ImplInitLayoutMode( OutputDevice* pOutDev, sal_Int32 nPara,
         // it also works for issue 55927
     }
 
-    ComplexTextLayoutFlags nLayoutMode = pOutDev->GetLayoutMode();
+    ComplexTextLayoutFlags nLayoutMode = rOutDev.GetLayoutMode();
 
     // We always use the left position for DrawText()
     nLayoutMode &= ~ComplexTextLayoutFlags::BiDiRtl;
@@ -4319,12 +4319,12 @@ void ImpEditEngine::ImplInitLayoutMode( OutputDevice* pOutDev, sal_Int32 nPara,
             nLayoutMode |= ComplexTextLayoutFlags::BiDiRtl|ComplexTextLayoutFlags::TextOriginLeft;
     }
 
-    pOutDev->SetLayoutMode( nLayoutMode );
+    rOutDev.SetLayoutMode( nLayoutMode );
 
     // #114278# Also setting up digit language from Svt options
     // (cannot reliably inherit the outdev's setting)
     LanguageType eLang = Application::GetSettings().GetLanguageTag().getLanguageType();
-    ImplInitDigitMode( pOutDev, eLang );
+    ImplInitDigitMode(&rOutDev, eLang);
 }
 
 Reference < i18n::XBreakIterator > const & ImpEditEngine::ImplGetBreakIterator() const


More information about the Libreoffice-commits mailing list