solenv/bin/native-code.py                             |    2 ++
 writerperfect/source/calc/MSWorksCalcImportFilter.cxx |    6 ++++++
 writerperfect/source/writer/MSWorksImportFilter.cxx   |    6 ++++++
 3 files changed, 14 insertions(+)

New commits:
commit 2e41a82fc5091b00e6460947003dab5a5ec10233
Author:     Michael Weghorn <[email protected]>
AuthorDate: Thu Feb 19 14:11:10 2026 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Tue Feb 24 13:13:51 2026 +0100

    tdf#170561 android: Don't try to show MS Works encoding dialog
    
    Showing dialogs isn't supported in Android Viewer.
    Therefore, don't try to show MSWorksImportFilter
    dialog to ask for the encoding to use there, but
    use the default encoding determined previously.
    
    With this in place, the same file from tdf#170561
    is displayed fine when e.g. opened from the Material
    Files file manager [1].
    (It can't be selected when trying to open a file from
    within the app, though, probably due to the MIME type
    determined by Android not matching any of those that
    are declared as supported.)
    
    [1] https://f-droid.org/en/packages/me.zhanghai.android.files/
    
    Change-Id: I19b7cc2efb88b6d594b4d44015ddc55b67014871
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199723
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx 
b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
index af64c05d666f..1cd595b25d63 100644
--- a/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
+++ b/writerperfect/source/calc/MSWorksCalcImportFilter.cxx
@@ -240,6 +240,11 @@ bool 
MSWorksCalcImportFilter::doImportDocument(weld::Window* pParent,
             }
 
             fileEncoding = encoding.toUtf8().getStr(); // set default to the 
proposed encoding
+#ifdef ANDROID
+            // Dialogs are not supported on Android
+            (void)pParent;
+            (void)title;
+#else
             try
             {
                 writerperfect::WPFTEncodingDialog aDlg(pParent, title, 
encoding);
@@ -257,6 +262,7 @@ bool 
MSWorksCalcImportFilter::doImportDocument(weld::Window* pParent,
                 SAL_WARN("writerperfect",
                          "ignoring Exception in 
MSWorksCalcImportFilter::doImportDocument");
             }
+#endif
         }
     }
     OString aUtf8Passwd;
diff --git a/writerperfect/source/writer/MSWorksImportFilter.cxx 
b/writerperfect/source/writer/MSWorksImportFilter.cxx
index 5609714d5a90..8c69c283f457 100644
--- a/writerperfect/source/writer/MSWorksImportFilter.cxx
+++ b/writerperfect/source/writer/MSWorksImportFilter.cxx
@@ -74,6 +74,11 @@ bool MSWorksImportFilter::doImportDocument(weld::Window* 
pParent,
             }
 
             fileEncoding = encoding.toUtf8().getStr(); // set default to the 
proposed encoding
+#ifdef ANDROID
+            // Dialogs are not supported on Android
+            (void)pParent;
+            (void)title;
+#else
             try
             {
                 writerperfect::WPFTEncodingDialog aDlg(pParent, title, 
encoding);
@@ -90,6 +95,7 @@ bool MSWorksImportFilter::doImportDocument(weld::Window* 
pParent,
             {
                 TOOLS_WARN_EXCEPTION("writerperfect", "ignoring");
             }
+#endif
         }
     }
     return libwps::WPS_OK
commit 22f3a3a4f88f9fdbc5448a1c51cd22e48096ff71
Author:     Michael Weghorn <[email protected]>
AuthorDate: Thu Feb 19 13:58:51 2026 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Tue Feb 24 13:13:44 2026 +0100

    tdf#170561 android: Add services needed to open MS Works file to native-code
    
    These two services are e.g. required to open the sample file
    from tdf#170561 with Android Viewer.
    
    Related ADB logcat output when trying to open the
    file without them included:
    
        2026-02-19 13:57:53.651  5790-8483  cppuhelper              
org.libreoffice                      W  8:cppuhelper/source/shlib.cxx:298: 
unknown constructor name 
"com_sun_star_comp_Writer_MSWorksImportFilter_get_implementation"
        [...]
        2026-02-19 13:57:53.763  5790-8483  cppuhelper              
org.libreoffice                      W  8:cppuhelper/source/shlib.cxx:298: 
unknown constructor name 
"com_sun_star_comp_Writer_MWAWImportFilter_get_implementation"
    
    Another issue still needs to be addressed before the file
    can actually be displayed.
    
    Change-Id: I71664ec2dd2088cd35291fd33db60d1c4bc98fc9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/199722
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index a5ce23de55ca..9f0fbaea3b82 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -738,6 +738,8 @@ writer_constructor_list = [
     "com_sun_star_comp_Writer_WriterFilter_get_implementation",
 # writerperfect/source/writer/wpftwriter.component
     "com_sun_star_comp_Writer_EPUBExportFilter_get_implementation",
+    "com_sun_star_comp_Writer_MSWorksImportFilter_get_implementation",
+    "com_sun_star_comp_Writer_MWAWImportFilter_get_implementation",
 # sw/util/swui.component
     ("com_sun_star_text_DialogFactoryService_get_implementation", "#if 
!ENABLE_FUZZERS"),
     ]

Reply via email to