summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndras Timar <andras.timar@collabora.com>2022-05-16 15:55:35 +0200
committerAndras Timar <andras.timar@collabora.com>2022-05-18 10:38:31 +0200
commit900891c3b42e80e8d3970fd5fc02b67022ae3795 (patch)
tree2eb47f711e789c5f7b1d75f45f01a00072c52cbe
parenta799a65283bfc560135e9e71d4f7df7d14cd8918 (diff)
Revert "sw: restore UI language to en while saving"co-21.06.29-1
This reverts commit f4ef1e3e580f7a590496d62aaa3dc7e092510a9c. Reason: T35383 Writer: Page breaks saved in German UI/locale turn into line breaks Change-Id: Iea7c41b361beb0bc6f455e72ab48cef3604305d6
-rw-r--r--sfx2/source/doc/objstor.cxx31
1 files changed, 0 insertions, 31 deletions
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;