diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-03-23 18:51:13 +1100 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-03-25 12:17:01 +0000 |
commit | 977aae0cdec71577cbdc74baea228a5f267e7fd8 (patch) | |
tree | 6423514964bef1da9d829c91ba104e08ac68efa5 /include | |
parent | b53ba68b6b4a070ec56d02aaacccc6f649ec9482 (diff) |
fdo#74702 Moved EnableRTL() logic to specific classes where appropriate
OutputDevice::EnableRTL() is a bit of a mess. It uses a runtime
variable to see if it is using a VirtualDevice, and it uses a
dynamic_cast to see if the object is a Window or a Control!
I have made it virtual and moved the knowledge of class specific
functionality from OutputDevice to VirtualDevice, Window and Control
as needed. OutputDevice::EnableRTL() functionality is then called.
Also: small formatting change to outdev.hxx, also included a note
that WindowImpl is a pimpl in window.hxx.
Change-Id: I44b66601c4457fb2e0bbc1014fb7acf8f6942f80
Reviewed-on: https://gerrit.libreoffice.org/8721
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/ctrl.hxx | 2 | ||||
-rw-r--r-- | include/vcl/outdev.hxx | 16 | ||||
-rw-r--r-- | include/vcl/virdev.hxx | 2 | ||||
-rw-r--r-- | include/vcl/window.hxx | 4 |
4 files changed, 15 insertions, 9 deletions
diff --git a/include/vcl/ctrl.hxx b/include/vcl/ctrl.hxx index 34879707e115..6c00e460d814 100644 --- a/include/vcl/ctrl.hxx +++ b/include/vcl/ctrl.hxx @@ -129,6 +129,8 @@ public: explicit Control( Window* pParent, const ResId& ); virtual ~Control(); + virtual void EnableRTL ( bool bEnable = true ); + virtual void GetFocus(); virtual void LoseFocus(); virtual bool Notify( NotifyEvent& rNEvt ); diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index eb4d0ba3f78e..c86a8ac80f7c 100644 --- a/include/vcl/outdev.hxx +++ b/include/vcl/outdev.hxx @@ -1141,25 +1141,25 @@ public: BitmapEx GetBitmapEx( const Point& rSrcPt, const Size& rSize ) const; void EnableMapMode( bool bEnable = true ); - bool IsMapModeEnabled() const { return mbMap; } + bool IsMapModeEnabled() const { return mbMap; } // Enabling/disabling RTL only makes sense for OutputDevices that use a mirroring SalGraphisLayout - void EnableRTL( bool bEnable = true); - bool IsRTLEnabled() const { return mbEnableRTL; } + virtual void EnableRTL( bool bEnable = true); + bool IsRTLEnabled() const { return mbEnableRTL; } void SetConnectMetaFile( GDIMetaFile* pMtf ); GDIMetaFile* GetConnectMetaFile() const { return mpMetaFile; } void EnableOutput( bool bEnable = true ); - bool IsOutputEnabled() const { return mbOutput; } - bool IsDeviceOutput() const { return mbDevOutput; } - bool IsDeviceOutputNecessary() const { return (mbOutput && mbDevOutput); } - bool IsOutputNecessary() const { return ((mbOutput && mbDevOutput) || (mpMetaFile != NULL)); } + bool IsOutputEnabled() const { return mbOutput; } + bool IsDeviceOutput() const { return mbDevOutput; } + bool IsDeviceOutputNecessary() const { return (mbOutput && mbDevOutput); } + bool IsOutputNecessary() const { return ((mbOutput && mbDevOutput) || (mpMetaFile != NULL)); } void SetClipRegion(); void SetClipRegion( const Region& rRegion ); Region GetClipRegion() const; - bool IsClipRegion() const { return mbClipRegion; } + bool IsClipRegion() const { return mbClipRegion; } Region GetActiveClipRegion() const; void MoveClipRegion( long nHorzMove, long nVertMove ); diff --git a/include/vcl/virdev.hxx b/include/vcl/virdev.hxx index 72cc3fe95e84..145179bfa73e 100644 --- a/include/vcl/virdev.hxx +++ b/include/vcl/virdev.hxx @@ -113,6 +113,8 @@ public: virtual ~VirtualDevice(); + void EnableRTL( bool bEnable = true ); + bool SetOutputSizePixel( const Size& rNewSize, bool bErase = true ); bool SetOutputSizePixelScaleOffsetAndBuffer( const Size& rNewSize, const Fraction& rScale, const Point& rNewOffset, const basebmp::RawMemorySharedArray &pBuffer ); bool SetOutputSize( const Size& rNewSize, bool bErase = true ) diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 5bf0e8d642c0..3a3851ca449d 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -355,7 +355,8 @@ private: // NOTE: to remove many dependencies of other modules // to this central file, all members are now hidden // in the WindowImpl class and all inline functions - // were removed + // were removed. + // (WindowImpl is a pImpl pattern) // Please do *not* add new members or inline functions to class Window, // but use class WindowImpl instead @@ -594,6 +595,7 @@ public: OutputDevice const* GetOutDev() const { return mpOutputDevice; }; OutputDevice* GetOutDev() { return mpOutputDevice; }; + virtual void EnableRTL ( bool bEnable = true ); virtual void MouseMove( const MouseEvent& rMEvt ); virtual void MouseButtonDown( const MouseEvent& rMEvt ); virtual void MouseButtonUp( const MouseEvent& rMEvt ); |