summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-02-04 21:04:44 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-02-04 21:05:36 +0000
commit535f34bba60e06d390a6f3802072b16a9841bc4e (patch)
treeb0b93de6d7a6b143d0aa0812745e3025e3589cc9
parentaf6cd2356afd1212acc529f796f8043ad7e278e6 (diff)
Resolves: tdf#Crash when clicking the Reminder icon on the Navigation toolbar
the Parent window isn't a SwScrollNaviPopup anymore Change-Id: I5c539d125aac28bfee0beb842ff2df001e19c945
-rw-r--r--sw/source/uibase/inc/workctrl.hxx13
-rw-r--r--sw/source/uibase/ribbar/workctrl.cxx6
2 files changed, 13 insertions, 6 deletions
diff --git a/sw/source/uibase/inc/workctrl.hxx b/sw/source/uibase/inc/workctrl.hxx
index 493b164d1962..6bb9c1f5377c 100644
--- a/sw/source/uibase/inc/workctrl.hxx
+++ b/sw/source/uibase/inc/workctrl.hxx
@@ -110,14 +110,21 @@ public:
DECL_LINK(PopupHdl, PopupMenu*);
};
+class SwScrollNaviPopup;
+
class SwScrollNaviToolBox : public ToolBox
{
+ SwScrollNaviPopup *m_pNaviPopup;
+
virtual void MouseButtonUp( const MouseEvent& rMEvt ) SAL_OVERRIDE;
virtual void RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE;
- public:
- SwScrollNaviToolBox(vcl::Window* pParent, WinBits nWinStyle ) :
- ToolBox(pParent, nWinStyle ) {}
+public:
+ SwScrollNaviToolBox(vcl::Window* pParent, SwScrollNaviPopup* pNaviPopup, WinBits nWinStyle)
+ : ToolBox(pParent, nWinStyle)
+ , m_pNaviPopup(pNaviPopup)
+ {
+ }
};
class SwScrollNaviPopup : public SfxPopupWindow
diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx
index 5317632688d3..09ee4a3dd3bf 100644
--- a/sw/source/uibase/ribbar/workctrl.cxx
+++ b/sw/source/uibase/ribbar/workctrl.cxx
@@ -394,7 +394,7 @@ SwScrollNaviPopup::SwScrollNaviPopup(sal_uInt16 nId, const Reference< XFrame >&
"modules/swriter/ui/floatingnavigation.ui", rFrame),
aIList(SW_RES(IL_VALUES))
{
- m_pToolBox = new SwScrollNaviToolBox(get<vcl::Window>("box"), 0);
+ m_pToolBox = new SwScrollNaviToolBox(get<vcl::Window>("box"), this, 0);
get(m_pInfoField, "label");
sal_uInt16 i;
@@ -502,8 +502,8 @@ IMPL_LINK(SwScrollNaviPopup, SelectHdl, ToolBox*, pSet)
void SwScrollNaviToolBox::MouseButtonUp( const MouseEvent& rMEvt )
{
ToolBox::MouseButtonUp(rMEvt);
- if ( static_cast<SwScrollNaviPopup*>(GetParent())->IsInPopupMode() )
- static_cast<SwScrollNaviPopup*>(GetParent())->EndPopupMode( FLOATWIN_POPUPMODEEND_CLOSEALL );
+ if (m_pNaviPopup->IsInPopupMode())
+ m_pNaviPopup->EndPopupMode(FLOATWIN_POPUPMODEEND_CLOSEALL);
}
void SwScrollNaviToolBox::RequestHelp( const HelpEvent& rHEvt )