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 /cui/source/tabpages/tphatch.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 'cui/source/tabpages/tphatch.cxx')
-rw-r--r-- | cui/source/tabpages/tphatch.cxx | 55 |
1 files changed, 12 insertions, 43 deletions
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx index 1f4fa526d9da..31efad7ad521 100644 --- a/cui/source/tabpages/tphatch.cxx +++ b/cui/source/tabpages/tphatch.cxx @@ -29,6 +29,7 @@ #include <cuires.hrc> #include "helpid.hrc" +#include <svx/colorbox.hxx> #include "svx/xattr.hxx" #include <svx/xpool.hxx> #include <svx/xtable.hxx> @@ -118,7 +119,8 @@ SvxHatchTabPage::SvxHatchTabPage m_pMtrAngle->SetModifyHdl( aLink ); m_pSliderAngle->SetSlideHdl( LINK( this, SvxHatchTabPage, ModifiedSliderHdl_Impl ) ); m_pLbLineType->SetSelectHdl( aLink2 ); - m_pLbLineColor->SetSelectHdl( aLink2 ); + Link<SvxColorListBox&,void> aLink3 = LINK( this, SvxHatchTabPage, ModifiedColorListBoxHdl_Impl ); + m_pLbLineColor->SetSelectHdl( aLink3 ); m_pCbBackgroundColor->SetToggleHdl( LINK( this, SvxHatchTabPage, ToggleHatchBackgroundColor_Impl ) ); m_pLbBackgroundColor->SetSelectHdl( LINK( this, SvxHatchTabPage, ModifiedBackgroundHdl_Impl ) ); @@ -150,20 +152,13 @@ void SvxHatchTabPage::dispose() SvxTabPage::dispose(); } - void SvxHatchTabPage::Construct() { - m_pLbLineColor->Fill( m_pColorList ); - m_pLbBackgroundColor->Fill( m_pColorList ); m_pHatchLB->FillPresetListBox(*m_pHatchingList); } - void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet ) { - sal_Int32 nPos; - sal_Int32 nCount; - if( m_pColorList.is() ) { // ColorList @@ -175,18 +170,6 @@ void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet ) if (pArea) m_pColorList = pArea->GetNewColorList(); - // LbLineColor - nPos = m_pLbLineColor->GetSelectEntryPos(); - m_pLbLineColor->Clear(); - m_pLbLineColor->Fill( m_pColorList ); - nCount = m_pLbLineColor->GetEntryCount(); - if( nCount == 0 ) - ; // this case should not occur - else if( nCount <= nPos ) - m_pLbLineColor->SelectEntryPos( 0 ); - else - m_pLbLineColor->SelectEntryPos( nPos ); - ModifiedHdl_Impl( this ); } @@ -228,12 +211,6 @@ void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet ) Color aColor(aColorItem.GetColorValue()); m_pLbBackgroundColor->Enable(); m_pLbBackgroundColor->SelectEntry(aColor); - - if( m_pLbBackgroundColor->GetSelectEntryCount() == 0 ) - { - m_pLbBackgroundColor->InsertEntry( aColor , OUString() ); - m_pLbBackgroundColor->SelectEntry( aColor ); - } m_rXFSet.Put( aColorItem ); } else @@ -295,15 +272,10 @@ bool SvxHatchTabPage::FillItemSet( SfxItemSet* rSet ) rSet->Put( XFillStyleItem( drawing::FillStyle_HATCH ) ); rSet->Put( XFillHatchItem( aString, *pXHatch ) ); rSet->Put( XFillBackgroundItem( m_pCbBackgroundColor->IsChecked() ) ); - if(m_pCbBackgroundColor->IsChecked()) + if (m_pCbBackgroundColor->IsChecked()) { - sal_uInt32 nPosBckColor = m_pLbBackgroundColor->GetSelectEntryPos(); - OUString aBckColorString; - if( nPosBckColor != LISTBOX_ENTRY_NOTFOUND ) - aBckColorString = m_pLbBackgroundColor->GetSelectEntry(); - else - aBckColorString = OUString(); - rSet->Put( XFillColorItem( aBckColorString, m_pLbBackgroundColor->GetSelectEntryColor() ) ); + NamedColor aColor = m_pLbBackgroundColor->GetSelectEntry(); + rSet->Put(XFillColorItem(aColor.second, aColor.first)); } return true; } @@ -335,12 +307,16 @@ VclPtr<SfxTabPage> SvxHatchTabPage::Create( vcl::Window* pWindow, return VclPtr<SvxHatchTabPage>::Create( pWindow, *rSet ); } - IMPL_LINK( SvxHatchTabPage, ModifiedListBoxHdl_Impl, ListBox&, rListBox, void ) { ModifiedHdl_Impl(&rListBox); } +IMPL_LINK( SvxHatchTabPage, ModifiedColorListBoxHdl_Impl, SvxColorListBox&, rListBox, void ) +{ + ModifiedHdl_Impl(&rListBox); +} + IMPL_LINK_NOARG( SvxHatchTabPage, ToggleHatchBackgroundColor_Impl, CheckBox&, void ) { if(m_pCbBackgroundColor->IsChecked()) @@ -351,7 +327,7 @@ IMPL_LINK_NOARG( SvxHatchTabPage, ToggleHatchBackgroundColor_Impl, CheckBox&, vo ModifiedBackgroundHdl_Impl(*m_pLbBackgroundColor); } -IMPL_LINK_NOARG( SvxHatchTabPage, ModifiedBackgroundHdl_Impl, ListBox&, void ) +IMPL_LINK_NOARG( SvxHatchTabPage, ModifiedBackgroundHdl_Impl, SvxColorListBox&, void ) { Color aColor(COL_TRANSPARENT); if(m_pCbBackgroundColor->IsChecked()) @@ -429,15 +405,8 @@ void SvxHatchTabPage::ChangeHatchHdl_Impl() { m_pLbLineType->SelectEntryPos( sal::static_int_cast< sal_Int32 >( pHatch->GetHatchStyle() ) ); - // if the entry is not in the listbox - // the color is added temporarily m_pLbLineColor->SetNoSelection(); m_pLbLineColor->SelectEntry( pHatch->GetColor() ); - if( m_pLbLineColor->GetSelectEntryCount() == 0 ) - { - m_pLbLineColor->InsertEntry( pHatch->GetColor(), OUString() ); - m_pLbLineColor->SelectEntry( pHatch->GetColor() ); - } SetMetricValue( *m_pMtrDistance, pHatch->GetDistance(), m_ePoolUnit ); long mHatchAngle = pHatch->GetAngle() / 10; m_pMtrAngle->SetValue( mHatchAngle ); |