[Libreoffice-commits] core.git: sfx2/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Fri May 22 14:14:08 UTC 2020
sfx2/source/dialog/templdlg.cxx | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
New commits:
commit 7d64beb17dc46203334de53f65ef955083ce5b46
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri May 22 09:29:46 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri May 22 16:13:31 2020 +0200
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 at redhat.com>
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();
}
More information about the Libreoffice-commits
mailing list