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 /vcl/source/control | |
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 'vcl/source/control')
-rw-r--r-- | vcl/source/control/ctrl.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/vcl/source/control/ctrl.cxx b/vcl/source/control/ctrl.cxx index 2fe5c0bd9a87..e1bfbca514f0 100644 --- a/vcl/source/control/ctrl.cxx +++ b/vcl/source/control/ctrl.cxx @@ -71,6 +71,16 @@ Control::~Control() delete mpControlData, mpControlData = NULL; } + +void Control::EnableRTL( bool bEnable ) +{ + // convenience: for controls also switch layout mode + SetLayoutMode( bEnable ? TEXT_LAYOUT_BIDI_RTL | TEXT_LAYOUT_TEXTORIGIN_LEFT : + TEXT_LAYOUT_BIDI_LTR | TEXT_LAYOUT_TEXTORIGIN_LEFT ); + StateChanged( STATE_CHANGE_MIRRORING ); + OutputDevice::EnableRTL(bEnable); +} + void Control::GetFocus() { Window::GetFocus(); |