summaryrefslogtreecommitdiff
path: root/sw/source/filter/html/swhtml.cxx
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2015-06-08 23:32:14 +0200
committerMichael Stahl <mstahl@redhat.com>2015-06-25 10:25:38 +0000
commit707ef3171a096787b2f7a4c221e60962f05e7d01 (patch)
treea7a86d64a70d90d748391aea090afb0404520623 /sw/source/filter/html/swhtml.cxx
parenta469002ab5dfffc108b4329fd7dddfc9b8fcce20 (diff)
Just continue to next iteration
Change-Id: I4040dff95dd1718df4cb555c155f7eea723bd2e3 Reviewed-on: https://gerrit.libreoffice.org/16170 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sw/source/filter/html/swhtml.cxx')
-rw-r--r--sw/source/filter/html/swhtml.cxx62
1 files changed, 30 insertions, 32 deletions
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 1f92ffce742a..9d338a727ee9 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -2292,7 +2292,7 @@ bool SwHTMLParser::AppendTextNode( SwHTMLAppendMode eMode, bool bUpdateNum )
{
SwTextAttr *pHt = rHints.GetTextHint( i );
sal_uInt16 nWhich = pHt->Which();
- sal_Int16 nIdx = -1;
+ sal_Int16 nIdx = 0;
bool bFont = false;
switch( nWhich )
{
@@ -2345,45 +2345,43 @@ bool SwHTMLParser::AppendTextNode( SwHTMLAppendMode eMode, bool bUpdateNum )
nIdx = 14;
break;
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();
- if( nStt >= aEndPos[nIdx] )
+ const SfxPoolItem& rItem =
+ static_cast<const SwContentNode *>(pTextNd)->GetAttr( nWhich );
+ if( bFont ? swhtml_css1atr_equalFontItems(rItem,pHt->GetAttr())
+ : rItem == pHt->GetAttr() )
{
- const SfxPoolItem& rItem =
- static_cast<const SwContentNode *>(pTextNd)->GetAttr( nWhich );
- if( bFont ? swhtml_css1atr_equalFontItems(rItem,pHt->GetAttr())
- : rItem == pHt->GetAttr() )
- {
- // The hint is the same as set in the paragraph and
- // therefore, it can be deleted
- // CAUTION!!! This WILL delete the hint and it MAY
- // also delete the SwpHints!!! To avoid any trouble
- // we leave the loop immediately if this is the last
- // hint.
- 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;
- }
+ // The hint is the same as set in the paragraph and
+ // therefore, it can be deleted
+ // CAUTION!!! This WILL delete the hint and it MAY
+ // also delete the SwpHints!!! To avoid any trouble
+ // we leave the loop immediately if this is the last
+ // hint.
+ pTextNd->DeleteAttribute( pHt );
+ if( 1 == nCntAttr )
+ break;
+ i--;
+ nCntAttr--;
}
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!" );
+ // The hint is different. Therefore all hints within that
+ // hint have to be ignored.
+ aEndPos[nIdx] = pHt->GetEnd() ? *pHt->GetEnd() : nStt;
}
}
+ 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!" );
+ }
}
}