[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - sd/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Nov 19 16:24:25 UTC 2018


 sd/source/ui/dlg/navigatr.cxx |    2 +-
 sd/source/ui/dlg/sdtreelb.cxx |   17 ++++++++++-------
 sd/source/ui/inc/sdtreelb.hxx |    7 ++-----
 3 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 63496a57b408ae18558208e4179c7b4624d5a44e
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Nov 19 12:55:16 2018 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Nov 19 17:23:55 2018 +0100

    tdf#101072 mpParent isn't SdNavigatorWin
    
    Change-Id: Ibfb60302ce14f0a3492bf4d9311fb5e598f25719
    Reviewed-on: https://gerrit.libreoffice.org/63569
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

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;}


More information about the Libreoffice-commits mailing list