[Libreoffice-commits] .: 2 commits - accessibility/source basctl/source cui/source

Christian Lohmaier cloph at kemper.freedesktop.org
Mon May 16 16:58:12 PDT 2011


 accessibility/source/helper/characterattributeshelper.cxx |    1 
 basctl/source/basicide/iderdll.cxx                        |    1 
 cui/source/dialogs/colorpicker.cxx                        |    6 ++---
 cui/source/options/cuisrchdlg.cxx                         |    1 
 cui/source/options/optimprove.cxx                         |    1 
 cui/source/tabpages/border.cxx                            |   16 +++++++-------
 6 files changed, 11 insertions(+), 15 deletions(-)

New commits:
commit e1fea21ac72bbafa1c2809bc42cdaaee8dbd866d
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date:   Tue May 17 02:00:14 2011 +0200

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

diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx
index 98c1b36..3f3110d 100644
--- a/cui/source/dialogs/colorpicker.cxx
+++ b/cui/source/dialogs/colorpicker.cxx
@@ -624,7 +624,7 @@ void ColorFieldControl::MouseButtonUp( const MouseEvent& )
 void ColorFieldControl::KeyMove( int dx, int dy )
 {
     Size aSize( GetOutputSizePixel() );
-    Point aPos( mdX * aSize.Width(), (1.0 - mdY) * aSize.Height() );
+    Point aPos(static_cast<long>(mdX * aSize.Width()), static_cast<long>((1.0 - mdY) * aSize.Height()));
     aPos.X() += dx;
     aPos.Y() += dy;
     if( aPos.X() < 0 )
@@ -741,7 +741,7 @@ double ColorFieldControl::GetY()
 void ColorFieldControl::UpdatePosition()
 {
     Size aSize( GetOutputSizePixel() );
-    ShowPosition( Point( mdX * aSize.Width(), (1.0 - mdY) * aSize.Height() ), false );
+    ShowPosition( Point(static_cast<long>(mdX * aSize.Width()), static_cast<long>((1.0 - mdY) * aSize.Height())), false );
 }
 
 // ====================================================================
@@ -998,7 +998,7 @@ void ColorSliderControl::SetValue( const Color& rColor, ColorMode eMode, double
     {
         maColor = rColor;
         mdValue = dValue;
-        mnLevel = (1.0-dValue) * GetOutputSizePixel().Height();
+        mnLevel = static_cast<sal_Int16>((1.0-dValue) * GetOutputSizePixel().Height());
         meMode = eMode;
         if( bUpdateBitmap )
             UpdateBitmap();
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index a4b54bc..9e29eba 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -506,9 +506,9 @@ void SvxBorderTabPage::Reset( const SfxItemSet& rSet )
         if( bWidthEq )
         {
             // Determine the width first as some styles can be missing depending on it
-            sal_Int64 nWidthPt = MetricField::ConvertDoubleValue(
+            sal_Int64 nWidthPt =  static_cast<sal_Int64>(MetricField::ConvertDoubleValue(
                         sal_Int64( nWidth ), aLineWidthMF.GetDecimalDigits( ),
-                        MAP_TWIP, aLineWidthMF.GetUnit() );
+                        MAP_TWIP,aLineWidthMF.GetUnit() ));
             aLineWidthMF.SetValue( nWidthPt );
             aLbLineStyle.SetWidth( nWidth );
 
@@ -879,10 +879,10 @@ IMPL_LINK( SvxBorderTabPage, SelColHdl_Impl, ListBox *, pLb )
 
 IMPL_LINK( SvxBorderTabPage, ModifyWidthHdl_Impl, void *, EMPTYARG )
 {
-    sal_Int64 nVal = MetricField::ConvertDoubleValue(
+    sal_Int64 nVal = static_cast<sal_Int64>(MetricField::ConvertDoubleValue(
                 aLineWidthMF.GetValue( ),
                 aLineWidthMF.GetDecimalDigits( ),
-                aLineWidthMF.GetUnit(), MAP_TWIP );
+                aLineWidthMF.GetUnit(), MAP_TWIP ));
     aLbLineStyle.SetWidth( nVal );
 
     aFrameSel.SetStyleToSelection( nVal,
@@ -897,10 +897,10 @@ IMPL_LINK( SvxBorderTabPage, SelStyleHdl_Impl, ListBox *, pLb )
 {
     if ( pLb == &aLbLineStyle )
     {
-        sal_Int64 nVal = MetricField::ConvertDoubleValue(
+        sal_Int64 nVal = static_cast<sal_Int64>(MetricField::ConvertDoubleValue(
                     aLineWidthMF.GetValue( ),
                     aLineWidthMF.GetDecimalDigits( ),
-                    aLineWidthMF.GetUnit(), MAP_TWIP );
+                    aLineWidthMF.GetUnit(), MAP_TWIP ));
         aFrameSel.SetStyleToSelection ( nVal,
             SvxBorderStyle( aLbLineStyle.GetSelectEntryStyle() ) );
     }
@@ -1091,10 +1091,10 @@ void SvxBorderTabPage::FillLineListBox_Impl()
     aLbLineStyle.InsertEntry( SvxBorderLine::getWidthImpl( INSET ), INSET, 10,
            &SvxBorderLine::darkColor, &SvxBorderLine::lightColor );
 
-    sal_Int64 nVal = MetricField::ConvertDoubleValue(
+    sal_Int64 nVal = static_cast<sal_Int64>(MetricField::ConvertDoubleValue(
                 aLineWidthMF.GetValue( ),
                 aLineWidthMF.GetDecimalDigits( ),
-                aLineWidthMF.GetUnit(), MAP_TWIP );
+                aLineWidthMF.GetUnit(), MAP_TWIP ));
     aLbLineStyle.SetWidth( nVal );
 }
 
commit 6d9cdc792a2813ddbad3f7fdd5a4bb8e9306d04c
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date:   Tue May 17 01:57:19 2011 +0200

    WaE (picky) - noeol

diff --git a/accessibility/source/helper/characterattributeshelper.cxx b/accessibility/source/helper/characterattributeshelper.cxx
index 27ba50e..ec800b7 100644
--- a/accessibility/source/helper/characterattributeshelper.cxx
+++ b/accessibility/source/helper/characterattributeshelper.cxx
@@ -111,4 +111,4 @@ Sequence< PropertyValue > CharacterAttributesHelper::GetCharacterAttributes( con
 }
 
 
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basctl/source/basicide/iderdll.cxx b/basctl/source/basicide/iderdll.cxx
index a1d4699..b9d9a69 100644
--- a/basctl/source/basicide/iderdll.cxx
+++ b/basctl/source/basicide/iderdll.cxx
@@ -213,4 +213,4 @@ IMPL_LINK( BasicIDEData, GlobalBasicBreakHdl, StarBASIC *, pBasic )
     return nRet;
 }
 
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/cuisrchdlg.cxx b/cui/source/options/cuisrchdlg.cxx
index 0787720..a78908f 100644
--- a/cui/source/options/cuisrchdlg.cxx
+++ b/cui/source/options/cuisrchdlg.cxx
@@ -92,4 +92,4 @@ sal_Int32 SvxJSearchOptionsDialog::GetTransliterationFlags() const
 }
 
 
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/optimprove.cxx b/cui/source/options/optimprove.cxx
index b5f550f..0937e59 100644
--- a/cui/source/options/optimprove.cxx
+++ b/cui/source/options/optimprove.cxx
@@ -196,4 +196,4 @@ IMPL_LINK( SvxImprovementDialog, HandleOK, OKButton*, EMPTYARG )
     return 0;
 }
 
-/* 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