summaryrefslogtreecommitdiffstats
path: root/cui
diff options
context:
space:
mode:
authorChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2011-05-17 02:00:14 +0200
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2011-05-17 02:00:14 +0200
commit348566943ca7ebae80ffdf4776917de374e240ec (patch)
tree073479f81db048015d7e3e42755a46756ca9de6b /cui
parentWaE (picky) - noeol (diff)
downloadcore-348566943ca7ebae80ffdf4776917de374e240ec.tar.gz
core-348566943ca7ebae80ffdf4776917de374e240ec.zip
WaE - add explicit casting (decimal-types → integer types)
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/colorpicker.cxx6
-rw-r--r--cui/source/tabpages/border.cxx16
2 files changed, 11 insertions, 11 deletions
diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx
index 98c1b3692d5f..3f3110de51a6 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 5c2490ba5200..dc792c90bb28 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 );
}