Hi,
I have submitted a patch for review:
https://gerrit.libreoffice.org/1521
To pull it, you can do:
git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/21/1521/2
More fixes to fdo#57422
* Code cleanup + replacing drawText() with drawTextLayout().
This solves mirrored LTR text in an RTL ui
Change-Id: Ib89aee7c817811c7b3751dc6f941a34ed763d993
---
M sdext/source/presenter/PresenterButton.cxx
M sdext/source/presenter/PresenterSlideShowView.cxx
2 files changed, 20 insertions(+), 51 deletions(-)
diff --git a/sdext/source/presenter/PresenterButton.cxx b/sdext/source/presenter/PresenterButton.cxx
index ac8e813..b7415a5 100644
--- a/sdext/source/presenter/PresenterButton.cxx
+++ b/sdext/source/presenter/PresenterButton.cxx
@@ -413,29 +413,15 @@
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 894e6d8..be99fa5 100644
--- a/sdext/source/presenter/PresenterSlideShowView.cxx
+++ b/sdext/source/presenter/PresenterSlideShowView.cxx
@@ -782,35 +782,18 @@
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);
--
To view, visit https://gerrit.libreoffice.org/1521
To unsubscribe, visit https://gerrit.libreoffice.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib89aee7c817811c7b3751dc6f941a34ed763d993
Gerrit-PatchSet: 2
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Ahmad Harthi <aalharthi@kacst.edu.sa>
Gerrit-Reviewer: Ahmad Harthi <aalharthi@kacst.edu.sa>
Gerrit-Reviewer: Faisal al-otaibi <fmalotaibi@kacst.edu.sa>
Gerrit-Reviewer: LibreOffice gerrit bot <gerrit@libreoffice.org>
Gerrit-Reviewer: Norbert Thiebaud <nthiebaud@gmail.com>
Gerrit-Reviewer: abdulmajeed ahmed <aalabdulrazzaq@kacst.edu.sa>
Context
- [PATCH] More fixes to fdo#57422 · Faisal al-otaibi (via Code Review)
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.