[Libreoffice-commits] .: 3 commits - sc/source

Caolán McNamara caolan at kemper.freedesktop.org
Sun Jan 9 13:16:34 PST 2011


 sc/source/core/data/attarray.cxx         |    6 +++---
 sc/source/core/tool/chartlis.cxx         |    2 --
 sc/source/core/tool/interpr1.cxx         |    2 +-
 sc/source/ui/dbgui/scuiimoptdlg.cxx      |    4 ++--
 sc/source/ui/vba/testvba/testvba.cxx     |    5 -----
 sc/source/ui/vba/vbachart.cxx            |    2 +-
 sc/source/ui/vba/vbachart.hxx            |    3 +--
 sc/source/ui/vba/vbaformatconditions.hxx |    2 +-
 sc/source/ui/vba/vbaoutline.cxx          |    2 +-
 sc/source/ui/vba/vbapane.hxx             |    2 +-
 sc/source/ui/vba/vbarange.cxx            |    2 +-
 sc/source/ui/vba/vbarange.hxx            |    4 ++--
 sc/source/ui/vba/vbastyle.cxx            |    2 +-
 sc/source/ui/view/output2.cxx            |    1 +
 14 files changed, 16 insertions(+), 23 deletions(-)

New commits:
commit e8ce403d008a0cc939905d00010bd61fca55e665
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 9 21:16:23 2011 +0000

    WaE: get member init order right

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 2f841f0..1dc8a92 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -190,10 +190,10 @@ ScDrawStringsVars::ScDrawStringsVars(ScOutputData* pData, BOOL bPTL) :
     pOutput		( pData ),
     pPattern	( NULL ),
     pCondSet	( NULL ),
+    nAscentPixel(0),
     eAttrOrient	( SVX_ORIENTATION_STANDARD ),
     eAttrHorJust( SVX_HOR_JUSTIFY_STANDARD ),
     eAttrVerJust( SVX_VER_JUSTIFY_BOTTOM ),
-    nAscentPixel(0),
     eAttrHorJustMethod( SVX_JUSTIFY_METHOD_AUTO ),
     eAttrVerJustMethod( SVX_JUSTIFY_METHOD_AUTO ),
     pMargin		( NULL ),
commit a1307271f1b7b343e57507a58b588e404e6b6ee1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Jan 9 21:13:46 2011 +0000

    remove some empty methods

diff --git a/sc/source/ui/vba/testvba/testvba.cxx b/sc/source/ui/vba/testvba/testvba.cxx
index 236fc19..06729c1 100644
--- a/sc/source/ui/vba/testvba/testvba.cxx
+++ b/sc/source/ui/vba/testvba/testvba.cxx
@@ -120,11 +120,6 @@ mxCompLoader( _xCompLoader ), msOutDirPath( convertToURL( _outDirPath  ) )
         return sLogLocation;
     }
 
-    void init() const
-    {
-        // blow away previous logs?
-    }
-
     void proccessDocument( const rtl::OUString& sUrl ) 
     {
             if ( !mxSFA->isFolder( sUrl ) && sUrl.endsWithIgnoreAsciiCaseAsciiL( ".xls", 4 ) ) 
diff --git a/sc/source/ui/vba/vbachart.hxx b/sc/source/ui/vba/vbachart.hxx
index 45210a1..ac8119c 100644
--- a/sc/source/ui/vba/vbachart.hxx
+++ b/sc/source/ui/vba/vbachart.hxx
@@ -69,7 +69,6 @@ friend class ScVbaAxis;
     bool hasMarkers() throw ( css::script::BasicErrorException );
     sal_Int32 getMarkerType(sal_Int32 _nWithMarkers, sal_Int32 _nWithoutMarkers) throw ( css::script::BasicErrorException ); 
     void assignDiagramAttributes();
-    void setDefaultSeriesDescriptionLabels() const {}
 public:
     ScVbaChart( const css::uno::Reference< ov::XHelperInterface >& _xParent, const css::uno::Reference< css::uno::XComponentContext >& _xContext, const css::uno::Reference< css::lang::XComponent >& _xChartComponent, const css::uno::Reference< css::table::XTableChart >& _xTableChart );
 
commit 4fa74cb55c4901578580474cb6775a56aa1d6bdf
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sun Jan 9 21:11:58 2011 +0000

    some cppcheckcleaning

diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index e18921c..574ab1f 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -234,14 +234,14 @@ BOOL ScAttrArray::Concat(SCSIZE nPos)
 
 BOOL ScAttrArray::Search( SCROW nRow, SCSIZE& nIndex ) const
 {
-    long	nLo 		= 0;
     long	nHi 		= static_cast<long>(nCount) - 1;
-    long	nStartRow	= 0;
-    long	nEndRow		= 0;
     long	i			= 0;
     BOOL	bFound		= (nCount == 1);
     if (pData)
     {
+        long nLo = 0;
+        long nStartRow = 0;
+        long nEndRow = 0;
         while ( !bFound && nLo <= nHi )
         {
             i = (nLo + nHi) / 2;
diff --git a/sc/source/core/tool/chartlis.cxx b/sc/source/core/tool/chartlis.cxx
index bfb3d57..095fdbd 100644
--- a/sc/source/core/tool/chartlis.cxx
+++ b/sc/source/core/tool/chartlis.cxx
@@ -336,7 +336,6 @@ public:
                 endListening(aRange);
         }
     }
-
 private:
     void startListening(const ScRange& rRange)
     {
@@ -353,7 +352,6 @@ private:
         else
             mpDoc->EndListeningArea(rRange, &mrParent);
     }
-
 private:
     ScDocument* mpDoc;
     ScChartListener& mrParent;
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 1c890b5..f88d332 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -4206,7 +4206,6 @@ static void lcl_GetLastMatch( SCSIZE& rIndex, const VectorMatrixAccessor& rMat,
 void ScInterpreter::ScMatch()
 {
     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "sc", "er", "ScInterpreter::ScMatch" );
-    ScMatrixRef pMatSrc = NULL;
 
     BYTE nParamCount = GetByte();
     if ( MustHaveParamCount( nParamCount, 2, 3 ) )
@@ -4222,6 +4221,7 @@ void ScInterpreter::ScMatch()
         SCCOL nCol2 = 0;
         SCROW nRow2 = 0;
         SCTAB nTab2 = 0;
+        ScMatrixRef pMatSrc = NULL;
 
         switch (GetStackType())
         {
diff --git a/sc/source/ui/dbgui/scuiimoptdlg.cxx b/sc/source/ui/dbgui/scuiimoptdlg.cxx
index d187301..f3edeaa 100644
--- a/sc/source/ui/dbgui/scuiimoptdlg.cxx
+++ b/sc/source/ui/dbgui/scuiimoptdlg.cxx
@@ -69,10 +69,10 @@ private:
 USHORT ScDelimiterTable::GetCode( const String& rDel ) const
 {
     sal_Unicode nCode = 0;
-    xub_StrLen i = 0;
 
     if ( nCount >= 2 )
     {
+        xub_StrLen i = 0;
         while ( i<nCount )
         {
             if ( rDel == theDelTab.GetToken( i, cSep ) )
@@ -93,10 +93,10 @@ USHORT ScDelimiterTable::GetCode( const String& rDel ) const
 String ScDelimiterTable::GetDelimiter( sal_Unicode nCode ) const
 {
     String aStrDel;
-    xub_StrLen i = 0;
 
     if ( nCount >= 2 )
     {
+        xub_StrLen i = 0;
         while ( i<nCount )
         {
             if ( nCode == (sal_Unicode) theDelTab.GetToken( i+1, cSep ).ToInt32() )
diff --git a/sc/source/ui/vba/testvba/testvba.cxx b/sc/source/ui/vba/testvba/testvba.cxx
index 3ca44cc..236fc19 100644
--- a/sc/source/ui/vba/testvba/testvba.cxx
+++ b/sc/source/ui/vba/testvba/testvba.cxx
@@ -120,7 +120,7 @@ mxCompLoader( _xCompLoader ), msOutDirPath( convertToURL( _outDirPath  ) )
         return sLogLocation;
     }
 
-    void init() 
+    void init() const
     {
         // blow away previous logs?
     }
diff --git a/sc/source/ui/vba/vbachart.cxx b/sc/source/ui/vba/vbachart.cxx
index fb02586..647e3ba 100644
--- a/sc/source/ui/vba/vbachart.cxx
+++ b/sc/source/ui/vba/vbachart.cxx
@@ -96,7 +96,7 @@ ScVbaChart::getName() throw (css::uno::RuntimeException)
     {
         xProps->getPropertyValue( CHART_NAME ) >>= sName;
     }
-    catch( uno::Exception e ) // swallow exceptions
+    catch( uno::Exception & ) // swallow exceptions
     {
     }
     return sName;
diff --git a/sc/source/ui/vba/vbachart.hxx b/sc/source/ui/vba/vbachart.hxx
index 3602baa..45210a1 100644
--- a/sc/source/ui/vba/vbachart.hxx
+++ b/sc/source/ui/vba/vbachart.hxx
@@ -69,12 +69,12 @@ friend class ScVbaAxis;
     bool hasMarkers() throw ( css::script::BasicErrorException );
     sal_Int32 getMarkerType(sal_Int32 _nWithMarkers, sal_Int32 _nWithoutMarkers) throw ( css::script::BasicErrorException ); 
     void assignDiagramAttributes();
-    void setDefaultSeriesDescriptionLabels(){}
+    void setDefaultSeriesDescriptionLabels() const {}
 public:
     ScVbaChart( const css::uno::Reference< ov::XHelperInterface >& _xParent, const css::uno::Reference< css::uno::XComponentContext >& _xContext, const css::uno::Reference< css::lang::XComponent >& _xChartComponent, const css::uno::Reference< css::table::XTableChart >& _xTableChart );
 
     // Non-interface
-    css::uno::Reference< css::beans::XPropertySet > xDiagramPropertySet() { return mxDiagramPropertySet; }
+    css::uno::Reference< css::beans::XPropertySet > xDiagramPropertySet() const { return mxDiagramPropertySet; }
     bool isSeriesIndexValid(sal_Int32 _seriesindex) throw( css::script::BasicErrorException );
     bool areIndicesValid(sal_Int32 _seriesindex, sal_Int32 _valindex) throw ( css::script::BasicErrorException );
     void setSeriesName(sal_Int32 _index, rtl::OUString _sname) throw ( css::script::BasicErrorException );
diff --git a/sc/source/ui/vba/vbaformatconditions.hxx b/sc/source/ui/vba/vbaformatconditions.hxx
index e51ca23..4193332 100644
--- a/sc/source/ui/vba/vbaformatconditions.hxx
+++ b/sc/source/ui/vba/vbaformatconditions.hxx
@@ -50,7 +50,7 @@ public:
     rtl::OUString getA1Formula(const css::uno::Any& _aFormula) throw ( css::script::BasicErrorException );
     rtl::OUString getStyleName();
     void removeFormatCondition( const rtl::OUString& _sStyleName, sal_Bool _bRemoveStyle) throw ( css::script::BasicErrorException );
-    css::uno::Reference< css::sheet::XSheetConditionalEntries > getSheetConditionalEntries() { return mxSheetConditionalEntries; }
+    css::uno::Reference< css::sheet::XSheetConditionalEntries > getSheetConditionalEntries() const { return mxSheetConditionalEntries; }
     // XFormatConditions
     virtual void SAL_CALL Delete(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
     virtual css::uno::Reference< ov::excel::XFormatCondition > SAL_CALL Add( ::sal_Int32 Type, const css::uno::Any& Operator, const css::uno::Any& Formula1, const css::uno::Any& Formula2 ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
diff --git a/sc/source/ui/vba/vbaoutline.cxx b/sc/source/ui/vba/vbaoutline.cxx
index 3d00b80..410b4f0 100644
--- a/sc/source/ui/vba/vbaoutline.cxx
+++ b/sc/source/ui/vba/vbaoutline.cxx
@@ -32,9 +32,9 @@ using namespace ::ooo::vba;
 void
 ScVbaOutline::ShowLevels( const uno::Any& RowLevels, const uno::Any& ColumnLevels ) throw (uno::RuntimeException) 
 {
-    sal_Int16 nLevel = 0;
     if (mxOutline.is()) 
     {
+        sal_Int16 nLevel = 0;
         if (RowLevels >>= nLevel)
         {
             mxOutline->showLevel(nLevel, table::TableOrientation_ROWS);
diff --git a/sc/source/ui/vba/vbapane.hxx b/sc/source/ui/vba/vbapane.hxx
index 841776a..c4dd653 100644
--- a/sc/source/ui/vba/vbapane.hxx
+++ b/sc/source/ui/vba/vbapane.hxx
@@ -44,7 +44,7 @@ public:
         const css::uno::Reference< css::frame::XModel >& xModel,
         const css::uno::Reference< css::sheet::XViewPane > xViewPane ) throw (css::uno::RuntimeException);
 
-    css::uno::Reference< css::sheet::XViewPane > getViewPane() { return m_xViewPane; }
+    css::uno::Reference< css::sheet::XViewPane > getViewPane() const { return m_xViewPane; }
 
     // XPane attributes
     virtual sal_Int32 SAL_CALL getScrollColumn() throw (css::uno::RuntimeException);
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx
index 445a08b..dd746eb 100644
--- a/sc/source/ui/vba/vbarange.cxx
+++ b/sc/source/ui/vba/vbarange.cxx
@@ -5394,10 +5394,10 @@ ScVbaRange::AutoFill(  const uno::Reference< excel::XRange >& Destination, const
 
     // default to include the number of Rows in the source range;
     SCCOLROW nSourceCount = ( sourceRange.aEnd.Row() - sourceRange.aStart.Row() ) + 1;
-    SCCOLROW nCount = 0;
 
     if ( sourceRange != destRange )
     {
+        SCCOLROW nCount = 0;
         // Find direction of fill, vertical or horizontal
         if ( sourceRange.aStart == destRange.aStart )
         {
diff --git a/sc/source/ui/vba/vbarange.hxx b/sc/source/ui/vba/vbarange.hxx
index b619752..cb31b3c 100644
--- a/sc/source/ui/vba/vbarange.hxx
+++ b/sc/source/ui/vba/vbarange.hxx
@@ -197,8 +197,8 @@ public:
     virtual void SAL_CALL setShowDetail(const css::uno::Any& aShowDetail) throw (css::uno::RuntimeException);
     virtual ::com::sun::star::uno::Reference< ::ooo::vba::excel::XQueryTable > SAL_CALL getQueryTable() throw (::com::sun::star::uno::RuntimeException); //09-09-16 add by limingl
     // Methods
-    sal_Bool IsRows() { return mbIsRows; }
-    sal_Bool IsColumns() { return mbIsColumns; }
+    sal_Bool IsRows() const { return mbIsRows; }
+    sal_Bool IsColumns() const { return mbIsColumns; }
     virtual css::uno::Reference< ov::excel::XComment > SAL_CALL AddComment( const css::uno::Any& Text ) throw (css::uno::RuntimeException);
     virtual void SAL_CALL Clear() throw (css::uno::RuntimeException);
     virtual void SAL_CALL ClearComments() throw (css::uno::RuntimeException);
diff --git a/sc/source/ui/vba/vbastyle.cxx b/sc/source/ui/vba/vbastyle.cxx
index 2594eff..e9c1488 100644
--- a/sc/source/ui/vba/vbastyle.cxx
+++ b/sc/source/ui/vba/vbastyle.cxx
@@ -133,7 +133,7 @@ ScVbaStyle::getNameLocal() throw (script::BasicErrorException, uno::RuntimeExcep
     {
         mxPropertySet->getPropertyValue(DISPLAYNAME) >>= sName;
     }
-    catch (uno::Exception e)
+    catch (uno::Exception &e)
     {
         DebugHelper::exception(SbERR_METHOD_FAILED, rtl::OUString() );
     }
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 3e8d9a6..2f841f0 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -193,6 +193,7 @@ ScDrawStringsVars::ScDrawStringsVars(ScOutputData* pData, BOOL bPTL) :
     eAttrOrient	( SVX_ORIENTATION_STANDARD ),
     eAttrHorJust( SVX_HOR_JUSTIFY_STANDARD ),
     eAttrVerJust( SVX_VER_JUSTIFY_BOTTOM ),
+    nAscentPixel(0),
     eAttrHorJustMethod( SVX_JUSTIFY_METHOD_AUTO ),
     eAttrVerJustMethod( SVX_JUSTIFY_METHOD_AUTO ),
     pMargin		( NULL ),


More information about the Libreoffice-commits mailing list