[Libreoffice-commits] .: sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Wed Mar 23 22:56:34 PDT 2011


 sc/source/ui/dbgui/tpsubt.cxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 041c6ff2d4732edc659999123899f0b1fd3e14ef
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Thu Mar 24 01:54:19 2011 -0400

    Select the first checked position. (fdo#31220)
    
    The dialog appears less confusing this way.

diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx
index 54cbb94..4e96838 100644
--- a/sc/source/ui/dbgui/tpsubt.cxx
+++ b/sc/source/ui/dbgui/tpsubt.cxx
@@ -172,6 +172,7 @@ bool ScTpSubTotalGroup::DoReset( sal_uInt16 			nGroupNo,
 
         aLbGroup.SelectEntryPos( GetFieldSelPos( nField )+1 );
 
+        sal_uInt16 nFirstChecked = 0;
         for ( sal_uInt16 i=0; i<nSubTotals; i++ )
         {
             sal_uInt16	nCheckPos = GetFieldSelPos( pSubTotals[i] );
@@ -179,8 +180,12 @@ bool ScTpSubTotalGroup::DoReset( sal_uInt16 			nGroupNo,
 
             aLbColumns.CheckEntryPos( nCheckPos );
             *pFunction = FuncToLbPos( pFunctions[i] );
+
+            if (i == 0 || (i > 0 && nCheckPos < nFirstChecked))
+                nFirstChecked = nCheckPos;
         }
-        aLbColumns.SelectEntryPos( 0 );
+        // Select the first checked field from the top.
+        aLbColumns.SelectEntryPos(nFirstChecked);
     }
     else
     {


More information about the Libreoffice-commits mailing list