diff options
author | Jim Raykowski <raykowj@gmail.com> | 2021-12-15 20:49:13 -0900 |
---|---|---|
committer | Jim Raykowski <raykowj@gmail.com> | 2021-12-18 04:44:44 +0100 |
commit | 17a4f4d5e4d49189b43e748271d2d4fa330eef9b (patch) | |
tree | a480437c5b16bc9918cc21abe1e0c5509152f041 /sw | |
parent | a25774ac230ad8c36f9c9fb99ecdda0098279f31 (diff) |
tdf#131063 Add Navigate on select expert option
Enhancement option to scroll the selected entry in Writer Navigator
into the document view.
Change-Id: I5c19a2e6a3a204a28723c3e1dfb15167dcb77c74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126906
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/inc/navicfg.hxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/utlui/content.cxx | 5 | ||||
-rw-r--r-- | sw/source/uibase/utlui/navicfg.cxx | 19 |
3 files changed, 25 insertions, 3 deletions
diff --git a/sw/source/uibase/inc/navicfg.hxx b/sw/source/uibase/inc/navicfg.hxx index 782bdfaf27b3..e36d45e10302 100644 --- a/sw/source/uibase/inc/navicfg.hxx +++ b/sw/source/uibase/inc/navicfg.hxx @@ -47,6 +47,7 @@ class SwNavigationConfig final : public utl::ConfigItem bool m_bIsDrawingObjectTracking; bool m_bIsFieldTracking; bool m_bIsFootnoteTracking; + bool m_bIsNavigateOnSelect; static css::uno::Sequence<OUString> GetPropertyNames(); @@ -56,6 +57,7 @@ public: SwNavigationConfig(); virtual ~SwNavigationConfig() override; + void Load(); virtual void Notify( const css::uno::Sequence< OUString >& aPropertyNames ) override; ContentTypeId GetRootType()const {return m_nRootType;} @@ -237,6 +239,8 @@ public: m_bIsFootnoteTracking = bSet; } } + + bool IsNavigateOnSelect() const {return m_bIsNavigateOnSelect;} }; #endif diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 2022dd00b792..e29ec40cab33 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -4851,6 +4851,11 @@ void SwContentTree::ShowActualView() IMPL_LINK_NOARG(SwContentTree, SelectHdl, weld::TreeView&, void) { + if (m_pConfig->IsNavigateOnSelect()) + { + ContentDoubleClickHdl(*m_xTreeView); + grab_focus(); + } Select(); } diff --git a/sw/source/uibase/utlui/navicfg.cxx b/sw/source/uibase/utlui/navicfg.cxx index d941f5fe3e4d..f06478cf9bbd 100644 --- a/sw/source/uibase/utlui/navicfg.cxx +++ b/sw/source/uibase/utlui/navicfg.cxx @@ -51,7 +51,8 @@ Sequence<OUString> SwNavigationConfig::GetPropertyNames() OUString("CommentTracking"), OUString("DrawingObjectTracking"), OUString("FieldTracking"), - OUString("FootnoteTracking")}; + OUString("FootnoteTracking"), + OUString("NavigateOnSelect")}; } SwNavigationConfig::SwNavigationConfig() : @@ -76,7 +77,14 @@ SwNavigationConfig::SwNavigationConfig() : m_bIsCommentTracking(true), m_bIsDrawingObjectTracking(true), m_bIsFieldTracking(true), - m_bIsFootnoteTracking(true) + m_bIsFootnoteTracking(true), + m_bIsNavigateOnSelect(false) +{ + Load(); + EnableNotification(GetPropertyNames()); +} + +void SwNavigationConfig::Load() { Sequence<OUString> aNames = GetPropertyNames(); Sequence<Any> aValues = GetProperties(aNames); @@ -134,6 +142,7 @@ SwNavigationConfig::SwNavigationConfig() : case 18: m_bIsDrawingObjectTracking = *o3tl::doAccess<bool>(pValues[nProp]); break; case 19: m_bIsFieldTracking = *o3tl::doAccess<bool>(pValues[nProp]); break; case 20: m_bIsFootnoteTracking = *o3tl::doAccess<bool>(pValues[nProp]); break; + case 21: m_bIsNavigateOnSelect = *o3tl::doAccess<bool>(pValues[nProp]); break; } } } @@ -174,11 +183,15 @@ void SwNavigationConfig::ImplCommit() case 18: pValues[nProp] <<= m_bIsDrawingObjectTracking; break; case 19: pValues[nProp] <<= m_bIsFieldTracking; break; case 20: pValues[nProp] <<= m_bIsFootnoteTracking; break; + case 21: pValues[nProp] <<= m_bIsNavigateOnSelect; break; } } PutProperties(aNames, aValues); } -void SwNavigationConfig::Notify( const css::uno::Sequence< OUString >& ) {} +void SwNavigationConfig::Notify( const css::uno::Sequence< OUString >& ) +{ + Load(); +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |