summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/layout/atrfrm.cxx33
1 files changed, 18 insertions, 15 deletions
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 15d2d309d571..f657aa195066 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -2628,22 +2628,25 @@ void SwFrameFormat::SetFormatName( const OUString& rNewName, bool bBroadcast )
}
// update accessibility sidebar object name if we modify the object name on the navigator bar
- if (!aHint.m_sOld.isEmpty() && aHint.m_sOld != aHint.m_sNew)
+ const bool bUpdateA11yName = !aHint.m_sOld.isEmpty() && aHint.m_sOld != aHint.m_sNew;
+ if (!bUpdateA11yName)
+ return;
+ SwFlyFrame* pSFly = SwIterator<SwFlyFrame, SwFormat>(*this).First();
+ if (!pSFly)
+ return;
+ SwFrame *pSFlyLower = pSFly->Lower();
+ if (!pSFlyLower)
+ return;
+ if (!pSFlyLower->IsNoTextFrame())
+ {
+ SwContentFrame* pContent = pSFly->ContainsContent();
+ if (SwTextNode* pSwTxtNode = pContent ? static_cast<SwTextFrame*>(pContent)->GetTextNodeFirst() : nullptr)
+ pSwTxtNode->resetAndQueueAccessibilityCheck(true);
+ }
+ else
{
- if (SwFlyFrame* pSFly = SwIterator<SwFlyFrame, SwFormat>(*this).First())
- {
- SwFrame *pSFlyLower = pSFly->Lower();
- if (pSFlyLower && !pSFlyLower->IsNoTextFrame())
- {
- if (SwTextNode* pSwTxtNode = static_cast<SwTextFrame*>(pSFly->ContainsContent())->GetTextNodeFirst())
- pSwTxtNode->resetAndQueueAccessibilityCheck(true);
- }
- else
- {
- if (SwNode* pSwNode = static_cast<SwNoTextFrame*>(pSFlyLower)->GetNode())
- pSwNode->resetAndQueueAccessibilityCheck(true);
- }
- }
+ if (SwNode* pSwNode = static_cast<SwNoTextFrame*>(pSFlyLower)->GetNode())
+ pSwNode->resetAndQueueAccessibilityCheck(true);
}
}
else