sw/source/core/crsr/pam.cxx   |   16 ++++++++--------
 sw/source/core/inc/pamtyp.hxx |    6 +++---
 vcl/win/gdi/salbmp.cxx        |   10 ----------
 3 files changed, 11 insertions(+), 21 deletions(-)

New commits:
commit bb9180f0a6a7082de202eb7d4697242e7f24ec54
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sun Jan 19 20:11:21 2025 +0200
Commit:     Noel Grandin <noelgran...@gmail.com>
CommitDate: Tue Jan 21 06:20:27 2025 +0100

    pass by reference to GoEndOfSection/GoStartOfSection
    
    instead of pointer, since we always de-ref the pointer
    
    Change-Id: I0193f77f9019fe5e57a6d56765917bb6c1f3f560
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180523
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index 15e96d25574f..fce732b9bf51 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -1135,11 +1135,11 @@ void GoStartSection( SwPosition * pPos )
     pPos->AssignStartIndex(*pPos->GetNode().GetContentNode());
 }
 
-void GoStartOfSection( SwPosition * pPos )
+void GoStartOfSection( SwPosition& rPos )
 {
     // jump to section's beginning
-    SwNodes::GoStartOfSection( &pPos->nNode );
-    pPos->nContent.Assign(pPos->GetNode().GetContentNode(), 0);
+    SwNodes::GoStartOfSection( &rPos.nNode );
+    rPos.nContent.Assign(rPos.GetNode().GetContentNode(), 0);
 }
 
 /// go to the end of the current base section
@@ -1160,11 +1160,11 @@ void GoEndSection( SwPosition * pPos )
         pPos->AssignEndIndex(*pCNd);
 }
 
-void GoEndOfSection( SwPosition * pPos )
+void GoEndOfSection( SwPosition& rPos )
 {
-    SwNodes::GoEndOfSection( &pPos->nNode );
-    SwContentNode* pCNd = pPos->nNode.GetNode().GetContentNode();
-    pPos->nContent.Assign(pCNd, pCNd ? pCNd->Len() : 0);
+    SwNodes::GoEndOfSection( &rPos.nNode );
+    SwContentNode* pCNd = rPos.nNode.GetNode().GetContentNode();
+    rPos.nContent.Assign(pCNd, pCNd ? pCNd->Len() : 0);
 }
 
 bool GoInDoc( SwPaM & rPam, SwMoveFnCollection const & fnMove )
@@ -1277,7 +1277,7 @@ bool GoCurrSection( SwPaM & rPam, SwMoveFnCollection 
const & fnMove )
 {
     SwPosition& rPos = *rPam.GetPoint();
     SwPosition aSavePos( rPos ); // position for comparison
-    (fnMove.fnSection)( &rPos );
+    (fnMove.fnSection)( rPos );
     SwContentNode *pNd;
     if( nullptr == ( pNd = rPos.GetNode().GetContentNode()) &&
         nullptr == ( pNd = (*fnMove.fnPos)( &rPos, true )) )
diff --git a/sw/source/core/inc/pamtyp.hxx b/sw/source/core/inc/pamtyp.hxx
index 33c920e41ebb..d269e3f10d46 100644
--- a/sw/source/core/inc/pamtyp.hxx
+++ b/sw/source/core/inc/pamtyp.hxx
@@ -49,8 +49,8 @@ void GoStartDoc( SwPosition*);
 void GoEndDoc( SwPosition*);
 void GoStartSection( SwPosition*);
 void GoEndSection( SwPosition*);
-void GoStartOfSection( SwPosition*);
-void GoEndOfSection( SwPosition*);
+void GoStartOfSection( SwPosition& );
+void GoEndOfSection( SwPosition& );
 const SwTextAttr* GetFrwrdTextHint( const SwpHints&, size_t&, sal_Int32 );
 const SwTextAttr* GetBkwrdTextHint( const SwpHints&, size_t&, sal_Int32 );
 
@@ -68,7 +68,7 @@ typedef bool (SwPosition::*CmpOp)( const SwPosition& ) const;
 typedef const SwTextAttr* (*GetHint)( const SwpHints&, size_t&, sal_Int32 );
 typedef bool (utl::TextSearch::*SearchText)( const OUString&, sal_Int32*,
                     sal_Int32*, css::util::SearchResult* );
-typedef void (*MvSection)( SwPosition * );
+typedef void (*MvSection)( SwPosition& );
 
 struct SwMoveFnCollection
 {
commit 5b4b4c0e691ede48f50725f4f174a0e1ac7b3668
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Mon Jan 20 21:08:44 2025 +0200
Commit:     Noel Grandin <noelgran...@gmail.com>
CommitDate: Tue Jan 21 06:20:18 2025 +0100

    dont store wrong bitcount in WinSalBitmap
    
    There is no point in lying to ourselves and saving a different bitcount
    from the one that is actually reported.
    This code dates back to "initial import" so no idea why it tries
    to do this.
    
    Change-Id: Ia5a88d28c85436b67b0225dbc81d83e74a1d3218
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180524
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/vcl/win/gdi/salbmp.cxx b/vcl/win/gdi/salbmp.cxx
index 780f91ee8fdb..9110e02e2923 100644
--- a/vcl/win/gdi/salbmp.cxx
+++ b/vcl/win/gdi/salbmp.cxx
@@ -442,9 +442,6 @@ bool WinSalBitmap::Create( HANDLE hBitmap )
             maSize = Size( pBIH->biWidth, pBIH->biHeight );
             mnBitCount = pBIH->biBitCount;
 
-            if( mnBitCount )
-                mnBitCount = ( mnBitCount <= 1 ) ? 1 : ( mnBitCount <= 4 ) ? 4 
: ( mnBitCount <= 8 ) ? 8 : 24;
-
             GlobalUnlock( mhDIB );
         }
         else
@@ -458,13 +455,6 @@ bool WinSalBitmap::Create( HANDLE hBitmap )
         {
             maSize = Size( aDDBInfo.bmWidth, aDDBInfo.bmHeight );
             mnBitCount = aDDBInfo.bmPlanes * aDDBInfo.bmBitsPixel;
-
-            if( mnBitCount )
-            {
-                mnBitCount = ( mnBitCount <= 1 ) ? 1 :
-                             ( mnBitCount <= 4 ) ? 4 :
-                             ( mnBitCount <= 8 ) ? 8 : 24;
-            }
         }
         else
         {

Reply via email to