summaryrefslogtreecommitdiff
path: root/xmlhelp
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-17 11:39:49 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-17 12:44:46 +0200
commit0b2ddcda730897cb5b2801731f03191d77409273 (patch)
tree063c9beae80927710fef7ac8b5bc22d458004de9 /xmlhelp
parent3cb8e9e211c30089516f56f465176d3a959631f9 (diff)
loplugin:buriedassign in tools..xmloff
Change-Id: I31df6c4fd82c6f6d15bbe5228e92e5171cacba51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92410 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlhelp')
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.cxx22
-rw-r--r--xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx5
-rw-r--r--xmlhelp/source/treeview/tvread.cxx5
3 files changed, 25 insertions, 7 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index 975e338bf5c2..a891fb8994a4 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -574,8 +574,12 @@ void KeywordInfo::KeywordElement::init( Databases const *pDatabases,helpdatafile
{
std::vector< OUString > id,anchor;
int idx = -1,k;
- while( ( idx = ids.indexOf( ';',k = ++idx ) ) != -1 )
+ for (;;)
{
+ k = ++idx;
+ idx = ids.indexOf( ';', k );
+ if( idx == -1 )
+ break;
int h = ids.indexOf( '#', k );
if( h < idx )
{
@@ -700,8 +704,11 @@ KeywordInfo* Databases::getKeyword( const OUString& Database,
KeyDataBaseFileIterator aDbFileIt( m_xContext, *this, Database, Language );
OUString fileURL;
bool bExtension = false;
- while( !(fileURL = aDbFileIt.nextDbFile( bExtension )).isEmpty() )
+ for (;;)
{
+ fileURL = aDbFileIt.nextDbFile( bExtension );
+ if( fileURL.isEmpty() )
+ break;
OUString fileNameHDFHelp( fileURL );
if( bExtension )
fileNameHDFHelp += "_";
@@ -851,8 +858,11 @@ Reference< XHierarchicalNameAccess > Databases::findJarFileForPath
JarFileIterator aJarFileIt( m_xContext, *this, jar, Language );
Reference< XHierarchicalNameAccess > xTestNA;
Reference< deployment::XPackage > xParentPackageBundle;
- while( (xTestNA = aJarFileIt.nextJarFile( xParentPackageBundle, o_pExtensionPath, o_pExtensionRegistryPath )).is() )
+ for (;;)
{
+ xTestNA = aJarFileIt.nextJarFile( xParentPackageBundle, o_pExtensionPath, o_pExtensionRegistryPath );
+ if( !xTestNA.is() )
+ break;
if( xTestNA.is() && xTestNA->hasByHierarchicalName( path ) )
{
bool bSuccess = true;
@@ -1025,9 +1035,11 @@ void Databases::setActiveText( const OUString& Module,
bool bSuccess = false;
if( !bFoundAsEmpty )
{
- helpdatafileproxy::Hdf* pHdf = nullptr;
- while( !bSuccess && (pHdf = aDbIt.nextHdf()) != nullptr )
+ while( !bSuccess )
{
+ helpdatafileproxy::Hdf* pHdf = aDbIt.nextHdf();
+ if( !pHdf )
+ break;
bSuccess = pHdf->getValueForKey( id, aHDFData );
nSize = aHDFData.getSize();
pData = aHDFData.getData();
diff --git a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx
index 04e8596f6455..cb0d765c7ad5 100644
--- a/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx
+++ b/xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx
@@ -123,8 +123,11 @@ ResultSetForQuery::ResultSetForQuery( const uno::Reference< uno::XComponentConte
vector< vector<HitItem> > aIndexFolderResultVectorVector;
bool bTemporary;
- while( !(idxDir = aIndexFolderIt.nextIndexFolder( bExtension, bTemporary )).isEmpty() )
+ for (;;)
{
+ idxDir = aIndexFolderIt.nextIndexFolder( bExtension, bTemporary );
+ if( idxDir.isEmpty() )
+ break;
vector<HitItem> aIndexFolderResultVector;
try
diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx
index d43ed0fd416a..e56a83975c77 100644
--- a/xmlhelp/source/treeview/tvread.cxx
+++ b/xmlhelp/source/treeview/tvread.cxx
@@ -660,8 +660,11 @@ ConfigData TVChildTarget::init( const Reference< XComponentContext >& xContext )
TreeFileIterator aTreeIt( locale );
OUString aTreeFile;
sal_Int32 nFileSize;
- while( !(aTreeFile = aTreeIt.nextTreeFile( nFileSize ) ).isEmpty() )
+ for (;;)
{
+ aTreeFile = aTreeIt.nextTreeFile( nFileSize );
+ if( aTreeFile.isEmpty() )
+ break;
configData.vFileLen.push_back( nFileSize );
configData.vFileURL.push_back( aTreeFile );
}