summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2016-05-03 11:39:37 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-05-04 11:43:31 +0000
commit03d46490d753bdeaaa7685c9bb01c75e090cb939 (patch)
treeac39a11adbe89247e32236a57e55c51d1c56da49
parent14b212dd77799f16d538636a2fb1acc9cb850d8c (diff)
tdf#99529 sw: don't pop up input field dialog before inserting field
The dialog calls SwEditShell::UpdateFields(), so if there is already a existing field at the current cursor position it will be "updated" before the new field is inserted. Change-Id: I8ddbbe00534950759781a1ce8d0dca0376663462 (cherry picked from commit 39d719a80d8c87856c84e3ecd569d45fa6f8a30e) Reviewed-on: https://gerrit.libreoffice.org/24613 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--sw/source/uibase/fldui/fldmgr.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx
index 1386ba25ef19..0825bbc6b48c 100644
--- a/sw/source/uibase/fldui/fldmgr.cxx
+++ b/sw/source/uibase/fldui/fldmgr.cxx
@@ -1192,9 +1192,6 @@ bool SwFieldMgr::InsertField(
new SwInputField( pTyp, rData.m_sPar1, rData.m_sPar2, nSubType|nsSwExtendedSubType::SUB_INVISIBLE, nFormatId);
pField = pInpField;
}
-
- // start dialog
- pCurShell->StartInputFieldDlg(pField, false, rData.m_pParent);
break;
}
@@ -1336,6 +1333,14 @@ bool SwFieldMgr::InsertField(
pCurShell->Insert( *pField );
+ if (TYP_INPUTFLD == rData.m_nTypeId)
+ {
+ // start dialog, not before the field is inserted tdf#99529
+ pCurShell->Left(CRSR_SKIP_CHARS,
+ false, (INP_VAR == (nSubType & 0xff)) ? 1 : 2, false );
+ pCurShell->StartInputFieldDlg(pField, false, rData.m_pParent);
+ }
+
if(bExp && bEvalExp)
pCurShell->UpdateExpFields(true);