diff options
author | Noel <noel.grandin@collabora.co.uk> | 2021-03-26 13:35:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-03-26 18:02:19 +0100 |
commit | b624b13b3d5a8e573c7de8158cadc66b1982d157 (patch) | |
tree | 56948e6a5e8d7f5a7cbde6328a27f13ecd8a72bc /sfx2/source/control | |
parent | 8136620ff432bf17815bef1f88c7531edb839d23 (diff) |
loplugin:flatten
Change-Id: Ib7a895fba66f8dc9b6501e61631c02694053b7fc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113157
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/control')
-rw-r--r-- | sfx2/source/control/recentdocsview.cxx | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/sfx2/source/control/recentdocsview.cxx b/sfx2/source/control/recentdocsview.cxx index ca822d0c3487..137591a43991 100644 --- a/sfx2/source/control/recentdocsview.cxx +++ b/sfx2/source/control/recentdocsview.cxx @@ -356,39 +356,39 @@ void RecentDocsView::Paint(vcl::RenderContext& rRenderContext, const tools::Rect { ThumbnailView::Paint(rRenderContext, aRect); - if (mItemList.empty()) + if (!mItemList.empty()) + return; + + if (maWelcomeImage.IsEmpty()) { - if (maWelcomeImage.IsEmpty()) - { - const tools::Long aWidth(aRect.GetWidth() > aRect.getHeight() ? aRect.GetHeight()/2 : aRect.GetWidth()/2); - maWelcomeImage = SfxApplication::GetApplicationLogo(aWidth); - } + const tools::Long aWidth(aRect.GetWidth() > aRect.getHeight() ? aRect.GetHeight()/2 : aRect.GetWidth()/2); + maWelcomeImage = SfxApplication::GetApplicationLogo(aWidth); + } - // No recent files to be shown yet. Show a welcome screen. - rRenderContext.Push(PushFlags::FONT | PushFlags::TEXTCOLOR); - SetMessageFont(rRenderContext); - rRenderContext.SetTextColor(maTextColor); + // No recent files to be shown yet. Show a welcome screen. + rRenderContext.Push(PushFlags::FONT | PushFlags::TEXTCOLOR); + SetMessageFont(rRenderContext); + rRenderContext.SetTextColor(maTextColor); - tools::Long nTextHeight = rRenderContext.GetTextHeight(); + tools::Long nTextHeight = rRenderContext.GetTextHeight(); - const Size& rImgSize = maWelcomeImage.GetSizePixel(); - const Size& rSize = GetOutputSizePixel(); + const Size& rImgSize = maWelcomeImage.GetSizePixel(); + const Size& rSize = GetOutputSizePixel(); - const int nX = (rSize.Width() - rImgSize.Width())/2; - int nY = (rSize.Height() - 3 * nTextHeight - rImgSize.Height())/2; - Point aImgPoint(nX, nY); - rRenderContext.DrawBitmapEx(aImgPoint, rImgSize, maWelcomeImage); + const int nX = (rSize.Width() - rImgSize.Width())/2; + int nY = (rSize.Height() - 3 * nTextHeight - rImgSize.Height())/2; + Point aImgPoint(nX, nY); + rRenderContext.DrawBitmapEx(aImgPoint, rImgSize, maWelcomeImage); - nY = nY + rImgSize.Height(); - rRenderContext.DrawText(tools::Rectangle(0, nY + 1 * nTextHeight, rSize.Width(), nY + nTextHeight), - maWelcomeLine1, - DrawTextFlags::Center); - rRenderContext.DrawText(tools::Rectangle(0, nY + 2 * nTextHeight, rSize.Width(), rSize.Height()), - maWelcomeLine2, - DrawTextFlags::MultiLine | DrawTextFlags::WordBreak | DrawTextFlags::Center); + nY = nY + rImgSize.Height(); + rRenderContext.DrawText(tools::Rectangle(0, nY + 1 * nTextHeight, rSize.Width(), nY + nTextHeight), + maWelcomeLine1, + DrawTextFlags::Center); + rRenderContext.DrawText(tools::Rectangle(0, nY + 2 * nTextHeight, rSize.Width(), rSize.Height()), + maWelcomeLine2, + DrawTextFlags::MultiLine | DrawTextFlags::WordBreak | DrawTextFlags::Center); - rRenderContext.Pop(); - } + rRenderContext.Pop(); } void RecentDocsView::LoseFocus() |