diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-11-25 16:26:51 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-11-25 16:28:16 +0000 |
commit | 67fe0b50ede437601e8f5ed90514d729486c6b83 (patch) | |
tree | 9f58b42b72ca674a277077b4f55e02471cca7294 | |
parent | b3b0ecbf3717b04de3a5149db1c70a8ee93bf2ee (diff) |
the real bug behind so many apparent crashtest discoveries
the tests are done headless with dbgutil enabled and
this dialog contents dumped in dbgutil mode tries to
spit out the contents of the various "file format
not known", "file busted" dialogs with some bad casts
and falls over and dies
Change-Id: I353619f0209902d4c099b42064fd48c3c547f846
-rw-r--r-- | vcl/source/window/dialog.cxx | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 99ceec2f0f4f..917af60fea41 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -57,15 +57,22 @@ static OString ImplGetDialogText( Dialog* pDialog ) { OStringBuffer aErrorStr(OUStringToOString( pDialog->GetText(), RTL_TEXTENCODING_UTF8)); - if ( (pDialog->GetType() == WINDOW_MESSBOX) || - (pDialog->GetType() == WINDOW_INFOBOX) || - (pDialog->GetType() == WINDOW_WARNINGBOX) || - (pDialog->GetType() == WINDOW_ERRORBOX) || - (pDialog->GetType() == WINDOW_QUERYBOX) ) + + OUString sMessage; + if (MessBox* pMessBox = dynamic_cast<MessBox*>(pDialog)) + { + sMessage = pMessBox->GetMessText(); + } + else if (MessageDialog* pMessDialog = dynamic_cast<MessageDialog*>(pDialog)) + { + sMessage = pMessDialog->get_primary_text(); + } + + if (!sMessage.isEmpty()) { aErrorStr.append(", "); aErrorStr.append(OUStringToOString( - static_cast<MessBox*>(pDialog)->GetMessText(), RTL_TEXTENCODING_UTF8)); + sMessage, RTL_TEXTENCODING_UTF8)); } return aErrorStr.makeStringAndClear(); } |