diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2014-12-19 08:47:29 +0100 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2014-12-19 11:00:32 +0000 |
commit | d41bc0f7b328ed6c69b2c2822de00165cdc62c61 (patch) | |
tree | f92cb1c15af79b7100e90d713eaa3ee6adcd5115 /reportdesign | |
parent | bfb9eb550c4facb9aa6346a8d19f015cf5182668 (diff) |
fdo#39440 reduce scope of local variables
This addresses some cppcheck warnings.
Change-Id: Idcedd908c653d5a5700884f233ad134dde8be018
Reviewed-on: https://gerrit.libreoffice.org/13540
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'reportdesign')
-rw-r--r-- | reportdesign/source/core/sdr/RptObject.cxx | 4 | ||||
-rw-r--r-- | reportdesign/source/ui/dlg/Condition.cxx | 3 | ||||
-rw-r--r-- | reportdesign/source/ui/dlg/GroupsSorting.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/ui/report/ReportSection.cxx | 3 |
4 files changed, 6 insertions, 6 deletions
diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx index 0d76ae25bf80..f40b8b820c94 100644 --- a/reportdesign/source/core/sdr/RptObject.cxx +++ b/reportdesign/source/core/sdr/RptObject.cxx @@ -710,9 +710,9 @@ void OUnoObject::NbcMove( const Size& rSize ) bool bPositionFixed = false; Size aUndoSize(0,0); - bool bUndoMode = false; if ( m_xReportComponent.is() ) { + bool bUndoMode = false; OReportModel* pRptModel = static_cast<OReportModel*>(GetModel()); if (pRptModel->GetUndoEnv().IsUndoMode()) { @@ -1006,9 +1006,9 @@ void OOle2Obj::NbcMove( const Size& rSize ) bool bPositionFixed = false; Size aUndoSize(0,0); - bool bUndoMode = false; if ( m_xReportComponent.is() ) { + bool bUndoMode = false; OReportModel* pRptModel = static_cast<OReportModel*>(GetModel()); if (pRptModel->GetUndoEnv().IsUndoMode()) { diff --git a/reportdesign/source/ui/dlg/Condition.cxx b/reportdesign/source/ui/dlg/Condition.cxx index 47ea6c0db641..26e5989dce07 100644 --- a/reportdesign/source/ui/dlg/Condition.cxx +++ b/reportdesign/source/ui/dlg/Condition.cxx @@ -122,7 +122,6 @@ OColorPopup::OColorPopup(vcl::Window* _pParent,Condition* _pCondition) short i = 0; XColorListRef pColorList( XColorList::CreateStdColorList() ); long nCount = pColorList->Count(); - XColorEntry* pEntry = NULL; Color aColWhite( COL_WHITE ); OUString aStrWhite( ModuleRes(STR_COLOR_WHITE) ); @@ -132,7 +131,7 @@ OColorPopup::OColorPopup(vcl::Window* _pParent,Condition* _pCondition) for ( i = 0; i < nCount; i++ ) { - pEntry = pColorList->GetColor(i); + XColorEntry* pEntry = pColorList->GetColor(i); m_aColorSet.InsertItem( i+1, pEntry->GetColor(), pEntry->GetName() ); } diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx index dfe92281328e..171ce3768cd4 100644 --- a/reportdesign/source/ui/dlg/GroupsSorting.cxx +++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx @@ -403,9 +403,9 @@ bool OFieldExpressionControl::SaveModified(bool _bAppendRow) sal_Int32 nRow = GetCurRow(); if ( nRow != BROWSER_ENDOFSELECTION ) { - bool bAppend = false; try { + bool bAppend = false; uno::Reference< report::XGroup> xGroup; if ( m_aGroupPositions[nRow] == NO_GROUP ) { diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx index 6b61162c42de..e7e2f533ee2e 100644 --- a/reportdesign/source/ui/report/ReportSection.cxx +++ b/reportdesign/source/ui/report/ReportSection.cxx @@ -547,7 +547,6 @@ void OReportSection::impl_adjustObjectSizePosition(sal_Int32 i_nPaperWidth,sal_I const sal_Int32 nCount = m_xSection->getCount(); for (sal_Int32 i = 0; i < nCount; ++i) { - bool bChanged = false; uno::Reference< report::XReportComponent> xReportComponent(m_xSection->getByIndex(i),uno::UNO_QUERY_THROW); awt::Point aPos = xReportComponent->getPosition(); awt::Size aSize = xReportComponent->getSize(); @@ -555,6 +554,8 @@ void OReportSection::impl_adjustObjectSizePosition(sal_Int32 i_nPaperWidth,sal_I SdrObject* pObject = pShape ? pShape->GetSdrObject() : NULL; if ( pObject ) { + bool bChanged = false; + OObjectBase& rBase = dynamic_cast<OObjectBase&>(*pObject); rBase.EndListening(false); if ( aPos.X < i_nLeftMargin ) |