diff options
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/source/filter/lwpbackgroundstuff.cxx | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/lotuswordpro/source/filter/lwpbackgroundstuff.cxx b/lotuswordpro/source/filter/lwpbackgroundstuff.cxx index 0c8deba1ac7f..46bd2ed88d01 100644 --- a/lotuswordpro/source/filter/lwpbackgroundstuff.cxx +++ b/lotuswordpro/source/filter/lwpbackgroundstuff.cxx @@ -65,6 +65,7 @@ #include "tools/stream.hxx" #include "vcl/bmpacc.hxx" +#include "svx/xbitmap.hxx" void LwpBackgroundStuff::Read(LwpObjectStream* pStrm) @@ -128,9 +129,37 @@ XFBGImage* LwpBackgroundStuff::GetFillPattern() pPttnArray = NULL; } - // transfer image data from Bitmap->SvStream->BYTE-Array + // create XOBitmap object from bitmap object + XOBitmap aXOBitmap( aBmp ); + aXOBitmap.Bitmap2Array(); + aXOBitmap.SetBitmapType( XBITMAP_8X8 ); + + // set back/fore-ground colors + if (m_aFillColor.IsValidColor() && m_aPatternColor.IsValidColor()) + { + Color aBackColor(static_cast<sal_uInt8>(m_aFillColor.GetRed()), + static_cast<sal_uInt8>(m_aFillColor.GetGreen()), + static_cast<sal_uInt8>(m_aFillColor.GetBlue())); + Color aForeColor(static_cast<sal_uInt8>(m_aPatternColor.GetRed()), + static_cast<sal_uInt8>(m_aPatternColor.GetGreen()), + static_cast<sal_uInt8>(m_aPatternColor.GetBlue())); + + if( aXOBitmap.GetBackgroundColor() == COL_BLACK ) + { + aXOBitmap.SetPixelColor( aBackColor ); + aXOBitmap.SetBackgroundColor( aForeColor ); + } + else + { + aXOBitmap.SetPixelColor( aForeColor ); + aXOBitmap.SetBackgroundColor( aBackColor ); + } + } + + // transfer image data from XOBitmap->SvStream->BYTE-Array SvMemoryStream aPicMemStream; - aBmp.Write(aPicMemStream); + aXOBitmap.Array2Bitmap(); + aXOBitmap.GetBitmap().Write(aPicMemStream); sal_uInt32 nSize = aPicMemStream.GetEndOfData(); sal_uInt8* pImageBuff = new sal_uInt8 [nSize]; memcpy(pImageBuff, aPicMemStream.GetData(), nSize); |