Kaydet (Commit) e209615b authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Revert "fix for bnc#791731 preserve cell formatting of datapilot area ("

This reverts commit 307ac3f5.

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
üst 7eac2e42
...@@ -780,7 +780,7 @@ void ScDPObject::Output( const ScAddress& rPos ) ...@@ -780,7 +780,7 @@ void ScDPObject::Output( const ScAddress& rPos )
// clear old output area // clear old output area
pDoc->DeleteAreaTab( aOutRange.aStart.Col(), aOutRange.aStart.Row(), pDoc->DeleteAreaTab( aOutRange.aStart.Col(), aOutRange.aStart.Row(),
aOutRange.aEnd.Col(), aOutRange.aEnd.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(), pDoc->RemoveFlagsTab( aOutRange.aStart.Col(), aOutRange.aStart.Row(),
aOutRange.aEnd.Col(), aOutRange.aEnd.Row(), aOutRange.aEnd.Col(), aOutRange.aEnd.Row(),
aOutRange.aStart.Tab(), SC_MF_AUTO ); aOutRange.aStart.Tab(), SC_MF_AUTO );
......
...@@ -952,7 +952,7 @@ void ScDPOutput::Output() ...@@ -952,7 +952,7 @@ void ScDPOutput::Output()
// clear whole (new) output area // clear whole (new) output area
//! when modifying table, clear old area //! when modifying table, clear old area
//! include IDF_OBJECTS ??? //! 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 ) if ( bDoFilter )
lcl_DoFilterButton( pDoc, aStartPos.Col(), aStartPos.Row(), nTab ); lcl_DoFilterButton( pDoc, aStartPos.Col(), aStartPos.Row(), nTab );
......
...@@ -26,8 +26,6 @@ ...@@ -26,8 +26,6 @@
#include "document.hxx" #include "document.hxx"
#include "docpool.hxx" #include "docpool.hxx"
#include "patattr.hxx" #include "patattr.hxx"
#include <editeng/brshitem.hxx>
#include <editeng/colritem.hxx>
using rtl::OUString; using rtl::OUString;
...@@ -35,7 +33,6 @@ ScDPFieldButton::ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pSt ...@@ -35,7 +33,6 @@ ScDPFieldButton::ScDPFieldButton(OutputDevice* pOutDev, const StyleSettings* pSt
mpDoc(pDoc), mpDoc(pDoc),
mpOutDev(pOutDev), mpOutDev(pOutDev),
mpStyle(pStyle), mpStyle(pStyle),
mpPattern(NULL),
mbBaseButton(true), mbBaseButton(true),
mbPopupButton(false), mbPopupButton(false),
mbHasHiddenMember(false), mbHasHiddenMember(false),
...@@ -108,15 +105,8 @@ void ScDPFieldButton::draw() ...@@ -108,15 +105,8 @@ void ScDPFieldButton::draw()
{ {
// Background // Background
Rectangle aRect(maPos, maSize); Rectangle aRect(maPos, maSize);
Color aBackCol = mpStyle->GetFaceColor(); mpOutDev->SetLineColor(mpStyle->GetFaceColor());
if ( mpPattern ) mpOutDev->SetFillColor(mpStyle->GetFaceColor());
{
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->DrawRect(aRect); mpOutDev->DrawRect(aRect);
// Border lines // Border lines
...@@ -133,27 +123,16 @@ void ScDPFieldButton::draw() ...@@ -133,27 +123,16 @@ void ScDPFieldButton::draw()
// Field name. // Field name.
// Get the font and size the same way as in scenario selection (lcl_DrawOneFrame in gridwin4.cxx) // Get the font and size the same way as in scenario selection (lcl_DrawOneFrame in gridwin4.cxx)
Font aTextFont( mpStyle->GetAppFont() ); Font aTextFont( mpStyle->GetAppFont() );
Color aButTextCol = mpStyle->GetButtonTextColor();
if ( mpDoc ) if ( mpDoc )
{ {
// use ScPatternAttr::GetFont only for font size
Font aAttrFont; Font aAttrFont;
if ( mpPattern ) static_cast<const ScPatternAttr&>(mpDoc->GetPool()->GetDefaultItem(ATTR_PATTERN)).
{
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)).
GetFont( aAttrFont, SC_AUTOCOL_BLACK, mpOutDev, &maZoomY ); GetFont( aAttrFont, SC_AUTOCOL_BLACK, mpOutDev, &maZoomY );
}
aTextFont.SetSize( aAttrFont.GetSize() ); aTextFont.SetSize( aAttrFont.GetSize() );
} }
mpOutDev->SetFont(aTextFont); mpOutDev->SetFont(aTextFont);
mpOutDev->SetTextColor( aButTextCol ); mpOutDev->SetTextColor(mpStyle->GetButtonTextColor());
Point aTextPos = maPos; Point aTextPos = maPos;
long nTHeight = mpOutDev->GetTextHeight(); long nTHeight = mpOutDev->GetTextHeight();
......
...@@ -32,7 +32,6 @@ class Point; ...@@ -32,7 +32,6 @@ class Point;
class Size; class Size;
class StyleSettings; class StyleSettings;
class ScDocument; class ScDocument;
class ScPatternAttr;
/** /**
* This class takes care of physically drawing field button controls inside * This class takes care of physically drawing field button controls inside
...@@ -52,7 +51,6 @@ public: ...@@ -52,7 +51,6 @@ public:
void setHasHiddenMember(bool b); void setHasHiddenMember(bool b);
void setPopupPressed(bool b); void setPopupPressed(bool b);
void setPopupLeft(bool b); void setPopupLeft(bool b);
void setFieldPattern(const ScPatternAttr* pPattern){ mpPattern = pPattern; }
void draw(); void draw();
void getPopupBoundingBox(Point& rPos, Size& rSize) const; void getPopupBoundingBox(Point& rPos, Size& rSize) const;
...@@ -69,7 +67,6 @@ private: ...@@ -69,7 +67,6 @@ private:
ScDocument* mpDoc; ScDocument* mpDoc;
OutputDevice* mpOutDev; OutputDevice* mpOutDev;
const StyleSettings* mpStyle; const StyleSettings* mpStyle;
const ScPatternAttr* mpPattern;
bool mbBaseButton; bool mbBaseButton;
bool mbPopupButton; bool mbPopupButton;
bool mbHasHiddenMember; bool mbHasHiddenMember;
......
...@@ -1236,8 +1236,6 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCROW /*nY1*/, SCCOL nX2, SCROW /*nY2 ...@@ -1236,8 +1236,6 @@ void ScGridWindow::DrawButtons( SCCOL nX1, SCROW /*nY1*/, SCCOL nX2, SCROW /*nY2
aCellBtn.setDrawBaseButton(true); aCellBtn.setDrawBaseButton(true);
aCellBtn.setDrawPopupButton(pInfo->bPopupButton); aCellBtn.setDrawPopupButton(pInfo->bPopupButton);
aCellBtn.setHasHiddenMember(pInfo->bFilterActive); aCellBtn.setHasHiddenMember(pInfo->bFilterActive);
aCellBtn.setFieldPattern( pDoc->GetPattern( nCol, nRow, nTab ) );
aCellBtn.draw(); aCellBtn.draw();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment