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>
This commit is contained in:
committed by
Michael Meeks
parent
ecfdf8a424
commit
2de803d056
@@ -311,59 +311,43 @@ 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)
|
||||||
{
|
{
|
||||||
/// check whether RTL interface or not
|
sal_Int32 LeftX1 = gnHorizontalGap;
|
||||||
if(!Application::GetSettings().GetLayoutRTL())
|
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 (
|
LeftX1 = aWindowBox.Width/2 + gnHorizontalGap;
|
||||||
(*iBlock)->maLeft.Paint(mxCanvas,
|
LeftX2 = aWindowBox.Width - gnHorizontalGap;
|
||||||
geometry::RealRectangle2D(
|
RightX1 = gnHorizontalGap;
|
||||||
gnHorizontalGap,
|
RightX2 = aWindowBox.Width/2 - 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);
|
|
||||||
}
|
}
|
||||||
else
|
const double nLeftHeight (
|
||||||
{
|
(*iBlock)->maLeft.Paint(mxCanvas,
|
||||||
const double nLeftHeight (
|
geometry::RealRectangle2D(
|
||||||
(*iBlock)->maLeft.Paint(mxCanvas,
|
LeftX1,
|
||||||
geometry::RealRectangle2D(
|
|
||||||
aWindowBox.Width/2 + gnHorizontalGap,
|
|
||||||
nY,
|
nY,
|
||||||
aWindowBox.Width - gnHorizontalGap,
|
LeftX2,
|
||||||
aWindowBox.Height - gnVerticalBorder),
|
aWindowBox.Height - gnVerticalBorder),
|
||||||
false,
|
false,
|
||||||
aViewState,
|
aViewState,
|
||||||
aRenderState,
|
aRenderState,
|
||||||
mpFont->mxFont));
|
mpFont->mxFont));
|
||||||
const double nRightHeight (
|
const double nRightHeight (
|
||||||
(*iBlock)->maRight.Paint(mxCanvas,
|
(*iBlock)->maRight.Paint(mxCanvas,
|
||||||
geometry::RealRectangle2D(
|
geometry::RealRectangle2D(
|
||||||
gnHorizontalGap,
|
RightX1,
|
||||||
nY,
|
nY,
|
||||||
aWindowBox.Width/2 - gnHorizontalGap,
|
RightX2,
|
||||||
aWindowBox.Height - gnVerticalBorder),
|
aWindowBox.Height - gnVerticalBorder),
|
||||||
true,
|
true,
|
||||||
aViewState,
|
aViewState,
|
||||||
aRenderState,
|
aRenderState,
|
||||||
mpFont->mxFont));
|
mpFont->mxFont));
|
||||||
nY += ::std::max(nLeftHeight,nRightHeight);
|
|
||||||
}
|
nY += ::std::max(nLeftHeight,nRightHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference<rendering::XSpriteCanvas> xSpriteCanvas (mxCanvas, UNO_QUERY);
|
Reference<rendering::XSpriteCanvas> xSpriteCanvas (mxCanvas, UNO_QUERY);
|
||||||
|
Reference in New Issue
Block a user