diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-26 17:13:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-28 07:34:27 +0100 |
commit | e2cb154195fdc2ffccdb6f5e87cae8b29640b3eb (patch) | |
tree | 7c3d53d78e0867aa879b98d84211d1e73602520f /sw/source/filter/ww8 | |
parent | 0ea41fea75cd1ac1d81fa57c4411e75a6b4001f0 (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/filter/ww8')
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfexport.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 7 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8atr.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par2.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par6.cxx | 6 |
6 files changed, 11 insertions, 12 deletions
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(); |