diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-12-12 18:38:29 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2012-12-12 18:43:45 -0500 |
commit | e209615b121f92f3668fc68903aa31e7ce6fdac6 (patch) | |
tree | 3c4189db0a4b62f31ecd71623b74b9e68e91c52c /sc | |
parent | 7eac2e42882fc36816b8b1f79e85abbe21bd40a0 (diff) |
Revert "fix for bnc#791731 preserve cell formatting of datapilot area ("
This reverts commit 307ac3f53d670a28e60471859aed03e4e13519d6.
That change causes nasty side-effect of leaving behind borders and buttons
that should've been removed when pivot table's geometry changes.
Change-Id: I46fa84c128e755516fc699810c53c869188c6452
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/dpobject.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/dpoutput.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/cctrl/dpcontrol.cxx | 31 | ||||
-rw-r--r-- | sc/source/ui/inc/dpcontrol.hxx | 3 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin4.cxx | 2 |
5 files changed, 7 insertions, 33 deletions
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 9b78336d1305..0c835cf687b6 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -780,7 +780,7 @@ void ScDPObject::Output( const ScAddress& rPos ) // clear old output area pDoc->DeleteAreaTab( aOutRange.aStart.Col(), aOutRange.aStart.Row(), aOutRange.aEnd.Col(), aOutRange.aEnd.Row(), - aOutRange.aStart.Tab(), IDF_CONTENTS | IDF_OBJECTS ); + aOutRange.aStart.Tab(), IDF_ALL ); pDoc->RemoveFlagsTab( aOutRange.aStart.Col(), aOutRange.aStart.Row(), aOutRange.aEnd.Col(), aOutRange.aEnd.Row(), aOutRange.aStart.Tab(), SC_MF_AUTO ); diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx index 7c38ee34a8d9..5038d43c65f6 100644 --- a/sc/source/core/data/dpoutput.cxx +++ b/sc/source/core/data/dpoutput.cxx @@ -952,7 +952,7 @@ void ScDPOutput::Output() // clear whole (new) output area //! when modifying table, clear old area //! include IDF_OBJECTS ??? - pDoc->DeleteAreaTab( aStartPos.Col(), aStartPos.Row(), nTabEndCol, nTabEndRow, nTab, IDF_CONTENTS | IDF_OBJECTS); + pDoc->DeleteAreaTab( aStartPos.Col(), aStartPos.Row(), nTabEndCol, nTabEndRow, nTab, IDF_ALL ); if ( bDoFilter ) lcl_DoFilterButton( pDoc, aStartPos.Col(), aStartPos.Row(), nTab ); diff --git a/sc/source/ui/cctrl/dpcontrol.cxx b/sc/source/ui/cctrl/dpcontrol.cxx index e57a7a56f80c..c866dedf3ce1 100644 --- a/sc/source/ui/cctrl/dpcontrol.cxx +++ b/sc/source/ui/cctrl/dpcontrol.cxx @@ -26,8 +26,6 @@ #include "document.hxx" #include "docpool.hxx" #include "patattr.hxx" -#include <editeng/brshitem.hxx> -#include <editeng/colritem.hxx> using rtl::OUString; @@ -35,7 +33,6 @@ ScDPFieldButton::ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pSt mpDoc(pDoc), mpOutDev(pOutDev), mpStyle(pStyle), - mpPattern(NULL), mbBaseButton(true), mbPopupButton(false), mbHasHiddenMember(false), @@ -108,15 +105,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 @@ -133,27 +123,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(); diff --git a/sc/source/ui/inc/dpcontrol.hxx b/sc/source/ui/inc/dpcontrol.hxx index 311d2cf889dc..e571adb31e06 100644 --- a/sc/source/ui/inc/dpcontrol.hxx +++ b/sc/source/ui/inc/dpcontrol.hxx @@ -32,7 +32,6 @@ class Point; class Size; class StyleSettings; class ScDocument; -class ScPatternAttr; /** * This class takes care of physically drawing field button controls inside @@ -52,7 +51,6 @@ public: void setHasHiddenMember(bool b); void setPopupPressed(bool b); void setPopupLeft(bool b); - void setFieldPattern(const ScPatternAttr* pPattern){ mpPattern = pPattern; } void draw(); void getPopupBoundingBox(Point& rPos, Size& rSize) const; @@ -69,7 +67,6 @@ private: ScDocument* mpDoc; OutputDevice* mpOutDev; const StyleSettings* mpStyle; - const ScPatternAttr* mpPattern; bool mbBaseButton; bool mbPopupButton; bool mbHasHiddenMember; diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 745e444dd962..aedcf22225f5 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -1236,8 +1236,6 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCROW /*nY1*/, SCCOL nX2, SCROW /*nY2 aCellBtn.setDrawBaseButton(true); aCellBtn.setDrawPopupButton(pInfo->bPopupButton); aCellBtn.setHasHiddenMember(pInfo->bFilterActive); - - aCellBtn.setFieldPattern( pDoc->GetPattern( nCol, nRow, nTab ) ); aCellBtn.draw(); } } |