summaryrefslogtreecommitdiff
path: root/offapi
diff options
context:
space:
mode:
authorRafael Lima <rafael.palma.lima@gmail.com>2023-08-14 00:34:43 +0200
committerTomaž Vajngerl <quikee@gmail.com>2023-10-01 13:01:32 +0200
commit8938bc703980e3bdf4a32863f3e0193302a08cde (patch)
tree48ea2e72a2cf6e30e37e9667e071ba09249f09d5 /offapi
parenteb68c77168db379d9d805a221a30581962040afb (diff)
tdf#154449 Add support for hidden named ranges
This patch adds the possibility of having "hidden" named ranges in Calc, in a way similar to what MS Excel has (i.e. they're not visible in the UI and can only be hidden/shown via scripting). This is done by creating a new HIDDEN flag in com.sun.star.sheet.NamedRangeFlag. Hence thia patch makes it so that named ranges can be made hidden/visible via scripting. For instance, consider a Calc document with a named range "NamedRange1". The following scripts hides "NamedRange1" from the UI (i.e. it's no longer visible in the Manage Names dialog): Sub SetHidden Dim eFlags : eFlags = com.sun.star.sheet.NamedRangeFlag aNamedRange = ThisComponent.NamedRanges.getByName("NamedRange1") nType = aNamedRange.getType() Or eFlags.HIDDEN aNamedRange.setType(nType) End Sub To make the named range visible again: Sub RemoveHidden Dim eFlags : eFlags = com.sun.star.sheet.NamedRangeFlag aNamedRange = ThisComponent.NamedRanges.getByName("NamedRange1") nType = aNamedRange.getType() nType = nType - (aNamedRange.getType() And eFlags.HIDDEN) aNamedRange.setType(nType) End Sub This patch also implements ODS and OOX import/export, as well as QA tests. Change-Id: I10efe46938fe772b87dc17fc597cb83648b5efb2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155599 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'offapi')
-rw-r--r--offapi/com/sun/star/sheet/NamedRangeFlag.idl7
1 files changed, 7 insertions, 0 deletions
diff --git a/offapi/com/sun/star/sheet/NamedRangeFlag.idl b/offapi/com/sun/star/sheet/NamedRangeFlag.idl
index 3c42431cb992..5addc08ad561 100644
--- a/offapi/com/sun/star/sheet/NamedRangeFlag.idl
+++ b/offapi/com/sun/star/sheet/NamedRangeFlag.idl
@@ -45,6 +45,13 @@ published constants NamedRangeFlag
*/
const long ROW_HEADER = 8;
+
+ /** The range is hidden from the user interface
+
+ @since LibreOffice 24.2
+ */
+ const long HIDDEN = 16;
+
};