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,15 +311,25 @@ void PresenterHelpView::Paint (const awt::Rectangle& rUpdateBox)
|
||||
TextContainer::const_iterator iBlockEnd (mpTextContainer->end());
|
||||
for ( ; iBlock!=iBlockEnd; ++iBlock)
|
||||
{
|
||||
/// check whether RTL interface or not
|
||||
if(!Application::GetSettings().GetLayoutRTL())
|
||||
sal_Int32 LeftX1 = gnHorizontalGap;
|
||||
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())
|
||||
{
|
||||
LeftX1 = aWindowBox.Width/2 + gnHorizontalGap;
|
||||
LeftX2 = aWindowBox.Width - gnHorizontalGap;
|
||||
RightX1 = gnHorizontalGap;
|
||||
RightX2 = aWindowBox.Width/2 - gnHorizontalGap;
|
||||
}
|
||||
const double nLeftHeight (
|
||||
(*iBlock)->maLeft.Paint(mxCanvas,
|
||||
geometry::RealRectangle2D(
|
||||
gnHorizontalGap,
|
||||
LeftX1,
|
||||
nY,
|
||||
aWindowBox.Width/2 - gnHorizontalGap,
|
||||
LeftX2,
|
||||
aWindowBox.Height - gnVerticalBorder),
|
||||
false,
|
||||
aViewState,
|
||||
@@ -328,43 +338,17 @@ void PresenterHelpView::Paint (const awt::Rectangle& rUpdateBox)
|
||||
const double nRightHeight (
|
||||
(*iBlock)->maRight.Paint(mxCanvas,
|
||||
geometry::RealRectangle2D(
|
||||
aWindowBox.Width/2 + gnHorizontalGap,
|
||||
RightX1,
|
||||
nY,
|
||||
aWindowBox.Width - gnHorizontalGap,
|
||||
RightX2,
|
||||
aWindowBox.Height - gnVerticalBorder),
|
||||
true,
|
||||
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);
|
||||
if (xSpriteCanvas.is())
|
||||
|
Reference in New Issue
Block a user