summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.com>2020-05-05 01:55:37 +0530
committerDennis Francis <dennis.francis@collabora.com>2020-06-22 19:08:25 +0200
commit9faf7b5e7abe39c287f28f83fd14a364e959c881 (patch)
tree5e9795d64c36d5900d10511e271e220c33a2eb81 /desktop
parent8cd6f7ae48f5795778de512b2867a8ed3374ef12 (diff)
Introduce ITiledRenderable::getSheetGeometryData()
ITiledRenderable::getSheetGeometryData(bool bColumns, bool bRows, bool bSizes, bool bHidden, bool bFiltered, bool bGroups) and implement it for the Calc derivation (ScModelObj). The aim is to use it actively in LOOL instead of the interface: ITiledRenderable::getRowColumnHeaders(const tools::Rectangle& /*rRectangle*/) This is used by the LOOL to fetch the sheet geometry data for just the current view-area in the clients, so LOOL queries this everytime some client's view-area changes. Like the existing interface, the new one will provide all 'kinds' of sheet geometry info [col/row sizes(twips), hidden/filtered and grouping]. But the difference is, it generates data for the whole sheet (not view-area specific). So the method need not be queried every time the view area changes in the LOOL clients, and more importantly it enables the clients to locate any cell at any zoom level without any further help from the core. This means core needn't send various client(zoom) specific positioning messages in pixel aligned twips. It just can send all positioning messages in print twips uniformly to all clients. Change-Id: Ib6aee9a0c92746b1576ed244e98cb54b572778c0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96892 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx67
1 files changed, 67 insertions, 0 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 67ce622436ee..b1732dc1bbea 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -4825,6 +4825,7 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo
OString aCommand(pCommand);
static const OString aViewRowColumnHeaders(".uno:ViewRowColumnHeaders");
+ static const OString aSheetGeometryData(".uno:SheetGeometryData");
static const OString aCellCursor(".uno:CellCursor");
static const OString aFontSubset(".uno:FontSubset&name=");
@@ -4922,6 +4923,72 @@ static char* doc_getCommandValues(LibreOfficeKitDocument* pThis, const char* pCo
else
return convertOUString(aHeaders);
}
+ else if (aCommand.startsWith(aSheetGeometryData))
+ {
+ ITiledRenderable* pDoc = getTiledRenderable(pThis);
+ if (!pDoc)
+ {
+ SetLastExceptionMsg("Document doesn't support tiled rendering");
+ return nullptr;
+ }
+
+ bool bColumns = true;
+ bool bRows = true;
+ bool bSizes = true;
+ bool bHidden = true;
+ bool bFiltered = true;
+ bool bGroups = true;
+ if (aCommand.getLength() > aSheetGeometryData.getLength())
+ {
+ bColumns = bRows = bSizes = bHidden = bFiltered = bGroups = false;
+
+ OString aArguments = aCommand.copy(aSheetGeometryData.getLength() + 1);
+ sal_Int32 nParamIndex = 0;
+ do
+ {
+ OString aParamToken = aArguments.getToken(0, '&', nParamIndex);
+ sal_Int32 nIndex = 0;
+ OString aKey;
+ OString aValue;
+ do
+ {
+ OString aToken = aParamToken.getToken(0, '=', nIndex);
+ if (!aKey.getLength())
+ aKey = aToken;
+ else
+ aValue = aToken;
+
+ } while (nIndex >= 0);
+
+ bool bEnableFlag = aValue.isEmpty() ||
+ aValue.equalsIgnoreAsciiCase("true") || aValue.toInt32() > 0;
+ if (!bEnableFlag)
+ continue;
+
+ if (aKey == "columns")
+ bColumns = true;
+ else if (aKey == "rows")
+ bRows = true;
+ else if (aKey == "sizes")
+ bSizes = true;
+ else if (aKey == "hidden")
+ bHidden = true;
+ else if (aKey == "filtered")
+ bFiltered = true;
+ else if (aKey == "groups")
+ bGroups = true;
+
+ } while (nParamIndex >= 0);
+ }
+
+ OString aGeomDataStr
+ = pDoc->getSheetGeometryData(bColumns, bRows, bSizes, bHidden, bFiltered, bGroups);
+
+ if (aGeomDataStr.isEmpty())
+ return nullptr;
+
+ return convertOString(aGeomDataStr);
+ }
else if (aCommand.startsWith(aCellCursor))
{
ITiledRenderable* pDoc = getTiledRenderable(pThis);