summaryrefslogtreecommitdiff
path: root/sw/source/ui/fldui
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-04-07 20:40:39 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-04-08 14:39:56 +0200
commitdb609a58df7be082de7d5a20a2a924789d6a64a1 (patch)
treed510f58bdd603bf29a48136be10759d4f9ecb119 /sw/source/ui/fldui
parent5ba8f4c55a65d0f525f3e65402cdca961efbe1ba (diff)
Resolves: tdf#154715 don't use last-used field setting when editing field
If we are inserting a field it makes sense to use the last-used settings, but if we are editing an existing field we naturally want to populate with the current field. Here we have IsRefresh used twice as a condition, one inside the other. But if was true in the outer use, it will also be true in the inner (this duplication exists all the way back to the initial commit) because GetUserData() has no side effect. IsRefresh is only true during EditNewField (which is the case of using the "next/back" button to go to edit another field). So even before this change if you click next and then back (assuming there is another field to move to) then you then get the right results Skip restoring the last-used settings in the EditField case, replace the outer !IsRefresh() with !IsFieldEdit() Change-Id: I4224302171d2e8d02a0f1e0efc9fdada5ada9d7f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165876 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sw/source/ui/fldui')
-rw-r--r--sw/source/ui/fldui/fldref.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/ui/fldui/fldref.cxx b/sw/source/ui/fldui/fldref.cxx
index a08715c8ca3c..434e10a6a2f2 100644
--- a/sw/source/ui/fldui/fldref.cxx
+++ b/sw/source/ui/fldui/fldref.cxx
@@ -268,7 +268,7 @@ void SwFieldRefPage::Reset(const SfxItemSet* )
nFieldDlgFormatSel = 0;
sal_uInt16 nFormatBoxPosition = USHRT_MAX;
- if( !IsRefresh() )
+ if( !IsFieldEdit() )
{
sal_Int32 nIdx{ 0 };
const OUString sUserData = GetUserData();