diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2025-01-18 10:04:33 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2025-01-18 12:02:54 +0100 |
commit | 8b7dfd32f417652087e3d880bcbf88bc2b4d2676 (patch) | |
tree | 185ec8158bf6cdef39530a5a333da7f453883d54 /vcl/source | |
parent | b5419f147deffb40410ae50ef3f474dfe8c7d525 (diff) |
vcl: Dereferencing NULL pointer 'pData'
After
commit a108fce773d46441e30dcc14abe29751410ae4ed
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Fri Jan 17 14:18:30 2025 +0100
tdf#163186 qt: Show menu item tooltips
C: /cygwin/home/tdf/lode/jenkins/workspace/lo_tb_master_win_analyze/vcl/source/window/menu.cxx(1144): error C2220: the following warning is treated as an error
C: \cygwin\home\tdf\lode\jenkins\workspace\lo_tb_master_win_analyze\vcl\source\window\menu.cxx(1142) : warning C6011: Dereferencing NULL pointer 'pData'. : Lines: 1137, 1139, 1142
Change-Id: I62e8462fcff83817f876489a10bd010e246a1d01
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/180430
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/window/menu.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index f7032281f7b2..75936aed46ca 100644 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -1137,10 +1137,12 @@ void Menu::SetTipHelpText( sal_uInt16 nItemId, const OUString& rStr ) MenuItemData* pData = pItemList->GetData( nItemId ); if ( pData ) + { pData->aTipHelpText = rStr; - if (ImplGetSalMenu() && pData->pSalMenuItem) - ImplGetSalMenu()->SetItemTooltip(pData->pSalMenuItem.get(), rStr); + if (ImplGetSalMenu() && pData->pSalMenuItem) + ImplGetSalMenu()->SetItemTooltip(pData->pSalMenuItem.get(), rStr); + } } OUString Menu::GetTipHelpText( sal_uInt16 nItemId ) const |