summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-07-22 14:20:33 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-07-22 14:37:39 +0100
commit13807fbf9f3a4aae6767da8bcf796bea4b065159 (patch)
tree91f3900efea5cbd821881a6cbc24e02074e30543 /vcl
parent15eb6b2e0161125e36357afcf64d27a9ca5c9d22 (diff)
Related: fdo#81457 skip setting an empty allocation
if the dimension is 0, don't bother calculating a bunch of <= 0 sizes, rely on the parents clipping to hide the lot instead Change-Id: I5b593a5b6b6c3614beb7f9bf3328fa469b700972
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/tabpage.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/vcl/source/window/tabpage.cxx b/vcl/source/window/tabpage.cxx
index 5e5526d6607d..f69258eb14b5 100644
--- a/vcl/source/window/tabpage.cxx
+++ b/vcl/source/window/tabpage.cxx
@@ -199,22 +199,25 @@ Size TabPage::GetOptimalSize() const
void TabPage::SetPosSizePixel(const Point& rAllocPos, const Size& rAllocation)
{
Window::SetPosSizePixel(rAllocPos, rAllocation);
- if (isLayoutEnabled(this))
+ if (isLayoutEnabled(this) && rAllocation.Width() && rAllocation.Height())
VclContainer::setLayoutAllocation(*GetWindow(WINDOW_FIRSTCHILD), Point(0, 0), rAllocation);
}
void TabPage::SetSizePixel(const Size& rAllocation)
{
Window::SetSizePixel(rAllocation);
- if (isLayoutEnabled(this))
+ if (isLayoutEnabled(this) && rAllocation.Width() && rAllocation.Height())
VclContainer::setLayoutAllocation(*GetWindow(WINDOW_FIRSTCHILD), Point(0, 0), rAllocation);
}
void TabPage::SetPosPixel(const Point& rAllocPos)
{
Window::SetPosPixel(rAllocPos);
- if (isLayoutEnabled(this))
- VclContainer::setLayoutAllocation(*GetWindow(WINDOW_FIRSTCHILD), Point(0, 0), GetOutputSizePixel());
+ Size aAllocation(GetOutputSizePixel());
+ if (isLayoutEnabled(this) && aAllocation.Width() && aAllocation.Height())
+ {
+ VclContainer::setLayoutAllocation(*GetWindow(WINDOW_FIRSTCHILD), Point(0, 0), aAllocation);
+ }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */