[Libreoffice-commits] .: sc/source
Kohei Yoshida
kohei at kemper.freedesktop.org
Thu Jun 2 16:49:53 PDT 2011
sc/source/ui/inc/areasave.hxx | 18 +++++++++---------
sc/source/ui/undo/areasave.cxx | 21 +++++++++++----------
2 files changed, 20 insertions(+), 19 deletions(-)
New commits:
commit e2df4d1e148d6601d5a28d1c16e4c21f08206d37
Author: Kohei Yoshida <kyoshida at novell.com>
Date: Thu Jun 2 19:51:12 2011 -0400
String and bool cleanup.
diff --git a/sc/source/ui/inc/areasave.hxx b/sc/source/ui/inc/areasave.hxx
index 1f7e642..8dbe355 100644
--- a/sc/source/ui/inc/areasave.hxx
+++ b/sc/source/ui/inc/areasave.hxx
@@ -40,12 +40,12 @@ class ScAreaLink;
class ScAreaLinkSaver : public ScDataObject
{
private:
- String aFileName;
- String aFilterName;
- String aOptions;
- String aSourceArea;
- ScRange aDestArea;
- sal_uLong nRefresh;
+ ::rtl::OUString aFileName;
+ ::rtl::OUString aFilterName;
+ ::rtl::OUString aOptions;
+ ::rtl::OUString aSourceArea;
+ ScRange aDestArea;
+ sal_uLong nRefresh;
public:
ScAreaLinkSaver( const ScAreaLink& rSource );
@@ -54,8 +54,8 @@ public:
virtual ScDataObject* Clone() const;
- sal_Bool IsEqual( const ScAreaLink& rCompare ) const;
- sal_Bool IsEqualSource( const ScAreaLink& rCompare ) const;
+ bool IsEqual( const ScAreaLink& rCompare ) const;
+ bool IsEqualSource( const ScAreaLink& rCompare ) const;
void WriteToLink( ScAreaLink& rLink ) const;
void InsertNewLink( ScDocument* pDoc ) const;
@@ -73,7 +73,7 @@ public:
ScAreaLinkSaver* operator[](sal_uInt16 nIndex) const {return (ScAreaLinkSaver*)At(nIndex);}
- sal_Bool IsEqual( const ScDocument* pDoc ) const;
+ bool IsEqual( const ScDocument* pDoc ) const;
void Restore( ScDocument* pDoc ) const;
// returns NULL if empty
diff --git a/sc/source/ui/undo/areasave.cxx b/sc/source/ui/undo/areasave.cxx
index a98ea5c..c8a137e 100644
--- a/sc/source/ui/undo/areasave.cxx
+++ b/sc/source/ui/undo/areasave.cxx
@@ -73,16 +73,16 @@ ScDataObject* ScAreaLinkSaver::Clone() const
return new ScAreaLinkSaver( *this );
}
-sal_Bool ScAreaLinkSaver::IsEqualSource( const ScAreaLink& rCompare ) const
+bool ScAreaLinkSaver::IsEqualSource( const ScAreaLink& rCompare ) const
{
- return ( aFileName == rCompare.GetFile() &&
- aFilterName == rCompare.GetFilter() &&
- aOptions == rCompare.GetOptions() &&
- aSourceArea == rCompare.GetSource() &&
- nRefresh == rCompare.GetRefreshDelay() );
+ return ( aFileName.equals(rCompare.GetFile()) &&
+ aFilterName.equals(rCompare.GetFilter()) &&
+ aOptions.equals(rCompare.GetOptions()) &&
+ aSourceArea.equals(rCompare.GetSource()) &&
+ nRefresh == rCompare.GetRefreshDelay() );
}
-sal_Bool ScAreaLinkSaver::IsEqual( const ScAreaLink& rCompare ) const
+bool ScAreaLinkSaver::IsEqual( const ScAreaLink& rCompare ) const
{
return ( IsEqualSource( rCompare ) &&
aDestArea == rCompare.GetDestArea() );
@@ -106,7 +106,8 @@ void ScAreaLinkSaver::InsertNewLink( ScDocument* pDoc ) const
aSourceArea, aDestArea.aStart, nRefresh );
pLink->SetInCreate( sal_True );
pLink->SetDestArea( aDestArea );
- pLinkManager->InsertFileLink( *pLink, OBJECT_CLIENT_FILE, aFileName, &aFilterName, &aSourceArea );
+ String aTmp1(aFilterName), aTmp2(aSourceArea);
+ pLinkManager->InsertFileLink( *pLink, OBJECT_CLIENT_FILE, aFileName, &aTmp1, &aTmp2 );
pLink->Update();
pLink->SetInCreate( false );
}
@@ -132,7 +133,7 @@ ScDataObject* ScAreaLinkSaveCollection::Clone() const
return new ScAreaLinkSaveCollection( *this );
}
-sal_Bool ScAreaLinkSaveCollection::IsEqual( const ScDocument* pDoc ) const
+bool ScAreaLinkSaveCollection::IsEqual( const ScDocument* pDoc ) const
{
// IsEqual can be checked in sequence.
// Neither ref-update nor removing links will change the order.
@@ -158,7 +159,7 @@ sal_Bool ScAreaLinkSaveCollection::IsEqual( const ScDocument* pDoc ) const
return false; // fewer links in the document than in the save collection
}
- return sal_True;
+ return true;
}
ScAreaLink* lcl_FindLink( const ::sfx2::SvBaseLinks& rLinks, const ScAreaLinkSaver& rSaver )
More information about the Libreoffice-commits
mailing list