summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorGulsah Kose <gulsah.1004@gmail.com>2017-11-20 23:45:02 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2017-12-17 21:48:16 +0100
commit5afa76782d192d66711e02400987d6153ef9e5a7 (patch)
tree22b68835eebdf4a0096b2dd6f40661d4fc8b132e /sfx2
parentc9a02670076afcba9157ef3a378b8c42b06301c1 (diff)
tdf#113928 Add uno:ReadOnlyDoc command.
That uno command is opposition to uno:EditDoc command. Change-Id: I34977a46c274574e8e44097a16c0fa8972d68559 Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/45005 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/sdi/frmslots.sdi5
-rw-r--r--sfx2/sdi/sfx.sdi19
-rw-r--r--sfx2/source/view/viewfrm.cxx13
3 files changed, 34 insertions, 3 deletions
diff --git a/sfx2/sdi/frmslots.sdi b/sfx2/sdi/frmslots.sdi
index f4c824ec29ab..09aafef95b7d 100644
--- a/sfx2/sdi/frmslots.sdi
+++ b/sfx2/sdi/frmslots.sdi
@@ -208,6 +208,11 @@ interface BrowseWindow : Window
ExecMethod = ExecReload_Impl ;
StateMethod = StateReload_Impl ;
]
+ SID_READONLYDOC // ole(?opt) api(play/rec)
+ [
+ ExecMethod = ExecReload_Impl ;
+ StateMethod = StateReload_Impl ;
+ ]
SID_RELOAD // ole(?opt) api(play/rec)
[
ExecMethod = ExecReload_Impl ;
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index 659e3763bfd1..79d10caa0716 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -1050,6 +1050,25 @@ SfxVoidItem EditDoc SID_EDITDOC
]
+SfxVoidItem ReadOnlyDoc SID_READONLYDOC
+(SfxBoolItem Editable SID_EDITDOC)
+[
+ AutoUpdate = TRUE,
+ FastCall = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+ Asynchron;
+
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ ToolBoxConfig = TRUE,
+ GroupId = SfxGroupId::Document;
+]
+
+
SfxVoidItem EditMacro SID_BASICIDE_EDITMACRO
(SfxMacroInfoItem aMacroInfo SID_BASICIDE_ARG_MACROINFO)
[
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index e168ac8068bf..448b625dd427 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -254,6 +254,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
switch ( rReq.GetSlot() )
{
case SID_EDITDOC:
+ case SID_READONLYDOC:
{
// Due to Double occupancy in toolboxes (with or without Ctrl),
// it is also possible that the slot is enabled, but Ctrl-click
@@ -791,6 +792,7 @@ void SfxViewFrame::StateReload_Impl( SfxItemSet& rSet )
switch ( nWhich )
{
case SID_EDITDOC:
+ case SID_READONLYDOC:
{
const SfxViewShell *pVSh;
const SfxShell *pFSh;
@@ -800,14 +802,19 @@ void SfxViewFrame::StateReload_Impl( SfxItemSet& rSet )
( !(pVSh = pSh->GetViewShell()) ||
!(pFSh = pVSh->GetFormShell()) ||
!pFSh->IsDesignMode())))
- rSet.DisableItem( SID_EDITDOC );
+ rSet.DisableItem( nWhich );
else
{
const SfxBoolItem* pItem = SfxItemSet::GetItem<SfxBoolItem>(pSh->GetMedium()->GetItemSet(), SID_EDITDOC, false);
if ( pItem && !pItem->GetValue() )
- rSet.DisableItem( SID_EDITDOC );
+ rSet.DisableItem( nWhich );
else
- rSet.Put( SfxBoolItem( nWhich, !pSh->IsReadOnly() ) );
+ {
+ if (nWhich==SID_EDITDOC)
+ rSet.Put( SfxBoolItem( nWhich, !pSh->IsReadOnly() ) );
+ else if (nWhich==SID_READONLYDOC)
+ rSet.Put( SfxBoolItem( nWhich, pSh->IsReadOnly() ) );
+ }
}
break;
}