[Libreoffice-commits] core.git: svx/inc svx/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Wed Aug 5 15:59:00 UTC 2020
svx/inc/CommonStylePreviewRenderer.hxx | 2 ++
svx/source/styles/CommonStylePreviewRenderer.cxx | 12 ++++++++++++
2 files changed, 14 insertions(+)
New commits:
commit 2f6728f88cb895d7bfe185185ace30327b23e8ed
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Aug 5 15:50:31 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Aug 5 17:58:10 2020 +0200
tdf#135438 Paragraph styles preview in sidebar are clipped
since...
commit fe9a13dc0e6d1384416c2a2343223b33925fc925
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Apr 26 15:43:25 2020 +0100
weld SfxTemplatePanelControl
getRenderSize used to be called after recalculate and before
render to change maSizePixel
Change-Id: Ifc1b6b0b3399c7de61d5f4d46f8346d13e72a4d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100178
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/svx/inc/CommonStylePreviewRenderer.hxx b/svx/inc/CommonStylePreviewRenderer.hxx
index 55391327533e..5dfd41faa39a 100644
--- a/svx/inc/CommonStylePreviewRenderer.hxx
+++ b/svx/inc/CommonStylePreviewRenderer.hxx
@@ -31,6 +31,8 @@ class CommonStylePreviewRenderer final : public sfx2::StylePreviewRenderer
Size maPixelSize;
OUString maStyleName;
+ Size getRenderSize() const;
+
public:
CommonStylePreviewRenderer(const SfxObjectShell& rShell, OutputDevice& rOutputDev,
SfxStyleSheetBase* pStyle, long nMaxHeight);
diff --git a/svx/source/styles/CommonStylePreviewRenderer.cxx b/svx/source/styles/CommonStylePreviewRenderer.cxx
index d677a135461e..9920903df469 100644
--- a/svx/source/styles/CommonStylePreviewRenderer.cxx
+++ b/svx/source/styles/CommonStylePreviewRenderer.cxx
@@ -168,9 +168,21 @@ bool CommonStylePreviewRenderer::recalculate()
}
m_pFont = std::move(pFont);
+ maPixelSize = getRenderSize();
return true;
}
+Size CommonStylePreviewRenderer::getRenderSize() const
+{
+ assert(m_pFont);
+ Size aPixelSize = m_pFont->GetTextSize(&mrOutputDev, maStyleName);
+
+ if (aPixelSize.Height() > mnMaxHeight)
+ aPixelSize.setHeight( mnMaxHeight );
+
+ return aPixelSize;
+}
+
bool CommonStylePreviewRenderer::render(const tools::Rectangle& aRectangle, RenderAlign eRenderAlign)
{
const OUString& rText = maStyleName;
More information about the Libreoffice-commits
mailing list