[Libreoffice-commits] core.git: uui/source

Caolán McNamara caolanm at redhat.com
Thu May 17 20:17:26 UTC 2018


 uui/source/iahndl-errorhandler.cxx |   15 +++++----
 uui/source/iahndl-locking.cxx      |   58 ++++++++++++++++++-------------------
 uui/source/iahndl-ssl.cxx          |    4 +-
 uui/source/iahndl.cxx              |   16 +++++-----
 4 files changed, 47 insertions(+), 46 deletions(-)

New commits:
commit f9ecd0f47960c8975f01c4564228796342e19be1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu May 17 10:28:15 2018 +0100

    go through getParentXWindow
    
    Change-Id: I1f52e1f9ff3fedf8996f72e671400c2549e74dfe
    Reviewed-on: https://gerrit.libreoffice.org/54488
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/uui/source/iahndl-errorhandler.cxx b/uui/source/iahndl-errorhandler.cxx
index 489d8bd0cc61..553d9cf51dbe 100644
--- a/uui/source/iahndl-errorhandler.cxx
+++ b/uui/source/iahndl-errorhandler.cxx
@@ -53,7 +53,7 @@ enum class MessageBoxStyle {
 
 DialogMask
 executeErrorDialog(
-    vcl::Window const * pParent,
+    weld::Window* pParent,
     task::InteractionClassification eClassification,
     OUString const & rContext,
     OUString const & rMessage,
@@ -72,19 +72,19 @@ executeErrorDialog(
     switch (eClassification)
     {
         case task::InteractionClassification_ERROR:
-            xBox.reset(Application::CreateMessageDialog(pParent ? pParent->GetFrameWeld() : nullptr,
+            xBox.reset(Application::CreateMessageDialog(pParent,
                         VclMessageType::Error, VclButtonsType::NONE, aText.makeStringAndClear()));
             break;
         case task::InteractionClassification_WARNING:
-            xBox.reset(Application::CreateMessageDialog(pParent ? pParent->GetFrameWeld() : nullptr,
+            xBox.reset(Application::CreateMessageDialog(pParent,
                         VclMessageType::Warning, VclButtonsType::NONE, aText.makeStringAndClear()));
             break;
         case task::InteractionClassification_INFO:
-            xBox.reset(Application::CreateMessageDialog(pParent ? pParent->GetFrameWeld() : nullptr,
+            xBox.reset(Application::CreateMessageDialog(pParent,
                         VclMessageType::Info, VclButtonsType::NONE, aText.makeStringAndClear()));
             break;
         case task::InteractionClassification_QUERY:
-            xBox.reset(Application::CreateMessageDialog(pParent ? pParent->GetFrameWeld() : nullptr,
+            xBox.reset(Application::CreateMessageDialog(pParent,
                         VclMessageType::Question, VclButtonsType::NONE, aText.makeStringAndClear()));
             break;
         default:
@@ -245,8 +245,9 @@ UUIInteractionHelper::handleErrorHandlerRequest(
             }
         }
 
-        DialogMask nResult = executeErrorDialog(
-            getParentProperty(), eClassification, aContext, aMessage, nButtonMask );
+        uno::Reference<awt::XWindow> xParent = getParentXWindow();
+        DialogMask nResult = executeErrorDialog(Application::GetFrameWeld(xParent),
+                eClassification, aContext, aMessage, nButtonMask );
 
         switch (nResult)
         {
diff --git a/uui/source/iahndl-locking.cxx b/uui/source/iahndl-locking.cxx
index b1fa4989d66d..8df6c85b0608 100644
--- a/uui/source/iahndl-locking.cxx
+++ b/uui/source/iahndl-locking.cxx
@@ -210,38 +210,38 @@ UUIInteractionHelper::handleLockedDocumentRequest(
     document::LockedDocumentRequest aLockedDocumentRequest;
     if (aAnyRequest >>= aLockedDocumentRequest )
     {
-        vcl::Window* pWin = getParentProperty();
-        handleLockedDocumentRequest_( pWin ? pWin->GetFrameWeld() : nullptr,
-                                      aLockedDocumentRequest.DocumentURL,
-                                      aLockedDocumentRequest.UserInfo,
-                                      rRequest->getContinuations(),
-                                      UUI_DOC_LOAD_LOCK );
+        uno::Reference<awt::XWindow> xParent = getParentXWindow();
+        handleLockedDocumentRequest_(Application::GetFrameWeld(xParent),
+                                     aLockedDocumentRequest.DocumentURL,
+                                     aLockedDocumentRequest.UserInfo,
+                                     rRequest->getContinuations(),
+                                     UUI_DOC_LOAD_LOCK);
         return true;
     }
 
     document::OwnLockOnDocumentRequest aOwnLockOnDocumentRequest;
     if (aAnyRequest >>= aOwnLockOnDocumentRequest )
     {
-        vcl::Window* pWin = getParentProperty();
-        handleLockedDocumentRequest_( pWin ? pWin->GetFrameWeld() : nullptr,
-                                      aOwnLockOnDocumentRequest.DocumentURL,
-                                      aOwnLockOnDocumentRequest.TimeInfo,
-                                      rRequest->getContinuations(),
-                                      aOwnLockOnDocumentRequest.IsStoring
-                                          ? UUI_DOC_OWN_SAVE_LOCK
-                                          : UUI_DOC_OWN_LOAD_LOCK );
+        uno::Reference<awt::XWindow> xParent = getParentXWindow();
+        handleLockedDocumentRequest_(Application::GetFrameWeld(xParent),
+                                     aOwnLockOnDocumentRequest.DocumentURL,
+                                     aOwnLockOnDocumentRequest.TimeInfo,
+                                     rRequest->getContinuations(),
+                                     aOwnLockOnDocumentRequest.IsStoring
+                                         ? UUI_DOC_OWN_SAVE_LOCK
+                                         : UUI_DOC_OWN_LOAD_LOCK);
         return true;
     }
 
     document::LockedOnSavingRequest aLockedOnSavingRequest;
     if (aAnyRequest >>= aLockedOnSavingRequest )
     {
-        vcl::Window* pWin = getParentProperty();
-        handleLockedDocumentRequest_( pWin ? pWin->GetFrameWeld() : nullptr,
-                                      aLockedOnSavingRequest.DocumentURL,
-                                      aLockedOnSavingRequest.UserInfo,
-                                      rRequest->getContinuations(),
-                                      UUI_DOC_SAVE_LOCK );
+        uno::Reference<awt::XWindow> xParent = getParentXWindow();
+        handleLockedDocumentRequest_(Application::GetFrameWeld(xParent),
+                                     aLockedOnSavingRequest.DocumentURL,
+                                     aLockedOnSavingRequest.UserInfo,
+                                     rRequest->getContinuations(),
+                                     UUI_DOC_SAVE_LOCK);
         return true;
     }
     return false;
@@ -256,9 +256,9 @@ UUIInteractionHelper::handleChangedByOthersRequest(
     document::ChangedByOthersRequest aChangedByOthersRequest;
     if (aAnyRequest >>= aChangedByOthersRequest )
     {
-        vcl::Window* pWin = getParentProperty();
-        handleChangedByOthersRequest_( pWin ? pWin->GetFrameWeld() : nullptr,
-                                       rRequest->getContinuations() );
+        uno::Reference<awt::XWindow> xParent = getParentXWindow();
+        handleChangedByOthersRequest_(Application::GetFrameWeld(xParent),
+                                      rRequest->getContinuations());
         return true;
     }
     return false;
@@ -274,18 +274,18 @@ UUIInteractionHelper::handleLockFileProblemRequest(
     document::LockFileIgnoreRequest aLockFileIgnoreRequest;
     if (aAnyRequest >>= aLockFileIgnoreRequest )
     {
-        vcl::Window* pWin = getParentProperty();
-        handleLockFileProblemRequest_( pWin ? pWin->GetFrameWeld() : nullptr,
-                                      rRequest->getContinuations(), UUI_DOC_CreateErrDlg );
+        uno::Reference<awt::XWindow> xParent = getParentXWindow();
+        handleLockFileProblemRequest_(Application::GetFrameWeld(xParent),
+                                      rRequest->getContinuations(), UUI_DOC_CreateErrDlg);
         return true;
     }
 
     document::LockFileCorruptRequest aLockFileCorruptRequest;
     if (aAnyRequest >>= aLockFileCorruptRequest )
     {
-        vcl::Window* pWin = getParentProperty();
-        handleLockFileProblemRequest_( pWin ? pWin->GetFrameWeld() : nullptr,
-                                      rRequest->getContinuations(), UUI_DOC_CorruptErrDlg );
+        uno::Reference<awt::XWindow> xParent = getParentXWindow();
+        handleLockFileProblemRequest_(Application::GetFrameWeld(xParent),
+                                      rRequest->getContinuations(), UUI_DOC_CorruptErrDlg);
         return true;
     }
 
diff --git a/uui/source/iahndl-ssl.cxx b/uui/source/iahndl-ssl.cxx
index 799dd60b106a..096f81b21d4c 100644
--- a/uui/source/iahndl-ssl.cxx
+++ b/uui/source/iahndl-ssl.cxx
@@ -348,8 +348,8 @@ UUIInteractionHelper::handleCertificateValidationRequest(
     ucb::CertificateValidationRequest aCertificateValidationRequest;
     if (aAnyRequest >>= aCertificateValidationRequest)
     {
-        vcl::Window* pWindow = getParentProperty();
-        handleCertificateValidationRequest_(pWindow ? pWindow->GetFrameWeld() : nullptr,
+        uno::Reference<awt::XWindow> xParent = getParentXWindow();
+        handleCertificateValidationRequest_(Application::GetFrameWeld(xParent),
                                             m_xContext,
                                             aCertificateValidationRequest,
                                             rRequest->getContinuations());
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index fa017aabadab..ce610c46ec41 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -1137,13 +1137,13 @@ UUIInteractionHelper::handleGenericErrorRequest(
                 aTitle += " - " ;
             aTitle += aErrTitle;
 
-            vcl::Window* pWin = getParentProperty();
-            executeMessageBox(pWin ? pWin->GetFrameWeld() : nullptr, aTitle, aErrorString, VclMessageType::Error);
+            uno::Reference<awt::XWindow> xParent = getParentXWindow();
+            executeMessageBox(Application::GetFrameWeld(xParent), aTitle, aErrorString, VclMessageType::Error);
         }
         else
         {
-            vcl::Window* pParent = getParentProperty();
-            ErrorHandler::HandleError(nErrorCode, pParent ? pParent->GetFrameWeld() : nullptr);
+            uno::Reference<awt::XWindow> xParent = getParentXWindow();
+            ErrorHandler::HandleError(nErrorCode, Application::GetFrameWeld(xParent));
         }
 
         if (xApprove.is() && bWarning)
@@ -1169,8 +1169,8 @@ UUIInteractionHelper::handleMacroConfirmRequest(
     bool bApprove = false;
 
     bool bShowSignatures = aSignInfo.getLength() > 0;
-    vcl::Window* pWin = getParentProperty();
-    MacroWarning aWarning(pWin ? pWin->GetFrameWeld() : nullptr, bShowSignatures);
+    uno::Reference<awt::XWindow> xParent = getParentXWindow();
+    MacroWarning aWarning(Application::GetFrameWeld(xParent), bShowSignatures);
 
     aWarning.SetDocumentURL(aDocumentURL);
     if ( aSignInfo.getLength() > 1 )
@@ -1252,8 +1252,8 @@ UUIInteractionHelper::handleBrokenPackageRequest(
         " " +
         utl::ConfigManager::getProductVersion() );
 
-    vcl::Window* pWin = getParentProperty();
-    switch (executeMessageBox(pWin ? pWin->GetFrameWeld() : nullptr, title, aMessage, eMessageType))
+    uno::Reference<awt::XWindow> xParent = getParentXWindow();
+    switch (executeMessageBox(Application::GetFrameWeld(xParent), title, aMessage, eMessageType))
     {
     case DialogMask::ButtonsOk:
         OSL_ENSURE( xAbort.is(), "unexpected situation" );


More information about the Libreoffice-commits mailing list