summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2018-10-18 21:09:12 +0200
committerXisco Faulí <xiscofauli@libreoffice.org>2018-11-16 13:43:19 +0100
commitda6c0638507aec8c9e8be2b8f63140136f1bff1d (patch)
treec9e032eeeb99b517e8ecbbc372dfb963f9cd0d36 /sc
parent277e9c5159635d131502372ff4f9cf719e7d3845 (diff)
tdf#107240 tdf#120432 Disable time/date entries in read-only/protected mode
Change-Id: Ia3c757fa094f17be3b4aadaee65c4699bf0c1cb1 Reviewed-on: https://gerrit.libreoffice.org/61953 Tested-by: Jenkins Reviewed-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 525ed5d1fcb89412f0b80be0b1e35410b048c337) Reviewed-on: https://gerrit.libreoffice.org/63452 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
Diffstat (limited to 'sc')
-rw-r--r--sc/sdi/scalc.sdi6
-rw-r--r--sc/source/ui/view/cellsh.cxx9
2 files changed, 12 insertions, 3 deletions
diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi
index e3a60c21951c..271bdd17fa08 100644
--- a/sc/sdi/scalc.sdi
+++ b/sc/sdi/scalc.sdi
@@ -3073,7 +3073,7 @@ SfxVoidItem InsertObjectStarMath SID_INSERT_SMATH
[
AutoUpdate = FALSE,
FastCall = FALSE,
- ReadOnlyDoc = TRUE,
+ ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
@@ -6200,7 +6200,7 @@ SfxVoidItem InsertCurrentDate SID_INSERT_CURRENT_DATE
[
AutoUpdate = FALSE,
FastCall = FALSE,
- ReadOnlyDoc = TRUE,
+ ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
@@ -6218,7 +6218,7 @@ SfxVoidItem InsertCurrentTime SID_INSERT_CURRENT_TIME
[
AutoUpdate = FALSE,
FastCall = FALSE,
- ReadOnlyDoc = TRUE,
+ ReadOnlyDoc = FALSE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index 854794adfb9d..9b25aa711260 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -896,6 +896,15 @@ void ScCellShell::GetState(SfxItemSet &rSet)
rSet.DisableItem( nWhich );
break;
+ case SID_INSERT_CURRENT_DATE:
+ case SID_INSERT_CURRENT_TIME:
+ {
+ if ( pDoc->IsTabProtected(nTab) &&
+ pDoc->HasAttrib(nPosX, nPosY, nTab, nPosX, nPosY, nTab, HasAttrFlags::Protected))
+ rSet.DisableItem( nWhich );
+ }
+ break;
+
case SID_SELECT_SCENARIO:
{
std::vector<OUString> aList;