[Libreoffice-commits] .: 5 commits - accessibility/source chart2/source comphelper/source lotuswordpro/source sal/qa

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Sep 15 06:23:25 PDT 2012


 accessibility/source/extended/accessibleiconchoicectrl.cxx                  |   23 ++++------
 accessibility/source/extended/accessiblelistbox.cxx                         |   22 ++++-----
 accessibility/source/extended/accessiblelistboxentry.cxx                    |   10 +---
 chart2/source/controller/chartapiwrapper/WrappedSeriesOrDiagramProperty.hxx |    4 -
 comphelper/source/property/MasterPropertySet.cxx                            |   11 +---
 lotuswordpro/source/filter/xfilter/xfliststyle.cxx                          |    1 
 sal/qa/rtl/oustring/rtl_OUString2.cxx                                       |    2 
 7 files changed, 32 insertions(+), 41 deletions(-)

New commits:
commit d7515f60dc0ebb54fb2db7de46b3579963698e6a
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Sep 15 15:16:04 2012 +0200

    Simplify AutoOGuardArray + rename private attribute
    
    Change-Id: I9d651303fb80ef5c81d608e56a87cb9548c13f8f

diff --git a/comphelper/source/property/MasterPropertySet.cxx b/comphelper/source/property/MasterPropertySet.cxx
index 1f353cc..1cc524b 100644
--- a/comphelper/source/property/MasterPropertySet.cxx
+++ b/comphelper/source/property/MasterPropertySet.cxx
@@ -30,26 +30,23 @@
 
 class AutoOGuardArray
 {
-    sal_Int32                       nSize;
-    boost::scoped_ptr< osl::SolarGuard > *  pGuardArray;
+    boost::scoped_ptr< osl::SolarGuard > *  mpGuardArray;
 
 public:
     AutoOGuardArray( sal_Int32 nNumElements );
     ~AutoOGuardArray();
 
-    boost::scoped_ptr< osl::SolarGuard > &  operator[] ( sal_Int32 i ) { return pGuardArray[i]; }
+    boost::scoped_ptr< osl::SolarGuard > &  operator[] ( sal_Int32 i ) { return mpGuardArray[i]; }
 };
 
-AutoOGuardArray::AutoOGuardArray( sal_Int32 nNumElements )
+AutoOGuardArray::AutoOGuardArray( sal_Int32 nNumElements ) : mpGuardArray(new boost::scoped_ptr< osl::SolarGuard >[nNumElements])
 {
-    nSize       = nNumElements;
-    pGuardArray = new boost::scoped_ptr< osl::SolarGuard >[ nSize ];
 }
 
 AutoOGuardArray::~AutoOGuardArray()
 {
     //!! release auto_ptr's and thus the mutexes locks
-    delete [] pGuardArray;
+    delete [] mpGuardArray;
 
 }
 
commit 64787ead29124860841e892b66319979e13ee61e
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Sep 15 14:07:54 2012 +0200

    Remove unused variable
    
    Should we use vector for m_pListLevels and use iterator then?
    Where does the "10" come from?
    
    Change-Id: I2c0d569db48226149645f039ca11633ae2b6c7a2

diff --git a/lotuswordpro/source/filter/xfilter/xfliststyle.cxx b/lotuswordpro/source/filter/xfilter/xfliststyle.cxx
index 24bc2b7..daee185 100644
--- a/lotuswordpro/source/filter/xfilter/xfliststyle.cxx
+++ b/lotuswordpro/source/filter/xfilter/xfliststyle.cxx
@@ -317,7 +317,6 @@ void    XFListStyle::SetListNumber(sal_Int32 level, XFNumFmt& fmt, sal_Int16 sta
 
 void XFListStyle::ToXml(IXFStream *pStrm)
 {
-    std::vector<XFListLevel*>::iterator it;
     IXFAttrList *pAttrList = pStrm->GetAttrList();
 
     pAttrList->Clear();
commit f2504a0a9ff348784b1533ff3798c1e762c6201c
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Sep 15 13:34:50 2012 +0200

    Fix some "Variables reassigned a value before the old one has been used"
    
    Change-Id: I64eadd8f34e9d60e9d696fa572dc0001532eab02

diff --git a/accessibility/source/extended/accessibleiconchoicectrl.cxx b/accessibility/source/extended/accessibleiconchoicectrl.cxx
index e617f42..16202db 100644
--- a/accessibility/source/extended/accessibleiconchoicectrl.cxx
+++ b/accessibility/source/extended/accessibleiconchoicectrl.cxx
@@ -250,10 +250,9 @@ namespace accessibility
 
         ensureAlive();
 
-        sal_Int32 i, nCount = 0;
         SvtIconChoiceCtrl* pCtrl = getCtrl();
-        nCount = pCtrl->GetEntryCount();
-        for ( i = 0; i < nCount; ++i )
+        sal_Int32 nCount = pCtrl->GetEntryCount();
+        for ( sal_Int32 i = 0; i < nCount; ++i )
         {
             SvxIconChoiceCtrlEntry* pEntry = pCtrl->GetEntry( i );
             if ( pCtrl->GetCursor() != pEntry )
@@ -267,10 +266,10 @@ namespace accessibility
 
         ensureAlive();
 
-        sal_Int32 i, nSelCount = 0, nCount = 0;
+        sal_Int32 nSelCount = 0;
         SvtIconChoiceCtrl* pCtrl = getCtrl();
-        nCount = pCtrl->GetEntryCount();
-        for ( i = 0; i < nCount; ++i )
+        sal_Int32 nCount = pCtrl->GetEntryCount();
+        for ( sal_Int32 i = 0; i < nCount; ++i )
         {
             SvxIconChoiceCtrlEntry* pEntry = pCtrl->GetEntry( i );
             if ( pCtrl->GetCursor() == pEntry )
@@ -290,10 +289,10 @@ namespace accessibility
             throw IndexOutOfBoundsException();
 
         Reference< XAccessible > xChild;
-        sal_Int32 i, nSelCount = 0, nCount = 0;
+        sal_Int32 nSelCount = 0;
         SvtIconChoiceCtrl* pCtrl = getCtrl();
-        nCount = pCtrl->GetEntryCount();
-        for ( i = 0; i < nCount; ++i )
+        sal_Int32 nCount = pCtrl->GetEntryCount();
+        for ( sal_Int32 i = 0; i < nCount; ++i )
         {
             SvxIconChoiceCtrlEntry* pEntry = pCtrl->GetEntry( i );
             if ( pCtrl->GetCursor() == pEntry )
@@ -319,11 +318,11 @@ namespace accessibility
             throw IndexOutOfBoundsException();
 
         Reference< XAccessible > xChild;
-        sal_Int32 i, nSelCount = 0, nCount = 0;
+        sal_Int32 nSelCount = 0;
         SvtIconChoiceCtrl* pCtrl = getCtrl();
-        nCount = pCtrl->GetEntryCount();
+        sal_Int32 nCount = pCtrl->GetEntryCount();
         bool bFound = false;
-        for ( i = 0; i < nCount; ++i )
+        for ( sal_Int32 i = 0; i < nCount; ++i )
         {
             SvxIconChoiceCtrlEntry* pEntry = pCtrl->GetEntry( i );
             if ( pEntry->IsSelected() )
diff --git a/accessibility/source/extended/accessiblelistbox.cxx b/accessibility/source/extended/accessiblelistbox.cxx
index e1a410a..d96754d 100644
--- a/accessibility/source/extended/accessiblelistbox.cxx
+++ b/accessibility/source/extended/accessiblelistbox.cxx
@@ -307,9 +307,8 @@ namespace accessibility
 
         ensureAlive();
 
-        sal_Int32 i, nCount = 0;
-        nCount = getListBox()->GetLevelChildCount( NULL );
-        for ( i = 0; i < nCount; ++i )
+        sal_Int32 nCount = getListBox()->GetLevelChildCount( NULL );
+        for ( sal_Int32 i = 0; i < nCount; ++i )
         {
             SvLBoxEntry* pEntry = getListBox()->GetEntry( i );
             if ( getListBox()->IsSelected( pEntry ) )
@@ -323,9 +322,8 @@ namespace accessibility
 
         ensureAlive();
 
-        sal_Int32 i, nCount = 0;
-        nCount = getListBox()->GetLevelChildCount( NULL );
-        for ( i = 0; i < nCount; ++i )
+        sal_Int32 nCount = getListBox()->GetLevelChildCount( NULL );
+        for ( sal_Int32 i = 0; i < nCount; ++i )
         {
             SvLBoxEntry* pEntry = getListBox()->GetEntry( i );
             if ( !getListBox()->IsSelected( pEntry ) )
@@ -339,9 +337,9 @@ namespace accessibility
 
         ensureAlive();
 
-        sal_Int32 i, nSelCount = 0, nCount = 0;
-        nCount = getListBox()->GetLevelChildCount( NULL );
-        for ( i = 0; i < nCount; ++i )
+        sal_Int32 nSelCount = 0;
+        sal_Int32 nCount = getListBox()->GetLevelChildCount( NULL );
+        for ( sal_Int32 i = 0; i < nCount; ++i )
         {
             SvLBoxEntry* pEntry = getListBox()->GetEntry( i );
             if ( getListBox()->IsSelected( pEntry ) )
@@ -361,9 +359,9 @@ namespace accessibility
             throw IndexOutOfBoundsException();
 
         Reference< XAccessible > xChild;
-        sal_Int32 i, nSelCount = 0, nCount = 0;
-        nCount = getListBox()->GetLevelChildCount( NULL );
-        for ( i = 0; i < nCount; ++i )
+        sal_Int32 nSelCount= 0;
+        sal_Int32 nCount = getListBox()->GetLevelChildCount( NULL );
+        for ( sal_Int32 i = 0; i < nCount; ++i )
         {
             SvLBoxEntry* pEntry = getListBox()->GetEntry( i );
             if ( getListBox()->IsSelected( pEntry ) )
diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx b/accessibility/source/extended/accessiblelistboxentry.cxx
index 36fc170..3b05336 100644
--- a/accessibility/source/extended/accessiblelistboxentry.cxx
+++ b/accessibility/source/extended/accessiblelistboxentry.cxx
@@ -730,9 +730,8 @@ namespace accessibility
         SvLBoxEntry* pParent = getListBox()->GetEntryFromPath( m_aEntryPath );
         if ( !pParent )
             throw RuntimeException();
-        sal_Int32 i, nCount = 0;
-        nCount = getListBox()->GetLevelChildCount( pParent );
-        for ( i = 0; i < nCount; ++i )
+        sal_Int32 nCount = getListBox()->GetLevelChildCount( pParent );
+        for ( sal_Int32 i = 0; i < nCount; ++i )
         {
             SvLBoxEntry* pEntry = getListBox()->GetEntry( pParent, i );
             if ( getListBox()->IsSelected( pEntry ) )
@@ -750,9 +749,8 @@ namespace accessibility
         SvLBoxEntry* pParent = getListBox()->GetEntryFromPath( m_aEntryPath );
         if ( !pParent )
             throw RuntimeException();
-        sal_Int32 i, nCount = 0;
-        nCount = getListBox()->GetLevelChildCount( pParent );
-        for ( i = 0; i < nCount; ++i )
+        sal_Int32 nCount = getListBox()->GetLevelChildCount( pParent );
+        for ( sal_Int32 i = 0; i < nCount; ++i )
         {
             SvLBoxEntry* pEntry = getListBox()->GetEntry( pParent, i );
             if ( !getListBox()->IsSelected( pEntry ) )
commit a579ad2c086f1854f7bb6058ec590d1427e72984
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Sep 15 13:18:35 2012 +0200

    Prefer prefix ++/-- operators for non-primitive types
    
    Change-Id: Ia6a14d2365fe0a31892517387035e4ebec1f25eb

diff --git a/chart2/source/controller/chartapiwrapper/WrappedSeriesOrDiagramProperty.hxx b/chart2/source/controller/chartapiwrapper/WrappedSeriesOrDiagramProperty.hxx
index 7402c3b..5caee38 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedSeriesOrDiagramProperty.hxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedSeriesOrDiagramProperty.hxx
@@ -72,7 +72,7 @@ public:
                 ::chart::DiagramHelper::getDataSeriesFromDiagram( m_spChart2ModelContact->getChart2Diagram() ) );
             ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > >::const_iterator aIter =
                     aSeriesVector.begin();
-            for( ; aIter != aSeriesVector.end(); aIter++ )
+            for( ; aIter != aSeriesVector.end(); ++aIter )
             {
                 PROPERTYTYPE aCurValue = getValueFromSeries( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >::query( *aIter ) );
                 if( !bHasDetectableInnerValue )
@@ -101,7 +101,7 @@ public:
                 ::chart::DiagramHelper::getDataSeriesFromDiagram( m_spChart2ModelContact->getChart2Diagram() ) );
             ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > >::const_iterator aIter =
                     aSeriesVector.begin();
-            for( ; aIter != aSeriesVector.end(); aIter++ )
+            for( ; aIter != aSeriesVector.end(); ++aIter )
             {
                 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xSeriesPropertySet( *aIter, ::com::sun::star::uno::UNO_QUERY );
                 if( xSeriesPropertySet.is() )
commit fb98459e66461f5ff82d849decb170ee0d81a391
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Sep 15 13:16:50 2012 +0200

    Fix comparison
    
    Change-Id: Id2db7abdec7373082f85fb9d8479427d09cc0a12

diff --git a/sal/qa/rtl/oustring/rtl_OUString2.cxx b/sal/qa/rtl/oustring/rtl_OUString2.cxx
index eebbcc6..f69b517 100644
--- a/sal/qa/rtl/oustring/rtl_OUString2.cxx
+++ b/sal/qa/rtl/oustring/rtl_OUString2.cxx
@@ -270,7 +270,7 @@ sal_Int16 SAL_CALL checkPrecisionSize()
         volatile T nValue = nCalcValue + static_cast<T>(0.1);
         volatile T dSub = nValue - nCalcValue;
         // ----- 0.11 ---- 0.1 ---- 0.09 -----
-        if (0.11 > dSub && dSub < 0.09)
+        if (0.11 > dSub && dSub > 0.09)
         {
             // due to the fact, that the value is break down we sub 1 from the precision value
             // but to suppress this, we start at zero, precision is i+1 till here --i;


More information about the Libreoffice-commits mailing list