From 9a97b9c051735afb3797888d111f1b6b2cab1a83 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 6 Mar 2018 11:09:21 +0200 Subject: use more Color in sw Change-Id: I51d575c40228bbd2ff384f12da33c1cd8bda2dda Reviewed-on: https://gerrit.libreoffice.org/50800 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/source/core/access/acccell.cxx | 6 +++--- sw/source/core/access/accpara.cxx | 10 +++++----- sw/source/core/access/acctable.cxx | 6 +++--- sw/source/core/doc/docfmt.cxx | 2 +- sw/source/core/edit/edfcol.cxx | 2 +- sw/source/core/layout/atrfrm.cxx | 2 +- sw/source/core/text/inftxt.cxx | 4 ++-- sw/source/core/txtnode/fntcache.cxx | 12 ++++++------ sw/source/core/unocore/unosett.cxx | 2 +- sw/source/core/view/viewimp.cxx | 2 +- sw/source/filter/html/css1atr.cxx | 6 +++--- sw/source/filter/html/htmlatr.cxx | 4 ++-- sw/source/filter/html/htmlform.cxx | 2 +- sw/source/filter/html/wrthtml.cxx | 6 +++--- sw/source/filter/inc/wrtswtbl.hxx | 2 +- sw/source/filter/writer/wrtswtbl.cxx | 4 ++-- sw/source/filter/ww8/docxattributeoutput.cxx | 2 +- sw/source/filter/ww8/rtfattributeoutput.cxx | 10 +++++----- sw/source/filter/ww8/rtfexport.cxx | 4 ++-- sw/source/filter/ww8/wrtw8esh.cxx | 2 +- sw/source/filter/ww8/wrtww8.cxx | 2 +- sw/source/filter/ww8/ww8atr.cxx | 14 +++++++------- sw/source/filter/ww8/ww8par.hxx | 4 ++-- sw/source/filter/ww8/ww8par2.cxx | 10 +++++----- sw/source/filter/ww8/ww8par3.cxx | 2 +- sw/source/filter/ww8/ww8par6.cxx | 22 +++++++++++----------- sw/source/filter/ww8/ww8scan.cxx | 2 +- sw/source/filter/ww8/ww8struc.hxx | 7 ++++++- sw/source/filter/xml/xmlexpit.cxx | 2 +- sw/source/filter/xml/xmlimpit.cxx | 4 +--- sw/source/filter/xml/xmlithlp.cxx | 3 +-- sw/source/ui/config/optpage.cxx | 10 +++++----- sw/source/uibase/app/docsh2.cxx | 2 +- sw/source/uibase/config/modcfg.cxx | 10 +++++----- sw/source/uibase/config/usrpref.cxx | 4 ++-- sw/source/uibase/config/viewopt.cxx | 2 +- sw/source/uibase/docvw/AnnotationWin2.cxx | 2 +- sw/source/uibase/utlui/shdwcrsr.cxx | 2 +- sw/source/uibase/utlui/uiitems.cxx | 7 ++++--- 39 files changed, 102 insertions(+), 99 deletions(-) (limited to 'sw/source') diff --git a/sw/source/core/access/acccell.cxx b/sw/source/core/access/acccell.cxx index 90fff856bf2e..f75a6fda8cdd 100644 --- a/sw/source/core/access/acccell.cxx +++ b/sw/source/core/access/acccell.cxx @@ -418,7 +418,7 @@ sal_Int32 SAL_CALL SwAccessibleCell::getBackground() SolarMutexGuard g; const SvxBrushItem &rBack = GetFrame()->GetAttrSet()->GetBackground(); - sal_uInt32 crBack = rBack.GetColor().GetColor(); + Color crBack = rBack.GetColor(); if (COL_AUTO == crBack) { @@ -428,11 +428,11 @@ sal_Int32 SAL_CALL SwAccessibleCell::getBackground() uno::Reference xCompoentDoc(xAccDoc, uno::UNO_QUERY); if (xCompoentDoc.is()) { - crBack = static_cast(xCompoentDoc->getBackground()); + crBack = Color(xCompoentDoc->getBackground()); } } } - return crBack; + return sal_Int32(crBack); } // XAccessibleSelection diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx index 0b35cdf968c9..beb170862692 100644 --- a/sw/source/core/access/accpara.cxx +++ b/sw/source/core/access/accpara.cxx @@ -1048,7 +1048,7 @@ sal_Int32 SAL_CALL SwAccessibleParagraph::getBackground() if ( lcl_GetBackgroundColor( aBackgroundCol, GetFrame(), GetCursorShell() ) ) { - return aBackgroundCol.GetColor(); + return sal_Int32(aBackgroundCol); } return SwAccessibleContext::getBackground(); @@ -2155,7 +2155,7 @@ void SwAccessibleParagraph::_correctValues( const sal_Int32 nIndex, { uno::Any &anyChar = rValue.Value; sal_uInt32 crBack = static_cast( reinterpret_cast(anyChar.pReserved)); - if (COL_AUTO == crBack) + if (COL_AUTO == Color(crBack)) { uno::Reference xComponent(this); if (xComponent.is()) @@ -2171,11 +2171,11 @@ void SwAccessibleParagraph::_correctValues( const sal_Int32 nIndex, if (rValue.Name == UNO_NAME_CHAR_COLOR) { if( GetPortionData().IsInGrayPortion( nIndex ) ) - rValue.Value <<= SwViewOption::GetFieldShadingsColor().GetColor(); + rValue.Value <<= SwViewOption::GetFieldShadingsColor(); uno::Any &anyChar = rValue.Value; sal_uInt32 crChar = static_cast( reinterpret_cast(anyChar.pReserved)); - if( COL_AUTO == crChar ) + if( COL_AUTO == Color(crChar) ) { uno::Reference xComponent(this); if (xComponent.is()) @@ -2231,7 +2231,7 @@ void SwAccessibleParagraph::_correctValues( const sal_Int32 nIndex, uno::Any &anyChar = rValue.Value; sal_uInt32 crUnderline = static_cast( reinterpret_cast(anyChar.pReserved)); - if ( COL_AUTO == crUnderline ) + if ( COL_AUTO == Color(crUnderline) ) { uno::Reference xComponent(this); if (xComponent.is()) diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx index e683adfd50e1..ba7f407f5721 100644 --- a/sw/source/core/access/acctable.cxx +++ b/sw/source/core/access/acctable.cxx @@ -1574,7 +1574,7 @@ void SAL_CALL SwAccessibleTable::deselectAccessibleChild( sal_Int32 SAL_CALL SwAccessibleTable::getBackground() { const SvxBrushItem &rBack = GetFrame()->GetAttrSet()->GetBackground(); - sal_uInt32 crBack = rBack.GetColor().GetColor(); + Color crBack = rBack.GetColor(); if (COL_AUTO == crBack) { @@ -1584,11 +1584,11 @@ sal_Int32 SAL_CALL SwAccessibleTable::getBackground() uno::Reference xCompoentDoc(xAccDoc,uno::UNO_QUERY); if (xCompoentDoc.is()) { - crBack = static_cast(xCompoentDoc->getBackground()); + crBack = Color(xCompoentDoc->getBackground()); } } } - return crBack; + return sal_Int32(crBack); } void SwAccessibleTable::FireSelectionEvent( ) diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index ccc273174886..ef62c91b839a 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -1984,7 +1984,7 @@ std::set SwDoc::GetDocColors() if (pItem == nullptr) continue; Color aColor( pItem->GetValue() ); - if (COL_AUTO != aColor.GetColor()) + if (COL_AUTO != aColor) aDocColors.insert(aColor); } } diff --git a/sw/source/core/edit/edfcol.cxx b/sw/source/core/edit/edfcol.cxx index 572dc6078de1..21800a9ec237 100644 --- a/sw/source/core/edit/edfcol.cxx +++ b/sw/source/core/edit/edfcol.cxx @@ -1402,7 +1402,7 @@ SfxWatermarkItem SwEditShell::GetWatermark() SfxWatermarkItem aItem; uno::Reference xTextRange(xWatermark, uno::UNO_QUERY); uno::Reference xPropertySet(xWatermark, uno::UNO_QUERY); - sal_uInt32 nColor; + Color nColor; sal_Int16 nTransparency; OUString aFont; drawing::HomogenMatrix3 aMatrix; diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 260bf28b4986..767a4b25129b 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -2233,7 +2233,7 @@ bool SwTextGridItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const switch( nMemberId & ~CONVERT_TWIPS ) { case MID_GRID_COLOR: - rVal <<= GetColor().GetColor(); + rVal <<= GetColor(); break; case MID_GRID_LINES: rVal <<= GetLines(); diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index ee3cb8a82b0e..92f92f7ad872 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -525,7 +525,7 @@ SwTextPaintInfo::SwTextPaintInfo( SwTextFrame *pFrame, const SwRect &rPaint ) static bool lcl_IsDarkBackground( const SwTextPaintInfo& rInf ) { const Color* pCol = rInf.GetFont()->GetBackColor(); - if( ! pCol || COL_TRANSPARENT == pCol->GetColor() ) + if( ! pCol || COL_TRANSPARENT == *pCol ) { const SvxBrushItem* pItem; SwRect aOrigBackRect; @@ -1094,7 +1094,7 @@ void SwTextPaintInfo::DrawBackground( const SwLinePortion &rPor ) const // For dark background we do not want to have a filled rectangle if ( GetVsh() && GetVsh()->GetWin() && lcl_IsDarkBackground( *this ) ) { - pOut->SetLineColor( SwViewOption::GetFontColor().GetColor() ); + pOut->SetLineColor( SwViewOption::GetFontColor() ); } else { diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index 842c91002989..2005af23df4b 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -2474,11 +2474,11 @@ bool SwDrawTextInfo::ApplyAutoColor( vcl::Font* pFont ) if( bPrt && GetShell() && GetShell()->GetViewOptions()->IsBlackFont() ) { - if ( COL_BLACK != rFnt.GetColor().GetColor() ) + if ( COL_BLACK != rFnt.GetColor() ) bChgFntColor = true; - if ( (COL_BLACK != GetOut().GetLineColor().GetColor()) || - (COL_BLACK != GetOut().GetOverlineColor().GetColor()) ) + if ( (COL_BLACK != GetOut().GetLineColor()) || + (COL_BLACK != GetOut().GetOverlineColor()) ) bChgLineColor = true; } else @@ -2491,14 +2491,14 @@ bool SwDrawTextInfo::ApplyAutoColor( vcl::Font* pFont ) bChgLineColor = ! bPrt && GetShell() && GetShell()->GetAccessibilityOptions()->IsAlwaysAutoColor(); - bChgFntColor = COL_AUTO == rFnt.GetColor().GetColor() || bChgLineColor; + bChgFntColor = COL_AUTO == rFnt.GetColor() || bChgLineColor; if ( bChgFntColor ) { // check if current background has a user defined setting const Color* pCol = GetFont() ? GetFont()->GetBackColor() : nullptr; Color aColor; - if( ! pCol || COL_TRANSPARENT == pCol->GetColor() ) + if( ! pCol || COL_TRANSPARENT == *pCol ) { const SvxBrushItem* pItem; SwRect aOrigBackRect; @@ -2547,7 +2547,7 @@ bool SwDrawTextInfo::ApplyAutoColor( vcl::Font* pFont ) nNewColor = COL_BLACK; else // we take the font color from the appearance page - nNewColor = SwViewOption::GetFontColor().GetColor(); + nNewColor = SwViewOption::GetFontColor(); } // change painting color depending of dark/bright background diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index cafbbcd56950..2e0a8fbc131b 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -2321,7 +2321,7 @@ SwXTextColumns::SwXTextColumns(const SwFormatCol& rFormatCol) : nReference = USHRT_MAX; nSepLineWidth = rFormatCol.GetLineWidth(); - nSepLineColor = rFormatCol.GetLineColor().GetColor(); + nSepLineColor = rFormatCol.GetLineColor(); nSepLineHeightRelative = rFormatCol.GetLineHeight(); bSepLineIsOn = rFormatCol.GetLineAdj() != COLADJ_NONE; sal_Int8 nStyle = API_COL_LINE_NONE; diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx index 8cc6d4e8797b..ee204d12fb9b 100644 --- a/sw/source/core/view/viewimp.cxx +++ b/sw/source/core/view/viewimp.cxx @@ -254,7 +254,7 @@ Color SwViewShellImp::GetRetoucheColor() const if ( rSh.GetWin() ) { if ( rSh.GetViewOptions()->getBrowseMode() && - COL_TRANSPARENT != rSh.GetViewOptions()->GetRetoucheColor().GetColor() ) + COL_TRANSPARENT != rSh.GetViewOptions()->GetRetoucheColor() ) aRet = rSh.GetViewOptions()->GetRetoucheColor(); else if(rSh.GetViewOptions()->IsPagePreview() && !SW_MOD()->GetAccessibilityOptions().GetIsForPagePreviews()) diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index 006ec185e0f1..d70b5c622ac7 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -2211,8 +2211,8 @@ void SwHTMLWriter::OutCSS1_FrameFormatBackground( const SwFrameFormat& rFrameFor { SwViewShell *pVSh = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell(); if ( pVSh && - COL_TRANSPARENT != pVSh->GetViewOptions()->GetRetoucheColor().GetColor()) - aColor = pVSh->GetViewOptions()->GetRetoucheColor().GetColor(); + COL_TRANSPARENT != pVSh->GetViewOptions()->GetRetoucheColor()) + aColor = pVSh->GetViewOptions()->GetRetoucheColor(); } OutCSS1_PropertyAscii(sCSS1_P_background, lclGetCSS1Color(aColor)); @@ -2387,7 +2387,7 @@ static Writer& OutCSS1_SvxColor( Writer& rWrt, const SfxPoolItem& rHt ) "write color as Hint?" ); Color aColor( static_cast(rHt).GetValue() ); - if( COL_AUTO == aColor.GetColor() ) + if( COL_AUTO == aColor ) aColor = COL_BLACK; rHTMLWrt.OutCSS1_PropertyAscii(sCSS1_P_color, lclGetCSS1Color(aColor)); diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index d4fcf1d70c94..96b624a541f8 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -1667,7 +1667,7 @@ void HTMLEndPosLst::InsertNoScript( const SfxPoolItem& rItem, OSL_ENSURE( RES_CHRATR_COLOR == rItem.Which(), "Not a foreground color, after all" ); Color aColor( static_cast(rItem).GetValue() ); - if( COL_AUTO == aColor.GetColor() ) + if( COL_AUTO == aColor ) aColor = COL_BLACK; bSet = !bParaAttrs || !pDfltColor || !pDfltColor->IsRGBEqual( aColor ); @@ -2618,7 +2618,7 @@ static Writer& OutHTML_SvxColor( Writer& rWrt, const SfxPoolItem& rHt ) if( rHTMLWrt.m_bTagOn ) { Color aColor( static_cast(rHt).GetValue() ); - if( COL_AUTO == aColor.GetColor() ) + if( COL_AUTO == aColor ) aColor = COL_BLACK; OString sOut = "<" OOO_STRING_SVTOOLS_HTML_font " " diff --git a/sw/source/filter/html/htmlform.cxx b/sw/source/filter/html/htmlform.cxx index 598b1dc4bde9..358cac7388af 100644 --- a/sw/source/filter/html/htmlform.cxx +++ b/sw/source/filter/html/htmlform.cxx @@ -957,7 +957,7 @@ uno::Reference< drawing::XShape > SwHTMLParser::InsertControl( if( rColor != COL_TRANSPARENT ) { /// copy complete color with transparency - aTmp <<= static_cast(rColor.GetColor()); + aTmp <<= rColor; rFCompPropSet->setPropertyValue( sPropName, aTmp ); } diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index d40ff9e448c9..ad6436de3912 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -866,11 +866,11 @@ static void OutBodyColor( const sal_Char* pTag, const SwFormat *pFormat, else { Color aColor( pCItem->GetValue() ); - if( COL_AUTO == aColor.GetColor() ) + if( COL_AUTO == aColor ) aColor = COL_BLACK; Color aRefColor( static_cast(pRefItem)->GetValue() ); - if( COL_AUTO == aRefColor.GetColor() ) + if( COL_AUTO == aRefColor ) aRefColor = COL_BLACK; if( !aColor.IsRGBEqual( aRefColor ) ) @@ -889,7 +889,7 @@ static void OutBodyColor( const sal_Char* pTag, const SwFormat *pFormat, sOut.append(" " + OString(pTag) + "="); rHWrt.Strm().WriteCharPtr( sOut.makeStringAndClear().getStr() ); Color aColor( pColorItem->GetValue() ); - if( COL_AUTO == aColor.GetColor() ) + if( COL_AUTO == aColor ) aColor = COL_BLACK; HTMLOutFuncs::Out_Color( rHWrt.Strm(), aColor ); if( RES_POOLCOLL_STANDARD==pFormat->GetPoolFormatId() ) diff --git a/sw/source/filter/inc/wrtswtbl.hxx b/sw/source/filter/inc/wrtswtbl.hxx index 20b9554c582a..2537dbb5dd29 100644 --- a/sw/source/filter/inc/wrtswtbl.hxx +++ b/sw/source/filter/inc/wrtswtbl.hxx @@ -222,7 +222,7 @@ protected: SwWriteTableCols m_aCols; // all columns SwWriteTableRows m_aRows; // all rows - sal_uInt32 m_nBorderColor; // border color + Color m_nBorderColor; // border color sal_uInt16 m_nCellSpacing; // thickness of the inner border sal_uInt16 m_nCellPadding; // distance of border to content diff --git a/sw/source/filter/writer/wrtswtbl.cxx b/sw/source/filter/writer/wrtswtbl.cxx index 98bc37956fc3..b9c2e7adb9a9 100644 --- a/sw/source/filter/writer/wrtswtbl.cxx +++ b/sw/source/filter/writer/wrtswtbl.cxx @@ -191,10 +191,10 @@ const SvxBrushItem *SwWriteTable::GetLineBrush( const SwTableBox *pBox, void SwWriteTable::MergeBorders( const SvxBorderLine* pBorderLine, bool bTable ) { - if( sal_uInt32(-1) == m_nBorderColor ) + if( Color(0xffffffff) == m_nBorderColor ) { if( !pBorderLine->GetColor().IsRGBEqual( COL_GRAY ) ) - m_nBorderColor = pBorderLine->GetColor().GetColor(); + m_nBorderColor = pBorderLine->GetColor(); } if( !m_bCollectBorderWidth ) diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 29d5cf1dbb78..6c069de73777 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -2984,7 +2984,7 @@ static void impl_borderLine( FSHelperPtr const & pSerializer, sal_Int32 elementT // no need to write them. if( rStyleProps != nullptr && pBorderLine && !pBorderLine->isEmpty() && pBorderLine->GetBorderLineStyle() == static_cast(rStyleProps->LineStyle) && - pBorderLine->GetColor() == rStyleProps->Color && + pBorderLine->GetColor() == Color(rStyleProps->Color) && pBorderLine->GetWidth() == convertMm100ToTwip( rStyleProps->LineWidth ) ) return; diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 56c4169aff32..5e14913bb865 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -1646,7 +1646,7 @@ void lcl_TextFrameShadow(std::vector>& rFlyPropertie const Color& rColor = aShadowItem.GetColor(); // We in fact need RGB to BGR, but the transformation is symmetric. rFlyProperties.push_back(std::make_pair( - "shadowColor", OString::number(msfilter::util::BGRToRGB(rColor.GetColor())))); + "shadowColor", OString::number(wwUtility::RGBToBGR(rColor)))); // Twips -> points -> EMUs -- hacky, the intermediate step hides rounding errors on roundtrip. OString aShadowWidth = OString::number(sal_Int32(aShadowItem.GetWidth() / 20) * 12700); @@ -3267,7 +3267,7 @@ void RtfAttributeOutput::FormatBackground(const SvxBrushItem& rBrush) const Color& rColor = rBrush.GetColor(); // We in fact need RGB to BGR, but the transformation is symmetric. m_aFlyProperties.push_back(std::make_pair( - "fillColor", OString::number(msfilter::util::BGRToRGB(rColor.GetColor())))); + "fillColor", OString::number(wwUtility::RGBToBGR(rColor)))); } else if (!rBrush.GetColor().GetTransparency()) { @@ -3291,11 +3291,11 @@ void RtfAttributeOutput::FormatFillGradient(const XFillGradientItem& rFillGradie const XGradient& rGradient = rFillGradient.GetGradientValue(); const Color& rStartColor = rGradient.GetStartColor(); m_aFlyProperties.push_back(std::make_pair( - "fillBackColor", OString::number(msfilter::util::BGRToRGB(rStartColor.GetColor())))); + "fillBackColor", OString::number(wwUtility::RGBToBGR(rStartColor)))); const Color& rEndColor = rGradient.GetEndColor(); m_aFlyProperties.push_back(std::make_pair( - "fillColor", OString::number(msfilter::util::BGRToRGB(rEndColor.GetColor())))); + "fillColor", OString::number(wwUtility::RGBToBGR(rEndColor)))); switch (rGradient.GetGradientStyle()) { @@ -3351,7 +3351,7 @@ void RtfAttributeOutput::FormatBox(const SvxBoxItem& rBox) const Color& rColor = pTop->GetColor(); // We in fact need RGB to BGR, but the transformation is symmetric. m_aFlyProperties.push_back(std::make_pair( - "lineColor", OString::number(msfilter::util::BGRToRGB(rColor.GetColor())))); + "lineColor", OString::number(wwUtility::RGBToBGR(rColor)))); if (pTop->GetBorderLineStyle() != SvxBorderLineStyle::NONE) { diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx index 292b1305e9c3..cb354fecd8f1 100644 --- a/sw/source/filter/ww8/rtfexport.cxx +++ b/sw/source/filter/ww8/rtfexport.cxx @@ -423,7 +423,7 @@ void RtfExport::WriteMainText() std::vector> aProperties; aProperties.push_back(std::make_pair("shapeType", "1")); aProperties.push_back(std::make_pair( - "fillColor", OString::number(msfilter::util::BGRToRGB(oBrush->GetColor().GetColor())))); + "fillColor", OString::number(wwUtility::RGBToBGR(oBrush->GetColor())))); for (std::pair& rPair : aProperties) { Strm().WriteCharPtr("{" OOO_STRING_SVTOOLS_RTF_SP "{"); @@ -1287,7 +1287,7 @@ void RtfExport::OutColorTable() for (std::size_t n = 0; n < m_aColTable.size(); ++n) { const Color& rCol = m_aColTable[n]; - if (n || COL_AUTO != rCol.GetColor()) + if (n || COL_AUTO != rCol) { Strm().WriteCharPtr(OOO_STRING_SVTOOLS_RTF_RED); OutULong(rCol.GetRed()).WriteCharPtr(OOO_STRING_SVTOOLS_RTF_GREEN); diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 293e0d1ab38d..c7448f42fbd2 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -2009,7 +2009,7 @@ sal_Int32 SwBasicEscherEx::WriteFlyFrameAttr(const SwFrameFormat& rFormat, const sal_uInt16 nCstScale = 635; // unit scale between AOO and MS Word const sal_uInt32 nShadowType = 131074; // shadow type of ms word. need to set the default value. - sal_uInt32 nColor = sal_uInt32(pSI->GetColor()); + Color nColor = pSI->GetColor(); sal_Int32 nOffX = pSI->GetWidth() * nCstScale; sal_Int32 nOffY = pSI->GetWidth() * nCstScale; diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index c2136a3ecb50..08f31d800dd5 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -2638,7 +2638,7 @@ void WW8AttributeOutput::TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t if ( aColor == COL_AUTO ) aSHD.setCvBack( 0xFF000000 ); else - aSHD.setCvBack( wwUtility::RGBToBGR( aColor.GetColor() ) ); + aSHD.setCvBack( wwUtility::RGBToBGR( aColor ) ); aSHD.Write( m_rWW8Export ); } diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 9b6b425269ef..f6c40194bf5e 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -1319,7 +1319,7 @@ void WW8AttributeOutput::CharUnderline( const SvxUnderlineItem& rUnderline ) { m_rWW8Export.InsUInt16( NS_sprm::sprmCCvUl ); - m_rWW8Export.InsUInt32( wwUtility::RGBToBGR( aColor.GetColor() ) ); + m_rWW8Export.InsUInt32( wwUtility::RGBToBGR( aColor ) ); } } @@ -1535,9 +1535,9 @@ bool WW8Export::TransBrush(const Color& rCol, WW8_SHD& rShd) return !rCol.GetTransparency(); } -sal_uInt32 SuitableBGColor(sal_uInt32 nIn) +sal_uInt32 SuitableBGColor(Color nIn) { - if (nIn == sal_uInt32(COL_AUTO)) + if (nIn == COL_AUTO) return 0xFF000000; return wwUtility::RGBToBGR(nIn); } @@ -1552,7 +1552,7 @@ void WW8AttributeOutput::CharColor( const SvxColorItem& rColor ) if (nColor) { m_rWW8Export.InsUInt16( NS_sprm::sprmCCv ); - m_rWW8Export.InsUInt32( wwUtility::RGBToBGR( rColor.GetValue().GetColor() ) ); + m_rWW8Export.InsUInt32( wwUtility::RGBToBGR( rColor.GetValue() ) ); } } @@ -1570,7 +1570,7 @@ void WW8AttributeOutput::CharBackground( const SvxBrushItem& rBrush ) m_rWW8Export.InsUInt16( NS_sprm::sprmCShd ); m_rWW8Export.pO->push_back( 10 ); m_rWW8Export.InsUInt32( 0xFF000000 ); - m_rWW8Export.InsUInt32( SuitableBGColor( rBrush.GetColor().GetColor() ) ); + m_rWW8Export.InsUInt32( SuitableBGColor( rBrush.GetColor() ) ); m_rWW8Export.InsUInt16( 0x0000); } @@ -4185,7 +4185,7 @@ void WW8AttributeOutput::FormatBackground( const SvxBrushItem& rBrush ) m_rWW8Export.InsUInt16( 0xC64D ); m_rWW8Export.pO->push_back( 10 ); m_rWW8Export.InsUInt32( 0xFF000000 ); - m_rWW8Export.InsUInt32( SuitableBGColor( rBrush.GetColor().GetColor() ) ); + m_rWW8Export.InsUInt32( SuitableBGColor( rBrush.GetColor() ) ); m_rWW8Export.InsUInt16( 0x0000 ); } } @@ -4283,7 +4283,7 @@ WW8_BRCVer9 WW8Export::TranslateBorderLine(const SvxBorderLine& rLine, nWidth = 1; // don't omit // BRC.cv - nColBGR = wwUtility::RGBToBGR(sal_uInt32(rLine.GetColor().GetRGBColor())); + nColBGR = wwUtility::RGBToBGR(rLine.GetColor().GetRGBColor()); } // BRC.dptSpace diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx index d434c9616472..601dcc17fa53 100644 --- a/sw/source/filter/ww8/ww8par.hxx +++ b/sw/source/filter/ww8/ww8par.hxx @@ -1021,7 +1021,7 @@ struct WW8TabBandDesc sal_uInt8 nOverrideSpacing[MAX_COL + 1]; short nOverrideValues[MAX_COL + 1][4]; WW8_SHD* pSHDs; - sal_uInt32* pNewSHDs; + Color* pNewSHDs; WW8_BRCVer9 aDefBrcs[6]; bool bExist[MAX_COL]; // does this cell exist ? @@ -1805,7 +1805,7 @@ public: // really private, but can only be done public void Read_TextBackColor(sal_uInt16, const sal_uInt8* pData, short nLen); void Read_ParaBackColor(sal_uInt16, const sal_uInt8* pData, short nLen); void Read_ParaBiDi(sal_uInt16, const sal_uInt8* pData, short nLen); - static sal_uInt32 ExtractColour(const sal_uInt8* &rpData, bool bVer67); + static Color ExtractColour(const sal_uInt8* &rpData, bool bVer67); void Read_TextVerticalAdjustment(sal_uInt16, const sal_uInt8* pData, short nLen); void Read_UnderlineColor(sal_uInt16, const sal_uInt8* pData, short nLen); diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 4374a1cf9ab3..1ab7029bca8e 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -1071,8 +1071,8 @@ WW8TabBandDesc::WW8TabBandDesc( WW8TabBandDesc const & rBand ) } if( rBand.pNewSHDs ) { - pNewSHDs = new sal_uInt32[nWwCols]; - memcpy(pNewSHDs, rBand.pNewSHDs, nWwCols * sizeof(sal_uInt32)); + pNewSHDs = new Color[nWwCols]; + memcpy(pNewSHDs, rBand.pNewSHDs, nWwCols * sizeof(Color)); } memcpy(aDefBrcs, rBand.aDefBrcs, sizeof(aDefBrcs)); } @@ -1556,7 +1556,7 @@ void WW8TabBandDesc::ReadNewShd(const sal_uInt8* pS, bool bVer67) return; if (!pNewSHDs) - pNewSHDs = new sal_uInt32[nWwCols]; + pNewSHDs = new Color[nWwCols]; short nCount = nLen / 10; //10 bytes each if (nCount > nWwCols) @@ -1567,7 +1567,7 @@ void WW8TabBandDesc::ReadNewShd(const sal_uInt8* pS, bool bVer67) pNewSHDs[i++] = SwWW8ImplReader::ExtractColour(pS, bVer67); while (i < nWwCols) - pNewSHDs[i++] = sal_uInt32(COL_AUTO); + pNewSHDs[i++] = COL_AUTO; } void WW8TabBandDesc::setcelldefaults(WW8_TCell *pCells, short nCols) @@ -3038,7 +3038,7 @@ void WW8TabDesc::SetTabShades( SwTableBox* pBox, short nWwIdx ) return; // faked cells -> no color bool bFound=false; - if (m_pActBand->pNewSHDs && m_pActBand->pNewSHDs[nWwIdx] != sal_uInt32(COL_AUTO)) + if (m_pActBand->pNewSHDs && m_pActBand->pNewSHDs[nWwIdx] != COL_AUTO) { Color aColor(m_pActBand->pNewSHDs[nWwIdx]); pBox->GetFrameFormat()->SetFormatAttr(SvxBrushItem(aColor, RES_BACKGROUND)); diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index fd6b4e8293f5..178188ee5853 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -2293,7 +2293,7 @@ awt::Size SwWW8ImplReader::MiserableDropDownFormHack(const OUString &rString, OUString aNm; if (xPropSetInfo->hasPropertyByName(aNm = "TextColor")) { - aTmp <<= static_cast(static_cast(pItem)->GetValue().GetColor()); + aTmp <<= static_cast(static_cast(pItem)->GetValue()); rPropSet->setPropertyValue(aNm, aTmp); } } diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index 1384a7738c69..eb4abe1770a3 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -3512,7 +3512,7 @@ void SwWW8ImplReader::Read_UnderlineColor(sal_uInt16, const sal_uInt8* pData, sh = static_cast(aSet.Get( RES_CHRATR_UNDERLINE, false ).Clone()); if (pUnderline && nLen >= 4) { - pUnderline->SetColor( Color( msfilter::util::BGRToRGB(SVBT32ToUInt32(pData)) ) ); + pUnderline->SetColor( msfilter::util::BGRToRGB(SVBT32ToUInt32(pData)) ); m_pCurrentColl->SetFormatAttr( *pUnderline ); delete pUnderline; } @@ -3526,7 +3526,7 @@ void SwWW8ImplReader::Read_UnderlineColor(sal_uInt16, const sal_uInt8* pData, sh = static_cast(m_xCurrentItemSet->Get(RES_CHRATR_UNDERLINE, false).Clone()); if (pUnderline && nLen >= 4) { - pUnderline->SetColor( Color( msfilter::util::BGRToRGB(SVBT32ToUInt32(pData)) ) ); + pUnderline->SetColor( msfilter::util::BGRToRGB(SVBT32ToUInt32(pData)) ); m_xCurrentItemSet->Put( *pUnderline ); delete pUnderline; } @@ -3536,7 +3536,7 @@ void SwWW8ImplReader::Read_UnderlineColor(sal_uInt16, const sal_uInt8* pData, sh { SvxUnderlineItem* pUnderlineAttr = const_cast(static_cast(m_xCtrlStck->GetOpenStackAttr( *m_pPaM->GetPoint(), RES_CHRATR_UNDERLINE ))); if (pUnderlineAttr && nLen >= 4) - pUnderlineAttr->SetColor( Color( msfilter::util::BGRToRGB(SVBT32ToUInt32( pData )))); + pUnderlineAttr->SetColor( msfilter::util::BGRToRGB(SVBT32ToUInt32( pData ) )); } } } @@ -4802,27 +4802,27 @@ void SwWW8ImplReader::Read_ParaBackColor(sal_uInt16, const sal_uInt8* pData, sho OSL_ENSURE(nLen == 10, "Len of para back colour not 10!"); if (nLen != 10) return; - NewAttr(SvxBrushItem(Color(ExtractColour(pData, m_bVer67)), RES_BACKGROUND)); + NewAttr(SvxBrushItem(ExtractColour(pData, m_bVer67), RES_BACKGROUND)); } } -sal_uInt32 SwWW8ImplReader::ExtractColour(const sal_uInt8* &rpData, bool bVer67) +Color SwWW8ImplReader::ExtractColour(const sal_uInt8* &rpData, bool bVer67) { OSL_ENSURE(!bVer67, "Impossible"); - sal_uInt32 nFore = msfilter::util::BGRToRGB(SVBT32ToUInt32(rpData)); + Color nFore = msfilter::util::BGRToRGB(SVBT32ToUInt32(rpData)); rpData+=4; - sal_uInt32 nBack = msfilter::util::BGRToRGB(SVBT32ToUInt32(rpData)); + Color nBack = msfilter::util::BGRToRGB(SVBT32ToUInt32(rpData)); rpData+=4; sal_uInt16 nIndex = SVBT16ToShort(rpData); rpData+=2; //Being a transparent background colour doesn't actually show the page //background through, it merely acts like white - if (nBack == 0xFF000000) - nBack = sal_uInt32(COL_AUTO); - OSL_ENSURE(nBack == sal_uInt32(COL_AUTO) || !(nBack & 0xFF000000), + if (nBack == Color(0xFF000000)) + nBack = COL_AUTO; + OSL_ENSURE(nBack == COL_AUTO || (nBack.GetTransparency() == 0), "ww8: don't know what to do with such a transparent bg colour, report"); SwWW8Shade aShade(nFore, nBack, nIndex); - return aShade.aColor.GetColor(); + return aShade.aColor; } void SwWW8ImplReader::Read_TextVerticalAdjustment( sal_uInt16, const sal_uInt8* pData, short nLen ) diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index a37ce262d1a7..380c2c8f1fba 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -1342,7 +1342,7 @@ WW8_BRCVer9::WW8_BRCVer9(const WW8_BRC& brcVer8) else { sal_uInt32 _cv = brcVer8.ico() == 0 ? 0xff000000 // "auto" colour - : wwUtility::RGBToBGR(sal_uInt32(SwWW8ImplReader::GetCol(brcVer8.ico()))); + : wwUtility::RGBToBGR(SwWW8ImplReader::GetCol(brcVer8.ico())); *this = WW8_BRCVer9(_cv, brcVer8.dptLineWidth(), brcVer8.brcType(), brcVer8.dptSpace(), brcVer8.fShadow(), brcVer8.fFrame()); } diff --git a/sw/source/filter/ww8/ww8struc.hxx b/sw/source/filter/ww8/ww8struc.hxx index 00d56263c9a5..559f5d440091 100644 --- a/sw/source/filter/ww8/ww8struc.hxx +++ b/sw/source/filter/ww8/ww8struc.hxx @@ -27,6 +27,7 @@ #include #include +#include #ifdef _WIN32 # pragma pack(push, 2) @@ -1076,7 +1077,11 @@ struct SEPr namespace wwUtility { - inline sal_uInt32 RGBToBGR(sal_uInt32 nColour) { return msfilter::util::BGRToRGB(nColour); } + inline sal_uInt32 RGBToBGR(::Color nColour) + { + // we can use this because the translation is symmetric + return msfilter::util::BGRToRGB(sal_uInt32(nColour)); + } } /// [MS-OSHARED] FactoidType: one smart tag type. diff --git a/sw/source/filter/xml/xmlexpit.cxx b/sw/source/filter/xml/xmlexpit.cxx index 69f982f1e8f7..577936ae59f2 100644 --- a/sw/source/filter/xml/xmlexpit.cxx +++ b/sw/source/filter/xml/xmlexpit.cxx @@ -897,7 +897,7 @@ bool SvXMLExportItemMapper::QueryXMLValue( else { ::sax::Converter::convertColor(aOut, - rBrush.GetColor().GetColor()); + rBrush.GetColor()); } bOk = true; break; diff --git a/sw/source/filter/xml/xmlimpit.cxx b/sw/source/filter/xml/xmlimpit.cxx index 13f8591292cb..0c9566012c26 100644 --- a/sw/source/filter/xml/xmlimpit.cxx +++ b/sw/source/filter/xml/xmlimpit.cxx @@ -374,12 +374,10 @@ bool SvXMLImportItemMapper::PutXMLValue( } else if( !bColorFound && aToken.startsWith("#") ) { - sal_Int32 nColor(0); - bOk = ::sax::Converter::convertColor( nColor, aToken ); + bOk = ::sax::Converter::convertColor( aColor, aToken ); if( !bOk ) return false; - aColor = nColor; bColorFound = true; } else if( !bOffsetFound ) diff --git a/sw/source/filter/xml/xmlithlp.cxx b/sw/source/filter/xml/xmlithlp.cxx index 6be60f48c2c7..4d7a5f3e09c6 100644 --- a/sw/source/filter/xml/xmlithlp.cxx +++ b/sw/source/filter/xml/xmlithlp.cxx @@ -112,9 +112,8 @@ bool sw_frmitems_parseXMLBorder( const OUString& rValue, { rHasStyle = true; } - else if (!rHasColor && ::sax::Converter::convertColor(nTemp, aToken)) + else if (!rHasColor && ::sax::Converter::convertColor(rColor, aToken)) { - rColor = nTemp; rHasColor = true; } else if( !rHasWidth && diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index bd8baa174c58..1bfa450b605f 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -1846,7 +1846,7 @@ bool SwRedlineOptionsTabPage::FillItemSet( SfxItemSet* ) pAttr = static_cast(m_pInsertLB->GetEntryData(nPos)); aInsertedAttr.m_nItemId = pAttr->nItemId; aInsertedAttr.m_nAttr = pAttr->nAttr; - aInsertedAttr.m_nColor = m_pInsertColorLB->GetSelectEntryColor().GetColor(); + aInsertedAttr.m_nColor = m_pInsertColorLB->GetSelectEntryColor(); pOpt->SetInsertAuthorAttr(aInsertedAttr); } @@ -1856,7 +1856,7 @@ bool SwRedlineOptionsTabPage::FillItemSet( SfxItemSet* ) pAttr = static_cast(m_pDeletedLB->GetEntryData(nPos)); aDeletedAttr.m_nItemId = pAttr->nItemId; aDeletedAttr.m_nAttr = pAttr->nAttr; - aDeletedAttr.m_nColor = m_pDeletedColorLB->GetSelectEntryColor().GetColor(); + aDeletedAttr.m_nColor = m_pDeletedColorLB->GetSelectEntryColor(); pOpt->SetDeletedAuthorAttr(aDeletedAttr); } @@ -1866,7 +1866,7 @@ bool SwRedlineOptionsTabPage::FillItemSet( SfxItemSet* ) pAttr = static_cast(m_pChangedLB->GetEntryData(nPos)); aChangedAttr.m_nItemId = pAttr->nItemId; aChangedAttr.m_nAttr = pAttr->nAttr; - aChangedAttr.m_nColor = m_pChangedColorLB->GetSelectEntryColor().GetColor(); + aChangedAttr.m_nColor = m_pChangedColorLB->GetSelectEntryColor(); pOpt->SetFormatAuthorAttr(aChangedAttr); } @@ -1886,7 +1886,7 @@ bool SwRedlineOptionsTabPage::FillItemSet( SfxItemSet* ) if (!(aInsertedAttr == aOldInsertAttr) || !(aDeletedAttr == aOldDeletedAttr) || !(aChangedAttr == aOldChangedAttr) || - nOldMarkColor != pOpt->GetMarkAlignColor().GetColor() || + nOldMarkColor != pOpt->GetMarkAlignColor() || nOldMarkMode != pOpt->GetMarkAlignMode() || bOldShowInlineTooltips != pOpt->IsShowInlineTooltip() ) { @@ -2130,7 +2130,7 @@ IMPL_LINK( SwRedlineOptionsTabPage, ColorHdl, SvxColorListBox&, rListBox, void ) void SwRedlineOptionsTabPage::ChangedMaskPrev() { m_pMarkPreviewWN->SetMarkPos(m_pMarkPosLB->GetSelectedEntryPos()); - m_pMarkPreviewWN->SetColor(m_pMarkColorLB->GetSelectEntryColor().GetColor()); + m_pMarkPreviewWN->SetColor(m_pMarkColorLB->GetSelectEntryColor()); m_pMarkPreviewWN->Invalidate(); } diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index efdba307cff3..65b718c52f67 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -1218,7 +1218,7 @@ void SwDocShell::Execute(SfxRequest& rReq) if ( pArgs->GetItemState( SID_WATERMARK_TRANSPARENCY, false, &pItem ) == SfxItemState::SET ) aItem.SetTransparency( static_cast( pItem )->GetValue() ); if ( pArgs->GetItemState( SID_WATERMARK_COLOR, false, &pItem ) == SfxItemState::SET ) - aItem.SetColor( static_cast( pItem )->GetValue() ); + aItem.SetColor( Color(static_cast( pItem )->GetValue()) ); pSh->SetWatermark( aItem ); } diff --git a/sw/source/uibase/config/modcfg.cxx b/sw/source/uibase/config/modcfg.cxx index 5341cac72c35..f0d9f010b7ab 100644 --- a/sw/source/uibase/config/modcfg.cxx +++ b/sw/source/uibase/config/modcfg.cxx @@ -308,7 +308,7 @@ void SwRevisionConfig::ImplCommit() case 4 : pValues[nProp] <<= lcl_ConvertAttrToCfg(aFormatAttr); break; case 5 : pValues[nProp] <<= aFormatAttr.m_nColor; break; case 6 : pValues[nProp] <<= nMarkAlign; break; - case 7 : pValues[nProp] <<= aMarkColor.GetColor(); break; + case 7 : pValues[nProp] <<= aMarkColor; break; case 8 : pValues[nProp] <<= bShowInlineTooltip; break; } } @@ -356,13 +356,13 @@ void SwRevisionConfig::Load() switch (nProp) { case 0 : lcl_ConvertCfgToAttr(nVal, aInsertAttr); break; - case 1 : aInsertAttr.m_nColor = nVal; break; + case 1 : aInsertAttr.m_nColor = Color(nVal); break; case 2 : lcl_ConvertCfgToAttr(nVal, aDeletedAttr, true); break; - case 3 : aDeletedAttr.m_nColor = nVal; break; + case 3 : aDeletedAttr.m_nColor = Color(nVal); break; case 4 : lcl_ConvertCfgToAttr(nVal, aFormatAttr); break; - case 5 : aFormatAttr.m_nColor = nVal; break; + case 5 : aFormatAttr.m_nColor = Color(nVal); break; case 6 : nMarkAlign = sal::static_int_cast< sal_uInt16, sal_Int32>(nVal); break; - case 7 : aMarkColor = nVal; break; + case 7 : aMarkColor = Color(nVal); break; case 8 : bShowInlineTooltip = *o3tl::doAccess(pValues[nProp]); } } diff --git a/sw/source/uibase/config/usrpref.cxx b/sw/source/uibase/config/usrpref.cxx index d7ad06fe6a3d..3fe97f702a8e 100644 --- a/sw/source/uibase/config/usrpref.cxx +++ b/sw/source/uibase/config/usrpref.cxx @@ -559,7 +559,7 @@ void SwWebColorConfig::ImplCommit() { switch(nProp) { - case 0: pValues[nProp] <<= static_cast(rParent.GetRetoucheColor().GetColor()); break;// "Color", + case 0: pValues[nProp] <<= rParent.GetRetoucheColor(); break;// "Color", } } PutProperties(aPropNames, aValues); @@ -581,7 +581,7 @@ void SwWebColorConfig::Load() switch(nProp) { case 0: - sal_Int32 nSet = 0; + Color nSet; pValues[nProp] >>= nSet; rParent.SetRetoucheColor(nSet); break;// "Color", } diff --git a/sw/source/uibase/config/viewopt.cxx b/sw/source/uibase/config/viewopt.cxx index f568247cb4d7..4735f2d87af0 100644 --- a/sw/source/uibase/config/viewopt.cxx +++ b/sw/source/uibase/config/viewopt.cxx @@ -146,7 +146,7 @@ void SwViewOption::PaintPostIts( OutputDevice *pOut, const SwRect &rRect, bool b const Point aTopLeft( rRect.Left() + nPix, rRect.Top() + nPix ); const Point aBotRight( rRect.Right() - nPix, rRect.Bottom() - nPix ); const SwRect aRect( aTopLeft, aBotRight ); - DrawRect( pOut, aRect, m_aScriptIndicatorColor.GetColor() ); + DrawRect( pOut, aRect, m_aScriptIndicatorColor ); pOut->SetLineColor( aOldLineColor ); } } diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx index a3ab401c4ac6..8a10fe16eed8 100644 --- a/sw/source/uibase/docvw/AnnotationWin2.cxx +++ b/sw/source/uibase/docvw/AnnotationWin2.cxx @@ -324,7 +324,7 @@ void SwAnnotationWin::Draw(OutputDevice* pDev, const Point& rPt, const Size& rSz vcl::Font aFont( mpMetadataDate->GetSettings().GetStyleSettings().GetFieldFont() ); mpMetadataDate->SetControlFont( aFont ); - mpMetadataDate->SetControlBackground( 0xFFFFFF ); + mpMetadataDate->SetControlBackground( Color(0xFFFFFF) ); mpMetadataDate->SetText("..."); mpMetadataDate->Draw(pDev, aPos, aSize, nInFlags); diff --git a/sw/source/uibase/utlui/shdwcrsr.cxx b/sw/source/uibase/utlui/shdwcrsr.cxx index 6e5c715789f7..d3590523b299 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() ^ sal_uInt32(COL_WHITE) ) ); + pWin->SetLineColor( Color( sal_uInt32(aCol) ^ sal_uInt32(COL_WHITE) ) ); // 1. The Line: pWin->DrawLine( Point( rPt.X(), rPt.Y() + 1), diff --git a/sw/source/uibase/utlui/uiitems.cxx b/sw/source/uibase/utlui/uiitems.cxx index 8b3f02a74b8a..1e370d9d26be 100644 --- a/sw/source/uibase/utlui/uiitems.cxx +++ b/sw/source/uibase/utlui/uiitems.cxx @@ -78,7 +78,7 @@ bool SwPageFootnoteInfoItem::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const { case MID_FTN_HEIGHT : rVal <<= static_cast(convertTwipToMm100(aFootnoteInfo.GetHeight()));break; case MID_LINE_WEIGHT : rVal <<= static_cast(convertTwipToMm100(aFootnoteInfo.GetLineWidth()));break; - case MID_LINE_COLOR : rVal <<= static_cast(aFootnoteInfo.GetLineColor().GetColor());break; + case MID_LINE_COLOR : rVal <<= aFootnoteInfo.GetLineColor();break; case MID_LINE_RELWIDTH : { Fraction aTmp( 100, 1 ); @@ -110,12 +110,13 @@ bool SwPageFootnoteInfoItem::QueryValue( Any& rVal, sal_uInt8 nMemberId ) const bool SwPageFootnoteInfoItem::PutValue(const Any& rVal, sal_uInt8 nMemberId) { sal_Int32 nSet32 = 0; + Color aColor; bool bRet = true; switch(nMemberId & ~CONVERT_TWIPS) { case MID_LINE_COLOR : - rVal >>= nSet32; - aFootnoteInfo.SetLineColor(nSet32); + rVal >>= aColor; + aFootnoteInfo.SetLineColor(aColor); break; case MID_FTN_HEIGHT: case MID_LINE_TEXT_DIST : -- cgit v1.2.3