[Libreoffice-commits] .: Branch 'feature/calc-dp-unlimited-fields' - sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Wed Dec 15 13:00:00 PST 2010


 sc/source/ui/dbgui/fieldwnd.cxx |   34 ++++++++++++++++++++++++++++++++++
 sc/source/ui/inc/fieldwnd.hxx   |   19 +++++++++++++++++++
 2 files changed, 53 insertions(+)

New commits:
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: */


More information about the Libreoffice-commits mailing list