diff options
author | Faisal M. Al-Otaibi <fmalotaibi@kacst.edu.sa> | 2012-12-12 10:34:19 +0300 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-12-12 10:53:33 +0000 |
commit | a77fa7ee84424a5844d836e83978ab0197716bef (patch) | |
tree | f4fffacfb7f8404acefc1a896c5a7d479a0feeac /sdext | |
parent | cd96cf04314e2bcd73340b52cb9d372e884a4355 (diff) |
fdo#57422 - presenter console RTL support needs completion
This patch will fix the RTL layout on Help view
Change-Id: I1cba5691649a0494efb9db63b8292525ff0c3656
Reviewed-on: https://gerrit.libreoffice.org/1302
Reviewed-by: Michael Meeks <michael.meeks@suse.com>
Tested-by: Michael Meeks <michael.meeks@suse.com>
Diffstat (limited to 'sdext')
-rw-r--r-- | sdext/source/presenter/PresenterHelpView.cxx | 106 |
1 files changed, 73 insertions, 33 deletions
diff --git a/sdext/source/presenter/PresenterHelpView.cxx b/sdext/source/presenter/PresenterHelpView.cxx index ee6729ffa692..25308b4c69ac 100644 --- a/sdext/source/presenter/PresenterHelpView.cxx +++ b/sdext/source/presenter/PresenterHelpView.cxx @@ -16,7 +16,7 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ - +#include "vcl/svapp.hxx" #include "PresenterHelpView.hxx" #include "PresenterButton.hxx" #include "PresenterCanvasHelper.hxx" @@ -311,29 +311,59 @@ void PresenterHelpView::Paint (const awt::Rectangle& rUpdateBox) TextContainer::const_iterator iBlockEnd (mpTextContainer->end()); for ( ; iBlock!=iBlockEnd; ++iBlock) { - const double nLeftHeight ( - (*iBlock)->maLeft.Paint(mxCanvas, - geometry::RealRectangle2D( - gnHorizontalGap, - nY, - aWindowBox.Width/2 - gnHorizontalGap, - aWindowBox.Height - gnVerticalBorder), - false, - aViewState, - aRenderState, - mpFont->mxFont)); - const double nRightHeight ( - (*iBlock)->maRight.Paint(mxCanvas, - geometry::RealRectangle2D( - aWindowBox.Width/2 + gnHorizontalGap, - nY, - aWindowBox.Width - gnHorizontalGap, - aWindowBox.Height - gnVerticalBorder), - true, - aViewState, - aRenderState, - mpFont->mxFont)); - nY += ::std::max(nLeftHeight,nRightHeight); + /// check whether RTL interface or not + if(!Application::GetSettings().GetLayoutRTL()) + { + const double nLeftHeight ( + (*iBlock)->maLeft.Paint(mxCanvas, + geometry::RealRectangle2D( + gnHorizontalGap, + nY, + aWindowBox.Width/2 - gnHorizontalGap, + aWindowBox.Height - gnVerticalBorder), + false, + aViewState, + aRenderState, + mpFont->mxFont)); + const double nRightHeight ( + (*iBlock)->maRight.Paint(mxCanvas, + geometry::RealRectangle2D( + aWindowBox.Width/2 + gnHorizontalGap, + nY, + aWindowBox.Width - gnHorizontalGap, + aWindowBox.Height - gnVerticalBorder), + true, + aViewState, + aRenderState, + mpFont->mxFont)); + nY += ::std::max(nLeftHeight,nRightHeight); + } + else + { + const double nLeftHeight ( + (*iBlock)->maLeft.Paint(mxCanvas, + geometry::RealRectangle2D( + aWindowBox.Width/2 + gnHorizontalGap, + nY, + aWindowBox.Width - gnHorizontalGap, + aWindowBox.Height - gnVerticalBorder), + false, + aViewState, + aRenderState, + mpFont->mxFont)); + const double nRightHeight ( + (*iBlock)->maRight.Paint(mxCanvas, + geometry::RealRectangle2D( + gnHorizontalGap, + nY, + aWindowBox.Width/2 - gnHorizontalGap, + aWindowBox.Height - gnVerticalBorder), + true, + aViewState, + aRenderState, + mpFont->mxFont)); + nY += ::std::max(nLeftHeight,nRightHeight); + } } Reference<rendering::XSpriteCanvas> xSpriteCanvas (mxCanvas, UNO_QUERY); @@ -567,20 +597,30 @@ double LineDescriptorList::Paint( vector<LineDescriptor>::const_iterator iEnd (mpLineDescriptors->end()); for ( ; iLine!=iEnd; ++iLine) { - double nX (rBBox.X1); - if ( ! bFlushLeft) - nX = rBBox.X2 - iLine->maSize.Width; + double nX; + /// check whether RTL interface or not + if(!Application::GetSettings().GetLayoutRTL()) + { + nX = rBBox.X1; + if ( ! bFlushLeft) + nX = rBBox.X2 - iLine->maSize.Width; + } + else + { + nX=rBBox.X2 - iLine->maSize.Width; + if ( ! bFlushLeft) + nX = rBBox.X1; + } rRenderState.AffineTransform.m02 = nX; rRenderState.AffineTransform.m12 = nY + iLine->maSize.Height - iLine->mnVerticalOffset; const rendering::StringContext aContext (iLine->msLine, 0, iLine->msLine.getLength()); - - rxCanvas->drawText ( - aContext, - rxFont, + Reference<rendering::XTextLayout> xLayout ( + rxFont->createTextLayout(aContext, rendering::TextDirection::WEAK_LEFT_TO_RIGHT, 0)); + rxCanvas->drawTextLayout ( + xLayout, rViewState, - rRenderState, - rendering::TextDirection::WEAK_LEFT_TO_RIGHT); + rRenderState); nY += iLine->maSize.Height * 1.2; } |