summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-05-15 18:04:06 +0200
committerMichael Stahl <Michael.Stahl@cib.de>2018-06-08 21:51:27 +0200
commitb5c583c234f1ac636660045c2868ac354afaa033 (patch)
treed995e404ffed9ac76485c9b477438ca0d2217f8d /sw
parent2984f84c4917e89c052d376bdebd06269e09ee79 (diff)
sw_redlinehide: adapt more functions of SwAttrIter
Change-Id: I17c14f9e66c82cafa2fb5b3e8e45b3bf94fc4a88
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/text/itratr.cxx20
1 files changed, 18 insertions, 2 deletions
diff --git a/sw/source/core/text/itratr.cxx b/sw/source/core/text/itratr.cxx
index 92fe78f71561..d74245038b09 100644
--- a/sw/source/core/text/itratr.cxx
+++ b/sw/source/core/text/itratr.cxx
@@ -113,12 +113,20 @@ SwAttrIter::~SwAttrIter()
*/
SwTextAttr *SwAttrIter::GetAttr(TextFrameIndex const nPosition) const
{
- return (m_pTextNode) ? m_pTextNode->GetTextAttrForCharAt(nPosition) : nullptr;
+ std::pair<SwTextNode const*, sal_Int32> const pos( m_pMergedPara
+ ? sw::MapViewToModel(*m_pMergedPara, nPosition)
+ : std::make_pair(m_pTextNode, sal_Int32(nPosition)));
+ return pos.first->GetTextAttrForCharAt(pos.second);
}
bool SwAttrIter::SeekAndChgAttrIter(TextFrameIndex const nNewPos, OutputDevice* pOut)
{
- bool bChg = m_nStartIndex && nNewPos == m_nPosition ? m_pFont->IsFntChg() : Seek( nNewPos );
+ std::pair<SwTextNode const*, sal_Int32> const pos( m_pMergedPara
+ ? sw::MapViewToModel(*m_pMergedPara, nNewPos)
+ : std::make_pair(m_pTextNode, sal_Int32(nNewPos)));
+ bool bChg = m_nStartIndex && pos.first == m_pTextNode && pos.second == m_nPosition
+ ? m_pFont->IsFntChg()
+ : Seek( nNewPos );
if ( m_pLastOut.get() != pOut )
{
m_pLastOut = pOut;
@@ -152,6 +160,14 @@ bool SwAttrIter::SeekStartAndChgAttrIter( OutputDevice* pOut, const bool bParaFo
if ( m_pRedline && m_pRedline->ExtOn() )
m_pRedline->LeaveExtend(*m_pFont, pFirstTextNode->GetIndex(), 0);
+ if (m_pTextNode != pFirstTextNode)
+ {
+ assert(m_pMergedPara);
+ m_pTextNode = m_pMergedPara->pFirstNode;
+ m_pHints = m_pTextNode->GetpSwpHints();
+ InitFontAndAttrHandler(*m_pTextNode, m_pMergedPara->mergedText, nullptr);
+ }
+
// reset font to its original state
m_aAttrHandler.Reset();
m_aAttrHandler.ResetFont( *m_pFont );