Kaydet (Commit) 707ef317 authored tarafından Matteo Casalin's avatar Matteo Casalin Kaydeden (comit) Michael Stahl

Just continue to next iteration

Change-Id: I4040dff95dd1718df4cb555c155f7eea723bd2e3
Reviewed-on: https://gerrit.libreoffice.org/16170Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
Tested-by: 's avatarMichael Stahl <mstahl@redhat.com>
üst a469002a
...@@ -2292,7 +2292,7 @@ bool SwHTMLParser::AppendTextNode( SwHTMLAppendMode eMode, bool bUpdateNum ) ...@@ -2292,7 +2292,7 @@ bool SwHTMLParser::AppendTextNode( SwHTMLAppendMode eMode, bool bUpdateNum )
{ {
SwTextAttr *pHt = rHints.GetTextHint( i ); SwTextAttr *pHt = rHints.GetTextHint( i );
sal_uInt16 nWhich = pHt->Which(); sal_uInt16 nWhich = pHt->Which();
sal_Int16 nIdx = -1; sal_Int16 nIdx = 0;
bool bFont = false; bool bFont = false;
switch( nWhich ) switch( nWhich )
{ {
...@@ -2345,45 +2345,43 @@ bool SwHTMLParser::AppendTextNode( SwHTMLAppendMode eMode, bool bUpdateNum ) ...@@ -2345,45 +2345,43 @@ bool SwHTMLParser::AppendTextNode( SwHTMLAppendMode eMode, bool bUpdateNum )
nIdx = 14; nIdx = 14;
break; break;
default: default:
break; // Skip to next attribute
continue;
} }
if( nIdx != -1 ) const sal_Int32 nStt = pHt->GetStart();
if( nStt >= aEndPos[nIdx] )
{ {
sal_Int32 nStt = pHt->GetStart(); const SfxPoolItem& rItem =
if( nStt >= aEndPos[nIdx] ) static_cast<const SwContentNode *>(pTextNd)->GetAttr( nWhich );
if( bFont ? swhtml_css1atr_equalFontItems(rItem,pHt->GetAttr())
: rItem == pHt->GetAttr() )
{ {
const SfxPoolItem& rItem = // The hint is the same as set in the paragraph and
static_cast<const SwContentNode *>(pTextNd)->GetAttr( nWhich ); // therefore, it can be deleted
if( bFont ? swhtml_css1atr_equalFontItems(rItem,pHt->GetAttr()) // CAUTION!!! This WILL delete the hint and it MAY
: rItem == pHt->GetAttr() ) // also delete the SwpHints!!! To avoid any trouble
{ // we leave the loop immediately if this is the last
// The hint is the same as set in the paragraph and // hint.
// therefore, it can be deleted pTextNd->DeleteAttribute( pHt );
// CAUTION!!! This WILL delete the hint and it MAY if( 1 == nCntAttr )
// also delete the SwpHints!!! To avoid any trouble break;
// we leave the loop immediately if this is the last i--;
// hint. nCntAttr--;
pTextNd->DeleteAttribute( pHt );
if( 1 == nCntAttr )
break;
i--;
nCntAttr--;
}
else
{
// The hint is different. Therefore all hints within that
// hint have to be ignored.
aEndPos[nIdx] = pHt->GetEnd() ? *pHt->GetEnd() : nStt;
}
} }
else else
{ {
// The hint starts before another one ends. // The hint is different. Therefore all hints within that
// The hint in this case is not deleted // hint have to be ignored.
OSL_ENSURE( pHt->GetEnd() && *pHt->GetEnd() <= aEndPos[nIdx], aEndPos[nIdx] = pHt->GetEnd() ? *pHt->GetEnd() : nStt;
"hints aren't nested properly!" );
} }
} }
else
{
// The hint starts before another one ends.
// The hint in this case is not deleted
OSL_ENSURE( pHt->GetEnd() && *pHt->GetEnd() <= aEndPos[nIdx],
"hints aren't nested properly!" );
}
} }
} }
......
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