Add uno cmd to protect bookmarks in a document
Change-Id: I7cc0dfa2b129d69d49b555495d77c2c710689e94 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88586 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
This commit is contained in:
@@ -3604,6 +3604,14 @@
|
||||
<value>1</value>
|
||||
</prop>
|
||||
</node>
|
||||
<node oor:name=".uno:ProtectBookmarks" oor:op="replace">
|
||||
<prop oor:name="Label" oor:type="xs:string">
|
||||
<value xml:lang="en-US">Protect Bookmarks</value>
|
||||
</prop>
|
||||
<prop oor:name="Properties" oor:type="xs:int">
|
||||
<value>1</value>
|
||||
</prop>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</oor:component-data>
|
||||
|
||||
@@ -285,6 +285,7 @@
|
||||
#define FN_INSERT_DATE_FORMFIELD (FN_INSERT2 + 25)
|
||||
|
||||
#define FN_PROTECT_FIELDS (FN_INSERT2 + 26)
|
||||
#define FN_PROTECT_BOOKMARKS (FN_INSERT2 + 27)
|
||||
|
||||
// clipboard table content
|
||||
#define FN_PASTE_NESTED_TABLE (FN_INSERT2 + 30) /* instead of the cell-by-cell copy between source and target tables */
|
||||
|
||||
@@ -1746,6 +1746,12 @@ interface BaseText
|
||||
StateMethod = GetState ;
|
||||
]
|
||||
|
||||
FN_PROTECT_BOOKMARKS
|
||||
[
|
||||
ExecMethod = Execute ;
|
||||
StateMethod = GetState ;
|
||||
]
|
||||
|
||||
SID_FM_CTL_PROPERTIES
|
||||
[
|
||||
ExecMethod = Execute ;
|
||||
|
||||
@@ -7935,6 +7935,24 @@ SfxBoolItem ProtectFields FN_PROTECT_FIELDS
|
||||
GroupId = SfxGroupId::Controls;
|
||||
]
|
||||
|
||||
SfxBoolItem ProtectBookmarks FN_PROTECT_BOOKMARKS
|
||||
|
||||
[
|
||||
AutoUpdate = TRUE,
|
||||
FastCall = FALSE,
|
||||
ReadOnlyDoc = FALSE,
|
||||
Toggle = TRUE,
|
||||
Container = FALSE,
|
||||
RecordAbsolute = FALSE,
|
||||
RecordPerSet;
|
||||
|
||||
|
||||
AccelConfig = TRUE,
|
||||
MenuConfig = TRUE,
|
||||
ToolBoxConfig = TRUE,
|
||||
GroupId = SfxGroupId::Controls;
|
||||
]
|
||||
|
||||
SfxUInt32Item TableRowHeight SID_ATTR_TABLE_ROW_HEIGHT
|
||||
|
||||
[
|
||||
|
||||
@@ -1385,9 +1385,13 @@ void SwTextShell::Execute(SfxRequest &rReq)
|
||||
}
|
||||
break;
|
||||
case FN_PROTECT_FIELDS:
|
||||
case FN_PROTECT_BOOKMARKS:
|
||||
{
|
||||
IDocumentSettingAccess& rIDSA = rWrtSh.getIDocumentSettingAccess();
|
||||
rIDSA.set(DocumentSettingId::PROTECT_FIELDS, !rIDSA.get(DocumentSettingId::PROTECT_FIELDS));
|
||||
DocumentSettingId aSettingId = nSlot == FN_PROTECT_FIELDS
|
||||
? DocumentSettingId::PROTECT_FIELDS
|
||||
: DocumentSettingId::PROTECT_BOOKMARKS;
|
||||
rIDSA.set(aSettingId, !rIDSA.get(aSettingId));
|
||||
// Invalidate so that toggle state gets updated
|
||||
SfxViewFrame* pViewFrame = GetView().GetViewFrame();
|
||||
pViewFrame->GetBindings().Invalidate(nSlot);
|
||||
@@ -2171,9 +2175,12 @@ void SwTextShell::GetState( SfxItemSet &rSet )
|
||||
break;
|
||||
}
|
||||
case FN_PROTECT_FIELDS:
|
||||
case FN_PROTECT_BOOKMARKS:
|
||||
{
|
||||
bool bProtected
|
||||
= rSh.getIDocumentSettingAccess().get(DocumentSettingId::PROTECT_FIELDS);
|
||||
DocumentSettingId aSettingId = nWhich == FN_PROTECT_FIELDS
|
||||
? DocumentSettingId::PROTECT_FIELDS
|
||||
: DocumentSettingId::PROTECT_BOOKMARKS;
|
||||
bool bProtected = rSh.getIDocumentSettingAccess().get(aSettingId);
|
||||
rSet.Put(SfxBoolItem(nWhich, bProtected));
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user