[Libreoffice-commits] .: xmloff/source xmlscript/source

Julien Nabet serval2412 at kemper.freedesktop.org
Sat Jul 30 14:51:22 PDT 2011


 xmloff/source/chart/SchXMLAutoStylePoolP.cxx |    2 +-
 xmloff/source/chart/SchXMLSeries2Context.cxx |   16 ++++++++--------
 xmloff/source/draw/XMLShapeStyleContext.cxx  |    2 +-
 xmloff/source/draw/ximpstyl.cxx              |    2 +-
 xmloff/source/style/XMLPageExport.cxx        |    2 +-
 xmloff/source/style/chrhghdl.cxx             |    6 ++----
 xmloff/source/style/xmlnumi.cxx              |    2 +-
 xmloff/source/style/xmlprmap.cxx             |    2 +-
 xmloff/source/text/XMLIndexMarkExport.cxx    |    4 ++--
 xmloff/source/text/XMLTextNumRuleInfo.hxx    |    1 +
 xmloff/source/text/txtimp.cxx                |    4 ++--
 xmloff/source/text/txtlists.cxx              |    2 +-
 xmloff/source/text/txtparae.cxx              |    2 +-
 xmlscript/source/xmldlg_imexp/imp_share.hxx  |    2 +-
 14 files changed, 24 insertions(+), 25 deletions(-)

New commits:
commit 433b71d8eb3992a9f79a914a5b79dd4e8ace0f09
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Jul 30 23:51:40 2011 +0200

    Some cppcheck cleaning

diff --git a/xmloff/source/chart/SchXMLAutoStylePoolP.cxx b/xmloff/source/chart/SchXMLAutoStylePoolP.cxx
index 4768c13..2ca8b5f 100644
--- a/xmloff/source/chart/SchXMLAutoStylePoolP.cxx
+++ b/xmloff/source/chart/SchXMLAutoStylePoolP.cxx
@@ -63,7 +63,7 @@ void SchXMLAutoStylePoolP::exportStyleAttributes(
     if( nFamily == XML_STYLE_FAMILY_SCH_CHART_ID )
     {
         for( ::std::vector< XMLPropertyState >::const_iterator iter = rProperties.begin();
-             (iter != rProperties.end()); iter++ )
+             (iter != rProperties.end()); ++iter )
         {
             if( iter->mnIndex == -1 )
                 continue;
diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx
index 0324d59..0b57ce7 100644
--- a/xmloff/source/chart/SchXMLSeries2Context.cxx
+++ b/xmloff/source/chart/SchXMLSeries2Context.cxx
@@ -131,10 +131,10 @@ void lcl_setAutomaticSymbolSize( const uno::Reference< beans::XPropertySet >& xS
 {
     awt::Size aSymbolSize(140,140);//old default for standard sized charts 7cm height
 
-    double fScale = 1;
     uno::Reference< chart::XChartDocument > xChartDoc( rImport.GetModel(), uno::UNO_QUERY );
     if( xChartDoc.is() )
     {
+        double fScale = 1;
         uno::Reference< beans::XPropertySet > xLegendProp( xChartDoc->getLegend(), uno::UNO_QUERY );
         chart::ChartLegendPosition aLegendPosition = chart::ChartLegendPosition_NONE;
         if( xLegendProp.is() && (xLegendProp->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Alignment" ))) >>= aLegendPosition)
@@ -705,7 +705,7 @@ void SchXMLSeries2Context::initSeriesPropertySets( SeriesDefaultsAndStyles& rSer
     // iterate over series first and remind propertysets in map
     // new api <-> old api wrapper
     ::std::map< Reference< chart2::XDataSeries >, Reference< beans::XPropertySet > > aSeriesMap;
-    for( iStyle = rSeriesDefaultsAndStyles.maSeriesStyleList.begin(); iStyle != rSeriesDefaultsAndStyles.maSeriesStyleList.end(); iStyle++ )
+    for( iStyle = rSeriesDefaultsAndStyles.maSeriesStyleList.begin(); iStyle != rSeriesDefaultsAndStyles.maSeriesStyleList.end(); ++iStyle )
     {
         if( iStyle->meType != DataRowPointStyle::DATA_SERIES )
             continue;
@@ -718,7 +718,7 @@ void SchXMLSeries2Context::initSeriesPropertySets( SeriesDefaultsAndStyles& rSer
     }
 
     //initialize m_xOldAPISeries for all other styles also
-    for( iStyle = rSeriesDefaultsAndStyles.maSeriesStyleList.begin(); iStyle != rSeriesDefaultsAndStyles.maSeriesStyleList.end(); iStyle++ )
+    for( iStyle = rSeriesDefaultsAndStyles.maSeriesStyleList.begin(); iStyle != rSeriesDefaultsAndStyles.maSeriesStyleList.end(); ++iStyle )
     {
         if( iStyle->meType == DataRowPointStyle::DATA_SERIES )
             continue;
@@ -733,7 +733,7 @@ void SchXMLSeries2Context::setDefaultsToSeries( SeriesDefaultsAndStyles& rSeries
     // iterate over series
     // call initSeriesPropertySets first
 
-    for( iStyle = rSeriesDefaultsAndStyles.maSeriesStyleList.begin(); iStyle != rSeriesDefaultsAndStyles.maSeriesStyleList.end(); iStyle++ )
+    for( iStyle = rSeriesDefaultsAndStyles.maSeriesStyleList.begin(); iStyle != rSeriesDefaultsAndStyles.maSeriesStyleList.end(); ++iStyle )
     {
         if( iStyle->meType != DataRowPointStyle::DATA_SERIES )
             continue;
@@ -787,7 +787,7 @@ void SchXMLSeries2Context::setStylesToSeries( SeriesDefaultsAndStyles& rSeriesDe
     ::std::list< DataRowPointStyle >::iterator iStyle;
 
     // iterate over series
-    for( iStyle = rSeriesDefaultsAndStyles.maSeriesStyleList.begin(); iStyle != rSeriesDefaultsAndStyles.maSeriesStyleList.end(); iStyle++ )
+    for( iStyle = rSeriesDefaultsAndStyles.maSeriesStyleList.begin(); iStyle != rSeriesDefaultsAndStyles.maSeriesStyleList.end(); ++iStyle )
     {
         if( iStyle->meType == DataRowPointStyle::DATA_SERIES )
         {
@@ -876,7 +876,7 @@ void SchXMLSeries2Context::setStylesToStatisticsObjects( SeriesDefaultsAndStyles
     ::std::list< DataRowPointStyle >::iterator iStyle;
 
     // iterate over regession etc
-    for( iStyle = rSeriesDefaultsAndStyles.maSeriesStyleList.begin(); iStyle != rSeriesDefaultsAndStyles.maSeriesStyleList.end(); iStyle++ )
+    for( iStyle = rSeriesDefaultsAndStyles.maSeriesStyleList.begin(); iStyle != rSeriesDefaultsAndStyles.maSeriesStyleList.end(); ++iStyle )
     {
         if( iStyle->meType == DataRowPointStyle::REGRESSION ||
             iStyle->meType == DataRowPointStyle::ERROR_INDICATOR ||
@@ -961,7 +961,7 @@ void SchXMLSeries2Context::setStylesToDataPoints( SeriesDefaultsAndStyles& rSeri
         , bool bIsStockChart, bool bIsDonutChart, bool bSwitchOffLinesForScatter )
 {
     ::std::list< DataRowPointStyle >::iterator iStyle;
-    for( iStyle = rSeriesDefaultsAndStyles.maSeriesStyleList.begin(); iStyle != rSeriesDefaultsAndStyles.maSeriesStyleList.end(); iStyle++ )
+    for( iStyle = rSeriesDefaultsAndStyles.maSeriesStyleList.begin(); iStyle != rSeriesDefaultsAndStyles.maSeriesStyleList.end(); ++iStyle )
     {
         if( iStyle->meType != DataRowPointStyle::DATA_POINT )
             continue;
@@ -1056,7 +1056,7 @@ void SchXMLSeries2Context::switchSeriesLinesOff( ::std::list< DataRowPointStyle
     ::std::list< DataRowPointStyle >::iterator iStyle;
     // iterate over series
     
-    for( iStyle = rSeriesStyleList.begin(); iStyle != rSeriesStyleList.end(); iStyle++ )
+    for( iStyle = rSeriesStyleList.begin(); iStyle != rSeriesStyleList.end(); ++iStyle )
     {
         if( iStyle->meType != DataRowPointStyle::DATA_SERIES )
             continue;
diff --git a/xmloff/source/draw/XMLShapeStyleContext.cxx b/xmloff/source/draw/XMLShapeStyleContext.cxx
index 3e8299d..a2a2c8a 100644
--- a/xmloff/source/draw/XMLShapeStyleContext.cxx
+++ b/xmloff/source/draw/XMLShapeStyleContext.cxx
@@ -154,7 +154,7 @@ void XMLShapeStyleContext::FillPropertySet( const Reference< beans::XPropertySet
 
         // first, look for the old format, where we had a text:list-style-name
         // attribute in the style:properties element
-        for( property = rProperties.begin(); property != end; property++ )
+        for( property = rProperties.begin(); property != end; ++property )
         {
             // find properties with context
             if( (property->mnIndex != -1) && (rMapper->GetEntryContextId( property->mnIndex ) == CTF_SD_NUMBERINGRULES_NAME) )
diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx
index 077cfba..461b8aa 100644
--- a/xmloff/source/draw/ximpstyl.cxx
+++ b/xmloff/source/draw/ximpstyl.cxx
@@ -227,7 +227,7 @@ void SdXMLDrawingPageStyleContext::Finish( sal_Bool bOverwrite )
     const UniReference< XMLPropertySetMapper >& rImpPrMap = GetStyles()->GetImportPropertyMapper( GetFamily() )->getPropertySetMapper();
 
     ::std::vector< XMLPropertyState >::iterator property = rProperties.begin();
-    for(; property != rProperties.end(); property++)
+    for(; property != rProperties.end(); ++property)
     {
         if( property->mnIndex == -1 )
             continue;
diff --git a/xmloff/source/style/XMLPageExport.cxx b/xmloff/source/style/XMLPageExport.cxx
index d020f36..ac5865e 100644
--- a/xmloff/source/style/XMLPageExport.cxx
+++ b/xmloff/source/style/XMLPageExport.cxx
@@ -61,7 +61,7 @@ using namespace ::xmloff::token;
 sal_Bool XMLPageExport::findPageMasterName( const OUString& rStyleName, OUString& rPMName ) const
 {
     for( ::std::vector< XMLPageExportNameEntry >::const_iterator pEntry = aNameVector.begin();
-            pEntry != aNameVector.end(); pEntry++ )
+            pEntry != aNameVector.end(); ++pEntry )
     {
         if( pEntry->sStyleName == rStyleName )
         {
diff --git a/xmloff/source/style/chrhghdl.cxx b/xmloff/source/style/chrhghdl.cxx
index 45f7511..9a73301 100644
--- a/xmloff/source/style/chrhghdl.cxx
+++ b/xmloff/source/style/chrhghdl.cxx
@@ -58,10 +58,9 @@ XMLCharHeightHdl::~XMLCharHeightHdl()
 
 sal_Bool XMLCharHeightHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& ) const
 { 
-    double fSize;
-
     if( rStrImpValue.indexOf( sal_Unicode('%') ) == -1 )
     {
+        double fSize;
         MapUnit eSrcUnit = SvXMLExportHelper::GetUnitFromString( rStrImpValue, MAP_POINT );
         if( SvXMLUnitConverter::convertDouble( fSize, rStrImpValue, eSrcUnit, MAP_POINT ))
         {
@@ -101,10 +100,9 @@ XMLCharHeightPropHdl::~XMLCharHeightPropHdl()
 
 sal_Bool XMLCharHeightPropHdl::importXML( const OUString& rStrImpValue, uno::Any& rValue, const SvXMLUnitConverter& ) const
 { 
-    sal_Int32 nPrc = 100;
-
     if( rStrImpValue.indexOf( sal_Unicode('%') ) != -1 )
     {
+        sal_Int32 nPrc = 100;
         if( SvXMLUnitConverter::convertPercent( nPrc, rStrImpValue ) )
         {
             rValue <<= (sal_Int16)nPrc;
diff --git a/xmloff/source/style/xmlnumi.cxx b/xmloff/source/style/xmlnumi.cxx
index 81b65c2..0b7c37e 100644
--- a/xmloff/source/style/xmlnumi.cxx
+++ b/xmloff/source/style/xmlnumi.cxx
@@ -858,7 +858,7 @@ SvxXMLListLevelStyleAttrContext_Impl::SvxXMLListLevelStyleAttrContext_Impl(
                 OUString sTmp;
                 sal_Int16 nTmp = 0;
                 ::std::vector< XMLPropertyState >::iterator i;
-                for( i = aProps.begin(); i != aProps.end(); i++ )
+                for( i = aProps.begin(); i != aProps.end(); ++i )
                 {
                     switch( i->mnIndex )
                     {
diff --git a/xmloff/source/style/xmlprmap.cxx b/xmloff/source/style/xmlprmap.cxx
index 8687c56..ad823f6 100644
--- a/xmloff/source/style/xmlprmap.cxx
+++ b/xmloff/source/style/xmlprmap.cxx
@@ -222,11 +222,11 @@ sal_Int32 XMLPropertySetMapper::FindEntryIndex(
 
 sal_Int32 XMLPropertySetMapper::FindEntryIndex( const sal_Int16 nContextId ) const
 {
-    sal_Int32 nIndex = 0;
     const sal_Int32 nEntries = GetEntryCount();
 
     if ( nEntries )
     {
+        sal_Int32 nIndex = 0;
         do
         {
             const XMLPropertySetMapperEntry_Impl& rEntry = aMapEntries[nIndex];
diff --git a/xmloff/source/text/XMLIndexMarkExport.cxx b/xmloff/source/text/XMLIndexMarkExport.cxx
index 49029c8..b29e51e 100644
--- a/xmloff/source/text/XMLIndexMarkExport.cxx
+++ b/xmloff/source/text/XMLIndexMarkExport.cxx
@@ -196,7 +196,7 @@ void XMLIndexMarkExport::ExportTOCMarkAttributes(
 
 void lcl_ExportPropertyString( SvXMLExport& rExport,
                                const Reference<XPropertySet> & rPropSet,
-                               const OUString sProperty,
+                               const OUString & sProperty,
                                XMLTokenEnum eToken,
                                Any& rAny )
 {
@@ -214,7 +214,7 @@ void lcl_ExportPropertyString( SvXMLExport& rExport,
 
 void lcl_ExportPropertyBool( SvXMLExport& rExport,
                              const Reference<XPropertySet> & rPropSet,
-                             const OUString sProperty,
+                             const OUString & sProperty,
                              XMLTokenEnum eToken,
                              Any& rAny )
 {
diff --git a/xmloff/source/text/XMLTextNumRuleInfo.hxx b/xmloff/source/text/XMLTextNumRuleInfo.hxx
index 2c487c2..d81cf32 100644
--- a/xmloff/source/text/XMLTextNumRuleInfo.hxx
+++ b/xmloff/source/text/XMLTextNumRuleInfo.hxx
@@ -159,6 +159,7 @@ inline XMLTextNumRuleInfo& XMLTextNumRuleInfo::operator=(
     msListId = rInfo.msListId;
     mnListStartValue = rInfo.mnListStartValue;
     mnListLevel = rInfo.mnListLevel;
+    mnListLevelStartValue = rInfo.mnListLevelStartValue;
     mbIsNumbered = rInfo.mbIsNumbered;
     mbIsRestart = rInfo.mbIsRestart;
     // Written OpenDocument file format doesn't fit to the created text document (#i69627#)
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index d9d6a8b..c65551c 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -2617,7 +2617,7 @@ SvI18NMap& XMLTextImportHelper::GetRenameMap()
 }
 
 void XMLTextImportHelper::InsertBookmarkStartRange(
-    const OUString sName,
+    const OUString & sName,
     const Reference<XTextRange> & rRange,
     OUString const& i_rXmlId,
     ::boost::shared_ptr< ::xmloff::ParsedRDFaAttributes > & i_rpRDFaAttributes)
@@ -2628,7 +2628,7 @@ void XMLTextImportHelper::InsertBookmarkStartRange(
 }
 
 sal_Bool XMLTextImportHelper::FindAndRemoveBookmarkStartRange(
-    const OUString sName,
+    const OUString & sName,
     Reference<XTextRange> & o_rRange,
     OUString & o_rXmlId,
     ::boost::shared_ptr< ::xmloff::ParsedRDFaAttributes > & o_rpRDFaAttributes)
diff --git a/xmloff/source/text/txtlists.cxx b/xmloff/source/text/txtlists.cxx
index a18f6ee..dce481e 100644
--- a/xmloff/source/text/txtlists.cxx
+++ b/xmloff/source/text/txtlists.cxx
@@ -246,10 +246,10 @@ const ::rtl::OUString& XMLTextListsHelper::GetListStyleOfLastProcessedList() con
     // Value of xml:id in element <text:list> has to be a valid ID type (#i92478#)
     sTmpStr += ::rtl::OUString::valueOf( n );
 
-    long nHitCount = 0;
     ::rtl::OUString sNewListId( sTmpStr );
     if ( mpProcessedLists != 0 )
     {
+        long nHitCount = 0;
         while ( mpProcessedLists->find( sNewListId ) != mpProcessedLists->end() )
         {
             ++nHitCount;
diff --git a/xmloff/source/text/txtparae.cxx b/xmloff/source/text/txtparae.cxx
index 88fd5a1..1f1c666 100644
--- a/xmloff/source/text/txtparae.cxx
+++ b/xmloff/source/text/txtparae.cxx
@@ -768,7 +768,7 @@ OUString XMLTextParagraphExport::FindTextStyleAndHyperlink(
     for( ::std::vector< XMLPropertyState >::iterator
             i = xPropStates.begin();
          nIgnoreProps < 2 && i != xPropStates.end();
-         i++ )
+         ++i )
     {
         if( i->mnIndex == -1 )
             continue;
diff --git a/xmlscript/source/xmldlg_imexp/imp_share.hxx b/xmlscript/source/xmldlg_imexp/imp_share.hxx
index 4751091..5b9b9a5 100644
--- a/xmlscript/source/xmldlg_imexp/imp_share.hxx
+++ b/xmlscript/source/xmldlg_imexp/imp_share.hxx
@@ -413,7 +413,7 @@ public:
           _aId( id )
         { OSL_ASSERT( _xControlModel.is() ); }
 
-    inline css::uno::Reference< css::beans::XPropertySet > getControlModel()
+    inline css::uno::Reference< css::beans::XPropertySet > getControlModel() const
         { return _xControlModel; }
 
     void importDefaults(


More information about the Libreoffice-commits mailing list