summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2011-03-31 22:05:47 -0400
committerKohei Yoshida <kyoshida@novell.com>2011-04-01 00:11:03 -0400
commit12024429e295b959001258d790ecac4b074203d0 (patch)
tree0a337c0b798856caa6e3ac8afdf00bb4f574379c /sc
parent7d18257bde13f64bad9fb87f663bfb347cd6b899 (diff)
Cleaned up ScSortParam.
Tabs and sal_Bool madness.
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/sortparam.hxx31
-rw-r--r--sc/source/core/data/sortparam.cxx28
2 files changed, 29 insertions, 30 deletions
diff --git a/sc/inc/sortparam.hxx b/sc/inc/sortparam.hxx
index 32e19bfa4662..982a124c595e 100644
--- a/sc/inc/sortparam.hxx
+++ b/sc/inc/sortparam.hxx
@@ -35,8 +35,7 @@
#include <com/sun/star/lang/Locale.hpp>
#include "scdllapi.h"
-#define MAXSORT 3
-
+#define MAXSORT 3
struct ScSubTotalParam;
struct ScQueryParam;
@@ -47,23 +46,23 @@ struct SC_DLLPUBLIC ScSortParam
SCROW nRow1;
SCCOL nCol2;
SCROW nRow2;
- sal_Bool bHasHeader;
- sal_Bool bByRow;
- sal_Bool bCaseSens;
- sal_Bool bNaturalSort;
- sal_Bool bUserDef;
- sal_uInt16 nUserIndex;
- sal_Bool bIncludePattern;
- sal_Bool bInplace;
+ bool bHasHeader;
+ bool bByRow;
+ bool bCaseSens;
+ bool bNaturalSort;
+ bool bUserDef;
+ sal_uInt16 nUserIndex;
+ bool bIncludePattern;
+ bool bInplace;
SCTAB nDestTab;
SCCOL nDestCol;
SCROW nDestRow;
- sal_Bool bDoSort[MAXSORT];
+ bool bDoSort[MAXSORT];
SCCOLROW nField[MAXSORT];
- sal_Bool bAscending[MAXSORT];
- ::com::sun::star::lang::Locale aCollatorLocale;
+ bool bAscending[MAXSORT];
+ ::com::sun::star::lang::Locale aCollatorLocale;
::rtl::OUString aCollatorAlgorithm;
- sal_uInt16 nCompatHeader;
+ sal_uInt16 nCompatHeader;
ScSortParam();
ScSortParam( const ScSortParam& r );
@@ -72,8 +71,8 @@ struct SC_DLLPUBLIC ScSortParam
/// TopTen sort
ScSortParam( const ScQueryParam&, SCCOL nCol );
- ScSortParam& operator= ( const ScSortParam& r );
- sal_Bool operator== ( const ScSortParam& rOther ) const;
+ ScSortParam& operator= ( const ScSortParam& r );
+ bool operator== ( const ScSortParam& rOther ) const;
void Clear ();
void MoveToDest();
diff --git a/sc/source/core/data/sortparam.cxx b/sc/source/core/data/sortparam.cxx
index 97cf97c8f6e9..2a933eb57473 100644
--- a/sc/source/core/data/sortparam.cxx
+++ b/sc/source/core/data/sortparam.cxx
@@ -84,7 +84,7 @@ void ScSortParam::Clear()
{
bDoSort[i] = false;
nField[i] = 0;
- bAscending[i] = sal_True;
+ bAscending[i] = true;
}
}
@@ -123,9 +123,9 @@ ScSortParam& ScSortParam::operator=( const ScSortParam& r )
//------------------------------------------------------------------------
-sal_Bool ScSortParam::operator==( const ScSortParam& rOther ) const
+bool ScSortParam::operator==( const ScSortParam& rOther ) const
{
- sal_Bool bEqual = false;
+ bool bEqual = false;
// Anzahl der Sorts gleich?
sal_uInt16 nLast = 0;
sal_uInt16 nOtherLast = 0;
@@ -155,7 +155,7 @@ sal_Bool ScSortParam::operator==( const ScSortParam& rOther ) const
&& (aCollatorAlgorithm == rOther.aCollatorAlgorithm)
)
{
- bEqual = sal_True;
+ bEqual = true;
for ( sal_uInt16 i=0; i<=nLast && bEqual; i++ )
{
bEqual = (nField[i] == rOther.nField[i]) && (bAscending[i] == rOther.bAscending[i]);
@@ -170,7 +170,7 @@ ScSortParam::ScSortParam( const ScSubTotalParam& rSub, const ScSortParam& rOld )
nCol1(rSub.nCol1),nRow1(rSub.nRow1),nCol2(rSub.nCol2),nRow2(rSub.nRow2),
bHasHeader(true),bByRow(true),bCaseSens(rSub.bCaseSens),bNaturalSort(rOld.bNaturalSort),
bUserDef(rSub.bUserDef),nUserIndex(rSub.nUserIndex),bIncludePattern(rSub.bIncludePattern),
- bInplace(sal_True),
+ bInplace(true),
nDestTab(0),nDestCol(0),nDestRow(0),
aCollatorLocale( rOld.aCollatorLocale ), aCollatorAlgorithm( rOld.aCollatorAlgorithm ),
nCompatHeader( rOld.nCompatHeader )
@@ -185,7 +185,7 @@ ScSortParam::ScSortParam( const ScSubTotalParam& rSub, const ScSortParam& rOld )
{
if (nNewCount < MAXSORT)
{
- bDoSort[nNewCount] = sal_True;
+ bDoSort[nNewCount] = true;
nField[nNewCount] = rSub.nField[i];
bAscending[nNewCount] = rSub.bAscending;
++nNewCount;
@@ -197,15 +197,15 @@ ScSortParam::ScSortParam( const ScSubTotalParam& rSub, const ScSortParam& rOld )
if (rOld.bDoSort[i])
{
SCCOLROW nThisField = rOld.nField[i];
- sal_Bool bDouble = false;
+ bool bDouble = false;
for (sal_uInt16 j=0; j<nNewCount; j++)
if ( nField[j] == nThisField )
- bDouble = sal_True;
+ bDouble = true;
if (!bDouble) // ein Feld nicht zweimal eintragen
{
if (nNewCount < MAXSORT)
{
- bDoSort[nNewCount] = sal_True;
+ bDoSort[nNewCount] = true;
nField[nNewCount] = nThisField;
bAscending[nNewCount] = rOld.bAscending[i];
++nNewCount;
@@ -217,7 +217,7 @@ ScSortParam::ScSortParam( const ScSubTotalParam& rSub, const ScSortParam& rOld )
{
bDoSort[i] = false;
nField[i] = 0;
- bAscending[i] = sal_True;
+ bAscending[i] = true;
}
}
@@ -232,14 +232,14 @@ ScSortParam::ScSortParam( const ScQueryParam& rParam, SCCOL nCol ) :
bInplace(true),
nDestTab(0),nDestCol(0),nDestRow(0), nCompatHeader(2)
{
- bDoSort[0] = sal_True;
+ bDoSort[0] = true;
nField[0] = nCol;
- bAscending[0] = sal_True;
+ bAscending[0] = true;
for (sal_uInt16 i=1; i<MAXSORT; i++)
{
bDoSort[i] = false;
nField[i] = 0;
- bAscending[i] = sal_True;
+ bAscending[i] = true;
}
}
@@ -262,7 +262,7 @@ void ScSortParam::MoveToDest()
else
nField[i] += nDifY;
- bInplace = sal_True;
+ bInplace = true;
}
else
{