desktop/source/app/cmdlineargs.cxx   |   10 ++++++++++
 static/CustomTarget_wasm_fs_image.mk |    1 +
 2 files changed, 11 insertions(+)

New commits:
commit 48d3d9600ea0bb45c32bbb1467ded6370dc59463
Author:     Armin Le Grand (Allotropia) <armin.le.gr...@me.com>
AuthorDate: Fri Nov 5 17:24:14 2021 +0100
Commit:     Armin Le Grand (Allotropia) <armin.le.gr...@me.com>
CommitDate: Fri Nov 5 17:24:14 2021 +0100

    Added loading a test file at WASM startup
    
    file is example.odt which is already part of LO, please
    copy to insdir for now by using
    
    cp /android/default-document/example.odt /instdir
    
    this should of course be automated, need to figure
    out how instdir is filled.
    
    Change-Id: Icecd700184d2287b30203bd9fc03634b5c787ad8

diff --git a/desktop/source/app/cmdlineargs.cxx 
b/desktop/source/app/cmdlineargs.cxx
index e5f354ac7935..5f495d5105ec 100644
--- a/desktop/source/app/cmdlineargs.cxx
+++ b/desktop/source/app/cmdlineargs.cxx
@@ -296,6 +296,16 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& 
supplier )
 
     m_bEmpty = false;
 
+    const OUString aWasmTestFile("file:///instdir/example.odt");
+    ::osl::File aFile(aWasmTestFile);
+    SAL_INFO("desktop.app", "Testfile: " << aWasmTestFile);
+    if(aFile.open(osl_File_OpenFlag_Read) == osl::FileBase::E_None)
+    {
+        SAL_INFO("desktop.app", "Testfile exists :-)");
+        aFile.close();
+        m_openlist.push_back(aWasmTestFile);
+    }
+
 #else
 
     m_cwdUrl = supplier.getCwdUrl();
diff --git a/static/CustomTarget_wasm_fs_image.mk 
b/static/CustomTarget_wasm_fs_image.mk
index b999811be389..1b2d607881b7 100644
--- a/static/CustomTarget_wasm_fs_image.mk
+++ b/static/CustomTarget_wasm_fs_image.mk
@@ -26,6 +26,7 @@ gb_wasm_image_filelist := \
     $(INSTROOT)/$(LIBO_ETC_FOLDER)/services/services.rdb \
     $(INSTROOT)/$(LIBO_URE_ETC_FOLDER)/$(call gb_Helper_get_rcfile,uno) \
     $(INSTROOT)/$(LIBO_URE_MISC_FOLDER)/services.rdb \
+    $(INSTROOT)/example.odt \
     $(INSTROOT)/program/resource/common/fonts/opens___.ttf \
     $(INSTROOT)/program/shell/logo_inverted.svg \
     $(INSTROOT)/program/shell/logo-sc.svg \

Reply via email to