[Libreoffice-commits] .: 6 commits - sc/inc sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Mon Jan 31 18:03:18 PST 2011
sc/inc/dpsave.hxx | 349 ++++++++++++++++++++-----------------
sc/source/core/data/dpsave.cxx | 201 +++++++++------------
sc/source/filter/excel/xipivot.cxx | 5
sc/source/filter/xml/xmldpimp.cxx | 3
sc/source/ui/unoobj/dapiuno.cxx | 11 -
sc/source/ui/view/dbfunc3.cxx | 4
sc/source/ui/view/gridwin.cxx | 5
7 files changed, 307 insertions(+), 271 deletions(-)
New commits:
commit 000bc293630164213aa5051d71c04febc0bf038c
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Mon Jan 31 21:01:50 2011 -0500
Use OUStringBuffer in case we need to modify string after creation.
diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx
index 26b8dc9..5333c4f 100644
--- a/sc/source/core/data/dpsave.cxx
+++ b/sc/source/core/data/dpsave.cxx
@@ -67,6 +67,7 @@ using namespace com::sun::star;
using ::com::sun::star::uno::Reference;
using ::com::sun::star::uno::Any;
using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
using ::rtl::OUStringHash;
using ::std::hash_map;
using ::std::auto_ptr;
@@ -1131,11 +1132,11 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie
{
if ( pDim->GetDupFlag() )
{
- String aNewName = pDim->GetName();
+ OUStringBuffer aBuf(pDim->GetName());
// different name for each duplication of a (real) dimension...
for (long j=0; j<=i; ++j) //! Test !!!!!!
- aNewName += '*'; //! modify name at creation of SaveDimension
+ aBuf.append(sal_Unicode('*')); //! modify name at creation of SaveDimension
uno::Reference<util::XCloneable> xCloneable( xIntDim, uno::UNO_QUERY );
DBG_ASSERT( xCloneable.is(), "cannot clone dimension" );
@@ -1145,7 +1146,7 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie
uno::Reference<container::XNamed> xNewName( xNew, uno::UNO_QUERY );
if (xNewName.is())
{
- xNewName->setName( aNewName );
+ xNewName->setName(aBuf.makeStringAndClear());
pDim->WriteToSource( xNew );
}
}
commit 7f3bbc606e14affbba8acecf650d3430f0591ed6
Author: Sören Möller <soerenmoeller2001 at gmail.com>
Date: Mon Jan 31 22:15:58 2011 +0100
Replaced tools/string with rtl::OUString in ScDPSaveData
diff --git a/sc/inc/dpsave.hxx b/sc/inc/dpsave.hxx
index f0270e0..f5e5f37 100644
--- a/sc/inc/dpsave.hxx
+++ b/sc/inc/dpsave.hxx
@@ -280,17 +280,17 @@ public:
* manages its life cycle; hence the caller must
* <i>not</i> delete this object.
*/
- ScDPSaveDimension* GetDimensionByName(const String& rName);
+ ScDPSaveDimension* GetDimensionByName(const ::rtl::OUString& rName);
SC_DLLPUBLIC ScDPSaveDimension* GetDataLayoutDimension();
SC_DLLPUBLIC ScDPSaveDimension* GetExistingDataLayoutDimension() const;
- ScDPSaveDimension* DuplicateDimension(const String& rName);
+ ScDPSaveDimension* DuplicateDimension(const ::rtl::OUString& rName);
SC_DLLPUBLIC ScDPSaveDimension& DuplicateDimension(const ScDPSaveDimension& rDim);
- SC_DLLPUBLIC ScDPSaveDimension* GetExistingDimensionByName(const String& rName) const;
- SC_DLLPUBLIC ScDPSaveDimension* GetNewDimensionByName(const String& rName);
+ SC_DLLPUBLIC ScDPSaveDimension* GetExistingDimensionByName(const ::rtl::OUString& rName) const;
+ SC_DLLPUBLIC ScDPSaveDimension* GetNewDimensionByName(const ::rtl::OUString& rName);
- void RemoveDimensionByName(const String& rName);
+ void RemoveDimensionByName(const ::rtl::OUString& rName);
ScDPSaveDimension* GetInnermostDimension(sal_uInt16 nOrientation);
ScDPSaveDimension* GetFirstDimension(::com::sun::star::sheet::DataPilotFieldOrientation eOrientation);
diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx
index 7815d74..26b8dc9 100644
--- a/sc/source/core/data/dpsave.cxx
+++ b/sc/source/core/data/dpsave.cxx
@@ -837,13 +837,13 @@ const OUString* ScDPSaveData::GetGrandTotalName() const
return mpGrandTotalName.get();
}
-ScDPSaveDimension* ScDPSaveData::GetDimensionByName(const String& rName)
+ScDPSaveDimension* ScDPSaveData::GetDimensionByName(const ::rtl::OUString& rName)
{
long nCount = aDimList.Count();
for (long i=0; i<nCount; i++)
{
ScDPSaveDimension* pDim = (ScDPSaveDimension*)aDimList.GetObject(i);
- if ( pDim->GetName() == ::rtl::OUString(rName) && !pDim->IsDataLayout() )
+ if ( pDim->GetName() == rName && !pDim->IsDataLayout() )
return pDim;
}
ScDPSaveDimension* pNew = new ScDPSaveDimension( rName, false );
@@ -851,25 +851,25 @@ ScDPSaveDimension* ScDPSaveData::GetDimensionByName(const String& rName)
return pNew;
}
-ScDPSaveDimension* ScDPSaveData::GetExistingDimensionByName(const String& rName) const
+ScDPSaveDimension* ScDPSaveData::GetExistingDimensionByName(const ::rtl::OUString& rName) const
{
long nCount = aDimList.Count();
for (long i=0; i<nCount; i++)
{
ScDPSaveDimension* pDim = (ScDPSaveDimension*)aDimList.GetObject(i);
- if ( pDim->GetName() == ::rtl::OUString(rName) && !pDim->IsDataLayout() )
+ if ( pDim->GetName() == rName && !pDim->IsDataLayout() )
return pDim;
}
return NULL; // don't create new
}
-ScDPSaveDimension* ScDPSaveData::GetNewDimensionByName(const String& rName)
+ScDPSaveDimension* ScDPSaveData::GetNewDimensionByName(const ::rtl::OUString& rName)
{
long nCount = aDimList.Count();
for (long i=0; i<nCount; i++)
{
ScDPSaveDimension* pDim = (ScDPSaveDimension*)aDimList.GetObject(i);
- if ( pDim->GetName() == ::rtl::OUString(rName) && !pDim->IsDataLayout() )
+ if ( pDim->GetName() == rName && !pDim->IsDataLayout() )
return DuplicateDimension(rName);
}
ScDPSaveDimension* pNew = new ScDPSaveDimension( rName, false );
@@ -883,7 +883,7 @@ ScDPSaveDimension* ScDPSaveData::GetDataLayoutDimension()
if (pDim)
return pDim;
- ScDPSaveDimension* pNew = new ScDPSaveDimension( String(), true );
+ ScDPSaveDimension* pNew = new ScDPSaveDimension( ::rtl::OUString(), true );
aDimList.Insert( pNew, LIST_APPEND );
return pNew;
}
@@ -900,7 +900,7 @@ ScDPSaveDimension* ScDPSaveData::GetExistingDataLayoutDimension() const
return NULL;
}
-ScDPSaveDimension* ScDPSaveData::DuplicateDimension(const String& rName)
+ScDPSaveDimension* ScDPSaveData::DuplicateDimension(const ::rtl::OUString& rName)
{
// always insert new
//! check if dimension is there?
@@ -912,13 +912,13 @@ ScDPSaveDimension* ScDPSaveData::DuplicateDimension(const String& rName)
return pNew;
}
-void ScDPSaveData::RemoveDimensionByName(const String& rName)
+void ScDPSaveData::RemoveDimensionByName(const ::rtl::OUString& rName)
{
long nCount = aDimList.Count();
for (long i=0; i<nCount; i++)
{
ScDPSaveDimension* pDim = (ScDPSaveDimension*)aDimList.GetObject(i);
- if ( pDim->GetName() == ::rtl::OUString(rName) && !pDim->IsDataLayout() )
+ if ( pDim->GetName() == rName && !pDim->IsDataLayout() )
{
delete pDim;
aDimList.Remove(i);
@@ -1219,8 +1219,8 @@ void ScDPSaveData::BuildAllDimensionMembers(ScDPTableData* pData)
for (sal_uInt32 i = 0; i < n; ++i)
{
ScDPSaveDimension* pDim = static_cast<ScDPSaveDimension*>(aDimList.GetObject(i));
- const String& rDimName = pDim->GetName();
- if (!rDimName.Len())
+ const ::rtl::OUString& rDimName = pDim->GetName();
+ if (!rDimName.getLength())
// empty dimension name. It must be data layout.
continue;
@@ -1235,7 +1235,7 @@ void ScDPSaveData::BuildAllDimensionMembers(ScDPTableData* pData)
for (size_t j = 0; j < mMemberCount; ++j)
{
const ScDPItemData* pMemberData = pData->GetMemberById( nDimIndex, rMembers[j] );
- String aMemName = pMemberData->GetString();
+ ::rtl::OUString aMemName = pMemberData->GetString();
if (pDim->GetExistingMemberByName(aMemName))
// this member instance already exists. nothing to do.
continue;
@@ -1285,7 +1285,7 @@ void ScDPSaveData::Refresh( const uno::Reference<sheet::XDimensionsSupplier>& xS
}
if ( !bFound )
{
- deletedDims.push_back( ::rtl::OUString(aName) );
+ deletedDims.push_back( aName );
aDimList.Remove(i);
DBG_TRACE( "\n Remove dim: \t" );
DBG_TRACESTR( String( aName ) );
commit 750e245c50ac0bac25305ed579bd3cc80963e916
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Mon Jan 31 20:50:54 2011 -0500
Remove unnecessary string copying.
When the original code creates a String instance from rtl::OUString one,
it's not good to create yet another OUString instance from the 2nd
String instance. Use the original OUString instance directly and
remove unnecessary string copying.
diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx
index 9a9fed3..a973b86 100644
--- a/sc/source/filter/excel/xipivot.cxx
+++ b/sc/source/filter/excel/xipivot.cxx
@@ -1010,8 +1010,8 @@ void XclImpPTField::ConvertPageField( ScDPSaveData& rSaveData ) const
DBG_ASSERT( maFieldInfo.mnAxes & EXC_SXVD_AXIS_PAGE, "XclImpPTField::ConvertPageField - no page field" );
if( ScDPSaveDimension* pSaveDim = ConvertRCPField( rSaveData ) )
{
- const rtl::OUString rOUStr = *GetItemName( maPageInfo.mnSelItem );
- pSaveDim->SetCurrentPage( &rOUStr );
+ const rtl::OUString aName = *GetItemName( maPageInfo.mnSelItem );
+ pSaveDim->SetCurrentPage( &aName );
}
}
diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx
index 1b88a6f..63f6375 100644
--- a/sc/source/filter/xml/xmldpimp.cxx
+++ b/sc/source/filter/xml/xmldpimp.cxx
@@ -1044,8 +1044,7 @@ void ScXMLDataPilotFieldContext::EndElement()
pDim->SetOrientation(nOrientation);
if (bSelectedPage)
{
- const ::rtl::OUString sPage(sSelectedPage);
- pDim->SetCurrentPage(&sPage);
+ pDim->SetCurrentPage(&sSelectedPage);
}
pDataPilotTable->AddDimension(pDim, mbHasHiddenMember);
if (bIsGroupField)
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index bf17ac5..7e6acff 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -1515,14 +1515,13 @@ ScDPSaveDimension* ScDataPilotChildObjBase::GetDPDimension( ScDPObject** ppDPObj
return pSaveData->GetDimensionByName( maFieldId.maFieldName );
// find dimension with specified index (search in duplicated dimensions)
- String aFieldName = maFieldId.maFieldName; // needed for comparison
const List& rDimensions = pSaveData->GetDimensions();
ULONG nDimCount = rDimensions.Count();
sal_Int32 nFoundIdx = 0;
for( ULONG nDim = 0; nDim < nDimCount; ++nDim )
{
ScDPSaveDimension* pDim = static_cast< ScDPSaveDimension* >( rDimensions.GetObject( nDim ) );
- if( !pDim->IsDataLayout() && (pDim->GetName() == ::rtl::OUString(aFieldName)) )
+ if( !pDim->IsDataLayout() && (pDim->GetName() == maFieldId.maFieldName) )
{
if( nFoundIdx == maFieldId.mnFieldIdx )
return pDim;
@@ -2078,14 +2077,13 @@ void ScDataPilotFieldObj::setOrientation(DataPilotFieldOrientation eNew)
// look for existing duplicate with orientation "hidden"
- String aNameStr( maFieldId.maFieldName );
const List& rDimensions = pSaveData->GetDimensions();
sal_Int32 nDimCount = rDimensions.Count();
sal_Int32 nFound = 0;
for ( sal_Int32 nDim = 0; nDim < nDimCount && !pNewDim; nDim++ )
{
ScDPSaveDimension* pOneDim = static_cast<ScDPSaveDimension*>(rDimensions.GetObject(nDim));
- if ( !pOneDim->IsDataLayout() && (pOneDim->GetName() == ::rtl::OUString(aNameStr)) )
+ if ( !pOneDim->IsDataLayout() && (pOneDim->GetName() == maFieldId.maFieldName) )
{
if ( pOneDim->GetOrientation() == DataPilotFieldOrientation_HIDDEN )
pNewDim = pOneDim; // use this one
@@ -2237,8 +2235,7 @@ void ScDataPilotFieldObj::setCurrentPage( const OUString& rPage )
ScDPObject* pDPObj = 0;
if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) )
{
- const ::rtl::OUString aPage( rPage );
- pDim->SetCurrentPage( &aPage );
+ pDim->SetCurrentPage( &rPage );
SetDPObject( pDPObj );
}
}
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 9832c50..f5c3978 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -1534,7 +1534,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const String& rString )
{
if (rString.Len())
{
- if (::rtl::OUString(rString).equalsIgnoreAsciiCase(pDim->GetName()))
+ if (pDim->GetName().equalsIgnoreAsciiCase(rString))
{
pDim->RemoveLayoutName();
bChange = true;
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index d7e4070..6d86f2f 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -564,8 +564,8 @@ void ScGridWindow::ExecPageFieldSelect( SCCOL nCol, SCROW nRow, BOOL bHasSelecti
if ( bHasSelection )
{
- const ::rtl::OUString rOUStr = rStr;
- pDim->SetCurrentPage( &rOUStr );
+ const ::rtl::OUString aName = rStr;
+ pDim->SetCurrentPage( &aName );
}
else
pDim->SetCurrentPage( NULL );
commit 0533d11984dc8d8bdfd767a2def5026be02fc423
Author: Sören Möller <soerenmoeller2001 at gmail.com>
Date: Mon Jan 31 21:57:02 2011 +0100
Replaced tools/string with ::rtl::OUString in ScDPSaveDimension
Changed comparisions and calls in different files
diff --git a/sc/inc/dpsave.hxx b/sc/inc/dpsave.hxx
index 601c99b..f0270e0 100644
--- a/sc/inc/dpsave.hxx
+++ b/sc/inc/dpsave.hxx
@@ -102,8 +102,8 @@ bool operator == (const ::com::sun::star::sheet::DataPilotFieldReference &l, con
class SC_DLLPUBLIC ScDPSaveDimension
{
private:
- String aName;
- String* pSelectedPage;
+ ::rtl::OUString aName;
+ ::rtl::OUString* pSelectedPage;
::std::auto_ptr<rtl::OUString> mpLayoutName;
::std::auto_ptr<rtl::OUString> mpSubtotalName;
bool bIsDataLayout;
@@ -121,7 +121,7 @@ private:
::com::sun::star::sheet::DataPilotFieldLayoutInfo* pLayoutInfo; // (level)
public:
- typedef std::hash_map <String, ScDPSaveMember*, rtl::OUStringHash> MemberHash;
+ typedef std::hash_map <rtl::OUString, ScDPSaveMember*, rtl::OUStringHash> MemberHash;
typedef std::list <ScDPSaveMember*> MemberList;
private:
@@ -129,7 +129,7 @@ private:
MemberList maMemberList;
public:
- ScDPSaveDimension(const String& rName, bool bDataLayout);
+ ScDPSaveDimension(const ::rtl::OUString& rName, bool bDataLayout);
ScDPSaveDimension(const ScDPSaveDimension& r);
~ScDPSaveDimension();
@@ -146,13 +146,13 @@ public:
bool GetDupFlag() const
{ return bDupFlag; }
- const String& GetName() const
+ const ::rtl::OUString& GetName() const
{ return aName; }
bool IsDataLayout() const
{ return bIsDataLayout; }
- void SetName( const String& rNew ); // used if the source dim was renamed (groups)
+ void SetName( const ::rtl::OUString& rNew ); // used if the source dim was renamed (groups)
void SetOrientation(sal_uInt16 nNew);
void SetSubTotals(long nCount, const sal_uInt16* pFuncs);
@@ -201,14 +201,14 @@ public:
void SetLayoutInfo(const ::com::sun::star::sheet::DataPilotFieldLayoutInfo* pNew);
- void SetCurrentPage( const String* pPage ); // NULL = no selection (all)
+ void SetCurrentPage( const ::rtl::OUString* pPage ); // NULL = no selection (all)
bool HasCurrentPage() const;
- const String& GetCurrentPage() const;
+ const ::rtl::OUString& GetCurrentPage() const;
sal_uInt16 GetOrientation() const
{ return nOrientation; }
- ScDPSaveMember* GetExistingMemberByName(const String& rName);
+ ScDPSaveMember* GetExistingMemberByName(const ::rtl::OUString& rName);
/**
* Get a member object by its name. If one doesn't exist, creat a new
@@ -219,13 +219,13 @@ public:
*
* @return pointer to the member object.
*/
- ScDPSaveMember* GetMemberByName(const String& rName);
+ ScDPSaveMember* GetMemberByName(const ::rtl::OUString& rName);
- void SetMemberPosition( const String& rName, sal_Int32 nNewPos );
+ void SetMemberPosition( const ::rtl::OUString& rName, sal_Int32 nNewPos );
void WriteToSource( const com::sun::star::uno::Reference<com::sun::star::uno::XInterface>& xDim );
void Refresh( const com::sun::star::uno::Reference<com::sun::star::sheet::XDimensionsSupplier>& xSource ,
- const std::list<String> & deletedDims);
+ const std::list<rtl::OUString> & deletedDims);
void UpdateMemberVisibility(const ::std::hash_map< ::rtl::OUString, bool, ::rtl::OUStringHash>& rData);
diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx
index 5807501..7815d74 100644
--- a/sc/source/core/data/dpsave.cxx
+++ b/sc/source/core/data/dpsave.cxx
@@ -182,7 +182,7 @@ void ScDPSaveMember::WriteToSource( const uno::Reference<uno::XInterface>& xMemb
}
}
-ScDPSaveDimension::ScDPSaveDimension(const String& rName, bool bDataLayout) :
+ScDPSaveDimension::ScDPSaveDimension(const ::rtl::OUString& rName, bool bDataLayout) :
aName( rName ),
pSelectedPage( NULL ),
mpLayoutName(NULL),
@@ -226,7 +226,7 @@ ScDPSaveDimension::ScDPSaveDimension(const ScDPSaveDimension& r) :
for (MemberList::const_iterator i=r.maMemberList.begin(); i != r.maMemberList.end() ; ++i)
{
- const String& rName = (*i)->GetName();
+ const ::rtl::OUString& rName = (*i)->GetName();
ScDPSaveMember* pNew = new ScDPSaveMember( **i );
maMemberHash[rName] = pNew;
maMemberList.push_back( pNew );
@@ -248,7 +248,7 @@ ScDPSaveDimension::ScDPSaveDimension(const ScDPSaveDimension& r) :
else
pLayoutInfo = NULL;
if (r.pSelectedPage)
- pSelectedPage = new String( *(r.pSelectedPage) );
+ pSelectedPage = new ::rtl::OUString( *(r.pSelectedPage) );
else
pSelectedPage = NULL;
if (r.mpLayoutName.get())
@@ -349,11 +349,11 @@ bool ScDPSaveDimension::operator== ( const ScDPSaveDimension& r ) const
void ScDPSaveDimension::AddMember(ScDPSaveMember* pMember)
{
- const String & rName = pMember->GetName();
+ const ::rtl::OUString & rName = pMember->GetName();
MemberHash::iterator aExisting = maMemberHash.find( rName );
if ( aExisting == maMemberHash.end() )
{
- std::pair< const String, ScDPSaveMember *> key( rName, pMember );
+ std::pair< const ::rtl::OUString, ScDPSaveMember *> key( rName, pMember );
maMemberHash.insert ( key );
}
else
@@ -365,7 +365,7 @@ void ScDPSaveDimension::AddMember(ScDPSaveMember* pMember)
maMemberList.push_back( pMember );
}
-void ScDPSaveDimension::SetName( const String& rNew )
+void ScDPSaveDimension::SetName( const ::rtl::OUString& rNew )
{
// Used only if the source dim was renamed (groups).
// For UI renaming of dimensions, the layout name must be used.
@@ -492,11 +492,11 @@ void ScDPSaveDimension::SetLayoutInfo(const sheet::DataPilotFieldLayoutInfo* pNe
pLayoutInfo = NULL;
}
-void ScDPSaveDimension::SetCurrentPage( const String* pPage )
+void ScDPSaveDimension::SetCurrentPage( const ::rtl::OUString* pPage )
{
delete pSelectedPage;
if (pPage)
- pSelectedPage = new String( *pPage );
+ pSelectedPage = new ::rtl::OUString( *pPage );
else
pSelectedPage = NULL;
}
@@ -506,14 +506,15 @@ bool ScDPSaveDimension::HasCurrentPage() const
return ( pSelectedPage != NULL );
}
-const String& ScDPSaveDimension::GetCurrentPage() const
+const ::rtl::OUString& ScDPSaveDimension::GetCurrentPage() const
{
+ static const ::rtl::OUString emptyOUString = ::rtl::OUString();
if (pSelectedPage)
return *pSelectedPage;
- return EMPTY_STRING;
+ return emptyOUString;
}
-ScDPSaveMember* ScDPSaveDimension::GetExistingMemberByName(const String& rName)
+ScDPSaveMember* ScDPSaveDimension::GetExistingMemberByName(const ::rtl::OUString& rName)
{
MemberHash::const_iterator res = maMemberHash.find (rName);
if (res != maMemberHash.end())
@@ -521,7 +522,7 @@ ScDPSaveMember* ScDPSaveDimension::GetExistingMemberByName(const String& rName)
return NULL;
}
-ScDPSaveMember* ScDPSaveDimension::GetMemberByName(const String& rName)
+ScDPSaveMember* ScDPSaveDimension::GetMemberByName(const ::rtl::OUString& rName)
{
MemberHash::const_iterator res = maMemberHash.find (rName);
if (res != maMemberHash.end())
@@ -533,7 +534,7 @@ ScDPSaveMember* ScDPSaveDimension::GetMemberByName(const String& rName)
return pNew;
}
-void ScDPSaveDimension::SetMemberPosition( const String& rName, sal_Int32 nNewPos )
+void ScDPSaveDimension::SetMemberPosition( const ::rtl::OUString& rName, sal_Int32 nNewPos )
{
ScDPSaveMember* pMember = GetMemberByName( rName ); // make sure it exists and is in the hash
@@ -708,7 +709,7 @@ void ScDPSaveDimension::UpdateMemberVisibility(const hash_map<OUString, bool, OU
for (; itrMem != itrMemEnd; ++itrMem)
{
ScDPSaveMember* pMem = *itrMem;
- const String& rMemName = pMem->GetName();
+ const ::rtl::OUString& rMemName = pMem->GetName();
DataMap::const_iterator itr = rData.find(rMemName);
if (itr != rData.end())
pMem->SetIsVisible(itr->second);
@@ -842,7 +843,7 @@ ScDPSaveDimension* ScDPSaveData::GetDimensionByName(const String& rName)
for (long i=0; i<nCount; i++)
{
ScDPSaveDimension* pDim = (ScDPSaveDimension*)aDimList.GetObject(i);
- if ( pDim->GetName() == rName && !pDim->IsDataLayout() )
+ if ( pDim->GetName() == ::rtl::OUString(rName) && !pDim->IsDataLayout() )
return pDim;
}
ScDPSaveDimension* pNew = new ScDPSaveDimension( rName, false );
@@ -856,7 +857,7 @@ ScDPSaveDimension* ScDPSaveData::GetExistingDimensionByName(const String& rName)
for (long i=0; i<nCount; i++)
{
ScDPSaveDimension* pDim = (ScDPSaveDimension*)aDimList.GetObject(i);
- if ( pDim->GetName() == rName && !pDim->IsDataLayout() )
+ if ( pDim->GetName() == ::rtl::OUString(rName) && !pDim->IsDataLayout() )
return pDim;
}
return NULL; // don't create new
@@ -868,7 +869,7 @@ ScDPSaveDimension* ScDPSaveData::GetNewDimensionByName(const String& rName)
for (long i=0; i<nCount; i++)
{
ScDPSaveDimension* pDim = (ScDPSaveDimension*)aDimList.GetObject(i);
- if ( pDim->GetName() == rName && !pDim->IsDataLayout() )
+ if ( pDim->GetName() == ::rtl::OUString(rName) && !pDim->IsDataLayout() )
return DuplicateDimension(rName);
}
ScDPSaveDimension* pNew = new ScDPSaveDimension( rName, false );
@@ -917,7 +918,7 @@ void ScDPSaveData::RemoveDimensionByName(const String& rName)
for (long i=0; i<nCount; i++)
{
ScDPSaveDimension* pDim = (ScDPSaveDimension*)aDimList.GetObject(i);
- if ( pDim->GetName() == rName && !pDim->IsDataLayout() )
+ if ( pDim->GetName() == ::rtl::OUString(rName) && !pDim->IsDataLayout() )
{
delete pDim;
aDimList.Remove(i);
@@ -1096,7 +1097,7 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie
ScDPSaveDimension* pDim = (ScDPSaveDimension*)aDimList.GetObject(i);
rtl::OUString aName = pDim->GetName();
- DBG_TRACESTR(pDim->GetName());
+ DBG_TRACESTR(String(pDim->GetName()));
bool bData = pDim->IsDataLayout();
@@ -1262,7 +1263,7 @@ void ScDPSaveData::Refresh( const uno::Reference<sheet::XDimensionsSupplier>& xS
try
{
long nCount = aDimList.Count();
- std::list<String> deletedDims;
+ std::list<rtl::OUString> deletedDims;
for (long i=nCount-1; i >=0 ; i--)
{
ScDPSaveDimension* pDim = (ScDPSaveDimension*)aDimList.GetObject(i);
@@ -1284,7 +1285,7 @@ void ScDPSaveData::Refresh( const uno::Reference<sheet::XDimensionsSupplier>& xS
}
if ( !bFound )
{
- deletedDims.push_back( aName );
+ deletedDims.push_back( ::rtl::OUString(aName) );
aDimList.Remove(i);
DBG_TRACE( "\n Remove dim: \t" );
DBG_TRACESTR( String( aName ) );
@@ -1314,7 +1315,7 @@ void ScDPSaveData::Refresh( const uno::Reference<sheet::XDimensionsSupplier>& xS
}
void ScDPSaveDimension::Refresh( const com::sun::star::uno::Reference<
com::sun::star::sheet::XDimensionsSupplier>& xSource ,
- const std::list<String>& deletedDims)
+ const std::list<rtl::OUString>& deletedDims)
{
if ( xSource.is() )
{
@@ -1329,7 +1330,7 @@ void ScDPSaveDimension::Refresh( const com::sun::star::uno::Reference<
return;
if ( pSelectedPage )
{//check pSelected page
- DBG_TRACESTR( (*pSelectedPage) );
+ DBG_TRACESTR( String(*pSelectedPage) );
if ( pCache->GetIdByItemData( nSrcDim, *pSelectedPage ) == -1 )
{
delete pSelectedPage;
@@ -1366,16 +1367,16 @@ void ScDPSaveDimension::Refresh( const com::sun::star::uno::Reference<
{
if( pReferenceValue->ReferenceItemType == DataPilotFieldReferenceItemType::NAMED )
{
- const String& sReferenceFieldName = pReferenceValue->ReferenceField;
- DBG_TRACESTR( sReferenceFieldName );
+ const ::rtl::OUString& sReferenceFieldName = pReferenceValue->ReferenceField;
+ DBG_TRACESTR( String(sReferenceFieldName) );
SCCOL nRefDim = pCache->GetDimensionIndex( sReferenceFieldName );
bool bValid = true;
if ( nRefDim == -1 )
bValid = false;
else if ( pReferenceValue->ReferenceType != sheet::DataPilotFieldReferenceType::RUNNING_TOTAL )
{ //running total has not reference item
- const String& sReferenceItemName = pReferenceValue->ReferenceItemName;
- DBG_TRACESTR( sReferenceItemName );
+ const ::rtl::OUString& sReferenceItemName = pReferenceValue->ReferenceItemName;
+ DBG_TRACESTR( String(sReferenceItemName) );
if ( pCache->GetIdByItemData( nRefDim, sReferenceItemName ) == -1 )
bValid = false;
}
@@ -1396,8 +1397,8 @@ void ScDPSaveDimension::Refresh( const com::sun::star::uno::Reference<
if ( pSortInfo->Mode == DataPilotFieldSortMode::DATA )
{
DBG_TRACE( "\n DataPilotFieldSortMode::DATA \n" );
- const String& sFieldDimName = pSortInfo->Field;
- std::list<String>::const_iterator iter = std::find( deletedDims.begin(), deletedDims.end(), sFieldDimName );
+ const ::rtl::OUString& sFieldDimName = pSortInfo->Field;
+ std::list<rtl::OUString>::const_iterator iter = std::find( deletedDims.begin(), deletedDims.end(), sFieldDimName );
if ( iter != deletedDims.end() && pCache->GetDimensionIndex( sFieldDimName ) == -1 )
{
pSortInfo->Mode = DataPilotFieldSortMode::MANUAL;
@@ -1408,8 +1409,8 @@ void ScDPSaveDimension::Refresh( const com::sun::star::uno::Reference<
if ( pAutoShowInfo )
{ //check autoshow
- const String& sFieldDimName = pAutoShowInfo->DataField;
- std::list<String>::const_iterator iter = std::find( deletedDims.begin(), deletedDims.end(), sFieldDimName );
+ const ::rtl::OUString& sFieldDimName = pAutoShowInfo->DataField;
+ std::list<rtl::OUString>::const_iterator iter = std::find( deletedDims.begin(), deletedDims.end(), sFieldDimName );
if ( iter != deletedDims.end() && pCache->GetDimensionIndex( sFieldDimName ) == -1 )
{
delete pAutoShowInfo;
diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx
index 957a947..9a9fed3 100644
--- a/sc/source/filter/excel/xipivot.cxx
+++ b/sc/source/filter/excel/xipivot.cxx
@@ -1009,7 +1009,10 @@ void XclImpPTField::ConvertPageField( ScDPSaveData& rSaveData ) const
{
DBG_ASSERT( maFieldInfo.mnAxes & EXC_SXVD_AXIS_PAGE, "XclImpPTField::ConvertPageField - no page field" );
if( ScDPSaveDimension* pSaveDim = ConvertRCPField( rSaveData ) )
- pSaveDim->SetCurrentPage( GetItemName( maPageInfo.mnSelItem ) );
+ {
+ const rtl::OUString rOUStr = *GetItemName( maPageInfo.mnSelItem );
+ pSaveDim->SetCurrentPage( &rOUStr );
+ }
}
// hidden fields --------------------------------------------------------------
diff --git a/sc/source/filter/xml/xmldpimp.cxx b/sc/source/filter/xml/xmldpimp.cxx
index dc644dc..1b88a6f 100644
--- a/sc/source/filter/xml/xmldpimp.cxx
+++ b/sc/source/filter/xml/xmldpimp.cxx
@@ -1044,7 +1044,7 @@ void ScXMLDataPilotFieldContext::EndElement()
pDim->SetOrientation(nOrientation);
if (bSelectedPage)
{
- String sPage(sSelectedPage);
+ const ::rtl::OUString sPage(sSelectedPage);
pDim->SetCurrentPage(&sPage);
}
pDataPilotTable->AddDimension(pDim, mbHasHiddenMember);
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index 5c3ad2c..bf17ac5 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -1522,7 +1522,7 @@ ScDPSaveDimension* ScDataPilotChildObjBase::GetDPDimension( ScDPObject** ppDPObj
for( ULONG nDim = 0; nDim < nDimCount; ++nDim )
{
ScDPSaveDimension* pDim = static_cast< ScDPSaveDimension* >( rDimensions.GetObject( nDim ) );
- if( !pDim->IsDataLayout() && (pDim->GetName() == aFieldName) )
+ if( !pDim->IsDataLayout() && (pDim->GetName() == ::rtl::OUString(aFieldName)) )
{
if( nFoundIdx == maFieldId.mnFieldIdx )
return pDim;
@@ -2085,7 +2085,7 @@ void ScDataPilotFieldObj::setOrientation(DataPilotFieldOrientation eNew)
for ( sal_Int32 nDim = 0; nDim < nDimCount && !pNewDim; nDim++ )
{
ScDPSaveDimension* pOneDim = static_cast<ScDPSaveDimension*>(rDimensions.GetObject(nDim));
- if ( !pOneDim->IsDataLayout() && (pOneDim->GetName() == aNameStr) )
+ if ( !pOneDim->IsDataLayout() && (pOneDim->GetName() == ::rtl::OUString(aNameStr)) )
{
if ( pOneDim->GetOrientation() == DataPilotFieldOrientation_HIDDEN )
pNewDim = pOneDim; // use this one
@@ -2237,7 +2237,7 @@ void ScDataPilotFieldObj::setCurrentPage( const OUString& rPage )
ScDPObject* pDPObj = 0;
if( ScDPSaveDimension* pDim = GetDPDimension( &pDPObj ) )
{
- String aPage( rPage );
+ const ::rtl::OUString aPage( rPage );
pDim->SetCurrentPage( &aPage );
SetDPObject( pDPObj );
}
@@ -2262,7 +2262,7 @@ void ScDataPilotFieldObj::setUseCurrentPage( sal_Bool bUse )
true, because it is still needed to set an explicit page name. */
if( !pDim->HasCurrentPage() )
{
- String aPage;
+ const ::rtl::OUString aPage;
pDim->SetCurrentPage( &aPage );
}
}
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 2d434e2..9832c50 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -1534,7 +1534,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const String& rString )
{
if (rString.Len())
{
- if (rString.EqualsIgnoreCaseAscii(pDim->GetName()))
+ if (::rtl::OUString(rString).equalsIgnoreAsciiCase(pDim->GetName()))
{
pDim->RemoveLayoutName();
bChange = true;
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 6cc6587..d7e4070 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -563,7 +563,10 @@ void ScGridWindow::ExecPageFieldSelect( SCCOL nCol, SCROW nRow, BOOL bHasSelecti
ScDPSaveDimension* pDim = aSaveData.GetDimensionByName(aDimName);
if ( bHasSelection )
- pDim->SetCurrentPage( &rStr );
+ {
+ const ::rtl::OUString rOUStr = rStr;
+ pDim->SetCurrentPage( &rOUStr );
+ }
else
pDim->SetCurrentPage( NULL );
commit ba9be812e3dca9f499d2aa91705925c1f40d8323
Author: Sören Möller <soerenmoeller2001 at gmail.com>
Date: Mon Jan 31 20:50:47 2011 +0100
Replaced tools/string with rtl::OUString in ScDPSaveMember
Corrected comparison with return value in dbfunc3.cxx
diff --git a/sc/inc/dpsave.hxx b/sc/inc/dpsave.hxx
index ffb870c..601c99b 100644
--- a/sc/inc/dpsave.hxx
+++ b/sc/inc/dpsave.hxx
@@ -29,6 +29,7 @@
#ifndef SC_DPSAVE_HXX
#define SC_DPSAVE_HXX
+#include <rtl/ustring.hxx>
#include <sal/types.h>
#include <tools/string.hxx>
#include <tools/list.hxx>
@@ -58,19 +59,19 @@ class ScDPTableData;
class ScDPSaveMember
{
private:
- String aName;
+ ::rtl::OUString aName;
::std::auto_ptr<rtl::OUString> mpLayoutName; // custom name to be displayed in the table.
sal_uInt16 nVisibleMode;
sal_uInt16 nShowDetailsMode;
public:
- ScDPSaveMember(const String& rName);
+ ScDPSaveMember(const ::rtl::OUString& rName);
ScDPSaveMember(const ScDPSaveMember& r);
~ScDPSaveMember();
bool operator== ( const ScDPSaveMember& r ) const;
- const String& GetName() const
+ const ::rtl::OUString& GetName() const
{ return aName; }
bool HasIsVisible() const;
@@ -83,7 +84,7 @@ public:
bool GetShowDetails() const
{ return bool(nShowDetailsMode); }
- void SetName( const String& rNew ); // used if the source member was renamed (groups)
+ void SetName( const ::rtl::OUString& rNew ); // used if the source member was renamed (groups)
SC_DLLPUBLIC void SetLayoutName( const ::rtl::OUString& rName );
SC_DLLPUBLIC const ::rtl::OUString* GetLayoutName() const;
diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx
index da8ce12..5807501 100644
--- a/sc/source/core/data/dpsave.cxx
+++ b/sc/source/core/data/dpsave.cxx
@@ -83,7 +83,7 @@ void lcl_SetBoolProperty( const uno::Reference<beans::XPropertySet>& xProp,
xProp->setPropertyValue( rName, uno::Any( &bValue, getBooleanCppuType() ) );
}
-ScDPSaveMember::ScDPSaveMember(const String& rName) :
+ScDPSaveMember::ScDPSaveMember(const ::rtl::OUString& rName) :
aName( rName ),
mpLayoutName(NULL),
nVisibleMode( SC_DPSAVEMODE_DONTKNOW ),
@@ -135,7 +135,7 @@ void ScDPSaveMember::SetShowDetails(bool bSet)
nShowDetailsMode = bSet;
}
-void ScDPSaveMember::SetName( const String& rNew )
+void ScDPSaveMember::SetName( const ::rtl::OUString& rNew )
{
// Used only if the source member was renamed (groups).
// For UI renaming of members, a layout name must be used.
diff --git a/sc/source/ui/view/dbfunc3.cxx b/sc/source/ui/view/dbfunc3.cxx
index 440eb22..2d434e2 100644
--- a/sc/source/ui/view/dbfunc3.cxx
+++ b/sc/source/ui/view/dbfunc3.cxx
@@ -1680,7 +1680,7 @@ void ScDBFunc::DataPilotInput( const ScAddress& rPos, const String& rString )
// already used.
if (rString.Len())
{
- if (rString.EqualsIgnoreCaseAscii(pMem->GetName()))
+ if (::rtl::OUString(rString).equalsIgnoreAsciiCase(pMem->GetName()))
{
pMem->RemoveLayoutName();
bChange = true;
commit c33ee8fe31afb5f9be82c23b7cb3a00ea668a114
Author: Sören Möller <soerenmoeller2001 at gmail.com>
Date: Mon Jan 31 20:30:59 2011 +0100
Cleaned up spacings in dpsave.hxx/.cxx
diff --git a/sc/inc/dpsave.hxx b/sc/inc/dpsave.hxx
index 7ea7472..ffb870c 100644
--- a/sc/inc/dpsave.hxx
+++ b/sc/inc/dpsave.hxx
@@ -51,130 +51,163 @@ class ScDPTableData;
// --------------------------------------------------------------------
//
-// classes to save Data Pilot settings
+// classes to save Data Pilot settings
//
class ScDPSaveMember
{
private:
- String aName;
+ String aName;
::std::auto_ptr<rtl::OUString> mpLayoutName; // custom name to be displayed in the table.
- sal_uInt16 nVisibleMode;
- sal_uInt16 nShowDetailsMode;
+ sal_uInt16 nVisibleMode;
+ sal_uInt16 nShowDetailsMode;
public:
- ScDPSaveMember(const String& rName);
- ScDPSaveMember(const ScDPSaveMember& r);
- ~ScDPSaveMember();
+ 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); }
+ const String& GetName() const
+ { return aName; }
- void SetName( const String& rNew ); // used if the source member was renamed (groups)
+ bool HasIsVisible() const;
+ SC_DLLPUBLIC void SetIsVisible(bool bSet);
+ bool GetIsVisible() const
+ { return bool(nVisibleMode); }
- SC_DLLPUBLIC void SetLayoutName( const ::rtl::OUString& rName );
+ 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)
+
+ SC_DLLPUBLIC void SetLayoutName( const ::rtl::OUString& rName );
SC_DLLPUBLIC const ::rtl::OUString* GetLayoutName() const;
- void RemoveLayoutName();
+ void RemoveLayoutName();
- void WriteToSource( const com::sun::star::uno::Reference<
- com::sun::star::uno::XInterface>& xMember,
- sal_Int32 nPosition );
+ void WriteToSource( const com::sun::star::uno::Reference<com::sun::star::uno::XInterface>& xMember,
+ sal_Int32 nPosition );
};
bool operator == (const ::com::sun::star::sheet::DataPilotFieldSortInfo &l, const ::com::sun::star::sheet::DataPilotFieldSortInfo &r );
bool operator == (const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo &l, const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo &r );
bool operator == (const ::com::sun::star::sheet::DataPilotFieldReference &l, const ::com::sun::star::sheet::DataPilotFieldReference &r );
+
class SC_DLLPUBLIC ScDPSaveDimension
{
private:
- String aName;
- String* pSelectedPage;
+ String aName;
+ String* pSelectedPage;
::std::auto_ptr<rtl::OUString> mpLayoutName;
::std::auto_ptr<rtl::OUString> mpSubtotalName;
- bool bIsDataLayout;
- bool bDupFlag;
- sal_uInt16 nOrientation;
- sal_uInt16 nFunction; // enum GeneralFunction, for data dimensions
- long nUsedHierarchy;
- sal_uInt16 nShowEmptyMode; //! at level
- bool bSubTotalDefault; //! at level
- long nSubTotalCount;
- sal_uInt16* pSubTotalFuncs; // enum GeneralFunction
+ bool bIsDataLayout;
+ bool bDupFlag;
+ sal_uInt16 nOrientation;
+ sal_uInt16 nFunction; // enum GeneralFunction, for data dimensions
+ long nUsedHierarchy;
+ sal_uInt16 nShowEmptyMode; //! at level
+ bool bSubTotalDefault; //! at level
+ long nSubTotalCount;
+ 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)
- ::com::sun::star::sheet::DataPilotFieldLayoutInfo* pLayoutInfo; // (level)
+ ::com::sun::star::sheet::DataPilotFieldSortInfo* pSortInfo; // (level)
+ ::com::sun::star::sheet::DataPilotFieldAutoShowInfo* pAutoShowInfo; // (level)
+ ::com::sun::star::sheet::DataPilotFieldLayoutInfo* pLayoutInfo; // (level)
public:
- typedef std::hash_map <String, ScDPSaveMember*, rtl::OUStringHash> MemberHash;
- typedef std::list <ScDPSaveMember*> MemberList;
+ typedef std::hash_map <String, ScDPSaveMember*, rtl::OUStringHash> MemberHash;
+ typedef std::list <ScDPSaveMember*> MemberList;
+
private:
MemberHash maMemberHash;
MemberList maMemberList;
+
public:
- ScDPSaveDimension(const String& rName, bool bDataLayout);
- ScDPSaveDimension(const ScDPSaveDimension& r);
- ~ScDPSaveDimension();
+ ScDPSaveDimension(const String& rName, bool bDataLayout);
+ ScDPSaveDimension(const ScDPSaveDimension& r);
+ ~ScDPSaveDimension();
+
+ 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; }
+
+ const String& GetName() const
+ { return aName; }
+
+ bool IsDataLayout() const
+ { return bIsDataLayout; }
+
+ void SetName( const String& rNew ); // used if the source dim was renamed (groups)
+
+ void SetOrientation(sal_uInt16 nNew);
+ void SetSubTotals(long nCount, const sal_uInt16* pFuncs);
+ long GetSubTotalsCount() const
+ { return nSubTotalCount; }
+
+ sal_uInt16 GetSubTotalFunc(long nIndex) const
+ { return pSubTotalFuncs[nIndex]; }
+
+ bool HasShowEmpty() const;
+ void SetShowEmpty(bool bSet);
+ bool GetShowEmpty() const
+ { return bool(nShowEmptyMode); }
- bool operator== ( const ScDPSaveDimension& r ) const;
+ void SetFunction(sal_uInt16 nNew); // enum GeneralFunction
+ sal_uInt16 GetFunction() const
+ { return nFunction; }
- const MemberList& GetMembers() const { return maMemberList; }
- void AddMember(ScDPSaveMember* pMember);
+ void SetUsedHierarchy(long nNew);
+ long GetUsedHierarchy() const
+ { return nUsedHierarchy; }
- void SetDupFlag(bool bSet) { bDupFlag = bSet; }
- bool GetDupFlag() const { return bDupFlag; }
+ void SetLayoutName(const ::rtl::OUString& rName);
+ const ::rtl::OUString* GetLayoutName() const;
+ void RemoveLayoutName();
+ void SetSubtotalName(const ::rtl::OUString& rName);
+ const ::rtl::OUString* GetSubtotalName() const;
- const String& GetName() const { return aName; }
- bool IsDataLayout() const { return bIsDataLayout; }
+ bool IsMemberNameInUse(const ::rtl::OUString& rName) const;
- void SetName( const String& rNew ); // used if the source dim was renamed (groups)
+ const ::com::sun::star::sheet::DataPilotFieldReference* GetReferenceValue() const
+ { return pReferenceValue; }
- void SetOrientation(sal_uInt16 nNew);
- void SetSubTotals(long nCount, const sal_uInt16* pFuncs);
- long GetSubTotalsCount() const { return nSubTotalCount; }
- sal_uInt16 GetSubTotalFunc(long nIndex) const { return pSubTotalFuncs[nIndex]; }
- bool HasShowEmpty() const;
- 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; }
+ void SetReferenceValue(const ::com::sun::star::sheet::DataPilotFieldReference* pNew);
- void SetLayoutName(const ::rtl::OUString& rName);
- const ::rtl::OUString* GetLayoutName() const;
- void RemoveLayoutName();
- void SetSubtotalName(const ::rtl::OUString& rName);
- const ::rtl::OUString* GetSubtotalName() const;
+ const ::com::sun::star::sheet::DataPilotFieldSortInfo* GetSortInfo() const
+ { return pSortInfo; }
- bool IsMemberNameInUse(const ::rtl::OUString& rName) const;
+ void SetSortInfo(const ::com::sun::star::sheet::DataPilotFieldSortInfo* pNew);
+ const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo* GetAutoShowInfo() const
+ { return pAutoShowInfo; }
- const ::com::sun::star::sheet::DataPilotFieldReference* GetReferenceValue() const { return pReferenceValue; }
- void SetReferenceValue(const ::com::sun::star::sheet::DataPilotFieldReference* pNew);
+ void SetAutoShowInfo(const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo* pNew);
+ const ::com::sun::star::sheet::DataPilotFieldLayoutInfo* GetLayoutInfo() const
+ { return pLayoutInfo; }
- const ::com::sun::star::sheet::DataPilotFieldSortInfo* GetSortInfo() const { return pSortInfo; }
- void SetSortInfo(const ::com::sun::star::sheet::DataPilotFieldSortInfo* pNew);
- const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo* GetAutoShowInfo() const { return pAutoShowInfo; }
- void SetAutoShowInfo(const ::com::sun::star::sheet::DataPilotFieldAutoShowInfo* pNew);
- const ::com::sun::star::sheet::DataPilotFieldLayoutInfo* GetLayoutInfo() const { return pLayoutInfo; }
- void SetLayoutInfo(const ::com::sun::star::sheet::DataPilotFieldLayoutInfo* pNew);
+ void SetLayoutInfo(const ::com::sun::star::sheet::DataPilotFieldLayoutInfo* pNew);
- void SetCurrentPage( const String* pPage ); // NULL = no selection (all)
- bool HasCurrentPage() const;
- const String& GetCurrentPage() const;
+ void SetCurrentPage( const String* pPage ); // NULL = no selection (all)
+ bool HasCurrentPage() const;
+ const String& GetCurrentPage() const;
- sal_uInt16 GetOrientation() const { return nOrientation; }
+ sal_uInt16 GetOrientation() const
+ { return nOrientation; }
- ScDPSaveMember* GetExistingMemberByName(const String& rName);
+ ScDPSaveMember* GetExistingMemberByName(const String& rName);
/**
* Get a member object by its name. If one doesn't exist, creat a new
@@ -185,55 +218,56 @@ public:
*
* @return pointer to the member object.
*/
- ScDPSaveMember* GetMemberByName(const String& rName);
+ ScDPSaveMember* GetMemberByName(const String& rName);
- void SetMemberPosition( const String& rName, sal_Int32 nNewPos );
+ void SetMemberPosition( const String& rName, sal_Int32 nNewPos );
- void WriteToSource( const com::sun::star::uno::Reference<
- com::sun::star::uno::XInterface>& xDim );
- void Refresh( const com::sun::star::uno::Reference<
- com::sun::star::sheet::XDimensionsSupplier>& xSource ,
- const std::list<String> & deletedDims);
+ void WriteToSource( const com::sun::star::uno::Reference<com::sun::star::uno::XInterface>& xDim );
+ void Refresh( const com::sun::star::uno::Reference<com::sun::star::sheet::XDimensionsSupplier>& xSource ,
+ const std::list<String> & deletedDims);
- void UpdateMemberVisibility(const ::std::hash_map< ::rtl::OUString, bool, ::rtl::OUStringHash>& rData);
+ void UpdateMemberVisibility(const ::std::hash_map< ::rtl::OUString, bool, ::rtl::OUStringHash>& rData);
- bool HasInvisibleMember() const;
+ bool HasInvisibleMember() const;
};
class ScDPSaveData
{
private:
- List aDimList;
- ScDPDimensionSaveData* pDimensionData; // settings that create new dimensions
- 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;
+ List aDimList;
+ ScDPDimensionSaveData* pDimensionData; // settings that create new dimensions
+ 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
* created. */
- bool mbDimensionMembersBuilt;
+ bool mbDimensionMembersBuilt;
::std::auto_ptr<rtl::OUString> mpGrandTotalName;
public:
- SC_DLLPUBLIC ScDPSaveData();
- ScDPSaveData(const ScDPSaveData& r);
- SC_DLLPUBLIC ~ScDPSaveData();
+ SC_DLLPUBLIC ScDPSaveData();
+ ScDPSaveData(const ScDPSaveData& r);
+ SC_DLLPUBLIC ~ScDPSaveData();
- ScDPSaveData& operator= ( const ScDPSaveData& r );
+ 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;
+ SC_DLLPUBLIC void SetGrandTotalName(const ::rtl::OUString& rName);
+ SC_DLLPUBLIC const ::rtl::OUString* GetGrandTotalName() const;
- const List& GetDimensions() const { return aDimList; }
- void AddDimension(ScDPSaveDimension* pDim) { aDimList.Insert(pDim, LIST_APPEND); }
+ const List& GetDimensions() const
+ { return aDimList; }
+
+ void AddDimension(ScDPSaveDimension* pDim)
+ { aDimList.Insert(pDim, LIST_APPEND); }
/**
* Get a dimension object by its name. <i>If one doesn't exist for the
@@ -245,59 +279,71 @@ public:
* manages its life cycle; hence the caller must
* <i>not</i> delete this object.
*/
- ScDPSaveDimension* GetDimensionByName(const String& rName);
- SC_DLLPUBLIC ScDPSaveDimension* GetDataLayoutDimension();
- SC_DLLPUBLIC ScDPSaveDimension* GetExistingDataLayoutDimension() const;
-
- ScDPSaveDimension* DuplicateDimension(const String& rName);
- SC_DLLPUBLIC ScDPSaveDimension& DuplicateDimension(const ScDPSaveDimension& rDim);
-
- SC_DLLPUBLIC ScDPSaveDimension* GetExistingDimensionByName(const String& rName) const;
- SC_DLLPUBLIC ScDPSaveDimension* GetNewDimensionByName(const String& rName);
-
- void RemoveDimensionByName(const String& rName);
-
- 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; }
-
- 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;
- inline long GetCacheId() const{ return mnCacheId; }
- inline void SetCacheId( long nCacheId ){ mnCacheId = nCacheId; }
- const ScDPDimensionSaveData* GetExistingDimensionData() const { return pDimensionData; }
- SC_DLLPUBLIC ScDPDimensionSaveData* GetDimensionData(); // create if not there
- void SetDimensionData( const ScDPDimensionSaveData* pNew ); // copied
- void BuildAllDimensionMembers(ScDPTableData* pData);
+ ScDPSaveDimension* GetDimensionByName(const String& rName);
+ SC_DLLPUBLIC ScDPSaveDimension* GetDataLayoutDimension();
+ SC_DLLPUBLIC ScDPSaveDimension* GetExistingDataLayoutDimension() const;
+
+ ScDPSaveDimension* DuplicateDimension(const String& rName);
+ SC_DLLPUBLIC ScDPSaveDimension& DuplicateDimension(const ScDPSaveDimension& rDim);
+
+ SC_DLLPUBLIC ScDPSaveDimension* GetExistingDimensionByName(const String& rName) const;
+ SC_DLLPUBLIC ScDPSaveDimension* GetNewDimensionByName(const String& rName);
+
+ void RemoveDimensionByName(const String& rName);
+
+ 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; }
+
+ 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;
+ inline long GetCacheId() const
+ { return mnCacheId; }
+
+ inline void SetCacheId( long nCacheId )
+ { mnCacheId = nCacheId; }
+
+ const ScDPDimensionSaveData* GetExistingDimensionData() const
+ { return pDimensionData; }
+
+ SC_DLLPUBLIC ScDPDimensionSaveData* GetDimensionData(); // create if not there
+ void SetDimensionData( const ScDPDimensionSaveData* pNew ); // copied
+ void BuildAllDimensionMembers(ScDPTableData* pData);
/**
* Check whether a dimension has one or more invisible members.
*
* @param rDimName dimension name
*/
- SC_DLLPUBLIC bool HasInvisibleMember(const ::rtl::OUString& rDimName) const;
+ SC_DLLPUBLIC bool HasInvisibleMember(const ::rtl::OUString& rDimName) const;
};
-
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx
index 28955de..da8ce12 100644
--- a/sc/source/core/data/dpsave.cxx
+++ b/sc/source/core/data/dpsave.cxx
@@ -29,8 +29,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sc.hxx"
-
-
// INCLUDE ---------------------------------------------------------------
#include "dpsave.hxx"
@@ -73,24 +71,18 @@ using ::rtl::OUStringHash;
using ::std::hash_map;
using ::std::auto_ptr;
-// -----------------------------------------------------------------------
-
-#define SC_DPSAVEMODE_NO 0
-#define SC_DPSAVEMODE_YES 1
-#define SC_DPSAVEMODE_DONTKNOW 2
-
-// -----------------------------------------------------------------------
+#define SC_DPSAVEMODE_NO 0
+#define SC_DPSAVEMODE_YES 1
+#define SC_DPSAVEMODE_DONTKNOW 2
void lcl_SetBoolProperty( const uno::Reference<beans::XPropertySet>& xProp,
const rtl::OUString& rName, sal_Bool bValue )
{
- //! move to ScUnoHelpFunctions?
+ //! move to ScUnoHelpFunctions?
xProp->setPropertyValue( rName, uno::Any( &bValue, getBooleanCppuType() ) );
}
-// -----------------------------------------------------------------------
-
ScDPSaveMember::ScDPSaveMember(const String& rName) :
aName( rName ),
mpLayoutName(NULL),
@@ -115,8 +107,8 @@ ScDPSaveMember::~ScDPSaveMember()
bool ScDPSaveMember::operator== ( const ScDPSaveMember& r ) const
{
- if ( aName != r.aName ||
- nVisibleMode != r.nVisibleMode ||
+ if ( aName != r.aName ||
+ nVisibleMode != r.nVisibleMode ||
nShowDetailsMode != r.nShowDetailsMode )
return false;
@@ -190,8 +182,6 @@ void ScDPSaveMember::WriteToSource( const uno::Reference<uno::XInterface>& xMemb
}
}
-// -----------------------------------------------------------------------
-
ScDPSaveDimension::ScDPSaveDimension(const String& rName, bool bDataLayout) :
aName( rName ),
pSelectedPage( NULL ),
@@ -281,18 +271,18 @@ ScDPSaveDimension::~ScDPSaveDimension()
bool ScDPSaveDimension::operator== ( const ScDPSaveDimension& r ) const
{
- if ( aName != r.aName ||
- bIsDataLayout != r.bIsDataLayout ||
- bDupFlag != r.bDupFlag ||
- nOrientation != r.nOrientation ||
- nFunction != r.nFunction ||
+ if ( aName != r.aName ||
+ bIsDataLayout != r.bIsDataLayout ||
+ bDupFlag != r.bDupFlag ||
+ nOrientation != r.nOrientation ||
+ nFunction != r.nFunction ||
nUsedHierarchy != r.nUsedHierarchy ||
nShowEmptyMode != r.nShowEmptyMode ||
bSubTotalDefault != r.bSubTotalDefault ||
- nSubTotalCount != r.nSubTotalCount )
+ nSubTotalCount != r.nSubTotalCount )
return false;
- if ( nSubTotalCount && ( !pSubTotalFuncs || !r.pSubTotalFuncs ) ) // should not happen
+ if ( nSubTotalCount && ( !pSubTotalFuncs || !r.pSubTotalFuncs ) ) // should not happen
return false;
long i;
@@ -531,7 +521,6 @@ ScDPSaveMember* ScDPSaveDimension::GetExistingMemberByName(const String& rName)
return NULL;
}
-
ScDPSaveMember* ScDPSaveDimension::GetMemberByName(const String& rName)
{
MemberHash::const_iterator res = maMemberHash.find (rName);
@@ -546,7 +535,7 @@ ScDPSaveMember* ScDPSaveDimension::GetMemberByName(const String& rName)
void ScDPSaveDimension::SetMemberPosition( const String& rName, sal_Int32 nNewPos )
{
- ScDPSaveMember* pMember = GetMemberByName( rName ); // make sure it exists and is in the hash
+ ScDPSaveMember* pMember = GetMemberByName( rName ); // make sure it exists and is in the hash
maMemberList.remove( pMember );
@@ -606,8 +595,8 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference<uno::XInterface>& xD
ScUnoHelpFunctions::SetOptionalPropertyValue(xDimProp, SC_UNO_FIELD_SUBTOTALNAME, *pSubTotalName);
}
- // Level loop outside of maMemberList loop
- // because SubTotals have to be set independently of known members
+ // Level loop outside of maMemberList loop
+ // because SubTotals have to be set independently of known members
long nCount = maMemberHash.size();
@@ -681,7 +670,7 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference<uno::XInterface>& xD
uno::Reference<container::XNameAccess> xMembers = xMembSupp->getMembers();
if ( xMembers.is() )
{
- sal_Int32 nPosition = -1; // set position only in manual mode
+ sal_Int32 nPosition = -1; // set position only in manual mode
if ( !pSortInfo || pSortInfo->Mode == sheet::DataPilotFieldSortMode::MANUAL )
nPosition = 0;
@@ -698,7 +687,7 @@ void ScDPSaveDimension::WriteToSource( const uno::Reference<uno::XInterface>& xD
pMember->WriteToSource( xMemberInt, nPosition );
if ( nPosition >= 0 )
- ++nPosition; // increase if initialized
+ ++nPosition; // increase if initialized
}
// missing member is no error
}
@@ -738,8 +727,6 @@ bool ScDPSaveDimension::HasInvisibleMember() const
return false;
}
-// -----------------------------------------------------------------------
-
ScDPSaveData::ScDPSaveData() :
pDimensionData( NULL ),
nColumnGrandMode( SC_DPSAVEMODE_DONTKNOW ),
@@ -794,12 +781,12 @@ ScDPSaveData& ScDPSaveData::operator= ( const ScDPSaveData& r )
bool ScDPSaveData::operator== ( const ScDPSaveData& r ) const
{
if ( nColumnGrandMode != r.nColumnGrandMode ||
- nRowGrandMode != r.nRowGrandMode ||
+ nRowGrandMode != r.nRowGrandMode ||
nIgnoreEmptyMode != r.nIgnoreEmptyMode ||
nRepeatEmptyMode != r.nRepeatEmptyMode ||
bFilterButton != r.bFilterButton ||
- mnCacheId != r.mnCacheId ||
- bDrillDown != r.bDrillDown ||
+ mnCacheId != r.mnCacheId ||
+ bDrillDown != r.bDrillDown ||
mbDimensionMembersBuilt != r.mbDimensionMembersBuilt)
return false;
@@ -872,7 +859,7 @@ ScDPSaveDimension* ScDPSaveData::GetExistingDimensionByName(const String& rName)
if ( pDim->GetName() == rName && !pDim->IsDataLayout() )
return pDim;
}
- return NULL; // don't create new
+ return NULL; // don't create new
}
ScDPSaveDimension* ScDPSaveData::GetNewDimensionByName(const String& rName)
@@ -914,8 +901,8 @@ ScDPSaveDimension* ScDPSaveData::GetExistingDataLayoutDimension() const
ScDPSaveDimension* ScDPSaveData::DuplicateDimension(const String& rName)
{
- // always insert new
- //! check if dimension is there?
+ // always insert new
+ //! check if dimension is there?
ScDPSaveDimension* pOld = GetDimensionByName( rName );
ScDPSaveDimension* pNew = new ScDPSaveDimension( *pOld );
@@ -949,8 +936,8 @@ ScDPSaveDimension& ScDPSaveData::DuplicateDimension( const ScDPSaveDimension& rD
ScDPSaveDimension* ScDPSaveData::GetInnermostDimension(sal_uInt16 nOrientation)
{
- // return the innermost dimension for the given orientation,
- // excluding data layout dimension
+ // return the innermost dimension for the given orientation,
+ // excluding data layout dimension
ScDPSaveDimension* pInner = NULL;
long nCount = aDimList.Count();
@@ -960,7 +947,7 @@ ScDPSaveDimension* ScDPSaveData::GetInnermostDimension(sal_uInt16 nOrientation)
if ( pDim->GetOrientation() == nOrientation && !pDim->IsDataLayout() )
pInner = pDim;
}
- return pInner; // the last matching one
+ return pInner; // the last matching one
}
ScDPSaveDimension* ScDPSaveData::GetFirstDimension(sheet::DataPilotFieldOrientation eOrientation)
@@ -992,12 +979,12 @@ long ScDPSaveData::GetDataDimensionCount() const
void ScDPSaveData::SetPosition( ScDPSaveDimension* pDim, long nNew )
{
- // position (nNew) is counted within dimensions of the same orientation
+ // position (nNew) is counted within dimensions of the same orientation
sal_uInt16 nOrient = pDim->GetOrientation();
aDimList.Remove( pDim );
- sal_uInt32 nCount = aDimList.Count(); // after remove
+ sal_uInt32 nCount = aDimList.Count(); // after remove
sal_uInt32 nInsPos = 0;
while ( nNew > 0 && nInsPos < nCount )
@@ -1065,14 +1052,14 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie
if (!xSource.is())
return;
- // source options must be first!
+ // source options must be first!
uno::Reference<beans::XPropertySet> xSourceProp( xSource, uno::UNO_QUERY );
DBG_ASSERT( xSourceProp.is(), "no properties at source" );
if ( xSourceProp.is() )
{
- // source options are not available for external sources
- //! use XPropertySetInfo to test for availability?
+ // source options are not available for external sources
+ //! use XPropertySetInfo to test for availability?
try
{
@@ -1096,9 +1083,9 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie
// exceptions in the other calls are errors
try
{
- // reset all orientations
- //! "forgetSettings" or similar at source ?????
- //! reset all duplicated dimensions, or reuse them below !!!
+ // reset all orientations
+ //! "forgetSettings" or similar at source ?????
+ //! reset all duplicated dimensions, or reuse them below !!!
DBG_TRACE( "ScDPSaveData::WriteToSource" );
lcl_ResetOrient( xSource );
@@ -1110,10 +1097,10 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie
rtl::OUString aName = pDim->GetName();
DBG_TRACESTR(pDim->GetName());
-
+
bool bData = pDim->IsDataLayout();
- //! getByName for ScDPSource, including DataLayoutDimension !!!!!!!!
+ //! getByName for ScDPSource, including DataLayoutDimension !!!!!!!!
uno::Reference<container::XNameAccess> xDimsName = xSource->getDimensions();
uno::Reference<container::XIndexAccess> xIntDims = new ScNameToIndexAccess( xDimsName );
@@ -1129,7 +1116,7 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie
{
bFound = ScUnoHelpFunctions::GetBoolProperty( xDimProp,
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(DP_PROP_ISDATALAYOUT)) );
- //! error checking -- is "IsDataLayoutDimension" property required??
+ //! error checking -- is "IsDataLayoutDimension" property required??
}
}
else
@@ -1146,8 +1133,8 @@ void ScDPSaveData::WriteToSource( const uno::Reference<sheet::XDimensionsSupplie
String aNewName = pDim->GetName();
// different name for each duplication of a (real) dimension...
- for (long j=0; j<=i; j++) //! Test !!!!!!
- aNewName += '*'; //! modify name at creation of SaveDimension
+ for (long j=0; j<=i; ++j) //! Test !!!!!!
+ aNewName += '*'; //! modify name at creation of SaveDimension
uno::Reference<util::XCloneable> xCloneable( xIntDim, uno::UNO_QUERY );
DBG_ASSERT( xCloneable.is(), "cannot clone dimension" );
@@ -1194,7 +1181,7 @@ bool ScDPSaveData::IsEmpty() const
if ( pDim->GetOrientation() != sheet::DataPilotFieldOrientation_HIDDEN && !pDim->IsDataLayout() )
return false;
}
- return true; // no entries that are not hidden
+ return true; // no entries that are not hidden
}
ScDPDimensionSaveData* ScDPSaveData::GetDimensionData()
@@ -1233,12 +1220,12 @@ void ScDPSaveData::BuildAllDimensionMembers(ScDPTableData* pData)
ScDPSaveDimension* pDim = static_cast<ScDPSaveDimension*>(aDimList.GetObject(i));
const String& rDimName = pDim->GetName();
if (!rDimName.Len())
- // empty dimension name. It must be data layout.
+ // empty dimension name. It must be data layout.
continue;
NameIndexMap::const_iterator itr = aMap.find(rDimName);
if (itr == itrEnd)
- // dimension name not in the data. This should never happen!
+ // dimension name not in the data. This should never happen!
continue;
long nDimIndex = itr->second;
@@ -1249,7 +1236,7 @@ void ScDPSaveData::BuildAllDimensionMembers(ScDPTableData* pData)
const ScDPItemData* pMemberData = pData->GetMemberById( nDimIndex, rMembers[j] );
String aMemName = pMemberData->GetString();
if (pDim->GetExistingMemberByName(aMemName))
- // this member instance already exists. nothing to do.
+ // this member instance already exists. nothing to do.
continue;
auto_ptr<ScDPSaveMember> pNewMember(new ScDPSaveMember(aMemName));
@@ -1300,13 +1287,13 @@ void ScDPSaveData::Refresh( const uno::Reference<sheet::XDimensionsSupplier>& xS
deletedDims.push_back( aName );
aDimList.Remove(i);
DBG_TRACE( "\n Remove dim: \t" );
- DBG_TRACESTR( String( aName ) );
+ DBG_TRACESTR( String( aName ) );
}
}
nCount = aDimList.Count();
- for (long i=nCount-1; i >=0 ; i--) //check every dimension ??
+ for (long i=nCount-1; i >=0 ; --i) //check every dimension ??
{
ScDPSaveDimension* pDim = (ScDPSaveDimension*)aDimList.GetObject(i);
@@ -1317,7 +1304,7 @@ void ScDPSaveData::Refresh( const uno::Reference<sheet::XDimensionsSupplier>& xS
}
- mbDimensionMembersBuilt = false; // there may be new members
+ mbDimensionMembersBuilt = false; // there may be new members
}
catch(uno::Exception&)
{
@@ -1337,7 +1324,7 @@ void ScDPSaveDimension::Refresh( const com::sun::star::uno::Reference<
return;
SCCOL nSrcDim = pCache->GetDimensionIndex( GetName() );
-
+
if ( nSrcDim == -1 )
return;
if ( pSelectedPage )
@@ -1377,7 +1364,7 @@ void ScDPSaveDimension::Refresh( const com::sun::star::uno::Reference<
case sheet::DataPilotFieldReferenceType::ITEM_PERCENTAGE_DIFFERENCE:
case sheet::DataPilotFieldReferenceType::RUNNING_TOTAL:
{
- if( pReferenceValue->ReferenceItemType == DataPilotFieldReferenceItemType::NAMED )
+ if( pReferenceValue->ReferenceItemType == DataPilotFieldReferenceItemType::NAMED )
{
const String& sReferenceFieldName = pReferenceValue->ReferenceField;
DBG_TRACESTR( sReferenceFieldName );
@@ -1411,25 +1398,23 @@ void ScDPSaveDimension::Refresh( const com::sun::star::uno::Reference<
DBG_TRACE( "\n DataPilotFieldSortMode::DATA \n" );
const String& sFieldDimName = pSortInfo->Field;
std::list<String>::const_iterator iter = std::find( deletedDims.begin(), deletedDims.end(), sFieldDimName );
- if ( iter != deletedDims.end() && pCache->GetDimensionIndex( sFieldDimName ) == -1 )
- {
+ if ( iter != deletedDims.end() && pCache->GetDimensionIndex( sFieldDimName ) == -1 )
+ {
pSortInfo->Mode = DataPilotFieldSortMode::MANUAL;
pSortInfo->Field = GetName();
}
}
-
};
if ( pAutoShowInfo )
{ //check autoshow
const String& sFieldDimName = pAutoShowInfo->DataField;
std::list<String>::const_iterator iter = std::find( deletedDims.begin(), deletedDims.end(), sFieldDimName );
- if ( iter != deletedDims.end() && pCache->GetDimensionIndex( sFieldDimName ) == -1 )
- {
+ if ( iter != deletedDims.end() && pCache->GetDimensionIndex( sFieldDimName ) == -1 )
+ {
delete pAutoShowInfo;
pAutoShowInfo = NULL;
}
-
};
//remove unused members
More information about the Libreoffice-commits
mailing list