[Libreoffice-commits] core.git: chart2/source connectivity/source desktop/source oox/source sc/source sfx2/source sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Aug 5 20:12:00 UTC 2018


 chart2/source/tools/InternalDataProvider.cxx          |    4 ++--
 connectivity/source/commontools/RowFunctionParser.cxx |    2 +-
 desktop/source/splash/unxsplash.cxx                   |    2 +-
 oox/source/ppt/comments.cxx                           |    8 ++++----
 sc/source/ui/view/viewdata.cxx                        |    2 +-
 sfx2/source/dialog/mgetempl.cxx                       |    2 +-
 sw/source/core/tox/txmsrt.cxx                         |    2 +-
 sw/source/filter/ww8/docxattributeoutput.cxx          |    2 +-
 sw/source/uibase/misc/glosdoc.cxx                     |    2 +-
 9 files changed, 13 insertions(+), 13 deletions(-)

New commits:
commit 98788274275d7c9effa2a3839469bd35d9290f1e
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sun Aug 5 19:30:53 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Aug 5 22:11:36 2018 +0200

    coverity#1438225 Improper use of negative value
    
    and
    
    coverity#1438221 Argument cannot be negative
    coverity#1438213 Argument cannot be negative
    coverity#1438227 Argument cannot be negative
    coverity#1438223 Argument cannot be negative
    coverity#1438222 Argument cannot be negative
    coverity#1438215 Improper use of negative value
    coverity#1438220 Improper use of negative value
    coverity#1438217 Improper use of negative value
    
    Change-Id: I398ae9901b27f6b65f03aad03638939b5880a671
    Reviewed-on: https://gerrit.libreoffice.org/58626
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/chart2/source/tools/InternalDataProvider.cxx b/chart2/source/tools/InternalDataProvider.cxx
index b5f0541c8236..e0867bb4a131 100644
--- a/chart2/source/tools/InternalDataProvider.cxx
+++ b/chart2/source/tools/InternalDataProvider.cxx
@@ -865,7 +865,7 @@ Sequence< uno::Any > SAL_CALL InternalDataProvider::getDataByRangeRepresentation
 
     if( aRange.match( lcl_aLabelRangePrefix ) )
     {
-        sal_Int32 nIndex = aRange.copy( strlen(lcl_aLabelRangePrefix)).toInt32();
+        auto nIndex = aRange.copy( strlen(lcl_aLabelRangePrefix)).toUInt32();
         vector< uno::Any > aComplexLabel = m_bDataInColumns
             ? m_aInternalData.getComplexColumnLabel( nIndex )
             : m_aInternalData.getComplexRowLabel( nIndex );
@@ -874,7 +874,7 @@ Sequence< uno::Any > SAL_CALL InternalDataProvider::getDataByRangeRepresentation
     }
     else if( aRange.match( lcl_aCategoriesPointRangeNamePrefix ) )
     {
-        sal_Int32 nPointIndex = aRange.copy( strlen(lcl_aCategoriesPointRangeNamePrefix) ).toInt32();
+        auto nPointIndex = aRange.copy( strlen(lcl_aCategoriesPointRangeNamePrefix) ).toUInt32();
         vector< uno::Any > aComplexCategory = m_bDataInColumns
             ? m_aInternalData.getComplexRowLabel( nPointIndex )
             : m_aInternalData.getComplexColumnLabel( nPointIndex );
diff --git a/connectivity/source/commontools/RowFunctionParser.cxx b/connectivity/source/commontools/RowFunctionParser.cxx
index afdbac9c9a52..f5942c8f7b0f 100644
--- a/connectivity/source/commontools/RowFunctionParser.cxx
+++ b/connectivity/source/commontools/RowFunctionParser.cxx
@@ -231,7 +231,7 @@ public:
     }
     virtual ORowSetValueDecoratorRef evaluate(const ODatabaseMetaDataResultSet::ORow& _aRow ) const override
     {
-        return _aRow[mpArg->evaluate(_aRow )->getValue().getInt32()];
+        return _aRow[mpArg->evaluate(_aRow )->getValue().getUInt32()];
     }
     virtual void fill(const ODatabaseMetaDataResultSet::ORow& /*_aRow*/ ) const override
     {
diff --git a/desktop/source/splash/unxsplash.cxx b/desktop/source/splash/unxsplash.cxx
index 88f1aef5090b..0cc948ee121b 100644
--- a/desktop/source/splash/unxsplash.cxx
+++ b/desktop/source/splash/unxsplash.cxx
@@ -94,7 +94,7 @@ UnxSplashScreen::initialize( const css::uno::Sequence< css::uno::Any>& )
         OUString aNum;
         if ( aArg.startsWithIgnoreAsciiCase("--splash-pipe=", &aNum) )
         {
-            int fd = aNum.toInt32();
+            auto fd = aNum.toUInt32();
             m_pOutFd = fdopen( fd, "w" );
             SAL_INFO("desktop.splash", "Got argument '--splash-pipe=" << fd << " ('"
                 << aNum << "') ("
diff --git a/oox/source/ppt/comments.cxx b/oox/source/ppt/comments.cxx
index 34206cffa37e..468a648ea99a 100644
--- a/oox/source/ppt/comments.cxx
+++ b/oox/source/ppt/comments.cxx
@@ -33,11 +33,11 @@ void Comment::setDateTime (const OUString& _datetime)
 {
     OUString datetime = _datetime;
     aDateTime.Year = datetime.getToken(0,'-').toInt32();
-    aDateTime.Month = datetime.getToken(1,'-').toInt32();
-    aDateTime.Day = datetime.getToken(2,'-').toInt32();
+    aDateTime.Month = datetime.getToken(1,'-').toUInt32();
+    aDateTime.Day = datetime.getToken(2,'-').toUInt32();
     datetime = datetime.getToken(1,'T');
-    aDateTime.Hours = datetime.getToken(0,':').toInt32();
-    aDateTime.Minutes = datetime.getToken(1,':').toInt32();
+    aDateTime.Hours = datetime.getToken(0,':').toUInt32();
+    aDateTime.Minutes = datetime.getToken(1,':').toUInt32();
     double seconds = datetime.getToken(2,':').toDouble();
     aDateTime.Seconds = floor(seconds);
     seconds -= aDateTime.Seconds;
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index d6ac02c82650..11169116e84d 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -2864,7 +2864,7 @@ void ScViewData::ReadUserData(const OUString& rData)
     // SetPagebreakMode must always be called due to CalcPPT / RecalcPixPos()
 
     // sheet may have become invalid (for instance last version):
-    SCTAB nNewTab = static_cast<SCTAB>(rData.getToken(1, ';').toInt32());
+    SCTAB nNewTab = static_cast<SCTAB>(rData.getToken(1, ';').toUInt32());
     if (pDoc->HasTable( nNewTab ))
         SetTabNo(nNewTab);
 
diff --git a/sfx2/source/dialog/mgetempl.cxx b/sfx2/source/dialog/mgetempl.cxx
index 5e8a8b4826b0..867933a89ba6 100644
--- a/sfx2/source/dialog/mgetempl.cxx
+++ b/sfx2/source/dialog/mgetempl.cxx
@@ -434,7 +434,7 @@ bool SfxManageStyleSheetPage::FillItemSet( SfxItemSet* rSet )
         bModified = true;
         OSL_ENSURE( pItem, "No Item" );
         // is only possibly for user templates
-        SfxStyleSearchBits nMask = pItem->GetFilterList()[m_xFilterLb->get_id(nFilterIdx).toInt32()].nFlags | SfxStyleSearchBits::UserDefined;
+        SfxStyleSearchBits nMask = pItem->GetFilterList()[m_xFilterLb->get_id(nFilterIdx).toUInt32()].nFlags | SfxStyleSearchBits::UserDefined;
         pStyle->SetMask( nMask );
     }
     if (m_xAutoCB->get_visible() && m_xAutoCB->get_state_changed_from_saved())
diff --git a/sw/source/core/tox/txmsrt.cxx b/sw/source/core/tox/txmsrt.cxx
index 41b66760ec20..a5dbd956b0c5 100644
--- a/sw/source/core/tox/txmsrt.cxx
+++ b/sw/source/core/tox/txmsrt.cxx
@@ -673,7 +673,7 @@ sal_uInt16 SwTOXAuthority::GetLevel() const
     sal_uInt16 nRet = 1;
     if( pTOXIntl->IsNumeric( sText ) )
     {
-        nRet = static_cast<sal_uInt16>(sText.toInt32());
+        nRet = sText.toUInt32();
         nRet++;
     }
     //illegal values are also set to 'ARTICLE' as non-numeric values are
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 5f112ea0b1fc..9ea5388cbc4b 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2652,7 +2652,7 @@ bool DocxAttributeOutput::StartURL( const OUString& rUrl, const OUString& rTarge
                     // Extract <seqname>, the field instruction text has the name quoted.
                     OUString aSequenceName = sMark.copy(0, nPos);
                     // Extract <index>.
-                    sal_uInt32 nIndex = sMark.copy(nPos + 1, sMark.getLength() - nPos - sizeof("|sequence")).toInt32();
+                    sal_uInt32 nIndex = sMark.copy(nPos + 1, sMark.getLength() - nPos - sizeof("|sequence")).toUInt32();
                     std::map<OUString, std::vector<OString> >::iterator it = m_aSeqBookmarksNames.find(aSequenceName);
                     if (it != m_aSeqBookmarksNames.end())
                     {
diff --git a/sw/source/uibase/misc/glosdoc.cxx b/sw/source/uibase/misc/glosdoc.cxx
index c23f9d36c127..b2037bc4e61b 100644
--- a/sw/source/uibase/misc/glosdoc.cxx
+++ b/sw/source/uibase/misc/glosdoc.cxx
@@ -120,7 +120,7 @@ bool SwGlossaries::FindGroupName(OUString& rGroup)
     for(size_t i = 0; i < nCount; ++i)
     {
         const OUString sTemp( GetGroupName( i ));
-        sal_uInt16 nPath = static_cast<sal_uInt16>(sTemp.getToken(1, GLOS_DELIM).toInt32());
+        sal_uInt16 nPath = sTemp.getToken(1, GLOS_DELIM).toUInt32();
 
         if (!SWUnoHelper::UCB_IsCaseSensitiveFileName( m_PathArr[nPath] )
              && rSCmp.isEqual( rGroup, sTemp.getToken( 0, GLOS_DELIM) ) )


More information about the Libreoffice-commits mailing list