summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;