summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcl/source/window/dialog.cxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index bf975b465cbb..7bede952a16e 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -24,6 +24,7 @@
#include <com/sun/star/frame/theGlobalEventBroadcaster.hpp>
#include <comphelper/lok.hxx>
#include <comphelper/processfactory.hxx>
+#include <officecfg/Office/Common.hxx>
#include <osl/file.hxx>
#include <tools/debug.hxx>
@@ -847,7 +848,11 @@ bool Dialog::ImplStartExecuteModal()
// FIXME: no layouting, workaround some clipping issues
ImplAdjustNWFSizes();
- Show();
+ css::uno::Reference< css::uno::XComponentContext > xContext(
+ comphelper::getProcessComponentContext());
+ bool bForceFocusAndToFront(officecfg::Office::Common::View::NewDocumentHandling::ForceFocusAndToFront::get(xContext));
+ ShowFlags showFlags = bForceFocusAndToFront ? ShowFlags::ForegroundTask : ShowFlags::NONE;
+ Show(true, showFlags);
pSVData->maAppData.mnModalMode++;
return true;