[Libreoffice-commits] .: 2 commits - drawinglayer/source linguistic/source vbahelper/source

Christian Lohmaier cloph at kemper.freedesktop.org
Mon May 16 14:26:50 PDT 2011


 drawinglayer/source/processor2d/vclprocessor2d.cxx |    2 +-
 linguistic/source/gciterator.cxx                   |    1 -
 vbahelper/source/msforms/vbauserform.cxx           |    2 +-
 vbahelper/source/vbahelper/vbahelper.cxx           |   18 +++++++++---------
 4 files changed, 11 insertions(+), 12 deletions(-)

New commits:
commit 12a0350ef4944d2e25cbae74713c0b77b39a13b9
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date:   Mon May 16 23:29:02 2011 +0200

    WaE - add explicit casting (decimal-types → integer types)

diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 19648d4..7ca17fb 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -263,7 +263,7 @@ namespace drawinglayer
                         double fOldRotate, fOldShearX;
                         rTextCandidate.getTextTransform().decompose(aOldFontScaling, aOldTranslate, fOldRotate, fOldShearX);
 
-                        long nWidthToFill = rTextCandidate.getWidthToFill( ) * aFontScaling.getX() / aOldFontScaling.getX();
+                        long nWidthToFill = static_cast<long>(rTextCandidate.getWidthToFill( ) * aFontScaling.getX() / aOldFontScaling.getX());
 
                         long nWidth = mpOutputDevice->GetTextArray(
                             rTextCandidate.getText(), pDXArray, 0, 1 );
diff --git a/vbahelper/source/msforms/vbauserform.cxx b/vbahelper/source/msforms/vbauserform.cxx
index 7152523..2939e05 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 5d5f6ec..35a7547 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);
             }
         }
     }
commit 1848c3a1f597f6e6e1d4e44314a56628c4903b00
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date:   Mon May 16 23:25:46 2011 +0200

    WaE (picky) - noeol

diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx
index f868675..e8178f8 100644
--- a/linguistic/source/gciterator.cxx
+++ b/linguistic/source/gciterator.cxx
@@ -1183,4 +1183,4 @@ void * SAL_CALL GrammarCheckingIterator_getFactory(
     return pRet;
 }
 
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list