diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-11-10 19:02:45 +0100 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2018-11-10 19:47:00 +0100 |
commit | e2fce5d71622243d3308b10d2ecff6382cb4ab4e (patch) | |
tree | cef9bc4054a583969092f22862c9e1bd916dea29 | |
parent | a354a01cea06dc4b091fd57b7c559850c38f7413 (diff) |
sw_redlinehide_3: [loplugin:blockblock] in accpara.cxx
Change-Id: Ib401e6d453519890badf13320e6f2123d1a3b11b
-rw-r--r-- | sw/source/core/access/accpara.cxx | 74 |
1 files changed, 35 insertions, 39 deletions
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index eec1a569da46..97948ffb9588 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -1242,19 +1242,19 @@ OUString SwAccessibleParagraph::GetFieldTypeNameAtIndex(sal_Int32 nIndex) sw::MergedAttrIter iter(*pFrame); while (SwTextAttr const*const pHt = iter.NextAttr()) { + if ((pHt->Which() == RES_TXTATR_FIELD + || pHt->Which() == RES_TXTATR_ANNOTATION + || pHt->Which() == RES_TXTATR_INPUTFIELD) + && (nFieldIndex-- == 0)) { - if ( ( pHt->Which() == RES_TXTATR_FIELD - || pHt->Which() == RES_TXTATR_ANNOTATION - || pHt->Which() == RES_TXTATR_INPUTFIELD ) + pTextField = const_cast<SwTextField*>( + static_txtattr_cast<SwTextField const*>(pHt)); + break; + } + else if (pHt->Which() == RES_TXTATR_REFMARK && (nFieldIndex-- == 0)) - { - pTextField = const_cast<SwTextField*>( - static_txtattr_cast<SwTextField const*>(pHt)); - break; - } - else if (pHt->Which() == RES_TXTATR_REFMARK - && (nFieldIndex-- == 0)) - strTypeName = "set reference"; + { + strTypeName = "set reference"; } } } @@ -2898,35 +2898,31 @@ uno::Reference< XAccessibleHyperlink > SAL_CALL { if( nTIndex == nLinkIndex ) { // found - { // it's a hyperlink + if (!m_pHyperTextData) + m_pHyperTextData.reset( new SwAccessibleHyperTextData ); + SwAccessibleHyperTextData::iterator aIter = + m_pHyperTextData ->find( pHt ); + if (aIter != m_pHyperTextData->end()) + { + xRet = (*aIter).second; + } + if (!xRet.is()) + { + TextFrameIndex const nHintStart(pTextFrame->MapModelToView(pNode, pHt->GetStart())); + TextFrameIndex const nHintEnd(pTextFrame->MapModelToView(pNode, *pHt->GetAnyEnd())); + const sal_Int32 nTmpHStt = GetPortionData().GetAccessiblePosition( + max(aHIter.startIdx(), nHintStart)); + const sal_Int32 nTmpHEnd = GetPortionData().GetAccessiblePosition( + min(aHIter.endIdx(), nHintEnd)); + xRet = new SwAccessibleHyperlink(*pHt, + *this, nTmpHStt, nTmpHEnd ); + if (aIter != m_pHyperTextData->end()) { - if( !m_pHyperTextData ) - m_pHyperTextData.reset( new SwAccessibleHyperTextData ); - SwAccessibleHyperTextData::iterator aIter = - m_pHyperTextData ->find( pHt ); - if( aIter != m_pHyperTextData->end() ) - { - xRet = (*aIter).second; - } - if( !xRet.is() ) - { - TextFrameIndex const nHintStart(pTextFrame->MapModelToView(pNode, pHt->GetStart())); - TextFrameIndex const nHintEnd(pTextFrame->MapModelToView(pNode, *pHt->GetAnyEnd())); - const sal_Int32 nTmpHStt= GetPortionData().GetAccessiblePosition( - max(aHIter.startIdx(), nHintStart)); - const sal_Int32 nTmpHEnd= GetPortionData().GetAccessiblePosition( - min(aHIter.endIdx(), nHintEnd)); - xRet = new SwAccessibleHyperlink(*pHt, - *this, nTmpHStt, nTmpHEnd ); - if( aIter != m_pHyperTextData->end() ) - { - (*aIter).second = xRet; - } - else - { - m_pHyperTextData->emplace( pHt, xRet ); - } - } + (*aIter).second = xRet; + } + else + { + m_pHyperTextData->emplace( pHt, xRet ); } } break; |