diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-08-25 20:55:53 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2018-09-09 21:07:54 +0200 |
commit | ecdca13805a2a7ded0f08208337509030d160c2c (patch) | |
tree | a9d44aa10e4d9f5ebf74b438033bf149b2b4d130 | |
parent | c08c3807fe1a2c4a08b542125ee9f40f0f7f07fe (diff) |
Bail out early
Change-Id: Ie5b34bfbfd45aaafbf0a64ee72f741066d1632e1
-rw-r--r-- | sc/source/filter/html/htmlimp.cxx | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/sc/source/filter/html/htmlimp.cxx b/sc/source/filter/html/htmlimp.cxx index ba4fc94344b7..e75f8421c9ad 100644 --- a/sc/source/filter/html/htmlimp.cxx +++ b/sc/source/filter/html/htmlimp.cxx @@ -214,22 +214,18 @@ OUString ScHTMLImport::GetHTMLRangeNameList( const ScDocument* pDoc, const OUStr if( pRangeNames && ScfTools::IsHTMLTablesName( aToken ) ) { // build list with all HTML tables sal_uLong nIndex = 1; - bool bLoop = true; - while( bLoop ) + for(;;) { aToken = ScfTools::GetNameFromHTMLIndex( nIndex++ ); const ScRangeData* pRangeData = pRangeNames->findByUpperName(ScGlobal::pCharClass->uppercase(aToken)); - if (pRangeData) + if (!pRangeData) + break; + ScRange aRange; + if( pRangeData->IsReference( aRange ) && !aRangeList.In( aRange ) ) { - ScRange aRange; - if( pRangeData->IsReference( aRange ) && !aRangeList.In( aRange ) ) - { - aNewName = ScGlobal::addToken(aNewName, aToken, ';'); - aRangeList.push_back( aRange ); - } + aNewName = ScGlobal::addToken(aNewName, aToken, ';'); + aRangeList.push_back( aRange ); } - else - bLoop = false; } } else |