diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-03-09 13:48:20 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-03-09 17:03:42 +0100 |
commit | 7750df3d615fde25d005fc56a14e4ae4d50b2d6a (patch) | |
tree | c6ed5594a91cef23b922957c7dee3d4d57367618 | |
parent | cf42f0916d1f30d8939de15bff626cabb6836d35 (diff) |
give color picker explicit parent
Change-Id: I73e9a29abd5d767b31850e9a6b1f2b8d757ee928
Reviewed-on: https://gerrit.libreoffice.org/51000
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | include/svtools/toolbarmenu.hxx | 2 | ||||
-rw-r--r-- | include/svx/PaletteManager.hxx | 2 | ||||
-rw-r--r-- | svx/source/tbxctrls/PaletteManager.cxx | 4 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 3 |
4 files changed, 6 insertions, 5 deletions
diff --git a/include/svtools/toolbarmenu.hxx b/include/svtools/toolbarmenu.hxx index 88174253548a..5372c719892e 100644 --- a/include/svtools/toolbarmenu.hxx +++ b/include/svtools/toolbarmenu.hxx @@ -66,10 +66,10 @@ protected: /// @throws css::uno::RuntimeException virtual void statusChanged(const css::frame::FeatureStateEvent& Event ); + css::uno::Reference< css::frame::XFrame > mxFrame; private: void init(); - css::uno::Reference< css::frame::XFrame > mxFrame; rtl::Reference< svt::FrameStatusListener > mxStatusListener; }; diff --git a/include/svx/PaletteManager.hxx b/include/svx/PaletteManager.hxx index 3cd11df51b22..c2a3b869d517 100644 --- a/include/svx/PaletteManager.hxx +++ b/include/svx/PaletteManager.hxx @@ -73,7 +73,7 @@ public: void AddRecentColor(const Color& rRecentColor, const OUString& rColorName, bool bFront = true); void SetBtnUpdater(svx::ToolboxButtonColorUpdater* pBtnUpdater); - void PopupColorPicker(const OUString& aCommand, const Color& rInitialColor); + void PopupColorPicker(vcl::Window* pParent, const OUString& aCommand, const Color& rInitialColor); void SetColorSelectFunction(const std::function<void(const OUString&, const NamedColor&)>& aColorSelectFunction); diff --git a/svx/source/tbxctrls/PaletteManager.cxx b/svx/source/tbxctrls/PaletteManager.cxx index 32b3aa11edf6..ddd952cf6cb2 100644 --- a/svx/source/tbxctrls/PaletteManager.cxx +++ b/svx/source/tbxctrls/PaletteManager.cxx @@ -305,11 +305,11 @@ void PaletteManager::SetColorSelectFunction(const std::function<void(const OUStr maColorSelectFunction = aColorSelectFunction; } -void PaletteManager::PopupColorPicker(const OUString& aCommand, const Color& rInitialColor) +void PaletteManager::PopupColorPicker(vcl::Window* pParent, const OUString& aCommand, const Color& rInitialColor) { // The calling object goes away during aColorDlg.Execute(), so we must copy this OUString aCommandCopy = aCommand; - SvColorDialog aColorDlg( nullptr ); + SvColorDialog aColorDlg(pParent); aColorDlg.SetColor(rInitialColor); aColorDlg.SetMode(svtools::ColorPickerMode::Modify); if( aColorDlg.Execute() == RET_OK ) diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 14d6441feee9..212afa8efe89 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -1505,7 +1505,8 @@ IMPL_LINK_NOARG(SvxColorWindow, OpenPickerClickHdl, Button*, void) if ( IsInPopupMode() ) EndPopupMode(); - mxPaletteManager->PopupColorPicker(maCommand, GetSelectEntryColor().first); + const css::uno::Reference<css::awt::XWindow> xParent(mxFrame->getContainerWindow(), uno::UNO_QUERY); + mxPaletteManager->PopupColorPicker(VCLUnoHelper::GetWindow(xParent), maCommand, GetSelectEntryColor().first); } void SvxColorWindow::StartSelection() |