diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-04-07 20:40:39 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-04-08 17:44:21 +0200 |
commit | 843b3abd2ab05c66533b12ef6a4b155247f99e58 (patch) | |
tree | d4615bd1bf988456b384020b59258090fde4e787 | |
parent | 4e04b442e037a2f679b4cfe26c3e6b1c66ee8642 (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>
(cherry picked from commit db609a58df7be082de7d5a20a2a924789d6a64a1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165840
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r-- | sw/source/ui/fldui/fldref.cxx | 2 |
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(); |