summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorStephan Bergmann <stephan.bergmann@allotropia.de>2024-04-04 09:53:34 +0200
committerStephan Bergmann <stephan.bergmann@allotropia.de>2024-04-04 14:14:26 +0200
commit219dd67d6ad96e1c05e92e36583391946143dba6 (patch)
tree74ec40b487b006eb85b3b758c81f6fed9e569445 /sfx2
parent41581fe7d782f261c19594c89875666f99c91af1 (diff)
-Werror=maybe-uninitialized
...as reported at least with some recent GCC 14 trunk. Lets assume that those calls to GetWindowPos are never meant to fail. (If it turns out that they can fail after all, the code would presumably need some modifications to mitigate the uninitialized reads from nL/nP.) Change-Id: I7695d3e54de2bf5d1e91b32cfdc84e994ccdd57d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165783 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/splitwin.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx
index 210a9dbeaaff..b9597eacfc79 100644
--- a/sfx2/source/dialog/splitwin.cxx
+++ b/sfx2/source/dialog/splitwin.cxx
@@ -36,6 +36,7 @@
#include <sfx2/dockwin.hxx>
#include <o3tl/string_view.hxx>
+#include <cassert>
#include <memory>
#include <vector>
#include <utility>
@@ -456,7 +457,8 @@ void SfxSplitWindow::InsertWindow( SfxDockingWindow* pDockWin, const Size& rSize
if ( bNewLine && !pFoundDock )
{
// Not known until now in which real line it is located
- GetWindowPos( rDock.pWin, nL, nPos );
+ [[maybe_unused]] auto const ok = GetWindowPos( rDock.pWin, nL, nPos );
+ assert(ok);
nLine = static_cast<short>(nL);
}
@@ -544,7 +546,8 @@ void SfxSplitWindow::MoveWindow( SfxDockingWindow* pDockWin, const Size& rSize,
{
sal_uInt16 nL, nP;
- GetWindowPos( pDockWin, nL, nP );
+ [[maybe_unused]] auto const ok = GetWindowPos( pDockWin, nL, nP );
+ assert(ok);
if ( nLine > nL && GetItemCount( GetItemId( nL ) ) == 1 )
{