diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-04-04 14:33:16 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-04-06 16:48:12 +0200 |
commit | 8ed2fb306ffa8c7fef336b858fc5074c309c3c9f (patch) | |
tree | 8699322ccfd3bfef66af56437bb9dabfa249a719 /sc | |
parent | 79ae6cc6b3b19252473f6987106ea7d8aa17a5ea (diff) |
weld linkeditdialog
which enables changing FileDialogHelper over to welded
Change-Id: I988342a6574cb7ed09b2724929e8c7117474a56c
Reviewed-on: https://gerrit.libreoffice.org/52388
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/arealink.hxx | 2 | ||||
-rw-r--r-- | sc/inc/externalrefmgr.hxx | 2 | ||||
-rw-r--r-- | sc/inc/tablink.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/arealink.cxx | 5 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh4.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/externalrefmgr.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/tablink.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/chartsh.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/fuins1.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/drawfunc/graphsh.cxx | 9 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/datastreamdlg.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/instbdlg.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/linkarea.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwshb.cxx | 2 |
14 files changed, 21 insertions, 19 deletions
diff --git a/sc/inc/arealink.hxx b/sc/inc/arealink.hxx index 9c8c33b9fff0..ae503c0a7f2e 100644 --- a/sc/inc/arealink.hxx +++ b/sc/inc/arealink.hxx @@ -54,7 +54,7 @@ public: virtual ::sfx2::SvBaseLink::UpdateResult DataChanged( const OUString& rMimeType, const css::uno::Any & rValue ) override; - virtual void Edit( vcl::Window*, const Link<SvBaseLink&,void>& rEndEditHdl ) override; + virtual void Edit(weld::Window*, const Link<SvBaseLink&,void>& rEndEditHdl) override; bool Refresh( const OUString& rNewFile, const OUString& rNewFilter, const OUString& rNewArea, sal_uLong nNewRefresh ); diff --git a/sc/inc/externalrefmgr.hxx b/sc/inc/externalrefmgr.hxx index 70cf8f99a65f..028dcdf67cb6 100644 --- a/sc/inc/externalrefmgr.hxx +++ b/sc/inc/externalrefmgr.hxx @@ -70,7 +70,7 @@ public: virtual void Closed() override; virtual ::sfx2::SvBaseLink::UpdateResult DataChanged( const OUString& rMimeType, const css::uno::Any & rValue) override; - virtual void Edit(vcl::Window* pParent, const Link<SvBaseLink&,void>& rEndEditHdl) override; + virtual void Edit(weld::Window* pParent, const Link<SvBaseLink&,void>& rEndEditHdl) override; void SetDoReferesh(bool b); diff --git a/sc/inc/tablink.hxx b/sc/inc/tablink.hxx index 54b13940db67..04c13f0a5580 100644 --- a/sc/inc/tablink.hxx +++ b/sc/inc/tablink.hxx @@ -53,7 +53,7 @@ public: virtual ::sfx2::SvBaseLink::UpdateResult DataChanged( const OUString& rMimeType, const css::uno::Any & rValue ) override; - virtual void Edit( vcl::Window*, const Link<SvBaseLink&,void>& rEndEditHdl ) override; + virtual void Edit(weld::Window*, const Link<SvBaseLink&,void>& rEndEditHdl) override; bool Refresh(const OUString& rNewFile, const OUString& rNewFilter, const OUString* pNewOptions /* = NULL */, sal_uLong nNewRefresh ); diff --git a/sc/source/ui/docshell/arealink.cxx b/sc/source/ui/docshell/arealink.cxx index 3e719dfb68f9..8a75234cc686 100644 --- a/sc/source/ui/docshell/arealink.cxx +++ b/sc/source/ui/docshell/arealink.cxx @@ -73,13 +73,14 @@ ScAreaLink::~ScAreaLink() StopRefreshTimer(); } -void ScAreaLink::Edit(vcl::Window* pParent, const Link<SvBaseLink&,void>& /* rEndEditHdl */ ) +void ScAreaLink::Edit(weld::Window*, const Link<SvBaseLink&,void>& /* rEndEditHdl */ ) { // use own dialog instead of SvBaseLink::Edit... ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create(); OSL_ENSURE(pFact, "ScAbstractFactory create fail!"); - ScopedVclPtr<AbstractScLinkedAreaDlg> pDlg(pFact->CreateScLinkedAreaDlg(pParent)); +//TODO ScopedVclPtr<AbstractScLinkedAreaDlg> pDlg(pFact->CreateScLinkedAreaDlg(pParent)); + ScopedVclPtr<AbstractScLinkedAreaDlg> pDlg(pFact->CreateScLinkedAreaDlg(nullptr)); OSL_ENSURE(pDlg, "Dialog create fail!"); pDlg->InitFromOldLink( aFileName, aFilterName, aOptions, aSourceArea, GetRefreshDelay() ); if ( pDlg->Execute() == RET_OK ) diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index ebd9651ff537..a0b2cf8b8678 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -770,7 +770,7 @@ void ScDocShell::Execute( SfxRequest& rReq ) ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell(); vcl::Window* pParent = pViewSh ? pViewSh->GetDialogParent() : nullptr; - pImpl->pDocInserter = new ::sfx2::DocumentInserter(pParent, + pImpl->pDocInserter = new ::sfx2::DocumentInserter(pParent ? pParent->GetFrameWeld() : nullptr, ScDocShell::Factory().GetFactoryName(), mode ); pImpl->pDocInserter->StartExecuteModal( LINK( this, ScDocShell, DialogClosedHdl ) ); return ; diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index 4ca3df975a36..a41052fc3124 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -1496,7 +1496,7 @@ void ScExternalRefLink::Closed() return SUCCESS; } -void ScExternalRefLink::Edit(vcl::Window* pParent, const Link<SvBaseLink&,void>& /*rEndEditHdl*/) +void ScExternalRefLink::Edit(weld::Window* pParent, const Link<SvBaseLink&,void>& /*rEndEditHdl*/) { SvBaseLink::Edit(pParent, Link<SvBaseLink&,void>()); } diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx index 8c0e3d5c6c1a..9074786c919e 100644 --- a/sc/source/ui/docshell/tablink.cxx +++ b/sc/source/ui/docshell/tablink.cxx @@ -108,7 +108,7 @@ ScTableLink::~ScTableLink() rDoc.SetLink( nTab, ScLinkMode::NONE, "", "", "", "", 0 ); } -void ScTableLink::Edit( vcl::Window* pParent, const Link<SvBaseLink&,void>& rEndEditHdl ) +void ScTableLink::Edit(weld::Window* pParent, const Link<SvBaseLink&,void>& rEndEditHdl) { pImpl->m_aEndEditLink = rEndEditHdl; diff --git a/sc/source/ui/drawfunc/chartsh.cxx b/sc/source/ui/drawfunc/chartsh.cxx index 054cce77a439..bc6e2bb48c74 100644 --- a/sc/source/ui/drawfunc/chartsh.cxx +++ b/sc/source/ui/drawfunc/chartsh.cxx @@ -98,7 +98,7 @@ void ScChartShell::ExecuteExportAsGraphic( SfxRequest& ) { vcl::Window* pWin = GetViewData()->GetActiveWin(); Reference< drawing::XShape > xSourceDoc( pObject->getUnoShape(), UNO_QUERY_THROW ); - GraphicHelper::SaveShapeAsGraphic(pWin, xSourceDoc); + GraphicHelper::SaveShapeAsGraphic(pWin ? pWin->GetFrameWeld() : nullptr, xSourceDoc); } } diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx index b7c4ed8d5e8b..5574a6f5b6cc 100644 --- a/sc/source/ui/drawfunc/fuins1.cxx +++ b/sc/source/ui/drawfunc/fuins1.cxx @@ -282,7 +282,7 @@ FuInsertGraphic::FuInsertGraphic( ScTabViewShell* pViewSh, } else { - SvxOpenGraphicDialog aDlg(ScResId(STR_INSERTGRAPHIC), pWin, + SvxOpenGraphicDialog aDlg(ScResId(STR_INSERTGRAPHIC), pWin ? pWin->GetFrameWeld() : nullptr, ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW_IMAGE_ANCHOR); Reference<ui::dialogs::XFilePickerControlAccess> xCtrlAcc = aDlg.GetFilePickerControlAccess(); @@ -388,7 +388,7 @@ FuInsertMedia::FuInsertMedia( ScTabViewShell* pViewSh, bool bLink(true); if (bAPI #if HAVE_FEATURE_AVMEDIA - || ::avmedia::MediaWindow::executeMediaURLDialog(pWin, aURL, &bLink) + || ::avmedia::MediaWindow::executeMediaURLDialog(pWin ? pWin->GetFrameWeld() : nullptr, aURL, &bLink) #endif ) { diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx index 641d3854ebb3..9855beee0125 100644 --- a/sc/source/ui/drawfunc/graphsh.cxx +++ b/sc/source/ui/drawfunc/graphsh.cxx @@ -266,11 +266,12 @@ void ScGraphicShell::ExecuteSaveGraphic( SAL_UNUSED_PARAMETER SfxRequest& /*rReq GraphicAttr aGraphicAttr = pObj->GetGraphicAttr(); short nState = RET_CANCEL; vcl::Window* pWin = GetViewData()->GetActiveWin(); + weld::Window* pWinFrame = pWin ? pWin->GetFrameWeld() : nullptr; if (aGraphicAttr != GraphicAttr()) // the image has been modified { if (pWin) { - nState = GraphicHelper::HasToSaveTransformedImage(pWin->GetFrameWeld()); + nState = GraphicHelper::HasToSaveTransformedImage(pWinFrame); } } else @@ -280,12 +281,12 @@ void ScGraphicShell::ExecuteSaveGraphic( SAL_UNUSED_PARAMETER SfxRequest& /*rReq if (nState == RET_YES) { - GraphicHelper::ExportGraphic(pWin, pObj->GetTransformedGraphic(), ""); + GraphicHelper::ExportGraphic(pWinFrame, pObj->GetTransformedGraphic(), ""); } else if (nState == RET_NO) { GraphicObject aGraphicObject(pObj->GetGraphicObject()); - GraphicHelper::ExportGraphic(pWin, aGraphicObject.GetGraphic(), ""); + GraphicHelper::ExportGraphic(pWinFrame, aGraphicObject.GetGraphic(), ""); } } } @@ -323,7 +324,7 @@ void ScGraphicShell::ExecuteChangePicture( SAL_UNUSED_PARAMETER SfxRequest& /*rR { SdrGrafObj* pGraphicObj = static_cast<SdrGrafObj*>(pObj); vcl::Window* pWin = GetViewData()->GetActiveWin(); - SvxOpenGraphicDialog aDlg(ScResId(STR_INSERTGRAPHIC), pWin); + SvxOpenGraphicDialog aDlg(ScResId(STR_INSERTGRAPHIC), pWin ? pWin->GetFrameWeld() : nullptr); if( aDlg.Execute() == ERRCODE_NONE ) { diff --git a/sc/source/ui/miscdlgs/datastreamdlg.cxx b/sc/source/ui/miscdlgs/datastreamdlg.cxx index f447f48dc277..6164037b1c34 100644 --- a/sc/source/ui/miscdlgs/datastreamdlg.cxx +++ b/sc/source/ui/miscdlgs/datastreamdlg.cxx @@ -74,7 +74,7 @@ void DataStreamDlg::dispose() IMPL_LINK_NOARG(DataStreamDlg, BrowseHdl, Button*, void) { - sfx2::FileDialogHelper aFileDialog(0, FileDialogFlags::NONE, this); + sfx2::FileDialogHelper aFileDialog(0, FileDialogFlags::NONE, GetFrameWeld()); if ( aFileDialog.Execute() != ERRCODE_NONE ) return; diff --git a/sc/source/ui/miscdlgs/instbdlg.cxx b/sc/source/ui/miscdlgs/instbdlg.cxx index 3e66652d76f2..83a301ceff1c 100644 --- a/sc/source/ui/miscdlgs/instbdlg.cxx +++ b/sc/source/ui/miscdlgs/instbdlg.cxx @@ -274,7 +274,7 @@ IMPL_LINK_NOARG(ScInsertTableDlg, ChoiceHdl_Impl, Button*, void) IMPL_LINK_NOARG(ScInsertTableDlg, BrowseHdl_Impl, Button*, void) { delete pDocInserter; - pDocInserter = new ::sfx2::DocumentInserter(this, ScDocShell::Factory().GetFactoryName()); + pDocInserter = new ::sfx2::DocumentInserter(GetFrameWeld(), ScDocShell::Factory().GetFactoryName()); pDocInserter->StartExecuteModal( LINK( this, ScInsertTableDlg, DialogClosedHdl ) ); } diff --git a/sc/source/ui/miscdlgs/linkarea.cxx b/sc/source/ui/miscdlgs/linkarea.cxx index e984045ab5ed..257f07f24747 100644 --- a/sc/source/ui/miscdlgs/linkarea.cxx +++ b/sc/source/ui/miscdlgs/linkarea.cxx @@ -83,7 +83,7 @@ void ScLinkedAreaDlg::dispose() IMPL_LINK_NOARG(ScLinkedAreaDlg, BrowseHdl, Button*, void) { - pDocInserter.reset( new sfx2::DocumentInserter(this, ScDocShell::Factory().GetFactoryName()) ); + pDocInserter.reset( new sfx2::DocumentInserter(GetFrameWeld(), ScDocShell::Factory().GetFactoryName()) ); pDocInserter->StartExecuteModal( LINK( this, ScLinkedAreaDlg, DialogClosedHdl ) ); } diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index 062a02f82247..af3602bc9471 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -350,7 +350,7 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq) { sfx2::FileDialogHelper aDlg(ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, FileDialogFlags::NONE, "com.sun.star.chart2.ChartDocument", - SfxFilterFlags::NONE, SfxFilterFlags::NONE, pWin); + SfxFilterFlags::NONE, SfxFilterFlags::NONE, pWin ? pWin->GetFrameWeld() : nullptr); if(aDlg.Execute() == ERRCODE_NONE ) { INetURLObject aURLObj( aDlg.GetPath() ); |