diff options
author | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2011-05-16 23:29:02 +0200 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2011-05-16 23:29:02 +0200 |
commit | 12a0350ef4944d2e25cbae74713c0b77b39a13b9 (patch) | |
tree | 2589f1aea2b3827df36fd61a89d430bbe0d5c74d /vbahelper | |
parent | 1848c3a1f597f6e6e1d4e44314a56628c4903b00 (diff) |
WaE - add explicit casting (decimal-types → integer types)
Diffstat (limited to 'vbahelper')
-rw-r--r-- | vbahelper/source/msforms/vbauserform.cxx | 2 | ||||
-rw-r--r-- | vbahelper/source/vbahelper/vbahelper.cxx | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/vbahelper/source/msforms/vbauserform.cxx b/vbahelper/source/msforms/vbauserform.cxx index 7152523e26..2939e053e4 100644 --- a/vbahelper/source/msforms/vbauserform.cxx +++ b/vbahelper/source/msforms/vbauserform.cxx @@ -85,7 +85,7 @@ ScVbaUserForm::Show( ) throw (uno::RuntimeException) uno::Reference< awt::XControl > xControl( m_xDialog, uno::UNO_QUERY_THROW ); uno::Reference< awt::XWindow > xControlWindow( xControl->getPeer(), uno::UNO_QUERY_THROW ); - xControlWindow->setPosSize( (aPosSize.Width - getWidth()) / 2.0, (aPosSize.Height - getHeight()) / 2.0, 0, 0, awt::PosSize::POS ); + xControlWindow->setPosSize(static_cast<sal_Int32>((aPosSize.Width - getWidth()) / 2.0), static_cast<sal_Int32>((aPosSize.Height - getHeight()) / 2.0), 0, 0, awt::PosSize::POS ); } catch( uno::Exception& ) { diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index 5d5f6ecfc2..35a75470e5 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -719,7 +719,7 @@ double PointsToPixels( css::uno::Reference< css::awt::XDevice >& xDevice, double double PixelsToPoints( css::uno::Reference< css::awt::XDevice >& xDevice, double fPixels, sal_Bool bVertical) { double fConvertFactor = getPixelTo100thMillimeterConversionFactor( xDevice, bVertical ); - return HmmToPoints( fPixels/fConvertFactor ); + return HmmToPoints(static_cast<sal_Int32>(fPixels/fConvertFactor)); } sal_Int32 PointsToHmm( double fPoints ) @@ -899,7 +899,7 @@ double UserFormGeometryHelper::getLeft() //--------------------------------------------- void UserFormGeometryHelper::setLeft( double nLeft ) { - mxWindow->setPosSize( nLeft, mxWindow->getPosSize().Y, 0, 0, awt::PosSize::POS ); + mxWindow->setPosSize(static_cast<sal_Int32>(nLeft), mxWindow->getPosSize().Y, 0, 0, awt::PosSize::POS ); } //--------------------------------------------- @@ -911,7 +911,7 @@ double UserFormGeometryHelper::getTop() //--------------------------------------------- void UserFormGeometryHelper::setTop( double nTop ) { - mxWindow->setPosSize( mxWindow->getPosSize().X, nTop, 0, 0, awt::PosSize::POS ); + mxWindow->setPosSize( mxWindow->getPosSize().X, static_cast<sal_Int32>(nTop), 0, 0, awt::PosSize::POS ); } //--------------------------------------------- @@ -934,7 +934,7 @@ double UserFormGeometryHelper::getWidth() //--------------------------------------------- void UserFormGeometryHelper::setWidth( double nWidth ) { - sal_Int64 nNewWidth = nWidth; + sal_Int64 nNewWidth = static_cast<sal_Int64>(nWidth); if ( mbDialog ) { @@ -948,8 +948,8 @@ void UserFormGeometryHelper::setWidth( double nWidth ) sal_Int64 nDecor = aRDecor.getWidth(); sal_Int64 nUnDecor = mxWindow->getPosSize().Width; if ( nWidth < nDecor - nUnDecor ) - nUnDecor = nDecor - nWidth; // avoid negative size - nNewWidth = nWidth + nUnDecor - nDecor; + nUnDecor = static_cast<sal_Int64>(nDecor - nWidth); // avoid negative size + nNewWidth = static_cast<sal_Int64>(nWidth + nUnDecor - nDecor); } } } @@ -977,7 +977,7 @@ double UserFormGeometryHelper::getHeight() //--------------------------------------------- void UserFormGeometryHelper::setHeight( double nHeight ) { - sal_Int64 nNewHeight = nHeight; + sal_Int64 nNewHeight = static_cast<sal_Int64>(nHeight); if ( mbDialog ) { const Window* pWindow = VCLUnoHelper::GetWindow( mxWindow ); @@ -990,8 +990,8 @@ void UserFormGeometryHelper::setHeight( double nHeight ) sal_Int64 nDecor = aRDecor.getHeight(); sal_Int64 nUnDecor = mxWindow->getPosSize().Height; if ( nHeight < nDecor - nUnDecor ) - nUnDecor = nDecor - nHeight; // avoid negative size - nNewHeight = nHeight + nUnDecor - nDecor; + nUnDecor = static_cast<sal_Int64>(nDecor - nHeight); // avoid negative size + nNewHeight = static_cast<sal_Int64>(nHeight + nUnDecor - nDecor); } } } |