Kaydet (Commit) 45cb9295 authored tarafından Caolán McNamara's avatar Caolán McNamara

keep empty spanned rows/cols for homogeneous grids

Change-Id: I5560ae291cd5bf9e5f57a5bad5ecdfe7a6cd0bb8
üst 22d1beb7
......@@ -774,64 +774,80 @@ VclGrid::array_type VclGrid::assembleGrid() const
if (pChild && pChild->IsVisible())
{
aNonEmptyCols[x] = true;
if (get_column_homogeneous())
{
for (sal_Int32 nSpanX = 1; nSpanX < rEntry.nSpanWidth; ++nSpanX)
aNonEmptyCols[x+1] = true;
}
aNonEmptyRows[y] = true;
if (get_row_homogeneous())
{
for (sal_Int32 nSpanY = 1; nSpanY < rEntry.nSpanHeight; ++nSpanY)
aNonEmptyRows[x+1] = true;
}
}
}
}
//reduce the spans of elements that span empty columns
for (sal_Int32 x = 0; x < nMaxX; ++x)
if (!get_column_homogeneous())
{
std::set<ExtendedGridEntry*> candidates;
for (sal_Int32 y = 0; y < nMaxY; ++y)
//reduce the spans of elements that span empty columns
for (sal_Int32 x = 0; x < nMaxX; ++x)
{
if (aNonEmptyCols[x])
continue;
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))
std::set<ExtendedGridEntry*> candidates;
for (sal_Int32 y = 0; y < nMaxY; ++y)
{
//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;
if (aNonEmptyCols[x])
continue;
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];
candidates.insert(&rEntry);
}
for (std::set<ExtendedGridEntry*>::iterator aI = candidates.begin(), aEnd = candidates.end();
aI != aEnd; ++aI)
{
ExtendedGridEntry *pEntry = *aI;
--pEntry->nSpanWidth;
}
ExtendedGridEntry &rEntry = A[rSpan.x][rSpan.y];
candidates.insert(&rEntry);
}
for (std::set<ExtendedGridEntry*>::iterator aI = candidates.begin(), aEnd = candidates.end();
aI != aEnd; ++aI)
{
ExtendedGridEntry *pEntry = *aI;
--pEntry->nSpanWidth;
}
}
//reduce the spans of elements that span empty rows
for (sal_Int32 y = 0; y < nMaxY; ++y)
if (!get_row_homogeneous())
{
std::set<ExtendedGridEntry*> candidates;
for (sal_Int32 x = 0; x < nMaxX; ++x)
//reduce the spans of elements that span empty rows
for (sal_Int32 y = 0; y < nMaxY; ++y)
{
if (aNonEmptyRows[y])
continue;
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))
std::set<ExtendedGridEntry*> candidates;
for (sal_Int32 x = 0; x < nMaxX; ++x)
{
//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;
if (aNonEmptyRows[y])
continue;
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];
candidates.insert(&rEntry);
}
for (std::set<ExtendedGridEntry*>::iterator aI = candidates.begin(), aEnd = candidates.end();
aI != aEnd; ++aI)
{
ExtendedGridEntry *pEntry = *aI;
--pEntry->nSpanHeight;
}
ExtendedGridEntry &rEntry = A[rSpan.x][rSpan.y];
candidates.insert(&rEntry);
}
for (std::set<ExtendedGridEntry*>::iterator aI = candidates.begin(), aEnd = candidates.end();
aI != aEnd; ++aI)
{
ExtendedGridEntry *pEntry = *aI;
--pEntry->nSpanHeight;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment