summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2009-06-15 12:41:42 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2009-06-15 12:41:42 +0000
commite52566c36c2c57f067b5664c41f6941159d6e298 (patch)
treec42856dc972691387340489b44224686f684f157 /vcl
parentc09770917fdef1019a8e11615f3e9cb68c23cb69 (diff)
CWS-TOOLING: integrate CWS svp02_DEV300
2009-04-29 16:59:46 +0200 pl r271386 : #159621# defined palette for 1 bit VDevs
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/headless/svpvd.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/vcl/unx/headless/svpvd.cxx b/vcl/unx/headless/svpvd.cxx
index 2d7342093e47..3f48584036f6 100644
--- a/vcl/unx/headless/svpvd.cxx
+++ b/vcl/unx/headless/svpvd.cxx
@@ -65,9 +65,14 @@ BOOL SvpSalVirtualDevice::SetSize( long nNewDX, long nNewDY )
if( ! m_aDevice.get() || m_aDevice->getSize() != aDevSize )
{
sal_uInt32 nFormat = SVP_DEFAULT_BITMAP_FORMAT;
+ std::vector< basebmp::Color > aDevPal;
switch( m_nBitCount )
{
- case 1: nFormat = Format::ONE_BIT_MSB_PAL; break;
+ case 1: nFormat = Format::ONE_BIT_MSB_PAL;
+ aDevPal.reserve(2);
+ aDevPal.push_back( basebmp::Color( 0, 0, 0 ) );
+ aDevPal.push_back( basebmp::Color( 0xff, 0xff, 0xff ) );
+ break;
case 4: nFormat = Format::FOUR_BIT_MSB_PAL; break;
case 8: nFormat = Format::EIGHT_BIT_PAL; break;
#ifdef OSL_BIGENDIAN
@@ -78,7 +83,9 @@ BOOL SvpSalVirtualDevice::SetSize( long nNewDX, long nNewDY )
case 24: nFormat = Format::TWENTYFOUR_BIT_TC_MASK; break;
case 32: nFormat = Format::THIRTYTWO_BIT_TC_MASK; break;
}
- m_aDevice = createBitmapDevice( aDevSize, false, nFormat );
+ m_aDevice = aDevPal.empty()
+ ? createBitmapDevice( aDevSize, false, nFormat )
+ : createBitmapDevice( aDevSize, false, nFormat, PaletteMemorySharedVector( new std::vector< basebmp::Color >(aDevPal) ) );
// update device in existing graphics
for( std::list< SvpSalGraphics* >::iterator it = m_aGraphics.begin();
it != m_aGraphics.end(); ++it )