[Libreoffice-commits] core.git: include/vcl vcl/source
Chris Sherlock
chris.sherlock79 at gmail.com
Tue Mar 25 05:25:44 PDT 2014
include/vcl/outdev.hxx | 6 +++---
include/vcl/virdev.hxx | 3 +++
vcl/source/gdi/outdev.cxx | 13 +------------
vcl/source/gdi/virdev.cxx | 29 +++++++++++++++++------------
4 files changed, 24 insertions(+), 27 deletions(-)
New commits:
commit 03568b2e2405fc44435b95720f3680ab1daea836
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date: Sun Mar 23 19:27:45 2014 +1100
fdo#74702 Move GetBitCount() and GetAlphaBitCount into correct classes
GetBitCount() works differently for VirtualDevices. GetAlphaBitCount()
is really only used by VirtualDevice, so moved functionality from
OutputDevice to VirtualDevice.
Change-Id: Ic00e32f1fa385542bcce8c9475f0ea5eb9a077f9
Reviewed-on: https://gerrit.libreoffice.org/8722
Reviewed-by: Chris Sherlock <chris.sherlock79 at gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79 at gmail.com>
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index c86a8ac..fbeae4b 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -1409,16 +1409,16 @@ public:
sal_Int32* pKashidaPosDropped // invalid kashida positions (out)
) const;
- sal_uInt16 GetBitCount() const;
+ virtual sal_uInt16 GetBitCount() const;
- bool GetTextIsRTL( const OUString&, sal_Int32 nIndex, sal_Int32 nLen ) const;
+ bool GetTextIsRTL( const OUString&, sal_Int32 nIndex, sal_Int32 nLen ) const;
/** Query the existence and depth of the alpha channel
@return 0, if no alpha channel available, and the bit depth of
the alpha channel otherwise.
*/
- sal_uInt16 GetAlphaBitCount() const;
+ virtual sal_uInt16 GetAlphaBitCount() const;
sal_uLong GetColorCount() const;
void Push( sal_uInt16 nFlags = PUSH_ALL );
diff --git a/include/vcl/virdev.hxx b/include/vcl/virdev.hxx
index 145179b..e5e5c54 100644
--- a/include/vcl/virdev.hxx
+++ b/include/vcl/virdev.hxx
@@ -134,6 +134,9 @@ public:
void SetReferenceDevice( sal_Int32 i_nDPIX, sal_Int32 i_nDPIY );
+ sal_uInt16 GetBitCount() const;
+ sal_uInt16 GetAlphaBitCount() const;
+
private:
SAL_DLLPRIVATE void ImplSetReferenceDevice( RefDevMode, sal_Int32 i_nDPIX, sal_Int32 i_nDPIY );
diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx
index 385ac40..2b7a088 100644
--- a/vcl/source/gdi/outdev.cxx
+++ b/vcl/source/gdi/outdev.cxx
@@ -2249,11 +2249,7 @@ void OutputDevice::SetSettings( const AllSettings& rSettings )
sal_uInt16 OutputDevice::GetBitCount() const
{
-
- if ( meOutDevType == OUTDEV_VIRDEV )
- return ((VirtualDevice*)this)->mnBitCount;
-
- // we need a graphics
+ // we need a graphics instance
if ( !mpGraphics )
{
if ( !((OutputDevice*)this)->ImplGetGraphics() )
@@ -2265,13 +2261,6 @@ sal_uInt16 OutputDevice::GetBitCount() const
sal_uInt16 OutputDevice::GetAlphaBitCount() const
{
-
- if ( meOutDevType == OUTDEV_VIRDEV &&
- mpAlphaVDev != NULL )
- {
- return mpAlphaVDev->GetBitCount();
- }
-
return 0;
}
diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx
index aa3f359..6fc68d2 100644
--- a/vcl/source/gdi/virdev.cxx
+++ b/vcl/source/gdi/virdev.cxx
@@ -369,6 +369,8 @@ bool VirtualDevice::InnerImplSetOutputSizePixel( const Size& rNewSize, bool bEra
return bRet;
}
+
+
// #i32109#: Fill opaque areas correctly (without relying on
// fill/linecolor state)
void VirtualDevice::ImplFillOpaqueRectangle( const Rectangle& rRect )
@@ -383,6 +385,8 @@ void VirtualDevice::ImplFillOpaqueRectangle( const Rectangle& rRect )
Pop();
}
+
+
bool VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, bool bErase, const basebmp::RawMemorySharedArray &pBuffer )
{
if( InnerImplSetOutputSizePixel(rNewSize, bErase, pBuffer) )
@@ -418,18 +422,6 @@ bool VirtualDevice::ImplSetOutputSizePixel( const Size& rNewSize, bool bErase, c
return false;
}
-void VirtualDevice::EnableRTL( bool bEnable )
-{
- // virdevs default to not mirroring, they will only be set to mirroring
- // under rare circumstances in the UI, eg the valueset control
- // because each virdev has its own SalGraphics we can safely switch the SalGraphics here
- // ...hopefully
- if( ImplGetGraphics() )
- mpGraphics->SetLayout( bEnable ? SAL_LAYOUT_BIDI_RTL : 0 );
-
- OutputDevice::EnableRTL(bEnable);
-}
-
bool VirtualDevice::SetOutputSizePixel( const Size& rNewSize, bool bErase )
{
return ImplSetOutputSizePixel( rNewSize, bErase, basebmp::RawMemorySharedArray() );
@@ -527,6 +519,19 @@ void VirtualDevice::ImplSetReferenceDevice( RefDevMode i_eRefDevMode, sal_Int32
mpFontCache = new ImplFontCache();
}
+sal_uInt16 VirtualDevice::GetBitCount() const
+{
+ return mnBitCount;
+}
+
+sal_uInt16 VirtualDevice::GetAlphaBitCount() const
+{
+ if (mpAlphaVDev)
+ return mpAlphaVDev->GetBitCount();
+
+ return 0;
+}
+
void VirtualDevice::Compat_ZeroExtleadBug()
{
meRefDevMode = (sal_uInt8)meRefDevMode | REFDEV_FORCE_ZERO_EXTLEAD;
More information about the Libreoffice-commits
mailing list