summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu8
-rw-r--r--sw/inc/cmdid.h2
-rw-r--r--sw/sdi/_textsh.sdi6
-rw-r--r--sw/sdi/swriter.sdi18
-rw-r--r--sw/source/uibase/shells/textsh1.cxx17
5 files changed, 51 insertions, 0 deletions
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index a40119acbfb9..b526f60ea6a9 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -3596,6 +3596,14 @@
<value xml:lang="en-US">Content Controls</value>
</prop>
</node>
+ <node oor:name=".uno:ProtectFields" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">Protect Fields</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
</node>
</node>
</oor:component-data>
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 68f640199c0f..2dfb720bb854 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -284,6 +284,8 @@
// MSO content controls
#define FN_INSERT_DATE_FORMFIELD (FN_INSERT2 + 25)
+#define FN_PROTECT_FIELDS (FN_INSERT2 + 26)
+
// clipboard table content
#define FN_PASTE_NESTED_TABLE (FN_INSERT2 + 30) /* instead of the cell-by-cell copy between source and target tables */
#define FN_TABLE_PASTE_ROW_BEFORE (FN_INSERT2 + 31) /* paste table as new table rows */
diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi
index b91292dea316..9bc92512435b 100644
--- a/sw/sdi/_textsh.sdi
+++ b/sw/sdi/_textsh.sdi
@@ -1740,6 +1740,12 @@ interface BaseText
StateMethod = StateField ;
]
+ FN_PROTECT_FIELDS
+ [
+ ExecMethod = Execute ;
+ StateMethod = GetState ;
+ ]
+
SID_FM_CTL_PROPERTIES
[
ExecMethod = Execute ;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 524018f1b90c..dbc6196feeb1 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -7917,6 +7917,24 @@ SfxVoidItem DatePickerFormField FN_INSERT_DATE_FORMFIELD
GroupId = SfxGroupId::Controls;
]
+SfxBoolItem ProtectFields FN_PROTECT_FIELDS
+
+[
+ 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
[
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index f8bd62cab79c..a6893e5f39e1 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -1384,6 +1384,16 @@ void SwTextShell::Execute(SfxRequest &rReq)
GetView().UpdateWordCount(this, nSlot);
}
break;
+ case FN_PROTECT_FIELDS:
+ {
+ IDocumentSettingAccess& rIDSA = rWrtSh.getIDocumentSettingAccess();
+ rIDSA.set(DocumentSettingId::PROTECT_FIELDS, !rIDSA.get(DocumentSettingId::PROTECT_FIELDS));
+ // Invalidate so that toggle state gets updated
+ SfxViewFrame* pViewFrame = GetView().GetViewFrame();
+ pViewFrame->GetBindings().Invalidate(nSlot);
+ pViewFrame->GetBindings().Update(nSlot);
+ }
+ break;
case SID_FM_CTL_PROPERTIES:
{
SwPosition aPos(*GetShell().GetCursor()->GetPoint());
@@ -2160,6 +2170,13 @@ void SwTextShell::GetState( SfxItemSet &rSet )
rSet.DisableItem(nWhich);
break;
}
+ case FN_PROTECT_FIELDS:
+ {
+ bool bProtected
+ = rSh.getIDocumentSettingAccess().get(DocumentSettingId::PROTECT_FIELDS);
+ rSet.Put(SfxBoolItem(nWhich, bProtected));
+ }
+ break;
}
nWhich = aIter.NextWhich();
}