[Libreoffice-commits] core.git: 5 commits - basic/source dbaccess/source l10ntools/source reportdesign/source sc/source

Markus Mohrhard markus.mohrhard at googlemail.com
Thu Feb 28 22:00:42 PST 2013


 basic/source/sbx/sbxint.cxx                                  |    5 ++++-
 dbaccess/source/ui/browser/genericcontroller.cxx             |    2 +-
 l10ntools/source/directory.cxx                               |    2 +-
 reportdesign/source/core/api/ReportDefinition.cxx            |    2 +-
 sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx |    6 +++---
 5 files changed, 10 insertions(+), 7 deletions(-)

New commits:
commit 03bbfe0a5754091f68eab01b15c6fb5726cfbed7
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Mar 1 06:16:28 2013 +0100

    coverity#705110: use of invalid iterator
    
    Change-Id: I13bb65892ffe09fa6f8bb70321e8846edcdc728c

diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index 14592bc..d5abf52 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -2553,7 +2553,7 @@ void SAL_CALL OStylesHelper::replaceByName( const ::rtl::OUString& aName, const
 {
     ::osl::MutexGuard aGuard(m_aMutex);
     TStyleElements::iterator aFind = m_aElements.find(aName);
-    if ( aFind != m_aElements.end() )
+    if ( aFind == m_aElements.end() )
         throw container::NoSuchElementException();
     if ( !aElement.isExtractableTo(m_aType) )
         throw lang::IllegalArgumentException();
commit 2828fe2fd6d3698dc1686811c17675e74afd1642
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Mar 1 06:13:50 2013 +0100

    coverity#705109: use of invalid iterator
    
    Change-Id: I9c16071a4182801ef5fed8b3d3661accce596716

diff --git a/l10ntools/source/directory.cxx b/l10ntools/source/directory.cxx
index 468bfbd..0571f5e 100644
--- a/l10ntools/source/directory.cxx
+++ b/l10ntools/source/directory.cxx
@@ -67,7 +67,7 @@ void Directory::scanSubDir( int nLevels )
     readDirectory( sFullName );
     dump();
     if( nLevels > 0 ) {
-        for( std::vector< transex::Directory >::iterator iter = aDirVec.begin() ; iter != aDirVec.end() || nLevels > 0 ; ++iter , nLevels-- )
+        for( std::vector< transex::Directory >::iterator iter = aDirVec.begin() ; iter != aDirVec.end() && nLevels > 0 ; ++iter , nLevels-- )
         {
             ( *iter ).scanSubDir();
         }
commit 6de8f018b687d37d01d04fde9156438a5c7eed9d
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Mar 1 06:11:09 2013 +0100

    coverity#705107: use of invalid iterator
    
    Change-Id: I2f36090f7d1b009466a973f3795c668f001063c2

diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx b/dbaccess/source/ui/browser/genericcontroller.cxx
index c2aa930..b80e613 100644
--- a/dbaccess/source/ui/browser/genericcontroller.cxx
+++ b/dbaccess/source/ui/browser/genericcontroller.cxx
@@ -815,7 +815,7 @@ void OGenericUnoController::removeStatusListener(const Reference< XStatusListene
                 )
             )
         {
-            m_arrStatusListener.erase( iterSearch );
+            m_arrStatusListener.erase( iterSearch++ );
             if (!bRemoveForAll)
                 // remove the listener only for the given URL, so we can exit the loop after deletion
                 break;
commit 5271d78920dd4159025db6786a6f0568b7131a76
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Mar 1 06:05:34 2013 +0100

    coverity#736015: use of invalid iterator
    
    Change-Id: Id72e6a2f9c11e72507a8c5c48f9627a1b529dd6f

diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
index 6dd8f6a..be40bd8 100644
--- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx
@@ -242,14 +242,14 @@ uno::Reference<XAccessible> ScNotesChildren::GetChild(sal_Int32 nIndex) const
             if (aItr != aEndItr)
             {
                 OSL_ENSURE((aItr->maNoteCell == maMarks[nIndex].maNoteCell) && (aItr->mbMarkNote == maMarks[nIndex].mbMarkNote), "wrong note found");
+                if (!aItr->mpTextHelper)
+                    aItr->mpTextHelper = CreateTextHelper(maMarks[nIndex].maNoteText, maMarks[nIndex].maRect, maMarks[nIndex].maNoteCell, maMarks[nIndex].mbMarkNote, nIndex + mnOffset); // the marks are the first and every mark has only one paragraph
+                xAccessible = aItr->mpTextHelper->GetChild(aParaFound.mnIndex + aItr->mpTextHelper->GetStartIndex());
             }
             else
             {
                 OSL_FAIL("wrong note found");
             }
-            if (!aItr->mpTextHelper)
-                aItr->mpTextHelper = CreateTextHelper(maMarks[nIndex].maNoteText, maMarks[nIndex].maRect, maMarks[nIndex].maNoteCell, maMarks[nIndex].mbMarkNote, nIndex + mnOffset); // the marks are the first and every mark has only one paragraph
-            xAccessible = aItr->mpTextHelper->GetChild(aParaFound.mnIndex + aItr->mpTextHelper->GetStartIndex());
         }
         else
         {
commit ece1af8c7f9f176b24ba976480518050af087e9e
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Mar 1 05:34:37 2013 +0100

    coverity#736108: nesting level mismatch
    
    Change-Id: I6e6a3baa5aba5591a40fd236e7a2056fb59d6977

diff --git a/basic/source/sbx/sbxint.cxx b/basic/source/sbx/sbxint.cxx
index dc8cd94..7713c76 100644
--- a/basic/source/sbx/sbxint.cxx
+++ b/basic/source/sbx/sbxint.cxx
@@ -881,7 +881,10 @@ start:
             *p->pDouble = ImpSalUInt64ToDouble( n ); break;
         case SbxBYREF | SbxCURRENCY:
             if ( n > ( SbxMAXSALINT64 / CURRENCY_FACTOR ) )
-                 SbxBase::SetError( SbxERR_OVERFLOW ); n = SbxMAXSALINT64;
+            {
+                 SbxBase::SetError( SbxERR_OVERFLOW );
+                 n = SbxMAXSALINT64;
+            }
             *p->pnInt64 = ( sal_Int64) ( n * CURRENCY_FACTOR ); break;
         case SbxBYREF | SbxSALUINT64:
             *p->puInt64 = n; break;


More information about the Libreoffice-commits mailing list