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

Kohei Yoshida kohei at kemper.freedesktop.org
Wed Dec 15 12:30:09 PST 2010


 sc/source/ui/dbgui/dpuiglobal.hxx |    2 --
 sc/source/ui/dbgui/fieldwnd.cxx   |   32 +++++++++++++++++++++-----------
 sc/source/ui/dbgui/pvlaydlg.cxx   |    3 ++-
 sc/source/ui/inc/fieldwnd.hxx     |    2 +-
 4 files changed, 24 insertions(+), 15 deletions(-)

New commits:
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(


More information about the Libreoffice-commits mailing list