[Libreoffice-commits] core.git: sw/source
Matteo Casalin
matteo.casalin at yahoo.com
Thu Jun 25 03:26:04 PDT 2015
sw/source/filter/html/swhtml.cxx | 62 ++++++++++++++++++---------------------
1 file changed, 30 insertions(+), 32 deletions(-)
New commits:
commit 707ef3171a096787b2f7a4c221e60962f05e7d01
Author: Matteo Casalin <matteo.casalin at yahoo.com>
Date: Mon Jun 8 23:32:14 2015 +0200
Just continue to next iteration
Change-Id: I4040dff95dd1718df4cb555c155f7eea723bd2e3
Reviewed-on: https://gerrit.libreoffice.org/16170
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Stahl <mstahl at redhat.com>
Tested-by: Michael Stahl <mstahl at redhat.com>
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 1f92ffc..9d338a7 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!" );
+ }
}
}
More information about the Libreoffice-commits
mailing list