Skip to content
This repository was archived by the owner on Feb 18, 2025. It is now read-only.

Commit b6028d7

Browse files
authored
[M273] - Fix switching between documents (#98)
2 parents c4dec3c + 4635ea2 commit b6028d7

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.1.7
1+
v0.1.8

libreoffice-core/desktop/source/lib/wasm_extensions.cxx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,18 @@ WasmDocumentExtension::loadFromExpanded(LibreOfficeKit* pThis,
296296
// throughout the load process.
297297
comphelper::OStorageHelper::SetIsExpandedStorage(true);
298298
comphelper::OStorageHelper::SetExpandedStorage(xStorage);
299-
comphelper::OStorageHelper::SetExpandedStorageBase(storageBase);
299+
300+
301+
/*
302+
storage instance MUST be set before storage base
303+
instance and base are the same objects, just casted differently
304+
instance is stored in an uno::Reference while base is stored in a shared_ptr
305+
306+
if the base is released first (as the shared_ptr is set), the uno reference
307+
has a bad time when it tries to access a null object at with it's pointer
308+
*/
300309
comphelper::OStorageHelper::SetExpandedStorageInstance(storage);
310+
comphelper::OStorageHelper::SetExpandedStorageBase(storageBase);
301311

302312
utl::MediaDescriptor aMediaDescriptor;
303313

qa-env/src/OfficeDocument/OfficeDocument.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,12 @@ export function OfficeDocument(props: Props) {
154154
};
155155
props.doc.on(CallbackType.DOCUMENT_SIZE_CHANGED, callback);
156156
onCleanup(() => {
157-
props.doc.off(CallbackType.DOCUMENT_SIZE_CHANGED, callback);
157+
// m273 this needs to be fixed, but this only occurs in this repo
158+
try {
159+
props.doc.off(CallbackType.DOCUMENT_SIZE_CHANGED, callback);
160+
} catch (e) {
161+
console.log('error', e);
162+
}
158163
});
159164
});
160165

0 commit comments

Comments
 (0)