Kaydet (Commit) 2aefb89b authored tarafından Eike Rathke's avatar Eike Rathke

execute the terrible bottle neck loop only if there are conditional formats

Change-Id: Ic8bd65a728289c9fa1a0721b0ecbd9b4a48672ca
üst 57792314
...@@ -495,6 +495,7 @@ public: ...@@ -495,6 +495,7 @@ public:
const_iterator end() const; const_iterator end() const;
size_t size() const; size_t size() const;
bool empty() const;
void erase(sal_uLong nIndex); void erase(sal_uLong nIndex);
......
...@@ -2321,6 +2321,11 @@ size_t ScConditionalFormatList::size() const ...@@ -2321,6 +2321,11 @@ size_t ScConditionalFormatList::size() const
return maConditionalFormats.size(); return maConditionalFormats.size();
} }
bool ScConditionalFormatList::empty() const
{
return maConditionalFormats.empty();
}
void ScConditionalFormatList::erase( sal_uLong nIndex ) void ScConditionalFormatList::erase( sal_uLong nIndex )
{ {
for( iterator itr = begin(); itr != end(); ++itr ) for( iterator itr = begin(); itr != end(); ++itr )
......
...@@ -141,8 +141,11 @@ void ScDocument::BroadcastCells( const ScRange& rRange, sal_uLong nHint, bool bB ...@@ -141,8 +141,11 @@ void ScDocument::BroadcastCells( const ScRange& rRange, sal_uLong nHint, bool bB
continue; continue;
ScConditionalFormatList* pCondFormList = GetCondFormList(nTab); ScConditionalFormatList* pCondFormList = GetCondFormList(nTab);
if (pCondFormList) if (pCondFormList && !pCondFormList->empty())
{ {
/* TODO: looping over all possible cells is a terrible bottle neck,
* for each cell looping over all conditional formats even worse,
* this certainly needs a better method. */
ScAddress aAddress( 0, 0, nTab); ScAddress aAddress( 0, 0, nTab);
for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow) for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment