sfx2/source/dialog/splitwin.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
New commits: commit 219dd67d6ad96e1c05e92e36583391946143dba6 Author: Stephan Bergmann <stephan.bergm...@allotropia.de> AuthorDate: Thu Apr 4 09:53:34 2024 +0200 Commit: Stephan Bergmann <stephan.bergm...@allotropia.de> CommitDate: Thu Apr 4 14:14:26 2024 +0200 -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.bergm...@allotropia.de> 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 ) {