android/source/res/values-de/strings.xml | 1 android/source/res/values-tr/strings.xml | 1 android/source/res/values/strings.xml | 1 android/source/src/java/org/libreoffice/LOKitTileProvider.java | 5 -- android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java | 18 +------ android/source/src/java/org/libreoffice/LocaleHelper.java | 3 - android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java | 23 +-------- configure.ac | 24 +--------- sw/source/ui/dialog/docstdlg.cxx | 6 ++ 9 files changed, 16 insertions(+), 66 deletions(-)
New commits: commit c2fc2c8c7c63ca4e43bca6e8c9b82c50418422d2 Author: Michael Weghorn <[email protected]> AuthorDate: Tue Dec 5 09:57:22 2023 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Fri Dec 8 10:39:37 2023 +0100 android: Bump minSdkVersion to 21 (Android 5.0) NDK 26 dropped support for API levels < 21 [1] [2]. Do the same for our Android build, to ease the maintenance. Adapt configure.ac accordingly and drop the now obsolete code paths in Android Viewer Java code. This in also means that the same minSdkVersion will be used for all architectures now, while API level 21 was already used for the 64-bit variants (for which the minimum supported version was 21 anyway) and API level 19 was used for x86 and 32-bit ARM when building with NDK 24/25, API level 16 when building with NDK 23. According to [1] and [3], more than 99% of Android devices have at least Android version 5, i.e. support API level 21. [1] https://github.com/android/ndk/issues/1751 [2] https://developer.android.com/ndk/downloads/revision_history [3] https://apilevels.com/ Change-Id: I875e784dd4e62993f51059ae6a280d425cb49c0a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160334 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/android/source/res/values-de/strings.xml b/android/source/res/values-de/strings.xml index bbab9383b794..e2a705f4fe30 100644 --- a/android/source/res/values-de/strings.xml +++ b/android/source/res/values-de/strings.xml @@ -155,7 +155,6 @@ <string name="pdf_export_finished">PDF-Export abgeschlossen</string> <string name="unable_to_export_pdf">PDF-Export nicht möglich</string> <string name="unable_to_save">Speichern nicht möglich</string> - <string name="printing_not_supported">Ihr Gerät unterstützt Drucken nicht</string> <string name="error">Fehler</string> <string name="enter_part_name">Name für Abschnitt eingeben</string> <string name="bmp_null">Bmp ist null!</string> diff --git a/android/source/res/values-tr/strings.xml b/android/source/res/values-tr/strings.xml index a9ce0782da97..303d217c4b28 100644 --- a/android/source/res/values-tr/strings.xml +++ b/android/source/res/values-tr/strings.xml @@ -148,7 +148,6 @@ <string name="display_language">Uygulama Dili</string> <string name="display_language_summary">Varsayılan dili değiştir</string> <string name="unable_to_export_pdf">Pdf dışa aktarılamıyor.</string> - <string name="printing_not_supported">Cihazınız yazdırmayı desteklemiyor.</string> <string name="error">Hata</string> <string name="enter_part_name">Bölüm ismi girin.</string> <string name="bmp_null">Bmp boş!</string> diff --git a/android/source/res/values/strings.xml b/android/source/res/values/strings.xml index bb8e3cdcfcfc..5d280ca5025b 100644 --- a/android/source/res/values/strings.xml +++ b/android/source/res/values/strings.xml @@ -158,7 +158,6 @@ <string name="pdf_export_finished">PDF export finished</string> <string name="unable_to_export_pdf">Unable to export to pdf</string> <string name="unable_to_save">Unable to save file</string> - <string name="printing_not_supported">Your device does not support printing</string> <string name="error">Error</string> <string name="enter_part_name">Enter a part name</string> <string name="bmp_null">Bmp is null!</string> diff --git a/android/source/src/java/org/libreoffice/LOKitTileProvider.java b/android/source/src/java/org/libreoffice/LOKitTileProvider.java index 0c7931763571..5d1cf12209dc 100644 --- a/android/source/src/java/org/libreoffice/LOKitTileProvider.java +++ b/android/source/src/java/org/libreoffice/LOKitTileProvider.java @@ -313,11 +313,6 @@ class LOKitTileProvider implements TileProvider { } public void printDocument() { - if (Build.VERSION.SDK_INT < 19) { - mContext.showCustomStatusMessage(mContext.getString(R.string.printing_not_supported)); - return; - } - String mInputFileName = (new File(mInputFile)).getName(); String file = mInputFileName.substring(0,(mInputFileName.length()-3))+"pdf"; String cacheFile = mContext.getExternalCacheDir().getAbsolutePath() + "/" + file; diff --git a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java index ba371bfd9c8a..23bf8d27b6c3 100644 --- a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java +++ b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java @@ -1089,21 +1089,9 @@ public class LibreOfficeMainActivity extends AppCompatActivity implements Settin } public void startPresentation(String tempPath) { - // pre-KitKat android doesn't have chrome-based WebView, which is needed to show svg slideshow - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { - Intent intent = new Intent(this, PresentationActivity.class); - intent.setData(Uri.parse(tempPath)); - startActivity(intent); - } else { - // copy the svg file path to clipboard for the user to paste in a browser - ClipboardManager clipboard = (ClipboardManager) getSystemService(Context.CLIPBOARD_SERVICE); - ClipData clip = ClipData.newPlainText("temp svg file path", tempPath); - clipboard.setPrimaryClip(clip); - - AlertDialog.Builder builder = new AlertDialog.Builder(this); - builder.setMessage(R.string.alert_copy_svg_slide_show_to_clipboard) - .setPositiveButton(R.string.alert_copy_svg_slide_show_to_clipboard_dismiss, null).show(); - } + Intent intent = new Intent(this, PresentationActivity.class); + intent.setData(Uri.parse(tempPath)); + startActivity(intent); } @Override diff --git a/android/source/src/java/org/libreoffice/LocaleHelper.java b/android/source/src/java/org/libreoffice/LocaleHelper.java index 8c0e9b3fbbed..a87c63f09990 100644 --- a/android/source/src/java/org/libreoffice/LocaleHelper.java +++ b/android/source/src/java/org/libreoffice/LocaleHelper.java @@ -38,8 +38,7 @@ public class LocaleHelper { Resources res = context.getResources(); Configuration cfg = res.getConfiguration(); cfg.locale = locale; - if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) - cfg.setLayoutDirection(locale); + cfg.setLayoutDirection(locale); res.updateConfiguration(cfg, res.getDisplayMetrics()); return context; diff --git a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java index 6f583377d592..bc5203d9c6eb 100644 --- a/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java +++ b/android/source/src/java/org/libreoffice/ui/LibreOfficeUIActivity.java @@ -179,12 +179,10 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings editFAB = findViewById(R.id.editFAB); editFAB.setOnClickListener(this); - // allow creating new docs only when experimental editing is enabled and - // Intent.ACTION_CREATE_DOCUMENT (used in 'createNewFileDialog') is available (SDK version >= 19) + // allow creating new docs only when experimental editing is enabled SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); final boolean bEditingEnabled = BuildConfig.ALLOW_EDITING && preferences.getBoolean(LibreOfficeMainActivity.ENABLE_EXPERIMENTAL_PREFS_KEY, false); - final boolean bAllowCreatingDocs = bEditingEnabled && Build.VERSION.SDK_INT >= 19; - editFAB.setVisibility(bAllowCreatingDocs ? View.VISIBLE : View.INVISIBLE); + editFAB.setVisibility(bEditingEnabled ? View.VISIBLE : View.INVISIBLE); impressFAB = findViewById(R.id.newImpressFAB); impressFAB.setOnClickListener(this); @@ -266,15 +264,7 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings } private void showSystemFilePickerAndOpenFile() { - Intent intent = new Intent(); - if (Build.VERSION.SDK_INT >= 19) { - intent.setAction(Intent.ACTION_OPEN_DOCUMENT); - } - else { - // Intent.ACTION_OPEN_DOCUMENT added in API level 19, but minSdkVersion is currently 16 - intent.setAction(Intent.ACTION_GET_CONTENT); - } - + Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); intent.setType("*/*"); intent.putExtra(Intent.EXTRA_MIME_TYPES, SUPPORTED_MIME_TYPES); @@ -363,13 +353,6 @@ public class LibreOfficeUIActivity extends AppCompatActivity implements Settings private void addDocumentToRecents(Uri fileUri) { SharedPreferences prefs = getSharedPreferences(EXPLORER_PREFS_KEY, MODE_PRIVATE); - if (Build.VERSION.SDK_INT < 19) { - // ContentResolver#takePersistableUriPermission only available from SDK level 19 on - Log.i(LOGTAG, "Recently used files not supported, requires SDK version >= 19."); - // drop potential entries - prefs.edit().putString(RECENT_DOCUMENTS_KEY, "").apply(); - return; - } // preserve permissions across device reboots, // s. https://developer.android.com/training/data-storage/shared/documents-files#persist-permissions diff --git a/configure.ac b/configure.ac index c800a6afd611..d77e27499230 100644 --- a/configure.ac +++ b/configure.ac @@ -683,7 +683,7 @@ fi if test -n "$with_android_ndk"; then eval ANDROID_NDK_DIR=$with_android_ndk - ANDROID_API_LEVEL=16 + ANDROID_API_LEVEL=21 if test -n "$with_android_api_level" ; then ANDROID_API_LEVEL="$with_android_api_level" fi @@ -696,16 +696,10 @@ if test -n "$with_android_ndk"; then elif test $host_cpu = aarch64; then LLVM_TRIPLE=aarch64-linux-android ANDROID_SYSROOT_PLATFORM=$LLVM_TRIPLE - # minimum android version that supports aarch64 - if test "$ANDROID_API_LEVEL" -lt "21" ; then - ANDROID_API_LEVEL=21 - fi ANDROID_APP_ABI=arm64-v8a elif test $host_cpu = x86_64; then LLVM_TRIPLE=x86_64-linux-android ANDROID_SYSROOT_PLATFORM=$LLVM_TRIPLE - # minimum android version that supports x86_64 - ANDROID_API_LEVEL=21 ANDROID_APP_ABI=x86_64 else # host_cpu is something like "i386" or "i686" I guess, NDK uses @@ -735,21 +729,11 @@ if test -n "$with_android_ndk"; then 11.1.*|12.1.*|13.1.*|14.1.*|16.*|17.*|18.*|19.*|20.*|21.*|22.*) AC_MSG_ERROR([Building for Android requires NDK version >= 23.*]) ;; - 23.*) + 23.*|24.*|25.*) ;; *) - # NDK 24 dropped support for API levels < 19 - if test "$ANDROID_API_LEVEL" -lt "19"; then - ANDROID_API_LEVEL=19 - fi - case $ANDROID_NDK_VERSION in - 24.*|25.*) - ;; - *) - AC_MSG_WARN([Untested Android NDK version $ANDROID_NDK_VERSION, only versions 23.* to 25.* have been used successfully. Proceed at your own risk.]) - add_warning "Untested Android NDK version $ANDROID_NDK_VERSION, only versions 23.* to 25.* have been used successfully. Proceed at your own risk." - ;; - esac + AC_MSG_WARN([Untested Android NDK version $ANDROID_NDK_VERSION, only versions 23.* to 25.* have been used successfully. Proceed at your own risk.]) + add_warning "Untested Android NDK version $ANDROID_NDK_VERSION, only versions 23.* to 25.* have been used successfully. Proceed at your own risk." ;; esac commit 99f91d64c57f4e2bfe47fe4d0870b92c269fa875 Author: Rafael Lima <[email protected]> AuthorDate: Thu Dec 7 21:37:59 2023 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Fri Dec 8 10:39:34 2023 +0100 tdf#156379 Fix Line count width in the Properties dialog In Writer, the "Lines" property in File - Properties - Statistics does not have enough width to handle numbers with 4 digits or more. This patch fixes the issue by adjusting the label width when it is updated. Change-Id: I1a56da106f7c80ffbbaa8bdfb93932a3974b1ee0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160367 Tested-by: Jenkins Tested-by: Caolán McNamara <[email protected]> Reviewed-by: Caolán McNamara <[email protected]> diff --git a/sw/source/ui/dialog/docstdlg.cxx b/sw/source/ui/dialog/docstdlg.cxx index 48e4642281ea..70a653dcbefe 100644 --- a/sw/source/ui/dialog/docstdlg.cxx +++ b/sw/source/ui/dialog/docstdlg.cxx @@ -120,7 +120,11 @@ IMPL_LINK_NOARG(SwDocStatPage, UpdateHdl, weld::Button&, void) SwDocShell* pDocShell = static_cast<SwDocShell*>( SfxObjectShell::Current()); SwFEShell* pFEShell = pDocShell ? pDocShell->GetFEShell() : nullptr; if (pFEShell) - m_xLineNo->set_label(OUString::number(pFEShell->GetLineCount())); + { + OUString sLineCount = OUString::number(pFEShell->GetLineCount()); + m_xLineNo->set_label(sLineCount); + m_xLineNo->set_size_request(m_xLineNo->get_approximate_digit_width() * sLineCount.getLength(), -1); + } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
