summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorheiko tietze <tietze.heiko@gmail.com>2018-04-15 12:02:20 +0200
committerHeiko Tietze <tietze.heiko@gmail.com>2018-04-15 18:52:23 +0200
commit04ee7404f3d00d6748324b6f60736a9326920b64 (patch)
tree3794ccaafbbb857a4ea2b4cd933761a9139fbef4 /sfx2
parent7d10bcb23624db11ca6445f5cb33a28660f16fd4 (diff)
tdf#108556 - Start center welcome text should respect window width
Wordwrap on second line added Change-Id: I1b50173eca4fa1c19d25291413fa0bebbcad9190 Reviewed-on: https://gerrit.libreoffice.org/52906 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Heiko Tietze <tietze.heiko@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/recentdocsview.cxx19
1 files changed, 9 insertions, 10 deletions
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx
index 0318b6bcf140..31591e3db568 100644
--- a/sfx2/source/control/recentdocsview.cxx
+++ b/sfx2/source/control/recentdocsview.cxx
@@ -346,22 +346,21 @@ void RecentDocsView::Paint(vcl::RenderContext& rRenderContext, const tools::Rect
long nTextHeight = rRenderContext.GetTextHeight();
- long nTextWidth1 = rRenderContext.GetTextWidth(maWelcomeLine1);
- long nTextWidth2 = rRenderContext.GetTextWidth(maWelcomeLine2);
-
const Size& rImgSize = maWelcomeImage.GetSizePixel();
const Size& rSize = GetSizePixel();
const int nX = (rSize.Width() - rImgSize.Width())/2;
- const int nY = (rSize.Height() - 3 * nTextHeight - rImgSize.Height())/2;
-
+ int nY = (rSize.Height() - 3 * nTextHeight - rImgSize.Height())/2;
Point aImgPoint(nX, nY);
- Point aStr1Point((rSize.Width() - nTextWidth1)/2, nY + rImgSize.Height());
- Point aStr2Point((rSize.Width() - nTextWidth2)/2, nY + rImgSize.Height() + 1.5 * nTextHeight);
-
rRenderContext.DrawImage(aImgPoint, rImgSize, maWelcomeImage);
- rRenderContext.DrawText(aStr1Point, maWelcomeLine1);
- rRenderContext.DrawText(aStr2Point, maWelcomeLine2);
+
+ nY = nY + rImgSize.Height();
+ rRenderContext.DrawText(tools::Rectangle(0, nY, rSize.Width(), nY + nTextHeight),
+ maWelcomeLine1,
+ DrawTextFlags::Center);
+ rRenderContext.DrawText(tools::Rectangle(0, nY + 1.5 * nTextHeight, rSize.Width(), rSize.Height()),
+ maWelcomeLine2,
+ DrawTextFlags::MultiLine | DrawTextFlags::WordBreak | DrawTextFlags::Center);
rRenderContext.Pop();
}