diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-05-20 16:13:40 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-05-21 09:54:15 +0200 |
commit | c1816feaa9c6ab30f01e14f621402307543c82ac (patch) | |
tree | 111847a9ca7daa349b5ab1c6dfaf166a7945c1e6 /vcl | |
parent | c278c1cf3e9ad4c810534558b7f9ea1a41c5e1cc (diff) |
Resolves: tdf#125394 consider unwelded dialogs
Change-Id: Ic66a622bb8b5481656ffe8e29a345a435042402e
Reviewed-on: https://gerrit.libreoffice.org/72625
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/dialog.cxx | 111 |
1 files changed, 60 insertions, 51 deletions
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 5348e206f2c0..03512eb76178 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -1445,25 +1445,28 @@ vcl::Window* Dialog::get_widget_for_response(int response) //copy explicit responses std::map<VclPtr<vcl::Window>, short> aResponses(mpDialogImpl->maResponses); - //add implicit responses - for (vcl::Window* pChild = mpActionArea->GetWindow(GetWindowType::FirstChild); pChild; - pChild = pChild->GetWindow(GetWindowType::Next)) + if (mpActionArea) { - if (aResponses.find(pChild) != aResponses.end()) - continue; - switch (pChild->GetType()) + //add implicit responses + for (vcl::Window* pChild = mpActionArea->GetWindow(GetWindowType::FirstChild); pChild; + pChild = pChild->GetWindow(GetWindowType::Next)) { - case WindowType::OKBUTTON: - aResponses[pChild] = RET_OK; - break; - case WindowType::CANCELBUTTON: - aResponses[pChild] = RET_CANCEL; - break; - case WindowType::HELPBUTTON: - aResponses[pChild] = RET_HELP; - break; - default: - break; + if (aResponses.find(pChild) != aResponses.end()) + continue; + switch (pChild->GetType()) + { + case WindowType::OKBUTTON: + aResponses[pChild] = RET_OK; + break; + case WindowType::CANCELBUTTON: + aResponses[pChild] = RET_CANCEL; + break; + case WindowType::HELPBUTTON: + aResponses[pChild] = RET_HELP; + break; + default: + break; + } } } @@ -1481,25 +1484,28 @@ int Dialog::get_default_response() //copy explicit responses std::map<VclPtr<vcl::Window>, short> aResponses(mpDialogImpl->maResponses); - //add implicit responses - for (vcl::Window* pChild = mpActionArea->GetWindow(GetWindowType::FirstChild); pChild; - pChild = pChild->GetWindow(GetWindowType::Next)) + if (mpActionArea) { - if (aResponses.find(pChild) != aResponses.end()) - continue; - switch (pChild->GetType()) + //add implicit responses + for (vcl::Window* pChild = mpActionArea->GetWindow(GetWindowType::FirstChild); pChild; + pChild = pChild->GetWindow(GetWindowType::Next)) { - case WindowType::OKBUTTON: - aResponses[pChild] = RET_OK; - break; - case WindowType::CANCELBUTTON: - aResponses[pChild] = RET_CANCEL; - break; - case WindowType::HELPBUTTON: - aResponses[pChild] = RET_HELP; - break; - default: - break; + if (aResponses.find(pChild) != aResponses.end()) + continue; + switch (pChild->GetType()) + { + case WindowType::OKBUTTON: + aResponses[pChild] = RET_OK; + break; + case WindowType::CANCELBUTTON: + aResponses[pChild] = RET_CANCEL; + break; + case WindowType::HELPBUTTON: + aResponses[pChild] = RET_HELP; + break; + default: + break; + } } } @@ -1518,25 +1524,28 @@ void Dialog::set_default_response(int response) //copy explicit responses std::map<VclPtr<vcl::Window>, short> aResponses(mpDialogImpl->maResponses); - //add implicit responses - for (vcl::Window* pChild = mpActionArea->GetWindow(GetWindowType::FirstChild); pChild; - pChild = pChild->GetWindow(GetWindowType::Next)) + if (mpActionArea) { - if (aResponses.find(pChild) != aResponses.end()) - continue; - switch (pChild->GetType()) + //add implicit responses + for (vcl::Window* pChild = mpActionArea->GetWindow(GetWindowType::FirstChild); pChild; + pChild = pChild->GetWindow(GetWindowType::Next)) { - case WindowType::OKBUTTON: - aResponses[pChild] = RET_OK; - break; - case WindowType::CANCELBUTTON: - aResponses[pChild] = RET_CANCEL; - break; - case WindowType::HELPBUTTON: - aResponses[pChild] = RET_HELP; - break; - default: - break; + if (aResponses.find(pChild) != aResponses.end()) + continue; + switch (pChild->GetType()) + { + case WindowType::OKBUTTON: + aResponses[pChild] = RET_OK; + break; + case WindowType::CANCELBUTTON: + aResponses[pChild] = RET_CANCEL; + break; + case WindowType::HELPBUTTON: + aResponses[pChild] = RET_HELP; + break; + default: + break; + } } } |