Kaydet (Commit) f9ecd0f4 authored tarafından Caolán McNamara's avatar Caolán McNamara

go through getParentXWindow

Change-Id: I1f52e1f9ff3fedf8996f72e671400c2549e74dfe
Reviewed-on: https://gerrit.libreoffice.org/54488Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst bf09cd79
...@@ -53,7 +53,7 @@ enum class MessageBoxStyle { ...@@ -53,7 +53,7 @@ enum class MessageBoxStyle {
DialogMask DialogMask
executeErrorDialog( executeErrorDialog(
vcl::Window const * pParent, weld::Window* pParent,
task::InteractionClassification eClassification, task::InteractionClassification eClassification,
OUString const & rContext, OUString const & rContext,
OUString const & rMessage, OUString const & rMessage,
...@@ -72,19 +72,19 @@ executeErrorDialog( ...@@ -72,19 +72,19 @@ executeErrorDialog(
switch (eClassification) switch (eClassification)
{ {
case task::InteractionClassification_ERROR: case task::InteractionClassification_ERROR:
xBox.reset(Application::CreateMessageDialog(pParent ? pParent->GetFrameWeld() : nullptr, xBox.reset(Application::CreateMessageDialog(pParent,
VclMessageType::Error, VclButtonsType::NONE, aText.makeStringAndClear())); VclMessageType::Error, VclButtonsType::NONE, aText.makeStringAndClear()));
break; break;
case task::InteractionClassification_WARNING: case task::InteractionClassification_WARNING:
xBox.reset(Application::CreateMessageDialog(pParent ? pParent->GetFrameWeld() : nullptr, xBox.reset(Application::CreateMessageDialog(pParent,
VclMessageType::Warning, VclButtonsType::NONE, aText.makeStringAndClear())); VclMessageType::Warning, VclButtonsType::NONE, aText.makeStringAndClear()));
break; break;
case task::InteractionClassification_INFO: case task::InteractionClassification_INFO:
xBox.reset(Application::CreateMessageDialog(pParent ? pParent->GetFrameWeld() : nullptr, xBox.reset(Application::CreateMessageDialog(pParent,
VclMessageType::Info, VclButtonsType::NONE, aText.makeStringAndClear())); VclMessageType::Info, VclButtonsType::NONE, aText.makeStringAndClear()));
break; break;
case task::InteractionClassification_QUERY: case task::InteractionClassification_QUERY:
xBox.reset(Application::CreateMessageDialog(pParent ? pParent->GetFrameWeld() : nullptr, xBox.reset(Application::CreateMessageDialog(pParent,
VclMessageType::Question, VclButtonsType::NONE, aText.makeStringAndClear())); VclMessageType::Question, VclButtonsType::NONE, aText.makeStringAndClear()));
break; break;
default: default:
...@@ -245,8 +245,9 @@ UUIInteractionHelper::handleErrorHandlerRequest( ...@@ -245,8 +245,9 @@ UUIInteractionHelper::handleErrorHandlerRequest(
} }
} }
DialogMask nResult = executeErrorDialog( uno::Reference<awt::XWindow> xParent = getParentXWindow();
getParentProperty(), eClassification, aContext, aMessage, nButtonMask ); DialogMask nResult = executeErrorDialog(Application::GetFrameWeld(xParent),
eClassification, aContext, aMessage, nButtonMask );
switch (nResult) switch (nResult)
{ {
......
...@@ -210,38 +210,38 @@ UUIInteractionHelper::handleLockedDocumentRequest( ...@@ -210,38 +210,38 @@ UUIInteractionHelper::handleLockedDocumentRequest(
document::LockedDocumentRequest aLockedDocumentRequest; document::LockedDocumentRequest aLockedDocumentRequest;
if (aAnyRequest >>= aLockedDocumentRequest ) if (aAnyRequest >>= aLockedDocumentRequest )
{ {
vcl::Window* pWin = getParentProperty(); uno::Reference<awt::XWindow> xParent = getParentXWindow();
handleLockedDocumentRequest_( pWin ? pWin->GetFrameWeld() : nullptr, handleLockedDocumentRequest_(Application::GetFrameWeld(xParent),
aLockedDocumentRequest.DocumentURL, aLockedDocumentRequest.DocumentURL,
aLockedDocumentRequest.UserInfo, aLockedDocumentRequest.UserInfo,
rRequest->getContinuations(), rRequest->getContinuations(),
UUI_DOC_LOAD_LOCK ); UUI_DOC_LOAD_LOCK);
return true; return true;
} }
document::OwnLockOnDocumentRequest aOwnLockOnDocumentRequest; document::OwnLockOnDocumentRequest aOwnLockOnDocumentRequest;
if (aAnyRequest >>= aOwnLockOnDocumentRequest ) if (aAnyRequest >>= aOwnLockOnDocumentRequest )
{ {
vcl::Window* pWin = getParentProperty(); uno::Reference<awt::XWindow> xParent = getParentXWindow();
handleLockedDocumentRequest_( pWin ? pWin->GetFrameWeld() : nullptr, handleLockedDocumentRequest_(Application::GetFrameWeld(xParent),
aOwnLockOnDocumentRequest.DocumentURL, aOwnLockOnDocumentRequest.DocumentURL,
aOwnLockOnDocumentRequest.TimeInfo, aOwnLockOnDocumentRequest.TimeInfo,
rRequest->getContinuations(), rRequest->getContinuations(),
aOwnLockOnDocumentRequest.IsStoring aOwnLockOnDocumentRequest.IsStoring
? UUI_DOC_OWN_SAVE_LOCK ? UUI_DOC_OWN_SAVE_LOCK
: UUI_DOC_OWN_LOAD_LOCK ); : UUI_DOC_OWN_LOAD_LOCK);
return true; return true;
} }
document::LockedOnSavingRequest aLockedOnSavingRequest; document::LockedOnSavingRequest aLockedOnSavingRequest;
if (aAnyRequest >>= aLockedOnSavingRequest ) if (aAnyRequest >>= aLockedOnSavingRequest )
{ {
vcl::Window* pWin = getParentProperty(); uno::Reference<awt::XWindow> xParent = getParentXWindow();
handleLockedDocumentRequest_( pWin ? pWin->GetFrameWeld() : nullptr, handleLockedDocumentRequest_(Application::GetFrameWeld(xParent),
aLockedOnSavingRequest.DocumentURL, aLockedOnSavingRequest.DocumentURL,
aLockedOnSavingRequest.UserInfo, aLockedOnSavingRequest.UserInfo,
rRequest->getContinuations(), rRequest->getContinuations(),
UUI_DOC_SAVE_LOCK ); UUI_DOC_SAVE_LOCK);
return true; return true;
} }
return false; return false;
...@@ -256,9 +256,9 @@ UUIInteractionHelper::handleChangedByOthersRequest( ...@@ -256,9 +256,9 @@ UUIInteractionHelper::handleChangedByOthersRequest(
document::ChangedByOthersRequest aChangedByOthersRequest; document::ChangedByOthersRequest aChangedByOthersRequest;
if (aAnyRequest >>= aChangedByOthersRequest ) if (aAnyRequest >>= aChangedByOthersRequest )
{ {
vcl::Window* pWin = getParentProperty(); uno::Reference<awt::XWindow> xParent = getParentXWindow();
handleChangedByOthersRequest_( pWin ? pWin->GetFrameWeld() : nullptr, handleChangedByOthersRequest_(Application::GetFrameWeld(xParent),
rRequest->getContinuations() ); rRequest->getContinuations());
return true; return true;
} }
return false; return false;
...@@ -274,18 +274,18 @@ UUIInteractionHelper::handleLockFileProblemRequest( ...@@ -274,18 +274,18 @@ UUIInteractionHelper::handleLockFileProblemRequest(
document::LockFileIgnoreRequest aLockFileIgnoreRequest; document::LockFileIgnoreRequest aLockFileIgnoreRequest;
if (aAnyRequest >>= aLockFileIgnoreRequest ) if (aAnyRequest >>= aLockFileIgnoreRequest )
{ {
vcl::Window* pWin = getParentProperty(); uno::Reference<awt::XWindow> xParent = getParentXWindow();
handleLockFileProblemRequest_( pWin ? pWin->GetFrameWeld() : nullptr, handleLockFileProblemRequest_(Application::GetFrameWeld(xParent),
rRequest->getContinuations(), UUI_DOC_CreateErrDlg ); rRequest->getContinuations(), UUI_DOC_CreateErrDlg);
return true; return true;
} }
document::LockFileCorruptRequest aLockFileCorruptRequest; document::LockFileCorruptRequest aLockFileCorruptRequest;
if (aAnyRequest >>= aLockFileCorruptRequest ) if (aAnyRequest >>= aLockFileCorruptRequest )
{ {
vcl::Window* pWin = getParentProperty(); uno::Reference<awt::XWindow> xParent = getParentXWindow();
handleLockFileProblemRequest_( pWin ? pWin->GetFrameWeld() : nullptr, handleLockFileProblemRequest_(Application::GetFrameWeld(xParent),
rRequest->getContinuations(), UUI_DOC_CorruptErrDlg ); rRequest->getContinuations(), UUI_DOC_CorruptErrDlg);
return true; return true;
} }
......
...@@ -348,8 +348,8 @@ UUIInteractionHelper::handleCertificateValidationRequest( ...@@ -348,8 +348,8 @@ UUIInteractionHelper::handleCertificateValidationRequest(
ucb::CertificateValidationRequest aCertificateValidationRequest; ucb::CertificateValidationRequest aCertificateValidationRequest;
if (aAnyRequest >>= aCertificateValidationRequest) if (aAnyRequest >>= aCertificateValidationRequest)
{ {
vcl::Window* pWindow = getParentProperty(); uno::Reference<awt::XWindow> xParent = getParentXWindow();
handleCertificateValidationRequest_(pWindow ? pWindow->GetFrameWeld() : nullptr, handleCertificateValidationRequest_(Application::GetFrameWeld(xParent),
m_xContext, m_xContext,
aCertificateValidationRequest, aCertificateValidationRequest,
rRequest->getContinuations()); rRequest->getContinuations());
......
...@@ -1137,13 +1137,13 @@ UUIInteractionHelper::handleGenericErrorRequest( ...@@ -1137,13 +1137,13 @@ UUIInteractionHelper::handleGenericErrorRequest(
aTitle += " - " ; aTitle += " - " ;
aTitle += aErrTitle; aTitle += aErrTitle;
vcl::Window* pWin = getParentProperty(); uno::Reference<awt::XWindow> xParent = getParentXWindow();
executeMessageBox(pWin ? pWin->GetFrameWeld() : nullptr, aTitle, aErrorString, VclMessageType::Error); executeMessageBox(Application::GetFrameWeld(xParent), aTitle, aErrorString, VclMessageType::Error);
} }
else else
{ {
vcl::Window* pParent = getParentProperty(); uno::Reference<awt::XWindow> xParent = getParentXWindow();
ErrorHandler::HandleError(nErrorCode, pParent ? pParent->GetFrameWeld() : nullptr); ErrorHandler::HandleError(nErrorCode, Application::GetFrameWeld(xParent));
} }
if (xApprove.is() && bWarning) if (xApprove.is() && bWarning)
...@@ -1169,8 +1169,8 @@ UUIInteractionHelper::handleMacroConfirmRequest( ...@@ -1169,8 +1169,8 @@ UUIInteractionHelper::handleMacroConfirmRequest(
bool bApprove = false; bool bApprove = false;
bool bShowSignatures = aSignInfo.getLength() > 0; bool bShowSignatures = aSignInfo.getLength() > 0;
vcl::Window* pWin = getParentProperty(); uno::Reference<awt::XWindow> xParent = getParentXWindow();
MacroWarning aWarning(pWin ? pWin->GetFrameWeld() : nullptr, bShowSignatures); MacroWarning aWarning(Application::GetFrameWeld(xParent), bShowSignatures);
aWarning.SetDocumentURL(aDocumentURL); aWarning.SetDocumentURL(aDocumentURL);
if ( aSignInfo.getLength() > 1 ) if ( aSignInfo.getLength() > 1 )
...@@ -1252,8 +1252,8 @@ UUIInteractionHelper::handleBrokenPackageRequest( ...@@ -1252,8 +1252,8 @@ UUIInteractionHelper::handleBrokenPackageRequest(
" " + " " +
utl::ConfigManager::getProductVersion() ); utl::ConfigManager::getProductVersion() );
vcl::Window* pWin = getParentProperty(); uno::Reference<awt::XWindow> xParent = getParentXWindow();
switch (executeMessageBox(pWin ? pWin->GetFrameWeld() : nullptr, title, aMessage, eMessageType)) switch (executeMessageBox(Application::GetFrameWeld(xParent), title, aMessage, eMessageType))
{ {
case DialogMask::ButtonsOk: case DialogMask::ButtonsOk:
OSL_ENSURE( xAbort.is(), "unexpected situation" ); OSL_ENSURE( xAbort.is(), "unexpected situation" );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment