diff options
author | Faisal M. Al-Otaibi <fmalotaibi@kacst.edu.sa> | 2014-02-24 10:35:36 +0300 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-02-24 15:46:24 +0000 |
commit | 1027e2be99f133ea30e5b81bf65b1c301a0a5866 (patch) | |
tree | 325c02d34f176c158bccc2c1f33d158a295dab5f /svx | |
parent | ee09b4ed2b934eba6875688d778f4c4e9c14320b (diff) |
fdo#74751: fix reverse base point diagram on RTL UI
Change-Id: Ib8e9f40b5576116f0220ffa70390f95b28c8bae0
Reviewed-on: https://gerrit.libreoffice.org/8200
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/dlgctrl.cxx | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index 330a9c93d05f..61f6bd101fb3 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -571,7 +571,9 @@ Point SvxRectCtl::SetActualRPWithoutInvalidate( RECT_POINT eNewRP ) if( (m_nState & CS_NOVERT) != 0 ) aPtNew.Y() = aPtMM.Y(); - eNewRP = GetRPFromPoint( aPtNew ); + // fdo#74751 this fix reverse base point on RTL UI. + bool bRTL = Application::GetSettings().GetLayoutRTL(); + eNewRP = GetRPFromPoint( aPtNew, bRTL ); eDefRP = eNewRP; eRP = eNewRP; @@ -627,19 +629,20 @@ Point SvxRectCtl::GetApproxLogPtFromPixPt( const Point& rPt ) const // Converts Point in RECT_POINT -RECT_POINT SvxRectCtl::GetRPFromPoint( Point aPt ) const +RECT_POINT SvxRectCtl::GetRPFromPoint( Point aPt, bool bRTL ) const { - if ( aPt == aPtLT) return RP_LT; - else if( aPt == aPtMT) return RP_MT; - else if( aPt == aPtRT) return RP_RT; - else if( aPt == aPtLM) return RP_LM; - else if( aPt == aPtRM) return RP_RM; - else if( aPt == aPtLB) return RP_LB; - else if( aPt == aPtMB) return RP_MB; - else if( aPt == aPtRB) return RP_RB; + RECT_POINT rPoint = RP_MM; // default - else - return RP_MM; // default + if ( aPt == aPtLT) rPoint = bRTL ? RP_RT : RP_LT; + else if( aPt == aPtMT) rPoint = RP_MT; + else if( aPt == aPtRT) rPoint = bRTL ? RP_LT : RP_RT; + else if( aPt == aPtLM) rPoint = bRTL ? RP_RM : RP_LM; + else if( aPt == aPtRM) rPoint = bRTL ? RP_LM : RP_RM; + else if( aPt == aPtLB) rPoint = bRTL ? RP_RB : RP_LB; + else if( aPt == aPtMB) rPoint = RP_MB; + else if( aPt == aPtRB) rPoint = bRTL ? RP_LB : RP_RB; + + return rPoint; } // Resets to the original state of the control |