summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorThorsten Behrens <thorsten.behrens@allotropia.de>2023-11-20 00:51:56 +0100
committerThorsten Behrens <thorsten.behrens@allotropia.de>2023-11-20 01:07:18 +0100
commit90990aae9e0424d1d0a9e708e1adffbfe7fecfc0 (patch)
tree0ba3f891a44641f453c7638488ac53b932b478a3 /sfx2
parent8bc30d66af5b920d6be2be09d2bf350c8b6aff96 (diff)
Revert "WASM: headless conversion without QT5 and with unique html" feature/wasm
Breaks due to double use of LD_FLAGS (and duplicated embind symbols). Lets back this out for the moment, needs some gbuild debonging. This reverts commit a09b1b9e68c2285289fbf36c7f5fb6a1677e8c39. Change-Id: Idb1348a0b4a55894bb12a2c101d9460bb5e40222
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/objstor.cxx65
-rw-r--r--sfx2/source/doc/objxtor.cxx2
2 files changed, 1 insertions, 66 deletions
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 3a722f026678..b39b5d14ee38 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -3006,37 +3006,6 @@ bool SfxObjectShell::PreDoSaveAs_Impl(const OUString& rFileName, const OUString&
if( bOk )
{
-#ifdef EMSCRIPTEN
- if (aFilterName.endsWith("pdf_Export"))
- {
- try
- {
- sal_Int32 nRead;
- Reference<io::XInputStream> aTempInput = pNewFile->GetInputStream();
- sal_Int32 nBufferSize = 32767;
- Sequence<sal_Int8> aSequence(nBufferSize);
- emscripten::val contentArray = emscripten::val::array();
- do
- {
- nRead = aTempInput->readBytes(aSequence, nBufferSize);
- if (nRead < nBufferSize)
- {
- Sequence<sal_Int8> aTempBuf(aSequence.getConstArray(), nRead);
- ReadWASMFile(contentArray, nRead, aTempBuf);
- }
- else
- {
- ReadWASMFile(contentArray, nRead, aSequence);
- }
- } while (nRead == nBufferSize);
- WriteWASMFile(contentArray, pNewFile->GetName());
- }
- catch (const Exception&)
- {
- }
- }
-#endif
-
if( !bCopyTo )
SetModified( false );
}
@@ -3082,40 +3051,6 @@ bool SfxObjectShell::PreDoSaveAs_Impl(const OUString& rFileName, const OUString&
}
-#ifdef EMSCRIPTEN
-void SfxObjectShell::ReadWASMFile(emscripten::val& contentArray, sal_Int32 nRead, css::uno::Sequence<sal_Int8>& aContent)
-{
- emscripten::val fileContentView = emscripten::val(emscripten::typed_memory_view(
- nRead,
- reinterpret_cast<const char*>(aContent.getConstArray())));
- emscripten::val fileContentCopy = emscripten::val::global("ArrayBuffer").new_(nRead);
- emscripten::val fileContentCopyView = emscripten::val::global("Uint8Array").new_(fileContentCopy);
- fileContentCopyView.call<void>("set", fileContentView);
- contentArray.call<void>("push", fileContentCopyView);
-}
-void SfxObjectShell::WriteWASMFile(emscripten::val& contentArray, const OUString& rFileName)
-{
- INetURLObject aURL(rFileName);
- OUString aNewname = aURL.GetLastName(INetURLObject::DecodeMechanism::WithCharset);
- emscripten::val document = emscripten::val::global("document");
- emscripten::val window = emscripten::val::global("window");
- emscripten::val type = emscripten::val::object();
- type.set("type","application/octet-stream");
- emscripten::val contentBlob = emscripten::val::global("Blob").new_(contentArray, type);
- emscripten::val contentUrl = window["URL"].call<emscripten::val>("createObjectURL", contentBlob);
- emscripten::val contentLink = document.call<emscripten::val>("createElement", std::string("a"));
- contentLink.set("href", contentUrl);
- contentLink.set("download", aNewname.toUtf8().getStr());
- contentLink.set("style", "display:none");
- emscripten::val body = document["body"];
- body.call<void>("appendChild", contentLink);
- contentLink.call<void>("click");
- body.call<void>("removeChild", contentLink);
- window["URL"].call<emscripten::val>("revokeObjectURL", contentUrl);
-}
-#endif
-
-
bool SfxObjectShell::LoadFrom( SfxMedium& /*rMedium*/ )
{
SAL_WARN( "sfx.doc", "Base implementation, must not be called in general!" );
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 5ee43348d0b2..2fd5df242fcc 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -877,7 +877,6 @@ void SfxObjectShell::SetCurrentComponent( const Reference< XInterface >& _rxComp
if ( _rxComponent == xOldCurrentComp )
// nothing to do
return;
- rTheCurrentComponent = _rxComponent;
// note that "_rxComponent.get() == s_xCurrentComponent.get().get()" is /sufficient/, but not
// /required/ for "_rxComponent == s_xCurrentComponent.get()".
// In other words, it's still possible that we here do something which is not necessary,
@@ -885,6 +884,7 @@ void SfxObjectShell::SetCurrentComponent( const Reference< XInterface >& _rxComp
#if HAVE_FEATURE_SCRIPTING
BasicManager* pAppMgr = SfxApplication::GetBasicManager();
+ rTheCurrentComponent = _rxComponent;
if ( !pAppMgr )
return;