diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-04-21 15:13:36 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-04-21 15:13:36 +0100 |
commit | b28ba9dbd00da1094fcd53f6370c04b7caa99d7d (patch) | |
tree | 190e4dee5bf68f9396f1d9da5bdc642895d0eb3c /svx | |
parent | e29e3f47e687689c824d71718ae2ccaa4846ac51 (diff) |
draw all entries the same way
Change-Id: I9da3c8dca4db4a02197a67e1fbedd9b525dc7768
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 36 |
1 files changed, 13 insertions, 23 deletions
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 031aabc237d4..8817b224b1fd 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -582,15 +582,17 @@ void SvxStyleBox_Impl::UserDrawEntry(const UserDrawEvent& rUDEvt, const OUString void SvxStyleBox_Impl::UserDraw( const UserDrawEvent& rUDEvt ) { sal_uInt16 nItem = rUDEvt.GetItemId(); + OUString aStyleName( GetEntry( nItem ) ); - if ( nItem == 0 || nItem == GetEntryCount() - 1 ) + OutputDevice *pDevice = rUDEvt.GetDevice(); + pDevice->Push(PushFlags::FILLCOLOR | PushFlags::FONT | PushFlags::TEXTCOLOR); + + if (nItem == 0 || nItem == GetEntryCount() - 1) { Rectangle aRect(rUDEvt.GetRect()); unsigned int nId = (aRect.getY() / aRect.GetSize().Height()); if(nId < MAX_STYLES_ENTRIES && m_pButtons[nId]) m_pButtons[nId]->Hide(); - // draw the non-style entries, ie. "Clear Formatting" or "More..." - DrawEntry( rUDEvt, true, true ); } else { @@ -598,8 +600,6 @@ void SvxStyleBox_Impl::UserDraw( const UserDrawEvent& rUDEvt ) SfxStyleSheetBasePool* pPool = pShell->GetStyleSheetPool(); SfxStyleSheetBase* pStyle = NULL; - OUString aStyleName( GetEntry( nItem ) ); - if ( pPool ) { pPool->SetSearchMask( eStyleFamily, SFXSTYLEBIT_ALL ); @@ -609,12 +609,7 @@ void SvxStyleBox_Impl::UserDraw( const UserDrawEvent& rUDEvt ) pStyle = pPool->Next(); } - if ( !pStyle ) - { - // cannot find the style for whatever reason - DrawEntry( rUDEvt, true, true ); - } - else + if (pStyle ) { const SfxItemSet& aItemSet = pStyle->GetItemSet(); @@ -623,8 +618,6 @@ void SvxStyleBox_Impl::UserDraw( const UserDrawEvent& rUDEvt ) if ( pFontItem && pFontHeightItem ) { - OutputDevice *pDevice = rUDEvt.GetDevice(); - Size aFontSize( 0, pFontHeightItem->GetHeight() ); Size aPixelSize( pDevice->LogicToPixel( aFontSize, pShell->GetMapUnit() ) ); @@ -676,7 +669,6 @@ void SvxStyleBox_Impl::UserDraw( const UserDrawEvent& rUDEvt ) // setup the device & draw vcl::Font aOldFont( pDevice->GetFont() ); - pDevice->Push(PushFlags::FILLCOLOR | PushFlags::FONT | PushFlags::TEXTCOLOR); Color aFontCol = COL_AUTO, aBackCol = COL_AUTO; @@ -748,18 +740,16 @@ void SvxStyleBox_Impl::UserDraw( const UserDrawEvent& rUDEvt ) m_pButtons[nId]->Show(); } } - - UserDrawEntry(rUDEvt, aStyleName); - - pDevice->Pop(); - - // draw separator, if present - DrawEntry( rUDEvt, false, false ); } - else - DrawEntry( rUDEvt, true, true ); } } + + UserDrawEntry(rUDEvt, aStyleName); + + pDevice->Pop(); + // draw separator, if present + DrawEntry( rUDEvt, false, false ); + } // test is the color between Font- and background-color to be identify |