summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2023-05-21 15:39:11 -0800
committerJim Raykowski <raykowj@gmail.com>2023-05-30 21:06:26 +0200
commit60e32969a98cad348cf8e55e8f93abc3d6e9c70c (patch)
treed7269b8fb17ad936ab3b3841ee4d91ba5173732c /sd
parent8b5f9debcdb861589c6c9b01858388603dec0d24 (diff)
tdf#155393 SdNavigator: Enhancement to navigate in Notes view
Change-Id: Icea71217fa5ffadc637bd7d9b8cae2fa18ec93bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152075 Tested-by: Jenkins Reviewed-by: Stéphane Guillou <stephane.guillou@libreoffice.org> Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org> Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/dlg/navigatr.cxx1
-rw-r--r--sd/source/ui/dlg/sdtreelb.cxx35
2 files changed, 33 insertions, 3 deletions
diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index 2bdfaefde410..ca6bc100cad9 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -778,6 +778,7 @@ void SdNavigatorControllerItem::StateChangedAtToolBoxControl( sal_uInt16 nSId,
static_cast<::sd::DrawViewShell *>(pDrawDocShell->GetViewShell());
if (pDrawViewShell)
{
+ pNavigatorWin->FreshTree(pDrawDocShell->GetDoc());
bool bEditModePage(pDrawViewShell->GetEditMode() == EditMode::Page);
pNavigatorWin->mxToolbox->set_sensitive(bEditModePage);
pNavigatorWin->mxLbDocs->set_sensitive(bEditModePage);
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index e39099a61675..45b078df0cb0 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -56,9 +56,21 @@
#include <vcl/commandevent.hxx>
#include <svx/svdview.hxx>
+#include <DrawViewShell.hxx>
using namespace com::sun::star;
+namespace {
+
+sd::DrawViewShell* lcl_getDrawViewShell(const SdDrawDocument* pDoc)
+{
+ if (!pDoc || !pDoc->GetDocSh())
+ return nullptr;
+ return static_cast<sd::DrawViewShell*>(pDoc->GetDocSh()->GetViewShell());
+}
+
+}
+
bool SdPageObjsTLV::bIsInDrag = false;
bool SdPageObjsTLV::IsInDrag()
@@ -251,6 +263,13 @@ bool SdPageObjsTLV::IsEqualToDoc( const SdDrawDocument* pInDoc )
if( !m_pDoc )
return false;
+ sd::DrawViewShell* pDrawViewShell = lcl_getDrawViewShell(m_pDoc);
+ if (!pDrawViewShell)
+ return false;
+ PageKind eDrawViewShellPageKind = pDrawViewShell->GetPageKind();
+ if (eDrawViewShellPageKind != PageKind::Standard && eDrawViewShellPageKind != PageKind::Notes)
+ return false;
+
std::unique_ptr<weld::TreeIter> xEntry(m_xTreeView->make_iterator());
if (!m_xTreeView->get_iter_first(*xEntry))
xEntry.reset();
@@ -262,7 +281,7 @@ bool SdPageObjsTLV::IsEqualToDoc( const SdDrawDocument* pInDoc )
while( nPage < nMaxPages )
{
const SdPage* pPage = static_cast<const SdPage*>( m_pDoc->GetPage( nPage ) );
- if( pPage->GetPageKind() == PageKind::Standard )
+ if (pPage->GetPageKind() == eDrawViewShellPageKind)
{
bool bRet = IsEqualToShapeList(xEntry, *pPage, pPage->GetName());
if (!bRet)
@@ -1247,11 +1266,21 @@ void SdPageObjsTLV::Fill(const SdDrawDocument* pInDoc, bool bAllPages, const OUS
sal_uInt16 nPage = 0;
const sal_uInt16 nMaxPages = m_pDoc->GetPageCount();
+ sd::DrawViewShell* pDrawViewShell = lcl_getDrawViewShell(m_pDoc);
+ if (!pDrawViewShell)
+ return;
+ PageKind eDrawViewShellPageKind = pDrawViewShell->GetPageKind();
+
while( nPage < nMaxPages )
{
const SdPage* pPage = static_cast<const SdPage*>( m_pDoc->GetPage( nPage ) );
- if( (m_bShowAllPages || pPage->GetPageKind() == PageKind::Standard)
- && (pPage->GetPageKind() != PageKind::Handout) ) //#94954# never list the normal handout page ( handout-masterpage is used instead )
+ PageKind ePagePageKind = pPage->GetPageKind();
+ if ((m_bShowAllPages ||
+ (ePagePageKind == PageKind::Standard &&
+ eDrawViewShellPageKind == PageKind::Standard) ||
+ (ePagePageKind == PageKind::Notes &&
+ eDrawViewShellPageKind == PageKind::Notes)) &&
+ ePagePageKind != PageKind::Handout) //#94954# never list the normal handout page ( handout-masterpage is used instead )
{
bool bPageExcluded = pPage->IsExcluded();