[Libreoffice-commits] .: Branch 'feature/calc-dp-unlimited-fields' - sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Wed Dec 15 11:38:42 PST 2010
sc/source/ui/dbgui/fieldwnd.cxx | 117 ----------------------------------------
sc/source/ui/dbgui/pvlaydlg.cxx | 6 +-
sc/source/ui/inc/fieldwnd.hxx | 37 ------------
3 files changed, 4 insertions(+), 156 deletions(-)
New commits:
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
More information about the Libreoffice-commits
mailing list