From 188042ad5230e912f3149cc7ea1bb836e084069a Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 15 Mar 2013 14:35:20 +0000 Subject: restore enough of XOBitmap to do fore/back color setting on escher patterns i.e. restore the logic of setting the colors of imported escher patterns like we always did in the past. Stripping that out seems risky in the absence of definite test-cases. Change-Id: I16bbb451b053fd04a5154602f8f38ed799e21286 --- filter/source/msfilter/msdffimp.cxx | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'filter') diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index 71b69149d2d7..86fabbd01b9c 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -131,6 +131,7 @@ #include #include #include "svx/EnhancedCustomShape2d.hxx" +#include #include #include #include @@ -1371,13 +1372,36 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, co { if ( eMSO_FillType == mso_fillPattern ) { - Color aCol1( COL_WHITE ), aCol2( COL_WHITE ); + Bitmap aBmp( aGraf.GetBitmap() ); + if( aBmp.GetSizePixel().Width() == 8 && aBmp.GetSizePixel().Height() == 8 && aBmp.GetColorCount() == 2) + { + Color aCol1( COL_WHITE ), aCol2( COL_WHITE ); + + if ( IsProperty( DFF_Prop_fillColor ) ) + aCol1 = rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillColor ), DFF_Prop_fillColor ); + + if ( IsProperty( DFF_Prop_fillBackColor ) ) + aCol2 = rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillBackColor ), DFF_Prop_fillBackColor ); - if ( IsProperty( DFF_Prop_fillColor ) ) - aCol1 = rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillColor ), DFF_Prop_fillColor ); + XOBitmap aXOBitmap( aBmp ); + aXOBitmap.Bitmap2Array(); + aXOBitmap.SetBitmapType( XBITMAP_8X8 ); + aXOBitmap.SetPixelSize( aBmp.GetSizePixel() ); + + if( aXOBitmap.GetBackgroundColor() == COL_BLACK ) + { + aXOBitmap.SetPixelColor( aCol1 ); + aXOBitmap.SetBackgroundColor( aCol2 ); + } + else + { + aXOBitmap.SetPixelColor( aCol2 ); + aXOBitmap.SetBackgroundColor( aCol1 ); + } - if ( IsProperty( DFF_Prop_fillBackColor ) ) - aCol2 = rManager.MSO_CLR_ToColor( GetPropertyValue( DFF_Prop_fillBackColor ), DFF_Prop_fillBackColor ); + aXOBitmap.Array2Bitmap(); + aGraf = Graphic( aXOBitmap.GetBitmap() ); + } rSet.Put(XFillBitmapItem(OUString(), aGraf)); } -- cgit ro/collabora/cp-5.3'>distro/collabora/cp-5.3 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/o3tl
AgeCommit message (Expand)Author
2017-10-26Add test for o3tl::saturating_addStephan Bergmann
2017-10-25improve o3tl::enumarray const-nessNoel Grandin
2017-10-23loplugin:includeform: o3tlStephan Bergmann
2017-09-06const correctness in o3tl::array_viewNoel Grandin
2017-07-31loplugin:oncevarNoel Grandin
2017-06-17create o3tl::array_viewNoel Grandin