sfx2/source/dialog/splitwin.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 73884e28faeb457c01b80051a701c073112ad564
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Fri Aug 23 10:56:27 2024 +0200
Commit:     Julien Nabet <serval2...@yahoo.fr>
CommitDate: Fri Aug 23 13:46:49 2024 +0200

    -Werror=maybe-uninitialized in sfx2
    
    /home/julien/lo/libo_perf/sfx2/source/dialog/splitwin.cxx: In member 
function ‘void SfxSplitWindow::InsertWindow(SfxDockingWindow*, const Size&)’:
    /home/julien/lo/libo_perf/sfx2/source/dialog/splitwin.cxx:462:23: error: 
‘nL’ may be used uninitialized [-Werror=maybe-uninitialized]
      462 |                 nLine = static_cast<short>(nL);
          |                 ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
    /home/julien/lo/libo_perf/sfx2/source/dialog/splitwin.cxx:433:16: note: 
‘nL’ was declared here
      433 |     sal_uInt16 nL;
          |                ^~
    /home/julien/lo/libo_perf/sfx2/source/dialog/splitwin.cxx: In member 
function ‘void SfxSplitWindow::MoveWindow(SfxDockingWindow*, const Size&, 
sal_uInt16, sal_uInt16, bool)’:
    /home/julien/lo/libo_perf/sfx2/source/dialog/splitwin.cxx:552:21: error: 
‘nL’ may be used uninitialized [-Werror=maybe-uninitialized]
      552 |     if ( nLine > nL && GetItemCount( GetItemId( nL ) ) == 1 )
          |          ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/julien/lo/libo_perf/sfx2/source/dialog/splitwin.cxx:548:16: note: 
‘nL’ was declared here
      548 |     sal_uInt16 nL, nP;
          |                ^~
    
    Change-Id: I816ec49fe2c63e4f448ae83251d3a24b08383903
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172306
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>
    Tested-by: Jenkins

diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx
index b9597eacfc79..fcdb5a548817 100644
--- a/sfx2/source/dialog/splitwin.cxx
+++ b/sfx2/source/dialog/splitwin.cxx
@@ -430,7 +430,6 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* 
pDockWin, const Size& rSize
 */
 {
     short nLine = -1;  // so that the first window cab set nline to 0
-    sal_uInt16 nL;
     sal_uInt16 nPos = 0;
     bool bNewLine = true;
     bool bSaveConfig = false;
@@ -457,6 +456,7 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* 
pDockWin, const Size& rSize
             if ( bNewLine && !pFoundDock )
             {
                 // Not known until now in which real line it is located
+                sal_uInt16 nL = 0;
                 [[maybe_unused]] auto const ok = GetWindowPos( rDock.pWin, nL, 
nPos );
                 assert(ok);
                 nLine = static_cast<short>(nL);
@@ -545,7 +545,8 @@ void SfxSplitWindow::MoveWindow( SfxDockingWindow* 
pDockWin, const Size& rSize,
 */
 
 {
-    sal_uInt16 nL, nP;
+    sal_uInt16 nL = 0;
+    sal_uInt16 nP = 0;
     [[maybe_unused]] auto const ok = GetWindowPos( pDockWin, nL, nP );
     assert(ok);
 

Reply via email to