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

Kohei Yoshida kohei at kemper.freedesktop.org
Tue Feb 14 20:06:32 PST 2012


 sc/inc/dpdimsave.hxx              |   21 +++++++++++++--------
 sc/source/core/data/dpdimsave.cxx |   24 +++++++++++++-----------
 sc/source/ui/unoobj/dapiuno.cxx   |    4 ++--
 sc/source/ui/view/dbfunc3.cxx     |    4 ++--
 4 files changed, 30 insertions(+), 23 deletions(-)

New commits:
commit d7ba94d506ef22967f627483ee0b89cb0ce61b99
Author: Kohei Yoshida <kohei.yoshida at suse.com>
Date:   Tue Feb 14 23:06:18 2012 -0500

    Get sc to build once again with debug=true.

diff --git a/sc/inc/dpdimsave.hxx b/sc/inc/dpdimsave.hxx
index 59857fd..8ed73ad 100644
--- a/sc/inc/dpdimsave.hxx
+++ b/sc/inc/dpdimsave.hxx
@@ -79,15 +79,15 @@ typedef ::std::vector<ScDPSaveGroupItem> ScDPSaveGroupItemVec;
 
 class SC_DLLPUBLIC ScDPSaveGroupDimension
 {
-    String                  aSourceDim;     // always the real source from the original data
-    String                  aGroupDimName;
+    rtl::OUString           aSourceDim;     // always the real source from the original data
+    rtl::OUString           aGroupDimName;
     ScDPSaveGroupItemVec    aGroups;
     ScDPNumGroupInfo        aDateInfo;
     sal_Int32               nDatePart;
 
 public:
-                ScDPSaveGroupDimension( const String& rSource, const String& rName );
-                ScDPSaveGroupDimension( const String& rSource, const String& rName, const ScDPNumGroupInfo& rDateInfo, sal_Int32 nPart );
+                ScDPSaveGroupDimension( const rtl::OUString& rSource, const rtl::OUString& rName );
+                ScDPSaveGroupDimension( const rtl::OUString& rSource, const rtl::OUString& rName, const ScDPNumGroupInfo& rDateInfo, sal_Int32 nPart );
                 ~ScDPSaveGroupDimension();
 
     void    AddToData( ScDPGroupTableData& rData ) const;
@@ -95,8 +95,8 @@ public:
     void    SetDateInfo( const ScDPNumGroupInfo& rInfo, sal_Int32 nPart );
 
     void    AddGroupItem( const ScDPSaveGroupItem& rItem );
-    const String& GetGroupDimName() const   { return aGroupDimName; }
-    const String& GetSourceDimName() const  { return aSourceDim; }
+    const rtl::OUString& GetGroupDimName() const { return aGroupDimName; }
+    const rtl::OUString& GetSourceDimName() const { return aSourceDim; }
 
     sal_Int32   GetDatePart() const             { return nDatePart; }
     const ScDPNumGroupInfo& GetDateInfo() const { return aDateInfo; }
@@ -150,8 +150,13 @@ public:
 
     void    WriteToData( ScDPGroupTableData& rData ) const;
 
-    String  CreateGroupDimName( const String& rSourceName, const ScDPObject& rObject, bool bAllowSource, const ::std::vector< String >* pDeletedNames );
-    String  CreateDateGroupDimName( sal_Int32 nDatePart, const ScDPObject& rObject, bool bAllowSource, const ::std::vector< String >* pDeletedNames );
+    String  CreateGroupDimName(
+        const rtl::OUString& rSourceName, const ScDPObject& rObject, bool bAllowSource,
+        const ::std::vector<rtl::OUString>* pDeletedNames );
+
+    String  CreateDateGroupDimName(
+        sal_Int32 nDatePart, const ScDPObject& rObject, bool bAllowSource,
+        const ::std::vector<rtl::OUString>* pDeletedNames );
 
     void    AddGroupDimension( const ScDPSaveGroupDimension& rGroupDim );
     void    ReplaceGroupDimension( const ScDPSaveGroupDimension& rGroupDim );
diff --git a/sc/source/core/data/dpdimsave.cxx b/sc/source/core/data/dpdimsave.cxx
index 10acf90..f2a7e10 100644
--- a/sc/source/core/data/dpdimsave.cxx
+++ b/sc/source/core/data/dpdimsave.cxx
@@ -123,14 +123,14 @@ void ScDPSaveGroupItem::AddToData( ScDPGroupDimension& rDataDim, SvNumberFormatt
 
 // ============================================================================
 
-ScDPSaveGroupDimension::ScDPSaveGroupDimension( const String& rSource, const String& rName ) :
+ScDPSaveGroupDimension::ScDPSaveGroupDimension( const rtl::OUString& rSource, const rtl::OUString& rName ) :
     aSourceDim( rSource ),
     aGroupDimName( rName ),
     nDatePart( 0 )
 {
 }
 
-ScDPSaveGroupDimension::ScDPSaveGroupDimension( const String& rSource, const String& rName, const ScDPNumGroupInfo& rDateInfo, sal_Int32 nPart ) :
+ScDPSaveGroupDimension::ScDPSaveGroupDimension( const rtl::OUString& rSource, const rtl::OUString& rName, const ScDPNumGroupInfo& rDateInfo, sal_Int32 nPart ) :
     aSourceDim( rSource ),
     aGroupDimName( rName ),
     aDateInfo( rDateInfo ),
@@ -337,15 +337,15 @@ namespace {
 
 struct ScDPSaveGroupDimNameFunc
 {
-    String              maDimName;
-    inline explicit     ScDPSaveGroupDimNameFunc( const String& rDimName ) : maDimName( rDimName ) {}
+    rtl::OUString       maDimName;
+    inline explicit     ScDPSaveGroupDimNameFunc( const rtl::OUString& rDimName ) : maDimName( rDimName ) {}
     inline bool         operator()( const ScDPSaveGroupDimension& rGroupDim ) const { return rGroupDim.GetGroupDimName() == maDimName; }
 };
 
 struct ScDPSaveGroupSourceNameFunc
 {
-    String              maSrcDimName;
-    inline explicit     ScDPSaveGroupSourceNameFunc( const String& rSrcDimName ) : maSrcDimName( rSrcDimName ) {}
+    rtl::OUString       maSrcDimName;
+    inline explicit     ScDPSaveGroupSourceNameFunc( const rtl::OUString& rSrcDimName ) : maSrcDimName( rSrcDimName ) {}
     inline bool         operator()( const ScDPSaveGroupDimension& rGroupDim ) const { return rGroupDim.GetSourceDimName() == maSrcDimName; }
 };
 
@@ -506,9 +506,9 @@ sal_Int32 ScDPDimensionSaveData::CollectDateParts( const String& rBaseDimName )
     return nParts;
 }
 
-String ScDPDimensionSaveData::CreateGroupDimName( const String& rSourceName,
+String ScDPDimensionSaveData::CreateGroupDimName( const rtl::OUString& rSourceName,
                                         const ScDPObject& rObject, bool bAllowSource,
-                                        const std::vector<String>* pDeletedNames )
+                                        const std::vector<rtl::OUString>* pDeletedNames )
 {
     // create a name for the new dimension by appending a number to the original
     // dimension's name
@@ -519,9 +519,9 @@ String ScDPDimensionSaveData::CreateGroupDimName( const String& rSourceName,
     const sal_Int32 nMaxAdd = 1000;     // limit the loop
     while ( nAdd <= nMaxAdd )
     {
-        String aDimName( rSourceName );
+        rtl::OUString aDimName( rSourceName );
         if ( !bUseSource )
-            aDimName.Append( String::CreateFromInt32( nAdd ) );
+            aDimName += rtl::OUString::valueOf(static_cast<sal_Int32>(nAdd));
         bool bExists = false;
 
         // look for existing group dimensions
@@ -553,7 +553,9 @@ String ScDPDimensionSaveData::CreateGroupDimName( const String& rSourceName,
     return EMPTY_STRING;
 }
 
-String ScDPDimensionSaveData::CreateDateGroupDimName( sal_Int32 nDatePart, const ScDPObject& rObject, bool bAllowSource, const ::std::vector< String >* pDeletedNames )
+String ScDPDimensionSaveData::CreateDateGroupDimName(
+    sal_Int32 nDatePart, const ScDPObject& rObject, bool bAllowSource,
+    const std::vector<rtl::OUString>* pDeletedNames )
 {
     using namespace ::com::sun::star::sheet::DataPilotFieldGroupBy;
     String aPartName;
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index efed717..7d9eea6 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -2760,9 +2760,9 @@ Reference < XDataPilotField > SAL_CALL ScDataPilotFieldObj::createDateGroup( con
         ScDPDimensionSaveData& rDimData = *aSaveData.GetDimensionData();
 
         // find source dimension name
-        const String& rDimName = pDim->GetName();
+        const rtl::OUString& rDimName = pDim->GetName();
         const ScDPSaveGroupDimension* pGroupDim = rDimData.GetNamedGroupDim( rDimName );
-        String aSrcDimName = pGroupDim ? pGroupDim->GetSourceDimName() : rDimName;
+        rtl::OUString aSrcDimName = pGroupDim ? pGroupDim->GetSourceDimName() : rDimName;
 
         // find a group dimension for the base field, or get numeric grouping
         pGroupDim = rDimData.GetFirstNamedGroupDim( aSrcDimName );
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 01a7563..ef66672 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -1006,11 +1006,11 @@ void ScDBFunc::DateGroupDataPilot( const ScDPNumGroupInfo& rInfo, sal_Int32 nPar
                 names which may be reused while recreating the groups.
                 Dimensions have to be removed from dimension save data and from
                 save data too. */
-            std::vector< String > aDeletedNames;
+            std::vector<rtl::OUString> aDeletedNames;
             const ScDPSaveGroupDimension* pExistingGroup = pDimData->GetGroupDimForBase( aBaseDimName );
             while ( pExistingGroup )
             {
-                String aGroupDimName = pExistingGroup->GetGroupDimName();
+                const rtl::OUString& aGroupDimName = pExistingGroup->GetGroupDimName();
                 pDimData->RemoveGroupDimension( aGroupDimName );     // pExistingGroup is deleted
 
                 // also remove SaveData settings for the dimension that no longer exists


More information about the Libreoffice-commits mailing list