summaryrefslogtreecommitdiff
path: root/sc/source/ui/cctrl/dpcontrol.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/cctrl/dpcontrol.cxx')
-rw-r--r--sc/source/ui/cctrl/dpcontrol.cxx31
1 files changed, 5 insertions, 26 deletions
diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx
index 1b18ed64c90a..5b430f87ebb1 100644
--- a/sc/source/ui/cctrl/dpcontrol.cxx
+++ b/sc/source/ui/cctrl/dpcontrol.cxx
@@ -38,8 +38,6 @@
#include "document.hxx"
#include "docpool.hxx"
#include "patattr.hxx"
-#include <editeng/brshitem.hxx>
-#include <editeng/colritem.hxx>
using rtl::OUString;
@@ -47,7 +45,6 @@ ScDPFieldButton::ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pSt
mpDoc(pDoc),
mpOutDev(pOutDev),
mpStyle(pStyle),
- mpPattern(NULL),
mbBaseButton(true),
mbPopupButton(false),
mbHasHiddenMember(false),
@@ -120,15 +117,8 @@ void ScDPFieldButton::draw()
{
// Background
Rectangle aRect(maPos, maSize);
- Color aBackCol = mpStyle->GetFaceColor();
- if ( mpPattern )
- {
- const SvxBrushItem& rBrushItem = (const SvxBrushItem&)mpPattern->GetItemSet().Get( ATTR_BACKGROUND );
- if ( rBrushItem.GetColor() != COL_TRANSPARENT )
- aBackCol = rBrushItem.GetColor();
- }
- mpOutDev->SetFillColor(aBackCol);
- mpOutDev->SetLineColor(aBackCol);
+ mpOutDev->SetLineColor(mpStyle->GetFaceColor());
+ mpOutDev->SetFillColor(mpStyle->GetFaceColor());
mpOutDev->DrawRect(aRect);
// Border lines
@@ -145,27 +135,16 @@ void ScDPFieldButton::draw()
// Field name.
// Get the font and size the same way as in scenario selection (lcl_DrawOneFrame in gridwin4.cxx)
Font aTextFont( mpStyle->GetAppFont() );
- Color aButTextCol = mpStyle->GetButtonTextColor();
if ( mpDoc )
{
+ // use ScPatternAttr::GetFont only for font size
Font aAttrFont;
- if ( mpPattern )
- {
- mpPattern->GetFont( aAttrFont, SC_AUTOCOL_DISPLAY, mpOutDev, &maZoomY );
- const SvxColorItem& rColorItem = (const SvxColorItem&)mpPattern->GetItemSet().Get( ATTR_FONT_COLOR );
- if ( rColorItem.GetValue().GetColor() != COL_TRANSPARENT )
- aButTextCol = rColorItem.GetValue();
- }
- else
- {
- // use ScPatternAttr::GetFont only for font size
- static_cast<const ScPatternAttr&>(mpDoc->GetPool()->GetDefaultItem(ATTR_PATTERN)).
+ static_cast<const ScPatternAttr&>(mpDoc->GetPool()->GetDefaultItem(ATTR_PATTERN)).
GetFont( aAttrFont, SC_AUTOCOL_BLACK, mpOutDev, &maZoomY );
- }
aTextFont.SetSize( aAttrFont.GetSize() );
}
mpOutDev->SetFont(aTextFont);
- mpOutDev->SetTextColor( aButTextCol );
+ mpOutDev->SetTextColor(mpStyle->GetButtonTextColor());
Point aTextPos = maPos;
long nTHeight = mpOutDev->GetTextHeight();