summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2014-03-23 19:27:45 +1100
committerChris Sherlock <chris.sherlock79@gmail.com>2014-03-25 12:25:18 +0000
commit03568b2e2405fc44435b95720f3680ab1daea836 (patch)
tree391a54edd21b9173f9255c1cc4f8f06652bf65ca
parent977aae0cdec71577cbdc74baea228a5f267e7fd8 (diff)
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@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
-rw-r--r--include/vcl/outdev.hxx6
-rw-r--r--include/vcl/virdev.hxx3
-rw-r--r--vcl/source/gdi/outdev.cxx13
-rw-r--r--vcl/source/gdi/virdev.cxx29
4 files changed, 24 insertions, 27 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index c86a8ac80f7c..fbeae4bafa0b 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 145179bfa73e..e5e5c54eda6f 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 385ac40a2f8c..2b7a088d0d6c 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 aa3f35947785..6fc68d29726d 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;