diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-05-22 09:29:46 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-05-22 16:13:31 +0200 |
commit | 7d64beb17dc46203334de53f65ef955083ce5b46 (patch) | |
tree | 77340758c6db958b332655e3ed9da0000b923e5b /sfx2/source | |
parent | 49fc4913ba7fc4a0be2e32407205edd8f31b3172 (diff) |
Resolves: tdf#133180 use full width of canvas for preview render
Change-Id: I1fa3f0fd8505712155c72c25b67da1ab6d4753e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94660
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/dialog/templdlg.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx index 2e81c71f54ca..cd54f9290867 100644 --- a/sfx2/source/dialog/templdlg.cxx +++ b/sfx2/source/dialog/templdlg.cxx @@ -276,6 +276,7 @@ IMPL_LINK(SfxCommonTemplateDialog_Impl, CustomRenderHdl, weld::TreeView::render_ { vcl::RenderContext& rRenderContext = std::get<0>(aPayload); const ::tools::Rectangle& rRect = std::get<1>(aPayload); + ::tools::Rectangle aRect(rRect.TopLeft(), Size(rRenderContext.GetOutputSize().Width() - rRect.Left(), rRect.GetHeight())); bool bSelected = std::get<2>(aPayload); const OUString& rId = std::get<3>(aPayload); @@ -299,16 +300,16 @@ IMPL_LINK(SfxCommonTemplateDialog_Impl, CustomRenderHdl, weld::TreeView::render_ if (pStyleSheet) { rRenderContext.Push(PushFlags::ALL); - sal_Int32 nSize = rRect.GetHeight(); + sal_Int32 nSize = aRect.GetHeight(); std::unique_ptr<sfx2::StylePreviewRenderer> pStylePreviewRenderer( pStyleManager->CreateStylePreviewRenderer(rRenderContext, pStyleSheet, nSize)); - bSuccess = pStylePreviewRenderer->recalculate() && pStylePreviewRenderer->render(rRect); + bSuccess = pStylePreviewRenderer->recalculate() && pStylePreviewRenderer->render(aRect); rRenderContext.Pop(); } } if (!bSuccess) - rRenderContext.DrawText(rRect, rId, DrawTextFlags::Left | DrawTextFlags::VCenter); + rRenderContext.DrawText(aRect, rId, DrawTextFlags::Left | DrawTextFlags::VCenter); rRenderContext.Pop(); } |