diff options
Diffstat (limited to 'sw/source/filter')
-rw-r--r-- | sw/source/filter/html/css1atr.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/html/htmlatr.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/html/htmlform.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/html/wrthtml.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/inc/wrtswtbl.hxx | 2 | ||||
-rw-r--r-- | sw/source/filter/writer/wrtswtbl.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 10 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfexport.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8esh.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8atr.cxx | 14 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.hxx | 4 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par2.cxx | 10 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par3.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par6.cxx | 22 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8scan.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8struc.hxx | 7 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlexpit.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlimpit.cxx | 4 | ||||
-rw-r--r-- | sw/source/filter/xml/xmlithlp.cxx | 3 |
21 files changed, 58 insertions, 56 deletions
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<const SvxColorItem&>(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<const SvxColorItem&>(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<const SvxColorItem&>(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<sal_Int32>(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<const SvxColorItem*>(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<SvxBorderLineStyle>(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<std::pair<OString, OString>>& rFlyPropertie const Color& rColor = aShadowItem.GetColor(); // We in fact need RGB to BGR, but the transformation is symmetric. rFlyProperties.push_back(std::make_pair<OString, OString>( - "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<OString, OString>( - "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<OString, OString>( - "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<OString, OString>( - "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<OString, OString>( - "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<std::pair<OString, OString>> aProperties; aProperties.push_back(std::make_pair<OString, OString>("shapeType", "1")); aProperties.push_back(std::make_pair<OString, OString>( - "fillColor", OString::number(msfilter::util::BGRToRGB(oBrush->GetColor().GetColor())))); + "fillColor", OString::number(wwUtility::RGBToBGR(oBrush->GetColor())))); for (std::pair<OString, OString>& 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<sal_Int32>(static_cast<const SvxColorItem*>(pItem)->GetValue().GetColor()); + aTmp <<= static_cast<sal_Int32>(static_cast<const SvxColorItem*>(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<SvxUnderlineItem *>(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<SvxUnderlineItem*>(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<SvxUnderlineItem*>(static_cast<const SvxUnderlineItem*>(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 <editeng/borderline.hxx> #include <filter/msfilter/util.hxx> +#include <tools/color.hxx> #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 && |