Kaydet (Commit) 5afa7678 authored tarafından Gulsah Kose's avatar Gulsah Kose Kaydeden (comit) Maxim Monastirsky

tdf#113928 Add uno:ReadOnlyDoc command.

That uno command is opposition to uno:EditDoc command.

Change-Id: I34977a46c274574e8e44097a16c0fa8972d68559
Signed-off-by: 's avatarGulsah Kose <gulsah.1004@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/45005Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMaxim Monastirsky <momonasmon@gmail.com>
üst c9a02670
......@@ -147,7 +147,7 @@
#define SID_CREATELINK (SID_SFX_START + 1309)
#define SID_EDITDOC (SID_SFX_START + 1312)
#define SID_BROWSER_MODE (SID_SFX_START + 1313)
// FREE (was SID_PLUGINS_ACTIVE) (SID_SFX_START + 1314)
#define SID_READONLYDOC (SID_SFX_START + 1314)
#define SID_BROWSER (SID_SFX_START + 1318)
#define SID_MACROEXECMODE (SID_SFX_START + 1319)
......
......@@ -2841,6 +2841,14 @@
<value>9</value>
</prop>
</node>
<node oor:name=".uno:ReadOnlyDoc" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Read Only Mode</value>
</prop>
<prop oor:name="TooltipLabel" oor:type="xs:string">
<value xml:lang="en-US">Toggle Read Only Mode</value>
</prop>
</node>
<node oor:name=".uno:InsertImageControl" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Image Control</value>
......
......@@ -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 ;
......
......@@ -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)
[
......
......@@ -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;
}
......
......@@ -28,6 +28,7 @@
<toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:visible="false"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:ReadOnlyDoc" toolbar:visible="false"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:ExportDirectToPDF"/>
<toolbar:toolbaritem xlink:href=".uno:ExportDirectToEPUB" toolbar:visible="false"/>
......
......@@ -21,6 +21,7 @@
<toolbar:toolbaritem xlink:href=".uno:SaveAs"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:ReadOnlyDoc" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:SendMail"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:ExportDirectToPDF"/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment