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"
...@@ -311,29 +311,59 @@ void PresenterHelpView::Paint (const awt::Rectangle& rUpdateBox) ...@@ -311,29 +311,59 @@ void PresenterHelpView::Paint (const awt::Rectangle& rUpdateBox)
TextContainer::const_iterator iBlockEnd (mpTextContainer->end()); TextContainer::const_iterator iBlockEnd (mpTextContainer->end());
for ( ; iBlock!=iBlockEnd; ++iBlock) for ( ; iBlock!=iBlockEnd; ++iBlock)
{ {
const double nLeftHeight ( /// check whether RTL interface or not
(*iBlock)->maLeft.Paint(mxCanvas, if(!Application::GetSettings().GetLayoutRTL())
geometry::RealRectangle2D( {
gnHorizontalGap, const double nLeftHeight (
nY, (*iBlock)->maLeft.Paint(mxCanvas,
aWindowBox.Width/2 - gnHorizontalGap, geometry::RealRectangle2D(
aWindowBox.Height - gnVerticalBorder), gnHorizontalGap,
false, nY,
aViewState, aWindowBox.Width/2 - gnHorizontalGap,
aRenderState, aWindowBox.Height - gnVerticalBorder),
mpFont->mxFont)); false,
const double nRightHeight ( aViewState,
(*iBlock)->maRight.Paint(mxCanvas, aRenderState,
geometry::RealRectangle2D( mpFont->mxFont));
aWindowBox.Width/2 + gnHorizontalGap, const double nRightHeight (
nY, (*iBlock)->maRight.Paint(mxCanvas,
aWindowBox.Width - gnHorizontalGap, geometry::RealRectangle2D(
aWindowBox.Height - gnVerticalBorder), aWindowBox.Width/2 + gnHorizontalGap,
true, nY,
aViewState, aWindowBox.Width - gnHorizontalGap,
aRenderState, aWindowBox.Height - gnVerticalBorder),
mpFont->mxFont)); true,
nY += ::std::max(nLeftHeight,nRightHeight); 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); Reference<rendering::XSpriteCanvas> xSpriteCanvas (mxCanvas, UNO_QUERY);
...@@ -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;
if ( ! bFlushLeft) /// check whether RTL interface or not
nX = rBBox.X2 - iLine->maSize.Width; 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.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