summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2022-07-19 16:34:14 +0200
committerMichael Stahl <michael.stahl@allotropia.de>2022-07-19 17:55:26 +0200
commita1ca68e91868df51a269682f7c3dac62a88a85ef (patch)
tree044047033e0ccefddf4abffe2a948692226ef2a1 /sfx2
parent0ef286389e4f40fd59890937c6c6b1e7ce4a5064 (diff)
tdf#149170 sfx2: fix regression about spurious dialog
Open a document that is locked, choose Read-Only, then click "Edit" on infobar: it is still locked, so a dialog pops up. Click "Cancel". Now a *second* dialog pops up that *again* asks if you want to open a copy of the document - this appears pointless so let's remove it. Change-Id: Id96a1211caea63e7559c67b08a6581d1a0ce9add Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137234 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/view/viewfrm.cxx26
1 files changed, 0 insertions, 26 deletions
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index f0f539ca675d..1e4ad7085fad 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -765,9 +765,6 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
// Do not cache the old Document! Is invalid when loading
// another document.
- const SfxStringItem* pSavedOptions = SfxItemSet::GetItem<SfxStringItem>(pMedium->GetItemSet(), SID_FILE_FILTEROPTIONS, false);
- const SfxStringItem* pSavedReferer = SfxItemSet::GetItem<SfxStringItem>(pMedium->GetItemSet(), SID_REFERER, false);
-
bool bHasStorage = pMedium->HasStorage_Impl();
if( bHandsOff )
{
@@ -812,29 +809,6 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
xOldObj->DoSaveCompleted( pMedium );
}
-
- // r/o-Doc couldn't be switched to writing mode
- if ( bForEdit && ( SID_EDITDOC == rReq.GetSlot() || SID_READONLYDOC == rReq.GetSlot() ) )
- {
- // ask user for opening as template
- std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetWindow().GetFrameWeld(),
- VclMessageType::Question, VclButtonsType::YesNo,
- SfxResId(STR_QUERY_OPENASTEMPLATE)));
- if (RET_YES == xBox->run())
- {
- SfxAllItemSet aSet( pApp->GetPool() );
- aSet.Put( SfxStringItem( SID_FILE_NAME, pMedium->GetName() ) );
- aSet.Put( SfxStringItem( SID_TARGETNAME, "_blank" ) );
- if ( pSavedOptions )
- aSet.Put( *pSavedOptions );
- if ( pSavedReferer )
- aSet.Put( *pSavedReferer );
- aSet.Put( SfxBoolItem( SID_TEMPLATE, true ) );
- if( pFilter )
- aSet.Put( SfxStringItem( SID_FILTER_NAME, pFilter->GetFilterName() ) );
- GetDispatcher()->Execute( SID_OPENDOC, SfxCallMode::ASYNCHRON, aSet );
- }
- }
}
else
{