[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 2 commits - sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Fri Jan 6 08:04:16 PST 2012


 sc/source/ui/inc/datafdlg.hrc      |    2 -
 sc/source/ui/inc/datafdlg.hxx      |    6 +--
 sc/source/ui/miscdlgs/datafdlg.cxx |   60 +++++++++++++++++++------------------
 sc/source/ui/src/datafdlg.src      |    4 +-
 4 files changed, 37 insertions(+), 35 deletions(-)

New commits:
commit 81b5a2d152f1e19a5c4f0001e7314a67b531a164
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Fri Jan 6 11:03:05 2012 -0500

    The data range may not always start at row 0, use 'n' prefix for int.

diff --git a/sc/source/ui/inc/datafdlg.hxx b/sc/source/ui/inc/datafdlg.hxx
index fbad64e..5600d2c 100644
--- a/sc/source/ui/inc/datafdlg.hxx
+++ b/sc/source/ui/inc/datafdlg.hxx
@@ -67,7 +67,7 @@ private:
     ScTabViewShell* pTabViewShell;
     ScDocument*     pDoc;
     sal_uInt16      aColLength;
-    SCROW           aCurrentRow;
+    SCROW           nCurrentRow;
     SCCOL           nStartCol;
     SCCOL           nEndCol;
     SCROW           nStartRow;
diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx
index f5926c2..698eb7b 100644
--- a/sc/source/ui/miscdlgs/datafdlg.cxx
+++ b/sc/source/ui/miscdlgs/datafdlg.cxx
@@ -159,7 +159,7 @@ ScDataFormDlg::ScDataFormDlg( Window* pParent, ScTabViewShell*  pTabViewShellOri
                 nEndRow = nStartRow;
         }
 
-        aCurrentRow = nStartRow + 1;
+        nCurrentRow = nStartRow + 1;
 
         String  aFieldName;
 
@@ -213,7 +213,7 @@ ScDataFormDlg::ScDataFormDlg( Window* pParent, ScTabViewShell*  pTabViewShellOri
         aSlider.SetSizePixel(nScrollSize);
     }
 
-    FillCtrls(aCurrentRow);
+    FillCtrls(nCurrentRow);
 
     aSlider.SetPageSize( 10 );
     aSlider.SetVisibleSize( 1 );
@@ -246,9 +246,9 @@ void ScDataFormDlg::FillCtrls(SCROW /*nCurrentRow*/)
     {
         if (!maEdits.is_null(i))
         {
-            if (aCurrentRow<=nEndRow)
+            if (nCurrentRow<=nEndRow)
             {
-                pDoc->GetString( i + nStartCol, aCurrentRow, nTab, aFieldName );
+                pDoc->GetString( i + nStartCol, nCurrentRow, nTab, aFieldName );
                 maEdits[i].SetText(aFieldName);
             }
             else
@@ -256,10 +256,10 @@ void ScDataFormDlg::FillCtrls(SCROW /*nCurrentRow*/)
         }
     }
 
-    if (aCurrentRow <= nEndRow)
+    if (nCurrentRow <= nEndRow)
     {
         OUStringBuffer aBuf;
-        aBuf.append(static_cast<sal_Int32>(aCurrentRow - nStartRow));
+        aBuf.append(static_cast<sal_Int32>(nCurrentRow - nStartRow));
         aBuf.appendAscii(" / ");
         aBuf.append(static_cast<sal_Int32>(nEndRow - nStartRow));
         aFixedText.SetText(aBuf.makeStringAndClear());
@@ -267,7 +267,7 @@ void ScDataFormDlg::FillCtrls(SCROW /*nCurrentRow*/)
     else
         aFixedText.SetText(String(ScResId(STR_NEW_RECORD)));
 
-    aSlider.SetThumbPos(aCurrentRow-nStartRow-1);
+    aSlider.SetThumbPos(nCurrentRow-nStartRow-1);
 }
 
 IMPL_LINK( ScDataFormDlg, Impl_DataModifyHdl, Edit*, pEdit)
@@ -295,15 +295,15 @@ IMPL_LINK( ScDataFormDlg, Impl_NewHdl, PushButton*, EMPTYARG )
 
         if ( bHasData )
         {
-            pTabViewShell->DataFormPutData( aCurrentRow , nStartRow , nStartCol , nEndRow , nEndCol , maEdits , aColLength );
-            aCurrentRow++;
-            if (aCurrentRow >= nEndRow + 2)
+            pTabViewShell->DataFormPutData( nCurrentRow , nStartRow , nStartCol , nEndRow , nEndCol , maEdits , aColLength );
+            nCurrentRow++;
+            if (nCurrentRow >= nEndRow + 2)
             {
                     nEndRow ++ ;
                     aSlider.SetRange( Range( 0, nEndRow - nStartRow + 1) );
             }
             SetButtonState();
-            FillCtrls(aCurrentRow);
+            FillCtrls(nCurrentRow);
             pDocSh->SetDocumentModified();
             pDocSh->PostPaintGridAll();
             }
@@ -315,11 +315,11 @@ IMPL_LINK( ScDataFormDlg, Impl_PrevHdl, PushButton*, EMPTYARG )
 {
     if (pDoc)
     {
-        if ( aCurrentRow > nStartRow +1 )
-            aCurrentRow--;
+        if ( nCurrentRow > nStartRow +1 )
+            nCurrentRow--;
 
         SetButtonState();
-        FillCtrls(aCurrentRow);
+        FillCtrls(nCurrentRow);
     }
     return 0;
 }
@@ -328,11 +328,11 @@ IMPL_LINK( ScDataFormDlg, Impl_NextHdl, PushButton*, EMPTYARG )
 {
     if (pDoc)
     {
-        if ( aCurrentRow <= nEndRow)
-            aCurrentRow++;
+        if ( nCurrentRow <= nEndRow)
+            nCurrentRow++;
 
         SetButtonState();
-        FillCtrls(aCurrentRow);
+        FillCtrls(nCurrentRow);
     }
     return 0;
 }
@@ -341,7 +341,7 @@ IMPL_LINK( ScDataFormDlg, Impl_RestoreHdl, PushButton*, EMPTYARG )
 {
     if (pDoc)
     {
-        FillCtrls(aCurrentRow);
+        FillCtrls(nCurrentRow);
     }
     return 0;
 }
@@ -352,14 +352,14 @@ IMPL_LINK( ScDataFormDlg, Impl_DeleteHdl, PushButton*, EMPTYARG )
     ScDocShell* pDocSh = pViewData->GetDocShell();
     if (pDoc)
     {
-        ScRange aRange(nStartCol, aCurrentRow, nTab, nEndCol, aCurrentRow, nTab);
+        ScRange aRange(nStartCol, nCurrentRow, nTab, nEndCol, nCurrentRow, nTab);
         pDoc->DeleteRow(aRange);
         nEndRow--;
 
         SetButtonState();
         pDocSh->GetUndoManager()->Clear();
 
-        FillCtrls(aCurrentRow);
+        FillCtrls(nCurrentRow);
         pDocSh->SetDocumentModified();
         pDocSh->PostPaintGridAll();
     }
@@ -375,15 +375,15 @@ IMPL_LINK( ScDataFormDlg, Impl_CloseHdl, PushButton*, EMPTYARG )
 IMPL_LINK( ScDataFormDlg, Impl_ScrollHdl, ScrollBar*, EMPTYARG )
 {
     long nOffset = aSlider.GetThumbPos();
-    aCurrentRow = nStartRow + nOffset + 1;
+    nCurrentRow = nStartRow + nOffset + 1;
     SetButtonState();
-    FillCtrls(aCurrentRow);
+    FillCtrls(nCurrentRow);
     return 0;
 }
 
 void ScDataFormDlg::SetButtonState()
 {
-    if ( aCurrentRow > nEndRow )
+    if (nCurrentRow > nEndRow)
     {
         aBtnDelete.Enable( false );
         aBtnNext.Enable( false );
@@ -393,7 +393,8 @@ void ScDataFormDlg::SetButtonState()
         aBtnDelete.Enable( true );
         aBtnNext.Enable( true );
     }
-    if ( 1 == aCurrentRow )
+
+    if (nCurrentRow == nStartRow + 1)
         aBtnPrev.Enable( false );
     else
         aBtnPrev.Enable( true );
commit 50d8f2cf9410fd368c597feabe7d91ab202c6200
Author: Lior Kaplan <kaplanlior at gmail.com>
Date:   Fri Jan 6 01:10:19 2012 +0200

    Update behavior and translation last record to prev record

diff --git a/sc/source/ui/inc/datafdlg.hrc b/sc/source/ui/inc/datafdlg.hrc
index 2a8341d..bdb1ea9 100644
--- a/sc/source/ui/inc/datafdlg.hrc
+++ b/sc/source/ui/inc/datafdlg.hrc
@@ -30,7 +30,7 @@
 #define BTN_DATAFORM_NEW          1
 #define BTN_DATAFORM_DELETE       2
 #define BTN_DATAFORM_RESTORE      3
-#define BTN_DATAFORM_LAST         4
+#define BTN_DATAFORM_PREV         4
 #define BTN_DATAFORM_NEXT         5
 #define BTN_DATAFORM_CLOSE        6
 #define WND_DATAFORM_SCROLLBAR    7
diff --git a/sc/source/ui/inc/datafdlg.hxx b/sc/source/ui/inc/datafdlg.hxx
index 6fda321..fbad64e 100644
--- a/sc/source/ui/inc/datafdlg.hxx
+++ b/sc/source/ui/inc/datafdlg.hxx
@@ -58,7 +58,7 @@ private:
     PushButton      aBtnNew;
     PushButton      aBtnDelete;
     PushButton      aBtnRestore;
-    PushButton      aBtnLast;
+    PushButton      aBtnPrev;
     PushButton      aBtnNext;
     PushButton      aBtnClose;
     ScrollBar       aSlider;
@@ -89,7 +89,7 @@ private:
 
     // Handler:
     DECL_LINK( Impl_NewHdl,     PushButton*    );
-    DECL_LINK( Impl_LastHdl,    PushButton*    );
+    DECL_LINK( Impl_PrevHdl,    PushButton*    );
     DECL_LINK( Impl_NextHdl,    PushButton*    );
 
     DECL_LINK( Impl_RestoreHdl, PushButton*    );
diff --git a/sc/source/ui/miscdlgs/datafdlg.cxx b/sc/source/ui/miscdlgs/datafdlg.cxx
index b5eeccd..f5926c2 100644
--- a/sc/source/ui/miscdlgs/datafdlg.cxx
+++ b/sc/source/ui/miscdlgs/datafdlg.cxx
@@ -51,7 +51,7 @@ ScDataFormDlg::ScDataFormDlg( Window* pParent, ScTabViewShell*  pTabViewShellOri
     aBtnNew          ( this, ScResId( BTN_DATAFORM_NEW ) ),
     aBtnDelete          ( this, ScResId( BTN_DATAFORM_DELETE ) ),
     aBtnRestore          ( this, ScResId( BTN_DATAFORM_RESTORE ) ),
-    aBtnLast          ( this, ScResId( BTN_DATAFORM_LAST ) ),
+    aBtnPrev          ( this, ScResId( BTN_DATAFORM_PREV ) ),
     aBtnNext          ( this, ScResId( BTN_DATAFORM_NEXT ) ),
     aBtnClose          ( this, ScResId( BTN_DATAFORM_CLOSE ) ),
     aSlider         ( this, ScResId( WND_DATAFORM_SCROLLBAR ) ),
@@ -222,7 +222,7 @@ ScDataFormDlg::ScDataFormDlg( Window* pParent, ScTabViewShell*  pTabViewShellOri
     aSlider.Show();
 
     aBtnNew.SetClickHdl     ( HDL(Impl_NewHdl)    );
-    aBtnLast.SetClickHdl    ( HDL(Impl_LastHdl)    );
+    aBtnPrev.SetClickHdl    ( HDL(Impl_PrevHdl)    );
     aBtnNext.SetClickHdl    ( HDL(Impl_NextHdl)    );
 
     aBtnRestore.SetClickHdl     ( HDL(Impl_RestoreHdl)    );
@@ -311,7 +311,7 @@ IMPL_LINK( ScDataFormDlg, Impl_NewHdl, PushButton*, EMPTYARG )
     return 0;
 }
 
-IMPL_LINK( ScDataFormDlg, Impl_LastHdl, PushButton*, EMPTYARG )
+IMPL_LINK( ScDataFormDlg, Impl_PrevHdl, PushButton*, EMPTYARG )
 {
     if (pDoc)
     {
@@ -386,7 +386,6 @@ void ScDataFormDlg::SetButtonState()
     if ( aCurrentRow > nEndRow )
     {
         aBtnDelete.Enable( false );
-        aBtnLast.Enable( true );
         aBtnNext.Enable( false );
     }
     else
@@ -395,7 +394,9 @@ void ScDataFormDlg::SetButtonState()
         aBtnNext.Enable( true );
     }
     if ( 1 == aCurrentRow )
-        aBtnLast.Enable( false );
+        aBtnPrev.Enable( false );
+    else
+        aBtnPrev.Enable( true );
 
     aBtnRestore.Enable( false );
     if ( maEdits.size()>=1 && !maEdits.is_null(0) )
diff --git a/sc/source/ui/src/datafdlg.src b/sc/source/ui/src/datafdlg.src
index 1cb3578..5c0ee6d 100644
--- a/sc/source/ui/src/datafdlg.src
+++ b/sc/source/ui/src/datafdlg.src
@@ -63,12 +63,12 @@ ModalDialog RID_SCDLG_DATAFORM
         TabStop = TRUE ;
         Text [ en-US ] = "Restore" ;
     };
-    PushButton BTN_DATAFORM_LAST
+    PushButton BTN_DATAFORM_PREV
     {
         Pos = MAP_APPFONT ( 135 , 82 ) ;
         Size = MAP_APPFONT ( 50 , 14 ) ;
         TabStop = TRUE ;
-        Text [ en-US ] = "Last Record" ;
+        Text [ en-US ] = "Previous Record" ;
     };
     PushButton BTN_DATAFORM_NEXT
     {


More information about the Libreoffice-commits mailing list