summaryrefslogtreecommitdiff
path: root/sd/source/ui/dlg/copydlg.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-10-28 13:37:33 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-11-04 17:14:26 +0000
commit43bc3031483d172eccd72c3804e2d4fc2ef37de4 (patch)
tree991d98e8e61fae47ada28ba7a0b02e1d6c8e443f /sd/source/ui/dlg/copydlg.cxx
parent44523738f094ff3987e85ea0c47b8c636bbe5786 (diff)
unify color selectors
Note: this removes the use of auto-color from writer's asian text grid, because its always invisible as far as I can see in practice. Change-Id: Ie850790d740a4d56c43015e493e093678cef3b4e
Diffstat (limited to 'sd/source/ui/dlg/copydlg.cxx')
-rw-r--r--sd/source/ui/dlg/copydlg.cxx35
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();
}