[Libreoffice-commits] online.git: 2 commits - Mobile/Mobile Mobile/Mobile.xcodeproj
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Nov 12 15:19:44 UTC 2018
Mobile/Mobile.xcodeproj/project.pbxproj | 20 ++++++++++++++++++++
Mobile/Mobile/Document.mm | 11 +++++++++++
2 files changed, 31 insertions(+)
New commits:
commit 94f491f2954728662bdc19921ba13f602fc45754
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Mon Nov 12 15:17:24 2018 +0200
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Mon Nov 12 17:18:52 2018 +0200
Call comphelper::LibreOfficeKit::setLanguageTag() to avoid assertion failure
The locale / language tag dance is a bit confusing. Let's hope it now
works sanely.
Without this change, if I as a test in Xcode set the LANG environment
variable when running the app to "de", to match the case where the
user is using their device in a German locale, and then open a
non-trivial .odt document, close it, and open it again, I get an
assertion failure in sw, in SwXPageStyle::GetPropertyValues_Impl().
(Note that the LANG environment variable is not set by the system on
iOS; in this app LANG is just an arbitrary (but familiar) name for an
environment variable used only when debugging in Xcode. Maybe I should
have called it something else to avoid confusing code readers who
might think it has the same meaning as in POSIX systems.)
The above assertion failure does not happen if I don't set LANG. I
don't really fully understand the convoluted mechanisms involved, but
explicitly re-setting the <comphelper/lok.hxx> concept of (global)
language tag each time before opening a document seems to help. Note
that if I set LANG to just "de", the code then later while handling
setView() calls in ChildSession::loadDocument(), sets it to "de-DE"
anyway. But that doesn't seem to harm.
Change-Id: Ic697ed44b4ace488782ebee3aa2e7610bb02e93c
diff --git a/Mobile/Mobile.xcodeproj/project.pbxproj b/Mobile/Mobile.xcodeproj/project.pbxproj
index 650213253..4ac376418 100644
--- a/Mobile/Mobile.xcodeproj/project.pbxproj
+++ b/Mobile/Mobile.xcodeproj/project.pbxproj
@@ -1534,6 +1534,7 @@
"$(LOSRCDIR)/include",
"$(SOURCE_ROOT)/../lobuilddir-symlink/workdir/CustomTarget/ios",
"$(SOURCE_ROOT)/../lobuilddir-symlink/workdir/UnpackedTarball/libpng",
+ "$(SOURCE_ROOT)/../lobuilddir-symlink/workdir/UnoApiHeadersTarget/udkapi/comprehensive",
"$(SOURCE_ROOT)/../pocoinclude-symlink",
);
INFOPLIST_FILE = Mobile/Info.plist;
@@ -1591,6 +1592,7 @@
"$(LOSRCDIR)/include",
"$(SOURCE_ROOT)/../lobuilddir-symlink/workdir/CustomTarget/ios",
"$(SOURCE_ROOT)/../lobuilddir-symlink/workdir/UnpackedTarball/libpng",
+ "$(SOURCE_ROOT)/../lobuilddir-symlink/workdir/UnoApiHeadersTarget/udkapi/comprehensive",
"$(SOURCE_ROOT)/../pocoinclude-symlink",
);
INFOPLIST_FILE = Mobile/Info.plist;
diff --git a/Mobile/Mobile/Document.mm b/Mobile/Mobile/Document.mm
index a14871a42..d27bf2092 100644
--- a/Mobile/Mobile/Document.mm
+++ b/Mobile/Mobile/Document.mm
@@ -10,6 +10,15 @@
#import <algorithm>
+// This is not "external" code in the UNO-based extensions sense. To be able to include
+// <comphelper/lok.hxx>, we must #define LIBO_INTERNAL_ONLY.
+
+#define LIBO_INTERNAL_ONLY
+#include <sal/config.h>
+#include <rtl/ustring.hxx>
+#include <comphelper/lok.hxx>
+#include <i18nlangtag/languagetag.hxx>
+
#import "ios.h"
#import "AppDelegate.h"
#import "Document.h"
@@ -43,6 +52,8 @@
else
locale = [NSLocale currentLocale].languageCode;
+ comphelper::LibreOfficeKit::setLanguageTag(LanguageTag(OUString::fromUtf8(OString([locale UTF8String])), true));
+
NSURL *url = [[NSBundle mainBundle] URLForResource:@"loleaflet" withExtension:@"html"];
NSURLComponents *components = [NSURLComponents componentsWithURL:url resolvingAgainstBaseURL:NO];
components.queryItems = @[ [NSURLQueryItem queryItemWithName:@"file_path" value:uri],
commit 653d24f91393482899ea4b558a427a020c6f5dc8
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Mon Nov 12 14:52:14 2018 +0200
Commit: Tor Lillqvist <tml at collabora.com>
CommitDate: Mon Nov 12 17:18:52 2018 +0200
Add lok.cxx from comphelper
Change-Id: If7627ecf4ca6771ecbba51ecde69160ab959be46
diff --git a/Mobile/Mobile.xcodeproj/project.pbxproj b/Mobile/Mobile.xcodeproj/project.pbxproj
index 5a749f2ab..650213253 100644
--- a/Mobile/Mobile.xcodeproj/project.pbxproj
+++ b/Mobile/Mobile.xcodeproj/project.pbxproj
@@ -454,6 +454,7 @@
BEA8CD7C21959343009FE17E /* readwritemutexguard.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = readwritemutexguard.cxx; path = "../../ios-device/unotools/source/i18n/readwritemutexguard.cxx"; sourceTree = "<group>"; };
BEA8CD7D21959343009FE17E /* localedatawrapper.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = localedatawrapper.cxx; path = "../../ios-device/unotools/source/i18n/localedatawrapper.cxx"; sourceTree = "<group>"; };
BEA8CD7E21959343009FE17E /* resmgr.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = resmgr.cxx; path = "../../ios-device/unotools/source/i18n/resmgr.cxx"; sourceTree = "<group>"; };
+ BEA8CDC32199AC9D009FE17E /* lok.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = lok.cxx; path = "../../ios-device/comphelper/source/misc/lok.cxx"; sourceTree = "<group>"; };
BEB6521C216F5D8B00B8C09A /* file_path_helper.hxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = file_path_helper.hxx; path = "../../ios-device/sal/osl/unx/file_path_helper.hxx"; sourceTree = "<group>"; };
BEB6521D216F5D8B00B8C09A /* file_error_transl.hxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = file_error_transl.hxx; path = "../../ios-device/sal/osl/unx/file_error_transl.hxx"; sourceTree = "<group>"; };
BEB6521E216F5D8B00B8C09A /* nlsupport.hxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; name = nlsupport.hxx; path = "../../ios-device/sal/osl/unx/nlsupport.hxx"; sourceTree = "<group>"; };
@@ -943,6 +944,7 @@
BE6362BE2153A79200F4237E /* Core */ = {
isa = PBXGroup;
children = (
+ BEA8CDC12199AC7A009FE17E /* comphelper */,
BE34D182218CFC6C00815297 /* desktop */,
BEB6521A216F5D4600B8C09A /* sal */,
BE93D43C216D555C007A39F4 /* sfx2 */,
@@ -1150,6 +1152,22 @@
name = i18n;
sourceTree = "<group>";
};
+ BEA8CDC12199AC7A009FE17E /* comphelper */ = {
+ isa = PBXGroup;
+ children = (
+ BEA8CDC22199AC80009FE17E /* misc */,
+ );
+ name = comphelper;
+ sourceTree = "<group>";
+ };
+ BEA8CDC22199AC80009FE17E /* misc */ = {
+ isa = PBXGroup;
+ children = (
+ BEA8CDC32199AC9D009FE17E /* lok.cxx */,
+ );
+ name = misc;
+ sourceTree = "<group>";
+ };
BEB6521A216F5D4600B8C09A /* sal */ = {
isa = PBXGroup;
children = (
More information about the Libreoffice-commits
mailing list