android/source/src/java/org/libreoffice/LOKitTileProvider.java |   22 
----------
 1 file changed, 2 insertions(+), 20 deletions(-)

New commits:
commit e996ad71582ecd4425a1ab0d0347cccf7c7724c2
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Tue Apr 26 16:38:35 2022 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Apr 27 05:51:18 2022 +0200

    android: Reuse existing LOKitTileProvider#resetParts
    
    ... instead of duplicating what it does in
    `LOKitTileProvider#postLoad`.
    
    Change-Id: I0ed3d77d9f9651efec764eafeaa3f71576abcf6e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133449
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/android/source/src/java/org/libreoffice/LOKitTileProvider.java 
b/android/source/src/java/org/libreoffice/LOKitTileProvider.java
index afce177f097e..fa22bc803c9a 100644
--- a/android/source/src/java/org/libreoffice/LOKitTileProvider.java
+++ b/android/source/src/java/org/libreoffice/LOKitTileProvider.java
@@ -120,25 +120,9 @@ class LOKitTileProvider implements TileProvider {
     private void postLoad() {
         mDocument.setMessageCallback(mMessageCallback);
 
-        int parts = mDocument.getParts();
-        Log.i(LOGTAG, "Document parts: " + parts);
-        mContext.getDocumentPartView().clear();
-
+        resetParts();
         // Writer documents always have one part, so hide the navigation 
drawer.
-        if (mDocument.getDocumentType() != Document.DOCTYPE_TEXT) {
-            for (int i = 0; i < parts; i++) {
-                String partName = mDocument.getPartName(i);
-                if (partName.isEmpty()) {
-                    partName = getGenericPartName(i);
-                }
-                Log.i(LOGTAG, "Document part " + i + " name:'" + partName + 
"'");
-
-                mDocument.setPart(i);
-                resetDocumentSize();
-                final DocumentPartView partView = new DocumentPartView(i, 
partName);
-                mContext.getDocumentPartView().add(partView);
-            }
-        } else {
+        if (mDocument.getDocumentType() == Document.DOCTYPE_TEXT) {
             mContext.disableNavigationDrawer();
             mContext.getToolbarController().hideItem(R.id.action_parts);
         }
commit 1b45a30ccd4726612420bd09318eeae2a72425be
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Tue Apr 26 16:21:37 2022 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Apr 27 05:51:04 2022 +0200

    android: Leave part names starting with "Sheet" etc. intact
    
    It's unexpected that opening a Calc sheet with two tables
    called "Sheet foobar" and "Sheet 10" would result in the
    sheets showing up as "Sheet 1" and "Sheet 2" in the parts
    view instead of their real names.
    
    Therefore, leave the original names intact and show
    them instead of generating new generic names.
    
    The change to rename such sheets (and similar parts)
    has been added in
    
        commit 1239dce2595877ad64fd8c8fd927ea4285d69abe
        Date:   Thu Nov 1 22:03:31 2018 +0300
    
            [Pardus] language improvements on Android
    
            More hardcoded strings extrated to the resource file
            Few Turkish language improvements
            This patch is sponsored by ULAKBIM/Pardus project.
    
    where the intention seems to have been to have a
    localized name for the parts show up.
    That still happens when the part name is empty
    (s. lines above), but I think that explicit
    names should remain as they are, as e.g. also
    happens for Calc sheets in the desktop version of
    LibreOffice.
    
    Change-Id: I3073babf99a6b2309be2107141bba92236eba76d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133448
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/android/source/src/java/org/libreoffice/LOKitTileProvider.java 
b/android/source/src/java/org/libreoffice/LOKitTileProvider.java
index 579162931d3a..afce177f097e 100644
--- a/android/source/src/java/org/libreoffice/LOKitTileProvider.java
+++ b/android/source/src/java/org/libreoffice/LOKitTileProvider.java
@@ -130,8 +130,6 @@ class LOKitTileProvider implements TileProvider {
                 String partName = mDocument.getPartName(i);
                 if (partName.isEmpty()) {
                     partName = getGenericPartName(i);
-                }else if (partName.startsWith("Slide") || 
partName.startsWith("Sheet") || partName.startsWith("Part")) {
-                    partName = getGenericPartName(i);
                 }
                 Log.i(LOGTAG, "Document part " + i + " name:'" + partName + 
"'");
 

Reply via email to