Kaydet (Commit) 5780a495 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Avoid unnecessary, wrong downcast

...from SvLBoxItem to SvLBoxString.  In a UBSan build, hovering the mouse over
the Navigator dialog in Calc caused

> sc/source/ui/navipi/content.cxx:727:39: runtime error: downcast of address 0x6030012a2820 which does not point to an object of type 'SvLBoxString'
> 0x6030012a2820: note: object is of type 'SvLBoxContextBmp'
>  15 02 80 76  50 8c 29 97 22 7f 00 00  00 be be be be be be be  10 d1 3a 01 40 60 00 00  00 00 00 00
>               ^~~~~~~~~~~~~~~~~~~~~~~
>               vptr for 'SvLBoxContextBmp'
>  #0 in ScContentTree::RequestHelp(HelpEvent const&) at sc/source/ui/navipi/content.cxx:727:39
>  #1 in ImplHandleMouseHelpRequest(vcl::Window*, Point const&) at vcl/source/window/winproc.cxx:183:25
>  #2 in ImplHandleMouseEvent(VclPtr<vcl::Window> const&, MouseNotifyEvent, bool, long, long, unsigned long, unsigned short, MouseEventModifiers) at vcl/source/window/winproc.cxx:729:13
>  #3 in ImplHandleSalMouseMove(vcl::Window*, SalMouseEvent const*) at vcl/source/window/winproc.cxx:2003:12
[...]

Change-Id: Iea5cda6e3be5c759eb71ad3100dc9b1870bda460
Reviewed-on: https://gerrit.libreoffice.org/72897
Tested-by: Jenkins
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 23fc425f
......@@ -724,7 +724,7 @@ void ScContentTree::RequestHelp( const HelpEvent& rHEvt )
if (bRet)
{
SvLBoxTab* pTab;
SvLBoxString* pItem = static_cast<SvLBoxString*>(GetItem( pEntry, aPos.X(), &pTab ));
SvLBoxItem* pItem = GetItem( pEntry, aPos.X(), &pTab );
if( pItem )
{
aPos = GetEntryPosition( pEntry );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment