diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-11-19 12:55:16 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-11-19 15:47:16 +0100 |
commit | c79653e33d018de7dd89b41e4206260b6a0767e9 (patch) | |
tree | b050ca1eb1eff01b72a3e7ad45fdc6589e46d572 /sd/source | |
parent | 221caface804a0db8773bc77f0ffbed073f69d6b (diff) |
tdf#101072 mpParent isn't SdNavigatorWin
Change-Id: Ibfb60302ce14f0a3492bf4d9311fb5e598f25719
Reviewed-on: https://gerrit.libreoffice.org/63567
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd/source')
-rw-r--r-- | sd/source/ui/dlg/navigatr.cxx | 2 | ||||
-rw-r--r-- | sd/source/ui/dlg/sdtreelb.cxx | 17 | ||||
-rw-r--r-- | sd/source/ui/inc/sdtreelb.hxx | 7 |
3 files changed, 13 insertions, 13 deletions
diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index bf0169a1ee1c..6e573c8f259f 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -96,7 +96,7 @@ SdNavigatorWin::SdNavigatorWin(vcl::Window* pParent, SfxBindings* pInBindings) // set focus to listbox, otherwise it is in the toolbox which is only useful // for keyboard navigation maTlbObjects->GrabFocus(); - maTlbObjects->SetSdNavigatorWinFlag(true); + maTlbObjects->SetSdNavigator(this); // DragTypeListBox maLbDocs->SetSelectHdl( LINK( this, SdNavigatorWin, SelectDocumentHdl ) ); diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index c2e3ce59bb4e..5f462ef08a82 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -194,8 +194,6 @@ SotClipboardFormatId SdPageObjsTLB::SdPageObjsTransferable::GetListBoxDropFormat SdPageObjsTLB::SdPageObjsTLB( vcl::Window* pParentWin, WinBits nStyle ) : SvTreeListBox ( pParentWin, nStyle ) -, bisInSdNavigatorWin ( false ) -, mpParent ( pParentWin ) , mpDoc ( nullptr ) , mpBookmarkDoc ( nullptr ) , mpMedium ( nullptr ) @@ -226,6 +224,11 @@ SdPageObjsTLB::SdPageObjsTLB( vcl::Window* pParentWin, WinBits nStyle ) m_pAccel = ::svt::AcceleratorExecute::createAcceleratorHelper(); } +void SdPageObjsTLB::SetSdNavigator(SdNavigatorWin* pNavigator) +{ + mpNavigator = pNavigator; +} + void SdPageObjsTLB::SetViewFrame( SfxViewFrame* pViewFrame ) { mpFrame = pViewFrame; @@ -247,7 +250,7 @@ void SdPageObjsTLB::dispose() else // no document was created from mpMedium, so this object is still the owner of it delete mpMedium; - mpParent.clear(); + mpNavigator.clear(); mpDropNavWin.clear(); m_pAccel.reset(); SvTreeListBox::dispose(); @@ -947,7 +950,7 @@ void SdPageObjsTLB::KeyInput( const KeyEvent& rKEvt ) } else if (rKEvt.GetKeyCode().GetCode() == KEY_SPACE) { - if(bisInSdNavigatorWin) + if (mpNavigator) { SvTreeListEntry* pNewEntry = GetCurEntry(); if (!pNewEntry) @@ -988,7 +991,7 @@ void SdPageObjsTLB::StartDrag( sal_Int8, const Point& rPosPixel) if (pEntry != nullptr && pNavWin !=nullptr - && pNavWin == mpParent + && pNavWin == mpNavigator && pNavWin->GetNavigatorDragType() != NAVIGATOR_DRAGTYPE_NONE ) { // Mark only the children of the page under the mouse as drop @@ -1189,13 +1192,13 @@ sal_Int8 SdPageObjsTLB::ExecuteDrop( const ExecuteDropEvent& rEvt ) pNavWin = pWnd ? static_cast<SdNavigatorWin*>(pWnd->GetContextWindow(SD_MOD())) : nullptr; } - if( pNavWin && ( pNavWin == mpParent ) ) + if( pNavWin && ( pNavWin == mpNavigator ) ) { TransferableDataHelper aDataHelper( rEvt.maDropEvent.Transferable ); OUString aFile; if( aDataHelper.GetString( SotClipboardFormatId::SIMPLE_FILE, aFile ) && - static_cast<SdNavigatorWin*>(mpParent.get())->InsertFile( aFile ) ) + mpNavigator->InsertFile( aFile ) ) { nRet = rEvt.mnAction; } diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx index 20e0a41ca917..5636a0227abd 100644 --- a/sd/source/ui/inc/sdtreelb.hxx +++ b/sd/source/ui/inc/sdtreelb.hxx @@ -58,9 +58,6 @@ class SD_DLLPUBLIC SdPageObjsTLB final : public SvTreeListBox { static bool SAL_DLLPRIVATE bIsInDrag; ///< static, in the case the navigator is deleted in ExecuteDrag - // set contenttree in SdNavigatorWin - bool bisInSdNavigatorWin; - ::std::unique_ptr< ::svt::AcceleratorExecute> m_pAccel; public: @@ -119,7 +116,7 @@ public: private: - VclPtr<vcl::Window> mpParent; + VclPtr<SdNavigatorWin> mpNavigator; const SdDrawDocument* mpDoc; SdDrawDocument* mpBookmarkDoc; SfxMedium* mpMedium; @@ -210,7 +207,7 @@ public: OUString GetSelectedEntry(); //Mark Current Entry - void SetSdNavigatorWinFlag(bool isInSdNavigatorWin){bisInSdNavigatorWin =isInSdNavigatorWin;}; + void SetSdNavigator(SdNavigatorWin* pNavigator); void Clear(); void SetSaveTreeItemStateFlag(bool bState){mbSaveTreeItemState = bState;} |