summaryrefslogtreecommitdiff
path: root/sc/inc/address.hxx
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2009-06-02 11:23:01 +0000
committerKurt Zenker <kz@openoffice.org>2009-06-02 11:23:01 +0000
commit92288a66306167c908c86064a8e8cacf4f592841 (patch)
treed04d1118fa0d5eb77d348a5442fc0876ec2961ab /sc/inc/address.hxx
parentbb6071dfa4ca367fa268c77880852e3d4f6e54e3 (diff)
CWS-TOOLING: integrate CWS calcperf04
2009-04-23 12:47:25 +0200 er r271155 : CWS-TOOLING: rebase CWS calcperf04 to trunk@270723 (milestone: DEV300:m46) 2009-04-22 13:49:45 +0200 er r271104 : #i101254# performance area broadcasters: replace ::std::set with ::std::hash_set; have broadcaster slots per sheet instead of document wide lumps 2009-04-16 15:04:58 +0200 nn r270886 : #i101126# ScFormatRangeStyles::GetStyleNameIndex: pass row before which to remove 2009-04-16 11:26:33 +0200 nn r270874 : #i101126# ScUniqueCellFormatsObj: collect ranges without ScRangeList::Join 2009-04-15 15:07:34 +0200 er r270846 : merged #i95967# changesets 263482,263483 for performance testcases 2009-03-06 12:48:52 +0100 nn r268996 : #i99960# don't get null date from the model repeatedly 2009-03-06 12:47:21 +0100 nn r268995 : #i99959# don't use GetInputString in ScXMLExport::WriteCell 2009-03-03 17:30:25 +0100 er r268772 : #i99828# NextNewToken: some string handling optimization, i.e. less toUpper calls
Diffstat (limited to 'sc/inc/address.hxx')
-rw-r--r--sc/inc/address.hxx39
1 files changed, 37 insertions, 2 deletions
diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index 7b128b4b1abd..7ba5aa9c1f32 100644
--- a/sc/inc/address.hxx
+++ b/sc/inc/address.hxx
@@ -434,6 +434,22 @@ inline size_t ScAddress::hash() const
(static_cast<size_t>(nCol) << 24) ^ static_cast<size_t>(nRow);
}
+struct ScAddressHashFunctor
+{
+ size_t operator()( const ScAddress & rAdr ) const
+ {
+ return rAdr.hash();
+ }
+};
+
+struct ScAddressEqualFunctor
+{
+ bool operator()( const ScAddress & rAdr1, const ScAddress & rAdr2 ) const
+ {
+ return rAdr1 == rAdr2;
+ }
+};
+
// === ScRange ===============================================================
@@ -521,7 +537,9 @@ public:
inline bool operator>( const ScRange& r ) const;
inline bool operator>=( const ScRange& r ) const;
- inline size_t hash() const;
+ /// Hash 2D area ignoring table number.
+ inline size_t hashArea() const;
+ /// Hash start column and start and end rows.
inline size_t hashStartColumn() const;
};
@@ -580,7 +598,7 @@ inline bool ScRange::In( const ScRange& r ) const
}
-inline size_t ScRange::hash() const
+inline size_t ScRange::hashArea() const
{
// Assume that there are not that many ranges with identical corners so we
// won't have too many collisions. Also assume that more lower row and
@@ -609,6 +627,23 @@ inline size_t ScRange::hashStartColumn() const
}
+struct ScRangeHashAreaFunctor
+{
+ size_t operator()( const ScRange & rRange ) const
+ {
+ return rRange.hashArea();
+ }
+};
+
+struct ScRangeEqualFunctor
+{
+ bool operator()( const ScRange & rRange1, const ScRange & rRange2 ) const
+ {
+ return rRange1 == rRange2;
+ }
+};
+
+
// === ScRangePair ===========================================================
class ScRangePair