sfx2/source/view/lokhelper.cxx |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

New commits:
commit f97dc9d815ad8fdd75cbcd9c18b2e585ecf39ca5
Author:     Attila Szűcs <attila.sz...@collabora.com>
AuthorDate: Tue Jan 9 20:23:44 2024 +0100
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Thu Jan 11 20:47:30 2024 +0100

    LOK: fix language warning in setView
    
    Made the warning before the new language set.
    This way we log the old (wrong) and new (good) language.
    
    Elseway we could save the old languages to a temporal variable,
    set the language, and do the warning with the saved variable, but
    i think the extra variables would be a waste of memory.
    
    Change-Id: I0b69f49d07e9130bf1538c2c8e1d0b09cf82091f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161841
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    (cherry picked from commit e09b3f5f4cd662a596b5d8d6ad4d5e2778e315f4)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161916
    Tested-by: Jenkins

diff --git a/sfx2/source/view/lokhelper.cxx b/sfx2/source/view/lokhelper.cxx
index 711e12209e8a..02cc7fe25230 100644
--- a/sfx2/source/view/lokhelper.cxx
+++ b/sfx2/source/view/lokhelper.cxx
@@ -194,10 +194,6 @@ void SfxLokHelper::setView(int nId)
             if (bIsCurrShell && 
comphelper::LibreOfficeKit::getLanguageTag().getBcp47() == 
pViewShell->GetLOKLanguageTag().getBcp47())
                 return;
 
-            // update the current LOK language and locale for the dialog 
tunneling
-            
comphelper::LibreOfficeKit::setLanguageTag(pViewShell->GetLOKLanguageTag());
-            comphelper::LibreOfficeKit::setLocale(pViewShell->GetLOKLocale());
-
             if (bIsCurrShell)
             {
                 // If we wanted to set the SfxViewShell that is actually set, 
we could skip it.
@@ -206,9 +202,15 @@ void SfxLokHelper::setView(int nId)
                 SAL_WARN("lok", "LANGUAGE mismatch at setView! ... old (wrong) 
lang:"
                                 << 
comphelper::LibreOfficeKit::getLanguageTag().getBcp47()
                                 << " new lang:" << 
pViewShell->GetLOKLanguageTag().getBcp47());
-                return;
             }
 
+            // update the current LOK language and locale for the dialog 
tunneling
+            
comphelper::LibreOfficeKit::setLanguageTag(pViewShell->GetLOKLanguageTag());
+            comphelper::LibreOfficeKit::setLocale(pViewShell->GetLOKLocale());
+
+            if (bIsCurrShell)
+                return;
+
             SfxViewFrame& rViewFrame = pViewShell->GetViewFrame();
             rViewFrame.MakeActive_Impl(false);
 

Reply via email to