diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-04-03 17:24:25 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2023-04-03 21:01:51 +0200 |
commit | dd56b1c4980bea867286880bd0ac194b6106c968 (patch) | |
tree | c1a601c203ba9c99aad89d0af53d8c842893e828 /embeddedobj | |
parent | e97c8ceb003488589bf14c7ea335eaa3e1a86975 (diff) |
set a parent for embedded object warning dialog
calc does a lot of "CaptureMouse" which then leads to a lot of
"ReleaseMouse", I'm somewhat unconvinced that there should be any
CaptureMouse calls in there.
Change-Id: I7c44d2c36c89a5c32c525d65939723da9be77a72
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149973
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'embeddedobj')
-rw-r--r-- | embeddedobj/source/commonembedding/miscobj.cxx | 7 | ||||
-rw-r--r-- | embeddedobj/source/inc/commonembobj.hxx | 3 |
2 files changed, 6 insertions, 4 deletions
diff --git a/embeddedobj/source/commonembedding/miscobj.cxx b/embeddedobj/source/commonembedding/miscobj.cxx index ecd149b8bb17..9fb1de15830b 100644 --- a/embeddedobj/source/commonembedding/miscobj.cxx +++ b/embeddedobj/source/commonembedding/miscobj.cxx @@ -37,7 +37,6 @@ #include <utility> #include <vcl/weld.hxx> -#include <unotools/resmgr.hxx> #include <vcl/stdtext.hxx> #include <strings.hrc> #include <osl/file.hxx> @@ -346,7 +345,7 @@ void OCommonEmbeddedObject::PostEvent_Impl( const OUString& aEventName ) } -static int ShowMsgDialog( TranslateId Msg, const OUString& sFileName ) +int OCommonEmbeddedObject::ShowMsgDialog(TranslateId Msg, const OUString& sFileName) { std::locale aResLocale = Translate::Create( "emo" ); OUString aMsg = Translate::get( Msg, aResLocale ); @@ -356,7 +355,7 @@ static int ShowMsgDialog( TranslateId Msg, const OUString& sFileName ) osl::FileBase::getSystemPathFromFileURL( sFileName, aTemp ); aMsg = aMsg.replaceFirst( "%{filename}", aTemp ); - weld::Window* pParent = Application::GetFrameWeld( nullptr ); + weld::Window* pParent = Application::GetFrameWeld(m_xClientWindow); std::unique_ptr<weld::MessageDialog> xQueryBox (Application::CreateMessageDialog( pParent, VclMessageType::Warning, VclButtonsType::NONE, aMsg ) ); @@ -431,7 +430,7 @@ void OCommonEmbeddedObject::handleLinkedOLE( CopyBackToOLELink eState ) OUString aMsg; osl::FileBase::getSystemPathFromFileURL( SrcName, aMsg ); aMsg = ex.Message + "\n\n" + aMsg; - weld::Window* pParent = Application::GetFrameWeld( nullptr ); + weld::Window* pParent = Application::GetFrameWeld(m_xClientWindow); std::unique_ptr<weld::MessageDialog> xQueryBox( Application::CreateMessageDialog( pParent, VclMessageType::Error, VclButtonsType::Ok, aMsg ) ); diff --git a/embeddedobj/source/inc/commonembobj.hxx b/embeddedobj/source/inc/commonembobj.hxx index 8f0a685c22c3..64ce9ae0f9f5 100644 --- a/embeddedobj/source/inc/commonembobj.hxx +++ b/embeddedobj/source/inc/commonembobj.hxx @@ -41,6 +41,7 @@ #include <map> #include <memory> #include <svtools/filechangedchecker.hxx> +#include <unotools/resmgr.hxx> namespace com::sun::star { namespace embed { @@ -251,6 +252,8 @@ private: const css::uno::Sequence< css::beans::PropertyValue >& lArguments, const css::uno::Sequence< css::beans::PropertyValue >& lObjArgs ); + int ShowMsgDialog(TranslateId Msg, const OUString& sFileName); + public: OCommonEmbeddedObject( css::uno::Reference< css::uno::XComponentContext > xContext, |