summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu20
-rw-r--r--sw/inc/cmdid.h20
-rw-r--r--sw/qa/uibase/shells/shells.cxx8
-rw-r--r--sw/sdi/_textsh.sdi14
-rw-r--r--sw/sdi/swriter.sdi34
-rw-r--r--sw/source/uibase/shells/textfld.cxx4
-rw-r--r--sw/uiconfig/sglobal/popupmenu/insertfield.xml2
-rw-r--r--sw/uiconfig/sweb/popupmenu/insertfield.xml2
-rw-r--r--sw/uiconfig/swform/popupmenu/insertfield.xml2
-rw-r--r--sw/uiconfig/swreport/popupmenu/insertfield.xml2
-rw-r--r--sw/uiconfig/swriter/popupmenu/insertfield.xml2
-rw-r--r--sw/uiconfig/swxform/popupmenu/insertfield.xml2
12 files changed, 96 insertions, 16 deletions
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index 44a98e183ccc..dc4d4dbdb399 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -1076,7 +1076,15 @@
</node>
<node oor:name=".uno:InsertDateField" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">~Date</value>
+ <value xml:lang="en-US">~Date (fix)</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:InsertDateFieldVar" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">~Date (variable)</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
<value>1</value>
@@ -1092,7 +1100,15 @@
</node>
<node oor:name=".uno:InsertTimeField" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
- <value xml:lang="en-US">~Time</value>
+ <value xml:lang="en-US">~Time (fix)</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:InsertTimeFieldVar" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">~Time (variable)</value>
</prop>
<prop oor:name="Properties" oor:type="xs:int">
<value>1</value>
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 08f239b3d8d0..74ab5cf8c554 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -267,18 +267,20 @@ class SwUINumRuleItem;
#define FN_MAILMERGE_PRINT_DOCUMENTS (FN_INSERT + 79) /* mail merge toolbar - print merged documents */
#define FN_MAILMERGE_EMAIL_DOCUMENTS (FN_INSERT + 80) /* mail merge toolbar - email merged documents */
-#define FN_TOOL_ANCHOR_CHAR (FN_INSERT + 84) /* anchor Draw object to character */
+#define FN_TOOL_ANCHOR_CHAR (FN_INSERT + 82) /* anchor Draw object to character */
-#define FN_QRY_INSERT (FN_INSERT + 86) /* insert record selection in to text */
-#define FN_QRY_MERGE_FIELD (FN_INSERT + 87) /* insert record selection into fields */
-#define FN_QRY_INSERT_FIELD (FN_INSERT + 88) /* insert database field */
+#define FN_QRY_INSERT (FN_INSERT + 83) /* insert record selection in to text */
+#define FN_QRY_MERGE_FIELD (FN_INSERT + 84) /* insert record selection into fields */
+#define FN_QRY_INSERT_FIELD (FN_INSERT + 86) /* insert database field */
-#define FN_INSERT_CTRL (FN_INSERT + 89) /* toolbar controller insert*/
-#define FN_INSERT_OBJ_CTRL (FN_INSERT + 90) /* toolbar controller (insert/object) */
-#define FN_INSERT_FIELD_CTRL (FN_INSERT + 91) /* toolbar controller insert/field commands */
+#define FN_INSERT_CTRL (FN_INSERT + 87) /* toolbar controller insert*/
+#define FN_INSERT_OBJ_CTRL (FN_INSERT + 88) /* toolbar controller (insert/object) */
+#define FN_INSERT_FIELD_CTRL (FN_INSERT + 89) /* toolbar controller insert/field commands */
-#define FN_INSERT_FLD_DATE (FN_INSERT + 92)
-#define FN_INSERT_FLD_TIME (FN_INSERT + 93)
+#define FN_INSERT_FLD_DATE (FN_INSERT + 90)
+#define FN_INSERT_FLD_DATE_VAR (FN_INSERT + 91)
+#define FN_INSERT_FLD_TIME (FN_INSERT + 92)
+#define FN_INSERT_FLD_TIME_VAR (FN_INSERT + 93)
#define FN_INSERT_FLD_PGNUMBER (FN_INSERT + 94)
#define FN_INSERT_FLD_PGCOUNT (FN_INSERT + 95)
#define FN_INSERT_FLD_TOPIC (FN_INSERT + 96)
diff --git a/sw/qa/uibase/shells/shells.cxx b/sw/qa/uibase/shells/shells.cxx
index 88f90e909698..8551ef685e1f 100644
--- a/sw/qa/uibase/shells/shells.cxx
+++ b/sw/qa/uibase/shells/shells.cxx
@@ -1049,9 +1049,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testInsertTextFormFieldEndnote)
// Then this was empty: the fieldmark was inserted before the note anchor, not in the note body.
CPPUNIT_ASSERT_EQUAL(OUString("result"), aActual);
}
-/*
-// Disabled because tdf#139141 was reverted and the default time field inserts a fix value again
-// Should be reactivated once a new UNO command is added for variable time fields
+
CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testUpdateSelectedField)
{
// Given an empty doc:
@@ -1061,7 +1059,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testUpdateSelectedField)
SwPaM* pCursor = pDoc->GetEditShell()->GetCursor();
// Insert a time field and select it:
- dispatchCommand(mxComponent, ".uno:InsertTimeField", {});
+ dispatchCommand(mxComponent, ".uno:InsertTimeFieldVar", {});
pCursor->SetMark();
pCursor->Move(fnMoveBackward);
@@ -1079,7 +1077,7 @@ CPPUNIT_TEST_FIXTURE(SwUibaseShellsTest, testUpdateSelectedField)
// Check that the selected field has changed:
CPPUNIT_ASSERT(aTimeFieldAfter != aTimeFieldBefore);
}
-*/
+
CPPUNIT_PLUGIN_IMPLEMENT();
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/sdi/_textsh.sdi b/sw/sdi/_textsh.sdi
index 086a7622b137..e5a4bfd0ad54 100644
--- a/sw/sdi/_textsh.sdi
+++ b/sw/sdi/_textsh.sdi
@@ -971,6 +971,13 @@ interface BaseText
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
+ FN_INSERT_FLD_DATE_VAR
+ [
+ ExecMethod = ExecField ;
+ StateMethod = StateField ;
+ DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
+ ]
+
FN_INSERT_FLD_TIME
[
ExecMethod = ExecField ;
@@ -978,6 +985,13 @@ interface BaseText
DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
]
+ FN_INSERT_FLD_TIME_VAR
+ [
+ ExecMethod = ExecField ;
+ StateMethod = StateField ;
+ DisableFlags="SfxDisableFlags::SwOnProtectedCursor";
+ ]
+
FN_INSERT_FLD_AUTHOR
[
ExecMethod = ExecField ;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index bf3de167741e..7608b22bac26 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -2941,6 +2941,23 @@ SfxVoidItem InsertDateField FN_INSERT_FLD_DATE
GroupId = SfxGroupId::Insert;
]
+SfxVoidItem InsertDateFieldVar FN_INSERT_FLD_DATE_VAR
+()
+[
+ AutoUpdate = FALSE,
+ FastCall = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ ToolBoxConfig = TRUE,
+ GroupId = SfxGroupId::Insert;
+]
+
SfxVoidItem InsertEndnote FN_INSERT_ENDNOTE
(SfxStringItem FootnoteAnchorText FN_INSERT_ENDNOTE,SfxStringItem FontName FN_PARAM_1)
[
@@ -3659,6 +3676,23 @@ SfxVoidItem InsertTimeField FN_INSERT_FLD_TIME
GroupId = SfxGroupId::Insert;
]
+SfxVoidItem InsertTimeFieldVar FN_INSERT_FLD_TIME_VAR
+()
+[
+ AutoUpdate = FALSE,
+ FastCall = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ ToolBoxConfig = TRUE,
+ GroupId = SfxGroupId::Insert;
+]
+
SfxVoidItem InsertTitleField FN_INSERT_FLD_TITLE
()
[
diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx
index d8da30749cc7..780a01f943da 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -691,8 +691,10 @@ void SwTextShell::ExecField(SfxRequest &rReq)
break;
case FN_INSERT_FLD_DATE :
+ case FN_INSERT_FLD_DATE_VAR:
{
nInsertType = SwFieldTypesEnum::Date;
+ nInsertSubType = nSlot == FN_INSERT_FLD_DATE ? 0 : 1;
bIsText = false;
// use long date format for Hungarian
SwPaM* pCursorPos = rSh.GetCursor();
@@ -705,7 +707,9 @@ void SwTextShell::ExecField(SfxRequest &rReq)
goto FIELD_INSERT;
}
case FN_INSERT_FLD_TIME :
+ case FN_INSERT_FLD_TIME_VAR:
nInsertType = SwFieldTypesEnum::Time;
+ nInsertSubType = nSlot == FN_INSERT_FLD_TIME ? 0 : 1;
bIsText = false;
goto FIELD_INSERT;
case FN_INSERT_FLD_PGNUMBER:
diff --git a/sw/uiconfig/sglobal/popupmenu/insertfield.xml b/sw/uiconfig/sglobal/popupmenu/insertfield.xml
index 6e5815340fe1..48e9ae5370d3 100644
--- a/sw/uiconfig/sglobal/popupmenu/insertfield.xml
+++ b/sw/uiconfig/sglobal/popupmenu/insertfield.xml
@@ -11,7 +11,9 @@
<menu:menuitem menu:id=".uno:InsertPageNumberField"/>
<menu:menuitem menu:id=".uno:InsertPageCountField"/>
<menu:menuitem menu:id=".uno:InsertDateField"/>
+ <menu:menuitem menu:id=".uno:InsertDateFieldVar"/>
<menu:menuitem menu:id=".uno:InsertTimeField"/>
+ <menu:menuitem menu:id=".uno:InsertTimeFieldVar"/>
<menu:menuitem menu:id=".uno:InsertTitleField"/>
<menu:menuitem menu:id=".uno:InsertAuthorField"/>
<menu:menuitem menu:id=".uno:InsertTopicField"/>
diff --git a/sw/uiconfig/sweb/popupmenu/insertfield.xml b/sw/uiconfig/sweb/popupmenu/insertfield.xml
index 4b42ce75668b..5eb0a1f16396 100644
--- a/sw/uiconfig/sweb/popupmenu/insertfield.xml
+++ b/sw/uiconfig/sweb/popupmenu/insertfield.xml
@@ -10,7 +10,9 @@
<menu:menupopup xmlns:menu="http://openoffice.org/2001/menu">
<menu:menuitem menu:id=".uno:InsertPageNumberField"/>
<menu:menuitem menu:id=".uno:InsertDateField"/>
+ <menu:menuitem menu:id=".uno:InsertDateFieldVar"/>
<menu:menuitem menu:id=".uno:InsertTimeField"/>
+ <menu:menuitem menu:id=".uno:InsertTimeFieldVar"/>
<menu:menuitem menu:id=".uno:InsertTitleField"/>
<menu:menuitem menu:id=".uno:InsertAuthorField"/>
<menu:menuseparator/>
diff --git a/sw/uiconfig/swform/popupmenu/insertfield.xml b/sw/uiconfig/swform/popupmenu/insertfield.xml
index 6e5815340fe1..48e9ae5370d3 100644
--- a/sw/uiconfig/swform/popupmenu/insertfield.xml
+++ b/sw/uiconfig/swform/popupmenu/insertfield.xml
@@ -11,7 +11,9 @@
<menu:menuitem menu:id=".uno:InsertPageNumberField"/>
<menu:menuitem menu:id=".uno:InsertPageCountField"/>
<menu:menuitem menu:id=".uno:InsertDateField"/>
+ <menu:menuitem menu:id=".uno:InsertDateFieldVar"/>
<menu:menuitem menu:id=".uno:InsertTimeField"/>
+ <menu:menuitem menu:id=".uno:InsertTimeFieldVar"/>
<menu:menuitem menu:id=".uno:InsertTitleField"/>
<menu:menuitem menu:id=".uno:InsertAuthorField"/>
<menu:menuitem menu:id=".uno:InsertTopicField"/>
diff --git a/sw/uiconfig/swreport/popupmenu/insertfield.xml b/sw/uiconfig/swreport/popupmenu/insertfield.xml
index 6e5815340fe1..48e9ae5370d3 100644
--- a/sw/uiconfig/swreport/popupmenu/insertfield.xml
+++ b/sw/uiconfig/swreport/popupmenu/insertfield.xml
@@ -11,7 +11,9 @@
<menu:menuitem menu:id=".uno:InsertPageNumberField"/>
<menu:menuitem menu:id=".uno:InsertPageCountField"/>
<menu:menuitem menu:id=".uno:InsertDateField"/>
+ <menu:menuitem menu:id=".uno:InsertDateFieldVar"/>
<menu:menuitem menu:id=".uno:InsertTimeField"/>
+ <menu:menuitem menu:id=".uno:InsertTimeFieldVar"/>
<menu:menuitem menu:id=".uno:InsertTitleField"/>
<menu:menuitem menu:id=".uno:InsertAuthorField"/>
<menu:menuitem menu:id=".uno:InsertTopicField"/>
diff --git a/sw/uiconfig/swriter/popupmenu/insertfield.xml b/sw/uiconfig/swriter/popupmenu/insertfield.xml
index 6e5815340fe1..48e9ae5370d3 100644
--- a/sw/uiconfig/swriter/popupmenu/insertfield.xml
+++ b/sw/uiconfig/swriter/popupmenu/insertfield.xml
@@ -11,7 +11,9 @@
<menu:menuitem menu:id=".uno:InsertPageNumberField"/>
<menu:menuitem menu:id=".uno:InsertPageCountField"/>
<menu:menuitem menu:id=".uno:InsertDateField"/>
+ <menu:menuitem menu:id=".uno:InsertDateFieldVar"/>
<menu:menuitem menu:id=".uno:InsertTimeField"/>
+ <menu:menuitem menu:id=".uno:InsertTimeFieldVar"/>
<menu:menuitem menu:id=".uno:InsertTitleField"/>
<menu:menuitem menu:id=".uno:InsertAuthorField"/>
<menu:menuitem menu:id=".uno:InsertTopicField"/>
diff --git a/sw/uiconfig/swxform/popupmenu/insertfield.xml b/sw/uiconfig/swxform/popupmenu/insertfield.xml
index 6e5815340fe1..48e9ae5370d3 100644
--- a/sw/uiconfig/swxform/popupmenu/insertfield.xml
+++ b/sw/uiconfig/swxform/popupmenu/insertfield.xml
@@ -11,7 +11,9 @@
<menu:menuitem menu:id=".uno:InsertPageNumberField"/>
<menu:menuitem menu:id=".uno:InsertPageCountField"/>
<menu:menuitem menu:id=".uno:InsertDateField"/>
+ <menu:menuitem menu:id=".uno:InsertDateFieldVar"/>
<menu:menuitem menu:id=".uno:InsertTimeField"/>
+ <menu:menuitem menu:id=".uno:InsertTimeFieldVar"/>
<menu:menuitem menu:id=".uno:InsertTitleField"/>
<menu:menuitem menu:id=".uno:InsertAuthorField"/>
<menu:menuitem menu:id=".uno:InsertTopicField"/>