summaryrefslogtreecommitdiff
path: root/vbahelper
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2015-01-17 00:37:31 +0100
committerNoel Grandin <noelgrandin@gmail.com>2015-01-19 06:18:37 +0000
commit5901827bd44dc3600bf66c83882e6847439d59d6 (patch)
tree3e4477e7a25cb10d836f6dcba1c49fcbb9e637d4 /vbahelper
parenta1fb4ac1991a8da2e527b64a0a01a88a8f2959e3 (diff)
fdo#39440 reduce scope of local variables
This addresses some cppcheck warnings. Change-Id: I1cd8b118e2598b8b18fb445851a3bb41e554267b Reviewed-on: https://gerrit.libreoffice.org/13967 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vbahelper')
-rw-r--r--vbahelper/source/vbahelper/vbapagesetupbase.cxx20
1 files changed, 12 insertions, 8 deletions
diff --git a/vbahelper/source/vbahelper/vbapagesetupbase.cxx b/vbahelper/source/vbahelper/vbapagesetupbase.cxx
index 46e8203a40ee..0148234d9ad0 100644
--- a/vbahelper/source/vbahelper/vbapagesetupbase.cxx
+++ b/vbahelper/source/vbahelper/vbapagesetupbase.cxx
@@ -31,12 +31,13 @@ VbaPageSetupBase::VbaPageSetupBase(const uno::Reference< XHelperInterface >& xPa
double SAL_CALL VbaPageSetupBase::getTopMargin() throw (css::uno::RuntimeException, std::exception)
{
- bool headerOn = false;
sal_Int32 topMargin = 0;
- sal_Int32 headerHeight = 0;
try
{
+ bool headerOn = false;
+ sal_Int32 headerHeight = 0;
+
uno::Any aValue = mxPageProps->getPropertyValue( "HeaderIsOn" );
aValue >>= headerOn;
@@ -60,11 +61,12 @@ double SAL_CALL VbaPageSetupBase::getTopMargin() throw (css::uno::RuntimeExcepti
void SAL_CALL VbaPageSetupBase::setTopMargin( double margin ) throw (css::uno::RuntimeException, std::exception)
{
sal_Int32 topMargin = Millimeter::getInHundredthsOfOneMillimeter( margin );
- bool headerOn = false;
- sal_Int32 headerHeight = 0;
try
{
+ bool headerOn = false;
+ sal_Int32 headerHeight = 0;
+
uno::Any aValue = mxPageProps->getPropertyValue( "HeaderIsOn" );
aValue >>= headerOn;
@@ -85,12 +87,13 @@ void SAL_CALL VbaPageSetupBase::setTopMargin( double margin ) throw (css::uno::R
double SAL_CALL VbaPageSetupBase::getBottomMargin() throw (css::uno::RuntimeException, std::exception)
{
- bool footerOn = false;
sal_Int32 bottomMargin = 0;
- sal_Int32 footerHeight = 0;
try
{
+ bool footerOn = false;
+ sal_Int32 footerHeight = 0;
+
uno::Any aValue = mxPageProps->getPropertyValue( "FooterIsOn" );
aValue >>= footerOn;
@@ -114,11 +117,12 @@ double SAL_CALL VbaPageSetupBase::getBottomMargin() throw (css::uno::RuntimeExce
void SAL_CALL VbaPageSetupBase::setBottomMargin( double margin ) throw (css::uno::RuntimeException, std::exception)
{
sal_Int32 bottomMargin = Millimeter::getInHundredthsOfOneMillimeter( margin );
- bool footerOn = false;
- sal_Int32 footerHeight = 0;
try
{
+ bool footerOn = false;
+ sal_Int32 footerHeight = 0;
+
uno::Any aValue = mxPageProps->getPropertyValue( "FooterIsOn" );
aValue >>= footerOn;