[Libreoffice-commits] core.git: sc/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Sun May 12 15:37:14 UTC 2019


 sc/source/ui/docshell/docsh4.cxx   |    5 ++---
 sc/source/ui/drawfunc/drawsh.cxx   |    8 ++++----
 sc/source/ui/drawfunc/drtxtob.cxx  |    3 +--
 sc/source/ui/drawfunc/drtxtob1.cxx |    3 +--
 sc/source/ui/drawfunc/graphsh.cxx  |    3 +--
 sc/source/ui/inc/tabvwsh.hxx       |    2 +-
 sc/source/ui/view/cellsh1.cxx      |   12 ++++--------
 sc/source/ui/view/cellsh3.cxx      |    6 ++----
 sc/source/ui/view/dbfunc.cxx       |    6 ++----
 sc/source/ui/view/dbfunc3.cxx      |    5 ++---
 sc/source/ui/view/editsh.cxx       |    3 +--
 sc/source/ui/view/tabvwsh3.cxx     |   14 +++++---------
 sc/source/ui/view/tabvwshf.cxx     |   10 ++++------
 sc/source/ui/view/viewfun2.cxx     |    6 ++----
 sc/source/ui/view/viewfun3.cxx     |   12 ++++--------
 sc/source/ui/view/viewfun4.cxx     |    3 +--
 sc/source/ui/view/viewfunc.cxx     |    3 +--
 17 files changed, 38 insertions(+), 66 deletions(-)

New commits:
commit 7cfacfd4e990d5b8fd2cb3045cf632b9dd957023
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat May 11 21:42:04 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun May 12 17:36:02 2019 +0200

    drop intermediate vcl::Window
    
    Change-Id: If06902f0308511fb40b031899c912c36da0b610e
    Reviewed-on: https://gerrit.libreoffice.org/72167
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 8d10df639169..945e98092521 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -763,9 +763,8 @@ void ScDocShell::Execute( SfxRequest& rReq )
                     m_pImpl->pDocInserter.reset();
 
                     ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
-                    vcl::Window* pParent = pViewSh ? pViewSh->GetDialogParent() : nullptr;
-
-                    m_pImpl->pDocInserter.reset( new ::sfx2::DocumentInserter(pParent ? pParent->GetFrameWeld() : nullptr,
+                    weld::Window* pParent = pViewSh ? pViewSh->GetFrameWeld() : nullptr;
+                    m_pImpl->pDocInserter.reset( new ::sfx2::DocumentInserter(pParent,
                         ScDocShell::Factory().GetFactoryName(), mode ) );
                     m_pImpl->pDocInserter->StartExecuteModal( LINK( this, ScDocShell, DialogClosedHdl ) );
                     return ;
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 76e8f6856fee..c510d685248b 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -409,9 +409,9 @@ void ScDrawShell::ExecuteAreaDlg( SfxRequest& rReq )
         pView->MergeAttrFromMarked( aNewAttr, false );
 
     SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-    vcl::Window* pWin = pViewData->GetDialogParent();
+    weld::Window* pWin = pViewData->GetFrameWeld();
     ScopedVclPtr<AbstractSvxAreaTabDialog> pDlg(pFact->CreateSvxAreaTabDialog(
-        pWin ? pWin->GetFrameWeld() : nullptr, &aNewAttr,
+        pWin, &aNewAttr,
         pViewData->GetDocument()->GetDrawLayer(), true));
 
     if ( pDlg->Execute() == RET_OK )
@@ -436,8 +436,8 @@ void ScDrawShell::ExecuteTextAttrDlg( SfxRequest& rReq )
         pView->MergeAttrFromMarked( aNewAttr, false );
 
     SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-    vcl::Window* pWin = pViewData->GetDialogParent();
-    ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog(pWin ? pWin->GetFrameWeld() : nullptr, &aNewAttr, pView));
+    weld::Window* pWin = pViewData->GetFrameWeld();
+    ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog(pWin, &aNewAttr, pView));
 
     sal_uInt16 nResult = pDlg->Execute();
 
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index 87777cf184a9..1100de6da90d 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -866,8 +866,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
             case SID_DRAWTEXT_ATTR_DLG:
                 {
                     SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-                    vcl::Window* pWin = pViewData->GetDialogParent();
-                    ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog( pWin ? pWin->GetFrameWeld() : nullptr, &aEditAttr, pView ));
+                    ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateTextTabDialog(pViewData->GetFrameWeld(), &aEditAttr, pView));
 
                     bDone = ( RET_OK == pDlg->Execute() );
 
diff --git a/sc/source/ui/drawfunc/drtxtob1.cxx b/sc/source/ui/drawfunc/drtxtob1.cxx
index 183362cf0b9e..401c954a2065 100644
--- a/sc/source/ui/drawfunc/drtxtob1.cxx
+++ b/sc/source/ui/drawfunc/drtxtob1.cxx
@@ -102,8 +102,7 @@ void ScDrawTextObjectBar::ExecutePasteContents( SfxRequest & /* rReq */ )
     SdrView* pView = pViewData->GetScDrawView();
     OutlinerView* pOutView = pView->GetTextEditOutlinerView();
     SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-    vcl::Window* pWin = pViewData->GetDialogParent();
-    ScopedVclPtr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog(pWin ? pWin->GetFrameWeld() : nullptr));
+    ScopedVclPtr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog(pViewData->GetFrameWeld()));
 
     pDlg->Insert( SotClipboardFormatId::STRING, EMPTY_OUSTRING );
     pDlg->Insert( SotClipboardFormatId::RTF,    EMPTY_OUSTRING );
diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx
index e1c39b39e3a3..61c3899a3fae 100644
--- a/sc/source/ui/drawfunc/graphsh.cxx
+++ b/sc/source/ui/drawfunc/graphsh.cxx
@@ -199,8 +199,7 @@ void ScGraphicShell::ExecuteCompressGraphic( SAL_UNUSED_PARAMETER SfxRequest& )
         if( dynamic_cast<const SdrGrafObj*>( pObj) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap )
         {
             SdrGrafObj* pGraphicObj = static_cast<SdrGrafObj*>(pObj);
-            vcl::Window* pWin = GetViewData()->GetDialogParent();
-            CompressGraphicsDialog dialog(pWin ? pWin->GetFrameWeld() : nullptr, pGraphicObj, GetViewData()->GetBindings());
+            CompressGraphicsDialog dialog(GetViewData()->GetFrameWeld(), pGraphicObj, GetViewData()->GetBindings());
             if (dialog.run() == RET_OK)
             {
                 SdrGrafObj* pNewObject = dialog.GetCompressedSdrGrafObj();
diff --git a/sc/source/ui/inc/tabvwsh.hxx b/sc/source/ui/inc/tabvwsh.hxx
index 1d5ab9612d0a..a738669dd7d1 100644
--- a/sc/source/ui/inc/tabvwsh.hxx
+++ b/sc/source/ui/inc/tabvwsh.hxx
@@ -224,7 +224,7 @@ public:
 
     virtual         ~ScTabViewShell() override;
 
-    vcl::Window* GetDialogParent();
+    vcl::Window*    GetDialogParent();
 
     bool            IsRefInputMode() const;
     void            ExecuteInputDirect();
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 791716a66faf..bd751a4d1540 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2022,8 +2022,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                 // or should create a new overlapping conditional format
                 if(bContainsCondFormat && !bCondFormatDlg && bContainsExistingCondFormat)
                 {
-                    vcl::Window* pWin = pTabViewShell->GetDialogParent();
-                    std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+                    std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pTabViewShell->GetFrameWeld(),
                                                                    VclMessageType::Question, VclButtonsType::YesNo,
                                                                    ScResId(STR_EDIT_EXISTING_COND_FORMATS)));
                     xQueryBox->set_default_response(RET_YES);
@@ -2541,9 +2540,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
                 if (!pList)
                     pList = pDoc->GetCondFormList( aPos.Tab() );
 
-                vcl::Window* pWin = pTabViewShell->GetDialogParent();
                 VclPtr<AbstractScCondFormatManagerDlg> pDlg(pFact->CreateScCondFormatMgrDlg(
-                    pWin ? pWin->GetFrameWeld() : nullptr, pDoc, pList));
+                    pTabViewShell->GetFrameWeld(), pDoc, pList));
 
                 if (pDlgItem)
                     pDlg->SetModified();
@@ -2918,8 +2916,7 @@ void ScCellShell::ExecuteDataPilotDialog()
                     if ( pDoc->HasSubTotalCells( aRange ) )
                     {
                         //  confirm selection if it contains SubTotal cells
-                        vcl::Window* pWin = pTabViewShell->GetDialogParent();
-                        std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+                        std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pTabViewShell->GetFrameWeld(),
                                                                        VclMessageType::Question, VclButtonsType::YesNo,
                                                                        ScResId(STR_DATAPILOT_SUBTOTAL)));
                         xQueryBox->set_default_response(RET_YES);
@@ -2950,8 +2947,7 @@ void ScCellShell::ExecuteDataPilotDialog()
         if (pSrcErrorId)
         {
             // Error occurred during data creation.  Launch an error and bail out.
-            vcl::Window* pWin = pTabViewShell->GetDialogParent();
-            std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+            std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pTabViewShell->GetFrameWeld(),
                                                           VclMessageType::Info, VclButtonsType::Ok,
                                                           ScResId(pSrcErrorId)));
             xInfoBox->run();
diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx
index 3f1569bfa405..621427d69eda 100644
--- a/sc/source/ui/view/cellsh3.cxx
+++ b/sc/source/ui/view/cellsh3.cxx
@@ -423,8 +423,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
                         bool bExtend = rReq.IsAPI();
                         if (!bExtend)
                         {
-                            vcl::Window* pWin = pTabViewShell->GetDialogParent();
-                            std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+                            std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pTabViewShell->GetFrameWeld(),
                                                                            VclMessageType::Question, VclButtonsType::YesNo,
                                                                            ScResId(STR_UPDATE_SCENARIO)));
                             xQueryBox->set_default_response(RET_YES);
@@ -439,8 +438,7 @@ void ScCellShell::Execute( SfxRequest& rReq )
                     }
                     else if( ! rReq.IsAPI() )
                     {
-                        vcl::Window* pWin = pTabViewShell->GetDialogParent();
-                        std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+                        std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(pTabViewShell->GetFrameWeld(),
                                                                        VclMessageType::Warning, VclButtonsType::Ok,
                                                                        ScResId(STR_NOAREASELECTED)));
                         xErrorBox->run();
diff --git a/sc/source/ui/view/dbfunc.cxx b/sc/source/ui/view/dbfunc.cxx
index d5064b41ae0d..b82762b7212b 100644
--- a/sc/source/ui/view/dbfunc.cxx
+++ b/sc/source/ui/view/dbfunc.cxx
@@ -342,8 +342,7 @@ void ScDBFunc::ToggleAutoFilter()
         {
             if (!bHeader)
             {
-                vcl::Window* pWin = GetViewData().GetDialogParent();
-                std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+                std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetViewData().GetFrameWeld(),
                                                           VclMessageType::Question,
                                                           VclButtonsType::YesNo, ScResId(STR_MSSG_MAKEAUTOFILTER_0))); // header from first row?
                 xBox->set_title(ScResId(STR_MSSG_DOSUBTOTALS_0)); // "StarCalc"
@@ -372,8 +371,7 @@ void ScDBFunc::ToggleAutoFilter()
         }
         else
         {
-            vcl::Window* pWin = GetViewData().GetDialogParent();
-            std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+            std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(GetViewData().GetFrameWeld(),
                                                            VclMessageType::Warning, VclButtonsType::Ok,
                                                            ScResId(STR_ERR_AUTOFILTER)));
             xErrorBox->run();
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 40bd881535f0..7a7946be7b32 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -418,14 +418,13 @@ void ScDBFunc::DoSubTotals( const ScSubTotalParam& rParam, bool bRecord,
         return;
     }
 
-    WaitObject aWait( GetViewData().GetDialogParent() );
+    weld::WaitObject aWait(GetViewData().GetFrameWeld());
     bool bOk = true;
     if (rParam.bReplace)
     {
         if (rDoc.TestRemoveSubTotals( nTab, rParam ))
         {
-            vcl::Window* pWin = GetViewData().GetDialogParent();
-            std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+            std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetViewData().GetFrameWeld(),
                                                       VclMessageType::Question, VclButtonsType::YesNo,
                                                       ScResId(STR_MSSG_DOSUBTOTALS_1))); // "delete data?"
             xBox->set_title(ScResId(STR_MSSG_DOSUBTOTALS_0)); // "StarCalc"
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 100592811994..05ad3a5c4283 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -270,8 +270,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
         case SID_PASTE_SPECIAL:
             {
                 SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-                vcl::Window* pWin = pViewData->GetDialogParent();
-                ScopedVclPtr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog(pWin ? pWin->GetFrameWeld() : nullptr));
+                ScopedVclPtr<SfxAbstractPasteDialog> pDlg(pFact->CreatePasteDialog(pViewData->GetFrameWeld()));
                 SotClipboardFormatId nFormat = SotClipboardFormatId::NONE;
                 pDlg->Insert( SotClipboardFormatId::STRING, EMPTY_OUSTRING );
                 pDlg->Insert( SotClipboardFormatId::RTF,    EMPTY_OUSTRING );
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index 002a846482fa..f55d280adaa1 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -732,8 +732,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
                     aZoomItem.SetValueSet( nBtnFlags );
                     aSet.Put( aZoomItem );
                     SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
-                    vcl::Window* pWin = GetDialogParent();
-                    pDlg.disposeAndReset(pFact->CreateSvxZoomDialog(pWin ? pWin->GetFrameWeld() : nullptr, aSet));
+                    pDlg.disposeAndReset(pFact->CreateSvxZoomDialog(GetFrameWeld(), aSet));
                     pDlg->SetLimits( MINZOOM, MAXZOOM );
 
                     bCancel = ( RET_CANCEL == pDlg->Execute() );
@@ -1050,7 +1049,6 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
                     }
                 }
 
-                vcl::Window* pWin = GetDialogParent();
                 ScDocProtection* pProtect = pDoc->GetDocProtection();
                 if (pProtect && pProtect->isProtected())
                 {
@@ -1061,7 +1059,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
                     {
                         OUString aText(ScResId(SCSTR_PASSWORD));
 
-                        SfxPasswordDialog aDlg(pWin ? pWin->GetFrameWeld() : nullptr, &aText);
+                        SfxPasswordDialog aDlg(GetFrameWeld(), &aText);
                         aDlg.set_title(ScResId(SCSTR_UNPROTECTDOC));
                         aDlg.SetMinLen(0);
                         aDlg.set_help_id(GetStaticInterface()->GetSlot(FID_PROTECT_DOC)->GetCommand());
@@ -1083,7 +1081,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
                 {
                     OUString aText(ScResId(SCSTR_PASSWORDOPT));
 
-                    SfxPasswordDialog aDlg(pWin ? pWin->GetFrameWeld() : nullptr, &aText);
+                    SfxPasswordDialog aDlg(GetFrameWeld(), &aText);
                     aDlg.set_title(ScResId(SCSTR_PROTECTDOC));
                     aDlg.SetMinLen( 0 );
                     aDlg.set_help_id(GetStaticInterface()->GetSlot(FID_PROTECT_DOC)->GetCommand());
@@ -1130,8 +1128,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
                 if (pProtect && pProtect->isProtectedWithPass())
                 {
                     OUString aText( ScResId(SCSTR_PASSWORDOPT) );
-                    vcl::Window* pWin = GetDialogParent();
-                    SfxPasswordDialog aDlg(pWin ? pWin->GetFrameWeld() : nullptr, &aText);
+                    SfxPasswordDialog aDlg(GetFrameWeld(), &aText);
                     aDlg.set_title(ScResId(SCSTR_UNPROTECTTAB));
                     aDlg.SetMinLen(0);
                     aDlg.set_help_id(GetStaticInterface()->GetSlot(FID_PROTECT_TABLE)->GetCommand());
@@ -1157,8 +1154,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
             {
                 // Protect a current sheet.
 
-                vcl::Window* pWin = GetDialogParent();
-                ScTableProtectionDlg aDlg(pWin ? pWin->GetFrameWeld() : nullptr);
+                ScTableProtectionDlg aDlg(GetFrameWeld());
 
                 ScTableProtection* pProtect = pDoc->GetTabProtection(nTab);
                 if (pProtect)
diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index 03e7e7f51090..fadba4acd6b6 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -392,9 +392,8 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
 
                     ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
 
-                    vcl::Window* pWin = GetDialogParent();
                     ScopedVclPtr<AbstractScStringInputDlg> pDlg(pFact->CreateScStringInputDlg(
-                        pWin ? pWin->GetFrameWeld() : nullptr, aDlgTitle, ScResId(SCSTR_NAME),
+                        GetFrameWeld(), aDlgTitle, ScResId(SCSTR_NAME),
                         aName, GetStaticInterface()->GetSlot(nSlot)->GetCommand(),
                         pHelpId));
 
@@ -432,7 +431,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
                                 }
                                 else
                                 {
-                                    std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+                                    std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(),
                                                                               VclMessageType::Warning, VclButtonsType::Ok, aErrMsg));
                                     nRet = xBox->run();
                                 }
@@ -621,10 +620,9 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
                         }
                     }
 
-                    vcl::Window* pWin = GetDialogParent();
                     if (bTabWithPivotTable)
                     {
-                        std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+                        std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(),
                                                                        VclMessageType::Question, VclButtonsType::YesNo,
                                                                        ScResId(STR_QUERY_PIVOTTABLE_DELTAB)));
                         xQueryBox->set_default_response(RET_NO);
@@ -634,7 +632,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
                     }
                     else
                     {
-                        std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+                        std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetFrameWeld(),
                                                                        VclMessageType::Question, VclButtonsType::YesNo,
                                                                        ScResId(STR_QUERY_DELTAB)));
                         xQueryBox->set_default_response(RET_YES);
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index bc8a0551417f..7cc06cdd44c8 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -1182,8 +1182,7 @@ bool ScViewFunc::MergeCells( bool bApi, bool& rDoContents, bool bCenter )
         bool bShowDialog = officecfg::Office::Calc::Compatibility::MergeCells::ShowDialog::get();
         if (!bApi && bShowDialog)
         {
-            vcl::Window* pWin = GetViewData().GetDialogParent();
-            ScMergeCellsDialog aBox(pWin ? pWin->GetFrameWeld() : nullptr);
+            ScMergeCellsDialog aBox(GetViewData().GetFrameWeld());
             sal_uInt16 nRetVal = aBox.run();
 
             if ( nRetVal == RET_OK )
@@ -2122,8 +2121,7 @@ void ScViewFunc::Solve( const ScSolveParam& rParam )
             aMsgStr += ScResId( STR_MSSG_SOLVE_4 );
         }
 
-        vcl::Window* pWin = GetViewData().GetDialogParent();
-        std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+        std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetViewData().GetFrameWeld(),
                                                   VclMessageType::Question, VclButtonsType::YesNo, aMsgStr));
         xBox->set_title(ScResId(STR_MSSG_DOSUBTOTALS_0));
         xBox->set_default_response(RET_NO);
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 84cbdcfe9a5e..2dbc3e9a55a8 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -1062,8 +1062,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc,
             ScWaitCursorOff aWaitOff( GetFrameWin() );
             OUString aMessage = ScResId( STR_PASTE_BIGGER );
 
-            vcl::Window* pWin = GetViewData().GetDialogParent();
-            std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+            std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetViewData().GetFrameWeld(),
                                                            VclMessageType::Question, VclButtonsType::YesNo,
                                                            aMessage));
             xQueryBox->set_default_response(RET_NO);
@@ -1151,8 +1150,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc,
         if ( bAskIfNotEmpty )
         {
             ScRangeList aTestRanges(aUserRange);
-            vcl::Window* pWin = GetViewData().GetDialogParent();
-            if (!checkDestRangeForOverwrite(aTestRanges, pDoc, aFilteredMark, pWin ? pWin->GetFrameWeld() : nullptr))
+            if (!checkDestRangeForOverwrite(aTestRanges, pDoc, aFilteredMark, GetViewData().GetFrameWeld()))
                 return false;
         }
     }
@@ -1519,8 +1517,7 @@ bool ScViewFunc::PasteMultiRangesFromClip(
     if (bAskIfNotEmpty)
     {
         ScRangeList aTestRanges(aMarkedRange);
-        vcl::Window* pWin = GetViewData().GetDialogParent();
-        if (!checkDestRangeForOverwrite(aTestRanges, pDoc, aMark, pWin ? pWin->GetFrameWeld() : nullptr))
+        if (!checkDestRangeForOverwrite(aTestRanges, pDoc, aMark, GetViewData().GetFrameWeld()))
             return false;
     }
 
@@ -1682,8 +1679,7 @@ bool ScViewFunc::PasteFromClipToMultiRanges(
 
     if (bAskIfNotEmpty)
     {
-        vcl::Window* pWin = GetViewData().GetDialogParent();
-        if (!checkDestRangeForOverwrite(aRanges, pDoc, aMark, pWin ? pWin->GetFrameWeld() : nullptr))
+        if (!checkDestRangeForOverwrite(aRanges, pDoc, aMark, GetViewData().GetFrameWeld()))
             return false;
     }
 
diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx
index 7c34c1b549af..dbae345879d0 100644
--- a/sc/source/ui/view/viewfun4.cxx
+++ b/sc/source/ui/view/viewfun4.cxx
@@ -398,8 +398,7 @@ void ScViewFunc::DoThesaurus()
         OUString aErr = SvtLanguageTable::GetLanguageString(eLnge);
         aErr += ScResId( STR_SPELLING_NO_LANG );
 
-        vcl::Window* pWin = GetViewData().GetDialogParent();
-        std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+        std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(GetViewData().GetFrameWeld(),
                                                       VclMessageType::Info, VclButtonsType::Ok,
                                                       aErr));
         xInfoBox->run();
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 894259de285b..991e3637480f 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -447,8 +447,7 @@ void ScViewFunc::EnterData( SCCOL nCol, SCROW nRow, SCTAB nTab,
                     OUString aMessage( ScResId( SCSTR_FORMULA_AUTOCORRECTION ) );
                     aMessage += aCorrectedFormula;
 
-                    vcl::Window* pWin = GetViewData().GetDialogParent();
-                    std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : nullptr,
+                    std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(GetViewData().GetFrameWeld(),
                                                                    VclMessageType::Question, VclButtonsType::YesNo,
                                                                    aMessage));
                     xQueryBox->set_default_response(RET_YES);


More information about the Libreoffice-commits mailing list