Kaydet (Commit) 1f3ec2e3 authored tarafından Eike Rathke's avatar Eike Rathke Kaydeden (comit) Markus Mohrhard

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

Change-Id: Ic8bd65a728289c9fa1a0721b0ecbd9b4a48672ca
(cherry picked from commit 2aefb89b)
Reviewed-on: https://gerrit.libreoffice.org/16902Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst 073936d3
......@@ -495,6 +495,7 @@ public:
const_iterator end() const;
size_t size() const;
bool empty() const;
void erase(sal_uLong nIndex);
......
......@@ -2321,6 +2321,11 @@ size_t ScConditionalFormatList::size() const
return maConditionalFormats.size();
}
bool ScConditionalFormatList::empty() const
{
return maConditionalFormats.empty();
}
void ScConditionalFormatList::erase( sal_uLong nIndex )
{
for( iterator itr = begin(); itr != end(); ++itr )
......
......@@ -141,8 +141,11 @@ void ScDocument::BroadcastCells( const ScRange& rRange, sal_uLong nHint, bool bB
continue;
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);
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