diff options
author | Faisal M. Al-Otaibi <fmalotaibi@kacst.edu.sa> | 2012-12-18 12:06:24 +0300 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-12-19 10:25:45 +0000 |
commit | 2de803d056e633952f8d8f676b4f7fbcf6c7948c (patch) | |
tree | 2a3224ffa65d44051ee523de15b4694dc3e1ce2d /sdext | |
parent | ecfdf8a42401b9762fb78ae693b19bdc76403508 (diff) |
Remove duplicate code from Presenter Help View
Change-Id: Ie33419ffe04dccc71956f7475d7b7a4acee7df12
Reviewed-on: https://gerrit.libreoffice.org/1391
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 | 78 |
1 files changed, 31 insertions, 47 deletions
diff --git a/sdext/source/presenter/PresenterHelpView.cxx b/sdext/source/presenter/PresenterHelpView.cxx index 25308b4c69ac..d0293b24c3e7 100644 --- a/sdext/source/presenter/PresenterHelpView.cxx +++ b/sdext/source/presenter/PresenterHelpView.cxx @@ -311,59 +311,43 @@ void PresenterHelpView::Paint (const awt::Rectangle& rUpdateBox) TextContainer::const_iterator iBlockEnd (mpTextContainer->end()); for ( ; iBlock!=iBlockEnd; ++iBlock) { - /// check whether RTL interface or not - if(!Application::GetSettings().GetLayoutRTL()) + sal_Int32 LeftX1 = gnHorizontalGap; + sal_Int32 LeftX2 = aWindowBox.Width/2 - gnHorizontalGap; + sal_Int32 RightX1 = aWindowBox.Width/2 + gnHorizontalGap; + sal_Int32 RightX2 = aWindowBox.Width - gnHorizontalGap; + /* check whether RTL interface or not + then replace the windowbox position */ + 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); + LeftX1 = aWindowBox.Width/2 + gnHorizontalGap; + LeftX2 = aWindowBox.Width - gnHorizontalGap; + RightX1 = gnHorizontalGap; + RightX2 = aWindowBox.Width/2 - gnHorizontalGap; } - else - { - const double nLeftHeight ( - (*iBlock)->maLeft.Paint(mxCanvas, - geometry::RealRectangle2D( - aWindowBox.Width/2 + gnHorizontalGap, + const double nLeftHeight ( + (*iBlock)->maLeft.Paint(mxCanvas, + geometry::RealRectangle2D( + LeftX1, nY, - aWindowBox.Width - gnHorizontalGap, + LeftX2, aWindowBox.Height - gnVerticalBorder), - false, - aViewState, - aRenderState, - mpFont->mxFont)); - const double nRightHeight ( - (*iBlock)->maRight.Paint(mxCanvas, - geometry::RealRectangle2D( - gnHorizontalGap, + false, + aViewState, + aRenderState, + mpFont->mxFont)); + const double nRightHeight ( + (*iBlock)->maRight.Paint(mxCanvas, + geometry::RealRectangle2D( + RightX1, nY, - aWindowBox.Width/2 - gnHorizontalGap, + RightX2, aWindowBox.Height - gnVerticalBorder), - true, - aViewState, - aRenderState, - mpFont->mxFont)); - nY += ::std::max(nLeftHeight,nRightHeight); - } + true, + aViewState, + aRenderState, + mpFont->mxFont)); + + nY += ::std::max(nLeftHeight,nRightHeight); } Reference<rendering::XSpriteCanvas> xSpriteCanvas (mxCanvas, UNO_QUERY); |