Skip to content

Commit 7c010b2

Browse files
committed
#1756 Remove qan::TableGroupItem::polishLayout().
Polish table item layout code. Still WIP, but working. Signed-off-by: cneben <[email protected]>
1 parent 3d973a2 commit 7c010b2

File tree

2 files changed

+1
-29
lines changed

2 files changed

+1
-29
lines changed

src/qanTableGroupItem.cpp

+1-22
Original file line numberDiff line numberDiff line change
@@ -412,10 +412,6 @@ void TableGroupItem::layoutTable()
412412
{
413413
if (!isEnabled())
414414
return; // Note 20240830: prevent spurious layouts during serialization (see hlg::TableGroup::serializeFromJson()).
415-
// Adapt to a new (width, height), keep previous rows/columns ratio
416-
// New position is:
417-
// x = previousX * (actualWidth / previousWidth)
418-
// y = previousY * (actualHeight / previousHeight)
419415
const auto tableContainer = getContainer();
420416
if (tableContainer == nullptr)
421417
return;
@@ -432,12 +428,10 @@ void TableGroupItem::layoutTable()
432428
qWarning() << "TableGroupItem::layoutTable(): " << getGroup()->getLabel() <<
433429
" tableWidth=" << tableWidth << "tableHeight=" << tableHeight;
434430

431+
// Project normalized sx/sy coordinates to table item container CS.
435432
for (const auto verticalBorder: _verticalBorders) {
436433
if (verticalBorder == nullptr)
437434
continue;
438-
// FIXME #1756
439-
//const auto previousX = verticalBorder->x();
440-
//verticalBorder->setX((previousX / _previousSize.width()) * tableWidth);
441435
verticalBorder->setX(verticalBorder->getSx() * tableWidth);
442436
verticalBorder->setY(0.);
443437
verticalBorder->setHeight(tableHeight);
@@ -447,28 +441,13 @@ void TableGroupItem::layoutTable()
447441
if (horizontalBorder == nullptr)
448442
continue;
449443
horizontalBorder->setX(0.);
450-
// FIXME #1756
451-
//const auto previousY = horizontalBorder->y();
452-
//horizontalBorder->setY((previousY / _previousSize.height()) * tableHeight);
453444
horizontalBorder->setY(horizontalBorder->getSy() * tableHeight);
454445
horizontalBorder->setWidth(tableWidth);
455446
}
456447

457448
layoutCells();
458449
}
459450

460-
void TableGroupItem::polishTable()
461-
{
462-
// FIXME #1756 no longer necessary ????
463-
464-
if (!isEnabled())
465-
return; // Note 20240830: prevent spurious layouts during serialization (see hlg::TableGroup::serializeFromJson()).
466-
const auto tableContainer = getContainer();
467-
if (tableContainer == nullptr)
468-
return;
469-
layoutCells();
470-
}
471-
472451
void TableGroupItem::layoutCells()
473452
{
474453
//qWarning() << "qan::TableGroupItem::layoutCells()";

src/qanTableGroupItem.h

-7
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,6 @@ public slots:
9696
//! Layout current cell after a table geometry change.
9797
void layoutTable();
9898

99-
/*! Layout cells and polish table (ie activate necessary bindings for table resizing).
100-
* This method could be used _after_ serialization of a table when
101-
* group content item is still unsure: it is safer than a complete
102-
* call to layoutTable(). Note: call layoutCells().
103-
*/
104-
void polishTable();
105-
10699
//! Layout table cells, triggered when table style change.
107100
void layoutCells();
108101

0 commit comments

Comments
 (0)