[Libreoffice-commits] .: sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Dec 12 15:43:18 PST 2012


 sc/source/core/data/dpobject.cxx |    2 +-
 sc/source/core/data/dpoutput.cxx |    2 +-
 sc/source/ui/cctrl/dpcontrol.cxx |   31 +++++--------------------------
 sc/source/ui/inc/dpcontrol.hxx   |    3 ---
 sc/source/ui/view/gridwin4.cxx   |    2 --
 5 files changed, 7 insertions(+), 33 deletions(-)

New commits:
commit e209615b121f92f3668fc68903aa31e7ce6fdac6
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Wed Dec 12 18:38:29 2012 -0500

    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

diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 9b78336..0c835cf 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 7c38ee3..5038d43 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 e57a7a5..c866ded 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 311d2cf..e571adb 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 745e444..aedcf22 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();
                 }
             }


More information about the Libreoffice-commits mailing list