[Libreoffice-commits] .: sc/inc sc/source

Kohei Yoshida kohei at kemper.freedesktop.org
Thu Mar 31 21:33:55 PDT 2011


 sc/inc/dbcolect.hxx              |  101 +++++++++++++++++++--------------------
 sc/source/core/tool/dbcolect.cxx |   24 ++++-----
 2 files changed, 62 insertions(+), 63 deletions(-)

New commits:
commit 2b3b897b4666b0700a4369eba3efe3c523dc2d4f
Author: Kohei Yoshida <kyoshida at novell.com>
Date:   Fri Apr 1 00:32:19 2011 -0400

    Prefer bool over sal_Bool in ScDBData.

diff --git a/sc/inc/dbcolect.hxx b/sc/inc/dbcolect.hxx
index ba0d7f6..8e4e28b 100644
--- a/sc/inc/dbcolect.hxx
+++ b/sc/inc/dbcolect.hxx
@@ -44,7 +44,6 @@ class ScDocument;
 
 class ScDBData : public ScDataObject, public ScRefreshTimer
 {
-
 private:
     // DBParam
     String			aName;
@@ -53,60 +52,60 @@ private:
     SCROW			nStartRow;
     SCCOL			nEndCol;
     SCROW			nEndRow;
-    sal_Bool			bByRow;
-    sal_Bool			bHasHeader;
-    sal_Bool			bDoSize;
-    sal_Bool			bKeepFmt;
-    sal_Bool			bStripData;
+    bool			bByRow;
+    bool			bHasHeader;
+    bool			bDoSize;
+    bool			bKeepFmt;
+    bool			bStripData;
     // SortParam
-    sal_Bool			bSortCaseSens;
-    sal_Bool			bSortNaturalSort;
-    sal_Bool			bIncludePattern;
-    sal_Bool			bSortInplace;
-    sal_Bool			bSortUserDef;
+    bool			bSortCaseSens;
+    bool			bSortNaturalSort;
+    bool			bIncludePattern;
+    bool			bSortInplace;
+    bool			bSortUserDef;
     sal_uInt16			nSortUserIndex;
     SCTAB			nSortDestTab;
     SCCOL			nSortDestCol;
     SCROW			nSortDestRow;
-    sal_Bool			bDoSort[MAXSORT];
+    bool			bDoSort[MAXSORT];
     SCCOLROW		nSortField[MAXSORT];
-    sal_Bool			bAscending[MAXSORT];
+    bool			bAscending[MAXSORT];
     ::com::sun::star::lang::Locale aSortLocale;
     String			aSortAlgorithm;
     // QueryParam
-    sal_Bool			bQueryInplace;
-    sal_Bool			bQueryCaseSens;
-    sal_Bool			bQueryRegExp;
-    sal_Bool			bQueryDuplicate;
+    bool			bQueryInplace;
+    bool			bQueryCaseSens;
+    bool			bQueryRegExp;
+    bool			bQueryDuplicate;
     SCTAB			nQueryDestTab;
     SCCOL			nQueryDestCol;
     SCROW			nQueryDestRow;
-    sal_Bool			bDoQuery[MAXQUERY];
+    bool			bDoQuery[MAXQUERY];
     SCCOLROW		nQueryField[MAXQUERY];
     ScQueryOp		eQueryOp[MAXQUERY];
-    sal_Bool			bQueryByString[MAXQUERY];
+    bool			bQueryByString[MAXQUERY];
     bool            bQueryByDate[MAXQUERY];
     String*			pQueryStr[MAXQUERY];
     double			nQueryVal[MAXQUERY];
     ScQueryConnect  eQueryConnect[MAXQUERY];
-    sal_Bool			bIsAdvanced;		// sal_True if created by advanced filter
+    bool			bIsAdvanced;		// sal_True if created by advanced filter
     ScRange			aAdvSource;			// source range
     SCROW           nDynamicEndRow;
 
     ScSubTotalParam maSubTotal;
 
     // data base import
-    sal_Bool			bDBImport;
+    bool			bDBImport;
     String			aDBName;
     String			aDBStatement;
-    sal_Bool			bDBNative;
-    sal_Bool			bDBSelection;		// not in Param: if selection, block update
-    sal_Bool			bDBSql;				// aDBStatement is SQL not a name
+    bool			bDBNative;
+    bool			bDBSelection;		// not in Param: if selection, block update
+    bool			bDBSql;				// aDBStatement is SQL not a name
     sal_uInt8			nDBType;			// enum DBObject (up to now only dbTable, dbQuery)
 
     sal_uInt16			nIndex; 			// unique index formulas
-    sal_Bool			bAutoFilter;		// AutoFilter? (not saved)
-    sal_Bool			bModified;			// is set/cleared for/by(?) UpdateReference
+    bool			bAutoFilter;		// AutoFilter? (not saved)
+    bool			bModified;			// is set/cleared for/by(?) UpdateReference
 
     using ScRefreshTimer::operator==;
 
@@ -114,7 +113,7 @@ public:
             SC_DLLPUBLIC ScDBData(const String& rName,
                      SCTAB nTab,
                      SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
-                     sal_Bool bByR = sal_True, sal_Bool bHasH = sal_True);
+                     bool bByR = sal_True, bool bHasH = sal_True);
             ScDBData(const ScDBData& rData);
             ~ScDBData();
 
@@ -122,7 +121,7 @@ public:
 
             ScDBData&	operator= (const ScDBData& rData);
 
-            sal_Bool		operator== (const ScDBData& rData) const;
+            bool		operator== (const ScDBData& rData) const;
 
             const String& GetName() const				{ return aName; }
             void		GetName(String& rName) const	{ rName = aName; }
@@ -132,18 +131,18 @@ public:
             void		SetArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
             void        SetDynamicEndRow(SCROW nRow);
             void		MoveTo(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
-            sal_Bool		IsByRow() const 				{ return bByRow; }
-            void		SetByRow(sal_Bool bByR) 			{ bByRow = bByR; }
-            sal_Bool		HasHeader() const 				{ return bHasHeader; }
-            void		SetHeader(sal_Bool bHasH) 			{ bHasHeader = bHasH; }
+            bool		IsByRow() const 				{ return bByRow; }
+            void		SetByRow(bool bByR) 			{ bByRow = bByR; }
+            bool		HasHeader() const 				{ return bHasHeader; }
+            void		SetHeader(bool bHasH) 			{ bHasHeader = bHasH; }
             void        SetIndex(sal_uInt16 nInd)           { nIndex = nInd; }
             sal_uInt16		GetIndex() const				{ return nIndex; }
-            sal_Bool		IsDoSize() const				{ return bDoSize; }
-            void		SetDoSize(sal_Bool bSet)			{ bDoSize = bSet; }
-            sal_Bool		IsKeepFmt() const				{ return bKeepFmt; }
-            void		SetKeepFmt(sal_Bool bSet)			{ bKeepFmt = bSet; }
-            sal_Bool		IsStripData() const				{ return bStripData; }
-            void		SetStripData(sal_Bool bSet)			{ bStripData = bSet; }
+            bool		IsDoSize() const				{ return bDoSize; }
+            void		SetDoSize(bool bSet)			{ bDoSize = bSet; }
+            bool		IsKeepFmt() const				{ return bKeepFmt; }
+            void		SetKeepFmt(bool bSet)			{ bKeepFmt = bSet; }
+            bool		IsStripData() const				{ return bStripData; }
+            void		SetStripData(bool bSet)			{ bStripData = bSet; }
 
             String		GetSourceString() const;
             String		GetOperations() const;
@@ -153,7 +152,7 @@ public:
 
             SC_DLLPUBLIC void		GetQueryParam(ScQueryParam& rQueryParam) const;
             SC_DLLPUBLIC void		SetQueryParam(const ScQueryParam& rQueryParam);
-            SC_DLLPUBLIC sal_Bool		GetAdvancedQuerySource(ScRange& rSource) const;
+            SC_DLLPUBLIC bool		GetAdvancedQuerySource(ScRange& rSource) const;
             SC_DLLPUBLIC void		SetAdvancedQuerySource(const ScRange* pSource);
 
             void		GetSubTotalParam(ScSubTotalParam& rSubTotalParam) const;
@@ -162,22 +161,22 @@ public:
             void		GetImportParam(ScImportParam& rImportParam) const;
             void		SetImportParam(const ScImportParam& rImportParam);
 
-            sal_Bool		IsDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_Bool bStartOnly) const;
-            sal_Bool		IsDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const;
+            bool		IsDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly) const;
+            bool		IsDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const;
 
-            sal_Bool		HasImportParam() const	 { return bDBImport; }
-            sal_Bool		HasQueryParam() const	 { return bDoQuery[0]; }
-            sal_Bool		HasSortParam() const	 { return bDoSort[0]; }
-            sal_Bool		HasSubTotalParam() const { return maSubTotal.bGroupActive[0]; }
+            bool		HasImportParam() const	 { return bDBImport; }
+            bool		HasQueryParam() const	 { return bDoQuery[0]; }
+            bool		HasSortParam() const	 { return bDoSort[0]; }
+            bool		HasSubTotalParam() const { return maSubTotal.bGroupActive[0]; }
 
-            sal_Bool		HasImportSelection() const		{ return bDBSelection; }
-            void		SetImportSelection(sal_Bool bSet)	{ bDBSelection = bSet; }
+            bool		HasImportSelection() const		{ return bDBSelection; }
+            void		SetImportSelection(bool bSet)	{ bDBSelection = bSet; }
 
-            sal_Bool		HasAutoFilter() const 		{ return bAutoFilter; }
-            void		SetAutoFilter(sal_Bool bSet)	{ bAutoFilter = bSet; }
+            bool		HasAutoFilter() const 		{ return bAutoFilter; }
+            void		SetAutoFilter(bool bSet)	{ bAutoFilter = bSet; }
 
-            sal_Bool		IsModified() const			{ return bModified; }
-            void		SetModified(sal_Bool bMod)		{ bModified = bMod; }
+            bool		IsModified() const			{ return bModified; }
+            void		SetModified(bool bMod)		{ bModified = bMod; }
 
             void	UpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos );
             void	UpdateReference(ScDocument* pDoc, UpdateRefMode eUpdateRefMode,
diff --git a/sc/source/core/tool/dbcolect.cxx b/sc/source/core/tool/dbcolect.cxx
index be160de..ffb4066 100644
--- a/sc/source/core/tool/dbcolect.cxx
+++ b/sc/source/core/tool/dbcolect.cxx
@@ -55,7 +55,7 @@ using ::std::remove_if;
 ScDBData::ScDBData( const String& rName,
                     SCTAB nTab,
                     SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2,
-                    sal_Bool bByR, sal_Bool bHasH) :
+                    bool bByR, bool bHasH) :
     aName		(rName),
     nTable		(nTab),
     nStartCol	(nCol1),
@@ -222,7 +222,7 @@ ScDBData& ScDBData::operator= (const ScDBData& rData)
     return *this;
 }
 
-sal_Bool ScDBData::operator== (const ScDBData& rData) const
+bool ScDBData::operator== (const ScDBData& rData) const
 {
     //	Daten, die nicht in den Params sind
 
@@ -264,7 +264,7 @@ sal_Bool ScDBData::operator== (const ScDBData& rData) const
     if (!(aImport1 == aImport2))
         return false;
 
-    return sal_True;
+    return true;
 }
 
 ScDBData::~ScDBData()
@@ -476,7 +476,7 @@ void ScDBData::SetQueryParam(const ScQueryParam& rQueryParam)
                 !rQueryParam.GetEntry(MAXQUERY).bDoQuery,
                 "zuviele Eintraege bei ScDBData::SetQueryParam" );
 
-    //	set bIsAdvanced to sal_False for everything that is not from the
+    //	set bIsAdvanced to false for everything that is not from the
     //	advanced filter dialog
     bIsAdvanced = false;
 
@@ -507,13 +507,13 @@ void ScDBData::SetAdvancedQuerySource(const ScRange* pSource)
     if (pSource)
     {
         aAdvSource = *pSource;
-        bIsAdvanced = sal_True;
+        bIsAdvanced = true;
     }
     else
         bIsAdvanced = false;
 }
 
-sal_Bool ScDBData::GetAdvancedQuerySource(ScRange& rSource) const
+bool ScDBData::GetAdvancedQuerySource(ScRange& rSource) const
 {
     rSource = aAdvSource;
     return bIsAdvanced;
@@ -561,7 +561,7 @@ void ScDBData::SetImportParam(const ScImportParam& rImportParam)
     nDBType			= rImportParam.nType;
 }
 
-sal_Bool ScDBData::IsDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_Bool bStartOnly) const
+bool ScDBData::IsDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, bool bStartOnly) const
 {
     if (nTab == nTable)
     {
@@ -575,9 +575,9 @@ sal_Bool ScDBData::IsDBAtCursor(SCCOL nCol, SCROW nRow, SCTAB nTab, sal_Bool bSt
     return false;
 }
 
-sal_Bool ScDBData::IsDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const
+bool ScDBData::IsDBAtArea(SCTAB nTab, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2) const
 {
-    return (sal_Bool)((nTab == nTable)
+    return (bool)((nTab == nTable)
                     && (nCol1 == nStartCol) && (nRow1 == nStartRow)
                     && (nCol2 == nEndCol) && (nRow2 == nEndRow));
 }
@@ -608,7 +608,7 @@ void ScDBData::UpdateMoveTab(SCTAB nOldPos, SCTAB nNewPos)
                 ++nTab;
         }
 
-        sal_Bool bChanged = ( nTab != aRange.aStart.Tab() );
+        bool bChanged = ( nTab != aRange.aStart.Tab() );
         if (bChanged)
             SetArea( nTab, aRange.aStart.Col(), aRange.aStart.Row(),
                                     aRange.aEnd.Col(),aRange.aEnd .Row() );
@@ -633,7 +633,7 @@ void ScDBData::UpdateReference(ScDocument* pDoc, UpdateRefMode eUpdateRefMode,
     GetArea( theTab1, theCol1, theRow1, theCol2, theRow2 );
     theTab2 = theTab1;
 
-    sal_Bool bDoUpdate = ScRefUpdate::Update( pDoc, eUpdateRefMode,
+    bool bDoUpdate = ScRefUpdate::Update( pDoc, eUpdateRefMode,
                                             nCol1,nRow1,nTab1, nCol2,nRow2,nTab2, nDx,nDy,nDz,
                                             theCol1,theRow1,theTab1, theCol2,theRow2,theTab2 ) != UR_NOTHING;
     if (bDoUpdate)
@@ -651,7 +651,7 @@ void ScDBData::UpdateReference(ScDocument* pDoc, UpdateRefMode eUpdateRefMode,
             aRangeAdvSource.aEnd.Set( theCol2,theRow2,theTab2 );
             SetAdvancedQuerySource( &aRangeAdvSource );
 
-            bDoUpdate = sal_True;		// DBData is modified
+            bDoUpdate = true;		// DBData is modified
         }
     }
 


More information about the Libreoffice-commits mailing list