[PATCH] Use an 8bpp virtual device (instead of a 1bpp one) in sw and...

Tor Lillqvist (via Code Review) gerrit at gerrit.libreoffice.org
Sun Mar 24 23:37:41 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2979

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/79/2979/1

Use an 8bpp virtual device (instead of a 1bpp one) in sw and sc

The reason why a 1bpp virtual device is used is unclear to me. Using an 8bpp
one instead doesn't seem to cause any harm, and in the iOS port a 1bpp virtual
device actually does cause complications.

Change-Id: Ia34927cf728d4be05a31e88b7da78200d0b799ba
---
M sc/source/core/data/documen8.cxx
M sw/source/core/doc/docnew.cxx
M vcl/source/gdi/virdev.cxx
3 files changed, 10 insertions(+), 8 deletions(-)



diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index f535235..dea44ec 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -207,7 +207,7 @@
 {
     if (!pVirtualDevice_100th_mm)
     {
-        pVirtualDevice_100th_mm = new VirtualDevice( 1 );
+        pVirtualDevice_100th_mm = new VirtualDevice( 8 );
         pVirtualDevice_100th_mm->SetReferenceDevice(VirtualDevice::REFDEV_MODE_MSO1);
         MapMode aMapMode( pVirtualDevice_100th_mm->GetMapMode() );
         aMapMode.SetMapUnit( MAP_100TH_MM );
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index 7ffacc3..48c5895 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -698,7 +698,7 @@
 
 VirtualDevice& SwDoc::CreateVirtualDevice_() const
 {
-    VirtualDevice* pNewVir = new VirtualDevice( 1 );
+    VirtualDevice* pNewVir = new VirtualDevice( 8 );
 
     pNewVir->SetReferenceDevice( VirtualDevice::REFDEV_MODE_MSO1 );
 
diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx
index 87a7487..5083a1b 100644
--- a/vcl/source/gdi/virdev.cxx
+++ b/vcl/source/gdi/virdev.cxx
@@ -39,6 +39,8 @@
 void VirtualDevice::ImplInitVirDev( const OutputDevice* pOutDev,
                                     long nDX, long nDY, sal_uInt16 nBitCount, const SystemGraphicsData *pData )
 {
+    SAL_INFO( "vcl.virdev", "ImplInitVirDev(" << nDX << "," << nDY << "," << nBitCount << ")" );
+
     if ( nDX < 1 )
         nDX = 1;
 
@@ -126,8 +128,8 @@
 :   mpVirDev( NULL ),
     meRefDevMode( REFDEV_NONE )
 {
-    SAL_WARN_IF( nBitCount > 1, "vcl.gdi",
-                "VirtualDevice::VirtualDevice(): Only 0 or 1 is for BitCount allowed" );
+    SAL_WARN_IF( (nBitCount > 1 && nBitCount != 8), "vcl.gdi",
+                "VirtualDevice::VirtualDevice(): Only 0, 1 or 8 allowed for BitCount" );
     SAL_INFO( "vcl.gdi", "VirtualDevice::VirtualDevice( " << nBitCount << " )" );
 
     ImplInitVirDev( Application::GetDefaultDevice(), 1, 1, nBitCount );
@@ -139,8 +141,8 @@
     : mpVirDev( NULL ),
     meRefDevMode( REFDEV_NONE )
 {
-    SAL_WARN_IF( nBitCount > 1, "vcl.gdi",
-                "VirtualDevice::VirtualDevice(): Only 0 or 1 is for BitCount allowed" );
+    SAL_WARN_IF( (nBitCount > 1 && nBitCount != 8), "vcl.gdi",
+                "VirtualDevice::VirtualDevice(): Only 0, 1 or 8 allowed for BitCount" );
     SAL_INFO( "vcl.gdi", "VirtualDevice::VirtualDevice( " << nBitCount << " )" );
 
     ImplInitVirDev( &rCompDev, 1, 1, nBitCount );
@@ -152,8 +154,8 @@
     : mpVirDev( NULL ),
     meRefDevMode( REFDEV_NONE )
 {
-    SAL_WARN_IF( nBitCount > 1, "vcl.gdi",
-                "VirtualDevice::VirtualDevice(): Only 0 or 1 is for BitCount allowed" );
+    SAL_WARN_IF( (nBitCount > 1 && nBitCount != 8), "vcl.gdi",
+                "VirtualDevice::VirtualDevice(): Only 0, 1 or 8 allowed for BitCount" );
     SAL_INFO( "vcl.gdi",
             "VirtualDevice::VirtualDevice( " << nBitCount << ", " << nAlphaBitCount << " )" );
 

-- 
To view, visit https://gerrit.libreoffice.org/2979
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia34927cf728d4be05a31e88b7da78200d0b799ba
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Tor Lillqvist <tml at iki.fi>



More information about the LibreOffice mailing list