Kaydet (Commit) 856c57f2 authored tarafından Noel Grandin's avatar Noel Grandin

use more Color in cppcanvas..drawinglayer

Change-Id: Ib0f15e8d4c01c1d2059cf32cc882042766d2a682
Reviewed-on: https://gerrit.libreoffice.org/50861Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst a498b12d
......@@ -912,21 +912,21 @@ namespace cppcanvas
::Color aTextColor = vcl::unotools::doubleSequenceToColor(
rState.textColor, xColorSpace );
aReliefColor = ::COL_LIGHTGRAY;
aReliefColor = COL_LIGHTGRAY;
// we don't have a automatic color, so black is always
// drawn on white (literally copied from
// vcl/source/gdi/outdev3.cxx)
if( aTextColor == COL_BLACK )
{
aTextColor = ::COL_WHITE;
aTextColor = COL_WHITE;
rParms.mrStates.getState().textColor =
vcl::unotools::colorToDoubleSequence(
aTextColor, xColorSpace );
}
if( aTextColor == COL_WHITE )
aReliefColor = ::COL_BLACK;
aReliefColor = COL_BLACK;
aReliefColor.SetTransparency( aTextColor.GetTransparency() );
}
......
......@@ -1610,7 +1610,7 @@ namespace cppcanvas
mnOutlineWidth( calcOutlineWidth(rState,rVDev) ),
maFillColor(
vcl::unotools::colorToDoubleSequence(
::COL_WHITE,
COL_WHITE,
rCanvas->getUNOCanvas()->getDevice()->getDeviceColorSpace() )),
maTextLineInfo( tools::createTextLineInfo( rVDev, rState ) ),
maLinesOverallSize(),
......@@ -1652,7 +1652,7 @@ namespace cppcanvas
mnOutlineWidth( calcOutlineWidth(rState,rVDev) ),
maFillColor(
vcl::unotools::colorToDoubleSequence(
::COL_WHITE,
COL_WHITE,
rCanvas->getUNOCanvas()->getDevice()->getDeviceColorSpace() )),
maTextLineInfo( tools::createTextLineInfo( rVDev, rState ) ),
maLinesOverallSize(),
......
......@@ -436,7 +436,7 @@ void ColorFieldControl::ShowPosition( const Point& rPos, bool bUpdate )
mdX = double(nX) / double(aSize.Width() - 1.0);
mdY = double(aSize.Height() - 1.0 - nY) / double(aSize.Height() - 1.0);
maColor = mxBitmap->GetPixel(Point(nX, nY)).GetColor();
maColor = mxBitmap->GetPixel(Point(nX, nY));
}
}
......@@ -807,7 +807,7 @@ void ColorSliderControl::SetValue(const Color& rColor, ColorMode eMode, double d
class ColorPickerDialog : public ModalDialog
{
public:
ColorPickerDialog(vcl::Window* pParent, sal_Int32 nColor, sal_Int16 nMode);
ColorPickerDialog(vcl::Window* pParent, Color nColor, sal_Int16 nMode);
virtual ~ColorPickerDialog() override
{
disposeOnce();
......@@ -821,7 +821,7 @@ public:
DECL_LINK(ColorModifyEditHdl, Edit&, void);
DECL_LINK(ModeModifyHdl, RadioButton&, void);
sal_Int32 GetColor() const;
Color GetColor() const;
void setColorComponent(ColorComponent nComp, double dValue);
......@@ -865,7 +865,7 @@ private:
VclPtr<MetricField> mpMFKey;
};
ColorPickerDialog::ColorPickerDialog( vcl::Window* pParent, sal_Int32 nColor, sal_Int16 nMode )
ColorPickerDialog::ColorPickerDialog( vcl::Window* pParent, Color nColor, sal_Int16 nMode )
: ModalDialog( pParent, "ColorPicker", "cui/ui/colorpickerdialog.ui" )
, mnDialogMode( nMode )
, meMode( DefaultMode )
......@@ -1001,9 +1001,9 @@ static int toInt( double dValue, double dRange )
return static_cast< int >( std::floor((dValue * dRange) + 0.5 ) );
}
sal_Int32 ColorPickerDialog::GetColor() const
Color ColorPickerDialog::GetColor() const
{
return Color( toInt(mdRed,255.0), toInt(mdGreen,255.0), toInt(mdBlue,255.0) ).GetColor();
return Color( toInt(mdRed,255.0), toInt(mdGreen,255.0), toInt(mdBlue,255.0) );
}
void ColorPickerDialog::update_color( UpdateFlags n )
......@@ -1088,7 +1088,7 @@ void ColorPickerDialog::update_color( UpdateFlags n )
if (n & UpdateFlags::Hex) // update hex
{
mpEDHex->SetColor(aColor.GetColor());
mpEDHex->SetColor(aColor);
}
{
......@@ -1358,7 +1358,7 @@ private:
OUString msTitle;
const OUString msColorKey;
const OUString msModeKey;
sal_Int32 mnColor;
Color mnColor;
sal_Int16 mnMode;
Reference<css::awt::XWindow> mxParent;
};
......
......@@ -422,7 +422,7 @@ void ColorConfigWindow_Impl::Entry::ColorChanged (
ColorConfigValue& rValue
) {
Color aColor = m_pColorList->GetSelectEntryColor();
rValue.nColor = aColor.GetColor();
rValue.nColor = aColor;
}
// color of an extended entry has changed
......@@ -430,7 +430,7 @@ void ColorConfigWindow_Impl::Entry::ColorChanged (
ExtendedColorConfigValue& rValue
) {
Color aColor = m_pColorList->GetSelectEntryColor();
rValue.setColor(aColor.GetColor());
rValue.setColor(aColor);
if (aColor == COL_AUTO)
{
rValue.setColor(rValue.getDefaultColor());
......
......@@ -396,7 +396,7 @@ IMPL_LINK_NOARG(SvxColorTabPage, ClickAddHdl_Impl, Button*, void)
sal_Int32 nSize = aCustomColorList.getLength();
aCustomColorList.realloc( nSize + 1 );
aCustomColorNameList.realloc( nSize + 1 );
aCustomColorList[nSize] = aCurrentColor.GetColor();
aCustomColorList[nSize] = sal_Int32(aCurrentColor);
aCustomColorNameList[nSize] = aName;
officecfg::Office::Common::UserColors::CustomColor::set(aCustomColorList, batch);
officecfg::Office::Common::UserColors::CustomColorName::set(aCustomColorNameList, batch);
......@@ -629,14 +629,14 @@ void SvxColorTabPage::UpdateColorValues( bool bUpdatePreset )
m_pRcustom->SetValue( ColorToPercent_Impl( aCurrentColor.GetRed() ) );
m_pGcustom->SetValue( ColorToPercent_Impl( aCurrentColor.GetGreen() ) );
m_pBcustom->SetValue( ColorToPercent_Impl( aCurrentColor.GetBlue() ) );
m_pHexcustom->SetColor( aCurrentColor.GetColor() );
m_pHexcustom->SetColor( aCurrentColor );
if( bUpdatePreset )
{
m_pRpreset->SetValue( ColorToPercent_Impl( aPreviousColor.GetRed() ) );
m_pGpreset->SetValue( ColorToPercent_Impl( aPreviousColor.GetGreen() ) );
m_pBpreset->SetValue( ColorToPercent_Impl( aPreviousColor.GetBlue() ) );
m_pHexpreset->SetColor( aPreviousColor.GetColor() );
m_pHexpreset->SetColor( aPreviousColor );
}
}
}
......
......@@ -1826,7 +1826,7 @@ void SbaXDataBrowserController::ExecuteSearch()
OSL_ENSURE(xModelSet.is(), "SbaXDataBrowserController::ExecuteSearch : no model set ?!");
xModelSet->setPropertyValue("DisplayIsSynchron", css::uno::Any(false));
xModelSet->setPropertyValue("AlwaysShowCursor", css::uno::Any(true));
xModelSet->setPropertyValue("CursorColor", makeAny(sal_Int32(COL_LIGHTRED)));
xModelSet->setPropertyValue("CursorColor", makeAny(COL_LIGHTRED));
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
VclPtr<AbstractFmSearchDialog> pDialog;
......
......@@ -41,7 +41,7 @@ namespace dbaui
getTypeSelectionPageFactory() override;
void TableDataOn(SvxCellHorJustify& eVal);
void TableFontOn(css::awt::FontDescriptor& _rFont,sal_Int32 &_rTextColor);
void TableFontOn(css::awt::FontDescriptor& _rFont, Color &_rTextColor);
sal_Int16 GetWidthPixel( const HTMLOption& rOption );
void setTextEncoding();
void fetchOptions();
......
......@@ -29,7 +29,7 @@ namespace dbaui
{
class ORTFReader final : public SvRTFParser , public ODatabaseExport
{
std::vector<sal_Int32> m_vecColor;
std::vector<Color> m_vecColor;
bool CreateTable(int nToken);
virtual void NextToken( int nToken ) override; // base class
......
......@@ -320,7 +320,7 @@ void OHTMLReader::TableDataOn(SvxCellHorJustify& eVal)
}
}
void OHTMLReader::TableFontOn(FontDescriptor& _rFont,sal_Int32 &_rTextColor)
void OHTMLReader::TableFontOn(FontDescriptor& _rFont, Color &_rTextColor)
{
const HTMLOptions& rHtmlOptions = GetOptions();
for (const auto & rOption : rHtmlOptions)
......@@ -331,7 +331,7 @@ void OHTMLReader::TableFontOn(FontDescriptor& _rFont,sal_Int32 &_rTextColor)
{
Color aColor;
rOption.GetColor( aColor );
_rTextColor = sal_Int32(aColor.GetRGBColor());
_rTextColor = aColor.GetRGBColor();
}
break;
case HtmlOptionId::FACE :
......@@ -401,7 +401,7 @@ bool OHTMLReader::CreateTable(HtmlTokenId nToken)
OUString aTableName;
FontDescriptor aFont = VCLUnoHelper::CreateFontDescriptor(Application::GetSettings().GetStyleSettings().GetAppFont());
sal_Int32 nTextColor = 0;
Color nTextColor;
do
{
switch (nToken)
......
......@@ -122,7 +122,7 @@ void ORTFReader::NextToken( int nToken )
nTmpToken2 = GetNextToken();
}
while(aToken[0] != ';' && eState != SvParserState::Error && eState != SvParserState::Accepted);
m_vecColor.push_back(sal_uInt32(aColor.GetRGBColor()));
m_vecColor.push_back(aColor.GetRGBColor());
nTmpToken2 = GetNextToken();
}
while(nTmpToken2 == RTF_RED && eState != SvParserState::Error && eState != SvParserState::Accepted);
......
......@@ -2464,7 +2464,7 @@ namespace wmfemfhelper
{
/** SIMPLE, DONE */
const MetaTextColorAction* pA = static_cast<const MetaTextColorAction*>(pAction);
const bool bActivate(COL_TRANSPARENT != pA->GetColor().GetColor());
const bool bActivate(COL_TRANSPARENT != pA->GetColor());
rPropertyHolders.Current().setTextColorActive(bActivate);
rPropertyHolders.Current().setTextColor(pA->GetColor().getBColor());
......@@ -2482,7 +2482,7 @@ namespace wmfemfhelper
// emulate OutputDevice::SetTextFillColor(...) WITH argument
const Color& rFontFillColor = pA->GetColor();
rPropertyHolders.Current().setTextFillColor(rFontFillColor.getBColor());
rPropertyHolders.Current().setTextFillColorActive(COL_TRANSPARENT != rFontFillColor.GetColor());
rPropertyHolders.Current().setTextFillColorActive(COL_TRANSPARENT != rFontFillColor);
}
else
{
......@@ -2594,7 +2594,7 @@ namespace wmfemfhelper
// older Metafiles have no MetaActionType::TEXTCOLOR which defines
// the FontColor now, so use the Font's color when not transparent
const Color& rFontColor = pA->GetFont().GetColor();
const bool bActivate(COL_TRANSPARENT != rFontColor.GetColor());
const bool bActivate(COL_TRANSPARENT != rFontColor);
if(bActivate)
{
......@@ -2611,7 +2611,7 @@ namespace wmfemfhelper
{
const Color& rFontFillColor = pA->GetFont().GetFillColor();
rPropertyHolders.Current().setTextFillColor(rFontFillColor.getBColor());
rPropertyHolders.Current().setTextFillColorActive(COL_TRANSPARENT != rFontFillColor.GetColor());
rPropertyHolders.Current().setTextFillColorActive(COL_TRANSPARENT != rFontFillColor);
}
else
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment