From c635b740e00d1762c905cdd787fdb31753dab932 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 30 Oct 2009 17:42:00 +0100 Subject: #i105295#: fix various uninitialized variables reported by valgrind in: SwTxtFormatter::CtorInitTxtFormatter(), SwArrowPortion::SwArrowPortion(), SwAccessiblePage::SwAccessiblePage(), SwXShape::_AdjustPositionProperties(), SwFrm::SwFrm(), SwGlosDocShell::SwGlosDocShell(), SwXPrintSettings::_getSingleValue() --- sw/source/core/unocore/unodraw.cxx | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'sw/source/core/unocore/unodraw.cxx') diff --git a/sw/source/core/unocore/unodraw.cxx b/sw/source/core/unocore/unodraw.cxx index 11b3eae5a16a..b9e537279ada 100644 --- a/sw/source/core/unocore/unodraw.cxx +++ b/sw/source/core/unocore/unodraw.cxx @@ -2739,12 +2739,14 @@ void SwXShape::_AdjustPositionProperties( const awt::Point _aPosition ) rtl::OUString aHoriOrientPropStr( RTL_CONSTASCII_USTRINGPARAM("HoriOrient") ); uno::Any aHoriOrient( getPropertyValue( aHoriOrientPropStr ) ); sal_Int16 eHoriOrient; - aHoriOrient >>= eHoriOrient; - if ( eHoriOrient != text::HoriOrientation::NONE ) + if (aHoriOrient >>= eHoriOrient) // may be void { - eHoriOrient = text::HoriOrientation::NONE; - aHoriOrient <<= eHoriOrient; - setPropertyValue( aHoriOrientPropStr, aHoriOrient ); + if ( eHoriOrient != text::HoriOrientation::NONE ) + { + eHoriOrient = text::HoriOrientation::NONE; + aHoriOrient <<= eHoriOrient; + setPropertyValue( aHoriOrientPropStr, aHoriOrient ); + } } // set x-position attribute aHoriPos <<= _aPosition.X; @@ -2767,12 +2769,14 @@ void SwXShape::_AdjustPositionProperties( const awt::Point _aPosition ) rtl::OUString aVertOrientPropStr( RTL_CONSTASCII_USTRINGPARAM("VertOrient") ); uno::Any aVertOrient( getPropertyValue( aVertOrientPropStr ) ); sal_Int16 eVertOrient; - aVertOrient >>= eVertOrient; - if ( eVertOrient != text::VertOrientation::NONE ) + if (aVertOrient >>= eVertOrient) // may be void { - eVertOrient = text::VertOrientation::NONE; - aVertOrient <<= eVertOrient; - setPropertyValue( aVertOrientPropStr, aVertOrient ); + if ( eVertOrient != text::VertOrientation::NONE ) + { + eVertOrient = text::VertOrientation::NONE; + aVertOrient <<= eVertOrient; + setPropertyValue( aVertOrientPropStr, aVertOrient ); + } } // set y-position attribute aVertPos <<= _aPosition.Y; -- cgit v1.2.3