diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-05-15 22:14:40 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-05-20 20:13:08 -0400 |
commit | c232a8c4723e1a948fbeef2f7ea9486658191eeb (patch) | |
tree | f17e7860a2cf19380ed8d88a61e298fc97b2ad26 /sc/source/core/data/conditio.cxx | |
parent | f3f0ae12f90af06f92b66017449ed4d7892a8ced (diff) |
Speed up ScColumn::HasEditCells() by keeping track of block position.
Use block position hint to avoid re-starting search in the cell text
attribute array. This change alone cuts additional 10 seconds off of
the previously mentioned use case, by reducing the duration of
HasEditCells() call from the previous ~10 seconds to a tiny fraction
of a second.
Change-Id: Id9f951cd235a88928c900619b6b66d7b8a057e0c
Diffstat (limited to 'sc/source/core/data/conditio.cxx')
-rw-r--r-- | sc/source/core/data/conditio.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index e889a9372b45..88028cf317f3 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -2134,6 +2134,18 @@ ScConditionalFormat* ScConditionalFormatList::GetFormat( sal_uInt32 nKey ) return NULL; } +const ScConditionalFormat* ScConditionalFormatList::GetFormat( sal_uInt32 nKey ) const +{ + //! binaer suchen + + for ( const_iterator itr = begin(); itr != end(); ++itr) + if (itr->GetKey() == nKey) + return &(*itr); + + SAL_WARN("sc", "ScConditionalFormatList: Entry not found"); + return NULL; +} + void ScConditionalFormatList::CompileAll() { for( iterator itr = begin(); itr != end(); ++itr) |