summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--desktop/source/lib/init.cxx8
-rw-r--r--include/vcl/dialoghelper.hxx2
-rw-r--r--vcl/source/window/dialog.cxx9
3 files changed, 6 insertions, 13 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 76f08455e3a7..6636254bd7b8 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -127,7 +127,6 @@
#include <tools/json_writer.hxx>
#include <svtools/ctrltool.hxx>
#include <svtools/langtab.hxx>
-#include <vcl/floatwin.hxx>
#include <vcl/fontcharmap.hxx>
#include <vcl/graphicfilter.hxx>
#ifdef IOS
@@ -5467,12 +5466,7 @@ static void doc_postWindow(LibreOfficeKitDocument* /*pThis*/, unsigned nLOKWindo
if (nAction == LOK_WINDOW_CLOSE)
{
- bool bWasDialog = vcl::CloseDialog(pWindow);
- if (!bWasDialog)
- {
- if (FloatingWindow* pFloatWin = dynamic_cast<FloatingWindow*>(pWindow.get()))
- pFloatWin->EndPopupMode(FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll);
- }
+ vcl::CloseTopLevel(pWindow);
}
else if (nAction == LOK_WINDOW_PASTE)
{
diff --git a/include/vcl/dialoghelper.hxx b/include/vcl/dialoghelper.hxx
index 828c21b2af17..549188e00214 100644
--- a/include/vcl/dialoghelper.hxx
+++ b/include/vcl/dialoghelper.hxx
@@ -23,7 +23,7 @@ VCL_DLLPUBLIC void EndAllDialogs(vcl::Window const* pParent);
/* for LibreOffice kit */
VCL_DLLPUBLIC void EnableDialogInput(vcl::Window* pDialog);
-VCL_DLLPUBLIC bool CloseDialog(vcl::Window* pDialog);
+VCL_DLLPUBLIC void CloseTopLevel(vcl::Window* pDialog);
/// Pre-loads all modules containing UI information
VCL_DLLPUBLIC void VclBuilderPreload();
}
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index d65ac881aa30..3bfdbe1c4bb4 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -43,6 +43,7 @@
#include <vcl/abstdlg.hxx>
#include <vcl/accel.hxx>
#include <vcl/builder.hxx>
+#include <vcl/floatwin.hxx>
#include <vcl/layout.hxx>
#include <vcl/svapp.hxx>
#include <vcl/event.hxx>
@@ -1201,14 +1202,12 @@ namespace vcl
}
}
- bool CloseDialog(vcl::Window* pWindow)
+ void CloseTopLevel(vcl::Window* pWindow)
{
if (Dialog* pDialog = dynamic_cast<Dialog*>(pWindow))
- {
pDialog->Close();
- return true;
- }
- return false;
+ else if (FloatingWindow* pFloatWin = dynamic_cast<FloatingWindow*>(pWindow))
+ pFloatWin->EndPopupMode(FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll);
}
}