Kaydet (Commit) 6c695e12 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

faster repaint after cond format dialog

Change-Id: Id5894efd385ad20c7a544142ce4fa4ec5d4ef062
üst 6ba6fe0c
...@@ -5090,9 +5090,11 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor ...@@ -5090,9 +5090,11 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor
if(pDoc->IsTabProtected(nTab)) if(pDoc->IsTabProtected(nTab))
return; return;
boost::scoped_ptr<ScRange> pRepaintRange;
if(nOldFormat) if(nOldFormat)
{ {
ScConditionalFormat* pOldFormat = pDoc->GetCondFormList(nTab)->GetFormat(nOldFormat); ScConditionalFormat* pOldFormat = pDoc->GetCondFormList(nTab)->GetFormat(nOldFormat);
pRepaintRange.reset(new ScRange( pOldFormat->GetRange().Combine() ));
if(pOldFormat) if(pOldFormat)
{ {
RemoveCondFormatAttributes(pDoc, pOldFormat); RemoveCondFormatAttributes(pDoc, pOldFormat);
...@@ -5103,14 +5105,20 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor ...@@ -5103,14 +5105,20 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor
} }
if(pFormat) if(pFormat)
{ {
if(pRepaintRange)
pRepaintRange->ExtendTo(rRanges.Combine());
else
pRepaintRange.reset(new ScRange(rRanges.Combine()));
sal_uLong nIndex = pDoc->AddCondFormat(pFormat, nTab); sal_uLong nIndex = pDoc->AddCondFormat(pFormat, nTab);
SetConditionalFormatAttributes(pDoc, rRanges, nIndex); SetConditionalFormatAttributes(pDoc, rRanges, nIndex);
size_t n = rRanges.size();
for(size_t i = 0; i < n; ++i)
pFormat->DoRepaint(rRanges[i]);
pDoc->SetStreamValid(nTab, false); pDoc->SetStreamValid(nTab, false);
} }
if(pRepaintRange)
rDocShell.PostPaint(*pRepaintRange, PAINT_GRID);
aModificator.SetDocumentModified(); aModificator.SetDocumentModified();
SFX_APP()->Broadcast(SfxSimpleHint(SC_HINT_AREAS_CHANGED)); SFX_APP()->Broadcast(SfxSimpleHint(SC_HINT_AREAS_CHANGED));
} }
......
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