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 | b993b1e9052102279063dbffb3601461391735ad (patch) | |
tree | b73b11a346cf142b56ed6cd02b1220178fc6d979 /vbahelper | |
parent | 2f326b70007afca8bd76e3440df09e891b8caaae (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 7152523e2696..2939e053e486 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 8211269bcd2a..4a1b360edad9 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); } } } |