Resolves: tdf#143487 don't draw a border at all for DrawFrameStyle::NONE
Change-Id: I7794376c9475a32276d23135365c99a3f6fb7d84
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122142
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit dedb3337291c09c85262ca08bacd01e8e5901d22)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122741
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index ae147dd..be5b0d1 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1831,6 +1831,8 @@ VclScrolledWindow::VclScrolledWindow(vcl::Window *pParent)
int VclScrolledWindow::CalcBorderWidth() const
{
if (m_eDrawFrameStyle == DrawFrameStyle::NONE)
return 0;
const tools::Rectangle aRect(tools::Rectangle(Point(0, 0), Size(100, 100)));
DecorationView aDecoView(const_cast<OutputDevice*>(GetOutDev()));
// don't actually draw anything, just measure what size it would be and the diff is the desired border size to reserve
@@ -2102,6 +2104,8 @@ bool VclScrolledWindow::EventNotify(NotifyEvent& rNEvt)
void VclScrolledWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)
{
VclBin::Paint(rRenderContext, rRect);
if (m_eDrawFrameStyle == DrawFrameStyle::NONE)
return;
const tools::Rectangle aRect(tools::Rectangle(Point(0,0), GetSizePixel()));
DecorationView aDecoView(&rRenderContext);
const tools::Rectangle aContentRect = aDecoView.DrawFrame(aRect, m_eDrawFrameStyle, m_eDrawFrameFlags);