sw/source/ui/fldui/fldref.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit db609a58df7be082de7d5a20a2a924789d6a64a1
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Sun Apr 7 20:40:39 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Mon Apr 8 14:39:56 2024 +0200

    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.mcnam...@collabora.com>

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();

Reply via email to