summaryrefslogtreecommitdiff
path: root/editeng/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-07 08:42:58 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-07 08:35:04 +0100
commita498b12dc1723b072a165f8c528c377024fd4c98 (patch)
treec52b7d01cd95176d345b4ad0bf417edc4c499d26 /editeng/source
parent073b4eadd2a9a00b915c664df90b15d5b2d709c0 (diff)
use more Color in editeng..forms
Change-Id: If6c862e7bb61cd78c3379afde11b528a74162900 Reviewed-on: https://gerrit.libreoffice.org/50860 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng/source')
-rw-r--r--editeng/source/accessibility/AccessibleEditableTextPara.cxx12
-rw-r--r--editeng/source/accessibility/AccessibleImageBullet.cxx4
-rw-r--r--editeng/source/editeng/impedit3.cxx6
-rw-r--r--editeng/source/items/frmitems.cxx12
-rw-r--r--editeng/source/items/numitem.cxx2
-rw-r--r--editeng/source/items/textitem.cxx15
-rw-r--r--editeng/source/uno/unonrule.cxx2
7 files changed, 24 insertions, 29 deletions
diff --git a/editeng/source/accessibility/AccessibleEditableTextPara.cxx b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
index 90859aac7a73..cbb1d51bb224 100644
--- a/editeng/source/accessibility/AccessibleEditableTextPara.cxx
+++ b/editeng/source/accessibility/AccessibleEditableTextPara.cxx
@@ -1143,12 +1143,12 @@ namespace accessibility
sal_Int32 SAL_CALL AccessibleEditableTextPara::getBackground( )
{
// #104444# Added to XAccessibleComponent interface
- Color aColor( Application::GetSettings().GetStyleSettings().GetWindowColor().GetColor() );
+ Color aColor( Application::GetSettings().GetStyleSettings().GetWindowColor() );
// the background is transparent
aColor.SetTransparency( 0xFF);
- return static_cast<sal_Int32>( aColor.GetColor() );
+ return static_cast<sal_Int32>( aColor );
}
// XAccessibleText
@@ -1470,7 +1470,7 @@ namespace accessibility
if (rRes.Name == "CharColor")
{
uno::Any &anyChar = rRes.Value;
- sal_uInt32 crChar = static_cast<sal_uInt32>( reinterpret_cast<sal_uIntPtr>(anyChar.pReserved));
+ Color crChar = static_cast<sal_uInt32>( reinterpret_cast<sal_uIntPtr>(anyChar.pReserved));
if (COL_AUTO == crChar )
{
uno::Reference< css::accessibility::XAccessibleComponent > xComponent(mxParent,uno::UNO_QUERY);
@@ -1485,7 +1485,7 @@ namespace accessibility
else
{
Color cr(xComponent->getBackground());
- crChar = sal_uInt32(cr.IsDark() ? COL_WHITE : COL_BLACK);
+ crChar = cr.IsDark() ? COL_WHITE : COL_BLACK;
anyChar <<= crChar;
}
}
@@ -1501,7 +1501,7 @@ namespace accessibility
if (rRes.Name == "CharUnderlineColor")
{
uno::Any &anyCharUnderLine = rRes.Value;
- sal_uInt32 crCharUnderLine = static_cast<sal_uInt32>( reinterpret_cast<sal_uIntPtr>( anyCharUnderLine.pReserved));
+ Color crCharUnderLine = static_cast<sal_uInt32>( reinterpret_cast<sal_uIntPtr>( anyCharUnderLine.pReserved));
if (COL_AUTO == crCharUnderLine )
{
uno::Reference< css::accessibility::XAccessibleComponent > xComponent(mxParent,uno::UNO_QUERY);
@@ -1516,7 +1516,7 @@ namespace accessibility
else
{
Color cr(xComponent->getBackground());
- crCharUnderLine = sal_uInt32(cr.IsDark() ? COL_WHITE : COL_BLACK);
+ crCharUnderLine = cr.IsDark() ? COL_WHITE : COL_BLACK;
anyCharUnderLine <<= crCharUnderLine;
}
}
diff --git a/editeng/source/accessibility/AccessibleImageBullet.cxx b/editeng/source/accessibility/AccessibleImageBullet.cxx
index 5ab8259f92a7..38bacff7245b 100644
--- a/editeng/source/accessibility/AccessibleImageBullet.cxx
+++ b/editeng/source/accessibility/AccessibleImageBullet.cxx
@@ -334,12 +334,12 @@ namespace accessibility
{
// #104444# Added to XAccessibleComponent interface
- Color aColor( Application::GetSettings().GetStyleSettings().GetWindowColor().GetColor() );
+ Color aColor( Application::GetSettings().GetStyleSettings().GetWindowColor() );
// the background is transparent
aColor.SetTransparency( 0xFF);
- return static_cast<sal_Int32>( aColor.GetColor() );
+ return static_cast<sal_Int32>( aColor );
}
OUString SAL_CALL AccessibleImageBullet::getImplementationName()
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index cbb8c2b3d3d9..5209c5b908dc 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -3157,17 +3157,17 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, tools::Rectangle aClipRect, Po
#if OSL_DEBUG_LEVEL > 2
if ( rTextPortion.GetKind() == PORTIONKIND_HYPHENATOR )
{
- aTmpFont.SetFillColor( COL_LIGHTGRAY );
+ aTmpFont.SetFillCOL_LIGHTGRAY );
aTmpFont.SetTransparent( sal_False );
}
if ( rTextPortion.GetRightToLeft() )
{
- aTmpFont.SetFillColor( COL_LIGHTGRAY );
+ aTmpFont.SetFillCOL_LIGHTGRAY );
aTmpFont.SetTransparent( sal_False );
}
else if ( GetI18NScriptType( EditPaM( pPortion->GetNode(), nIndex+1 ) ) == i18n::ScriptType::COMPLEX )
{
- aTmpFont.SetFillColor( COL_LIGHTCYAN );
+ aTmpFont.SetFillCOL_LIGHTCYAN );
aTmpFont.SetTransparent( sal_False );
}
#endif
diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index f7a73d190229..46fac60bb578 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -1080,7 +1080,7 @@ bool SvxShadowItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
aShadow.Location = eSet;
aShadow.ShadowWidth = bConvert ? convertTwipToMm100(nWidth) : nWidth;
aShadow.IsTransparent = aShadowColor.GetTransparency() > 0;
- aShadow.Color = aShadowColor.GetColor();
+ aShadow.Color = sal_Int32(aShadowColor);
sal_Int8 nTransparence = rtl::math::round(float(aShadowColor.GetTransparency() * 100) / 255);
@@ -1132,7 +1132,7 @@ bool SvxShadowItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
{
Color aColor(aShadow.Color);
aColor.SetTransparency(rtl::math::round(float(nTransparence * 255) / 100));
- aShadow.Color = aColor.GetColor();
+ aShadow.Color = sal_Int32(aColor);
}
break;
}
@@ -1429,7 +1429,7 @@ table::BorderLine2 SvxBoxItem::SvxLineToLine(const SvxBorderLine* pLine, bool bC
table::BorderLine2 aLine;
if(pLine)
{
- aLine.Color = pLine->GetColor().GetColor() ;
+ aLine.Color = sal_Int32(pLine->GetColor());
aLine.InnerLineWidth = sal_uInt16( bConvert ? convertTwipToMm100(pLine->GetInWidth() ): pLine->GetInWidth() );
aLine.OuterLineWidth = sal_uInt16( bConvert ? convertTwipToMm100(pLine->GetOutWidth()): pLine->GetOutWidth() );
aLine.LineDistance = sal_uInt16( bConvert ? convertTwipToMm100(pLine->GetDistance()): pLine->GetDistance() );
@@ -2815,7 +2815,7 @@ bool SvxLineItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemId ) const
{
switch ( nMemId )
{
- case MID_FG_COLOR: rVal <<= sal_Int32(pLine->GetColor().GetColor()); break;
+ case MID_FG_COLOR: rVal <<= pLine->GetColor(); break;
case MID_OUTER_WIDTH: rVal <<= sal_Int32(pLine->GetOutWidth()); break;
case MID_INNER_WIDTH: rVal <<= sal_Int32(pLine->GetInWidth( )); break;
case MID_DISTANCE: rVal <<= sal_Int32(pLine->GetDistance()); break;
@@ -3180,10 +3180,10 @@ bool SvxBrushItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
switch( nMemberId)
{
case MID_BACK_COLOR:
- rVal <<= static_cast<sal_Int32>( aColor.GetColor() );
+ rVal <<= aColor;
break;
case MID_BACK_COLOR_R_G_B:
- rVal <<= static_cast<sal_Int32>( aColor.GetRGBColor() );
+ rVal <<= aColor.GetRGBColor();
break;
case MID_BACK_COLOR_TRANSPARENCY:
rVal <<= SvxBrushItem::TransparencyToPercent(aColor.GetTransparency());
diff --git a/editeng/source/items/numitem.cxx b/editeng/source/items/numitem.cxx
index c65c4e5f5e02..6b8a322a704c 100644
--- a/editeng/source/items/numitem.cxx
+++ b/editeng/source/items/numitem.cxx
@@ -295,7 +295,7 @@ void SvxNumberFormat::Store(SvStream &rStream, FontToSubsFontConverter pConverte
WritePair( rStream, aGraphicSize );
Color nTempColor = nBulletColor;
- if(COL_AUTO == nBulletColor.GetColor())
+ if(COL_AUTO == nBulletColor)
nTempColor = COL_BLACK;
WriteColor( rStream, nTempColor );
rStream.WriteUInt16( nBulletRelSize );
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index ed64f8392891..7ef82e39ec98 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -1168,7 +1168,7 @@ bool SvxTextLineItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
rVal <<= static_cast<sal_Int16>(GetValue());
break;
case MID_TL_COLOR:
- rVal <<= static_cast<sal_Int32>( mColor.GetColor() );
+ rVal <<= mColor;
break;
case MID_TL_HASCOLOR:
rVal <<= !mColor.GetTransparency();
@@ -1628,7 +1628,7 @@ bool SvxBackgroundColorItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) c
}
default:
{
- rVal <<= static_cast<sal_Int32>(aColor.GetColor());
+ rVal <<= aColor;
break;
}
}
@@ -1703,18 +1703,13 @@ bool SvxColorItem::operator==( const SfxPoolItem& rAttr ) const
bool SvxColorItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
{
- rVal <<= static_cast<sal_Int32>(mColor.GetColor());
+ rVal <<= mColor;
return true;
}
bool SvxColorItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
{
- sal_Int32 nColor = 0;
- if(!(rVal >>= nColor))
- return false;
-
- mColor = nColor;
- return true;
+ return (rVal >>= mColor);
}
SfxPoolItem* SvxColorItem::Clone( SfxItemPool * ) const
@@ -1725,7 +1720,7 @@ SfxPoolItem* SvxColorItem::Clone( SfxItemPool * ) const
SvStream& SvxColorItem::Store( SvStream& rStrm , sal_uInt16 nItemVersion ) const
{
if( VERSION_USEAUTOCOLOR == nItemVersion &&
- COL_AUTO == mColor.GetColor() )
+ COL_AUTO == mColor )
WriteColor( rStrm, COL_BLACK );
else
WriteColor( rStrm, mColor );
diff --git a/editeng/source/uno/unonrule.cxx b/editeng/source/uno/unonrule.cxx
index 2d16b96242b4..84ac95dab8b1 100644
--- a/editeng/source/uno/unonrule.cxx
+++ b/editeng/source/uno/unonrule.cxx
@@ -252,7 +252,7 @@ Sequence<beans::PropertyValue> SvxUnoNumberingRules::getNumberingRuleByIndex(sal
pArray[nIdx++] = beans::PropertyValue("SymbolTextDistance", -1, aVal, beans::PropertyState_DIRECT_VALUE);
- aVal <<= static_cast<sal_Int32>(rFmt.GetBulletColor().GetColor());
+ aVal <<= rFmt.GetBulletColor();
pArray[nIdx++] = beans::PropertyValue(UNO_NAME_NRULE_BULLET_COLOR, -1, aVal, beans::PropertyState_DIRECT_VALUE);
aVal <<= static_cast<sal_Int16>(rFmt.GetBulletRelSize());