sfx2/source/view/viewfrm.cxx |   26 --------------------------
 1 file changed, 26 deletions(-)

New commits:
commit b1d54e724ae360a22e08ef20e83a81804ebfae21
Author:     Michael Stahl <michael.st...@allotropia.de>
AuthorDate: Tue Jul 19 16:34:14 2022 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Wed Jul 27 10:08:16 2022 +0200

    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.st...@allotropia.de>
    (cherry picked from commit a1ca68e91868df51a269682f7c3dac62a88a85ef)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137421
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 3e09372dd781..da5477928f51 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
                 {

Reply via email to