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

give color picker explicit parent

Change-Id: I73e9a29abd5d767b31850e9a6b1f2b8d757ee928
Reviewed-on: https://gerrit.libreoffice.org/51000Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst cf42f091
......@@ -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;
};
......
......@@ -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);
......
......@@ -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 )
......
......@@ -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()
......
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