summaryrefslogtreecommitdiff
path: root/uui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-11-02 17:23:00 +0000
committerCaolán McNamara <caolanm@redhat.com>2017-11-03 22:05:57 +0100
commitfdcd11ff68fcd9e46aad6efc20779a063f4f6182 (patch)
treee0a28c7599e66334debb6f57fb4713e3ed4fd541 /uui
parent7cca1dc560aeceb430ef6a0db2f7823e717ee585 (diff)
Resolves: tdf#113160 changing all warning dialogs to non-modal is unsafe
existing code doesn't expect that so stuff crashes partial revert of... commit db6b703d391838c481fd090065f6d329edcd4efa Date: Thu Aug 24 18:32:38 2017 +0200 Allow non-modal Dialogs during FileImport/Load Change-Id: I152feb849186cf035664a700d3f94ee049cdf6d3 Reviewed-on: https://gerrit.libreoffice.org/44227 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'uui')
-rw-r--r--uui/source/iahndl.cxx33
1 files changed, 4 insertions, 29 deletions
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index d53d01a513ba..27a10becaf88 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -959,35 +959,12 @@ executeMessageBox(
vcl::Window * pParent,
OUString const & rTitle,
OUString const & rMessage,
- MessBoxStyle nButtonMask,
- Dialog::InitFlag eInitFlag)
+ MessBoxStyle nButtonMask)
{
SolarMutexGuard aGuard;
WinBits nStyle(0);
- ScopedVclPtrInstance< MessBox > xBox(pParent, nButtonMask, nStyle, rTitle, rMessage, eInitFlag);
-
- if (Dialog::InitFlag::NoParentCentered == eInitFlag)
- {
- vcl::Window* pDefaultParent = Dialog::GetDefaultParent(nStyle);
-
- if (pDefaultParent)
- {
- // need to 'Show' to have the following tasks do something, does
- // not work without and may even stumble on nullptrs/errors
- xBox->Show();
-
- // center on parent window
- const Point aP(pDefaultParent->GetPosPixel());
- const Size aS(pDefaultParent->GetSizePixel());
- const Size aMySize(xBox->GetSizePixel());
-
- xBox->SetPosPixel(
- Point(
- aP.X() + ((aS.Width() - aMySize.Width()) >> 1),
- aP.Y() + ((aS.Height() - aMySize.Height()) >> 1)));
- }
- }
+ ScopedVclPtrInstance< MessBox > xBox(pParent, nButtonMask, nStyle, rTitle, rMessage);
sal_uInt16 aMessResult = xBox->Execute();
DialogMask aResult = DialogMask::NONE;
@@ -1131,8 +1108,7 @@ UUIInteractionHelper::handleGenericErrorRequest(
aTitle += " - " ;
aTitle += aErrTitle;
- executeMessageBox(
- getParentProperty(), aTitle, aErrorString, MessBoxStyle::Ok, Dialog::InitFlag::NoParentCentered);
+ executeMessageBox(getParentProperty(), aTitle, aErrorString, MessBoxStyle::Ok);
}
else
ErrorHandler::HandleError(nErrorCode);
@@ -1247,8 +1223,7 @@ UUIInteractionHelper::handleBrokenPackageRequest(
" " +
utl::ConfigManager::getProductVersion() );
- switch (
- executeMessageBox( getParentProperty(), title, aMessage, nButtonMask, Dialog::InitFlag::NoParentCentered) )
+ switch (executeMessageBox(getParentProperty(), title, aMessage, nButtonMask))
{
case DialogMask::ButtonsOk:
OSL_ENSURE( xAbort.is(), "unexpected situation" );