diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-05-31 17:55:10 +0200 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-07-12 01:04:13 +0200 |
commit | 75099d6788672a98389d8592b88777c8d3a25fa6 (patch) | |
tree | 2cdc5d40cbe401072152366b2cac38df7db329a7 /sw/source | |
parent | 0fd05f6503c42df35b16735c7b690e56f1acab30 (diff) |
MSForms: Insert text-based date field from MS compatible Forms menu
Change-Id: I2f08fa806dc55a185adf67ca616af8d81bb23bda
Reviewed-on: https://gerrit.libreoffice.org/75438
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/uibase/shells/textfld.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx index fa5afebd6c59..27c28daabbf2 100644 --- a/sw/source/uibase/shells/textfld.cxx +++ b/sw/source/uibase/shells/textfld.cxx @@ -717,6 +717,21 @@ FIELD_INSERT: rSh.GetView().GetViewFrame()->GetBindings().Invalidate( SID_UNDO ); } break; + case FN_INSERT_DATE_FORMFIELD: + { + rSh.GetDoc()->GetIDocumentUndoRedo().StartUndo(SwUndoId::INSERT_FORM_FIELD, nullptr); + + SwPaM* pCursorPos = rSh.GetCursor(); + if(pCursorPos) + { + IDocumentMarkAccess* pMarksAccess = rSh.GetDoc()->getIDocumentMarkAccess(); + pMarksAccess->makeNoTextFieldBookmark(*pCursorPos, OUString(), ODF_FORMDATE); + } + + rSh.GetDoc()->GetIDocumentUndoRedo().EndUndo(SwUndoId::INSERT_FORM_FIELD, nullptr); + rSh.GetView().GetViewFrame()->GetBindings().Invalidate( SID_UNDO ); + } + break; default: OSL_FAIL("wrong dispatcher"); return; @@ -880,6 +895,7 @@ void SwTextShell::StateField( SfxItemSet &rSet ) case FN_INSERT_TEXT_FORMFIELD: case FN_INSERT_CHECKBOX_FORMFIELD: case FN_INSERT_DROPDOWN_FORMFIELD: + case FN_INSERT_DATE_FORMFIELD: if ( rSh.CursorInsideInputField() ) { rSet.DisableItem(nWhich); |