summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-10-12 12:50:56 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-10-12 12:51:35 +0100
commit12a971118f732858bd288e6fd5b38b17b7c560e8 (patch)
tree803a0dbbb0092c8d2800fb2aad67c27880716002
parent6b459bf06c10ee05ff1b6d5db8c3e30fa2774a9e (diff)
don't process empty grid cells
Change-Id: Ibd8ea6a40ced219c5f64d1c04df28b85c99a00bb
-rw-r--r--vcl/inc/vcl/layout.hxx4
-rw-r--r--vcl/source/window/layout.cxx8
2 files changed, 10 insertions, 2 deletions
diff --git a/vcl/inc/vcl/layout.hxx b/vcl/inc/vcl/layout.hxx
index 5e22537b73eb..43fc7a9c60bd 100644
--- a/vcl/inc/vcl/layout.hxx
+++ b/vcl/inc/vcl/layout.hxx
@@ -315,8 +315,8 @@ private:
int x;
int y;
ExtendedGridEntry()
- : x(0)
- , y(0)
+ : x(-1)
+ , y(-1)
{
}
};
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 836b6a802688..8336a08055ed 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -427,6 +427,14 @@ VclGrid::array_type VclGrid::assembleGrid() const
for (sal_Int32 y = 0; y < nMaxY; ++y)
{
ExtendedGridEntry &rSpan = A[x][y];
+ //cell x/y is spanned by the widget at cell rSpan.x/rSpan.y,
+ //just points back to itself if there's no cell spanning
+ if ((rSpan.x == -1) || (rSpan.y == -1))
+ {
+ //there is no entry for this cell, i.e. this is a cell
+ //with no widget in it, or spanned by any other widget
+ continue;
+ }
ExtendedGridEntry &rEntry = A[rSpan.x][rSpan.y];
if (aNonEmptyCols[x] == false)
--rEntry.nSpanWidth;