summaryrefslogtreecommitdiff
path: root/cui/source/tabpages/tpline.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cui/source/tabpages/tpline.cxx')
-rw-r--r--cui/source/tabpages/tpline.cxx30
1 files changed, 7 insertions, 23 deletions
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index 11ffd614387d..3172081f1a2c 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -24,6 +24,7 @@
#include <sfx2/module.hxx>
#include <cuires.hrc>
+#include <svx/colorbox.hxx>
#include "svx/xattr.hxx"
#include <svx/xpool.hxx>
#include <svx/xtable.hxx>
@@ -268,8 +269,6 @@ void SvxLineTabPage::dispose()
void SvxLineTabPage::Construct()
{
- // Color chart
- m_pLbColor->Fill( m_pColorList );
FillListboxes();
}
@@ -641,17 +640,6 @@ void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet )
{
if( *m_pnColorListState & ChangeType::CHANGED )
m_pColorList = static_cast<SvxLineTabDialog*>( GetParentDialog() )->GetNewColorList();
- // aLbColor
- sal_Int32 nColorPos = m_pLbColor->GetSelectEntryPos();
- m_pLbColor->Clear();
- m_pLbColor->Fill( m_pColorList );
- nCount = m_pLbColor->GetEntryCount();
- if( nCount == 0 )
- ; // This case should never occur
- else if( nCount <= nColorPos )
- m_pLbColor->SelectEntryPos( 0 );
- else
- m_pLbColor->SelectEntryPos( nColorPos );
ChangePreviewHdl_Impl( nullptr );
}
@@ -767,9 +755,9 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
}
// Line color
- if( m_pLbColor->IsValueChangedFromSaved() )
{
- XLineColorItem aItem( m_pLbColor->GetSelectEntry(), m_pLbColor->GetSelectEntryColor() );
+ NamedColor aColor = m_pLbColor->GetSelectEntry();
+ XLineColorItem aItem(aColor.second, aColor.first);
pOld = GetOldItem( *rAttrs, XATTR_LINECOLOR );
if ( !pOld || !( *static_cast<const XLineColorItem*>(pOld) == aItem ) )
{
@@ -1070,7 +1058,8 @@ void SvxLineTabPage::FillXLSet_Impl()
m_rXLSet.Put( XLineEndWidthItem( GetCoreValue( *m_pMtrEndWidth, m_ePoolUnit ) ) );
m_rXLSet.Put( XLineWidthItem( GetCoreValue( *m_pMtrLineWidth, m_ePoolUnit ) ) );
- m_rXLSet.Put( XLineColorItem( m_pLbColor->GetSelectEntry(), m_pLbColor->GetSelectEntryColor() ) );
+ NamedColor aColor = m_pLbColor->GetSelectEntry();
+ m_rXLSet.Put(XLineColorItem(aColor.second, aColor.first));
// Centered line end
if( m_pTsbCenterStart->GetState() == TRISTATE_TRUE )
@@ -1260,11 +1249,6 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
{
Color aCol = static_cast<const XLineColorItem&>( rAttrs->Get( XATTR_LINECOLOR ) ).GetColorValue();
m_pLbColor->SelectEntry( aCol );
- if( m_pLbColor->GetSelectEntryCount() == 0 )
- {
- m_pLbColor->InsertEntry( aCol, OUString() );
- m_pLbColor->SelectEntry( aCol );
- }
}
// Line start
@@ -1498,11 +1482,11 @@ VclPtr<SfxTabPage> SvxLineTabPage::Create( vcl::Window* pWindow,
return VclPtr<SvxLineTabPage>::Create( pWindow, *rAttrs );
}
-
-IMPL_LINK( SvxLineTabPage, ChangePreviewListBoxHdl_Impl, ListBox&, rListBox, void )
+IMPL_LINK( SvxLineTabPage, ChangePreviewListBoxHdl_Impl, SvxColorListBox&, rListBox, void )
{
ChangePreviewHdl_Impl(&rListBox);
}
+
IMPL_LINK( SvxLineTabPage, ChangePreviewModifyHdl_Impl, Edit&, rEdit, void )
{
ChangePreviewHdl_Impl(&rEdit);