summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-02-26 13:30:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-02-27 11:28:29 +0100
commitc98d3303027bd8bf8e0881b61918710ac479864c (patch)
treee6843dfd93352f134207cbc482451e8f17266bc2 /svtools
parent44a485c2baaf5bab81748f992915459bdaa58615 (diff)
replace Color(COL_*) with COL_*
using git grep -lwP "Color\s*\(\s*(COL_\w+)\s*\)" | xargs perl -pi -e "s/Color\s*\(\s*(COL_\w+)\s*\)//g" and then some manual fixup where the resulting expression no longer compiled Change-Id: I0e268d78611c3be40bba9f60ecfdc087a36c0df4 Reviewed-on: https://gerrit.libreoffice.org/50372 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/brwbox/brwbox1.cxx2
-rw-r--r--svtools/source/brwbox/brwbox2.cxx8
-rw-r--r--svtools/source/brwbox/datwin.cxx2
-rw-r--r--svtools/source/brwbox/editbrowsebox.cxx2
-rw-r--r--svtools/source/contnr/iconview.cxx2
-rw-r--r--svtools/source/contnr/imivctl1.cxx2
-rw-r--r--svtools/source/contnr/svimpbox.cxx2
-rw-r--r--svtools/source/contnr/treelistbox.cxx2
-rw-r--r--svtools/source/control/calendar.cxx2
-rw-r--r--svtools/source/control/headbar.cxx6
-rw-r--r--svtools/source/control/tabbar.cxx22
-rw-r--r--svtools/source/control/valueset.cxx16
-rw-r--r--svtools/source/filter/DocumentToGraphicRenderer.cxx2
-rw-r--r--svtools/source/graphic/grfmgr2.cxx14
-rw-r--r--svtools/source/misc/embedhlp.cxx4
15 files changed, 44 insertions, 44 deletions
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx
index 027549077fcb..ee4326154038 100644
--- a/svtools/source/brwbox/brwbox1.cxx
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -65,7 +65,7 @@ void BrowseBox::ConstructImpl( BrowserMode nMode )
pDataWin = VclPtr<BrowserDataWin>::Create( this ).get();
m_pImpl.reset( new ::svt::BrowseBoxImpl() );
- aGridLineColor = Color( COL_LIGHTGRAY );
+ aGridLineColor = COL_LIGHTGRAY;
InitSettings_Impl( this );
InitSettings_Impl( pDataWin );
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx
index 7432a57edf49..89c3babea3c7 100644
--- a/svtools/source/brwbox/brwbox2.cxx
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -606,7 +606,7 @@ void BrowseBox::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle
else
{
rRenderContext.Push(PushFlags::FILLCOLOR);
- rRenderContext.SetFillColor(Color(COL_BLACK));
+ rRenderContext.SetFillColor(COL_BLACK);
rRenderContext.DrawRect(tools::Rectangle(Point(nX, 0), Size(pCol->Width(), GetTitleHeight() - 1)));
rRenderContext.Pop();
}
@@ -725,7 +725,7 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
aButtonFrame.Draw( *pDev );
pDev->Push( PushFlags::LINECOLOR );
- pDev->SetLineColor( Color( COL_BLACK ) );
+ pDev->SetLineColor( COL_BLACK );
pDev->DrawLine( Point( aRealPos.X(), aRealPos.Y() + nTitleHeight-1 ),
Point( aRealPos.X() + pFirstCol->Width() - 1, aRealPos.Y() + nTitleHeight-1 ) );
@@ -791,7 +791,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const tools::Rectangle& _rRec
// cache frequently used values
Point aPos( aOverallAreaPos.X(), nRelTopRow * nDataRowHeigt + aOverallAreaPos.Y() );
- _rOut.SetLineColor( Color( COL_WHITE ) );
+ _rOut.SetLineColor( COL_WHITE );
const AllSettings& rAllSets = _rOut.GetSettings();
const StyleSettings &rSettings = rAllSets.GetStyleSettings();
const Color &rHighlightTextColor = rSettings.GetHighlightTextColor();
@@ -961,7 +961,7 @@ void BrowseBox::ImplPaintData(OutputDevice& _rOut, const tools::Rectangle& _rRec
{
// fill rectangle gray below handle column
// DG: fill it only until the end of the drawing rect and not to the end, as this may overpaint handle columns
- _rOut.SetLineColor( Color( COL_BLACK ) );
+ _rOut.SetLineColor( COL_BLACK );
_rOut.DrawRect( tools::Rectangle(
Point( aOverallAreaPos.X() - 1, aPos.Y() - 1 ),
Point( aOverallAreaPos.X() + pCols[ 0 ]->Width() - 1,
diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx
index 2385b7d8b907..881396dfa853 100644
--- a/svtools/source/brwbox/datwin.cxx
+++ b/svtools/source/brwbox/datwin.cxx
@@ -134,7 +134,7 @@ void BrowserColumn::Draw( BrowseBox const & rBox, OutputDevice& rDev, const Poin
ButtonFrame( rPos, Size( Width()-1, rBox.GetDataRowHeight()-1 ),
"", false ).Draw( rDev );
Color aOldLineColor = rDev.GetLineColor();
- rDev.SetLineColor( Color( COL_BLACK ) );
+ rDev.SetLineColor( COL_BLACK );
rDev.DrawLine(
Point( rPos.X(), rPos.Y()+rBox.GetDataRowHeight()-1 ),
Point( rPos.X() + Width() - 1, rPos.Y()+rBox.GetDataRowHeight()-1 ) );
diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx
index 05094cc40c30..2928cbb61f76 100644
--- a/svtools/source/brwbox/editbrowsebox.cxx
+++ b/svtools/source/brwbox/editbrowsebox.cxx
@@ -112,7 +112,7 @@ namespace svt
m_aImpl.reset(new EditBrowseBoxImpl);
SetCompoundControl(true);
- SetGridLineColor( Color( COL_LIGHTGRAY ) );
+ SetGridLineColor( COL_LIGHTGRAY );
ImplInitSettings(true, true, true);
diff --git a/svtools/source/contnr/iconview.cxx b/svtools/source/contnr/iconview.cxx
index c7f7d9181d59..9af84362f45f 100644
--- a/svtools/source/contnr/iconview.cxx
+++ b/svtools/source/contnr/iconview.cxx
@@ -182,7 +182,7 @@ void IconView::PaintEntry(SvTreeListEntry& rEntry, long nX, long nY,
aRect.SetSize(aRectSize);
Color aBackgroundColor = aWallpaper.GetColor();
- if (aBackgroundColor != Color(COL_TRANSPARENT))
+ if (aBackgroundColor != COL_TRANSPARENT)
{
rRenderContext.SetFillColor(aBackgroundColor);
// this case may occur for smaller horizontal resizes
diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx
index e97d67952430..d04cd408dae4 100644
--- a/svtools/source/contnr/imivctl1.cxx
+++ b/svtools/source/contnr/imivctl1.cxx
@@ -1538,7 +1538,7 @@ void SvxIconChoiceCtrl_Impl::PaintEmphasis(const tools::Rectangle& rTextRect, bo
if (bCursored)
{
aOldLineColor = rRenderContext.GetLineColor();
- rRenderContext.SetLineColor(Color(COL_GRAY));
+ rRenderContext.SetLineColor(COL_GRAY);
}
rRenderContext.DrawRect(rTextRect);
if (bCursored)
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index 0a229ca5e6f3..f11071fe9790 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -2889,7 +2889,7 @@ void SvImpLBox::PaintDDCursor( SvTreeListEntry* pInsertionPos )
RasterOp eOldOp = pView->GetRasterOp();
pView->SetRasterOp( RasterOp::Invert );
Color aOldLineColor = pView->GetLineColor();
- pView->SetLineColor( Color( COL_BLACK ) );
+ pView->SetLineColor( COL_BLACK );
pView->DrawLine( Point( 0, nY ), Point( aOutputSize.Width(), nY ) );
pView->SetLineColor( aOldLineColor );
pView->SetRasterOp( eOldOp );
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index aa070ff36a88..8bfda5c3d37f 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -2822,7 +2822,7 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render
if (!(nCurTab == 0 && (nTreeFlags & SvTreeFlags::USESEL) && nFirstSelTab))
{
Color aBackgroundColor = aWallpaper.GetColor();
- if (aBackgroundColor != Color(COL_TRANSPARENT))
+ if (aBackgroundColor != COL_TRANSPARENT)
{
rRenderContext.SetFillColor(aBackgroundColor);
// this case may occur for smaller horizontal resizes
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx
index e89605313e54..3771de6a8f7d 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -313,7 +313,7 @@ void Calendar::ImplFormat()
mnDayCount += 42-nDaysInMonth-nWeekDay;
// determine colours
- maOtherColor = Color( COL_LIGHTGRAY );
+ maOtherColor = COL_LIGHTGRAY;
if ( maOtherColor.IsRGBEqual( GetBackground().GetColor() ) )
maOtherColor = COL_GRAY;
diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx
index d2777c670e7e..5c1f32d1cd95 100644
--- a/svtools/source/control/headbar.cxx
+++ b/svtools/source/control/headbar.cxx
@@ -444,7 +444,7 @@ void HeaderBar::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos
// display text
if (!pItem->maOutText.isEmpty())
{
- if (aSelectionTextColor != Color(COL_TRANSPARENT))
+ if (aSelectionTextColor != COL_TRANSPARENT)
{
rRenderContext.Push(PushFlags::TEXTCOLOR);
rRenderContext.SetTextColor(aSelectionTextColor);
@@ -453,7 +453,7 @@ void HeaderBar::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos
rRenderContext.DrawText(Point(nTxtPos, nTxtPosY), pItem->maOutText);
else
rRenderContext.DrawCtrlText(Point(nTxtPos, nTxtPosY), pItem->maOutText, 0, pItem->maOutText.getLength(), DrawTextFlags::Disable);
- if (aSelectionTextColor != Color(COL_TRANSPARENT))
+ if (aSelectionTextColor != COL_TRANSPARENT)
rRenderContext.Pop();
}
@@ -924,7 +924,7 @@ void HeaderBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
pDev->SetMapMode();
pDev->SetFont( aFont );
if ( nFlags & DrawFlags::Mono )
- pDev->SetTextColor( Color( COL_BLACK ) );
+ pDev->SetTextColor( COL_BLACK );
else
pDev->SetTextColor( GetTextColor() );
pDev->SetTextFillColor();
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index 2cd5bd234484..1c623f210b97 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -219,14 +219,14 @@ struct ImplTabBarItem
, mbShort(false)
, mbSelect(false)
, mbProtect(false)
- , maTabBgColor(Color(COL_AUTO))
- , maTabTextColor(Color(COL_AUTO))
+ , maTabBgColor(COL_AUTO)
+ , maTabTextColor(COL_AUTO)
{
}
bool IsDefaultTabBgColor() const
{
- return maTabBgColor == Color(COL_AUTO);
+ return maTabBgColor == COL_AUTO;
}
bool IsSelected(ImplTabBarItem const * pCurItem) const
@@ -1208,7 +1208,7 @@ void TabBar::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& r
if (pItem->mnBits & TabBarPageBits::Blue)
{
- rRenderContext.SetTextColor(Color(COL_LIGHTBLUE));
+ rRenderContext.SetTextColor(COL_LIGHTBLUE);
}
if (pItem->mnBits & TabBarPageBits::Italic)
{
@@ -1653,7 +1653,7 @@ Color TabBar::GetTabBgColor(sal_uInt16 nPageId) const
if (nPos != PAGE_NOT_FOUND)
return mpImpl->mpItemList[nPos]->maTabBgColor;
else
- return Color(COL_AUTO);
+ return COL_AUTO;
}
void TabBar::SetTabBgColor(sal_uInt16 nPageId, const Color& aTabBgColor)
@@ -1663,18 +1663,18 @@ void TabBar::SetTabBgColor(sal_uInt16 nPageId, const Color& aTabBgColor)
return;
auto& pItem = mpImpl->mpItemList[nPos];
- if (aTabBgColor != Color(COL_AUTO))
+ if (aTabBgColor != COL_AUTO)
{
pItem->maTabBgColor = aTabBgColor;
if (aTabBgColor.GetLuminance() <= 128) //Do not use aTabBgColor.IsDark(), because that threshold is way too low...
- pItem->maTabTextColor = Color(COL_WHITE);
+ pItem->maTabTextColor = COL_WHITE;
else
- pItem->maTabTextColor = Color(COL_BLACK);
+ pItem->maTabTextColor = COL_BLACK;
}
else
{
- pItem->maTabBgColor = Color(COL_AUTO);
- pItem->maTabTextColor = Color(COL_AUTO);
+ pItem->maTabBgColor = COL_AUTO;
+ pItem->maTabTextColor = COL_AUTO;
}
}
@@ -2112,7 +2112,7 @@ bool TabBar::StartEditMode(sal_uInt16 nPageId)
}
if (GetPageBits( mnEditId ) & TabBarPageBits::Blue)
{
- aForegroundColor = Color(COL_LIGHTBLUE);
+ aForegroundColor = COL_LIGHTBLUE;
}
mpImpl->mpEdit->SetControlFont(aFont);
mpImpl->mpEdit->SetControlForeground(aForegroundColor);
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
index 4d4e0a8d89bc..54d7e3bbbf02 100644
--- a/svtools/source/control/valueset.cxx
+++ b/svtools/source/control/valueset.cxx
@@ -772,13 +772,13 @@ void ValueSet::ImplDrawSelect(vcl::RenderContext& rRenderContext, sal_uInt16 nIt
const Color& rBack = rWall.GetColor();
if (rBack.IsDark() && ! aDoubleColor.IsBright())
{
- aDoubleColor = Color(COL_WHITE);
- aSingleColor = Color(COL_BLACK);
+ aDoubleColor = COL_WHITE;
+ aSingleColor = COL_BLACK;
}
else if (rBack.IsBright() && ! aDoubleColor.IsDark())
{
- aDoubleColor = Color(COL_BLACK);
- aSingleColor = Color(COL_WHITE);
+ aDoubleColor = COL_BLACK;
+ aSingleColor = COL_WHITE;
}
}
}
@@ -792,7 +792,7 @@ void ValueSet::ImplDrawSelect(vcl::RenderContext& rRenderContext, sal_uInt16 nIt
if (bDrawSel)
{
- rRenderContext.SetLineColor(mbBlackSel ? Color(COL_BLACK) : aDoubleColor);
+ rRenderContext.SetLineColor(mbBlackSel ? COL_BLACK : aDoubleColor);
rRenderContext.DrawRect(aRect);
}
}
@@ -800,7 +800,7 @@ void ValueSet::ImplDrawSelect(vcl::RenderContext& rRenderContext, sal_uInt16 nIt
{
if (bDrawSel)
{
- rRenderContext.SetLineColor(mbBlackSel ? Color(COL_BLACK) : aDoubleColor);
+ rRenderContext.SetLineColor(mbBlackSel ? COL_BLACK : aDoubleColor);
rRenderContext.DrawRect(aRect);
}
if (mbDoubleSel)
@@ -835,11 +835,11 @@ void ValueSet::ImplDrawSelect(vcl::RenderContext& rRenderContext, sal_uInt16 nIt
if (bDrawSel)
{
- rRenderContext.SetLineColor(mbBlackSel ? Color(COL_WHITE) : aSingleColor);
+ rRenderContext.SetLineColor(mbBlackSel ? COL_WHITE : aSingleColor);
}
else
{
- rRenderContext.SetLineColor(Color(COL_LIGHTGRAY));
+ rRenderContext.SetLineColor(COL_LIGHTGRAY);
}
rRenderContext.DrawRect(aRect2);
diff --git a/svtools/source/filter/DocumentToGraphicRenderer.cxx b/svtools/source/filter/DocumentToGraphicRenderer.cxx
index 8d48bca87706..fd3ce0c39be8 100644
--- a/svtools/source/filter/DocumentToGraphicRenderer.cxx
+++ b/svtools/source/filter/DocumentToGraphicRenderer.cxx
@@ -206,7 +206,7 @@ Graphic DocumentToGraphicRenderer::renderToGraphic(
aMtf.Record( pOutputDev );
- if (aPageColor != Color(COL_TRANSPARENT))
+ if (aPageColor != COL_TRANSPARENT)
{
pOutputDev->SetBackground(Wallpaper(aPageColor));
pOutputDev->Erase();
diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx
index 2c9429f01be6..61d587ea089a 100644
--- a/svtools/source/graphic/grfmgr2.cxx
+++ b/svtools/source/graphic/grfmgr2.cxx
@@ -685,7 +685,7 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib
}
else // scaleByAveraging
{
- const BitmapColor aTrans( pWriteAccess->GetBestMatchingColor( Color( COL_WHITE ) ) );
+ const BitmapColor aTrans( pWriteAccess->GetBestMatchingColor( Color(COL_WHITE) ) );
BitmapColor aResultColor( 0 );
double aSum, aCount;
@@ -746,7 +746,7 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib
}
else
{
- const BitmapColor aTrans( pWriteAccess->GetBestMatchingColor( Color( COL_WHITE ) ) );
+ const BitmapColor aTrans( pWriteAccess->GetBestMatchingColor( Color(COL_WHITE) ) );
BitmapColor aAlphaVal( 0 );
for( long nY = 0; nY < aTargetHeight; nY++ )
@@ -802,8 +802,8 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib
if( pWriteAccess )
{
Bitmap aMsk( rBmpEx.GetMask() );
- const BitmapColor aB( pWriteAccess->GetBestMatchingColor( Color( COL_BLACK ) ) );
- const BitmapColor aW( pWriteAccess->GetBestMatchingColor( Color( COL_WHITE ) ) );
+ const BitmapColor aB( pWriteAccess->GetBestMatchingColor( Color(COL_BLACK) ) );
+ const BitmapColor aW( pWriteAccess->GetBestMatchingColor( Color(COL_WHITE) ) );
BitmapReadAccess* pMAcc = nullptr;
if( !aMsk || ( ( pMAcc = aMsk.AcquireReadAccess() ) != nullptr ) )
@@ -813,7 +813,7 @@ bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAttrib
BitmapColor aTestB;
if( pMAcc )
- aTestB = pMAcc->GetBestMatchingColor( Color( COL_BLACK ) );
+ aTestB = pMAcc->GetBestMatchingColor( Color(COL_BLACK) );
// create new horizontal mapping table
for( long nX = 0; nX < aUnrotatedWidth; nX++ )
@@ -1448,7 +1448,7 @@ void GraphicManager::ImplAdjust( BitmapEx& rBmpEx, const GraphicAttr& rAttr, Gra
if( ( nAdjustmentFlags & GraphicAdjustmentFlags::ROTATE ) && aAttr.IsRotated() )
{
- rBmpEx.Rotate( aAttr.GetRotation(), Color( COL_TRANSPARENT ) );
+ rBmpEx.Rotate( aAttr.GetRotation(), COL_TRANSPARENT );
}
if( ( nAdjustmentFlags & GraphicAdjustmentFlags::TRANSPARENCY ) && aAttr.IsTransparent() )
@@ -1881,7 +1881,7 @@ bool GraphicObject::ImplDrawTiled( OutputDevice* pOut, const tools::Rectangle& r
AlphaMask( aVDev->GetBitmap( Point(0,0), aVDev->GetOutputSize() ) ) );
else
aTileBitmap = BitmapEx( aTileBitmap.GetBitmap(),
- aVDev->GetBitmap( Point(0,0), aVDev->GetOutputSize() ).CreateMask( Color(COL_WHITE) ) );
+ aVDev->GetBitmap( Point(0,0), aVDev->GetOutputSize() ).CreateMask( COL_WHITE ) );
}
}
diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx
index c6890a2c6f29..c7d0e4d82c01 100644
--- a/svtools/source/misc/embedhlp.cxx
+++ b/svtools/source/misc/embedhlp.cxx
@@ -624,7 +624,7 @@ void EmbeddedObjectRef::DrawPaintReplacement( const tools::Rectangle &rRect, con
Size aAppFontSz = pOut->LogicToLogic( Size( 0, 8 ), &aMM, nullptr );
vcl::Font aFnt( "Helvetica", aAppFontSz );
aFnt.SetTransparent( true );
- aFnt.SetColor( Color( COL_LIGHTRED ) );
+ aFnt.SetColor( COL_LIGHTRED );
aFnt.SetWeight( WEIGHT_BOLD );
aFnt.SetFamily( FAMILY_SWISS );
@@ -707,7 +707,7 @@ void EmbeddedObjectRef::DrawShading( const tools::Rectangle &rRect, OutputDevice
return;
pOut->Push();
- pOut->SetLineColor( Color( COL_BLACK ) );
+ pOut->SetLineColor( COL_BLACK );
Size aPixSize = pOut->LogicToPixel( rRect.GetSize() );
aPixSize.AdjustWidth( -1 );