diff options
author | Gulsah Kose <gulsah.1004@gmail.com> | 2017-03-14 15:35:26 +0300 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-05-05 00:13:13 +0200 |
commit | 9691f2652f157f375881aea3bf5e39d72a133e0f (patch) | |
tree | 004315d3e3b16330a9e1326ab33cf8524d4c1d88 | |
parent | 87a5be1cb579cb1e215c39990986c0a770c18b50 (diff) |
tdf#95885 Add new toolbar and toggle icons for Cell Protection
Change-Id: Ib0d7f2a8cc07988d27f5cf96e5c57727ad1eca71
Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/35218
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
-rw-r--r-- | icon-themes/breeze/links.txt | 3 | ||||
-rw-r--r-- | icon-themes/breeze_dark/links.txt | 3 | ||||
-rw-r--r-- | icon-themes/elementary/links.txt | 2 | ||||
-rw-r--r-- | icon-themes/galaxy/links.txt | 2 | ||||
-rw-r--r-- | icon-themes/tango/links.txt | 3 | ||||
-rw-r--r-- | officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu | 8 | ||||
-rw-r--r-- | sc/inc/sc.hrc | 1 | ||||
-rw-r--r-- | sc/sdi/formatsh.sdi | 1 | ||||
-rw-r--r-- | sc/sdi/scalc.sdi | 18 | ||||
-rw-r--r-- | sc/source/ui/view/formatsh.cxx | 27 | ||||
-rw-r--r-- | sc/source/ui/view/tabview3.cxx | 2 | ||||
-rw-r--r-- | sc/uiconfig/scalc/toolbar/formatobjectbar.xml | 1 |
12 files changed, 71 insertions, 0 deletions
diff --git a/icon-themes/breeze/links.txt b/icon-themes/breeze/links.txt index 652711c99e75..79a3d7e75062 100644 --- a/icon-themes/breeze/links.txt +++ b/icon-themes/breeze/links.txt @@ -1361,3 +1361,6 @@ cmd/lc_columnoperations.png cmd/lc_entirecolumn.png cmd/sc_columnoperations.png cmd/sc_entirecolumn.png cmd/lc_rowoperations.png cmd/lc_entirerow.png cmd/sc_rowoperations.png cmd/sc_entirerow.png + +cmd/sc_cellprotection.png cmd/sc_protect.png +cmd/lc_cellprotection.png cmd/lc_protect.png diff --git a/icon-themes/breeze_dark/links.txt b/icon-themes/breeze_dark/links.txt index c8af3adff72f..56dbccf6bce5 100644 --- a/icon-themes/breeze_dark/links.txt +++ b/icon-themes/breeze_dark/links.txt @@ -1360,3 +1360,6 @@ cmd/lc_columnoperations.png cmd/lc_entirecolumn.png cmd/sc_columnoperations.png cmd/sc_entirecolumn.png cmd/lc_rowoperations.png cmd/lc_entirerow.png cmd/sc_rowoperations.png cmd/sc_entirerow.png + +cmd/sc_cellprotection.png cmd/sc_protect.png +cmd/lc_cellprotection.png cmd/lc_protect.png diff --git a/icon-themes/elementary/links.txt b/icon-themes/elementary/links.txt index 247a0a39abb6..8232190685dc 100644 --- a/icon-themes/elementary/links.txt +++ b/icon-themes/elementary/links.txt @@ -668,3 +668,5 @@ cmd/lc_columnoperations.png cmd/lc_entirecolumn.png cmd/sc_columnoperations.png cmd/sc_entirecolumn.png cmd/lc_rowoperations.png cmd/lc_entirerow.png cmd/sc_rowoperations.png cmd/sc_entirerow.png + +cmd/sc_cellprotection.png cmd/sc_protect.png diff --git a/icon-themes/galaxy/links.txt b/icon-themes/galaxy/links.txt index c6113afc67c7..a401ae66c0e0 100644 --- a/icon-themes/galaxy/links.txt +++ b/icon-themes/galaxy/links.txt @@ -148,3 +148,5 @@ cmd/lc_columnoperations.png cmd/lc_entirecolumn.png cmd/sc_columnoperations.png cmd/sc_entirecolumn.png cmd/lc_rowoperations.png cmd/lc_entirerow.png cmd/sc_rowoperations.png cmd/sc_entirerow.png + +cmd/sc_cellprotection.png cmd/sc_protect.png diff --git a/icon-themes/tango/links.txt b/icon-themes/tango/links.txt index 272425875a99..54ecb6575daf 100644 --- a/icon-themes/tango/links.txt +++ b/icon-themes/tango/links.txt @@ -601,3 +601,6 @@ cmd/lc_columnoperations.png cmd/lc_entirecolumn.png cmd/sc_columnoperations.png cmd/sc_entirecolumn.png cmd/lc_rowoperations.png cmd/lc_entirerow.png cmd/sc_rowoperations.png cmd/sc_entirerow.png + +cmd/sc_cellprotection.png cmd/sc_protect.png +cmd/lc_cellprotection.png cmd/lc_protect.png diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu index 6c0ebf974d89..a558ff951111 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu @@ -610,6 +610,14 @@ <value>1</value> </prop> </node> + <node oor:name=".uno:CellProtection" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Cell Protection</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>9</value> + </prop> + </node> <node oor:name=".uno:DefinePrintArea" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> <value xml:lang="en-US">Print Area</value> diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index aa32f3c66a42..db37b7729ac2 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -644,6 +644,7 @@ #define FID_SHOW_ALL_NOTES (SID_NEW_SLOTS+102) #define FID_HIDE_ALL_NOTES (SID_NEW_SLOTS+103) #define FID_DELETE_ALL_NOTES (SID_NEW_SLOTS+104) +#define SID_SCATTR_CELLPROTECTION (SID_NEW_SLOTS+105) // idl parameter diff --git a/sc/sdi/formatsh.sdi b/sc/sdi/formatsh.sdi index cb2a76cb57da..3663955aadfa 100644 --- a/sc/sdi/formatsh.sdi +++ b/sc/sdi/formatsh.sdi @@ -76,6 +76,7 @@ interface FormatForSelection SID_ALIGN_ANY_VDEFAULT [ ExecMethod = ExecuteAlignment; StateMethod = GetAlignState; ] SID_SCATTR_PROTECTION [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; ] + SID_SCATTR_CELLPROTECTION [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; ] SID_BACKGROUND_COLOR [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; ] SID_ATTR_BRUSH [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; ] SID_ATTR_CHAR_OVERLINE [ ExecMethod = ExecuteAttr; StateMethod = GetAttrState; ] diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi index 68d63700c0b3..dff77d40c255 100644 --- a/sc/sdi/scalc.sdi +++ b/sc/sdi/scalc.sdi @@ -6109,6 +6109,24 @@ ScProtectionAttr Protection SID_SCATTR_PROTECTION ] +SfxBoolItem CellProtection SID_SCATTR_CELLPROTECTION + +[ + AutoUpdate = FALSE, + FastCall = TRUE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + + AccelConfig = TRUE, + MenuConfig = TRUE, + ToolBoxConfig = TRUE, + GroupId = GID_FORMAT; +] + + SfxVoidItem SelectArrayFormula SID_MARKARRAYFORMULA () [ diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index b55f25186ea3..259338a37ab4 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -73,6 +73,7 @@ #include "undostyl.hxx" #include "markdata.hxx" #include "markarr.hxx" +#include "attrib.hxx" #define ScFormatShell #define TableFont @@ -1719,6 +1720,26 @@ void ScFormatShell::ExecuteAttr( SfxRequest& rReq ) rBindings.Invalidate( nSlot ); } break; + + case SID_SCATTR_CELLPROTECTION: // without parameter as toggle + { + const ScPatternAttr* pAttrs = pTabViewShell->GetSelectionPattern(); + bool bProtect = static_cast<const ScProtectionAttr&>(pAttrs->GetItem(ATTR_PROTECTION)).GetProtection(); + bool bHideFormula = static_cast<const ScProtectionAttr&>(pAttrs->GetItem(ATTR_PROTECTION)).GetHideFormula(); + bool bHideCell = static_cast<const ScProtectionAttr&>(pAttrs->GetItem(ATTR_PROTECTION)).GetHideCell(); + bool bHidePrint = static_cast<const ScProtectionAttr&>(pAttrs->GetItem(ATTR_PROTECTION)).GetHidePrint(); + + ScProtectionAttr aProtectionItem( !bProtect, bHideFormula, bHideCell, bHidePrint ); + pTabViewShell->ApplyAttr( aProtectionItem ); + + SfxAllItemSet aNewSet( GetPool() ); + aNewSet.Put( aProtectionItem, aProtectionItem.Which()); + aNewSet.Put( SfxBoolItem( SID_SCATTR_CELLPROTECTION, !bProtect ) ); + rReq.Done( aNewSet ); + + rBindings.Invalidate( nSlot ); + } + break; } } else @@ -2197,6 +2218,12 @@ void ScFormatShell::GetAttrState( SfxItemSet& rSet ) rSet.Put( *pNewItem ); } break; + case SID_SCATTR_CELLPROTECTION: + { + bool bProtect = static_cast<const ScProtectionAttr&>(rAttrSet.Get( ATTR_PROTECTION )).GetProtection(); + rSet.Put( SfxBoolItem(SID_SCATTR_CELLPROTECTION, bProtect) ); + } + break; } nWhich = aIter.NextWhich(); } diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index fb1f35d5c35d..6a1087c6b135 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -278,6 +278,8 @@ void ScTabView::InvalidateAttribs() rBindings.Invalidate( SID_ALIGNBOTTOM ); rBindings.Invalidate( SID_ALIGNCENTERVER ); + rBindings.Invalidate( SID_SCATTR_CELLPROTECTION ); + // stuff for sidebar panels { rBindings.Invalidate( SID_H_ALIGNCELL ); diff --git a/sc/uiconfig/scalc/toolbar/formatobjectbar.xml b/sc/uiconfig/scalc/toolbar/formatobjectbar.xml index 800db8db56cf..3707ab952533 100644 --- a/sc/uiconfig/scalc/toolbar/formatobjectbar.xml +++ b/sc/uiconfig/scalc/toolbar/formatobjectbar.xml @@ -65,6 +65,7 @@ <toolbar:toolbaritem xlink:href=".uno:IncrementIndent"/> <toolbar:toolbaritem xlink:href=".uno:DecrementIndent"/> <toolbar:toolbarseparator/> + <toolbar:toolbaritem xlink:href=".uno:CellProtection"/> <toolbar:toolbaritem xlink:href=".uno:SetBorderStyle"/> <toolbar:toolbaritem xlink:href=".uno:LineStyle"/> <toolbar:toolbaritem xlink:href=".uno:FrameLineColor"/> |