Kaydet (Commit) b5c583c2 authored tarafından Michael Stahl's avatar Michael Stahl

sw_redlinehide: adapt more functions of SwAttrIter

Change-Id: I17c14f9e66c82cafa2fb5b3e8e45b3bf94fc4a88
üst 2984f84c
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment