summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2021-11-18 10:21:27 -0900
committerJim Raykowski <raykowj@gmail.com>2021-11-20 16:04:58 +0100
commitd3adc15ba3091fea5a90b654ee667b25797501db (patch)
treeb494e99c7f22b803ea4e79084fbf0052b861352f
parent823a351adb0384598304d597ae7f637079ca6175 (diff)
SwNavigator: Check for graphic, frame, or ole types before entering
the block that handles these in UpdateTracking Change-Id: I4b435351133b28f1fc34e2733a9d453de5c117a0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125508 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
-rw-r--r--sw/source/uibase/utlui/content.cxx52
1 files changed, 27 insertions, 25 deletions
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 36686253ff83..1d18fa291da1 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -3689,33 +3689,35 @@ void SwContentTree::UpdateTracking()
if (bTrack)
{
- {
// graphic, frame, and ole
- OUString aContentTypeName;
- if (m_pActiveShell->GetSelectionType() == SelectionType::Graphic &&
- !(m_bIsRoot && m_nRootType != ContentTypeId::GRAPHIC))
- {
- if (!m_bImageTracking) return;
- aContentTypeName = SwResId(STR_CONTENT_TYPE_GRAPHIC);
- }
- else if (m_pActiveShell->GetSelectionType() == SelectionType::Frame &&
- !(m_bIsRoot && m_nRootType != ContentTypeId::FRAME))
- {
- if (!m_bFrameTracking) return;
- aContentTypeName = SwResId(STR_CONTENT_TYPE_FRAME);
- }
- else if (m_pActiveShell->GetSelectionType() == SelectionType::Ole &&
- !(m_bIsRoot && m_nRootType != ContentTypeId::OLE))
+ if (m_pActiveShell->GetSelectionType() &
+ (SelectionType::Graphic | SelectionType::Frame | SelectionType::Ole))
{
- if (!m_bOLEobjectTracking) return;
- aContentTypeName = SwResId(STR_CONTENT_TYPE_OLE);
- }
- if (!aContentTypeName.isEmpty())
- {
- OUString aName(m_pActiveShell->GetFlyName());
- lcl_SelectByContentTypeAndName(this, *m_xTreeView, aContentTypeName, aName);
- return;
- }
+ OUString aContentTypeName;
+ if (m_pActiveShell->GetSelectionType() == SelectionType::Graphic &&
+ !(m_bIsRoot && m_nRootType != ContentTypeId::GRAPHIC))
+ {
+ if (!m_bImageTracking) return;
+ aContentTypeName = SwResId(STR_CONTENT_TYPE_GRAPHIC);
+ }
+ else if (m_pActiveShell->GetSelectionType() == SelectionType::Frame &&
+ !(m_bIsRoot && m_nRootType != ContentTypeId::FRAME))
+ {
+ if (!m_bFrameTracking) return;
+ aContentTypeName = SwResId(STR_CONTENT_TYPE_FRAME);
+ }
+ else if (m_pActiveShell->GetSelectionType() == SelectionType::Ole &&
+ !(m_bIsRoot && m_nRootType != ContentTypeId::OLE))
+ {
+ if (!m_bOLEobjectTracking) return;
+ aContentTypeName = SwResId(STR_CONTENT_TYPE_OLE);
+ }
+ if (!aContentTypeName.isEmpty())
+ {
+ OUString aName(m_pActiveShell->GetFlyName());
+ lcl_SelectByContentTypeAndName(this, *m_xTreeView, aContentTypeName, aName);
+ return;
+ }
}
// drawing
if ((m_pActiveShell->GetSelectionType() & (SelectionType::DrawObject |