diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-06-20 14:15:01 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-06-21 09:59:39 +0200 |
commit | 649be5feb4e162f83e9ff5fc8a68b463e723bc07 (patch) | |
tree | 30ed9e92936bfa51ec376e438fabccc55facff0c /svx | |
parent | 1d48e998ae038263b092e0de71da97fceee299f4 (diff) |
move SvColorDialog to welded arguments
Change-Id: Ieb04fc4684caa6df47b123ab06e280f2d204375a
Reviewed-on: https://gerrit.libreoffice.org/56174
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/dialog/_bmpmask.cxx | 17 | ||||
-rw-r--r-- | svx/source/engine3d/float3d.cxx | 5 | ||||
-rw-r--r-- | svx/source/tbxctrls/PaletteManager.cxx | 6 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 2 |
4 files changed, 14 insertions, 16 deletions
diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx index 0256b719e9a4..cd797af7552f 100644 --- a/svx/source/dialog/_bmpmask.cxx +++ b/svx/source/dialog/_bmpmask.cxx @@ -55,13 +55,13 @@ SFX_IMPL_DOCKINGWINDOW_WITHID( SvxBmpMaskChildWindow, SID_BMPMASK ) -class ColorWindow : public Control +class BmpColorWindow : public Control { Color aColor; public: - explicit ColorWindow(vcl::Window* pParent) + explicit BmpColorWindow(vcl::Window* pParent) : Control(pParent, WB_BORDER) , aColor( COL_WHITE ) { @@ -147,15 +147,14 @@ void MaskSet::KeyInput( const KeyEvent& rKEvt ) void MaskSet::onEditColor() { - std::unique_ptr<SvColorDialog> pColorDlg(new SvColorDialog( GetParent() )); + SvColorDialog aColorDlg; - pColorDlg->SetColor(GetItemColor(1)); + aColorDlg.SetColor(GetItemColor(1)); - if( pColorDlg->Execute() ) - SetItemColor( 1, pColorDlg->GetColor() ); + if (aColorDlg.Execute(GetFrameWeld())) + SetItemColor(1, aColorDlg.GetColor()); } - class MaskData { VclPtr<SvxBmpMask> pMask; @@ -310,7 +309,7 @@ IMPL_LINK_NOARG(MaskData, ExecHdl, Button*, void) { &aBItem }); } -void ColorWindow::Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& /*Rect*/) +void BmpColorWindow::Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& /*Rect*/) { rRenderContext.Push(PushFlags::LINECOLOR | PushFlags::FILLCOLOR); rRenderContext.SetLineColor(aColor); @@ -361,7 +360,7 @@ SvxBmpMask::SvxBmpMask(SfxBindings *pBindinx, SfxChildWindow *pCW, vcl::Window* m_pTbxPipette->SetItemBits(m_pTbxPipette->GetItemId(0), ToolBoxItemBits::AUTOCHECK); get(m_pBtnExec, "replace"); - m_pCtlPipette = VclPtr<ColorWindow>::Create(get<Window>("toolgrid")); + m_pCtlPipette = VclPtr<BmpColorWindow>::Create(get<Window>("toolgrid")); m_pCtlPipette->Show(); m_pCtlPipette->set_grid_left_attach(1); m_pCtlPipette->set_grid_top_attach(0); diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx index 98f9fb485df3..b0763c522ed2 100644 --- a/svx/source/engine3d/float3d.cxx +++ b/svx/source/engine3d/float3d.cxx @@ -2506,10 +2506,9 @@ IMPL_LINK( Svx3DWin, ClickHdl, Button *, pButton, void ) } } - IMPL_LINK( Svx3DWin, ClickColorHdl, Button *, pBtn, void) { - SvColorDialog aColorDlg( this ); + SvColorDialog aColorDlg; SvxColorListBox* pLb; if( pBtn == m_pBtnLightColor ) @@ -2526,7 +2525,7 @@ IMPL_LINK( Svx3DWin, ClickColorHdl, Button *, pBtn, void) Color aColor = pLb->GetSelectEntryColor(); aColorDlg.SetColor( aColor ); - if( aColorDlg.Execute() == RET_OK ) + if( aColorDlg.Execute(GetFrameWeld()) == RET_OK ) { aColor = aColorDlg.GetColor(); LBSelectColor(pLb, aColor); diff --git a/svx/source/tbxctrls/PaletteManager.cxx b/svx/source/tbxctrls/PaletteManager.cxx index 48bd555893ee..27c84cdbfd56 100644 --- a/svx/source/tbxctrls/PaletteManager.cxx +++ b/svx/source/tbxctrls/PaletteManager.cxx @@ -357,14 +357,14 @@ void PaletteManager::SetColorSelectFunction(const std::function<void(const OUStr maColorSelectFunction = aColorSelectFunction; } -void PaletteManager::PopupColorPicker(vcl::Window* pParent, const OUString& aCommand, const Color& rInitialColor) +void PaletteManager::PopupColorPicker(weld::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(pParent); + SvColorDialog aColorDlg; aColorDlg.SetColor(rInitialColor); aColorDlg.SetMode(svtools::ColorPickerMode::Modify); - if( aColorDlg.Execute() == RET_OK ) + if (aColorDlg.Execute(pParent) == RET_OK) { if (mpBtnUpdater) mpBtnUpdater->Update( aColorDlg.GetColor() ); diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index ae103afddc21..b9e58be778ae 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -1513,7 +1513,7 @@ IMPL_LINK_NOARG(SvxColorWindow, OpenPickerClickHdl, Button*, void) if ( IsInPopupMode() ) EndPopupMode(); - mxPaletteManager->PopupColorPicker(mxParentWindow, maCommand, GetSelectEntryColor().first); + mxPaletteManager->PopupColorPicker(mxParentWindow->GetFrameWeld(), maCommand, GetSelectEntryColor().first); } void SvxColorWindow::StartSelection() |