summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2018-02-21 19:58:11 +0100
committerJan Holesovsky <kendy@collabora.com>2018-02-26 12:37:21 +0100
commitb8d5061f54408960177992d0f4be312b7d123167 (patch)
tree94418372d51a2089e7d3d270d08d38f253cd56f2
parentd0faecb02f47cb2165c0e20e3f63e2c2f1af7f19 (diff)
sc lok: Make the Validation "Invalid value." message box working.
Change-Id: Ic0131fa6fc397ae440efed834266b8396aa9e619 Reviewed-on: https://gerrit.libreoffice.org/50160 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
-rw-r--r--include/vcl/dialog.hxx4
-rw-r--r--sc/source/ui/app/inputhdl.cxx8
-rw-r--r--vcl/source/window/msgbox.cxx1
3 files changed, 10 insertions, 3 deletions
diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
index 8695cc4fa632..e53a71782f3a 100644
--- a/include/vcl/dialog.hxx
+++ b/include/vcl/dialog.hxx
@@ -62,7 +62,6 @@ private:
SAL_DLLPRIVATE void RemoveFromDlgList();
SAL_DLLPRIVATE void ImplInitDialogData();
SAL_DLLPRIVATE void ImplInitSettings();
- SAL_DLLPRIVATE inline void ImplLOKNotifier(vcl::Window* pParent);
SAL_DLLPRIVATE VclPtr<vcl::Window> AddBorderWindow(vcl::Window* pParent, WinBits nBits);
virtual void ApplySettings(vcl::RenderContext& rRenderContext) override;
@@ -77,6 +76,9 @@ protected:
using Window::ImplInit;
SAL_DLLPRIVATE void ImplInit( vcl::Window* pParent, WinBits nStyle, InitFlag eFlag = InitFlag::Default );
+ /// Find and set the LOK notifier according to the pParent.
+ void ImplLOKNotifier(vcl::Window* pParent);
+
public:
SAL_DLLPRIVATE bool IsInClose() const { return mbInClose; }
virtual void doDeferredInit(WinBits nBits) override;
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index dcbfba02d73b..bff453de38cd 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -2664,8 +2664,12 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode )
if ( pActiveViewSh ) // If it came from MouseButtonDown
pActiveViewSh->StopMarking(); // (the InfoBox consumes the MouseButtonUp)
- //FIXME: We still run into problems if the input is triggered by activating another View
- vcl::Window* pParent = Application::GetDefDialogParent();
+ vcl::Window* pParent = nullptr;
+ if (pActiveViewSh)
+ pParent = &pActiveViewSh->GetViewFrame()->GetWindow();
+ else
+ pParent = Application::GetDefDialogParent();
+
if ( pData->DoError( pParent, aString, aCursorPos ) )
bForget = true; // Do not take over input
}
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
index 8fbd0475c57d..efe8bfcfe175 100644
--- a/vcl/source/window/msgbox.cxx
+++ b/vcl/source/window/msgbox.cxx
@@ -130,6 +130,7 @@ MessBox::MessBox(vcl::Window* pParent, MessBoxStyle nMessBoxStyle, WinBits nWinB
mnMessBoxStyle( nMessBoxStyle ),
maMessText( rMessage )
{
+ ImplLOKNotifier(pParent);
ImplInit(pParent, nWinBits | WB_MOVEABLE | WB_HORZ | WB_CENTER);
ImplInitButtons();