summaryrefslogtreecommitdiff
path: root/reportdesign
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-07 08:29:24 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-07 09:51:42 +0100
commit82bea50f1ba18a32b175b495b61701a4c148c753 (patch)
treec66805ac01d02b760805ec5a394c904fda7a65ba /reportdesign
parentdbcf5b28aacba55d5f48e58a07fa4d6fc06931b9 (diff)
use more Color in reportdesign
Change-Id: I9e51bfa6346823863b00bca9c007e28de62aab29 Reviewed-on: https://gerrit.libreoffice.org/50859 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'reportdesign')
-rw-r--r--reportdesign/source/ui/dlg/Condition.cxx4
-rw-r--r--reportdesign/source/ui/inc/FixedTextColor.hxx3
-rw-r--r--reportdesign/source/ui/inspection/GeometryHandler.cxx2
-rw-r--r--reportdesign/source/ui/misc/UITools.cxx10
-rw-r--r--reportdesign/source/ui/report/FixedTextColor.cxx10
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx4
-rw-r--r--reportdesign/source/ui/report/ReportSection.cxx4
7 files changed, 19 insertions, 18 deletions
diff --git a/reportdesign/source/ui/dlg/Condition.cxx b/reportdesign/source/ui/dlg/Condition.cxx
index 1110e9aef21a..4f147933d6e3 100644
--- a/reportdesign/source/ui/dlg/Condition.cxx
+++ b/reportdesign/source/ui/dlg/Condition.cxx
@@ -402,9 +402,9 @@ void Condition::updateToolbar(const uno::Reference< report::XReportControlFormat
aFont.SetFontHeight(OutputDevice::LogicToLogic(Size(0, aFont.GetFontHeight()), MapMode(MapUnit::MapPoint), MapMode(MapUnit::MapTwip)).Height());
aFont.SetEmphasisMark( static_cast< FontEmphasisMark >( _xReportControlFormat->getControlTextEmphasis() ) );
aFont.SetRelief( static_cast< FontRelief >( _xReportControlFormat->getCharRelief() ) );
- aFont.SetColor( _xReportControlFormat->getCharColor() );
+ aFont.SetColor( Color(_xReportControlFormat->getCharColor()) );
m_pPreview->SetFont( aFont, aFont, aFont );
- m_pPreview->SetBackColor( _xReportControlFormat->getControlBackground() );
+ m_pPreview->SetBackColor( Color(_xReportControlFormat->getControlBackground()) );
m_pPreview->SetTextLineColor( Color( _xReportControlFormat->getCharUnderlineColor() ) );
}
catch( const Exception& )
diff --git a/reportdesign/source/ui/inc/FixedTextColor.hxx b/reportdesign/source/ui/inc/FixedTextColor.hxx
index 31e317df3be5..6c0f1d88cc7b 100644
--- a/reportdesign/source/ui/inc/FixedTextColor.hxx
+++ b/reportdesign/source/ui/inc/FixedTextColor.hxx
@@ -26,6 +26,7 @@
#include <com/sun/star/awt/XControl.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/report/XFixedText.hpp>
+#include <tools/color.hxx>
#include "IReportControllerObserver.hxx"
#include <vector>
@@ -43,7 +44,7 @@ namespace rptui
/// @throws css::uno::RuntimeException
css::uno::Reference< css::awt::XControl > getXControl(const css::uno::Reference< css::report::XFixedText >& _xFixedText);
- static void setPropertyTextColor(const css::uno::Reference< css::awt::XVclWindowPeer >& _xVclWindowPeer, sal_Int32 _nFormatKey);
+ static void setPropertyTextColor(const css::uno::Reference< css::awt::XVclWindowPeer >& _xVclWindowPeer, Color _nFormatKey);
public:
FixedTextColor(const OReportController & _aObserver);
diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx
index 7643320646fb..012a35b8520a 100644
--- a/reportdesign/source/ui/inspection/GeometryHandler.cxx
+++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx
@@ -972,7 +972,7 @@ uno::Any SAL_CALL GeometryHandler::convertToPropertyValue(const OUString & Prope
case PROPERTY_ID_CONTROLBACKGROUND:
if ( !_rControlValue.hasValue() )
{
- aPropertyValue <<= static_cast<sal_Int32>(COL_TRANSPARENT);
+ aPropertyValue <<= COL_TRANSPARENT;
break;
}
SAL_FALLTHROUGH;
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index 309edb5f3b7d..55eb29e1109d 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -339,7 +339,7 @@ namespace
_rItemSet.Put(SvxCharHiddenItem(_rxReportControlFormat->getCharHidden(),ITEMID_CHARHIDDEN));
_rItemSet.Put(SvxTwoLinesItem(_rxReportControlFormat->getCharCombineIsOn(),_rxReportControlFormat->getCharCombinePrefix().toChar(),_rxReportControlFormat->getCharCombineSuffix().toChar(),ITEMID_TWOLINES));
SvxUnderlineItem aUnderLineItem(aFont.GetUnderline(),ITEMID_UNDERLINE);
- aUnderLineItem.SetColor(_rxReportControlFormat->getCharUnderlineColor());
+ aUnderLineItem.SetColor(Color(_rxReportControlFormat->getCharUnderlineColor()));
_rItemSet.Put(aUnderLineItem);
_rItemSet.Put(SvxKerningItem(_rxReportControlFormat->getCharKerning(),ITEMID_KERNING));
_rItemSet.Put(SvxEmphasisMarkItem(static_cast<FontEmphasisMark>(_rxReportControlFormat->getCharEmphasis()),ITEMID_EMPHASISMARK));
@@ -430,7 +430,7 @@ namespace
if ( SfxItemState::SET == _rItemSet.GetItemState( ITEMID_COLOR,true,&pItem) && dynamic_cast< const SvxColorItem *>( pItem ) != nullptr)
{
const SvxColorItem* pFontItem = static_cast<const SvxColorItem*>(pItem);
- aNewFont.SetColor(pFontItem->GetValue().GetColor());
+ aNewFont.SetColor(pFontItem->GetValue());
}
_out_rAwtFont = VCLUnoHelper::CreateFontDescriptor( aNewFont );
@@ -464,7 +464,7 @@ namespace
if ( SfxItemState::SET == _rItemSet.GetItemState( ITEMID_UNDERLINE,true,&pItem) && dynamic_cast< const SvxUnderlineItem *>( pItem ) != nullptr)
{
const SvxUnderlineItem* pFontItem = static_cast<const SvxUnderlineItem*>(pItem);
- lcl_pushBack( _out_rProperties, PROPERTY_CHARUNDERLINECOLOR, uno::makeAny( pFontItem->GetColor().GetColor() ) );
+ lcl_pushBack( _out_rProperties, PROPERTY_CHARUNDERLINECOLOR, uno::makeAny( pFontItem->GetColor() ) );
}
if ( SfxItemState::SET == _rItemSet.GetItemState( ITEMID_HORJUSTIFY,true,&pItem) && dynamic_cast< const SvxHorJustifyItem *>( pItem ) != nullptr)
{
@@ -498,7 +498,7 @@ namespace
if ( SfxItemState::SET == _rItemSet.GetItemState( ITEMID_BRUSH,true,&pItem) && dynamic_cast< const SvxBrushItem *>( pItem ) != nullptr)
{
const SvxBrushItem* pFontItem = static_cast<const SvxBrushItem*>(pItem);
- lcl_pushBack( _out_rProperties, PROPERTY_CONTROLBACKGROUND, uno::makeAny( pFontItem->GetColor().GetColor() ) );
+ lcl_pushBack( _out_rProperties, PROPERTY_CONTROLBACKGROUND, uno::makeAny( pFontItem->GetColor() ) );
}
if ( SfxItemState::SET == _rItemSet.GetItemState( ITEMID_BLINK,true,&pItem) && dynamic_cast< const SvxBlinkItem *>( pItem ) != nullptr)
{
@@ -520,7 +520,7 @@ namespace
if ( SfxItemState::SET == _rItemSet.GetItemState( ITEMID_COLOR,true,&pItem) && dynamic_cast< const SvxColorItem *>( pItem ) != nullptr)
{
const SvxColorItem* pFontItem = static_cast<const SvxColorItem*>(pItem);
- lcl_pushBack( _out_rProperties, PROPERTY_CHARCOLOR, uno::makeAny( pFontItem->GetValue().GetColor() ) );
+ lcl_pushBack( _out_rProperties, PROPERTY_CHARCOLOR, uno::makeAny( pFontItem->GetValue() ) );
}
if ( SfxItemState::SET == _rItemSet.GetItemState( ITEMID_KERNING,true,&pItem) && dynamic_cast< const SvxKerningItem *>( pItem ) != nullptr)
{
diff --git a/reportdesign/source/ui/report/FixedTextColor.cxx b/reportdesign/source/ui/report/FixedTextColor.cxx
index 643fc3407bef..63bde85edb6e 100644
--- a/reportdesign/source/ui/report/FixedTextColor.cxx
+++ b/reportdesign/source/ui/report/FixedTextColor.cxx
@@ -80,7 +80,7 @@ namespace rptui
}
- void FixedTextColor::setPropertyTextColor(const uno::Reference< awt::XVclWindowPeer >& _xVclWindowPeer, sal_Int32 _nTextColor)
+ void FixedTextColor::setPropertyTextColor(const uno::Reference< awt::XVclWindowPeer >& _xVclWindowPeer, Color _nTextColor)
{
_xVclWindowPeer->setProperty(PROPERTY_TEXTCOLOR, uno::makeAny(_nTextColor));
}
@@ -103,8 +103,8 @@ namespace rptui
try
{
bool bIsDark = false;
- const sal_Int32 nBackColor( xFixedText->getControlBackground() );
- if (nBackColor == sal_Int32(COL_TRANSPARENT))
+ const Color nBackColor( xFixedText->getControlBackground() );
+ if (nBackColor == COL_TRANSPARENT)
{
uno::Reference <report::XSection> xSection(xFixedText->getParent(), uno::UNO_QUERY_THROW);
@@ -134,12 +134,12 @@ namespace rptui
{
const StyleSettings& aStyleSettings = Application::GetSettings().GetStyleSettings();
Color aLabelTextColor = aStyleSettings.GetLabelTextColor();
- setPropertyTextColor(xVclWindowPeer, aLabelTextColor.GetColor());
+ setPropertyTextColor(xVclWindowPeer, aLabelTextColor);
}
else
{
util::Color aLabelColor = xFixedText->getCharColor();
- setPropertyTextColor(xVclWindowPeer, aLabelColor);
+ setPropertyTextColor(xVclWindowPeer, ::Color(aLabelColor));
}
}
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index 1e71f487d053..1304a5f5bd6d 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -2439,7 +2439,7 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _
{
const SfxPoolItem* pItem;
if ( SfxItemState::SET == pSet->GetItemState( RPTUI_ID_BRUSH,true,&pItem))
- _xSection->setBackColor(static_cast<const SvxBrushItem*>(pItem)->GetColor().GetColor());
+ _xSection->setBackColor(sal_Int32(static_cast<const SvxBrushItem*>(pItem)->GetColor()));
}
else
{
@@ -2482,7 +2482,7 @@ void OReportController::openPageDialog(const uno::Reference<report::XSection>& _
{
::Color aBackColor = static_cast<const SvxBrushItem*>(pItem)->GetColor();
xProp->setPropertyValue(PROPERTY_BACKTRANSPARENT,uno::makeAny(aBackColor == COL_TRANSPARENT));
- xProp->setPropertyValue(PROPERTY_BACKCOLOR,uno::makeAny(aBackColor.GetColor()));
+ xProp->setPropertyValue(PROPERTY_BACKCOLOR,uno::makeAny(aBackColor));
}
}
}
diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx
index 5b9765fb793b..9cca7d85a9b8 100644
--- a/reportdesign/source/ui/report/ReportSection.cxx
+++ b/reportdesign/source/ui/report/ReportSection.cxx
@@ -214,7 +214,7 @@ void OReportSection::fill()
sal_Int32 nColor = m_xSection->getBackColor();
if ( nColor == static_cast<sal_Int32>(COL_TRANSPARENT) )
nColor = getStyleProperty<sal_Int32>(m_xSection->getReportDefinition(),PROPERTY_BACKCOLOR);
- m_pView->SetApplicationDocumentColor(nColor);
+ m_pView->SetApplicationDocumentColor(Color(nColor));
uno::Reference<report::XReportDefinition> xReportDefinition = m_xSection->getReportDefinition();
const sal_Int32 nLeftMargin = getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN);
@@ -469,7 +469,7 @@ void OReportSection::_propertyChanged(const beans::PropertyChangeEvent& _rEvent)
sal_Int32 nColor = m_xSection->getBackColor();
if ( nColor == static_cast<sal_Int32>(COL_TRANSPARENT) )
nColor = getStyleProperty<sal_Int32>(m_xSection->getReportDefinition(),PROPERTY_BACKCOLOR);
- m_pView->SetApplicationDocumentColor(nColor);
+ m_pView->SetApplicationDocumentColor(Color(nColor));
Invalidate(InvalidateFlags::NoChildren|InvalidateFlags::NoErase);
}
else