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

Kohei Yoshida kohei at kemper.freedesktop.org
Mon Jan 31 14:15:13 PST 2011


 sc/inc/dpsave.hxx              |  105 ++++++++++++++---------------
 sc/source/core/data/dpsave.cxx |  147 ++++++++++++++++++++---------------------
 2 files changed, 127 insertions(+), 125 deletions(-)

New commits:
commit 80a133359f60768f7eaff3a98c9ecddac4b2c2b1
Author: Sören Möller <soerenmoeller2001 at gmail.com>
Date:   Mon Jan 31 19:42:06 2011 +0100

    Replaced tools/solar.h types with sal types

diff --git a/sc/inc/dpsave.hxx b/sc/inc/dpsave.hxx
index 742ecd4..7ea7472 100644
--- a/sc/inc/dpsave.hxx
+++ b/sc/inc/dpsave.hxx
@@ -29,6 +29,7 @@
 #ifndef SC_DPSAVE_HXX
 #define SC_DPSAVE_HXX
 
+#include <sal/types.h>
 #include <tools/string.hxx>
 #include <tools/list.hxx>
 #include <com/sun/star/sheet/XDimensionsSupplier.hpp>
@@ -59,23 +60,23 @@ class ScDPSaveMember
 private:
     String		aName;
     ::std::auto_ptr<rtl::OUString> mpLayoutName; // custom name to be displayed in the table.
-    USHORT		nVisibleMode;
-    USHORT		nShowDetailsMode;
+    sal_uInt16		nVisibleMode;
+    sal_uInt16		nShowDetailsMode;
 
 public:
                             ScDPSaveMember(const String& rName);
                             ScDPSaveMember(const ScDPSaveMember& r);
                             ~ScDPSaveMember();
 
-    BOOL		 			operator== ( const ScDPSaveMember& r ) const;
+    bool		 			operator== ( const ScDPSaveMember& r ) const;
 
     const String&           GetName() const { return aName; }
-    BOOL                    HasIsVisible() const;
-    SC_DLLPUBLIC void					SetIsVisible(BOOL bSet);
-    BOOL                    GetIsVisible() const { return BOOL(nVisibleMode); }
-    BOOL                    HasShowDetails() const;
-    SC_DLLPUBLIC void					SetShowDetails(BOOL bSet);
-    BOOL                    GetShowDetails() const { return BOOL(nShowDetailsMode); }
+    bool                    HasIsVisible() const;
+    SC_DLLPUBLIC void					SetIsVisible(bool bSet);
+    bool                    GetIsVisible() const { return bool(nVisibleMode); }
+    bool                    HasShowDetails() const;
+    SC_DLLPUBLIC void					SetShowDetails(bool bSet);
+    bool                    GetShowDetails() const { return bool(nShowDetailsMode); }
 
     void                    SetName( const String& rNew );  // used if the source member was renamed (groups)
 
@@ -99,15 +100,15 @@ private:
     String*		pSelectedPage;
     ::std::auto_ptr<rtl::OUString> mpLayoutName;
     ::std::auto_ptr<rtl::OUString> mpSubtotalName;
-    BOOL		bIsDataLayout;
-    BOOL		bDupFlag;
-    USHORT		nOrientation;
-    USHORT		nFunction;			// enum GeneralFunction, for data dimensions
+    bool		bIsDataLayout;
+    bool		bDupFlag;
+    sal_uInt16		nOrientation;
+    sal_uInt16		nFunction;			// enum GeneralFunction, for data dimensions
     long		nUsedHierarchy;
-    USHORT		nShowEmptyMode;		//!	at level
-    BOOL		bSubTotalDefault;	//!	at level
+    sal_uInt16		nShowEmptyMode;		//!	at level
+    bool		bSubTotalDefault;	//!	at level
     long		nSubTotalCount;
-    USHORT*		pSubTotalFuncs;		// enum GeneralFunction
+    sal_uInt16*		pSubTotalFuncs;		// enum GeneralFunction
     ::com::sun::star::sheet::DataPilotFieldReference* pReferenceValue;
     ::com::sun::star::sheet::DataPilotFieldSortInfo*  pSortInfo;            // (level)
     ::com::sun::star::sheet::DataPilotFieldAutoShowInfo* pAutoShowInfo;     // (level)
@@ -120,32 +121,32 @@ private:
     MemberHash maMemberHash;
     MemberList maMemberList;
 public:
-                            ScDPSaveDimension(const String& rName, BOOL bDataLayout);
+                            ScDPSaveDimension(const String& rName, bool bDataLayout);
                             ScDPSaveDimension(const ScDPSaveDimension& r);
                             ~ScDPSaveDimension();
 
-    BOOL		 			operator== ( const ScDPSaveDimension& r ) const;
+    bool		 			operator== ( const ScDPSaveDimension& r ) const;
 
     const MemberList&       GetMembers() const { return maMemberList; }
     void					AddMember(ScDPSaveMember* pMember);
 
-    void					SetDupFlag(BOOL bSet)	{ bDupFlag = bSet; }
-    BOOL					GetDupFlag() const		{ return bDupFlag; }
+    void					SetDupFlag(bool bSet)	{ bDupFlag = bSet; }
+    bool					GetDupFlag() const		{ return bDupFlag; }
 
     const String&			GetName() const			{ return aName; }
-    BOOL					IsDataLayout() const	{ return bIsDataLayout; }
+    bool					IsDataLayout() const	{ return bIsDataLayout; }
 
     void                    SetName( const String& rNew );  // used if the source dim was renamed (groups)
 
-    void					SetOrientation(USHORT nNew);
-    void					SetSubTotals(long nCount, const USHORT* pFuncs);
+    void					SetOrientation(sal_uInt16 nNew);
+    void					SetSubTotals(long nCount, const sal_uInt16* pFuncs);
     long                    GetSubTotalsCount() const { return nSubTotalCount; }
-    USHORT                  GetSubTotalFunc(long nIndex) const { return pSubTotalFuncs[nIndex]; }
+    sal_uInt16                  GetSubTotalFunc(long nIndex) const { return pSubTotalFuncs[nIndex]; }
     bool                    HasShowEmpty() const;
-    void					SetShowEmpty(BOOL bSet);
-    BOOL                    GetShowEmpty() const { return BOOL(nShowEmptyMode); }
-    void					SetFunction(USHORT nNew);		// enum GeneralFunction
-    USHORT                  GetFunction() const { return nFunction; }
+    void					SetShowEmpty(bool bSet);
+    bool                    GetShowEmpty() const { return bool(nShowEmptyMode); }
+    void					SetFunction(sal_uInt16 nNew);		// enum GeneralFunction
+    sal_uInt16                  GetFunction() const { return nFunction; }
     void					SetUsedHierarchy(long nNew);
     long                    GetUsedHierarchy() const { return nUsedHierarchy; }
 
@@ -168,10 +169,10 @@ public:
     void                    SetLayoutInfo(const ::com::sun::star::sheet::DataPilotFieldLayoutInfo* pNew);
 
     void					SetCurrentPage( const String* pPage );		// NULL = no selection (all)
-    BOOL					HasCurrentPage() const;
+    bool					HasCurrentPage() const;
     const String&			GetCurrentPage() const;
 
-    USHORT					GetOrientation() const	{ return nOrientation; }
+    sal_uInt16					GetOrientation() const	{ return nOrientation; }
 
     ScDPSaveMember* 		GetExistingMemberByName(const String& rName);
 
@@ -205,12 +206,12 @@ class ScDPSaveData
 private:
     List		aDimList;
     ScDPDimensionSaveData* pDimensionData;      // settings that create new dimensions
-    USHORT		nColumnGrandMode;
-    USHORT		nRowGrandMode;
-    USHORT		nIgnoreEmptyMode;
-    USHORT		nRepeatEmptyMode;
-    BOOL        bFilterButton;      // not passed to DataPilotSource
-    BOOL        bDrillDown;         // not passed to DataPilotSource
+    sal_uInt16		nColumnGrandMode;
+    sal_uInt16		nRowGrandMode;
+    sal_uInt16		nIgnoreEmptyMode;
+    sal_uInt16		nRepeatEmptyMode;
+    bool        bFilterButton;      // not passed to DataPilotSource
+    bool        bDrillDown;         // not passed to DataPilotSource
     long      mnCacheId;
 
     /** if true, all dimensions already have all of their member instances
@@ -226,7 +227,7 @@ public:
 
     ScDPSaveData& 			operator= ( const ScDPSaveData& r );
 
-    BOOL		 			operator== ( const ScDPSaveData& r ) const;
+    bool		 			operator== ( const ScDPSaveData& r ) const;
 
     SC_DLLPUBLIC void                    SetGrandTotalName(const ::rtl::OUString& rName);
     SC_DLLPUBLIC const ::rtl::OUString*  GetGrandTotalName() const;
@@ -256,31 +257,31 @@ public:
 
     void                    RemoveDimensionByName(const String& rName);
 
-    ScDPSaveDimension*      GetInnermostDimension(USHORT nOrientation);
+    ScDPSaveDimension*      GetInnermostDimension(sal_uInt16 nOrientation);
     ScDPSaveDimension*      GetFirstDimension(::com::sun::star::sheet::DataPilotFieldOrientation eOrientation);
     long                    GetDataDimensionCount() const;
 
 
     void					SetPosition( ScDPSaveDimension* pDim, long nNew );
-    SC_DLLPUBLIC void					SetColumnGrand( BOOL bSet );
-    BOOL					GetColumnGrand() const { return BOOL(nColumnGrandMode); }
-    SC_DLLPUBLIC void					SetRowGrand( BOOL bSet );
-    BOOL					GetRowGrand() const { return BOOL(nRowGrandMode); }
-    void					SetIgnoreEmptyRows( BOOL bSet );
-    BOOL					GetIgnoreEmptyRows() const { return BOOL(nIgnoreEmptyMode); }
-    void					SetRepeatIfEmpty( BOOL bSet );
-    BOOL					GetRepeatIfEmpty() const { return BOOL(nRepeatEmptyMode); }
-
-    SC_DLLPUBLIC void                    SetFilterButton( BOOL bSet );
-    BOOL                    GetFilterButton() const { return bFilterButton; }
-    SC_DLLPUBLIC void                    SetDrillDown( BOOL bSet );
-    BOOL                    GetDrillDown() const { return bDrillDown; }
+    SC_DLLPUBLIC void					SetColumnGrand( bool bSet );
+    bool					GetColumnGrand() const { return bool(nColumnGrandMode); }
+    SC_DLLPUBLIC void					SetRowGrand( bool bSet );
+    bool					GetRowGrand() const { return bool(nRowGrandMode); }
+    void					SetIgnoreEmptyRows( bool bSet );
+    bool					GetIgnoreEmptyRows() const { return bool(nIgnoreEmptyMode); }
+    void					SetRepeatIfEmpty( bool bSet );
+    bool					GetRepeatIfEmpty() const { return bool(nRepeatEmptyMode); }
+
+    SC_DLLPUBLIC void                    SetFilterButton( bool bSet );
+    bool                    GetFilterButton() const { return bFilterButton; }
+    SC_DLLPUBLIC void                    SetDrillDown( bool bSet );
+    bool                    GetDrillDown() const { return bDrillDown; }
 
     void					WriteToSource( const com::sun::star::uno::Reference<
         com::sun::star::sheet::XDimensionsSupplier>& xSource );
     void					Refresh( const com::sun::star::uno::Reference<
                                             com::sun::star::sheet::XDimensionsSupplier>& xSource );
-    BOOL					IsEmpty() const;
+    bool					IsEmpty() const;
     inline long GetCacheId() const{ return mnCacheId; }
     inline void SetCacheId( long nCacheId ){ mnCacheId = nCacheId; }
     const ScDPDimensionSaveData* GetExistingDimensionData() const   { return pDimensionData; }
diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx
index 5502e39..28955de 100644
--- a/sc/source/core/data/dpsave.cxx
+++ b/sc/source/core/data/dpsave.cxx
@@ -40,6 +40,7 @@
 #include "unonames.hxx"
 #include "global.hxx"
 
+#include <sal/types.h>
 #include <tools/debug.hxx>
 
 #include <com/sun/star/sheet/GeneralFunction.hpp>
@@ -112,32 +113,32 @@ ScDPSaveMember::~ScDPSaveMember()
 {
 }
 
-BOOL ScDPSaveMember::operator== ( const ScDPSaveMember& r ) const
+bool ScDPSaveMember::operator== ( const ScDPSaveMember& r ) const
 {
     if ( aName			  != r.aName 			||
          nVisibleMode	  != r.nVisibleMode		||
          nShowDetailsMode != r.nShowDetailsMode )
-        return FALSE;
+        return false;
 
-    return TRUE;
+    return true;
 }
 
-BOOL ScDPSaveMember::HasIsVisible() const
+bool ScDPSaveMember::HasIsVisible() const
 {
     return nVisibleMode != SC_DPSAVEMODE_DONTKNOW;
 }
 
-void ScDPSaveMember::SetIsVisible(BOOL bSet)
+void ScDPSaveMember::SetIsVisible(bool bSet)
 {
     nVisibleMode = bSet;
 }
 
-BOOL ScDPSaveMember::HasShowDetails() const
+bool ScDPSaveMember::HasShowDetails() const
 {
     return nShowDetailsMode != SC_DPSAVEMODE_DONTKNOW;
 }
 
-void ScDPSaveMember::SetShowDetails(BOOL bSet)
+void ScDPSaveMember::SetShowDetails(bool bSet)
 {
     nShowDetailsMode = bSet;
 }
@@ -175,11 +176,11 @@ void ScDPSaveMember::WriteToSource( const uno::Reference<uno::XInterface>& xMemb
 
         if ( nVisibleMode != SC_DPSAVEMODE_DONTKNOW )
             lcl_SetBoolProperty( xMembProp,
-                    rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ISVISIBLE)), (BOOL)nVisibleMode );
+                    rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ISVISIBLE)), (bool)nVisibleMode );
 
         if ( nShowDetailsMode != SC_DPSAVEMODE_DONTKNOW )
             lcl_SetBoolProperty( xMembProp,
-                    rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_SHOWDETAILS)), (BOOL)nShowDetailsMode );
+                    rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_SHOWDETAILS)), (bool)nShowDetailsMode );
 
         if (mpLayoutName.get())
             ScUnoHelpFunctions::SetOptionalPropertyValue(xMembProp, SC_UNO_LAYOUTNAME, *mpLayoutName);
@@ -191,18 +192,18 @@ void ScDPSaveMember::WriteToSource( const uno::Reference<uno::XInterface>& xMemb
 
 // -----------------------------------------------------------------------
 
-ScDPSaveDimension::ScDPSaveDimension(const String& rName, BOOL bDataLayout) :
+ScDPSaveDimension::ScDPSaveDimension(const String& rName, bool bDataLayout) :
     aName( rName ),
     pSelectedPage( NULL ),
     mpLayoutName(NULL),
     mpSubtotalName(NULL),
     bIsDataLayout( bDataLayout ),
-    bDupFlag( FALSE ),
+    bDupFlag( false ),
     nOrientation( sheet::DataPilotFieldOrientation_HIDDEN ),
     nFunction( sheet::GeneralFunction_AUTO ),
     nUsedHierarchy( -1 ),
     nShowEmptyMode( SC_DPSAVEMODE_DONTKNOW ),
-    bSubTotalDefault( TRUE ),
+    bSubTotalDefault( true ),
     nSubTotalCount( 0 ),
     pSubTotalFuncs( NULL ),
     pReferenceValue( NULL ),
@@ -228,7 +229,7 @@ ScDPSaveDimension::ScDPSaveDimension(const ScDPSaveDimension& r) :
 {
     if ( nSubTotalCount && r.pSubTotalFuncs )
     {
-        pSubTotalFuncs = new USHORT[nSubTotalCount];
+        pSubTotalFuncs = new sal_uInt16[nSubTotalCount];
         for (long nSub=0; nSub<nSubTotalCount; nSub++)
             pSubTotalFuncs[nSub] = r.pSubTotalFuncs[nSub];
     }
@@ -278,7 +279,7 @@ ScDPSaveDimension::~ScDPSaveDimension()
     delete [] pSubTotalFuncs;
 }
 
-BOOL ScDPSaveDimension::operator== ( const ScDPSaveDimension& r ) const
+bool ScDPSaveDimension::operator== ( const ScDPSaveDimension& r ) const
 {
     if ( aName			  != r.aName			||
          bIsDataLayout    != r.bIsDataLayout	||
@@ -289,71 +290,71 @@ BOOL ScDPSaveDimension::operator== ( const ScDPSaveDimension& r ) const
          nShowEmptyMode   != r.nShowEmptyMode   ||
          bSubTotalDefault != r.bSubTotalDefault ||
          nSubTotalCount   != r.nSubTotalCount )
-        return FALSE;
+        return false;
 
     if ( nSubTotalCount && ( !pSubTotalFuncs || !r.pSubTotalFuncs ) )	// should not happen
-        return FALSE;
+        return false;
 
     long i;
     for (i=0; i<nSubTotalCount; i++)
         if ( pSubTotalFuncs[i] != r.pSubTotalFuncs[i] )
-            return FALSE;
+            return false;
 
     if (maMemberHash.size() != r.maMemberHash.size() )
-        return FALSE;
+        return false;
 
     MemberList::const_iterator a=maMemberList.begin();
     MemberList::const_iterator b=r.maMemberList.begin();
     for (; a != maMemberList.end() ; ++a, ++b)
         if (!(**a == **b))
-            return FALSE;
+            return false;
 
     if ( this->HasCurrentPage() && r.HasCurrentPage() )
     {
         if ( this->GetCurrentPage() != r.GetCurrentPage() )
         {
-            return FALSE;
+            return false;
         }
     }
     else if ( this->HasCurrentPage() || r.HasCurrentPage() )
     {
-        return FALSE;
+        return false;
     }
     if( pReferenceValue && r.pReferenceValue )
     {
         if ( !(*pReferenceValue == *r.pReferenceValue) )
         {
-            return FALSE;
+            return false;
         }
     }
     else if ( pReferenceValue || r.pReferenceValue )
     {
-        return FALSE;
+        return false;
     }
     if( this->pSortInfo && r.pSortInfo )
     {
         if ( !(*this->pSortInfo == *r.pSortInfo) )
         {
-            return FALSE;
+            return false;
         }
     }
     else if ( this->pSortInfo || r.pSortInfo )
     {
-        return FALSE;
+        return false;
     }
     if( this->pAutoShowInfo && r.pAutoShowInfo )
     {
         if ( !(*this->pAutoShowInfo == *r.pAutoShowInfo) )
         {
-            return FALSE;
+            return false;
         }
     }
     else if ( this->pAutoShowInfo || r.pAutoShowInfo )
     {
-        return FALSE;
+        return false;
     }
 
-    return TRUE;
+    return true;
 }
 
 void ScDPSaveDimension::AddMember(ScDPSaveMember* pMember)
@@ -382,26 +383,26 @@ void ScDPSaveDimension::SetName( const String& rNew )
     aName = rNew;
 }
 
-void ScDPSaveDimension::SetOrientation(USHORT nNew)
+void ScDPSaveDimension::SetOrientation(sal_uInt16 nNew)
 {
     nOrientation = nNew;
 }
 
-void ScDPSaveDimension::SetSubTotals(long nCount, const USHORT* pFuncs)
+void ScDPSaveDimension::SetSubTotals(long nCount, const sal_uInt16* pFuncs)
 {
     if (pSubTotalFuncs)
         delete [] pSubTotalFuncs;
     nSubTotalCount = nCount;
     if ( nCount && pFuncs )
     {
-        pSubTotalFuncs = new USHORT[nCount];
+        pSubTotalFuncs = new sal_uInt16[nCount];
         for (long i=0; i<nCount; i++)
             pSubTotalFuncs[i] = pFuncs[i];
     }
     else
         pSubTotalFuncs = NULL;
 
-    bSubTotalDefault = FALSE;
+    bSubTotalDefault = false;
 }
 
 bool ScDPSaveDimension::HasShowEmpty() const
@@ -409,12 +410,12 @@ bool ScDPSaveDimension::HasShowEmpty() const
     return nShowEmptyMode != SC_DPSAVEMODE_DONTKNOW;
 }
 
-void ScDPSaveDimension::SetShowEmpty(BOOL bSet)
+void ScDPSaveDimension::SetShowEmpty(bool bSet)
 {
     nShowEmptyMode = bSet;
 }
 
-void ScDPSaveDimension::SetFunction(USHORT nNew)
+void ScDPSaveDimension::SetFunction(sal_uInt16 nNew)
 {
     nFunction = nNew;
 }
@@ -510,7 +511,7 @@ void ScDPSaveDimension::SetCurrentPage( const String* pPage )
         pSelectedPage = NULL;
 }
 
-BOOL ScDPSaveDimension::HasCurrentPage() const
+bool ScDPSaveDimension::HasCurrentPage() const
 {
     return ( pSelectedPage != NULL );
 }
@@ -658,7 +659,7 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference<uno::XInterface>& xD
                 }
                 if ( nShowEmptyMode != SC_DPSAVEMODE_DONTKNOW )
                     lcl_SetBoolProperty( xLevProp,
-                        rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_SHOWEMPTY)), (BOOL)nShowEmptyMode );
+                        rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_SHOWEMPTY)), (bool)nShowEmptyMode );
 
                 if ( pSortInfo )
                     ScUnoHelpFunctions::SetOptionalPropertyValue(xLevProp, SC_UNO_SORTING, *pSortInfo);
@@ -745,8 +746,8 @@ ScDPSaveData::ScDPSaveData() :
     nRowGrandMode( SC_DPSAVEMODE_DONTKNOW ),
     nIgnoreEmptyMode( SC_DPSAVEMODE_DONTKNOW ),
     nRepeatEmptyMode( SC_DPSAVEMODE_DONTKNOW ),
-    bFilterButton( TRUE ),
-    bDrillDown( TRUE ),
+    bFilterButton( true ),
+    bDrillDown( true ),
     mnCacheId( -1),
     mbDimensionMembersBuilt(false),
     mpGrandTotalName(NULL)
@@ -790,7 +791,7 @@ ScDPSaveData& ScDPSaveData::operator= ( const ScDPSaveData& r )
     return *this;
 }
 
-BOOL ScDPSaveData::operator== ( const ScDPSaveData& r ) const
+bool ScDPSaveData::operator== ( const ScDPSaveData& r ) const
 {
     if ( nColumnGrandMode != r.nColumnGrandMode ||
          nRowGrandMode    != r.nRowGrandMode	||
@@ -800,20 +801,20 @@ BOOL ScDPSaveData::operator== ( const ScDPSaveData& r ) const
          mnCacheId		  != r.mnCacheId ||
          bDrillDown       != r.bDrillDown ||
          mbDimensionMembersBuilt != r.mbDimensionMembersBuilt)
-        return FALSE;
+        return false;
 
     if ( pDimensionData || r.pDimensionData )
         if ( !pDimensionData || !r.pDimensionData || !( *pDimensionData == *r.pDimensionData ) )
-            return FALSE;
+            return false;
 
-    ULONG nCount = aDimList.Count();
+    sal_uInt32 nCount = aDimList.Count();
     if ( nCount != r.aDimList.Count() )
-        return FALSE;
+        return false;
 
-    for (ULONG i=0; i<nCount; i++)
+    for (sal_uInt32 i=0; i<nCount; ++i)
         if ( !( *(ScDPSaveDimension*)aDimList.GetObject(i) ==
                 *(ScDPSaveDimension*)r.aDimList.GetObject(i) ) )
-            return FALSE;
+            return false;
 
     if (mpGrandTotalName.get())
     {
@@ -825,7 +826,7 @@ BOOL ScDPSaveData::operator== ( const ScDPSaveData& r ) const
     else if (r.mpGrandTotalName.get())
         return false;
 
-    return TRUE;
+    return true;
 }
 
 ScDPSaveData::~ScDPSaveData()
@@ -857,7 +858,7 @@ ScDPSaveDimension* ScDPSaveData::GetDimensionByName(const String& rName)
         if ( pDim->GetName() == rName && !pDim->IsDataLayout() )
             return pDim;
     }
-    ScDPSaveDimension* pNew = new ScDPSaveDimension( rName, FALSE );
+    ScDPSaveDimension* pNew = new ScDPSaveDimension( rName, false );
     aDimList.Insert( pNew, LIST_APPEND );
     return pNew;
 }
@@ -883,7 +884,7 @@ ScDPSaveDimension* ScDPSaveData::GetNewDimensionByName(const String& rName)
         if ( pDim->GetName() == rName && !pDim->IsDataLayout() )
             return DuplicateDimension(rName);
     }
-    ScDPSaveDimension* pNew = new ScDPSaveDimension( rName, FALSE );
+    ScDPSaveDimension* pNew = new ScDPSaveDimension( rName, false );
     aDimList.Insert( pNew, LIST_APPEND );
     return pNew;
 }
@@ -894,7 +895,7 @@ ScDPSaveDimension* ScDPSaveData::GetDataLayoutDimension()
     if (pDim)
         return pDim;
 
-    ScDPSaveDimension* pNew = new ScDPSaveDimension( String(), TRUE );
+    ScDPSaveDimension* pNew = new ScDPSaveDimension( String(), true );
     aDimList.Insert( pNew, LIST_APPEND );
     return pNew;
 }
@@ -918,7 +919,7 @@ ScDPSaveDimension* ScDPSaveData::DuplicateDimension(const String& rName)
 
     ScDPSaveDimension* pOld = GetDimensionByName( rName );
     ScDPSaveDimension* pNew = new ScDPSaveDimension( *pOld );
-    pNew->SetDupFlag( TRUE );
+    pNew->SetDupFlag( true );
     aDimList.Insert( pNew, LIST_APPEND );
     return pNew;
 }
@@ -941,12 +942,12 @@ void ScDPSaveData::RemoveDimensionByName(const String& rName)
 ScDPSaveDimension& ScDPSaveData::DuplicateDimension( const ScDPSaveDimension& rDim )
 {
     ScDPSaveDimension* pNew = new ScDPSaveDimension( rDim );
-    pNew->SetDupFlag( TRUE );
+    pNew->SetDupFlag( true );
     aDimList.Insert( pNew, LIST_APPEND );
     return *pNew;
 }
 
-ScDPSaveDimension* ScDPSaveData::GetInnermostDimension(USHORT nOrientation)
+ScDPSaveDimension* ScDPSaveData::GetInnermostDimension(sal_uInt16 nOrientation)
 {
     //  return the innermost dimension for the given orientation,
     //  excluding data layout dimension
@@ -993,12 +994,12 @@ void ScDPSaveData::SetPosition( ScDPSaveDimension* pDim, long nNew )
 {
     //	position (nNew) is counted within dimensions of the same orientation
 
-    USHORT nOrient = pDim->GetOrientation();
+    sal_uInt16 nOrient = pDim->GetOrientation();
 
     aDimList.Remove( pDim );
-    ULONG nCount = aDimList.Count();		// after remove
+    sal_uInt32 nCount = aDimList.Count();		// after remove
 
-    ULONG nInsPos = 0;
+    sal_uInt32 nInsPos = 0;
     while ( nNew > 0 && nInsPos < nCount )
     {
         if ( ((ScDPSaveDimension*)aDimList.GetObject(nInsPos))->GetOrientation() == nOrient )
@@ -1009,32 +1010,32 @@ void ScDPSaveData::SetPosition( ScDPSaveDimension* pDim, long nNew )
     aDimList.Insert( pDim, nInsPos );
 }
 
-void ScDPSaveData::SetColumnGrand(BOOL bSet)
+void ScDPSaveData::SetColumnGrand(bool bSet)
 {
     nColumnGrandMode = bSet;
 }
 
-void ScDPSaveData::SetRowGrand(BOOL bSet)
+void ScDPSaveData::SetRowGrand(bool bSet)
 {
     nRowGrandMode = bSet;
 }
 
-void ScDPSaveData::SetIgnoreEmptyRows(BOOL bSet)
+void ScDPSaveData::SetIgnoreEmptyRows(bool bSet)
 {
     nIgnoreEmptyMode = bSet;
 }
 
-void ScDPSaveData::SetRepeatIfEmpty(BOOL bSet)
+void ScDPSaveData::SetRepeatIfEmpty(bool bSet)
 {
     nRepeatEmptyMode = bSet;
 }
 
-void ScDPSaveData::SetFilterButton(BOOL bSet)
+void ScDPSaveData::SetFilterButton(bool bSet)
 {
     bFilterButton = bSet;
 }
 
-void ScDPSaveData::SetDrillDown(BOOL bSet)
+void ScDPSaveData::SetDrillDown(bool bSet)
 {
     bDrillDown = bSet;
 }
@@ -1077,10 +1078,10 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie
         {
             if ( nIgnoreEmptyMode != SC_DPSAVEMODE_DONTKNOW )
                 lcl_SetBoolProperty( xSourceProp,
-                    rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_IGNOREEMPTY)), (BOOL)nIgnoreEmptyMode );
+                    rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_IGNOREEMPTY)), (bool)nIgnoreEmptyMode );
             if ( nRepeatEmptyMode != SC_DPSAVEMODE_DONTKNOW )
                 lcl_SetBoolProperty( xSourceProp,
-                    rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_REPEATIFEMPTY)), (BOOL)nRepeatEmptyMode );
+                    rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_REPEATIFEMPTY)), (bool)nRepeatEmptyMode );
         }
         catch(uno::Exception&)
         {
@@ -1110,14 +1111,14 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie
 
             DBG_TRACESTR(pDim->GetName());
             
-            BOOL bData = pDim->IsDataLayout();
+            bool bData = pDim->IsDataLayout();
 
             //!	getByName for ScDPSource, including DataLayoutDimension !!!!!!!!
 
             uno::Reference<container::XNameAccess> xDimsName = xSource->getDimensions();
             uno::Reference<container::XIndexAccess> xIntDims = new ScNameToIndexAccess( xDimsName );
             long nIntCount = xIntDims->getCount();
-            BOOL bFound = FALSE;
+            bool bFound = false;
             for (long nIntDim=0; nIntDim<nIntCount && !bFound; nIntDim++)
             {
                 uno::Reference<uno::XInterface> xIntDim = ScUnoHelpFunctions::AnyToInterface( xIntDims->getByIndex(nIntDim) );
@@ -1135,7 +1136,7 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie
                 {
                     uno::Reference<container::XNamed> xDimName( xIntDim, uno::UNO_QUERY );
                     if ( xDimName.is() && xDimName->getName() == aName )
-                        bFound = TRUE;
+                        bFound = true;
                 }
 
                 if ( bFound )
@@ -1172,10 +1173,10 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie
         {
             if ( nColumnGrandMode != SC_DPSAVEMODE_DONTKNOW )
                 lcl_SetBoolProperty( xSourceProp,
-                    rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_COLUMNGRAND)), (BOOL)nColumnGrandMode );
+                    rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_COLUMNGRAND)), (bool)nColumnGrandMode );
             if ( nRowGrandMode != SC_DPSAVEMODE_DONTKNOW )
                 lcl_SetBoolProperty( xSourceProp,
-                    rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ROWGRAND)), (BOOL)nRowGrandMode );
+                    rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ROWGRAND)), (bool)nRowGrandMode );
         }
     }
     catch(uno::Exception&)
@@ -1184,16 +1185,16 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie
     }
 }
 
-BOOL ScDPSaveData::IsEmpty() const
+bool ScDPSaveData::IsEmpty() const
 {
     long nCount = aDimList.Count();
     for (long i=0; i<nCount; i++)
     {
         ScDPSaveDimension* pDim = (ScDPSaveDimension*)aDimList.GetObject(i);
         if ( pDim->GetOrientation() != sheet::DataPilotFieldOrientation_HIDDEN && !pDim->IsDataLayout() )
-            return FALSE;
+            return false;
     }
-    return TRUE;	// no entries that are not hidden
+    return true;	// no entries that are not hidden
 }
 
 ScDPDimensionSaveData* ScDPSaveData::GetDimensionData()
@@ -1286,13 +1287,13 @@ void ScDPSaveData::Refresh( const uno::Reference<sheet::XDimensionsSupplier>& xS
             uno::Reference<container::XNameAccess> xDimsName = xSource->getDimensions();
             uno::Reference<container::XIndexAccess> xIntDims = new ScNameToIndexAccess( xDimsName );
             long nIntCount = xIntDims->getCount();
-            BOOL bFound = FALSE;
+            bool bFound = false;
             for (long nIntDim=0; nIntDim<nIntCount && !bFound; nIntDim++)
             {
                 uno::Reference<uno::XInterface> xIntDim = ScUnoHelpFunctions::AnyToInterface( xIntDims->getByIndex(nIntDim) );
                 uno::Reference<container::XNamed> xDimName( xIntDim, uno::UNO_QUERY );
                 if ( xDimName.is() && xDimName->getName() == aName )
-                    bFound = TRUE;
+                    bFound = true;
             }
             if ( !bFound )
             {


More information about the Libreoffice-commits mailing list