summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-02-26 17:13:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-02-28 07:34:27 +0100
commite2cb154195fdc2ffccdb6f5e87cae8b29640b3eb (patch)
tree7c3d53d78e0867aa879b98d84211d1e73602520f /sw/source
parent0ea41fea75cd1ac1d81fa57c4411e75a6b4001f0 (diff)
convert COL_ constants to be of type Color
Change-Id: I0e25c8950ac26b851ff42f71e1471fcbe4770d48 Reviewed-on: https://gerrit.libreoffice.org/50373 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/access/acccontext.cxx4
-rw-r--r--sw/source/core/access/accpara.cxx8
-rw-r--r--sw/source/core/frmedt/fefly1.cxx2
-rw-r--r--sw/source/core/layout/paintfrm.cxx2
-rw-r--r--sw/source/core/text/inftxt.cxx2
-rw-r--r--sw/source/core/txtnode/fntcache.cxx2
-rw-r--r--sw/source/filter/html/css1atr.cxx2
-rw-r--r--sw/source/filter/html/htmlform.cxx2
-rw-r--r--sw/source/filter/html/wrthtml.cxx2
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx2
-rw-r--r--sw/source/filter/ww8/rtfexport.cxx2
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx7
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx2
-rw-r--r--sw/source/filter/ww8/ww8par2.cxx4
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx6
-rw-r--r--sw/source/uibase/config/viewopt.cxx2
-rw-r--r--sw/source/uibase/docvw/HeaderFooterWin.cxx6
-rw-r--r--sw/source/uibase/docvw/PageBreakWin.cxx6
-rw-r--r--sw/source/uibase/frmdlg/colex.cxx2
-rw-r--r--sw/source/uibase/utlui/shdwcrsr.cxx2
20 files changed, 33 insertions, 34 deletions
diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx
index 9a4c36659c20..628ad727dc47 100644
--- a/sw/source/core/access/acccontext.cxx
+++ b/sw/source/core/access/acccontext.cxx
@@ -970,12 +970,12 @@ void SAL_CALL SwAccessibleContext::grabFocus()
sal_Int32 SAL_CALL SwAccessibleContext::getForeground()
{
- return COL_BLACK;
+ return sal_Int32(COL_BLACK);
}
sal_Int32 SAL_CALL SwAccessibleContext::getBackground()
{
- return COL_WHITE;
+ return sal_Int32(COL_WHITE);
}
sal_Bool SAL_CALL SwAccessibleContext::supportsService (const OUString& ServiceName)
diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index 6f206aff32cb..0b35cdf968c9 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -1029,11 +1029,11 @@ sal_Int32 SAL_CALL SwAccessibleParagraph::getForeground()
{
if ( aBackgroundCol.IsDark() )
{
- return COL_WHITE;
+ return sal_Int32(COL_WHITE);
}
else
{
- return COL_BLACK;
+ return sal_Int32(COL_BLACK);
}
}
@@ -2181,7 +2181,7 @@ void SwAccessibleParagraph::_correctValues( const sal_Int32 nIndex,
if (xComponent.is())
{
Color cr(xComponent->getBackground());
- crChar = cr.IsDark() ? COL_WHITE : COL_BLACK;
+ crChar = sal_uInt32(cr.IsDark() ? COL_WHITE : COL_BLACK);
rValue.Value <<= crChar;
}
}
@@ -2237,7 +2237,7 @@ void SwAccessibleParagraph::_correctValues( const sal_Int32 nIndex,
if (xComponent.is())
{
Color cr(xComponent->getBackground());
- crUnderline = cr.IsDark() ? COL_WHITE : COL_BLACK;
+ crUnderline = sal_uInt32(cr.IsDark() ? COL_WHITE : COL_BLACK);
rValue.Value <<= crUnderline;
}
}
diff --git a/sw/source/core/frmedt/fefly1.cxx b/sw/source/core/frmedt/fefly1.cxx
index b43ec2dfe50d..f6b731ba2be1 100644
--- a/sw/source/core/frmedt/fefly1.cxx
+++ b/sw/source/core/frmedt/fefly1.cxx
@@ -597,7 +597,7 @@ Point SwFEShell::FindAnchorPos( const Point& rAbsPos, bool bMoveIt )
MakeVisible( aTmpRect );
#if OSL_DEBUG_LEVEL > 0
//TODO: That doesn't seem to be intended
- if( Color(COL_TRANSPARENT) != GetOut()->GetLineColor() )
+ if( COL_TRANSPARENT != GetOut()->GetLineColor() )
{
OSL_FAIL( "Hey, Joe: Where's my Null Pen?" );
GetOut()->SetLineColor( COL_TRANSPARENT );
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index a4b10585e6b3..9acc1debd096 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -3736,7 +3736,7 @@ bool SwFlyFrame::IsBackgroundTransparent() const
{
if ( pSectionTOXColor &&
(pSectionTOXColor->GetTransparency() != 0) &&
- (pSectionTOXColor->GetColor() != COL_TRANSPARENT) )
+ (*pSectionTOXColor != COL_TRANSPARENT) )
{
bBackgroundTransparent = true;
}
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 814d7fad91a4..ee3cb8a82b0e 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -541,7 +541,7 @@ static bool lcl_IsDarkBackground( const SwTextPaintInfo& rInf )
pCol = &pItem->GetColor();
// Determined color <pCol> can be <COL_TRANSPARENT>. Thus, check it.
- if ( pCol->GetColor() == COL_TRANSPARENT)
+ if ( *pCol == COL_TRANSPARENT)
pCol = nullptr;
}
else
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index 40768a132e84..599452c0b5a3 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -2528,7 +2528,7 @@ bool SwDrawTextInfo::ApplyAutoColor( vcl::Font* pFont )
/// OD 30.08.2002 #99657#
/// determined color <pCol> can be <COL_TRANSPARENT>. Thus, check it.
- if ( pCol->GetColor() == COL_TRANSPARENT)
+ if ( *pCol == COL_TRANSPARENT)
pCol = nullptr;
}
else
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index 6d23a4a60ce9..4232fdfdedd4 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -3135,7 +3135,7 @@ static Writer& OutCSS1_SvxBrush( Writer& rWrt, const SfxPoolItem& rHt,
// get the color
bool bColor = false;
/// set <bTransparent> to true, if color is "no fill"/"auto fill"
- bool bTransparent = (rColor.GetColor() == COL_TRANSPARENT);
+ bool bTransparent = (rColor == COL_TRANSPARENT);
Color aColor;
if( !bTransparent )
{
diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx
index 2e6d38e42666..598b1dc4bde9 100644
--- a/sw/source/filter/html/htmlform.cxx
+++ b/sw/source/filter/html/htmlform.cxx
@@ -954,7 +954,7 @@ uno::Reference< drawing::XShape > SwHTMLParser::InsertControl(
{
const Color &rColor = static_cast<const SvxBrushItem *>(pItem)->GetColor();
/// copy color, if color is not "no fill"/"auto fill"
- if( rColor.GetColor() != COL_TRANSPARENT )
+ if( rColor != COL_TRANSPARENT )
{
/// copy complete color with transparency
aTmp <<= static_cast<sal_Int32>(rColor.GetColor());
diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx
index c7256f05a8c0..717365e535de 100644
--- a/sw/source/filter/html/wrthtml.cxx
+++ b/sw/source/filter/html/wrthtml.cxx
@@ -1208,7 +1208,7 @@ void SwHTMLWriter::OutBackground( const SvxBrushItem *pBrushItem, bool bGraphic
const Color &rBackColor = pBrushItem->GetColor();
/// check, if background color is not "no fill"/"auto fill", instead of
/// only checking, if transparency is not set.
- if( rBackColor.GetColor() != COL_TRANSPARENT )
+ if( rBackColor != COL_TRANSPARENT )
{
OStringBuffer sOut;
sOut.append(' ').append(OOO_STRING_SVTOOLS_HTML_O_bgcolor).append('=');
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 2f1301b354a4..e472319cc4b8 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4257,7 +4257,7 @@ void DocxAttributeOutput::OutputDefaultItem(const SfxPoolItem& rHt)
bMustWrite = static_cast< const SvxCaseMapItem& >(rHt).GetCaseMap() != SvxCaseMap::NotMapped;
break;
case RES_CHRATR_COLOR:
- bMustWrite = static_cast< const SvxColorItem& >(rHt).GetValue().GetColor() != COL_AUTO;
+ bMustWrite = static_cast< const SvxColorItem& >(rHt).GetValue() != COL_AUTO;
break;
case RES_CHRATR_CONTOUR:
bMustWrite = static_cast< const SvxContourItem& >(rHt).GetValue();
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index 50044b5241f4..848a11f28715 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -1127,7 +1127,7 @@ void RtfExport::InsColor(const Color& rCol)
if (rEntry.second == COL_AUTO)
bAutoColorInTable = true;
}
- if (rCol.GetColor() == COL_AUTO)
+ if (rCol == COL_AUTO)
// COL_AUTO gets value 0
n = 0;
else
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index cfc7123e3673..7287557f8780 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -1531,7 +1531,7 @@ boost::optional<SvxBrushItem> MSWordExportBase::getBackground()
if (SfxItemState::SET == eState)
{
// The 'color' is set for the first page style - take it and use it as the background color of the entire DOCX
- if (aBrush.GetColor().GetColor() != COL_AUTO)
+ if (aBrush.GetColor() != COL_AUTO)
oRet.reset(aBrush);
}
return oRet;
@@ -2635,11 +2635,10 @@ void WW8AttributeOutput::TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t
WW8SHDLong aSHD;
aSHD.setCvFore( 0xFF000000 );
- sal_uInt32 nBgColor = aColor.GetColor();
- if ( nBgColor == COL_AUTO )
+ if ( aColor == COL_AUTO )
aSHD.setCvBack( 0xFF000000 );
else
- aSHD.setCvBack( wwUtility::RGBToBGR( nBgColor ) );
+ aSHD.setCvBack( wwUtility::RGBToBGR( aColor.GetColor() ) );
aSHD.Write( m_rWW8Export );
}
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 2c187e610522..9480ce32ba80 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -1537,7 +1537,7 @@ bool WW8Export::TransBrush(const Color& rCol, WW8_SHD& rShd)
sal_uInt32 SuitableBGColor(sal_uInt32 nIn)
{
- if (nIn == COL_AUTO)
+ if (nIn == sal_uInt32(COL_AUTO))
return 0xFF000000;
return wwUtility::RGBToBGR(nIn);
}
diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx
index 7da1c54edc82..04856eb181db 100644
--- a/sw/source/filter/ww8/ww8par2.cxx
+++ b/sw/source/filter/ww8/ww8par2.cxx
@@ -1564,7 +1564,7 @@ void WW8TabBandDesc::ReadNewShd(const sal_uInt8* pS, bool bVer67)
pNewSHDs[i++] = SwWW8ImplReader::ExtractColour(pS, bVer67);
while (i < nWwCols)
- pNewSHDs[i++] = COL_AUTO;
+ pNewSHDs[i++] = sal_uInt32(COL_AUTO);
}
void WW8TabBandDesc::setcelldefaults(WW8_TCell *pCells, short nCols)
@@ -3035,7 +3035,7 @@ void WW8TabDesc::SetTabShades( SwTableBox* pBox, short nWwIdx )
return; // faked cells -> no color
bool bFound=false;
- if (m_pActBand->pNewSHDs && m_pActBand->pNewSHDs[nWwIdx] != COL_AUTO)
+ if (m_pActBand->pNewSHDs && m_pActBand->pNewSHDs[nWwIdx] != sal_uInt32(COL_AUTO))
{
Color aColor(m_pActBand->pNewSHDs[nWwIdx]);
pBox->GetFrameFormat()->SetFormatAttr(SvxBrushItem(aColor, RES_BACKGROUND));
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index a9a9ee0cdbfe..1384a7738c69 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -2539,7 +2539,7 @@ void SwWW8ImplReader::StopApo()
*/
const SfxPoolItem &rItm = pNd->SwContentNode::GetAttr(RES_BACKGROUND);
const SvxBrushItem &rBrush = static_cast<const SvxBrushItem&>(rItm);
- if (rBrush.GetColor().GetColor() != COL_AUTO)
+ if (rBrush.GetColor() != COL_AUTO)
aBg = rBrush.GetColor();
if (m_pLastAnchorPos.get())
@@ -4818,8 +4818,8 @@ sal_uInt32 SwWW8ImplReader::ExtractColour(const sal_uInt8* &rpData, bool bVer67)
//Being a transparent background colour doesn't actually show the page
//background through, it merely acts like white
if (nBack == 0xFF000000)
- nBack = COL_AUTO;
- OSL_ENSURE(nBack == COL_AUTO || !(nBack & 0xFF000000),
+ nBack = sal_uInt32(COL_AUTO);
+ OSL_ENSURE(nBack == sal_uInt32(COL_AUTO) || !(nBack & 0xFF000000),
"ww8: don't know what to do with such a transparent bg colour, report");
SwWW8Shade aShade(nFore, nBack, nIndex);
return aShade.aColor.GetColor();
diff --git a/sw/source/uibase/config/viewopt.cxx b/sw/source/uibase/config/viewopt.cxx
index e8b436894ed9..f568247cb4d7 100644
--- a/sw/source/uibase/config/viewopt.cxx
+++ b/sw/source/uibase/config/viewopt.cxx
@@ -101,7 +101,7 @@ bool SwViewOption::IsEqualFlags( const SwViewOption &rOpt ) const
}
void SwViewOption::DrawRect( OutputDevice *pOut,
- const SwRect &rRect, long nCol )
+ const SwRect &rRect, ::Color nCol )
{
if ( pOut->GetOutDevType() != OUTDEV_PRINTER )
{
diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index 007184220816..a45ce53b8bbd 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -348,9 +348,9 @@ void SwHeaderFooterWin::Paint(vcl::RenderContext& rRenderContext, const ::tools:
aSign.setClosed(true);
}
- BColor aSignColor = Color(COL_BLACK).getBColor();
+ BColor aSignColor = COL_BLACK.getBColor();
if (Application::GetSettings().GetStyleSettings().GetHighContrastMode())
- aSignColor = Color(COL_WHITE).getBColor();
+ aSignColor = COL_WHITE.getBColor();
aSeq.push_back( drawinglayer::primitive2d::Primitive2DReference(
new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
@@ -366,7 +366,7 @@ void SwHeaderFooterWin::Paint(vcl::RenderContext& rRenderContext, const ::tools:
double nFadeRate = double(m_nFadeRate) / 100.0;
const basegfx::BColorModifierSharedPtr aBColorModifier(
- new basegfx::BColorModifier_interpolate(Color(COL_WHITE).getBColor(),
+ new basegfx::BColorModifier_interpolate(COL_WHITE.getBColor(),
1.0 - nFadeRate));
aGhostedSeq[0] = drawinglayer::primitive2d::Primitive2DReference(
diff --git a/sw/source/uibase/docvw/PageBreakWin.cxx b/sw/source/uibase/docvw/PageBreakWin.cxx
index c93a863cf7f0..a629f2cc5742 100644
--- a/sw/source/uibase/docvw/PageBreakWin.cxx
+++ b/sw/source/uibase/docvw/PageBreakWin.cxx
@@ -192,9 +192,9 @@ void SwPageBreakWin::Paint(vcl::RenderContext& rRenderContext, const ::tools::Re
aTriangle.append(B2DPoint((nLeft + nRight) / 2.0, nBottom));
aTriangle.setClosed(true);
- BColor aTriangleColor = Color(COL_BLACK).getBColor();
+ BColor aTriangleColor = COL_BLACK.getBColor();
if (Application::GetSettings().GetStyleSettings().GetHighContrastMode())
- aTriangleColor = Color(COL_WHITE).getBColor();
+ aTriangleColor = COL_WHITE.getBColor();
aSeq.emplace_back();
aSeq.back().set( new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(
@@ -203,7 +203,7 @@ void SwPageBreakWin::Paint(vcl::RenderContext& rRenderContext, const ::tools::Re
drawinglayer::primitive2d::Primitive2DContainer aGhostedSeq(1);
double nFadeRate = double(m_nFadeRate) / 100.0;
const basegfx::BColorModifierSharedPtr aBColorModifier(
- new basegfx::BColorModifier_interpolate(Color(COL_WHITE).getBColor(),
+ new basegfx::BColorModifier_interpolate(COL_WHITE.getBColor(),
1.0 - nFadeRate));
aGhostedSeq[0].set( new drawinglayer::primitive2d::ModifiedColorPrimitive2D(
aSeq, aBColorModifier));
diff --git a/sw/source/uibase/frmdlg/colex.cxx b/sw/source/uibase/frmdlg/colex.cxx
index 5a4a67bb9c11..f3ae1b67b49d 100644
--- a/sw/source/uibase/frmdlg/colex.cxx
+++ b/sw/source/uibase/frmdlg/colex.cxx
@@ -516,7 +516,7 @@ void SwPageGridExample::DrawPage(vcl::RenderContext& rRenderContext, const Point
//paint the grid now
Color aLineColor = pGridItem->GetColor();
- if (aLineColor.GetColor() == COL_AUTO)
+ if (aLineColor == COL_AUTO)
{
aLineColor = rRenderContext.GetFillColor();
aLineColor.Invert();
diff --git a/sw/source/uibase/utlui/shdwcrsr.cxx b/sw/source/uibase/utlui/shdwcrsr.cxx
index 47e6613af6b0..6e5c715789f7 100644
--- a/sw/source/uibase/utlui/shdwcrsr.cxx
+++ b/sw/source/uibase/utlui/shdwcrsr.cxx
@@ -76,7 +76,7 @@ void SwShadowCursor::DrawCursor( const Point& rPt, long nHeight, sal_uInt16 nMod
pWin->SetMapMode(MapMode(MapUnit::MapPixel));
pWin->SetRasterOp( RasterOp::Xor );
- pWin->SetLineColor( Color( aCol.GetColor() ^ COL_WHITE ) );
+ pWin->SetLineColor( Color( aCol.GetColor() ^ sal_uInt32(COL_WHITE) ) );
// 1. The Line:
pWin->DrawLine( Point( rPt.X(), rPt.Y() + 1),