summaryrefslogtreecommitdiff
path: root/sfx2/source/dialog/filedlghelper.cxx
diff options
context:
space:
mode:
authorOliver Specht <oliver.specht@cib.de>2016-05-04 11:51:58 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2016-05-11 14:40:23 +0000
commitb22ce3294695c7ef4c80f7ec4c4db10b13ad7ab2 (patch)
tree2f63fe6e7fb490e882844ca16f3fe9d9bd17210f /sfx2/source/dialog/filedlghelper.cxx
parent315aebd9706fde5c8d4a4b6d1f5587edf5607671 (diff)
set parent window of windows system file picker on save(as)
If no parent is provided the Windows system file picker uses either the current foreground window or the desktop. The decision depends on the thread id of the foreground window. To make sure the document window is used as parent this is now also sent to the system file picker as it was already done for the internal file picker. Change-Id: Id589cbc1f91db30e065175aaea42ef1512ffb1b9 Reviewed-on: https://gerrit.libreoffice.org/24635 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'sfx2/source/dialog/filedlghelper.cxx')
-rw-r--r--sfx2/source/dialog/filedlghelper.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index 1d6fe71d8431..be788616c6a2 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -1030,6 +1030,8 @@ FileDialogHelper_Impl::FileDialogHelper_Impl(
if ( mbSystemPicker )
{
aInitArguments[0] <<= nTemplateDescription;
+ if ( mpPreferredParentWindow )
+ aInitArguments[1] <<= makeAny( VCLUnoHelper::GetInterface( mpPreferredParentWindow ) );
}
else
{
@@ -2230,10 +2232,11 @@ FileDialogHelper::FileDialogHelper(
SfxFilterFlags nMust,
SfxFilterFlags nDont,
const OUString& rStandardDir,
- const css::uno::Sequence< OUString >& rBlackList)
+ const css::uno::Sequence< OUString >& rBlackList,
+ vcl::Window* _pPreferredParent)
: m_nError(0)
{
- mpImp = new FileDialogHelper_Impl( this, nDialogType, nFlags, nDialog, nullptr, rStandardDir, rBlackList );
+ mpImp = new FileDialogHelper_Impl( this, nDialogType, nFlags, nDialog, _pPreferredParent, rStandardDir, rBlackList );
mxImp = mpImp;
// create the list of filters