summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/gridwin4.cxx
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.com>2023-01-25 13:51:17 +0530
committerDennis Francis <dennis.francis@collabora.com>2023-04-27 08:35:59 +0200
commit2f8d10b0b9baa03b8a713e9fd1342fe6c8094fb4 (patch)
treef008321e237e02ca032178711e27a16969718312 /sc/source/ui/view/gridwin4.cxx
parent292f422c421336c43bafe5ee048832137d617436 (diff)
sc: pivot table compact layout
This implements compact layout for pivot tables. In ooxml each row field can have a compact layout setting. Support for any such "mixed" layout of tabular/outline/compact per field is also implemented. This also implements expand/collpse toggle buttons to field labels to make pivot tables with compact layout more usable. Such buttons are also available if other layouts are used. Conflicts: sc/qa/unit/pivottable_filters_test.cxx sc/source/ui/cctrl/checklistmenu.cxx sc/source/ui/inc/checklistmenu.hxx Change-Id: Ieaa1f3bd282ebdec804d0b45a0af7b3d95a2027f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151057 Tested-by: Jenkins Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
Diffstat (limited to 'sc/source/ui/view/gridwin4.cxx')
-rw-r--r--sc/source/ui/view/gridwin4.cxx16
1 files changed, 13 insertions, 3 deletions
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index fa78ad78312e..16d37447072d 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -2176,7 +2176,7 @@ void ScGridWindow::DrawButtons(SCCOL nX1, SCCOL nX2, const ScTableInfo& rTabInfo
}
}
- if ( pRowInfo[nArrY].bPivotButton && pRowInfo[nArrY].bChanged )
+ if ( (pRowInfo[nArrY].bPivotToggle || pRowInfo[nArrY].bPivotButton) && pRowInfo[nArrY].bChanged )
{
RowInfo* pThisRowInfo = &pRowInfo[nArrY];
nRow = pThisRowInfo->nRowNo;
@@ -2194,12 +2194,22 @@ void ScGridWindow::DrawButtons(SCCOL nX1, SCCOL nX2, const ScTableInfo& rTabInfo
tools::Long nPosY = aScrPos.Y();
// bLayoutRTL is handled in setBoundingBox
- OUString aStr = rDoc.GetString(nCol, nRow, nTab);
- aCellBtn.setText(aStr);
+ bool bDrawToggle = pInfo->bPivotCollapseButton || pInfo->bPivotExpandButton;
+ if (!bDrawToggle)
+ {
+ OUString aStr = rDoc.GetString(nCol, nRow, nTab);
+ aCellBtn.setText(aStr);
+ }
+
+ sal_uInt16 nIndent = 0;
+ if (const ScIndentItem* pIndentItem = rDoc.GetAttr(nCol, nRow, nTab, ATTR_INDENT))
+ nIndent = pIndentItem->GetValue();
aCellBtn.setBoundingBox(Point(nPosX, nPosY), Size(nSizeX-1, nSizeY-1), bLayoutRTL);
aCellBtn.setPopupLeft(false); // DataPilot popup is always right-aligned for now
aCellBtn.setDrawBaseButton(pInfo->bPivotButton);
aCellBtn.setDrawPopupButton(pInfo->bPivotPopupButton);
+ aCellBtn.setDrawPopupButtonMulti(pInfo->bPivotPopupButtonMulti);
+ aCellBtn.setDrawToggleButton(bDrawToggle, pInfo->bPivotCollapseButton, nIndent);
aCellBtn.setHasHiddenMember(pInfo->bFilterActive);
aCellBtn.draw();
}