summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2024-04-03 23:26:49 -0800
committerJim Raykowski <raykowj@gmail.com>2024-04-05 17:44:18 +0200
commit186c4cd328830c9b3a1769ea7c6a0738e019dae7 (patch)
treeff9d25c52306bc3decc65ea184eb21074febecae
parentbe938f2fb1c0a18658b4170396a22c64b77bf646 (diff)
SdNavigator: fix lcl_select_marked_object page selection
...which makes invalidation of SID_NAVIGATOR_PAGENAME in InitTreeLB unnecessary. Also rename lcl_select_marked_object lcl_select_marked_objects. Change-Id: I6afe0cc59808a476dcb1496e23dbb1b54ec570e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165780 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
-rw-r--r--sd/source/ui/dlg/navigatr.cxx19
1 files changed, 10 insertions, 9 deletions
diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index cdbfcac41382..8b955ba07035 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -50,6 +50,8 @@
#include <vcl/commandevent.hxx>
#include <comphelper/lok.hxx>
+#include <sdpage.hxx>
+
/**
* SdNavigatorWin - FloatingWindow
*/
@@ -136,7 +138,7 @@ SdNavigatorWin::~SdNavigatorWin()
mxLbDocs.reset();
}
-static void lcl_select_marked_object(const sd::ViewShell* pViewShell, SdPageObjsTLV* pTlbObjects)
+static void lcl_select_marked_objects(sd::ViewShell* pViewShell, SdPageObjsTLV* pTlbObjects)
{
if (const SdrView* pView = pViewShell->GetDrawView())
{
@@ -148,7 +150,10 @@ static void lcl_select_marked_object(const sd::ViewShell* pViewShell, SdPageObjs
pTlbObjects->SelectEntry(rMarkedObject);
}
else
- pTlbObjects->SelectEntry(pViewShell->GetName());
+ {
+ if (SdPage* pPage = pViewShell->GetActualPage())
+ pTlbObjects->SelectEntry(pPage->GetName());
+ }
}
}
@@ -185,7 +190,7 @@ void SdNavigatorWin::FreshTree( const SdDrawDocument* pDoc )
}
if (pViewShell)
- lcl_select_marked_object(pViewShell, mxTlbObjects.get());
+ lcl_select_marked_objects(pViewShell, mxTlbObjects.get());
}
void SdNavigatorWin::InitTreeLB( const SdDrawDocument* pDoc )
@@ -251,11 +256,7 @@ void SdNavigatorWin::InitTreeLB( const SdDrawDocument* pDoc )
}
if (pViewShell)
- lcl_select_marked_object(pViewShell, mxTlbObjects.get());
-
- SfxViewFrame* pViewFrame = ( ( pViewShell && pViewShell->GetViewFrame() ) ? pViewShell->GetViewFrame() : SfxViewFrame::Current() );
- if( pViewFrame )
- pViewFrame->GetBindings().Invalidate(SID_NAVIGATOR_PAGENAME, true, true);
+ lcl_select_marked_objects(pViewShell, mxTlbObjects.get());
}
/**
@@ -589,7 +590,7 @@ IMPL_LINK( SdNavigatorWin, ShapeFilterCallback, const OUString&, rIdent, void )
{
pFrameView->SetIsNavigatorShowingAllShapes(bShowAllShapes);
}
- lcl_select_marked_object(pViewShell, mxTlbObjects.get());
+ lcl_select_marked_objects(pViewShell, mxTlbObjects.get());
}
}
}