Fix minor iOS build and runtime problems

This patch contains changes to iOS and/or Android code only.

Signed-off-by: Patrick Luby <plubius@neooffice.org>
Change-Id: Ia1461b0b3ca374b682494a7e2e900b832c85ea9d
private/gokay/tab-translations
Patrick Luby 2023-09-08 19:03:54 -04:00 committed by Paris
parent baec3ff60d
commit e7bd50c967
3 changed files with 47 additions and 35 deletions

View File

@ -247,41 +247,45 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({
}
},
_createiOsFontButton: function(parentContainer, data, builder) {
// Fix issue #5838 Use unique IDs for font name combobox elements
var table = L.DomUtil.createWithId('div', data.id, parentContainer);
var row = L.DomUtil.create('div', 'notebookbar row', table);
var button = L.DomUtil.createWithId('button', data.id + 'ios', row);
$(table).addClass('select2 select2-container select2-container--default');
// Fix issue #5838 Don't add the "select2-selection--single" class
$(row).addClass('select2-selection');
$(button).addClass('select2-selection__rendered');
if (data.selectedEntries.length && data.entries[data.selectedEntries[0]])
button.innerText = data.entries[data.selectedEntries[0]];
else if (window.LastSetiOSFontNameButtonFont)
button.innerText = window.LastSetiOSFontNameButtonFont;
else if (data.text)
button.innerText = data.text;
var map = builder.map;
window.MagicFontNameCallback = function(font) {
button.innerText = font;
map.applyFont(font);
map.focus();
};
button.onclick = function() {
// There doesn't seem to be a way to pre-select an entry in the
// UIFontPickerViewController so no need to pass the
// current font here.
window.postMobileMessage('FONTPICKER');
};
},
_comboboxControl: function(parentContainer, data, builder) {
if (!data.entries || data.entries.length === 0)
return false;
// Fix exception due to undefined _createiOsFontButton function
// Starting with commit 4082e1e570258f5032dfd460cf4d34ff6ae0d575,
// this._createiOsFontButton() throws and exception because "this"
// is a Window object. So fix this by moving the _createiOsFontButton
// function inline.
if (window.ThisIsTheiOSApp && data.id === 'fontnamecombobox') {
this._createiOsFontButton(parentContainer, data, builder);
// Fix issue #5838 Use unique IDs for font name combobox elements
var table = L.DomUtil.createWithId('div', data.id, parentContainer);
var row = L.DomUtil.create('div', 'notebookbar row', table);
var button = L.DomUtil.createWithId('button', data.id + 'ios', row);
$(table).addClass('select2 select2-container select2-container--default');
// Fix issue #5838 Don't add the "select2-selection--single" class
$(row).addClass('select2-selection');
$(button).addClass('select2-selection__rendered');
if (data.selectedEntries.length && data.entries[data.selectedEntries[0]])
button.innerText = data.entries[data.selectedEntries[0]];
else if (window.LastSetiOSFontNameButtonFont)
button.innerText = window.LastSetiOSFontNameButtonFont;
else if (data.text)
button.innerText = data.text;
var map = builder.map;
window.MagicFontNameCallback = function(font) {
button.innerText = font;
map.applyFont(font);
map.focus();
};
button.onclick = function() {
// There doesn't seem to be a way to pre-select an entry in the
// UIFontPickerViewController so no need to pass the
// current font here.
window.postMobileMessage('FONTPICKER');
};
return false;
}

View File

@ -62,9 +62,11 @@ static std::atomic<bool> ForwardSigUsr2Flag(false); //< Flags to forward SIG_USR
static size_t ActivityStringIndex = 0;
static std::array<std::string, 8> ActivityStrings;
static bool UnattendedRun = false;
#if !MOBILEAPP
static int SignalLogFD = STDERR_FILENO; //< The FD where signalLogs are dumped.
static char* VersionInfo = nullptr;
static char FatalGdbString[256] = { '\0' };
#endif
} // namespace

View File

@ -88,9 +88,15 @@ NSString *app_text_direction;
// Fix assert failure when running "My Mac (Designed for iPad)" in Xcode
// LANG values such as en_US.UTF-8 trigger an assert in the LibreOffice
// code so replace all "_" characters with "-" characters.
if (lang != nullptr)
if (lang != nullptr) {
app_locale = [[NSString stringWithUTF8String:lang] stringByReplacingOccurrencesOfString:@"_" withString:@"-"];
else
// Eliminate invalid language tag exceptions in JavaScript by
// trimming any text encoding from LANG
NSRange range = [app_locale rangeOfString:@"."];
if (range.location != NSNotFound)
app_locale = [app_locale substringToIndex:range.location];
}
if (!app_locale || ![app_locale length])
app_locale = [[NSLocale preferredLanguages] firstObject];
if (LangUtil::isRtlLanguage(std::string([app_locale UTF8String])))