summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2023-04-23 20:49:33 +0100
committerCaolán McNamara <caolanm@redhat.com>2023-04-24 13:57:20 +0200
commit5be0f62621a5ef66438cf2dc660be8e524588c15 (patch)
tree7671f8060f54527ef48adad89231bc7e3e0e86f7
parent5951e37eb24e09d3c24cb4cab4b0f3da41e3dfff (diff)
tdf#147503 don't use SfxObjectShellLock for new xml forms document
because in the hidden case the document is unexpectedly closed on leaving NewXForms Change-Id: I00ea0b8de6c10ff141584cefe3768b7071138393 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150891 Tested-by: Jenkins Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--cui/source/dialogs/hldocntp.cxx1
-rw-r--r--sw/source/uibase/app/apphdl.cxx4
2 files changed, 2 insertions, 3 deletions
diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index 5160d934cce9..4bdb56ea0658 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -287,7 +287,6 @@ IMPL_STATIC_LINK(SvxHyperlinkNewDocTp, DispatchDocument, void*, p, void)
{
SfxStringItem aNewName( SID_FILE_NAME, xExecuteInfo->aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
SfxUnoFrameItem aDocFrame( SID_FILLFRAME, pViewFrame->GetFrame().GetFrameInterface() );
- fprintf(stderr, "is there a frame int %p\n", pViewFrame->GetFrame().GetFrameInterface().get() );
pViewFrame->GetDispatcher()->ExecuteList(
SID_SAVEASDOC, SfxCallMode::SYNCHRON,
{ &aNewName }, { &aDocFrame });
diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index 086002ce712e..dcdb31ae8bc3 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -1119,11 +1119,11 @@ void NewXForms( SfxRequest& rReq )
// copied & excerpted from SwModule::InsertLab(..)
// create new document
- SfxObjectShellLock xDocSh( new SwDocShell( SfxObjectCreateMode::STANDARD) );
+ SwDocShellRef xDocSh( new SwDocShell( SfxObjectCreateMode::STANDARD) );
xDocSh->DoInitNew();
// initialize XForms
- static_cast<SwDocShell*>( &xDocSh )->GetDoc()->initXForms( true );
+ xDocSh->GetDoc()->initXForms(true);
// load document into frame
SfxViewFrame::DisplayNewDocument( *xDocSh, rReq );