[Libreoffice-commits] .: 28 commits - sc/inc sc/qa sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Wed Dec 15 19:35:30 PST 2010


 sc/inc/dpglobal.hxx                                       |    2 
 sc/inc/dpobject.hxx                                       |   10 
 sc/inc/dpshttab.hxx                                       |   11 
 sc/inc/pivot.hxx                                          |   23 
 sc/inc/sc.hrc                                             |    1 
 sc/qa/complex/sc/CalcRTL.java                             |    2 
 sc/source/core/data/dpobject.cxx                          |  324 +--
 sc/source/core/data/dpoutput.cxx                          |   39 
 sc/source/core/data/global2.cxx                           |   96 
 sc/source/ui/Accessibility/AccessibleDataPilotControl.cxx |   10 
 sc/source/ui/dbgui/dpuiglobal.hxx                         |   43 
 sc/source/ui/dbgui/fieldwnd.cxx                           | 1466 +++++++++-----
 sc/source/ui/dbgui/pivot.hrc                              |    3 
 sc/source/ui/dbgui/pivot.src                              |   91 
 sc/source/ui/dbgui/pvglob.hxx                             |   45 
 sc/source/ui/dbgui/pvlaydlg.cxx                           | 1243 +++++------
 sc/source/ui/inc/AccessibleDataPilotControl.hxx           |    6 
 sc/source/ui/inc/fieldwnd.hxx                             |  428 ++--
 sc/source/ui/inc/pvlaydlg.hxx                             |   61 
 sc/source/ui/src/scstring.src                             |    5 
 20 files changed, 2260 insertions(+), 1649 deletions(-)

New commits:
commit d28be24997af545a56180d9a7d0ce3d57009a9ff
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Dec 15 22:26:33 2010 -0500

    Give each field control a proper description.
    
    Incidentally, the page field was missing a description.  Added one.

diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index 1d7d59d..d684d05 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -1316,6 +1316,7 @@
 #define STR_ACC_DATAPILOT_COL_DESCR (STR_START + 179)
 #define STR_ACC_DATAPILOT_DATA_DESCR (STR_START + 180)
 #define STR_ACC_DATAPILOT_SEL_DESCR (STR_START + 181)
+#define STR_ACC_DATAPILOT_PAGE_DESCR (STR_START + 182)
 
 // --------------------------------------------------
 
diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index c0a0998..26f6faf 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -977,6 +977,11 @@ ScDPFieldType ScDPPageFieldControl::GetFieldType() const
     return TYPE_PAGE;
 }
 
+String ScDPPageFieldControl::GetDescription() const
+{
+    return ScResId(STR_ACC_DATAPILOT_PAGE_DESCR);
+}
+
 //=============================================================================
 
 ScDPColFieldControl::ScDPColFieldControl(
@@ -994,6 +999,11 @@ ScDPFieldType ScDPColFieldControl::GetFieldType() const
     return TYPE_COL;
 }
 
+String ScDPColFieldControl::GetDescription() const
+{
+    return ScResId(STR_ACC_DATAPILOT_COL_DESCR);
+}
+
 //=============================================================================
 
 ScDPRowFieldControl::ScDPRowFieldControl(
@@ -1244,6 +1254,11 @@ ScDPFieldType ScDPSelectFieldControl::GetFieldType() const
     return TYPE_SELECT;
 }
 
+String ScDPSelectFieldControl::GetDescription() const
+{
+    return ScResId(STR_ACC_DATAPILOT_SEL_DESCR);
+}
+
 //=============================================================================
 
 ScDPDataFieldControl::ScDPDataFieldControl(
diff --git a/sc/source/ui/inc/fieldwnd.hxx b/sc/source/ui/inc/fieldwnd.hxx
index bf707ad..7835855 100644
--- a/sc/source/ui/inc/fieldwnd.hxx
+++ b/sc/source/ui/inc/fieldwnd.hxx
@@ -302,6 +302,7 @@ public:
     virtual ~ScDPPageFieldControl();
 
     virtual ScDPFieldType GetFieldType() const;
+    virtual String GetDescription() const;
 };
 
 // ============================================================================
@@ -314,6 +315,7 @@ public:
     virtual ~ScDPColFieldControl();
 
     virtual ScDPFieldType GetFieldType() const;
+    virtual String GetDescription() const;
 };
 
 // ============================================================================
@@ -370,6 +372,7 @@ public:
     virtual ~ScDPSelectFieldControl();
 
     virtual ScDPFieldType GetFieldType() const;
+    virtual String GetDescription() const;
 };
 
 // ============================================================================
diff --git a/sc/source/ui/src/scstring.src b/sc/source/ui/src/scstring.src
index c39a183..92ced8a 100644
--- a/sc/source/ui/src/scstring.src
+++ b/sc/source/ui/src/scstring.src
@@ -796,6 +796,11 @@ String STR_ACC_DATAPILOT_SEL_DESCR
     Text [ en-US ] = "Lists the fields that you can drag to one of the other three areas.";
 };
 
+String STR_ACC_DATAPILOT_PAGE_DESCR
+{
+    Text [ en-US ] = "Fields that you drop here will be available as filter lists at the top of the final DataPilot table.";
+};
+
 String SCSTR_MEDIASHELL
 {
     Text [ en-US ] = "Media Playback";
commit f9d6a0014cd41a915f31841c7251177ee8b21e31
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Dec 15 22:11:42 2010 -0500

    Wrapper class for the normal scroll bar class.
    
    We need to only to pass the mouse wheel events to its parent control
    in order to have them handled properly while the mouse cursor is
    over the scroll bar control.  For some reason the normal scroll bar
    does not handle mouse wheel events natively.

diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index a96af6d..c0a0998 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -51,6 +51,17 @@ using ::com::sun::star::accessibility::XAccessible;
 
 const size_t INVALID_INDEX = static_cast<size_t>(-1);
 
+ScDPFieldControlBase::ScrollBar::ScrollBar(Window* pParent, WinBits nStyle) :
+    ::ScrollBar(pParent, nStyle),
+    mpParent(pParent)
+{
+}
+
+void ScDPFieldControlBase::ScrollBar::Command( const CommandEvent& rCEvt )
+{
+    mpParent->Command(rCEvt);
+}
+
 ScDPFieldControlBase::ScDPFieldControlBase( ScDPLayoutDlg* pParent, const ResId& rResId, FixedText* pCaption ) :
     Control(pParent, rResId),
     mpDlg(pParent),
diff --git a/sc/source/ui/inc/fieldwnd.hxx b/sc/source/ui/inc/fieldwnd.hxx
index a8128fc..bf707ad 100644
--- a/sc/source/ui/inc/fieldwnd.hxx
+++ b/sc/source/ui/inc/fieldwnd.hxx
@@ -65,6 +65,22 @@ protected:
     typedef ::std::vector<FieldName> FieldNames;
 
 public:
+
+    /**
+     * Custom scroll bar to pass the command event to its parent window.
+     * We need this to pass the mouse wheel events to its parent field
+     * control to have mouse wheel events appaer to be properly handled by the
+     * scroll bar.
+     */
+    class ScrollBar : public ::ScrollBar
+    {
+    public:
+        ScrollBar(Window* pParent, WinBits nStyle);
+        virtual void Command( const CommandEvent& rCEvt );
+    private:
+        Window* mpParent;
+    };
+
     ScDPFieldControlBase(
         ScDPLayoutDlg* pParent, const ResId& rResId, FixedText* pCaption );
     virtual ~ScDPFieldControlBase();
@@ -340,7 +356,7 @@ private:
 
 private:
 
-    ScrollBar               maScroll;
+    ScDPFieldControlBase::ScrollBar maScroll;
     size_t                  mnColumnBtnCount;
 };
 
commit 42497053fccc1a676a06fdae0f0a4db185d28355
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Dec 15 21:45:06 2010 -0500

    Handle mouse wheel input on the row field control.
    
    Only for vertical scrolling at the moment.

diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index 802b2d8..a96af6d 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -275,6 +275,20 @@ void ScDPFieldControlBase::DataChanged( const DataChangedEvent& rDCEvt )
     Control::DataChanged( rDCEvt );
 }
 
+void ScDPFieldControlBase::Command( const CommandEvent& rCEvt )
+{
+    if (rCEvt.GetCommand() == COMMAND_WHEEL)
+    {
+        const CommandWheelData* pData = rCEvt.GetWheelData();
+        if (pData->GetMode() == COMMAND_WHEEL_SCROLL && !pData->IsHorz())
+        {
+            // Handle vertical mouse wheel scrolls.
+            long nNotch = pData->GetNotchDelta(); // positive => up; negative => down
+            HandleWheelScroll(nNotch);
+        }
+    }
+}
+
 void ScDPFieldControlBase::MouseButtonDown( const MouseEvent& rMEvt )
 {
     if( rMEvt.IsLeft() )
@@ -896,6 +910,11 @@ void ScDPHorFieldControl::ResetScrollBar()
     }
 }
 
+void ScDPHorFieldControl::HandleWheelScroll(long /*nNotch*/)
+{
+    // not handled for horizontal field controls.
+}
+
 bool ScDPHorFieldControl::GetFieldBtnPosSize(size_t nPos, Point& rPos, Size& rSize)
 {
     if (nPos >= mnFieldBtnColCount*mnFieldBtnRowCount)
@@ -1159,6 +1178,11 @@ void ScDPRowFieldControl::ResetScrollBar()
     }
 }
 
+void ScDPRowFieldControl::HandleWheelScroll(long nNotch)
+{
+    maScroll.DoScroll(maScroll.GetThumbPos() - nNotch);
+}
+
 bool ScDPRowFieldControl::GetFieldBtnPosSize(size_t nPos, Point& rPos, Size& rSize)
 {
     if (nPos >= mnColumnBtnCount)
diff --git a/sc/source/ui/inc/fieldwnd.hxx b/sc/source/ui/inc/fieldwnd.hxx
index f681021..a8128fc 100644
--- a/sc/source/ui/inc/fieldwnd.hxx
+++ b/sc/source/ui/inc/fieldwnd.hxx
@@ -88,6 +88,7 @@ public:
     virtual void ScrollToShowSelection() = 0;
     virtual void ScrollToEnd() = 0;
     virtual void ResetScrollBar() = 0;
+    virtual void HandleWheelScroll(long nNotch) = 0;
 
     /** Reads the FixedText's text with mnemonic and hides the FixedText. */
     void            UseMnemonic();
@@ -145,6 +146,7 @@ public:
 
     virtual void            Paint( const Rectangle& rRect );
     virtual void            DataChanged( const DataChangedEvent& rDCEvt );
+    virtual void            Command( const CommandEvent& rCEvt );
     virtual void            MouseButtonDown( const MouseEvent& rMEvt );
     virtual void            MouseButtonUp( const MouseEvent& rMEvt );
     virtual void            MouseMove( const MouseEvent& rMEvt );
@@ -257,6 +259,7 @@ public:
     virtual void ScrollToEnd();
     virtual void ScrollToShowSelection();
     virtual void ResetScrollBar();
+    virtual void HandleWheelScroll(long nNotch);
 
 private:
     bool GetFieldBtnPosSize(size_t nPos, Point& rPos, Size& rSize);
@@ -321,6 +324,7 @@ public:
     virtual void ScrollToEnd();
     virtual void ScrollToShowSelection();
     virtual void ResetScrollBar();
+    virtual void HandleWheelScroll(long nNotch);
 
 protected:
     virtual size_t          CalcNewFieldIndex( SCsCOL nDX, SCsROW nDY ) const;
commit 3ceb39b15fa268fbad260c2254ea07690529479a
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Dec 15 20:39:46 2010 -0500

    Fixed the mouse cursor pos to field index conversion method.
    
    For row field control.

diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index 7c5950d..802b2d8 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -1004,7 +1004,23 @@ bool ScDPRowFieldControl::GetFieldIndex( const Point& rPos, size_t& rnIndex )
     if (rPos.X() < 0 || rPos.Y() < 0)
         return false;
 
-    rnIndex = rPos.Y() / GetFieldSize().Height() + maScroll.GetThumbPos();
+    long nFldH = GetFieldSize().Height();
+    long nThreshold = OUTER_MARGIN_VER + nFldH + ROW_FIELD_BTN_GAP / 2;
+
+    size_t nIndex = 0;
+    for (; nIndex < mnColumnBtnCount; ++nIndex)
+    {
+        if (rPos.Y() < nThreshold)
+            break;
+
+        nThreshold += nFldH + ROW_FIELD_BTN_GAP;
+    }
+
+    if (nIndex >= mnColumnBtnCount)
+        nIndex = mnColumnBtnCount - 1;
+
+    nIndex += maScroll.GetThumbPos();
+    rnIndex = nIndex;
     return IsValidIndex(rnIndex);
 }
 
@@ -1074,6 +1090,8 @@ void ScDPRowFieldControl::CalcSize()
 
 bool ScDPRowFieldControl::IsValidIndex(size_t /*nIndex*/) const
 {
+    // This method is here in case we decide to impose an arbitrary upper
+    // boundary on the number of fields.
     return true;
 }
 
commit 295990097592f9ffe25e4c0c6d85e341f10a6fa2
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Dec 15 19:44:21 2010 -0500

    Removed all my debug statements.

diff --git a/sc/source/core/data/dpoutput.cxx b/sc/source/core/data/dpoutput.cxx
index e846203..a486c9c 100644
--- a/sc/source/core/data/dpoutput.cxx
+++ b/sc/source/core/data/dpoutput.cxx
@@ -77,48 +77,6 @@ using ::com::sun::star::uno::makeAny;
 using ::com::sun::star::uno::Any;
 using ::rtl::OUString;
 
-#include <stdio.h>
-#include <string>
-#include <sys/time.h>
-
-namespace {
-
-class StackPrinter
-{
-public:
-    explicit StackPrinter(const char* msg) :
-        msMsg(msg)
-    {
-        fprintf(stdout, "%s: --begin\n", msMsg.c_str());
-        mfStartTime = getTime();
-    }
-
-    ~StackPrinter()
-    {
-        double fEndTime = getTime();
-        fprintf(stdout, "%s: --end (duration: %g sec)\n", msMsg.c_str(), (fEndTime-mfStartTime));
-    }
-
-    void printTime(int line) const
-    {
-        double fEndTime = getTime();
-        fprintf(stdout, "%s: --(%d) (duration: %g sec)\n", msMsg.c_str(), line, (fEndTime-mfStartTime));
-    }
-
-private:
-    double getTime() const
-    {
-        timeval tv;
-        gettimeofday(&tv, NULL);
-        return tv.tv_sec + tv.tv_usec / 1000000.0;
-    }
-
-    ::std::string msMsg;
-    double mfStartTime;
-};
-
-}
-
 // -----------------------------------------------------------------------
 
 //!	move to a header file
@@ -413,7 +371,6 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference<sheet::XDimensionsS
     bSizeOverflow( FALSE ),
     mbHeaderLayout( false )
 {
-    StackPrinter __stack_printer__("ScDPOutput::ScDPOutput");
     nTabStartCol = nMemberStartCol = nDataStartCol = nTabEndCol = 0;
     nTabStartRow = nMemberStartRow = nDataStartRow = nTabEndRow = 0;
 
@@ -434,7 +391,6 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference<sheet::XDimensionsS
         long nDimCount = xDims->getCount();
         for (long nDim=0; nDim<nDimCount; nDim++)
         {
-            fprintf(stdout, "ScDPOutput::ScDPOutput:   dimension = %ld\n", nDim);
             uno::Reference<uno::XInterface> xDim =
                     ScUnoHelpFunctions::AnyToInterface( xDims->getByIndex(nDim) );
             uno::Reference<beans::XPropertySet> xDimProp( xDim, uno::UNO_QUERY );
@@ -455,7 +411,6 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference<sheet::XDimensionsS
 
                 if ( eDimOrient != sheet::DataPilotFieldOrientation_HIDDEN )
                 {
-                    fprintf(stdout, "ScDPOutput::ScDPOutput:   not hidden\n");
                     uno::Reference<container::XIndexAccess> xHiers =
                             new ScNameToIndexAccess( xDimSupp->getHierarchies() );
                     long nHierarchy = ScUnoHelpFunctions::GetLongProperty(
@@ -495,7 +450,6 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference<sheet::XDimensionsS
                                 switch ( eDimOrient )
                                 {
                                     case sheet::DataPilotFieldOrientation_COLUMN:
-                                        fprintf(stdout, "ScDPOutput::ScDPOutput:   column\n");
                                         pColFields[nColFieldCount].nDim    = nDim;
                                         pColFields[nColFieldCount].nHier   = nHierarchy;
                                         pColFields[nColFieldCount].nLevel  = nLev;
@@ -508,7 +462,6 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference<sheet::XDimensionsS
                                             ++nColFieldCount;
                                         break;
                                     case sheet::DataPilotFieldOrientation_ROW:
-                                        fprintf(stdout, "ScDPOutput::ScDPOutput:   row\n");
                                         pRowFields[nRowFieldCount].nDim    = nDim;
                                         pRowFields[nRowFieldCount].nHier   = nHierarchy;
                                         pRowFields[nRowFieldCount].nLevel  = nLev;
@@ -524,7 +477,6 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference<sheet::XDimensionsS
                                         }
                                         break;
                                     case sheet::DataPilotFieldOrientation_PAGE:
-                                        fprintf(stdout, "ScDPOutput::ScDPOutput:   page\n");
                                         pPageFields[nPageFieldCount].nDim    = nDim;
                                         pPageFields[nPageFieldCount].nHier   = nHierarchy;
                                         pPageFields[nPageFieldCount].nLevel  = nLev;
@@ -538,7 +490,6 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference<sheet::XDimensionsS
                                         break;
                                     default:
                                     {
-                                        fprintf(stdout, "ScDPOutput::ScDPOutput:   none of the above\n");
                                         // added to avoid warnings
                                     }
                                 }
@@ -546,7 +497,6 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference<sheet::XDimensionsS
                                 // get number formats from data dimensions
                                 if ( bIsDataLayout )
                                 {
-                                    fprintf(stdout, "ScDPOutput::ScDPOutput:   data layout\n");
                                     if (bRowFieldHasMember)
                                         mbHasDataLayout = true;
 
@@ -562,14 +512,11 @@ ScDPOutput::ScDPOutput( ScDocument* pD, const uno::Reference<sheet::XDimensionsS
                 }
                 else if ( bIsDataLayout )
                 {
-                    fprintf(stdout, "ScDPOutput::ScDPOutput:   hidden data layout\n");
                     // data layout dimension is hidden (allowed if there is only one data dimension)
                     // -> use the number format from the first data dimension for all results
 
                     nSingleNumFmt = lcl_GetFirstNumberFormat( xDims );
                 }
-                else
-                    fprintf(stdout, "ScDPOutput::ScDPOutput:   just hidden ?\n");
             }
         }
         lcl_SortFields( pColFields, nColFieldCount );
@@ -767,11 +714,6 @@ void ScDPOutput::CalcSizes()
             // Insert an extra header row only when there is no column field.
             nHeaderSize = 2;
 
-        fprintf(stdout, "ScDPOutput::CalcSizes:   header size = %d\n", nHeaderSize);
-
-        fprintf(stdout, "ScDPOutput::CalcSizes:   col fields = %d  row fields = %d\n",
-                nColFieldCount, nRowFieldCount);
-
         //	calculate output positions and sizes
 
         long nPageSize = 0;		//! use page fields!
@@ -806,9 +748,6 @@ void ScDPOutput::CalcSizes()
         else
             nTabEndRow = nDataStartRow;		// single row will remain empty
         bSizesValid = TRUE;
-
-        fprintf(stdout, "ScDPOutput::CalcSizes:   table size (col=%ld,row=%ld) - (col=%ld,row=%ld)\n",
-                nTabStartCol,nTabStartRow,nTabEndCol,nTabEndRow);
     }
 }
 
diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index e0bdf66..7c5950d 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -49,48 +49,6 @@ using ::com::sun::star::uno::Reference;
 using ::com::sun::star::uno::WeakReference;
 using ::com::sun::star::accessibility::XAccessible;
 
-#include <stdio.h>
-#include <string>
-#include <sys/time.h>
-
-namespace {
-
-class StackPrinter
-{
-public:
-    explicit StackPrinter(const char* msg) :
-        msMsg(msg)
-    {
-        fprintf(stdout, "%s: --begin\n", msMsg.c_str());
-        mfStartTime = getTime();
-    }
-
-    ~StackPrinter()
-    {
-        double fEndTime = getTime();
-        fprintf(stdout, "%s: --end (duration: %g sec)\n", msMsg.c_str(), (fEndTime-mfStartTime));
-    }
-
-    void printTime(int line) const
-    {
-        double fEndTime = getTime();
-        fprintf(stdout, "%s: --(%d) (duration: %g sec)\n", msMsg.c_str(), line, (fEndTime-mfStartTime));
-    }
-
-private:
-    double getTime() const
-    {
-        timeval tv;
-        gettimeofday(&tv, NULL);
-        return tv.tv_sec + tv.tv_usec / 1000000.0;
-    }
-
-    ::std::string msMsg;
-    double mfStartTime;
-};
-
-}
-
 const size_t INVALID_INDEX = static_cast<size_t>(-1);
 
 ScDPFieldControlBase::ScDPFieldControlBase( ScDPLayoutDlg* pParent, const ResId& rResId, FixedText* pCaption ) :
diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx
index c207744..b9b273f 100644
--- a/sc/source/ui/dbgui/pvlaydlg.cxx
+++ b/sc/source/ui/dbgui/pvlaydlg.cxx
@@ -58,48 +58,6 @@
 #include "sc.hrc"
 #include "scabstdlg.hxx"
 
-#include <stdio.h>
-#include <string>
-#include <sys/time.h>
-
-namespace {
-
-class StackPrinter
-{
-public:
-    explicit StackPrinter(const char* msg) :
-        msMsg(msg)
-    {
-        fprintf(stdout, "%s: --begin\n", msMsg.c_str());
-        mfStartTime = getTime();
-    }
-
-    ~StackPrinter()
-    {
-        double fEndTime = getTime();
-        fprintf(stdout, "%s: --end (duration: %g sec)\n", msMsg.c_str(), (fEndTime-mfStartTime));
-    }
-
-    void printTime(int line) const
-    {
-        double fEndTime = getTime();
-        fprintf(stdout, "%s: --(%d) (duration: %g sec)\n", msMsg.c_str(), line, (fEndTime-mfStartTime));
-    }
-
-private:
-    double getTime() const
-    {
-        timeval tv;
-        gettimeofday(&tv, NULL);
-        return tv.tv_sec + tv.tv_usec / 1000000.0;
-    }
-
-    ::std::string msMsg;
-    double mfStartTime;
-};
-
-}
-
 using namespace com::sun::star;
 using ::rtl::OUString;
 using ::std::vector;
@@ -473,7 +431,6 @@ void ScDPLayoutDlg::InitFields()
 
 void ScDPLayoutDlg::AddField( size_t nFromIndex, ScDPFieldType eToType, const Point& rAtPos )
 {
-    fprintf(stdout, "ScDPLayoutDlg::AddField:   from index = %d  pos = (%ld, %ld)\n", nFromIndex, rAtPos.X(), rAtPos.Y());
     ScDPFuncData        fData( *(aSelectArr[nFromIndex]) );
     size_t nAt = 0;
     ScDPFieldControlBase* toWnd = GetFieldWindow(eToType);
@@ -548,8 +505,6 @@ void ScDPLayoutDlg::AddField( size_t nFromIndex, ScDPFieldType eToType, const Po
 
 void ScDPLayoutDlg::AppendField(size_t nFromIndex, ScDPFieldType eToType)
 {
-    StackPrinter __stack_printer__("ScDPLayoutDlg::AppendField");
-    fprintf(stdout, "ScDPLayoutDlg::AppendField:   from index = %d  to type = %d\n", nFromIndex, eToType);
     ScDPFuncData aFuncData = *aSelectArr[nFromIndex];
 
     size_t nAt = 0;
@@ -621,8 +576,6 @@ void ScDPLayoutDlg::AppendField(size_t nFromIndex, ScDPFieldType eToType)
 
 void ScDPLayoutDlg::MoveField( ScDPFieldType eFromType, size_t nFromIndex, ScDPFieldType eToType, const Point& rAtPos )
 {
-    StackPrinter __stack_printer__("ScDPLayoutDlg::MoveField");
-    fprintf(stdout, "ScDPLayoutDlg::MoveField:   from type = %d  from index = %d  to type = %d\n", eFromType, nFromIndex, eToType);
     if ( eFromType == TYPE_SELECT )
         AddField( nFromIndex, eToType, rAtPos );
     else if ( eFromType != eToType )
@@ -767,10 +720,6 @@ void ScDPLayoutDlg::MoveField( ScDPFieldType eFromType, size_t nFromIndex, ScDPF
 
 void ScDPLayoutDlg::MoveFieldToEnd( ScDPFieldType eFromType, size_t nFromIndex, ScDPFieldType eToType )
 {
-    StackPrinter __stack_printer__("ScDPLayoutDlg::MoveFieldToEnd");
-    fprintf(stdout, "ScDPLayoutDlg::MoveFieldToEnd:   from type = %d  from index = %d  to type = %d\n",
-            eFromType, nFromIndex, eToType);
-
     if ( eFromType == TYPE_SELECT )
         AppendField( nFromIndex, eToType );
     else if ( eFromType != eToType )
@@ -907,8 +856,6 @@ void ScDPLayoutDlg::MoveFieldToEnd( ScDPFieldType eFromType, size_t nFromIndex,
 
 void ScDPLayoutDlg::RemoveField( ScDPFieldType eFromType, size_t nIndex )
 {
-    StackPrinter __stack_printer__("ScDPLayoutDlg::RemoveField");
-    fprintf(stdout, "ScDPLayoutDlg::RemoveField:   from type = %d  index = %d\n", eFromType, nIndex);
     ScDPFuncDataVec* pArr = GetFieldDataArray(eFromType);
 
     if( pArr )
@@ -927,7 +874,6 @@ void ScDPLayoutDlg::RemoveField( ScDPFieldType eFromType, size_t nIndex )
 
 void ScDPLayoutDlg::NotifyMouseButtonUp( const Point& rAt )
 {
-    StackPrinter __stack_printer__("ScDPLayoutDlg::NotifyMouseButtonUp");
     if ( bIsDrag )
     {
         bIsDrag = FALSE;
@@ -1431,7 +1377,6 @@ bool ScDPLayoutDlg::GetPivotArrays(
 
 void ScDPLayoutDlg::UpdateSrcRange()
 {
-    StackPrinter __stack_printer__("ScDPLayoutDlg::UpdateSrcRange");
     String  theCurPosStr = aEdInPos.GetText();
     USHORT  nResult = ScRange().Parse(theCurPosStr, pDoc, pDoc->GetAddressConvention());
 
commit c7e7a4f56c6fb09829264ab2819e2f2c10693465
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Dec 15 17:46:36 2010 -0500

    Added some class descriptions.

diff --git a/sc/source/ui/inc/fieldwnd.hxx b/sc/source/ui/inc/fieldwnd.hxx
index 22defb6..f681021 100644
--- a/sc/source/ui/inc/fieldwnd.hxx
+++ b/sc/source/ui/inc/fieldwnd.hxx
@@ -230,6 +230,10 @@ private:
 
 // ============================================================================
 
+/**
+ * Base class for field control with a horizontal scroll bar at the bottom.
+ * Page, column, data and select fields are derived from this class.
+ */
 class ScDPHorFieldControl : public ScDPFieldControlBase
 {
 protected:
@@ -295,6 +299,9 @@ public:
 
 // ============================================================================
 
+/**
+ * Row field control with a vertical scroll bar.
+ */
 class ScDPRowFieldControl : public ScDPFieldControlBase
 {
 public:
commit 926dfc3a1a09b53aa53711ac4f3bf176d67ab8be
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Dec 15 17:18:17 2010 -0500

    Show the scroll bars only when necessary, otherwise hide them.

diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index 2d0b812..e0bdf66 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -721,7 +721,7 @@ ScDPHorFieldControl::ScDPHorFieldControl(
 {
     maScroll.SetScrollHdl( LINK(this, ScDPHorFieldControl, ScrollHdl) );
     maScroll.SetEndScrollHdl( LINK(this, ScDPHorFieldControl, EndScrollHdl) );
-    maScroll.Show();
+    maScroll.Hide();
 
     AppendPaintable(&maScroll);
 }
@@ -931,7 +931,11 @@ void ScDPHorFieldControl::ResetScrollBar()
         static_cast<double>(GetFieldCount()) / static_cast<double>(mnFieldBtnRowCount));
 
     if (nOldMax != nNewMax)
+    {
         maScroll.SetRangeMax(nNewMax);
+        bool bShow = mnFieldBtnColCount*mnFieldBtnRowCount < GetFieldCount();
+        maScroll.Show(bShow);
+    }
 }
 
 bool ScDPHorFieldControl::GetFieldBtnPosSize(size_t nPos, Point& rPos, Size& rSize)
@@ -1012,7 +1016,7 @@ ScDPRowFieldControl::ScDPRowFieldControl(
 {
     maScroll.SetScrollHdl( LINK(this, ScDPRowFieldControl, ScrollHdl) );
     maScroll.SetEndScrollHdl( LINK(this, ScDPRowFieldControl, EndScrollHdl) );
-    maScroll.Show();
+    maScroll.Show(false);
 
     AppendPaintable(&maScroll);
 }
@@ -1173,7 +1177,10 @@ void ScDPRowFieldControl::ResetScrollBar()
     long nNewMax = std::max<long>(mnColumnBtnCount, GetFieldCount());
 
     if (nOldMax != nNewMax)
+    {
         maScroll.SetRangeMax(nNewMax);
+        maScroll.Show(GetFieldCount() > mnColumnBtnCount);
+    }
 }
 
 bool ScDPRowFieldControl::GetFieldBtnPosSize(size_t nPos, Point& rPos, Size& rSize)
commit 83bfacd324eae18eb9d4a3bba1027affff4c0fbf
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Dec 15 16:56:47 2010 -0500

    Removed the old code for the data field control.

diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index 74bc3ee..2d0b812 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -1228,8 +1228,6 @@ ScDPFieldType ScDPSelectFieldControl::GetFieldType() const
 
 //=============================================================================
 
-#if DATA_FIELD_NEW
-
 ScDPDataFieldControl::ScDPDataFieldControl(
     ScDPLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption) :
     ScDPHorFieldControl(pDialog, rResId, pCaption)
@@ -1258,360 +1256,4 @@ String ScDPDataFieldControl::GetDescription() const
     return ScResId(STR_ACC_DATAPILOT_DATA_DESCR);
 }
 
-#else
-
-ScDPDataFieldControl::ScDPDataFieldControl( ScDPLayoutDlg* pParent, const ResId& rResId, FixedText* pCaption ) :
-    ScDPFieldControlBase(pParent, rResId, pCaption),
-    maScroll(this, WB_HORZ | WB_DRAG),
-    mpParent(pParent),
-    mnScrollMarginHeight(0),
-    mnColumnBtnCount(0),
-    mnTotalBtnCount(0)
-{
-    maScroll.SetLineSize(1);
-    maScroll.SetVisibleSize(2);
-    maScroll.SetPageSize(2);
-    maScroll.SetRange(Range(0, 2));
-    maScroll.DoScroll(0);
-    maScroll.SetScrollHdl( LINK(this, ScDPDataFieldControl, ScrollHdl) );
-    maScroll.SetEndScrollHdl( LINK(this, ScDPDataFieldControl, EndScrollHdl) );
-    maScroll.Show();
-
-    AppendPaintable(&maScroll);
-}
-
-ScDPDataFieldControl::~ScDPDataFieldControl()
-{
-}
-
-void ScDPDataFieldControl::CalcSize()
-{
-    long nScrollSize = GetSettings().GetStyleSettings().GetScrollBarSize();
-    Size aWndSize = GetSizePixel();
-    mnScrollMarginHeight = nScrollSize + OUTER_MARGIN_VER;
-
-    maScroll.SetSizePixel(Size(aWndSize.Width() - OUTER_MARGIN_HOR*2, nScrollSize));
-    maScroll.SetPosPixel(Point(OUTER_MARGIN_HOR, aWndSize.Height() - mnScrollMarginHeight));
-
-    long nH = GetFieldSize().Height() + DATA_FIELD_BTN_GAP;
-    long nTotalH = aWndSize.Height() - mnScrollMarginHeight - OUTER_MARGIN_VER;
-    mnColumnBtnCount = nTotalH / nH;
-    mnTotalBtnCount = mnColumnBtnCount * 2;
-}
-
-bool ScDPDataFieldControl::IsValidIndex(size_t /*nIndex*/) const
-{
-    // We support unlimited number of data fields.  If we ever want to put a
-    // cap on the number of data fields, this is the right place.
-    return true;
-}
-
-Point ScDPDataFieldControl::GetFieldPosition(size_t nIndex)
-{
-    Point aPos;
-    Size aSize;
-    GetFieldBtnPosSize(nIndex, aPos, aSize);
-    return aPos;
-}
-
-bool ScDPDataFieldControl::GetFieldIndex(const Point& rPos, size_t& rnIndex)
-{
-    size_t nCol, nRow;
-    GetFieldBtnColRow(rPos, nCol, nRow);
-    nCol += static_cast<size_t>(maScroll.GetThumbPos());
-    size_t nIndex = nCol * mnColumnBtnCount;
-
-    nIndex += nRow;
-    size_t nFldCount = GetFieldCount();
-    if (nIndex >= nFldCount)
-        nIndex = nFldCount;
-
-    rnIndex = nIndex;
-    return true;
-}
-
-Size ScDPDataFieldControl::GetFieldSize() const
-{
-    Size aWndSize = GetSizePixel();
-    long nFieldObjWidth = aWndSize.Width() / 2.0 - OUTER_MARGIN_HOR - DATA_FIELD_BTN_GAP/2;
-    Size aFieldSize(nFieldObjWidth, FIELD_BTN_HEIGHT);
-    return aFieldSize;
-}
-
-String ScDPDataFieldControl::GetDescription() const
-{
-    return ScResId(STR_ACC_DATAPILOT_DATA_DESCR);
-}
-
-ScDPFieldType ScDPDataFieldControl::GetFieldType() const
-{
-    return TYPE_DATA;
-}
-
-void ScDPDataFieldControl::ScrollToEnd()
-{
-    maScroll.DoScroll(maScroll.GetRangeMax());
-}
-
-void ScDPDataFieldControl::ScrollToShowSelection()
-{
-    long nNewOffset = CalcOffsetToShowSelection();
-    if (nNewOffset != maScroll.GetThumbPos())
-        maScroll.DoScroll(nNewOffset);
-}
-
-void ScDPDataFieldControl::ResetScrollBar()
-{
-    long nOldMax = maScroll.GetRangeMax();
-    long nNewMax = ceil(
-        static_cast<double>(GetFieldCount()) / static_cast<double>(mnColumnBtnCount));
-
-    if (nOldMax != nNewMax)
-    {
-        maScroll.SetRangeMax(nNewMax);
-        if (nNewMax < nOldMax)
-        {
-            // We lost a column.  Scroll to the right frame.
-            long nNewOffset = CalcOffsetToShowSelection();
-            nNewOffset -= 2;
-            if (nNewOffset < 0)
-                nNewOffset = 0;
-            maScroll.DoScroll(nNewOffset);
-        }
-    }
-}
-
-void ScDPDataFieldControl::Paint(const Rectangle& /*rRect*/)
-{
-    Redraw();
-}
-
-void ScDPDataFieldControl::DataChanged( const DataChangedEvent& rDCEvt )
-{
-    ScDPFieldControlBase::DataChanged(rDCEvt);
-}
-
-void ScDPDataFieldControl::MouseButtonDown(const MouseEvent& rMEvt)
-{
-    if (maScroll.IsVisible())
-    {
-        Rectangle aRect(maScroll.GetPosPixel(), maScroll.GetSizePixel());
-        if (aRect.IsInside(rMEvt.GetPosPixel()))
-        {
-            maScroll.MouseButtonDown(rMEvt);
-            return;
-        }
-    }
-    ScDPFieldControlBase::MouseButtonDown(rMEvt);
-}
-
-void ScDPDataFieldControl::MouseButtonUp(const MouseEvent& rMEvt)
-{
-    if (maScroll.IsVisible())
-    {
-        Rectangle aRect(maScroll.GetPosPixel(), maScroll.GetSizePixel());
-        if (aRect.IsInside(rMEvt.GetPosPixel()))
-        {
-            maScroll.MouseButtonUp(rMEvt);
-            return;
-        }
-    }
-    ScDPFieldControlBase::MouseButtonUp(rMEvt);
-}
-
-void ScDPDataFieldControl::MouseMove(const MouseEvent& rMEvt)
-{
-    if (maScroll.IsVisible())
-    {
-        Rectangle aRect(maScroll.GetPosPixel(), maScroll.GetSizePixel());
-        if (aRect.IsInside(rMEvt.GetPosPixel()))
-        {
-            maScroll.MouseMove(rMEvt);
-            return;
-        }
-    }
-    ScDPFieldControlBase::MouseMove(rMEvt);
-}
-
-bool ScDPDataFieldControl::GetFieldBtnPosSize(size_t nPos, Point& rPos, Size& rSize)
-{
-    if (nPos >= mnTotalBtnCount)
-        return false;
-
-    Size aFieldSize = GetFieldSize();
-
-    size_t nCol = nPos / mnColumnBtnCount;
-    size_t nRow = nPos % mnColumnBtnCount;
-
-    long nX = OUTER_MARGIN_HOR + aFieldSize.Width() * nCol;
-    if (nCol > 0)
-        nX += DATA_FIELD_BTN_GAP * nCol;
-
-    long nY = OUTER_MARGIN_VER + aFieldSize.Height() * nRow;
-    if (nRow > 0)
-        nY += DATA_FIELD_BTN_GAP * nRow;
-
-    rPos = Point(nX, nY);
-    rSize = aFieldSize;
-    return true;
-}
-
-void ScDPDataFieldControl::GetFieldBtnColRow(const Point& rPos, size_t& rCol, size_t& rRow)
-{
-    Size aSize = GetSizePixel();
-    long nBtnH = GetFieldSize().Height();
-
-    size_t nCol = (rPos.X() <= aSize.Width()/2.0) ? 0 : 1;
-    size_t nRow = 0;
-
-    long nVBound = OUTER_MARGIN_VER + nBtnH + DATA_FIELD_BTN_GAP;
-    while (true)
-    {
-        if (rPos.Y() <= nVBound)
-            break;
-
-        nVBound += nBtnH + DATA_FIELD_BTN_GAP;
-        if (nVBound > aSize.Height())
-            break;
-
-        ++nRow;
-    }
-
-    rCol = nCol;
-    rRow = nRow;
-}
-
-long ScDPDataFieldControl::CalcOffsetToShowSelection()
-{
-    long nOffset = maScroll.GetThumbPos();
-    size_t nSel = GetSelectedField();
-    size_t nLower = nOffset*mnColumnBtnCount;
-    size_t nUpper = nLower + mnColumnBtnCount * 2 - 1;
-    long nNewOffset = nOffset;
-    if (nSel < nLower)
-    {
-        // scroll to left.  The selected field should be in the left column.
-        nNewOffset = floor(
-            static_cast<double>(nSel) / static_cast<double>(mnColumnBtnCount));
-    }
-    else if (nUpper < nSel)
-    {
-        // scroll to right.  The selected field should be in the right column.
-        nNewOffset = floor(
-            static_cast<double>(nSel) / static_cast<double>(mnColumnBtnCount))-1;
-    }
-    return nNewOffset;
-}
-
-void ScDPDataFieldControl::HandleScroll()
-{
-    Redraw();
-}
-
-void ScDPDataFieldControl::Redraw()
-{
-    VirtualDevice	aVirDev;
-    // #i97623# VirtualDevice is always LTR while other windows derive direction from parent
-    aVirDev.EnableRTL( IsRTLEnabled() );
-    aVirDev.SetMapMode( MAP_PIXEL );
-
-    Point aPos0;
-    Size aWndSize = GetSizePixel();
-    Font aFont = GetFont();
-    aFont.SetTransparent(true);
-    aVirDev.SetFont(aFont);
-    aVirDev.SetOutputSizePixel(aWndSize);
-
-    DrawBackground(aVirDev);
-
-    long nOffset = maScroll.GetThumbPos();
-    FieldNames& rFields = GetFieldNames();
-    {
-        FieldNames::iterator itr = rFields.begin(), itrEnd = rFields.end();
-        if (nOffset)
-            ::std::advance(itr, nOffset*mnColumnBtnCount);
-
-        for (size_t i = 0; itr != itrEnd; ++itr, ++i)
-        {
-            Point aFldPt;
-            Size aFldSize;
-            if (!GetFieldBtnPosSize(i, aFldPt, aFldSize))
-                break;
-
-            size_t nField = i + nOffset*mnColumnBtnCount;
-            bool bFocus = HasFocus() && (nField == GetSelectedField());
-            DrawField(aVirDev, Rectangle(aFldPt, aFldSize), *itr, bFocus);
-        }
-    }
-
-    // Create a bitmap from the virtual device, and place that bitmap onto
-    // this control.
-    DrawBitmap(aPos0, aVirDev.GetBitmap(aPos0, aWndSize));
-
-    DrawPaintables();
-    DrawInvertSelection();
-    UpdateStyle();
-}
-
-size_t ScDPDataFieldControl::CalcNewFieldIndex(SCsCOL nDX, SCsROW nDY) const
-{
-    size_t nField = GetSelectedField();
-    if (nField < mnColumnBtnCount)
-    {
-        // selected button in the first column.
-        if (nDX < 0)
-            // in the left most column.  We can't move any more to the left.
-            return nField;
-        if (nField == 0 && nDY < 0)
-            // at the top left most position.  We can't move up any more.
-            return nField;
-    }
-
-    size_t nFldCount = GetFieldCount();
-    size_t nFirstInLastCol = nFldCount / mnColumnBtnCount * mnColumnBtnCount;
-    if (nFirstInLastCol <= nField)
-    {
-        // selected button in the last column.
-        if (nDX > 0)
-            // can't move to the right any more.
-            return nField;
-        if (nDY > 0 && nField >= nFldCount)
-            // at the last position.  Can't move down any more.
-            return nField;
-    }
-
-    nDY += nDX * mnColumnBtnCount;
-    nField += nDY;
-
-    if (nField >= nFldCount)
-        // Don't exceed the upper bound.
-        nField = nFldCount - 1;
-    return nField;
-}
-
-size_t ScDPDataFieldControl::GetDisplayPosition(size_t nIndex) const
-{
-    long nOffset = maScroll.GetThumbPos();
-    size_t nLower = mnColumnBtnCount * nOffset;
-    size_t nUpper = nLower + mnColumnBtnCount*2 - 1;
-    if (nLower <= nIndex && nIndex <= nUpper)
-        return nIndex - nLower;
-
-    return INVALID_INDEX;
-}
-
-IMPL_LINK(ScDPDataFieldControl, ScrollHdl, ScrollBar*, EMPTYARG)
-{
-    HandleScroll();
-    return 0;
-}
-
-IMPL_LINK(ScDPDataFieldControl, EndScrollHdl, ScrollBar*, EMPTYARG)
-{
-    HandleScroll();
-    return 0;
-}
-
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/fieldwnd.hxx b/sc/source/ui/inc/fieldwnd.hxx
index f501a32..22defb6 100644
--- a/sc/source/ui/inc/fieldwnd.hxx
+++ b/sc/source/ui/inc/fieldwnd.hxx
@@ -347,10 +347,6 @@ public:
 
 // ============================================================================
 
-#define DATA_FIELD_NEW 1
-
-#if DATA_FIELD_NEW
-
 class ScDPDataFieldControl : public ScDPHorFieldControl
 {
 public:
@@ -362,69 +358,6 @@ public:
     virtual String GetDescription() const;
 };
 
-#else
-
-class ScDPDataFieldControl : public ScDPFieldControlBase
-{
-public:
-    ScDPDataFieldControl( ScDPLayoutDlg* pParent, const ResId& rResId, FixedText* pCaption );
-    virtual ~ScDPDataFieldControl();
-
-    virtual void CalcSize();
-    virtual bool IsValidIndex( size_t nIndex ) const;
-    virtual Point GetFieldPosition( size_t nIndex );
-    virtual bool GetFieldIndex(const Point& rPos, size_t& rnIndex);
-    virtual Size GetFieldSize() const;
-    virtual String GetDescription() const;
-    virtual ScDPFieldType GetFieldType() const;
-    virtual void ScrollToEnd();
-    virtual void ScrollToShowSelection();
-    virtual void ResetScrollBar();
-
-public:
-    virtual void Paint( const Rectangle& rRect );
-    virtual void DataChanged( const DataChangedEvent& rDCEvt );
-    virtual void MouseButtonDown( const MouseEvent& rMEvt );
-    virtual void MouseButtonUp( const MouseEvent& rMEvt );
-    virtual void MouseMove( const MouseEvent& rMEvt );
-
-protected:
-    virtual void Redraw();
-    virtual size_t CalcNewFieldIndex( SCsCOL nDX, SCsROW nDY ) const;
-    virtual size_t GetDisplayPosition(size_t nIndex) const;
-
-private:
-    /**
-     * Get the size and position of specified field button.
-     *
-     * @param nPos position index of the field button.  Note that this index
-     *             differs from field name index in that, the top left button
-     *             always has an index of 0 regardless off scroll offset.
-     * @param rPos
-     * @param rSize
-     *
-     * @return false if the position index is out-of-bound, or otherwise
-     *         invalid.
-     */
-    bool GetFieldBtnPosSize(size_t nPos, Point& rPos, Size& rSize);
-    void GetFieldBtnColRow(const Point& rPos, size_t& rCol, size_t& rRow);
-    long CalcOffsetToShowSelection();
-    void HandleScroll();
-
-    DECL_LINK(ScrollHdl, ScrollBar*);
-    DECL_LINK(EndScrollHdl, ScrollBar*);
-
-private:
-    ScrollBar       maScroll;
-    ScDPLayoutDlg*  mpParent;
-
-    long            mnScrollMarginHeight; /// bottom scroll bar margin height.
-    size_t          mnColumnBtnCount; /// number of buttons per single column.
-    size_t          mnTotalBtnCount; /// number of total visible buttons
-};
-
-#endif
-
 #endif // SC_FIELDWND_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 8fffea3bec326e98386b98c294356d4d1cb49936
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Dec 15 16:51:50 2010 -0500

    Added mode lines for the new file.

diff --git a/sc/source/ui/dbgui/dpuiglobal.hxx b/sc/source/ui/dbgui/dpuiglobal.hxx
index 10d95e6..b648750 100644
--- a/sc/source/ui/dbgui/dpuiglobal.hxx
+++ b/sc/source/ui/dbgui/dpuiglobal.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*
  * Version: MPL 1.1 / GPLv3+ / LGPLv3+
  *
@@ -38,3 +39,5 @@
 #define FIELD_AREA_GAP       3   // gap between row/column/data/page areas
 
 #endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit ddfe893ea68dc7bdb02d711c750d4e413e1bb118
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Dec 15 15:59:15 2010 -0500

    Reuse ScDPHorFieldControl to render the data field, to reduce code size.

diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index cd14479..74bc3ee 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -1228,6 +1228,38 @@ ScDPFieldType ScDPSelectFieldControl::GetFieldType() const
 
 //=============================================================================
 
+#if DATA_FIELD_NEW
+
+ScDPDataFieldControl::ScDPDataFieldControl(
+    ScDPLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption) :
+    ScDPHorFieldControl(pDialog, rResId, pCaption)
+{
+}
+
+ScDPDataFieldControl::~ScDPDataFieldControl()
+{
+}
+
+ScDPFieldType ScDPDataFieldControl::GetFieldType() const
+{
+    return TYPE_DATA;
+}
+
+Size ScDPDataFieldControl::GetFieldSize() const
+{
+    Size aWndSize = GetSizePixel();
+    long nFieldObjWidth = aWndSize.Width() / 2.0 - OUTER_MARGIN_HOR - DATA_FIELD_BTN_GAP/2;
+    Size aFieldSize(nFieldObjWidth, FIELD_BTN_HEIGHT);
+    return aFieldSize;
+}
+
+String ScDPDataFieldControl::GetDescription() const
+{
+    return ScResId(STR_ACC_DATAPILOT_DATA_DESCR);
+}
+
+#else
+
 ScDPDataFieldControl::ScDPDataFieldControl( ScDPLayoutDlg* pParent, const ResId& rResId, FixedText* pCaption ) :
     ScDPFieldControlBase(pParent, rResId, pCaption),
     maScroll(this, WB_HORZ | WB_DRAG),
@@ -1580,4 +1612,6 @@ IMPL_LINK(ScDPDataFieldControl, EndScrollHdl, ScrollBar*, EMPTYARG)
     return 0;
 }
 
+#endif
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/fieldwnd.hxx b/sc/source/ui/inc/fieldwnd.hxx
index 21eda91..f501a32 100644
--- a/sc/source/ui/inc/fieldwnd.hxx
+++ b/sc/source/ui/inc/fieldwnd.hxx
@@ -347,6 +347,23 @@ public:
 
 // ============================================================================
 
+#define DATA_FIELD_NEW 1
+
+#if DATA_FIELD_NEW
+
+class ScDPDataFieldControl : public ScDPHorFieldControl
+{
+public:
+    ScDPDataFieldControl( ScDPLayoutDlg* pParent, const ResId& rResId, FixedText* pCaption );
+    virtual ~ScDPDataFieldControl();
+
+    virtual ScDPFieldType GetFieldType() const;
+    virtual Size GetFieldSize() const;
+    virtual String GetDescription() const;
+};
+
+#else
+
 class ScDPDataFieldControl : public ScDPFieldControlBase
 {
 public:
@@ -406,6 +423,8 @@ private:
     size_t          mnTotalBtnCount; /// number of total visible buttons
 };
 
+#endif
+
 #endif // SC_FIELDWND_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 331d477815640c9dd62089725a9bec8af4d0ee40
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Dec 15 15:45:15 2010 -0500

    Call GetFieldSize() to get button size to avoid hard-coded size.

diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index 6f5151f..cd14479 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -758,18 +758,19 @@ bool ScDPHorFieldControl::GetFieldIndex( const Point& rPos, size_t& rnIndex )
     size_t nW = aWndSize.Width();
     size_t nH = aWndSize.Height();
 
-    size_t nCurX = OUTER_MARGIN_HOR + FIELD_BTN_WIDTH + ROW_FIELD_BTN_GAP/2;
-    size_t nCurY = OUTER_MARGIN_VER + FIELD_BTN_HEIGHT + ROW_FIELD_BTN_GAP/2;
+    Size aFldSize = GetFieldSize();
+    size_t nCurX = OUTER_MARGIN_HOR + aFldSize.Width() + ROW_FIELD_BTN_GAP/2;
+    size_t nCurY = OUTER_MARGIN_VER + aFldSize.Height() + ROW_FIELD_BTN_GAP/2;
     size_t nCol = 0;
     size_t nRow = 0;
     while (nX > nCurX && nCurX <= nW)
     {
-        nCurX += FIELD_BTN_WIDTH + ROW_FIELD_BTN_GAP;
+        nCurX += aFldSize.Width() + ROW_FIELD_BTN_GAP;
         ++nCol;
     }
     while (nY > nCurY && nCurY <= nH)
     {
-        nCurY += FIELD_BTN_HEIGHT + ROW_FIELD_BTN_GAP;
+        nCurY += aFldSize.Height() + ROW_FIELD_BTN_GAP;
         ++nRow;
     }
 
@@ -840,8 +841,8 @@ void ScDPHorFieldControl::CalcSize()
 
     long nTotalH = aWndSize.Height() - nScrollSize - OUTER_MARGIN_VER*2;
     long nTotalW = aWndSize.Width() - OUTER_MARGIN_HOR*2;
-    mnFieldBtnRowCount = nTotalH / (FIELD_BTN_HEIGHT + ROW_FIELD_BTN_GAP);
-    mnFieldBtnColCount = (nTotalW + ROW_FIELD_BTN_GAP) / (FIELD_BTN_WIDTH + ROW_FIELD_BTN_GAP);
+    mnFieldBtnRowCount = nTotalH / (GetFieldSize().Height() + ROW_FIELD_BTN_GAP);
+    mnFieldBtnColCount = (nTotalW + ROW_FIELD_BTN_GAP) / (GetFieldSize().Width() + ROW_FIELD_BTN_GAP);
 
     maScroll.SetLineSize(1);
     maScroll.SetVisibleSize(mnFieldBtnColCount);
@@ -942,11 +943,11 @@ bool ScDPHorFieldControl::GetFieldBtnPosSize(size_t nPos, Point& rPos, Size& rSi
     size_t nRow = nPos % mnFieldBtnRowCount;
     size_t nCol = nPos / mnFieldBtnRowCount;
 
-    aPos.X() += nCol*(FIELD_BTN_WIDTH + ROW_FIELD_BTN_GAP);
-    aPos.Y() += nRow*(FIELD_BTN_HEIGHT + ROW_FIELD_BTN_GAP);
+    aPos.X() += nCol*(GetFieldSize().Width() + ROW_FIELD_BTN_GAP);
+    aPos.Y() += nRow*(GetFieldSize().Height() + ROW_FIELD_BTN_GAP);
 
     rPos = aPos;
-    rSize = Size(FIELD_BTN_WIDTH, FIELD_BTN_HEIGHT);
+    rSize = GetFieldSize();
     return true;
 }
 
@@ -1041,7 +1042,7 @@ bool ScDPRowFieldControl::GetFieldIndex( const Point& rPos, size_t& rnIndex )
     if (rPos.X() < 0 || rPos.Y() < 0)
         return false;
 
-    rnIndex = rPos.Y() / FIELD_BTN_HEIGHT + maScroll.GetThumbPos();
+    rnIndex = rPos.Y() / GetFieldSize().Height() + maScroll.GetThumbPos();
     return IsValidIndex(rnIndex);
 }
 
@@ -1095,7 +1096,7 @@ void ScDPRowFieldControl::CalcSize()
     Size aWndSize = GetSizePixel();
 
     long nTotal = aWndSize.Height() - OUTER_MARGIN_VER;
-    mnColumnBtnCount = nTotal / (FIELD_BTN_HEIGHT + ROW_FIELD_BTN_GAP);
+    mnColumnBtnCount = nTotal / (GetFieldSize().Height() + ROW_FIELD_BTN_GAP);
 
     long nScrollSize = GetSettings().GetStyleSettings().GetScrollBarSize();
 
@@ -1184,9 +1185,9 @@ bool ScDPRowFieldControl::GetFieldBtnPosSize(size_t nPos, Point& rPos, Size& rSi
     if (nPos + nOffset >= GetFieldCount())
         return false;
 
-    rSize = Size(FIELD_BTN_WIDTH, FIELD_BTN_HEIGHT);
+    rSize = GetFieldSize();
     rPos = Point(OUTER_MARGIN_HOR, OUTER_MARGIN_VER);
-    rPos.Y() += nPos * (FIELD_BTN_HEIGHT + ROW_FIELD_BTN_GAP);
+    rPos.Y() += nPos * (rSize.Height() + ROW_FIELD_BTN_GAP);
     return true;
 }
 
@@ -1260,7 +1261,7 @@ void ScDPDataFieldControl::CalcSize()
     maScroll.SetSizePixel(Size(aWndSize.Width() - OUTER_MARGIN_HOR*2, nScrollSize));
     maScroll.SetPosPixel(Point(OUTER_MARGIN_HOR, aWndSize.Height() - mnScrollMarginHeight));
 
-    long nH = FIELD_BTN_HEIGHT + DATA_FIELD_BTN_GAP;
+    long nH = GetFieldSize().Height() + DATA_FIELD_BTN_GAP;
     long nTotalH = aWndSize.Height() - mnScrollMarginHeight - OUTER_MARGIN_VER;
     mnColumnBtnCount = nTotalH / nH;
     mnTotalBtnCount = mnColumnBtnCount * 2;
@@ -1426,7 +1427,7 @@ bool ScDPDataFieldControl::GetFieldBtnPosSize(size_t nPos, Point& rPos, Size& rS
 void ScDPDataFieldControl::GetFieldBtnColRow(const Point& rPos, size_t& rCol, size_t& rRow)
 {
     Size aSize = GetSizePixel();
-    long nBtnH = FIELD_BTN_HEIGHT;
+    long nBtnH = GetFieldSize().Height();
 
     size_t nCol = (rPos.X() <= aSize.Width()/2.0) ? 0 : 1;
     size_t nRow = 0;
commit f29227703201cf96928e53dd1dc7ee369706c5ff
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Dec 15 15:29:46 2010 -0500

    A little UI tweak & code cleanup.

diff --git a/sc/source/ui/dbgui/dpuiglobal.hxx b/sc/source/ui/dbgui/dpuiglobal.hxx
index 5fd4ed2..10d95e6 100644
--- a/sc/source/ui/dbgui/dpuiglobal.hxx
+++ b/sc/source/ui/dbgui/dpuiglobal.hxx
@@ -28,8 +28,6 @@
 #ifndef __SC_DPUIGLOBAL_HXX__
 #define __SC_DPUIGLOBAL_HXX__
 
-#define MAX_PAGEFIELDS 10   // maximum count of fields for page area
-
 #define OUTER_MARGIN_HOR     4
 #define OUTER_MARGIN_VER     4
 #define DATA_FIELD_BTN_GAP   2     // must be an even number
diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index 206812c..6f5151f 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -396,15 +396,17 @@ void ScDPFieldControlBase::KeyInput( const KeyEvent& rKEvt )
         bKeyEvaluated = true;
         switch( nCode )
         {
-            case KEY_UP:    MoveSelection( nCode, 0, -1 );          break;
-            case KEY_DOWN:  MoveSelection( nCode, 0, 1 );           break;
-            case KEY_LEFT:  MoveSelection( nCode, -1, 0 );          break;
-            case KEY_RIGHT: MoveSelection( nCode, 1, 0 );           break;
-            case KEY_HOME:  SetSelectionHome();                     break;
-            case KEY_END:   SetSelectionEnd();                      break;
+            case KEY_UP:    MoveSelection( 0, -1 ); break;
+            case KEY_DOWN:  MoveSelection( 0, 1 ); break;
+            case KEY_LEFT:  MoveSelection( -1, 0 ); break;
+            case KEY_RIGHT: MoveSelection( 1, 0 ); break;
+            case KEY_HOME:  SetSelectionHome();     break;
+            case KEY_END:   SetSelectionEnd();      break;
             case KEY_DELETE:
-                mpDlg->NotifyRemoveField( GetFieldType(), mnFieldSelected );   break;
-            default:        bKeyEvaluated = false;
+                mpDlg->NotifyRemoveField( GetFieldType(), mnFieldSelected );
+            break;
+            default:
+                bKeyEvaluated = false;
         }
     }
 
@@ -504,8 +506,16 @@ void ScDPFieldControlBase::DrawBackground( OutputDevice& rDev )
     Point aPos0;
     Size aSize( GetSizePixel() );
 
-    rDev.SetLineColor( aWinTextColor );
-    rDev.SetFillColor( aWinColor );
+    if (mpCaption)
+    {
+        rDev.SetLineColor( aWinTextColor );
+        rDev.SetFillColor( aWinColor );
+    }
+    else
+    {
+        rDev.SetLineColor( aFaceColor );
+        rDev.SetFillColor( aFaceColor );
+    }
     rDev.DrawRect( Rectangle( aPos0, aSize ) );
 
     rDev.SetTextColor( aWinTextColor );
@@ -676,7 +686,7 @@ void ScDPFieldControlBase::SetSelectionEnd()
     }
 }
 
-void ScDPFieldControlBase::MoveSelection( USHORT nKeyCode, SCsCOL nDX, SCsROW nDY )
+void ScDPFieldControlBase::MoveSelection(SCsCOL nDX, SCsROW nDY)
 {
     size_t nNewIndex = CalcNewFieldIndex( nDX, nDY );
     SetSelection( nNewIndex );
diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx
index 9f05845..c207744 100644
--- a/sc/source/ui/dbgui/pvlaydlg.cxx
+++ b/sc/source/ui/dbgui/pvlaydlg.cxx
@@ -1360,6 +1360,7 @@ void ScDPLayoutDlg::CalcWndSizes()
     // selection area
     long nLineSize = 10; // number of fields per column.
     long nH = OUTER_MARGIN_VER + nLineSize* nFldH + nLineSize * ROW_FIELD_BTN_GAP;
+    nH += ROW_FIELD_BTN_GAP;
     nH += GetSettings().GetStyleSettings().GetScrollBarSize() + OUTER_MARGIN_VER;
     aWndSelect.SetSizePixel(
         Size(2 * nFldW + ROW_FIELD_BTN_GAP + 10, nH));
diff --git a/sc/source/ui/inc/fieldwnd.hxx b/sc/source/ui/inc/fieldwnd.hxx
index 67f16c2..21eda91 100644
--- a/sc/source/ui/inc/fieldwnd.hxx
+++ b/sc/source/ui/inc/fieldwnd.hxx
@@ -211,7 +211,7 @@ private:
     /** Sets selection to last field. */
     void                    SetSelectionEnd();
     /** Sets selection to new position relative to current. */
-    void                    MoveSelection( USHORT nKeyCode, SCsCOL nDX, SCsROW nDY );
+    void                    MoveSelection( SCsCOL nDX, SCsROW nDY );
 
 private:
     typedef ::std::vector<Window*> Paintables;
commit 8fefa461a29658d184d72eadd98ffd0fde089d6c
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Dec 15 14:42:35 2010 -0500

    Up the number of fields per column from 8 to 10.

diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx
index 2b59740..9f05845 100644
--- a/sc/source/ui/dbgui/pvlaydlg.cxx
+++ b/sc/source/ui/dbgui/pvlaydlg.cxx
@@ -1358,7 +1358,7 @@ void ScDPLayoutDlg::CalcWndSizes()
               aWndPage.GetPosPixel().Y()));
 
     // selection area
-    long nLineSize = 8; // number of fields per column.
+    long nLineSize = 10; // number of fields per column.
     long nH = OUTER_MARGIN_VER + nLineSize* nFldH + nLineSize * ROW_FIELD_BTN_GAP;
     nH += GetSettings().GetStyleSettings().GetScrollBarSize() + OUTER_MARGIN_VER;
     aWndSelect.SetSizePixel(
commit 2f7f47072d8263242d45624c7d56a58ed7c43167
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Dec 15 14:38:30 2010 -0500

    Removed code I don't use any more.

diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index 76cc70c..206812c 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -1199,8 +1199,6 @@ IMPL_LINK(ScDPRowFieldControl, EndScrollHdl, ScrollBar*, EMPTYARG)
 
 //=============================================================================
 
-#if NEW_SELECT_FIELD
-
 ScDPSelectFieldControl::ScDPSelectFieldControl(
         ScDPLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption) :
     ScDPHorFieldControl(pDialog, rResId, pCaption)
@@ -1217,121 +1215,6 @@ ScDPFieldType ScDPSelectFieldControl::GetFieldType() const
     return TYPE_SELECT;
 }
 
-#else
-
-ScDPSelectFieldControl::ScDPSelectFieldControl(
-    ScDPLayoutDlg* pDialog, const ResId& rResId, const String& rName ) :
-    ScDPFieldControlBase( pDialog, rResId, NULL )
-{
-    SetName(rName);
-}
-
-ScDPSelectFieldControl::~ScDPSelectFieldControl()
-{
-}
-
-Point ScDPSelectFieldControl::GetFieldPosition( size_t nIndex )
-{
-    Point aPos;
-    long nFldW = FIELD_BTN_WIDTH;
-    long nFldH = FIELD_BTN_HEIGHT;
-    long nSpace = SELECT_FIELD_BTN_SPACE;
-
-    aPos.X() = (nFldW + nSpace) * (nIndex / LINE_SIZE);
-    aPos.Y() = (nFldH + nSpace) * (nIndex % LINE_SIZE);
-    return aPos;
-}
-
-Size ScDPSelectFieldControl::GetFieldSize() const
-{
-    return Size(FIELD_BTN_WIDTH, FIELD_BTN_HEIGHT);
-}
-
-bool ScDPSelectFieldControl::GetFieldIndex( const Point& rPos, size_t& rnIndex )
-{
-    rnIndex = INVALID_INDEX;
-    long nFldW = FIELD_BTN_WIDTH;
-    long nFldH = FIELD_BTN_HEIGHT;
-    long nSpace = SELECT_FIELD_BTN_SPACE;
-    if( (rPos.X() >= 0) && (rPos.Y() >= 0) )
-    {
-        size_t nRow = rPos.Y() / (nFldH + nSpace);
-        size_t nCol = rPos.X() / (nFldW + nSpace);
-        // is not between controls?
-        if( (rPos.Y() % (nFldH + nSpace) < nFldH) && (rPos.X() % (nFldW + nSpace) < nFldW) )
-            rnIndex = nCol * LINE_SIZE + nRow;
-    }
-    return IsValidIndex( rnIndex );
-}
-
-void ScDPSelectFieldControl::Redraw()
-{
-    const StyleSettings& rStyleSet = GetSettings().GetStyleSettings();
-    Color aFaceColor = rStyleSet.GetFaceColor();
-    Color aWinColor = rStyleSet.GetWindowColor();
-    Color aTextColor = rStyleSet.GetButtonTextColor();
-    Color aWinTextColor = rStyleSet.GetWindowTextColor();
-
-    VirtualDevice	aVirDev;
-    // #i97623# VirtualDevice is always LTR while other windows derive direction from parent
-    aVirDev.EnableRTL( IsRTLEnabled() );
-    aVirDev.SetMapMode( MAP_PIXEL );
-
-    Point			aPos0;
-    Size			aSize( GetSizePixel() );
-    Font			aFont( GetFont() );			// Font vom Window
-    aFont.SetTransparent( TRUE );
-    aVirDev.SetFont( aFont );
-    aVirDev.SetOutputSizePixel( aSize );
-
-    aVirDev.SetLineColor();
-    aVirDev.SetFillColor( aFaceColor );
-    aVirDev.DrawRect( Rectangle(aPos0, aSize) );
-
-    size_t nFieldSelected = GetSelectedField();
-    FieldNames& rFields = GetFieldNames();
-
-    Rectangle aFieldRect( aPos0, GetFieldSize() );
-    for( size_t nIx = 0; nIx < rFields.size(); ++nIx )
-    {
-        aFieldRect.SetPos( GetFieldPosition( nIx ) );
-        bool bFocus = HasFocus() && (nIx == nFieldSelected);
-        DrawField( aVirDev, aFieldRect, rFields[ nIx ], bFocus );
-    }
-
-    DrawBitmap( aPos0, aVirDev.GetBitmap( aPos0, aSize ) );
-    DrawInvertSelection();
-    UpdateStyle();
-}
-
-//-------------------------------------------------------------------
-
-bool ScDPSelectFieldControl::IsValidIndex( size_t nIndex ) const
-{
-    return nIndex < PAGE_SIZE;
-}
-
-size_t ScDPSelectFieldControl::CalcNewFieldIndex( SCsCOL nDX, SCsROW nDY ) const
-{
-    size_t nNewField = GetSelectedField();
-    nNewField += static_cast<SCsCOLROW>(nDX) * LINE_SIZE + nDY;
-    return IsExistingIndex( nNewField ) ? nNewField : GetSelectedField();
-}
-
-//-------------------------------------------------------------------
-
-String ScDPSelectFieldControl::GetDescription() const
-{
-    return ScResId(STR_ACC_DATAPILOT_SEL_DESCR);
-}
-
-ScDPFieldType ScDPSelectFieldControl::GetFieldType() const
-{
-    return TYPE_SELECT;
-}
-
-#endif
-
 //=============================================================================
 
 ScDPDataFieldControl::ScDPDataFieldControl( ScDPLayoutDlg* pParent, const ResId& rResId, FixedText* pCaption ) :
diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx
index 1b2d4e5..2b59740 100644
--- a/sc/source/ui/dbgui/pvlaydlg.cxx
+++ b/sc/source/ui/dbgui/pvlaydlg.cxx
@@ -1358,9 +1358,11 @@ void ScDPLayoutDlg::CalcWndSizes()
               aWndPage.GetPosPixel().Y()));
 
     // selection area
+    long nLineSize = 8; // number of fields per column.
+    long nH = OUTER_MARGIN_VER + nLineSize* nFldH + nLineSize * ROW_FIELD_BTN_GAP;
+    nH += GetSettings().GetStyleSettings().GetScrollBarSize() + OUTER_MARGIN_VER;
     aWndSelect.SetSizePixel(
-        Size(2 * nFldW + ROW_FIELD_BTN_GAP + 10,
-             LINE_SIZE * nFldH + (LINE_SIZE - 1) * ROW_FIELD_BTN_GAP));
+        Size(2 * nFldW + ROW_FIELD_BTN_GAP + 10, nH));
 
     aRectPage   = Rectangle( aWndPage.GetPosPixel(),    aWndPage.GetSizePixel() );
     aRectRow	= Rectangle( aWndRow.GetPosPixel(),		aWndRow.GetSizePixel() );
diff --git a/sc/source/ui/inc/fieldwnd.hxx b/sc/source/ui/inc/fieldwnd.hxx
index 0b1fb85..67f16c2 100644
--- a/sc/source/ui/inc/fieldwnd.hxx
+++ b/sc/source/ui/inc/fieldwnd.hxx
@@ -37,12 +37,6 @@
 #include <vcl/scrbar.hxx>
 #include <cppuhelper/weakref.hxx>
 
-#define NEW_SELECT_FIELD 1
-
-#define PAGE_SIZE   16      // count of visible fields for scrollbar
-#define LINE_SIZE   8       // count of fields per column for scrollbar
-#define MAX_FIELDS  8       // maximum count of fields for row/col/data area
-
 class ScDPLayoutDlg;
 class ScAccessibleDataPilotControl;
 
@@ -341,8 +335,6 @@ private:
 
 // ============================================================================
 
-#if NEW_SELECT_FIELD
-
 class ScDPSelectFieldControl : public ScDPHorFieldControl
 {
 public:
@@ -353,35 +345,6 @@ public:
     virtual ScDPFieldType GetFieldType() const;
 };
 
-#else
-
-class ScDPSelectFieldControl : public ScDPFieldControlBase
-{
-public:
-    ScDPSelectFieldControl(
-        ScDPLayoutDlg* pDialog, const ResId& rResId, const String& aName );
-
-    virtual                 ~ScDPSelectFieldControl();
-
-    virtual void            CalcSize() {}
-    virtual bool            IsValidIndex( size_t nIndex ) const;
-    virtual Point           GetFieldPosition( size_t nIndex );
-    virtual Size            GetFieldSize() const;
-    virtual bool            GetFieldIndex( const Point& rPos, size_t& rnIndex );
-    virtual String          GetDescription() const;
-    virtual ScDPFieldType   GetFieldType() const;
-
-    virtual void ScrollToEnd() {}
-    virtual void ScrollToShowSelection() {}
-    virtual void ResetScrollBar() {}
-
-protected:
-    virtual size_t          CalcNewFieldIndex( SCsCOL nDX, SCsROW nDY ) const;
-    virtual size_t          GetDisplayPosition(size_t nIndex) const { return 0; }
-    virtual void            Redraw();
-};
-#endif
-
 // ============================================================================
 
 class ScDPDataFieldControl : public ScDPFieldControlBase
commit 7dcbd30dddd940cae0c14d1082582359f1d476e4
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Dec 15 14:22:33 2010 -0500

    The size of each field control is calculated in the dialog code.
    
    Since the size of each field control is calculated in the dialog
    code, leave some note in the src file and set the sizes to 1 by 1.

diff --git a/sc/source/ui/dbgui/pivot.src b/sc/source/ui/dbgui/pivot.src
index fc70df9..514a371 100644
--- a/sc/source/ui/dbgui/pivot.src
+++ b/sc/source/ui/dbgui/pivot.src
@@ -46,8 +46,9 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
     };
     Control WND_PAGE
     {
+        /* Size is calculated in the dialog code. */
         Pos = MAP_APPFONT ( 20 , 14 ) ;
-        Size = MAP_APPFONT ( 202 , 34 ) ;
+        Size = MAP_APPFONT ( 1 , 1 ) ;
         TabStop = TRUE ;
     };
     FixedText FT_COL
@@ -58,8 +59,9 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
     };
     Control WND_COL
     {
+        /* Size is calculated in the dialog code. */
         Pos = MAP_APPFONT ( 56 , 56 ) ;
-        Size = MAP_APPFONT ( 144 , 34 ) ;
+        Size = MAP_APPFONT ( 1 , 1 ) ;
         TabStop = TRUE ;
     };
     FixedText FT_ROW
@@ -70,8 +72,9 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
     };
     Control WND_ROW
     {
+        /* Size is calculated in the dialog code. */
         Pos = MAP_APPFONT ( 6 , 98 ) ;
-        Size = MAP_APPFONT ( 50 , 96 ) ;
+        Size = MAP_APPFONT ( 1 , 1 ) ;
         TabStop = TRUE ;
     };
     FixedText FT_DATA
@@ -82,14 +85,16 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
     };
     Control WND_DATA
     {
+        /* Size is calculated in the dialog code. */
         Pos = MAP_APPFONT ( 56 , 98 ) ;
-        Size = MAP_APPFONT ( 144 , 96 ) ;
+        Size = MAP_APPFONT ( 1 , 1 ) ;
         TabStop = TRUE ;
     };
     Control WND_SELECT
     {
+        /* Size is calculated in the dialog code. */
         Pos = MAP_APPFONT ( 210 , 14 ) ;
-        Size = MAP_APPFONT ( 70 , 136 ) ;
+        Size = MAP_APPFONT ( 1 , 1 ) ;
         TabStop = TRUE ;
     };
     String STR_SELECT
commit 4b5c4e2d3a926ea18b943199252d6d983c179361
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Dec 15 14:17:50 2010 -0500

    Clean up.

diff --git a/sc/source/ui/dbgui/pivot.hrc b/sc/source/ui/dbgui/pivot.hrc
index 9942cfa..e4207e8 100644
--- a/sc/source/ui/dbgui/pivot.hrc
+++ b/sc/source/ui/dbgui/pivot.hrc
@@ -38,9 +38,6 @@
 #define WND_ROW                 12
 #define WND_DATA                13
 #define WND_SELECT              14
-//#define WND_FIELD               15
-//#define WND_FIELD_SPACE         16
-#define WND_HSCROLL             17
 #define WND_PAGE                18
 #define FT_COL                  31
 #define FT_ROW                  32
diff --git a/sc/source/ui/dbgui/pivot.src b/sc/source/ui/dbgui/pivot.src
index 1aaf937..fc70df9 100644
--- a/sc/source/ui/dbgui/pivot.src
+++ b/sc/source/ui/dbgui/pivot.src
@@ -89,20 +89,13 @@ ModelessDialog RID_SCDLG_PIVOT_LAYOUT
     Control WND_SELECT
     {
         Pos = MAP_APPFONT ( 210 , 14 ) ;
-        Size = MAP_APPFONT ( 70 , 126 ) ;
+        Size = MAP_APPFONT ( 70 , 136 ) ;
         TabStop = TRUE ;
     };
     String STR_SELECT
     {
         Text [ en-US ] = "Selection area";
     };
-    ScrollBar WND_HSCROLL
-    {
-        Pos = MAP_APPFONT ( 208 , 144 ) ;
-        Size = MAP_APPFONT ( 70 , 8 ) ;
-        HScroll = TRUE ;
-        TabStop = FALSE ;
-    };
     FixedText FT_INFO
     {
         Pos = MAP_APPFONT ( 6 , 200 ) ;
diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx
index b5db6a7..1b2d4e5 100644
--- a/sc/source/ui/dbgui/pvlaydlg.cxx
+++ b/sc/source/ui/dbgui/pvlaydlg.cxx
@@ -1460,8 +1460,6 @@ void ScDPLayoutDlg::UpdateSrcRange()
     aWndPage.ClearFields();
 
     aSelectArr.clear();
-    aSelectArr.resize(PAGE_SIZE);
-
     aRowArr.clear();
     aColArr.clear();
     aDataArr.clear();
diff --git a/sc/source/ui/inc/pvlaydlg.hxx b/sc/source/ui/inc/pvlaydlg.hxx
index 01b4fe9..98c3ba1 100644
--- a/sc/source/ui/inc/pvlaydlg.hxx
+++ b/sc/source/ui/inc/pvlaydlg.hxx
@@ -166,7 +166,7 @@ private:
     ScDPFieldType           eLastActiveType;        /// Type of last active area.
     size_t                  nOffset;                /// Offset of first field in TYPE_SELECT area.
 
-    ScDPFuncDataVec         aSelectArr;  // holds instances for visible buttons only
+    ScDPFuncDataVec         aSelectArr;
     ScDPFuncDataVec         aPageArr;
     ScDPFuncDataVec         aColArr;
     ScDPFuncDataVec         aRowArr;
commit c4c6475f86b1dba9f8453431e4426ac83b8c6c40
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Dec 15 14:00:14 2010 -0500

    Simpler logic for selecting next field button.

diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index 288a136..76cc70c 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -690,8 +690,7 @@ void ScDPFieldControlBase::ModifySelectionOffset( long nOffsetDiff )
 
 void ScDPFieldControlBase::SelectNext()
 {
-    if( GetFieldType() == TYPE_SELECT )
-        MoveSelection( KEY_DOWN, 0, 1 );
+    SetSelection(mnFieldSelected + 1);
 }
 
 void ScDPFieldControlBase::GrabFocusWithSel( size_t nIndex )
commit 104f1f7f0185e986e789ecba3932ba27dd06e9e0
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Dec 15 13:04:11 2010 -0500

    Set scroll bar line size to always 1.

diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index 4ebc44a..288a136 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -834,7 +834,7 @@ void ScDPHorFieldControl::CalcSize()
     mnFieldBtnRowCount = nTotalH / (FIELD_BTN_HEIGHT + ROW_FIELD_BTN_GAP);
     mnFieldBtnColCount = (nTotalW + ROW_FIELD_BTN_GAP) / (FIELD_BTN_WIDTH + ROW_FIELD_BTN_GAP);
 
-    maScroll.SetLineSize(mnFieldBtnRowCount);
+    maScroll.SetLineSize(1);
     maScroll.SetVisibleSize(mnFieldBtnColCount);
     maScroll.SetPageSize(mnFieldBtnColCount);
     maScroll.SetRange(Range(0, mnFieldBtnColCount));
commit 06aa754ffd3a6a21cd06f2a226ddab57780ae424
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Dec 15 12:05:50 2010 -0500

    TRUE to true

diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx
index bda93dd..b5db6a7 100644
--- a/sc/source/ui/dbgui/pvlaydlg.cxx
+++ b/sc/source/ui/dbgui/pvlaydlg.cxx
@@ -957,7 +957,7 @@ void ScDPLayoutDlg::NotifyMouseButtonUp( const Point& rAt )
             eDnDToType = TYPE_SELECT;
         }
         else
-            bDel = TRUE;
+            bDel = true;
 
         if (bDel)
         {
commit 02969310c4288f1f303d7da96f96a5b3c5df7b4d
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Dec 15 12:03:40 2010 -0500

    Debug statements & we don't remove any buttons from the select field.

diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx
index fafabaa..bda93dd 100644
--- a/sc/source/ui/dbgui/pvlaydlg.cxx
+++ b/sc/source/ui/dbgui/pvlaydlg.cxx
@@ -548,6 +548,8 @@ void ScDPLayoutDlg::AddField( size_t nFromIndex, ScDPFieldType eToType, const Po
 
 void ScDPLayoutDlg::AppendField(size_t nFromIndex, ScDPFieldType eToType)
 {
+    StackPrinter __stack_printer__("ScDPLayoutDlg::AppendField");
+    fprintf(stdout, "ScDPLayoutDlg::AppendField:   from index = %d  to type = %d\n", nFromIndex, eToType);
     ScDPFuncData aFuncData = *aSelectArr[nFromIndex];
 
     size_t nAt = 0;
@@ -619,6 +621,8 @@ void ScDPLayoutDlg::AppendField(size_t nFromIndex, ScDPFieldType eToType)
 
 void ScDPLayoutDlg::MoveField( ScDPFieldType eFromType, size_t nFromIndex, ScDPFieldType eToType, const Point& rAtPos )
 {
+    StackPrinter __stack_printer__("ScDPLayoutDlg::MoveField");
+    fprintf(stdout, "ScDPLayoutDlg::MoveField:   from type = %d  from index = %d  to type = %d\n", eFromType, nFromIndex, eToType);
     if ( eFromType == TYPE_SELECT )
         AddField( nFromIndex, eToType, rAtPos );
     else if ( eFromType != eToType )
@@ -763,6 +767,10 @@ void ScDPLayoutDlg::MoveField( ScDPFieldType eFromType, size_t nFromIndex, ScDPF
 
 void ScDPLayoutDlg::MoveFieldToEnd( ScDPFieldType eFromType, size_t nFromIndex, ScDPFieldType eToType )
 {
+    StackPrinter __stack_printer__("ScDPLayoutDlg::MoveFieldToEnd");
+    fprintf(stdout, "ScDPLayoutDlg::MoveFieldToEnd:   from type = %d  from index = %d  to type = %d\n",
+            eFromType, nFromIndex, eToType);
+
     if ( eFromType == TYPE_SELECT )
         AppendField( nFromIndex, eToType );
     else if ( eFromType != eToType )
@@ -899,6 +907,8 @@ void ScDPLayoutDlg::MoveFieldToEnd( ScDPFieldType eFromType, size_t nFromIndex,
 
 void ScDPLayoutDlg::RemoveField( ScDPFieldType eFromType, size_t nIndex )
 {
+    StackPrinter __stack_printer__("ScDPLayoutDlg::RemoveField");
+    fprintf(stdout, "ScDPLayoutDlg::RemoveField:   from type = %d  index = %d\n", eFromType, nIndex);
     ScDPFuncDataVec* pArr = GetFieldDataArray(eFromType);
 
     if( pArr )
@@ -917,44 +927,44 @@ void ScDPLayoutDlg::RemoveField( ScDPFieldType eFromType, size_t nIndex )
 
 void ScDPLayoutDlg::NotifyMouseButtonUp( const Point& rAt )
 {
+    StackPrinter __stack_printer__("ScDPLayoutDlg::NotifyMouseButtonUp");
     if ( bIsDrag )
     {
         bIsDrag = FALSE;
 
         ScDPFieldType   eDnDToType = TYPE_SELECT;
         Point           aPos = ScreenToOutputPixel( rAt );
-        BOOL            bDel = FALSE;
+        bool            bDel = false;
 
         if ( aRectPage.IsInside( aPos ) )
         {
             eDnDToType = TYPE_PAGE;
-            bDel = FALSE;
         }
         else if ( aRectCol.IsInside( aPos ) )
         {
             eDnDToType = TYPE_COL;
-            bDel = FALSE;
         }
         else if ( aRectRow.IsInside( aPos ) )
         {
             eDnDToType = TYPE_ROW;
-            bDel = FALSE;
         }
         else if ( aRectData.IsInside( aPos ) )
         {
             eDnDToType = TYPE_DATA;
-            bDel = FALSE;
         }
         else if ( aRectSelect.IsInside( aPos ) )
         {
             eDnDToType = TYPE_SELECT;
-            bDel = TRUE;
         }
         else
             bDel = TRUE;
 
-        if ( bDel )
-            RemoveField( eDnDFromType, nDnDFromIndex );
+        if (bDel)
+        {
+            // We don't remove any buttons from the select field.
+            if (eDnDFromType != TYPE_SELECT)
+                RemoveField( eDnDFromType, nDnDFromIndex );
+        }
         else
             MoveField( eDnDFromType, nDnDFromIndex, eDnDToType, aPos );
     }
commit 63e57a2994380322a07519ae598ae871555ce8f0
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Dec 15 11:23:00 2010 -0500

    Fixed a build breakage after merging master.

diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx
index 11ebc49..fafabaa 100644
--- a/sc/source/ui/dbgui/pvlaydlg.cxx
+++ b/sc/source/ui/dbgui/pvlaydlg.cxx
@@ -717,6 +717,7 @@ void ScDPLayoutDlg::MoveField( ScDPFieldType eFromType, size_t nFromIndex, ScDPF
 
         if ( Contains( theArr, fData.mnCol, nAt ) )
         {
+            size_t nToIndex = 0;
             aToPos = DlgPos2WndPos( rAtPos, *theWnd );
             theWnd->GetExistingIndex( aToPos, nToIndex );
 
commit c1a3585f31f0000e845647d5c12a61d9d9ee0ff1
Merge: caab2dc... 828b212...
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Dec 15 11:11:52 2010 -0500

    Merge branch 'master' into feature/calc-dp-unlimited-fields
    
    Conflicts:
    	sc/source/core/data/global2.cxx
    	sc/source/ui/dbgui/fieldwnd.cxx
    	sc/source/ui/dbgui/pvlaydlg.cxx

diff --cc sc/qa/complex/sc/CalcRTL.java
index fb39b7c,44e1ebe..5805f1b
--- a/sc/qa/complex/sc/CalcRTL.java
+++ b/sc/qa/complex/sc/CalcRTL.java
@@@ -325,7 -325,7 +325,7 @@@ public class CalcRTL extends ComplexTes
              worked = checkResult(set, pName, oldValue, pValue, resValue, 
                                   exception);
          } catch (Exception e) {
-             System.out.println("Exception occured while testing property '" + 
 -            System.out.println("Exception occurred while testing property '" + 
++            System.out.println("Exception occurred while testing property '" +
                                 pName + "'");
              e.printStackTrace();
              worked = false;
diff --cc sc/source/core/data/dpobject.cxx
index 9e7bc80,d6be537..2df47c7
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@@ -1711,19 -1713,19 +1711,19 @@@ USHORT lcl_CountBits( USHORT nBits 
      return nCount;
  }
  
 -SCSIZE lcl_FillOldFields( PivotField* pFields,
 -                            const uno::Reference<sheet::XDimensionsSupplier>& xSource,
 -                            USHORT nOrient, SCCOL nColAdd, BOOL bAddData )
 +void lcl_FillOldFields(
 +    vector<PivotField>& rFields,
 +    const uno::Reference<sheet::XDimensionsSupplier>& xSource,
 +    USHORT nOrient, SCCOL nColAdd, bool bAddData )
  {
 -    SCSIZE nOutCount = 0;
 -    BOOL bDataFound = FALSE;
 +    vector<PivotField> aFields;
  
 -    SCSIZE nCount = (nOrient == sheet::DataPilotFieldOrientation_PAGE) ? PIVOT_MAXPAGEFIELD : PIVOT_MAXFIELD;
 +    bool bDataFound = false;
  
-     //!	merge multiple occurences (data field with different functions)
+     //!	merge multiple occurrences (data field with different functions)
      //!	force data field in one dimension
  
 -    std::vector< long > aPos( nCount, 0 );
 +    vector<long> aPos;
  
      uno::Reference<container::XNameAccess> xDimsName = xSource->getDimensions();
      uno::Reference<container::XIndexAccess> xDims = new ScNameToIndexAccess( xDimsName );
diff --cc sc/source/ui/dbgui/pvlaydlg.cxx
index 1873ef5,e634089..11ebc49
--- a/sc/source/ui/dbgui/pvlaydlg.cxx
+++ b/sc/source/ui/dbgui/pvlaydlg.cxx
@@@ -707,151 -800,40 +707,150 @@@ void ScDPLayoutDlg::MoveField( ScDPFiel
      }
      else // -> eFromType == eToType
      {
 -        ScDPFieldWindow*    theWnd  = NULL;
 -        ScDPFuncDataVec*    theArr   = NULL;
 +        ScDPFieldControlBase* theWnd  = GetFieldWindow(eFromType);
 +        ScDPFuncDataVec*    theArr   = GetFieldDataArray(eFromType);
          size_t              nAt      = 0;
-         size_t              nToIndex = 0;
          Point               aToPos;
 -        BOOL                bDataArr = FALSE;
 +        BOOL                bDataArr = eFromType == TYPE_DATA;
 +
 +        ScDPFuncData fData( *((*theArr)[nFromIndex]) );
  
 -        switch ( eFromType )
 +        if ( Contains( theArr, fData.mnCol, nAt ) )
          {
 -            case TYPE_PAGE:
 -                theWnd = &aWndPage;
 -                theArr = &aPageArr;
 -                break;
 +            aToPos = DlgPos2WndPos( rAtPos, *theWnd );
 +            theWnd->GetExistingIndex( aToPos, nToIndex );
  
 -            case TYPE_COL:
 -                theWnd = &aWndCol;
 -                theArr = &aColArr;
 -                break;
 +            if ( nToIndex != nAt )
 +            {
 +                size_t nAddedAt = 0;
  
 -            case TYPE_ROW:
 -                theWnd = &aWndRow;
 -                theArr = &aRowArr;
 -                break;
 +                theWnd->DelField( nAt );
 +                Remove( theArr, nAt );
  
 -            case TYPE_DATA:
 -                theWnd = &aWndData;
 -                theArr = &aDataArr;
 -                bDataArr = TRUE;
 -                break;
 +                if ( !bDataArr )
 +                {
 +                    if ( theWnd->AddField( GetLabelString( fData.mnCol ),
 +                                           aToPos,
 +                                           nAddedAt ) )
 +                    {
 +                        Insert( theArr, fData, nAddedAt );
 +                    }
 +                }
 +                else
 +                {
 +                    ScDPLabelData* p = GetLabelData(fData.mnCol);
 +                    OUString aStr = p->maLayoutName;
 +                    USHORT nMask = fData.mnFuncMask;
 +                    if (!aStr.getLength())
 +                    {
 +                        aStr = GetFuncString(nMask);
 +                        aStr += p->maName;
 +                    }
  
 -            default:
 +                    if ( theWnd->AddField( aStr,
 +                                           DlgPos2WndPos( rAtPos, *theWnd ),
 +                                           nAddedAt ) )
 +                    {
 +                        fData.mnFuncMask = nMask;
 +                        Insert( theArr, fData, nAddedAt );
 +                    }
 +                }
 +            }
 +        }
 +    }
 +}
 +
 +void ScDPLayoutDlg::MoveFieldToEnd( ScDPFieldType eFromType, size_t nFromIndex, ScDPFieldType eToType )
 +{
 +    if ( eFromType == TYPE_SELECT )
 +        AppendField( nFromIndex, eToType );
 +    else if ( eFromType != eToType )
 +    {
 +        ScDPFieldControlBase* fromWnd  = GetFieldWindow(eFromType);
 +        ScDPFieldControlBase* toWnd    = GetFieldWindow(eToType);
 +
 +        ScDPFieldControlBase* rmWnd1   = NULL;
 +        ScDPFieldControlBase* rmWnd2   = NULL;
 +        GetOtherFieldWindows(eToType, rmWnd1, rmWnd2);
 +
 +        ScDPFuncDataVec*    fromArr  = GetFieldDataArray(eFromType);
 +        ScDPFuncDataVec*    toArr    = GetFieldDataArray(eToType);
 +
 +        ScDPFuncDataVec*    rmArr1   = NULL;
 +        ScDPFuncDataVec*    rmArr2   = NULL;
 +        GetOtherDataArrays(eToType, rmArr1, rmArr2);
 +
 +        size_t nAt = 0;
 +        bool bDataArr = eToType == TYPE_DATA;
 +
 +        if ( fromArr && toArr && fromWnd && toWnd )
 +        {
 +            ScDPFuncData fData( *((*fromArr)[nFromIndex]) );
 +
 +            if ( Contains( fromArr, fData.mnCol, nAt ) )
              {
 -                // added to avoid warnings
 +                fromWnd->DelField( nAt );
 +                Remove( fromArr, nAt );
 +
 +                if (!Contains( toArr, fData.mnCol, nAt ))
 +                {
 +                    size_t nAddedAt = 0;
 +                    if ( !bDataArr )
 +                    {
 +                        // ggF. in anderem Fenster entfernen
 +                        if ( rmArr1 )
 +                        {
 +                            if ( Contains( rmArr1, fData.mnCol, nAt ) )
 +                            {
 +                                rmWnd1->DelField( nAt );
 +                                Remove( rmArr1, nAt );
 +                            }
 +                        }
 +                        if ( rmArr2 )
 +                        {
 +                            if ( Contains( rmArr2, fData.mnCol, nAt ) )
 +                            {
 +                                rmWnd2->DelField( nAt );
 +                                Remove( rmArr2, nAt );
 +                            }
 +                        }
 +
 +                        if ( toWnd->AppendField( GetLabelString( fData.mnCol ), nAddedAt ) )
 +                        {
 +                            Insert( toArr, fData, nAddedAt );
 +                            toWnd->GrabFocus();
 +                        }
 +                    }
 +                    else
 +                    {
 +                        ScDPLabelData* p = GetLabelData(fData.mnCol);
 +                        OUString aStr = p->maLayoutName;
 +                        USHORT nMask = fData.mnFuncMask;
 +                        if (!aStr.getLength())
 +                        {
 +                            aStr = GetFuncString(nMask);
 +                            aStr += p->maName;
 +                        }
 +
 +                        if ( toWnd->AppendField(aStr, nAddedAt) )
 +                        {
 +                            fData.mnFuncMask = nMask;
 +                            Insert( toArr, fData, nAddedAt );
 +                            toWnd->GrabFocus();
 +                        }
 +                    }
 +                }
              }
          }
 +    }
 +    else // -> eFromType == eToType
 +    {
 +        ScDPFieldControlBase* theWnd  = GetFieldWindow(eFromType);
 +        ScDPFuncDataVec*    theArr   = GetFieldDataArray(eFromType);
 +        size_t              nAt      = 0;
 +        size_t              nToIndex = 0;
 +        Point               aToPos;
 +        BOOL                bDataArr = eFromType == TYPE_DATA;
  
          ScDPFuncData fData( *((*theArr)[nFromIndex]) );
  
commit caab2dc5df4938d37a28be1aeffe194a5a595b9d
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Fri Nov 19 00:01:58 2010 -0500

    Now the select field control shows two columns of field buttons.

diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index 04c25ce..4ebc44a 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -1686,4 +1686,5 @@ IMPL_LINK(ScDPDataFieldControl, EndScrollHdl, ScrollBar*, EMPTYARG)
     HandleScroll();
     return 0;
 }
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx
index a0f84ca..1873ef5 100644
--- a/sc/source/ui/dbgui/pvlaydlg.cxx
+++ b/sc/source/ui/dbgui/pvlaydlg.cxx
@@ -384,7 +384,6 @@ void ScDPLayoutDlg::StateChanged( StateChangedType nStateChange )
 
 void ScDPLayoutDlg::InitWndSelect( const vector<ScDPLabelDataRef>& rLabels )
 {
-    StackPrinter __stack_printer__("ScDPLayoutDlg::InitWndSelect");
     size_t nLabelCount = rLabels.size();
     if (nLabelCount > MAX_LABELS)
         nLabelCount = MAX_LABELS;
@@ -393,13 +392,12 @@ void ScDPLayoutDlg::InitWndSelect( const vector<ScDPLabelDataRef>& rLabels )
     aLabelDataArr.reserve( nLabelCount );
     for ( size_t i=0; i < nLabelCount; i++ )
     {
-        fprintf(stdout, "ScDPLayoutDlg::InitWndSelect:   label data = %s\n",
-                rtl::OUStringToOString(rLabels[i]->getDisplayName(), RTL_TEXTENCODING_UTF8).getStr());
         aLabelDataArr.push_back(*rLabels[i]);
         aWndSelect.AddField(aLabelDataArr[i].getDisplayName(), i);
         ScDPFuncDataRef p(new ScDPFuncData(aLabelDataArr[i].mnCol, aLabelDataArr[i].mnFuncMask));
         aSelectArr.push_back(p);
     }
+    aWndSelect.ResetScrollBar();
 }
 
 //----------------------------------------------------------------------------
@@ -1351,7 +1349,7 @@ void ScDPLayoutDlg::CalcWndSizes()
 
     // selection area
     aWndSelect.SetSizePixel(
-        Size(2 * nFldW + ROW_FIELD_BTN_GAP,
+        Size(2 * nFldW + ROW_FIELD_BTN_GAP + 10,
              LINE_SIZE * nFldH + (LINE_SIZE - 1) * ROW_FIELD_BTN_GAP));
 
     aRectPage   = Rectangle( aWndPage.GetPosPixel(),    aWndPage.GetSizePixel() );
commit 67487fa4eb3bbfb1fb31a4878967b80a0d798553
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Thu Nov 18 16:45:08 2010 -0500

    More work on select field control rework.

diff --git a/sc/source/ui/dbgui/dpuiglobal.hxx b/sc/source/ui/dbgui/dpuiglobal.hxx
index 8b5c743..5fd4ed2 100644
--- a/sc/source/ui/dbgui/dpuiglobal.hxx
+++ b/sc/source/ui/dbgui/dpuiglobal.hxx
@@ -36,7 +36,7 @@
 #define ROW_FIELD_BTN_GAP    2     // must be an even number
 #define FIELD_BTN_WIDTH     81
 #define FIELD_BTN_HEIGHT    23
-#define SELECT_FIELD_BTN_SPACE   5
+#define SELECT_FIELD_BTN_SPACE   2
 #define FIELD_AREA_GAP       3   // gap between row/column/data/page areas
 
 #endif
diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index a9f0ab3..04c25ce 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -663,8 +663,6 @@ void ScDPFieldControlBase::SetSelectionHome()
     const FieldNames& rFields = GetFieldNames();
     if( !rFields.empty() )
     {
-        if( GetFieldType() == TYPE_SELECT )
-            mpDlg->NotifyMoveSlider( KEY_HOME );
         SetSelection( 0 );
     }
 }
@@ -674,8 +672,6 @@ void ScDPFieldControlBase::SetSelectionEnd()
     const FieldNames& rFields = GetFieldNames();
     if( !rFields.empty() )
     {
-        if( GetFieldType() == TYPE_SELECT )
-            mpDlg->NotifyMoveSlider( KEY_END );
         SetSelection( rFields.size() - 1 );
     }
 }
@@ -683,17 +679,6 @@ void ScDPFieldControlBase::SetSelectionEnd()
 void ScDPFieldControlBase::MoveSelection( USHORT nKeyCode, SCsCOL nDX, SCsROW nDY )
 {
     size_t nNewIndex = CalcNewFieldIndex( nDX, nDY );
-    if( (GetFieldType() == TYPE_SELECT) && (nNewIndex == GetSelectedField()) )
-    {
-        if( mpDlg->NotifyMoveSlider( nKeyCode ) )
-        {
-            switch( nKeyCode )
-            {
-                case KEY_UP:    nNewIndex += (LINE_SIZE - 1);   break;
-                case KEY_DOWN:  nNewIndex -= (LINE_SIZE - 1);   break;
-            }
-        }
-    }
     SetSelection( nNewIndex );
 }
 
diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx
index 530776c..a0f84ca 100644
--- a/sc/source/ui/dbgui/pvlaydlg.cxx
+++ b/sc/source/ui/dbgui/pvlaydlg.cxx
@@ -147,7 +147,6 @@ ScDPLayoutDlg::ScDPLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pPar
         aFtData         ( this, ScResId( FT_DATA ) ),
         aWndData        ( this, ScResId( WND_DATA ), &aFtData ),
         aWndSelect      ( this, ScResId( WND_SELECT ), NULL ),
-        aSlider			( this, ScResId( WND_HSCROLL ) ),
         aFtInfo			( this, ScResId( FT_INFO ) ),
 
         aFlAreas        ( this, ScResId( FL_OUTPUT ) ),
@@ -243,8 +242,6 @@ void ScDPLayoutDlg::Init(bool bNewOutput)
 
     CalcWndSizes();
 
-    aSelectArr.resize( PAGE_SIZE );
-
     ScRange inRange;
     String inString;
     if (xDlgDPObject->GetSheetDesc())
@@ -387,22 +384,21 @@ void ScDPLayoutDlg::StateChanged( StateChangedType nStateChange )
 
 void ScDPLayoutDlg::InitWndSelect( const vector<ScDPLabelDataRef>& rLabels )
 {
+    StackPrinter __stack_printer__("ScDPLayoutDlg::InitWndSelect");
     size_t nLabelCount = rLabels.size();
     if (nLabelCount > MAX_LABELS)
         nLabelCount = MAX_LABELS;
-    size_t nLast = (nLabelCount > PAGE_SIZE) ? (PAGE_SIZE - 1) : (nLabelCount - 1);
 
     aLabelDataArr.clear();
     aLabelDataArr.reserve( nLabelCount );
     for ( size_t i=0; i < nLabelCount; i++ )
     {
+        fprintf(stdout, "ScDPLayoutDlg::InitWndSelect:   label data = %s\n",
+                rtl::OUStringToOString(rLabels[i]->getDisplayName(), RTL_TEXTENCODING_UTF8).getStr());
         aLabelDataArr.push_back(*rLabels[i]);
-
-        if ( i <= nLast )
-        {
-            aWndSelect.AddField(aLabelDataArr[i].getDisplayName(), i);
-            aSelectArr[i].reset( new ScDPFuncData( aLabelDataArr[i].mnCol, aLabelDataArr[i].mnFuncMask ) );
-        }
+        aWndSelect.AddField(aLabelDataArr[i].getDisplayName(), i);
+        ScDPFuncDataRef p(new ScDPFuncData(aLabelDataArr[i].mnCol, aLabelDataArr[i].mnFuncMask));
+        aSelectArr.push_back(p);
     }
 }
 
@@ -473,20 +469,6 @@ void ScDPLayoutDlg::InitFields()
     InitFieldWindow(thePivotData.maColFields, TYPE_COL);
     InitFieldWindow(thePivotData.maRowFields, TYPE_ROW);
     InitFieldWindow(thePivotData.maDataFields, TYPE_DATA);
-
-    size_t nLabels = thePivotData.maLabelArray.size();
-    aSlider.SetPageSize( PAGE_SIZE );
-    aSlider.SetVisibleSize( PAGE_SIZE );
-    aSlider.SetLineSize( LINE_SIZE );
-    aSlider.SetRange( Range( 0, static_cast<long>(((nLabels+LINE_SIZE-1)/LINE_SIZE)*LINE_SIZE) ) );
-
-    if ( nLabels > PAGE_SIZE )
-    {
-        aSlider.SetEndScrollHdl( LINK( this, ScDPLayoutDlg, ScrollHdl ) );
-        aSlider.Show();
-    }
-    else
-        aSlider.Hide();
 }
 
 //----------------------------------------------------------------------------
@@ -1189,25 +1171,6 @@ void ScDPLayoutDlg::NotifyRemoveField( ScDPFieldType eType, size_t nFieldIndex )
         RemoveField( eType, nFieldIndex );
 }
 
-//----------------------------------------------------------------------------
-
-BOOL ScDPLayoutDlg::NotifyMoveSlider( USHORT nKeyCode )
-{
-    long nOldPos = aSlider.GetThumbPos();
-    switch( nKeyCode )
-    {
-        case KEY_HOME:  aSlider.DoScroll( 0 );                      break;
-        case KEY_END:   aSlider.DoScroll( aSlider.GetRangeMax() );  break;
-        case KEY_UP:
-        case KEY_LEFT:  aSlider.DoScrollAction( SCROLL_LINEUP );    break;
-        case KEY_DOWN:
-        case KEY_RIGHT: aSlider.DoScrollAction( SCROLL_LINEDOWN );  break;
-    }
-    return nOldPos != aSlider.GetThumbPos();
-}
-
-//----------------------------------------------------------------------------
-
 void ScDPLayoutDlg::Deactivate()
 {
     /*  #107616# If the dialog has been deactivated (click into document), the LoseFocus
@@ -1388,15 +1351,8 @@ void ScDPLayoutDlg::CalcWndSizes()
 
     // selection area
     aWndSelect.SetSizePixel(
-        Size(2 * nFldW + SELECT_FIELD_BTN_SPACE,
-             LINE_SIZE * nFldH + (LINE_SIZE - 1) * SELECT_FIELD_BTN_SPACE));
-
-    // scroll bar
-    Point aSliderPos( aWndSelect.GetPosPixel() );
-    Size aSliderSize( aWndSelect.GetSizePixel() );
-    aSliderPos.Y() += aSliderSize.Height() + SELECT_FIELD_BTN_SPACE;
-    aSliderSize.Height() = GetSettings().GetStyleSettings().GetScrollBarSize();
-    aSlider.SetPosSizePixel( aSliderPos, aSliderSize );
+        Size(2 * nFldW + ROW_FIELD_BTN_GAP,
+             LINE_SIZE * nFldH + (LINE_SIZE - 1) * ROW_FIELD_BTN_GAP));
 
     aRectPage   = Rectangle( aWndPage.GetPosPixel(),    aWndPage.GetSizePixel() );
     aRectRow	= Rectangle( aWndRow.GetPosPixel(),		aWndRow.GetSizePixel() );
@@ -1922,34 +1878,6 @@ IMPL_LINK( ScDPLayoutDlg, SelAreaHdl, ListBox *, EMPTYARG )
     return 0;
 }
 
-//----------------------------------------------------------------------------
-
-IMPL_LINK( ScDPLayoutDlg, ScrollHdl, ScrollBar *, EMPTYARG )
-{
-    long nNewOffset = aSlider.GetThumbPos();
-    long nOffsetDiff = nNewOffset - nOffset;
-    nOffset = nNewOffset;
-
-    size_t nFields = std::min< size_t >( aLabelDataArr.size() - nOffset, PAGE_SIZE );
-
-    aWndSelect.ClearFields();
-
-    size_t i=0;
-    for ( i=0; i<nFields; i++ )
-    {
-        const ScDPLabelData& rData = aLabelDataArr[nOffset+i];
-        aWndSelect.AddField(rData.getDisplayName(), i);
-        aSelectArr[i].reset( new ScDPFuncData( rData.mnCol, rData.mnFuncMask ) );
-    }
-    for ( ; i<aSelectArr.size(); i++ )
-        aSelectArr[i].reset();
-
-    aWndSelect.ModifySelectionOffset( nOffsetDiff );    // adjusts selection & redraws
-    return 0;
-}
-
-//----------------------------------------------------------------------------
-
 IMPL_LINK( ScDPLayoutDlg, GetFocusHdl, Control*, pCtrl )
 {
     pEditActive = NULL;
diff --git a/sc/source/ui/inc/pvlaydlg.hxx b/sc/source/ui/inc/pvlaydlg.hxx
index 3416243..01b4fe9 100644
--- a/sc/source/ui/inc/pvlaydlg.hxx
+++ b/sc/source/ui/inc/pvlaydlg.hxx
@@ -97,7 +97,6 @@ public:
     void                    NotifyFieldFocus     ( ScDPFieldType eType, BOOL bGotFocus );
     void                    NotifyMoveFieldToEnd      ( ScDPFieldType eToType );
     void                    NotifyRemoveField    ( ScDPFieldType eType, size_t nFieldIndex );
-    BOOL                    NotifyMoveSlider     ( USHORT nKeyCode );   // return TRUE, if position changed
 
 protected:
     virtual void            Deactivate();
@@ -117,7 +116,6 @@ private:
     FixedText               aFtData;
     ScDPDataFieldControl    aWndData;
     ScDPSelectFieldControl  aWndSelect;
-    ScrollBar               aSlider;
     FixedInfo               aFtInfo;
 
     FixedLine               aFlAreas;
@@ -235,7 +233,6 @@ private:
 
     // Handler
     DECL_LINK( ClickHdl, PushButton * );
-    DECL_LINK( ScrollHdl, ScrollBar * );
     DECL_LINK( SelAreaHdl, ListBox * );
     DECL_LINK( MoreClickHdl, MoreButton * );
     DECL_LINK( EdModifyHdl, Edit * );
commit df8379433f5bc8ef6ac81f553b24b85514d7f942
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Thu Nov 18 15:55:45 2010 -0500

    Started re-working the select field window widget.
    
    The new widget will make use of horizontal scroll control base
    class to manage scrolling etc.  Much better than the old method of
    having the parent class manage scrolling.

diff --git a/sc/source/ui/dbgui/dpuiglobal.hxx b/sc/source/ui/dbgui/dpuiglobal.hxx
index 9312e07..8b5c743 100644
--- a/sc/source/ui/dbgui/dpuiglobal.hxx
+++ b/sc/source/ui/dbgui/dpuiglobal.hxx
@@ -32,7 +32,7 @@
 
 #define OUTER_MARGIN_HOR     4
 #define OUTER_MARGIN_VER     4
-#define DATA_FIELD_BTN_GAP   4     // must be an even number
+#define DATA_FIELD_BTN_GAP   2     // must be an even number
 #define ROW_FIELD_BTN_GAP    2     // must be an even number
 #define FIELD_BTN_WIDTH     81
 #define FIELD_BTN_HEIGHT    23
diff --git a/sc/source/ui/dbgui/fieldwnd.cxx b/sc/source/ui/dbgui/fieldwnd.cxx
index 5faad71..a9f0ab3 100644
--- a/sc/source/ui/dbgui/fieldwnd.cxx
+++ b/sc/source/ui/dbgui/fieldwnd.cxx
@@ -41,7 +41,7 @@
 #include "dpuiglobal.hxx"
 #include "AccessibleDataPilotControl.hxx"
 #include "scresid.hxx"
-#include "sc.hrc"
+#include "pivot.hrc"
 
 using ::rtl::OUString;
 using ::std::vector;
@@ -1215,6 +1215,26 @@ IMPL_LINK(ScDPRowFieldControl, EndScrollHdl, ScrollBar*, EMPTYARG)
 
 //=============================================================================
 
+#if NEW_SELECT_FIELD
+
+ScDPSelectFieldControl::ScDPSelectFieldControl(
+        ScDPLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption) :
+    ScDPHorFieldControl(pDialog, rResId, pCaption)
+{
+    SetName(String(ScResId(STR_SELECT)));
+}
+
+ScDPSelectFieldControl::~ScDPSelectFieldControl()
+{
+}
+
+ScDPFieldType ScDPSelectFieldControl::GetFieldType() const
+{
+    return TYPE_SELECT;
+}
+
+#else
+
 ScDPSelectFieldControl::ScDPSelectFieldControl(
     ScDPLayoutDlg* pDialog, const ResId& rResId, const String& rName ) :
     ScDPFieldControlBase( pDialog, rResId, NULL )
@@ -1326,6 +1346,8 @@ ScDPFieldType ScDPSelectFieldControl::GetFieldType() const
     return TYPE_SELECT;
 }
 
+#endif
+
 //=============================================================================
 
 ScDPDataFieldControl::ScDPDataFieldControl( ScDPLayoutDlg* pParent, const ResId& rResId, FixedText* pCaption ) :
diff --git a/sc/source/ui/dbgui/pvlaydlg.cxx b/sc/source/ui/dbgui/pvlaydlg.cxx
index 11f6bc4..530776c 100644
--- a/sc/source/ui/dbgui/pvlaydlg.cxx
+++ b/sc/source/ui/dbgui/pvlaydlg.cxx
@@ -146,7 +146,7 @@ ScDPLayoutDlg::ScDPLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pPar
         aWndRow         ( this, ScResId( WND_ROW ), &aFtRow ),
         aFtData         ( this, ScResId( FT_DATA ) ),
         aWndData        ( this, ScResId( WND_DATA ), &aFtData ),
-        aWndSelect      ( this, ScResId( WND_SELECT ), String(ScResId(STR_SELECT)) ),
+        aWndSelect      ( this, ScResId( WND_SELECT ), NULL ),
         aSlider			( this, ScResId( WND_HSCROLL ) ),
         aFtInfo			( this, ScResId( FT_INFO ) ),
 
@@ -189,7 +189,8 @@ ScDPLayoutDlg::ScDPLayoutDlg( SfxBindings* pB, SfxChildWindow* pCW, Window* pPar
                                 GetViewData() ),
         pDoc			( ((ScTabViewShell*)SfxViewShell::Current())->
                                 GetViewData()->GetDocument() ),
-        bRefInputMode	( FALSE )
+        bRefInputMode   (false),
+        mbValidSrcRange (false)
 {
     xDlgDPObject->SetAlive( TRUE );     // needed to get structure information
     xDlgDPObject->FillOldParam( thePivotData, FALSE );
@@ -352,11 +353,6 @@ void ScDPLayoutDlg::Init(bool bNewOutput)
     aWndSelect.SetHelpId( HID_SC_DPLAY_SELECT );
 
     InitFocus();
-
-//	SetDispatcherLock( TRUE ); // Modal-Modus einschalten
-
-    //@BugID 54702 Enablen/Disablen nur noch in Basisklasse
-    //SFX_APPWINDOW->Disable(FALSE);		//! allgemeine Methode im ScAnyRefDlg
 }
 
 //----------------------------------------------------------------------------
@@ -1412,6 +1408,7 @@ void ScDPLayoutDlg::CalcWndSizes()
     aWndRow.CalcSize();
     aWndCol.CalcSize();
     aWndData.CalcSize();
+    aWndSelect.CalcSize();
 }
 
 namespace {
@@ -1467,6 +1464,7 @@ bool ScDPLayoutDlg::GetPivotArrays(
 
 void ScDPLayoutDlg::UpdateSrcRange()
 {
+    StackPrinter __stack_printer__("ScDPLayoutDlg::UpdateSrcRange");
     String  theCurPosStr = aEdInPos.GetText();
     USHORT  nResult = ScRange().Parse(theCurPosStr, pDoc, pDoc->GetAddressConvention());
 
diff --git a/sc/source/ui/inc/fieldwnd.hxx b/sc/source/ui/inc/fieldwnd.hxx
index 77c6b66..0b1fb85 100644
--- a/sc/source/ui/inc/fieldwnd.hxx
+++ b/sc/source/ui/inc/fieldwnd.hxx
@@ -37,6 +37,8 @@
 #include <vcl/scrbar.hxx>
 #include <cppuhelper/weakref.hxx>
 
+#define NEW_SELECT_FIELD 1
+
 #define PAGE_SIZE   16      // count of visible fields for scrollbar
 #define LINE_SIZE   8       // count of fields per column for scrollbar
 #define MAX_FIELDS  8       // maximum count of fields for row/col/data area
@@ -339,6 +341,20 @@ private:
 
 // ============================================================================
 
+#if NEW_SELECT_FIELD
+
+class ScDPSelectFieldControl : public ScDPHorFieldControl
+{
+public:
+    ScDPSelectFieldControl(
+        ScDPLayoutDlg* pDialog, const ResId& rResId, FixedText* pCaption);
+    virtual ~ScDPSelectFieldControl();
+
+    virtual ScDPFieldType GetFieldType() const;
+};
+
+#else
+
 class ScDPSelectFieldControl : public ScDPFieldControlBase
 {
 public:
@@ -364,6 +380,7 @@ protected:
     virtual size_t          GetDisplayPosition(size_t nIndex) const { return 0; }
     virtual void            Redraw();
 };
+#endif
 
 // ============================================================================
 
diff --git a/sc/source/ui/inc/pvlaydlg.hxx b/sc/source/ui/inc/pvlaydlg.hxx
index f732e6c..3416243 100644
--- a/sc/source/ui/inc/pvlaydlg.hxx
+++ b/sc/source/ui/inc/pvlaydlg.hxx
@@ -181,7 +181,8 @@ private:
     ScPivotParam            thePivotData;
     ScViewData*             pViewData;
     ScDocument*             pDoc;
-    BOOL                    bRefInputMode;
+    bool                    bRefInputMode;
+    bool                    mbValidSrcRange;
 
 private:
     void                    Init            (bool bNewOutput);
commit d9753a7c5e833738c1ae6ef90f5442d67d4b3160
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Nov 17 22:47:37 2010 -0500

    Indentation fix.

diff --git a/sc/inc/dpshttab.hxx b/sc/inc/dpshttab.hxx
index 2c0ccc2..7979472 100644
--- a/sc/inc/dpshttab.hxx
+++ b/sc/inc/dpshttab.hxx
@@ -71,7 +71,7 @@ private:
     bool            bIgnoreEmptyRows;
     bool            bRepeatIfEmpty;
 
-       ScDPCacheTable  aCacheTable;
+    ScDPCacheTable  aCacheTable;
 
 public:
     ScSheetDPData( ScDocument* pD, const ScSheetSourceDesc& rDesc, long nCacheId = -1 );
commit c91bf4a8ac9210cf8463f50db737e1dfe192d3b0
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Wed Nov 17 22:45:05 2010 -0500

    Moved the mis-placed class header comment into the right place.

diff --git a/sc/inc/dpshttab.hxx b/sc/inc/dpshttab.hxx
index ec0c483..2c0ccc2 100644
--- a/sc/inc/dpshttab.hxx
+++ b/sc/inc/dpshttab.hxx
@@ -44,11 +44,6 @@ namespace com { namespace sun { namespace star { namespace sheet {
 class ScDPDimension;
 class ScDPItemData;
 
-// --------------------------------------------------------------------
-//
-//	implementation of ScDPTableData with sheet data
-//
-
 struct ScSheetSourceDesc
 {
     ScRange			aSourceRange;
@@ -64,6 +59,10 @@ struct ScSheetSourceDesc
     long	GetCacheId( ScDocument* pDoc, long nID ) const;
 };
 
+// --------------------------------------------------------------------
+//
+//	implementation of ScDPTableData with sheet data
+//
 class SC_DLLPUBLIC ScSheetDPData : public ScDPTableData
 {
 private:
commit 1ce7fb1258d86287a9aea610755dae92db76f1e5
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Sat Nov 6 02:49:11 2010 -0400

    Ported my previous work into this branch.  Not build-tested yet.

diff --git a/sc/inc/dpglobal.hxx b/sc/inc/dpglobal.hxx
index 0541bd7..534c4f5 100644
--- a/sc/inc/dpglobal.hxx

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list