[Libreoffice-commits] core.git: tools/source ucb/source unotools/source unoxml/source writerfilter/source xmlhelp/source xmloff/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Fri Apr 17 10:45:25 UTC 2020


 tools/source/generic/poly.cxx                         |   16 +
 tools/source/memtools/multisel.cxx                    |   23 +-
 tools/source/zcodec/zcodec.cxx                        |   10 -
 ucb/source/ucp/file/filrset.cxx                       |    3 
 ucb/source/ucp/file/filtask.cxx                       |    5 
 ucb/source/ucp/ftp/ftpurl.cxx                         |   12 -
 unotools/source/config/bootstrap.cxx                  |    3 
 unotools/source/misc/datetime.cxx                     |  165 +++++++++---------
 unoxml/source/rdf/CURI.cxx                            |   12 -
 writerfilter/source/dmapper/DomainMapper_Impl.cxx     |   18 +
 writerfilter/source/dmapper/NumberingManager.cxx      |    4 
 xmlhelp/source/cxxhelp/provider/databases.cxx         |   22 +-
 xmlhelp/source/cxxhelp/provider/resultsetforquery.cxx |    5 
 xmlhelp/source/treeview/tvread.cxx                    |    5 
 xmloff/source/forms/formattributes.cxx                |    3 
 xmloff/source/style/xmlnumfe.cxx                      |    7 
 16 files changed, 193 insertions(+), 120 deletions(-)

New commits:
commit 0b2ddcda730897cb5b2801731f03191d77409273
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Apr 17 11:39:49 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Apr 17 12:44:46 2020 +0200

    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 at collabora.co.uk>

diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx
index fba7a80bd23d..72e7532874ad 100644
--- a/tools/source/generic/poly.cxx
+++ b/tools/source/generic/poly.cxx
@@ -332,10 +332,12 @@ ImplPolygon::ImplPolygon( const Point& rBezPt1, const Point& rCtrlPt1,
         Point& rPt = mxPointAry[i];
 
         fK_2 = fK_1;
-        fK_3 = ( fK_2 *= fK_1 );
+        fK_2 *= fK_1;
+        fK_3 = fK_2;
         fK_3 *= fK_1;
         fK1_2 = fK1_1;
-        fK1_3 = ( fK1_2 *= fK1_1 );
+        fK1_2 *= fK1_1;
+        fK1_3 = fK1_2;
         fK1_3 *= fK1_1;
         double fK12 = fK_1 * fK1_2;
         double fK21 = fK_2 * fK1_1;
@@ -1250,10 +1252,14 @@ Vector2D& Vector2D::Normalize()
 {
     double fLen = Scalar( *this );
 
-    if( ( fLen != 0.0 ) && ( fLen != 1.0 ) && ( ( fLen = sqrt( fLen ) ) != 0.0 ) )
+    if( ( fLen != 0.0 ) && ( fLen != 1.0 ) )
     {
-        mfX /= fLen;
-        mfY /= fLen;
+        fLen = sqrt( fLen );
+        if( fLen != 0.0 )
+        {
+            mfX /= fLen;
+            mfY /= fLen;
+        }
     }
 
     return *this;
diff --git a/tools/source/memtools/multisel.cxx b/tools/source/memtools/multisel.cxx
index 8fd0c61aeb27..7a8df48d0049 100644
--- a/tools/source/memtools/multisel.cxx
+++ b/tools/source/memtools/multisel.cxx
@@ -379,10 +379,11 @@ sal_Int32 MultiSelection::FirstSelected()
     nCurSubSel = 0;
 
     bCurValid = !aSels.empty();
-    if ( bCurValid )
-        return nCurIndex = aSels[ 0 ].Min();
+    if ( !bCurValid )
+        return SFX_ENDOFSELECTION;
 
-    return SFX_ENDOFSELECTION;
+    nCurIndex = aSels[ 0 ].Min();
+    return nCurIndex;
 }
 
 sal_Int32 MultiSelection::LastSelected()
@@ -390,10 +391,11 @@ sal_Int32 MultiSelection::LastSelected()
     nCurSubSel = aSels.size() - 1;
     bCurValid = !aSels.empty();
 
-    if ( bCurValid )
-        return nCurIndex = aSels[ nCurSubSel ].Max();
+    if ( !bCurValid )
+        return SFX_ENDOFSELECTION;
 
-    return SFX_ENDOFSELECTION;
+    nCurIndex = aSels[ nCurSubSel ].Max();
+    return nCurIndex;
 }
 
 sal_Int32 MultiSelection::NextSelected()
@@ -406,11 +408,12 @@ sal_Int32 MultiSelection::NextSelected()
         return ++nCurIndex;
 
     // are there further sub selections?
-    if ( ++nCurSubSel < sal_Int32(aSels.size()) )
-        return nCurIndex = aSels[ nCurSubSel ].Min();
+    if ( ++nCurSubSel >= sal_Int32(aSels.size()) )
+        // we are at the end!
+        return SFX_ENDOFSELECTION;
 
-    // we are at the end!
-    return SFX_ENDOFSELECTION;
+    nCurIndex = aSels[ nCurSubSel ].Min();
+    return nCurIndex;
 }
 
 void MultiSelection::SetTotalRange( const Range& rTotRange )
diff --git a/tools/source/zcodec/zcodec.cxx b/tools/source/zcodec/zcodec.cxx
index a29127be7232..b6b1b2112b32 100644
--- a/tools/source/zcodec/zcodec.cxx
+++ b/tools/source/zcodec/zcodec.cxx
@@ -119,9 +119,12 @@ void ZCodec::Compress( SvStream& rIStm, SvStream& rOStm )
     InitCompress();
     mpInBuf = new sal_uInt8[ mnInBufSize ];
     auto pStream = static_cast<z_stream*>(mpsC_Stream);
-    while ((pStream->avail_in = rIStm.ReadBytes(
-                    pStream->next_in = mpInBuf, mnInBufSize )) != 0)
+    for (;;)
     {
+        pStream->next_in = mpInBuf;
+        pStream->avail_in = rIStm.ReadBytes( pStream->next_in, mnInBufSize );
+        if (pStream->avail_in == 0)
+            break;
         if ( pStream->avail_out == 0 )
             ImplWriteBack();
         if ( deflate( pStream, Z_NO_FLUSH ) < 0 )
@@ -142,7 +145,8 @@ long ZCodec::Decompress( SvStream& rIStm, SvStream& rOStm )
     assert(meState == STATE_INIT);
     mpOStm = &rOStm;
     InitDecompress(rIStm);
-    pStream->next_out = mpOutBuf = new sal_uInt8[ pStream->avail_out = mnOutBufSize ];
+    pStream->avail_out = mnOutBufSize;
+    pStream->next_out = mpOutBuf = new sal_uInt8[ pStream->avail_out ];
     do
     {
         if ( pStream->avail_out == 0 ) ImplWriteBack();
diff --git a/ucb/source/ucp/file/filrset.cxx b/ucb/source/ucp/file/filrset.cxx
index 90c9646e8dbb..470ec88d6f58 100644
--- a/ucb/source/ucp/file/filrset.cxx
+++ b/ucb/source/ucp/file/filrset.cxx
@@ -212,7 +212,8 @@ XResultSet_impl::OneMore()
         {
             m_aFolder.close();
             isFinalChanged();
-            return ( m_nIsOpen = false );
+            m_nIsOpen = false;
+            return m_nIsOpen;
         }
         else if( err == osl::FileBase::E_None )
         {
diff --git a/ucb/source/ucp/file/filtask.cxx b/ucb/source/ucp/file/filtask.cxx
index 624e4e531dfa..8d839d726a57 100644
--- a/ucb/source/ucp/file/filtask.cxx
+++ b/ucb/source/ucp/file/filtask.cxx
@@ -2012,8 +2012,11 @@ TaskManager::copy_recursive( const OUString& srcUnqPath,
 
             osl::DirectoryItem aDirItem;
 
-            while( err == osl::FileBase::E_None && ( next = aDir.getNextItem( aDirItem ) ) == osl::FileBase::E_None )
+            while( err == osl::FileBase::E_None )
             {
+                next = aDir.getNextItem( aDirItem );
+                if (next != osl::FileBase::E_None )
+                    break;
                 bool IsDoc = false;
                 osl::FileStatus aFileStatus( n_Mask );
                 aDirItem.getFileStatus( aFileStatus );
diff --git a/ucb/source/ucp/ftp/ftpurl.cxx b/ucb/source/ucp/ftp/ftpurl.cxx
index 93b7dc331cd9..74b77dec15be 100644
--- a/ucb/source/ucp/ftp/ftpurl.cxx
+++ b/ucb/source/ucp/ftp/ftpurl.cxx
@@ -226,10 +226,14 @@ void FTPURL::parse(const OUString& url)
                         ""/*aAccount*/);
 
     // now check for something like ";type=i" at end of url
-    if(!m_aPathSegmentVec.empty() &&
-       (l = m_aPathSegmentVec.back().indexOf(';')) != -1) {
-        m_aType = m_aPathSegmentVec.back().copy(l);
-        m_aPathSegmentVec.back() = m_aPathSegmentVec.back().copy(0,l);
+    if(!m_aPathSegmentVec.empty())
+    {
+        l = m_aPathSegmentVec.back().indexOf(';');
+        if (l != -1)
+        {
+            m_aType = m_aPathSegmentVec.back().copy(l);
+            m_aPathSegmentVec.back() = m_aPathSegmentVec.back().copy(0,l);
+        }
     }
 }
 
diff --git a/unotools/source/config/bootstrap.cxx b/unotools/source/config/bootstrap.cxx
index 7ea340b8cc9d..459d8e518945 100644
--- a/unotools/source/config/bootstrap.cxx
+++ b/unotools/source/config/bootstrap.cxx
@@ -385,7 +385,8 @@ static OUString getExecutableBaseName()
 
 static Bootstrap::PathStatus updateStatus(Bootstrap::Impl::PathData & _rResult)
 {
-    return _rResult.status = checkStatusAndNormalizeURL(_rResult.path);
+    _rResult.status = checkStatusAndNormalizeURL(_rResult.path);
+    return _rResult.status;
 }
 
 static Bootstrap::PathStatus implGetBootstrapFile(rtl::Bootstrap const & _rData, Bootstrap::Impl::PathData & _rBootstrapFile)
diff --git a/unotools/source/misc/datetime.cxx b/unotools/source/misc/datetime.cxx
index ca5c2c110057..703ce91273aa 100644
--- a/unotools/source/misc/datetime.cxx
+++ b/unotools/source/misc/datetime.cxx
@@ -381,94 +381,111 @@ bool ISO8601parseTime(const OUString &aTimeStr, css::util::Time& rTime)
     bool bFrac = false;
     // hours
     bool bSuccess = getISO8601TimeToken(aTimeStr, n, tokInt, bFrac, tokFrac);
-    if (bSuccess)
+    if (!bSuccess)
+        return false;
+
+    if ( bFrac && n < aTimeStr.getLength())
+    {
+        // is it junk or the timezone?
+        bSuccess = getISO8601TimeZoneToken(aTimeStr, n, tokTz);
+        if (!bSuccess)
+            return false;
+    }
+    bSuccess = convertNumber32( nHour, tokInt, 0, 23 );
+    if (!bSuccess)
+        return false;
+
+    if (bFrac)
     {
-        if ( bFrac && n < aTimeStr.getLength())
-            // is it junk or the timezone?
-            bSuccess = getISO8601TimeZoneToken(aTimeStr, n, tokTz);
-        if (bSuccess && (bSuccess = convertNumber32( nHour, tokInt, 0, 23 )) )
+        sal_Int64 fracNumerator;
+        bSuccess = convertNumber64(fracNumerator, tokFrac);
+        if ( bSuccess )
         {
-            if (bFrac)
-            {
-                sal_Int64 fracNumerator;
-                if ( (bSuccess = convertNumber64(fracNumerator, tokFrac)) )
-                {
-                    double frac = static_cast<double>(fracNumerator) / pow(static_cast<double>(10), static_cast<double>(tokFrac.getLength()));
-                    // minutes
-                    OSL_ENSURE(frac < 1 && frac >= 0, "ISO8601parse internal error frac hours (of hours) not between 0 and 1");
-                    frac *= 60;
-                    nMin = floor(frac);
-                    frac -=  nMin;
-                    // seconds
-                    OSL_ENSURE(frac < 1 && frac >= 0, "ISO8601parse internal error frac minutes (of hours) not between 0 and 1");
-                    frac *= 60;
-                    nSec = floor(frac);
-                    frac -=  nSec;
-                    // nanoseconds
-                    OSL_ENSURE(frac < 1 && frac >= 0, "ISO8601parse internal error frac seconds (of hours) not between 0 and 1");
-                    frac *= 1000000000;
-                    nNanoSec = ::rtl::math::round(frac);
-                }
-                goto end;
-            }
-            if(n >= aTimeStr.getLength())
-                goto end;
+            double frac = static_cast<double>(fracNumerator) / pow(static_cast<double>(10), static_cast<double>(tokFrac.getLength()));
+             // minutes
+            OSL_ENSURE(frac < 1 && frac >= 0, "ISO8601parse internal error frac hours (of hours) not between 0 and 1");
+            frac *= 60;
+            nMin = floor(frac);
+            frac -=  nMin;
+            // seconds
+            OSL_ENSURE(frac < 1 && frac >= 0, "ISO8601parse internal error frac minutes (of hours) not between 0 and 1");
+            frac *= 60;
+            nSec = floor(frac);
+            frac -=  nSec;
+            // nanoseconds
+            OSL_ENSURE(frac < 1 && frac >= 0, "ISO8601parse internal error frac seconds (of hours) not between 0 and 1");
+            frac *= 1000000000;
+            nNanoSec = ::rtl::math::round(frac);
         }
+        goto end;
     }
+    if(n >= aTimeStr.getLength())
+        goto end;
 
     // minutes
-    if (bSuccess && (bSuccess = getISO8601TimeToken(aTimeStr, n, tokInt, bFrac, tokFrac)))
+    bSuccess = getISO8601TimeToken(aTimeStr, n, tokInt, bFrac, tokFrac);
+    if (!bSuccess)
+        return false;
+    if ( bFrac && n < aTimeStr.getLength())
     {
-        if ( bFrac && n < aTimeStr.getLength())
-            // is it junk or the timezone?
-            bSuccess = getISO8601TimeZoneToken(aTimeStr, n, tokTz);
-        if (bSuccess && (bSuccess = convertNumber32( nMin, tokInt, 0, 59 )) )
+        // is it junk or the timezone?
+        bSuccess = getISO8601TimeZoneToken(aTimeStr, n, tokTz);
+        if (!bSuccess)
+            return false;
+    }
+    bSuccess = convertNumber32( nMin, tokInt, 0, 59 );
+    if (!bSuccess)
+        return false;
+    if (bFrac)
+    {
+        sal_Int64 fracNumerator;
+        bSuccess = convertNumber64(fracNumerator, tokFrac);
+        if ( bSuccess )
         {
-            if (bFrac)
-            {
-                sal_Int64 fracNumerator;
-                if ( (bSuccess = convertNumber64(fracNumerator, tokFrac)) )
-                {
-                    double frac = static_cast<double>(fracNumerator) / pow(static_cast<double>(10), static_cast<double>(tokFrac.getLength()));
-                    // seconds
-                    OSL_ENSURE(frac < 1 && frac >= 0, "ISO8601parse internal error frac minutes (of minutes) not between 0 and 1");
-                    frac *= 60;
-                    nSec = floor(frac);
-                    frac -=  nSec;
-                    // nanoseconds
-                    OSL_ENSURE(frac < 1 && frac >= 0, "ISO8601parse internal error frac seconds (of minutes) not between 0 and 1");
-                    frac *= 1000000000;
-                    nNanoSec = ::rtl::math::round(frac);
-                }
-                goto end;
-            }
-            if(n >= aTimeStr.getLength())
-                goto end;
+            double frac = static_cast<double>(fracNumerator) / pow(static_cast<double>(10), static_cast<double>(tokFrac.getLength()));
+            // seconds
+            OSL_ENSURE(frac < 1 && frac >= 0, "ISO8601parse internal error frac minutes (of minutes) not between 0 and 1");
+            frac *= 60;
+            nSec = floor(frac);
+            frac -=  nSec;
+            // nanoseconds
+            OSL_ENSURE(frac < 1 && frac >= 0, "ISO8601parse internal error frac seconds (of minutes) not between 0 and 1");
+            frac *= 1000000000;
+            nNanoSec = ::rtl::math::round(frac);
         }
+        goto end;
     }
+    if(n >= aTimeStr.getLength())
+        goto end;
+
     // seconds
-    if (bSuccess && (bSuccess = getISO8601TimeToken(aTimeStr, n, tokInt, bFrac, tokFrac)))
+    bSuccess = getISO8601TimeToken(aTimeStr, n, tokInt, bFrac, tokFrac);
+    if (!bSuccess)
+        return false;
+    if (n < aTimeStr.getLength())
     {
-        if (n < aTimeStr.getLength())
-            // is it junk or the timezone?
-            bSuccess = getISO8601TimeZoneToken(aTimeStr, n, tokTz);
-        // max 60 for leap seconds
-        if (bSuccess && (bSuccess = convertNumber32( nSec, tokInt, 0, 60 )) )
+        // is it junk or the timezone?
+        bSuccess = getISO8601TimeZoneToken(aTimeStr, n, tokTz);
+        if (!bSuccess)
+            return false;
+    }
+    // max 60 for leap seconds
+    bSuccess = convertNumber32( nSec, tokInt, 0, 60 );
+    if (!bSuccess)
+        return false;
+    if (bFrac)
+    {
+        sal_Int64 fracNumerator;
+        bSuccess = convertNumber64(fracNumerator, tokFrac);
+        if ( bSuccess )
         {
-            if (bFrac)
-            {
-                sal_Int64 fracNumerator;
-                if ( (bSuccess = convertNumber64(fracNumerator, tokFrac)) )
-                {
-                    double frac = static_cast<double>(fracNumerator) / pow(static_cast<double>(10), static_cast<double>(tokFrac.getLength()));
-                    // nanoseconds
-                    OSL_ENSURE(frac < 1 && frac >= 0, "ISO8601parse internal error frac seconds (of seconds) not between 0 and 1");
-                    frac *= 1000000000;
-                    nNanoSec = ::rtl::math::round(frac);
-                }
-                goto end;
-            }
+            double frac = static_cast<double>(fracNumerator) / pow(static_cast<double>(10), static_cast<double>(tokFrac.getLength()));
+            // nanoseconds
+            OSL_ENSURE(frac < 1 && frac >= 0, "ISO8601parse internal error frac seconds (of seconds) not between 0 and 1");
+            frac *= 1000000000;
+            nNanoSec = ::rtl::math::round(frac);
         }
+        goto end;
     }
 
     end:
diff --git a/unoxml/source/rdf/CURI.cxx b/unoxml/source/rdf/CURI.cxx
index cef43fa22488..bacc42697e1a 100644
--- a/unoxml/source/rdf/CURI.cxx
+++ b/unoxml/source/rdf/CURI.cxx
@@ -742,11 +742,13 @@ void SAL_CALL CURI::initialize(const css::uno::Sequence< css::uno::Any > & aArgu
     }
 
     // split parameter
-    sal_Int32 idx;
-    if (    ((idx = arg0.indexOf    ('#')) < 0)
-        &&  ((idx = arg0.lastIndexOf('/')) < 0)
-        &&  ((idx = arg0.lastIndexOf(':')) < 0) )
- {
+    sal_Int32 idx = arg0.indexOf('#');
+    if (idx < 0)
+        idx = arg0.lastIndexOf('/');
+    if (idx < 0)
+        idx = arg0.lastIndexOf(':');
+    if (idx < 0)
+    {
         throw css::lang::IllegalArgumentException(
             "CURI::initialize: argument not splittable: no separator [#/:]", *this, 0);
     }
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 010cb3e3fe21..2c84a56ce73a 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -1395,11 +1395,15 @@ void DomainMapper_Impl::finishParagraph( const PropertyMapPtr& pPropertyMap, con
             const StyleSheetEntryPtr pParent = (!pEntry->sBaseStyleIdentifier.isEmpty()) ? GetStyleSheetTable()->FindStyleSheetByISTD(pEntry->sBaseStyleIdentifier) : nullptr;
             const StyleSheetPropertyMap* pParentProperties = dynamic_cast<const StyleSheetPropertyMap*>(pParent ? pParent->pProperties.get() : nullptr);
             if (!pEntry->sBaseStyleIdentifier.isEmpty())
-                if ( (oProperty = pStyleSheetProperties->getProperty(PROP_PARA_FIRST_LINE_INDENT))
+            {
+                oProperty = pStyleSheetProperties->getProperty(PROP_PARA_FIRST_LINE_INDENT);
+                if ( oProperty
                     // If the numbering comes from a base style, indent of the base style has also priority.
                     || (bNumberingFromBaseStyle && pParentProperties && (oProperty = pParentProperties->getProperty(PROP_PARA_FIRST_LINE_INDENT))) )
                     pParaContext->Insert(PROP_PARA_FIRST_LINE_INDENT, oProperty->second, /*bOverwrite=*/false);
-            if ( (oProperty = pStyleSheetProperties->getProperty(PROP_PARA_LEFT_MARGIN))
+            }
+            oProperty = pStyleSheetProperties->getProperty(PROP_PARA_LEFT_MARGIN);
+            if ( oProperty
                 || (bNumberingFromBaseStyle && pParentProperties && (oProperty = pParentProperties->getProperty(PROP_PARA_LEFT_MARGIN))) )
                 pParaContext->Insert(PROP_PARA_LEFT_MARGIN, oProperty->second, /*bOverwrite=*/false);
 
@@ -4015,7 +4019,15 @@ void  DomainMapper_Impl::handleRubyEQField( const FieldContextPtr& pContext)
     }
 
     nIndex = rCommand.indexOf("\\o");
-    if (nIndex == -1 || (nIndex = rCommand.indexOf('(', nIndex)) == -1 || (nEnd = rCommand.lastIndexOf(')'))==-1 || nEnd <= nIndex)
+    if (nIndex == -1)
+        return;
+    nIndex = rCommand.indexOf('(', nIndex);
+    if (nIndex == -1)
+        return;
+    nEnd = rCommand.lastIndexOf(')');
+    if (nEnd == -1)
+        return;
+    if (nEnd <= nIndex)
         return;
 
     OUString sRubyParts = rCommand.copy(nIndex+1,nEnd-nIndex-1);
diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx
index e0922b41a7af..5bb17c39ebd3 100644
--- a/writerfilter/source/dmapper/NumberingManager.cxx
+++ b/writerfilter/source/dmapper/NumberingManager.cxx
@@ -778,8 +778,8 @@ void ListsManager::lcl_attribute( Id nName, Value& rVal )
             //add a new level to the level vector and make it the current one
             m_pCurrentDefinition->AddLevel();
 
-            writerfilter::Reference<Properties>::Pointer_t pProperties;
-            if((pProperties = rVal.getProperties()).get())
+            writerfilter::Reference<Properties>::Pointer_t pProperties = rVal.getProperties();
+            if(pProperties.get())
                 pProperties->resolve(*this);
         }
         break;
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 );
     }
diff --git a/xmloff/source/forms/formattributes.cxx b/xmloff/source/forms/formattributes.cxx
index 54046cac8085..3086fcb98f6c 100644
--- a/xmloff/source/forms/formattributes.cxx
+++ b/xmloff/source/forms/formattributes.cxx
@@ -262,7 +262,8 @@ namespace xmloff
         aAssignment.aPropertyType = _rType;
 
         // redundance, the accessor is stored in aAssignment.sAttributeName, too
-        return m_aKnownProperties[sAttributeName] = aAssignment;
+        m_aKnownProperties[sAttributeName] = aAssignment;
+        return m_aKnownProperties[sAttributeName];
     }
 
 }   // namespace xmloff
diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx
index de626f0e1661..680368de6a00 100644
--- a/xmloff/source/style/xmlnumfe.cxx
+++ b/xmloff/source/style/xmlnumfe.cxx
@@ -853,9 +853,10 @@ static sal_Int32 lcl_FindSymbol( const OUString& sUpperStr, const OUString& sCur
             {
                 //  dm can be escaped as "dm or \d
                 sal_Unicode c;
-                if ( nCPos == 0 ||
-                    ((c = sUpperStr[nCPos-1]) != '"'
-                     && c != '\\') )
+                if ( nCPos == 0 )
+                    return nCPos;                   // found
+                c = sUpperStr[nCPos-1];
+                if ( c != '"' && c != '\\')
                 {
                     return nCPos;                   // found
                 }


More information about the Libreoffice-commits mailing list