summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-09-07 10:54:22 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-09-08 11:27:18 +0200
commit1af5f6e8d1bdec9bd2f14d0f5f8fad9c0fdead2b (patch)
tree84773114c08ca86424af4f8a17ec69d295908e01 /sc
parentbb2258f7e4bcf078810cf1e40fdec2f17576c3b2 (diff)
set parent for file dialog helper
Change-Id: I3994ee48dcb5b2732cb27cb9ccb54926abf0828a Reviewed-on: https://gerrit.libreoffice.org/42048 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/source/ui/docshell/docsh4.cxx6
-rw-r--r--sc/source/ui/drawfunc/chartsh.cxx4
-rw-r--r--sc/source/ui/drawfunc/fuins1.cxx4
-rw-r--r--sc/source/ui/drawfunc/graphsh.cxx9
-rw-r--r--sc/source/ui/miscdlgs/dataproviderdlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/datastreamdlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/instbdlg.cxx2
-rw-r--r--sc/source/ui/miscdlgs/linkarea.cxx2
-rw-r--r--sc/source/ui/view/tabvwshb.cxx3
9 files changed, 21 insertions, 13 deletions
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index e70fb68f3abd..9dc6b4bd97af 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -727,7 +727,11 @@ void ScDocShell::Execute( SfxRequest& rReq )
delete pImpl->pRequest;
pImpl->pRequest = new SfxRequest( rReq );
delete pImpl->pDocInserter;
- pImpl->pDocInserter = new ::sfx2::DocumentInserter(
+
+ ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell();
+ vcl::Window* pParent = pViewSh ? pViewSh->GetDialogParent() : nullptr;
+
+ pImpl->pDocInserter = new ::sfx2::DocumentInserter(pParent,
ScDocShell::Factory().GetFactoryName(), mode );
pImpl->pDocInserter->StartExecuteModal( LINK( this, ScDocShell, DialogClosedHdl ) );
return ;
diff --git a/sc/source/ui/drawfunc/chartsh.cxx b/sc/source/ui/drawfunc/chartsh.cxx
index e82cbfe4fa6e..d3b870bb15d7 100644
--- a/sc/source/ui/drawfunc/chartsh.cxx
+++ b/sc/source/ui/drawfunc/chartsh.cxx
@@ -36,6 +36,7 @@
#include "document.hxx"
#include "docpool.hxx"
#include "drawview.hxx"
+#include "gridwin.hxx"
#include "scresid.hxx"
#define ScChartShell
@@ -96,8 +97,9 @@ void ScChartShell::ExecuteExportAsGraphic( SfxRequest& )
if( pObject && dynamic_cast<const SdrOle2Obj*>( pObject) != nullptr )
{
+ vcl::Window* pWin = GetViewData()->GetActiveWin();
Reference< drawing::XShape > xSourceDoc( pObject->getUnoShape(), UNO_QUERY_THROW );
- GraphicHelper::SaveShapeAsGraphic( xSourceDoc );
+ GraphicHelper::SaveShapeAsGraphic(pWin, xSourceDoc);
}
}
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index 00a612e2eefe..37aa583be912 100644
--- a/sc/source/ui/drawfunc/fuins1.cxx
+++ b/sc/source/ui/drawfunc/fuins1.cxx
@@ -219,7 +219,7 @@ static void lcl_InsertMedia( const OUString& rMediaURL, bool bApi,
}
FuInsertGraphic::FuInsertGraphic( ScTabViewShell* pViewSh,
- vcl::Window* pWin,
+ vcl::Window* pWin,
ScDrawView* pViewP,
SdrModel* pDoc,
SfxRequest& rReq )
@@ -249,7 +249,7 @@ FuInsertGraphic::FuInsertGraphic( ScTabViewShell* pViewSh,
}
else
{
- SvxOpenGraphicDialog aDlg(ScResId(STR_INSERTGRAPHIC));
+ SvxOpenGraphicDialog aDlg(ScResId(STR_INSERTGRAPHIC), pWin);
if( aDlg.Execute() == ERRCODE_NONE )
{
diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx
index 44a21ded58b7..3a55971f4dd4 100644
--- a/sc/source/ui/drawfunc/graphsh.cxx
+++ b/sc/source/ui/drawfunc/graphsh.cxx
@@ -266,9 +266,9 @@ void ScGraphicShell::ExecuteSaveGraphic( SAL_UNUSED_PARAMETER SfxRequest& /*rReq
{
GraphicAttr aGraphicAttr = pObj->GetGraphicAttr();
short nState = RET_CANCEL;
+ vcl::Window* pWin = GetViewData()->GetActiveWin();
if (aGraphicAttr != GraphicAttr()) // the image has been modified
{
- vcl::Window* pWin = GetViewData()->GetActiveWin();
if (pWin)
{
nState = GraphicHelper::HasToSaveTransformedImage(pWin);
@@ -281,12 +281,12 @@ void ScGraphicShell::ExecuteSaveGraphic( SAL_UNUSED_PARAMETER SfxRequest& /*rReq
if (nState == RET_YES)
{
- GraphicHelper::ExportGraphic( pObj->GetTransformedGraphic(), "" );
+ GraphicHelper::ExportGraphic(pWin, pObj->GetTransformedGraphic(), "");
}
else if (nState == RET_NO)
{
GraphicObject aGraphicObject(pObj->GetGraphicObject());
- GraphicHelper::ExportGraphic( aGraphicObject.GetGraphic(), "" );
+ GraphicHelper::ExportGraphic(pWin, aGraphicObject.GetGraphic(), "");
}
}
}
@@ -323,7 +323,8 @@ void ScGraphicShell::ExecuteChangePicture( SAL_UNUSED_PARAMETER SfxRequest& /*rR
if( pObj && nullptr != dynamic_cast<const SdrGrafObj*>( pObj) && static_cast<SdrGrafObj*>(pObj)->GetGraphicType() == GraphicType::Bitmap )
{
SdrGrafObj* pGraphicObj = static_cast<SdrGrafObj*>(pObj);
- SvxOpenGraphicDialog aDlg(ScResId(STR_INSERTGRAPHIC));
+ vcl::Window* pWin = GetViewData()->GetActiveWin();
+ SvxOpenGraphicDialog aDlg(ScResId(STR_INSERTGRAPHIC), pWin);
if( aDlg.Execute() == ERRCODE_NONE )
{
diff --git a/sc/source/ui/miscdlgs/dataproviderdlg.cxx b/sc/source/ui/miscdlgs/dataproviderdlg.cxx
index 7d1bd6150dd3..14cec83a8c68 100644
--- a/sc/source/ui/miscdlgs/dataproviderdlg.cxx
+++ b/sc/source/ui/miscdlgs/dataproviderdlg.cxx
@@ -57,7 +57,7 @@ void DataProviderDlg::dispose()
IMPL_LINK_NOARG(DataProviderDlg, BrowseHdl, Button*, void)
{
- sfx2::FileDialogHelper aFileDialog(0);
+ sfx2::FileDialogHelper aFileDialog(0, FileDialogFlags::NONE, this);
if ( aFileDialog.Execute() != ERRCODE_NONE )
return;
diff --git a/sc/source/ui/miscdlgs/datastreamdlg.cxx b/sc/source/ui/miscdlgs/datastreamdlg.cxx
index b746d6051845..8a657492c29d 100644
--- a/sc/source/ui/miscdlgs/datastreamdlg.cxx
+++ b/sc/source/ui/miscdlgs/datastreamdlg.cxx
@@ -81,7 +81,7 @@ void DataStreamDlg::dispose()
IMPL_LINK_NOARG(DataStreamDlg, BrowseHdl, Button*, void)
{
- sfx2::FileDialogHelper aFileDialog(0);
+ sfx2::FileDialogHelper aFileDialog(0, FileDialogFlags::NONE, this);
if ( aFileDialog.Execute() != ERRCODE_NONE )
return;
diff --git a/sc/source/ui/miscdlgs/instbdlg.cxx b/sc/source/ui/miscdlgs/instbdlg.cxx
index 1dd51b7774b5..04acdf5e530a 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(ScDocShell::Factory().GetFactoryName());
+ pDocInserter = new ::sfx2::DocumentInserter(this, 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 1fdf02ac7e0e..2de2133121cd 100644
--- a/sc/source/ui/miscdlgs/linkarea.cxx
+++ b/sc/source/ui/miscdlgs/linkarea.cxx
@@ -84,7 +84,7 @@ void ScLinkedAreaDlg::dispose()
IMPL_LINK_NOARG(ScLinkedAreaDlg, BrowseHdl, Button*, void)
{
if ( !pDocInserter )
- pDocInserter = new sfx2::DocumentInserter(ScDocShell::Factory().GetFactoryName());
+ pDocInserter = new sfx2::DocumentInserter(this, 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 e709aa738c3e..5946da5c5ecd 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -349,7 +349,8 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq)
try
{
sfx2::FileDialogHelper aDlg(ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,
- FileDialogFlags::NONE, "com.sun.star.chart2.ChartDocument");
+ FileDialogFlags::NONE, "com.sun.star.chart2.ChartDocument",
+ SfxFilterFlags::NONE, SfxFilterFlags::NONE, pWin);
if(aDlg.Execute() == ERRCODE_NONE )
{
INetURLObject aURLObj( aDlg.GetPath() );