sfx2/source/doc/objstor.cxx |   31 -------------------------------
 1 file changed, 31 deletions(-)

New commits:
commit 900891c3b42e80e8d3970fd5fc02b67022ae3795
Author:     Andras Timar <andras.ti...@collabora.com>
AuthorDate: Mon May 16 15:55:35 2022 +0200
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Wed May 18 10:38:31 2022 +0200

    Revert "sw: restore UI language to en while saving"
    
    This reverts commit f4ef1e3e580f7a590496d62aaa3dc7e092510a9c.
    Reason: T35383 Writer: Page breaks saved in German UI/locale turn into line 
breaks
    
    Change-Id: Iea7c41b361beb0bc6f455e72ab48cef3604305d6

diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 238369b746e6..7ccee4f3a970 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -91,7 +91,6 @@
 #include <osl/file.hxx>
 #include <comphelper/scopeguard.hxx>
 #include <comphelper/lok.hxx>
-#include <i18nlangtag/languagetag.hxx>
 
 #include <sfx2/signaturestate.hxx>
 #include <sfx2/app.hxx>
@@ -3169,11 +3168,6 @@ bool SfxObjectShell::LoadOwnFormat( SfxMedium& rMedium )
         return false;
 }
 
-namespace
-{
-static LanguageTag g_defaultLanguageTag("en-US", true);
-}
-
 bool SfxObjectShell::SaveAsOwnFormat( SfxMedium& rMedium )
 {
     uno::Reference< embed::XStorage > xStorage = rMedium.GetStorage();
@@ -3196,31 +3190,6 @@ bool SfxObjectShell::SaveAsOwnFormat( SfxMedium& rMedium 
)
             pImpl->aBasicManager.storeLibrariesToStorage( xStorage );
         }
 #endif
-
-        // Because XMLTextFieldExport::ExportFieldDeclarations (called from 
SwXMLExport)
-        // calls SwXTextFieldMasters::getByName, which in turn maps property 
names by
-        // calling SwStyleNameMapper::GetTextUINameArray, which uses
-        // SvtSysLocale().GetUILanguageTag() to do the mapping, saving 
indirectly depends
-        // on the UI language. This is an unfortunate depenency.
-        // Here we restore to English
-        const auto viewLanguage = comphelper::LibreOfficeKit::getLanguageTag();
-
-        // Use the default language for saving and restore later if necessary.
-        bool restoreLanguage = false;
-        if (comphelper::LibreOfficeKit::isActive() && viewLanguage != 
g_defaultLanguageTag)
-        {
-            restoreLanguage = true;
-            comphelper::LibreOfficeKit::setLanguageTag(g_defaultLanguageTag);
-        }
-
-        // Restore the view's original language automatically and as necessary.
-        const ::comphelper::ScopeGuard aGuard(
-            [&viewLanguage, restoreLanguage]()
-            {
-                if (restoreLanguage && viewLanguage != 
comphelper::LibreOfficeKit::getLanguageTag())
-                    comphelper::LibreOfficeKit::setLanguageTag(viewLanguage);
-            });
-
         return SaveAs( rMedium );
     }
     else return false;

Reply via email to