desktop/source/app/cmdlineargs.cxx          |    5 +++--
 framework/source/helper/statusindicator.cxx |   10 +++++-----
 package/source/zipapi/ZipFile.cxx           |    2 ++
 sax/source/fastparser/fastparser.cxx        |    4 ++++
 vcl/source/app/svapp.cxx                    |    2 ++
 xmloff/source/core/xmlimp.cxx               |    3 +++
 6 files changed, 19 insertions(+), 7 deletions(-)

New commits:
commit 349f8921bde12f16ad6164ae087f0db1b519da8b
Author:     Armin Le Grand (Allotropia) <armin.le.gr...@me.com>
AuthorDate: Fri Nov 12 17:16:32 2021 +0100
Commit:     Armin Le Grand (Allotropia) <armin.le.gr...@me.com>
CommitDate: Fri Nov 12 17:16:32 2021 +0100

    WASM: Make test file loading work
    
    Change-Id: Ic34104534c3e0e73791cf867bfb2e1246dc79cf8

diff --git a/desktop/source/app/cmdlineargs.cxx 
b/desktop/source/app/cmdlineargs.cxx
index 5f495d5105ec..0b3a9598ea88 100644
--- a/desktop/source/app/cmdlineargs.cxx
+++ b/desktop/source/app/cmdlineargs.cxx
@@ -298,11 +298,12 @@ void CommandLineArgs::ParseCommandLine_Impl( Supplier& 
supplier )
 
     const OUString aWasmTestFile("file:///instdir/example.odt");
     ::osl::File aFile(aWasmTestFile);
-    SAL_INFO("desktop.app", "Testfile: " << aWasmTestFile);
+    SAL_INFO("wasm", "Testfile: " << aWasmTestFile);
     if(aFile.open(osl_File_OpenFlag_Read) == osl::FileBase::E_None)
     {
-        SAL_INFO("desktop.app", "Testfile exists :-)");
+        SAL_INFO("wasm", "Testfile exists :-)");
         aFile.close();
+        m_writer = false; // Writer startup not needed when file exists
         m_openlist.push_back(aWasmTestFile);
     }
 
diff --git a/framework/source/helper/statusindicator.cxx 
b/framework/source/helper/statusindicator.cxx
index 2deb4a0ae5b2..7dcc9018e1f3 100644
--- a/framework/source/helper/statusindicator.cxx
+++ b/framework/source/helper/statusindicator.cxx
@@ -40,7 +40,7 @@ void SAL_CALL StatusIndicator::start(const OUString& sText, 
sal_Int32 nRange)
 
         comphelper::LibreOfficeKit::statusIndicatorStart(sText);
     }
-#if !defined(IOS) && !defined(ANDROID)
+#if !defined(IOS) && !defined(ANDROID) && !defined(EMSCRIPTEN)
     css::uno::Reference<css::task::XStatusIndicatorFactory> 
xFactory(m_xFactory);
     if (xFactory.is())
     {
@@ -58,7 +58,7 @@ void SAL_CALL StatusIndicator::end()
     {
         comphelper::LibreOfficeKit::statusIndicatorFinish();
     }
-#if !defined(IOS) && !defined(ANDROID)
+#if !defined(IOS) && !defined(ANDROID) && !defined(EMSCRIPTEN)
     css::uno::Reference<css::task::XStatusIndicatorFactory> 
xFactory(m_xFactory);
     if (xFactory.is())
     {
@@ -72,7 +72,7 @@ void SAL_CALL StatusIndicator::reset()
 {
     if (comphelper::LibreOfficeKit::isActive())
         return;
-#if !defined(IOS) && !defined(ANDROID)
+#if !defined(IOS) && !defined(ANDROID) && !defined(EMSCRIPTEN)
     css::uno::Reference<css::task::XStatusIndicatorFactory> 
xFactory(m_xFactory);
     if (xFactory.is())
     {
@@ -86,7 +86,7 @@ void SAL_CALL StatusIndicator::setText(const OUString& sText)
 {
     if (comphelper::LibreOfficeKit::isActive())
         return;
-#if !defined(IOS) && !defined(ANDROID)
+#if !defined(IOS) && !defined(ANDROID) && !defined(EMSCRIPTEN)
     css::uno::Reference<css::task::XStatusIndicatorFactory> 
xFactory(m_xFactory);
     if (xFactory.is())
     {
@@ -113,7 +113,7 @@ void SAL_CALL StatusIndicator::setValue(sal_Int32 nValue)
         }
         return;
     }
-#if !defined(IOS) && !defined(ANDROID)
+#if !defined(IOS) && !defined(ANDROID) && !defined(EMSCRIPTEN)
     css::uno::Reference<css::task::XStatusIndicatorFactory> 
xFactory(m_xFactory);
     if (xFactory.is())
     {
diff --git a/package/source/zipapi/ZipFile.cxx 
b/package/source/zipapi/ZipFile.cxx
index 0869d58931c9..db004669cffa 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -652,9 +652,11 @@ uno::Reference< XInputStream > 
ZipFile::createStreamForZipEntry(
     uno::Reference<io::XInputStream> xBufStream;
     static const sal_Int32 nThreadingThreshold = 10000;
 
+#ifndef EMSCRIPTEN
     if( xSrcStream->available() > nThreadingThreshold )
         xBufStream = new XBufferedThreadedStream(xSrcStream, 
xSrcStream->getSize());
     else
+#endif
         xBufStream = new XBufferedStream(xSrcStream);
 
     return xBufStream;
diff --git a/sax/source/fastparser/fastparser.cxx 
b/sax/source/fastparser/fastparser.cxx
index 97435e2219ea..bc4e00ba0349 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -838,6 +838,9 @@ void FastSaxParserImpl::parseStream(const InputSource& 
rStructSource)
         rEntity.mxDocumentHandler->startDocument();
     }
 
+#ifdef EMSCRIPTEN
+    rEntity.mbEnableThreads = false;
+#else
     if (!getenv("SAX_DISABLE_THREADS") && !m_bDisableThreadedParser)
     {
         Reference<css::io::XSeekable> 
xSeekable(rEntity.maStructSource.aInputStream, UNO_QUERY);
@@ -845,6 +848,7 @@ void FastSaxParserImpl::parseStream(const InputSource& 
rStructSource)
         rEntity.mbEnableThreads = (xSeekable.is() && xSeekable->getLength() > 
10000)
                 || (rEntity.maStructSource.aInputStream->available() > 10000);
     }
+#endif
 
     if (rEntity.mbEnableThreads)
     {
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index faaafa3f7cd3..a0b5ecfe5f3d 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -482,6 +482,7 @@ static bool ImplYield(bool i_bWait, bool i_bAllEvents)
 bool Application::Reschedule( bool i_bAllEvents )
 {
 #ifdef EMSCRIPTEN
+    SAL_INFO("wasm", "Application::Reschedule(" << i_bAllEvents << ")");
     (void) i_bAllEvents;
     std::abort();
 #else
@@ -541,6 +542,7 @@ SAL_DLLPUBLIC_EXPORT void unit_lok_process_events_to_idle()
 void Application::Yield()
 {
 #ifdef EMSCRIPTEN
+    SAL_INFO("wasm", "Application::Yield()");
     std::abort();
 #else
     ImplYield(true, false);
diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx
index 6fa0830ff68b..762b7577dea7 100644
--- a/xmloff/source/core/xmlimp.cxx
+++ b/xmloff/source/core/xmlimp.cxx
@@ -1567,6 +1567,9 @@ void SvXMLImport::SetAutoStyles( SvXMLStylesContext 
*pAutoStyles )
     mxAutoStyles = pAutoStyles;
     GetTextImport()->SetAutoStyles( pAutoStyles );
     GetShapeImport()->SetAutoStylesContext( pAutoStyles );
+#ifdef EMSCRIPTEN
+    if(GetChartImport().is())
+#endif
     GetChartImport()->SetAutoStylesContext( pAutoStyles );
     GetFormImport()->setAutoStyleContext( pAutoStyles );
 }

Reply via email to