diff options
author | Ahmad Harthi <aalharthi@kacst.edu.sa> | 2012-12-31 09:16:20 +0300 |
---|---|---|
committer | Ahmad Harthi <aalharthi@kacst.edu.sa> | 2013-01-29 07:40:02 +0000 |
commit | e252ac072276a6e9459a5573c862e8066b78c29d (patch) | |
tree | 4ac0907e8e45c645b002adcafdf00f7958c0ce38 /sdext | |
parent | Resolves the bug fdo#59117 missing borders of last column (diff) | |
download | core-e252ac072276a6e9459a5573c862e8066b78c29d.tar.gz core-e252ac072276a6e9459a5573c862e8066b78c29d.zip |
More fixes to fdo#57422
* Code cleanup + replacing drawText() with drawTextLayout().
This solves mirrored LTR text in an RTL ui
Change-Id: Ib89aee7c817811c7b3751dc6f941a34ed763d993
Reviewed-on: https://gerrit.libreoffice.org/1521
Tested-by: Ahmad Harthi <aalharthi@kacst.edu.sa>
Reviewed-by: Ahmad Harthi <aalharthi@kacst.edu.sa>
Diffstat (limited to 'sdext')
-rw-r--r-- | sdext/source/presenter/PresenterButton.cxx | 30 | ||||
-rw-r--r-- | sdext/source/presenter/PresenterSlideShowView.cxx | 41 |
2 files changed, 20 insertions, 51 deletions
diff --git a/sdext/source/presenter/PresenterButton.cxx b/sdext/source/presenter/PresenterButton.cxx index ac8e813379d5..b7415a538243 100644 --- a/sdext/source/presenter/PresenterButton.cxx +++ b/sdext/source/presenter/PresenterButton.cxx @@ -413,29 +413,15 @@ void PresenterButton::RenderButton ( rendering::RenderState aRenderState (geometry::AffineMatrix2D(1,0,0, 0,1,0), NULL, Sequence<double>(4), rendering::CompositeOperation::SOURCE); PresenterCanvasHelper::SetDeviceColor(aRenderState, rpFont->mnColor); + + aRenderState.AffineTransform.m02 = (rSize.Width - aTextBBox.X2 + aTextBBox.X1)/2; + aRenderState.AffineTransform.m12 = (rSize.Height - aTextBBox.Y2 + aTextBBox.Y1)/2 - aTextBBox.Y1; + /// this is responsible of the close button - /// check whether RTL interface or not - if(!Application::GetSettings().GetLayoutRTL()){ - aRenderState.AffineTransform.m02 = (rSize.Width - aTextBBox.X2 + aTextBBox.X1)/2; - aRenderState.AffineTransform.m12 = (rSize.Height - aTextBBox.Y2 + aTextBBox.Y1)/2 - aTextBBox.Y1; - - rxCanvas->drawText( - aContext, - rpFont->mxFont, - rendering::ViewState(geometry::AffineMatrix2D(1,0,0, 0,1,0), NULL), - aRenderState, - rendering::TextDirection::WEAK_LEFT_TO_RIGHT); - }else{ - aRenderState.AffineTransform.m02 = (rSize.Width + aTextBBox.X2 - aTextBBox.X1)/2; - aRenderState.AffineTransform.m12 = (rSize.Height - aTextBBox.Y2 + aTextBBox.Y1)/2 - aTextBBox.Y1; - - rxCanvas->drawText( - aContext, - rpFont->mxFont, - rendering::ViewState(geometry::AffineMatrix2D(1,0,0, 0,1,0), NULL), - aRenderState, - rendering::TextDirection::WEAK_RIGHT_TO_LEFT); - } + rxCanvas->drawTextLayout( + xLayout, + rendering::ViewState(geometry::AffineMatrix2D(1,0,0, 0,1,0), NULL), + aRenderState); } void PresenterButton::Invalidate (void) diff --git a/sdext/source/presenter/PresenterSlideShowView.cxx b/sdext/source/presenter/PresenterSlideShowView.cxx index 894e6d889fe7..be99fa56c18e 100644 --- a/sdext/source/presenter/PresenterSlideShowView.cxx +++ b/sdext/source/presenter/PresenterSlideShowView.cxx @@ -782,35 +782,18 @@ void PresenterSlideShowView::PaintEndSlide (const awt::Rectangle& rRepaintBox) break; /// this is responsible of the " presentation exit " text inside the slide windows - /// check whether RTL interface or not - if(!Application::GetSettings().GetLayoutRTL()){ - PresenterCanvasHelper::SetDeviceColor(aRenderState, util::Color(0x00ffffff)); - aRenderState.AffineTransform.m02 = 20; - aRenderState.AffineTransform.m12 = 40; - const rendering::StringContext aContext ( - msClickToExitPresentationText, 0, msClickToExitPresentationText.getLength()); - pFont->PrepareFont(mxCanvas); - mxCanvas->drawText( - aContext, - pFont->mxFont, - aViewState, - aRenderState, - rendering::TextDirection::WEAK_LEFT_TO_RIGHT); - } - else{ - PresenterCanvasHelper::SetDeviceColor(aRenderState, util::Color(0x00ffffff)); - aRenderState.AffineTransform.m02 = rRepaintBox.Width-20; - aRenderState.AffineTransform.m12 = 40; - const rendering::StringContext aContext ( - msClickToExitPresentationText, 0, msClickToExitPresentationText.getLength()); - pFont->PrepareFont(mxCanvas); - mxCanvas->drawText( - aContext, - pFont->mxFont, - aViewState, - aRenderState, - rendering::TextDirection::WEAK_RIGHT_TO_LEFT); - } + PresenterCanvasHelper::SetDeviceColor(aRenderState, util::Color(0x00ffffff)); + aRenderState.AffineTransform.m02 = 20; + aRenderState.AffineTransform.m12 = 40; + const rendering::StringContext aContext ( + msClickToExitPresentationText, 0, msClickToExitPresentationText.getLength()); + pFont->PrepareFont(mxCanvas); + const Reference<rendering::XTextLayout> xLayout ( + pFont->mxFont->createTextLayout(aContext,rendering::TextDirection::WEAK_LEFT_TO_RIGHT,0)); + mxCanvas->drawTextLayout( + xLayout, + aViewState, + aRenderState); } while (false); |