diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-11-05 20:28:27 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-11-07 21:04:50 +0000 |
commit | 64a708cba9b954afe3331f63c58218eb53b3d0ce (patch) | |
tree | ddc1bea3b63f32a1c6d377c1d1dd7aee0803fb70 /sd/source/ui/dlg/copydlg.cxx | |
parent | f01c49c4a89ecad2376fd0023625186e5cac642e (diff) |
Revert "Reverts a commit series that cripple windows ci."
with addition of...
- svxlo-SvxColorListBox
+ svxcorelo-SvxColorListBox
This reverts commit db380aab1063e8a5e40111c40ee9f7921aa82601.
Change-Id: I3af7aa0abb1a430bce64188244404fcbd480b128
Reviewed-on: https://gerrit.libreoffice.org/30598
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sd/source/ui/dlg/copydlg.cxx')
-rw-r--r-- | sd/source/ui/dlg/copydlg.cxx | 35 |
1 files changed, 10 insertions, 25 deletions
diff --git a/sd/source/ui/dlg/copydlg.cxx b/sd/source/ui/dlg/copydlg.cxx index f68e06c38293..efcebc1442f1 100644 --- a/sd/source/ui/dlg/copydlg.cxx +++ b/sd/source/ui/dlg/copydlg.cxx @@ -19,6 +19,7 @@ #include "copydlg.hxx" #include <comphelper/string.hxx> +#include <svx/colorbox.hxx> #include <svx/dlgutil.hxx> #include <sfx2/module.hxx> #include <svx/xcolit.hxx> @@ -40,11 +41,9 @@ namespace sd { #define TOKEN ';' -CopyDlg::CopyDlg(vcl::Window* pWindow, const SfxItemSet& rInAttrs, - const XColorListRef &pColList, ::sd::View* pInView) +CopyDlg::CopyDlg(vcl::Window* pWindow, const SfxItemSet& rInAttrs, ::sd::View* pInView) : SfxModalDialog(pWindow, "DuplicateDialog", "modules/sdraw/ui/copydlg.ui") , mrOutAttrs(rInAttrs) - , mpColorList(pColList) , maUIScale(pInView->GetDoc().GetUIScale()) , mpView(pInView) { @@ -60,11 +59,6 @@ CopyDlg::CopyDlg(vcl::Window* pWindow, const SfxItemSet& rInAttrs, get(m_pLbEndColor, "end"); get(m_pBtnSetDefault, "default"); - // color tables - DBG_ASSERT( mpColorList.is(), "No colortable available !" ); - m_pLbStartColor->Fill( mpColorList ); - m_pLbEndColor->CopyEntries( *m_pLbStartColor ); - m_pLbStartColor->SetSelectHdl( LINK( this, CopyDlg, SelectColorHdl ) ); m_pBtnSetViewData->SetClickHdl( LINK( this, CopyDlg, SetViewData ) ); m_pBtnSetDefault->SetClickHdl( LINK( this, CopyDlg, SetDefault ) ); @@ -201,31 +195,22 @@ void CopyDlg::GetAttr( SfxItemSet& rOutAttrs ) rOutAttrs.Put( SfxInt32Item( ATTR_COPY_WIDTH, nWidth ) ); rOutAttrs.Put( SfxInt32Item( ATTR_COPY_HEIGHT, nHeight ) ); - if( m_pLbStartColor->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND ) - { - XColorItem aXColorItem( ATTR_COPY_START_COLOR, m_pLbStartColor->GetSelectEntry(), - m_pLbStartColor->GetSelectEntryColor() ); - rOutAttrs.Put( aXColorItem ); - } - if( m_pLbEndColor->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND ) - { - XColorItem aXColorItem( ATTR_COPY_END_COLOR, m_pLbEndColor->GetSelectEntry(), - m_pLbEndColor->GetSelectEntryColor() ); - rOutAttrs.Put( aXColorItem ); - } + NamedColor aColor = m_pLbStartColor->GetSelectEntry(); + rOutAttrs.Put(XColorItem(ATTR_COPY_START_COLOR, aColor.second, aColor.first)); + aColor = m_pLbEndColor->GetSelectEntry(); + rOutAttrs.Put(XColorItem(ATTR_COPY_END_COLOR, aColor.second, aColor.first)); } /** * enables and selects end color LB */ -IMPL_LINK_NOARG(CopyDlg, SelectColorHdl, ListBox&, void) +IMPL_LINK_NOARG(CopyDlg, SelectColorHdl, SvxColorListBox&, void) { - sal_Int32 nPos = m_pLbStartColor->GetSelectEntryPos(); + const Color aColor = m_pLbStartColor->GetSelectEntryColor(); - if( nPos != LISTBOX_ENTRY_NOTFOUND && - !m_pLbEndColor->IsEnabled() ) + if (!m_pLbEndColor->IsEnabled()) { - m_pLbEndColor->SelectEntryPos( nPos ); + m_pLbEndColor->SelectEntry(aColor); m_pLbEndColor->Enable(); m_pFtEndColor->Enable(); } |