Kaydet (Commit) a77fa7ee authored tarafından Faisal M. Al-Otaibi's avatar Faisal M. Al-Otaibi Kaydeden (comit) Michael Meeks

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/1302Reviewed-by: 's avatarMichael Meeks <michael.meeks@suse.com>
Tested-by: 's avatarMichael Meeks <michael.meeks@suse.com>
üst cd96cf04
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
* except in compliance with the License. You may obtain a copy of * except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include "vcl/svapp.hxx"
#include "PresenterHelpView.hxx" #include "PresenterHelpView.hxx"
#include "PresenterButton.hxx" #include "PresenterButton.hxx"
#include "PresenterCanvasHelper.hxx" #include "PresenterCanvasHelper.hxx"
...@@ -310,6 +310,9 @@ void PresenterHelpView::Paint (const awt::Rectangle& rUpdateBox) ...@@ -310,6 +310,9 @@ void PresenterHelpView::Paint (const awt::Rectangle& rUpdateBox)
TextContainer::const_iterator iBlock (mpTextContainer->begin()); TextContainer::const_iterator iBlock (mpTextContainer->begin());
TextContainer::const_iterator iBlockEnd (mpTextContainer->end()); TextContainer::const_iterator iBlockEnd (mpTextContainer->end());
for ( ; iBlock!=iBlockEnd; ++iBlock) for ( ; iBlock!=iBlockEnd; ++iBlock)
{
/// check whether RTL interface or not
if(!Application::GetSettings().GetLayoutRTL())
{ {
const double nLeftHeight ( const double nLeftHeight (
(*iBlock)->maLeft.Paint(mxCanvas, (*iBlock)->maLeft.Paint(mxCanvas,
...@@ -335,6 +338,33 @@ void PresenterHelpView::Paint (const awt::Rectangle& rUpdateBox) ...@@ -335,6 +338,33 @@ void PresenterHelpView::Paint (const awt::Rectangle& rUpdateBox)
mpFont->mxFont)); mpFont->mxFont));
nY += ::std::max(nLeftHeight,nRightHeight); 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); Reference<rendering::XSpriteCanvas> xSpriteCanvas (mxCanvas, UNO_QUERY);
if (xSpriteCanvas.is()) if (xSpriteCanvas.is())
...@@ -567,20 +597,30 @@ double LineDescriptorList::Paint( ...@@ -567,20 +597,30 @@ double LineDescriptorList::Paint(
vector<LineDescriptor>::const_iterator iEnd (mpLineDescriptors->end()); vector<LineDescriptor>::const_iterator iEnd (mpLineDescriptors->end());
for ( ; iLine!=iEnd; ++iLine) for ( ; iLine!=iEnd; ++iLine)
{ {
double nX (rBBox.X1); double nX;
/// check whether RTL interface or not
if(!Application::GetSettings().GetLayoutRTL())
{
nX = rBBox.X1;
if ( ! bFlushLeft) if ( ! bFlushLeft)
nX = rBBox.X2 - iLine->maSize.Width; nX = rBBox.X2 - iLine->maSize.Width;
}
else
{
nX=rBBox.X2 - iLine->maSize.Width;
if ( ! bFlushLeft)
nX = rBBox.X1;
}
rRenderState.AffineTransform.m02 = nX; rRenderState.AffineTransform.m02 = nX;
rRenderState.AffineTransform.m12 = nY + iLine->maSize.Height - iLine->mnVerticalOffset; rRenderState.AffineTransform.m12 = nY + iLine->maSize.Height - iLine->mnVerticalOffset;
const rendering::StringContext aContext (iLine->msLine, 0, iLine->msLine.getLength()); const rendering::StringContext aContext (iLine->msLine, 0, iLine->msLine.getLength());
Reference<rendering::XTextLayout> xLayout (
rxCanvas->drawText ( rxFont->createTextLayout(aContext, rendering::TextDirection::WEAK_LEFT_TO_RIGHT, 0));
aContext, rxCanvas->drawTextLayout (
rxFont, xLayout,
rViewState, rViewState,
rRenderState, rRenderState);
rendering::TextDirection::WEAK_LEFT_TO_RIGHT);
nY += iLine->maSize.Height * 1.2; nY += iLine->maSize.Height * 1.2;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment