diff options
author | Matúš Kukan <matus.kukan@collabora.com> | 2014-12-22 14:09:47 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@collabora.com> | 2014-12-23 10:38:14 +0100 |
commit | 81938e2b4121d0ffbe2240706ae92af606ee1338 (patch) | |
tree | f3b757d33858bfd533f6eb86607ecdbbfb41d8b8 /sc | |
parent | 96b4645497521ff0cac948cba409829565d213bc (diff) |
Be more direct; bin simple local functions
Change-Id: I3e06f4bb18449c56d0cc396230c56d5fb6a6ed98
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/docshell/docfunc.cxx | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index 22b804d1e02a..9b9518423e96 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -5282,21 +5282,6 @@ bool ScDocFunc::InsertAreaLink( const OUString& rFile, const OUString& rFilter, return true; } -namespace { - -void RemoveCondFormatAttributes(ScDocument* pDoc, const ScConditionalFormat* pFormat, SCTAB nTab) -{ - const ScRangeList& rRangeList = pFormat->GetRange(); - pDoc->RemoveCondFormatData( rRangeList, nTab, pFormat->GetKey() ); -} - -void SetConditionalFormatAttributes(ScDocument* pDoc, const ScRangeList& rRanges, sal_uLong nIndex, SCTAB nTab) -{ - pDoc->AddCondFormatData( rRanges, nTab, nIndex ); -} - -} - void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFormat* pFormat, SCTAB nTab, const ScRangeList& rRanges ) { ScDocShellModificator aModificator(rDocShell); @@ -5336,7 +5321,7 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor if(pOldFormat) { pRepaintRange.reset(new ScRange( pOldFormat->GetRange().Combine() )); - RemoveCondFormatAttributes(&rDoc, pOldFormat, nTab); + rDoc.RemoveCondFormatData(pOldFormat->GetRange(), nTab, pOldFormat->GetKey()); } rDoc.DeleteConditionalFormat(nOldFormat, nTab); @@ -5351,7 +5336,7 @@ void ScDocFunc::ReplaceConditionalFormat( sal_uLong nOldFormat, ScConditionalFor sal_uLong nIndex = rDoc.AddCondFormat(pFormat, nTab); - SetConditionalFormatAttributes(&rDoc, rRanges, nIndex, nTab); + rDoc.AddCondFormatData(rRanges, nTab, nIndex); rDoc.SetStreamValid(nTab, false); } @@ -5384,15 +5369,13 @@ void ScDocFunc::SetConditionalFormatList( ScConditionalFormatList* pList, SCTAB ScConditionalFormatList* pOldList = rDoc.GetCondFormList(nTab); for(ScConditionalFormatList::const_iterator itr = pOldList->begin(), itrEnd = pOldList->end(); itr != itrEnd; ++itr) { - RemoveCondFormatAttributes(&rDoc, &(*itr), nTab); + rDoc.RemoveCondFormatData(itr->GetRange(), nTab, itr->GetKey()); } // then set new entries for(ScConditionalFormatList::iterator itr = pList->begin(); itr != pList->end(); ++itr) { - sal_uLong nIndex = itr->GetKey(); - const ScRangeList& rRange = itr->GetRange(); - SetConditionalFormatAttributes(&rDoc, rRange, nIndex, nTab); + rDoc.AddCondFormatData(itr->GetRange(), nTab, itr->GetKey()); } rDoc.SetCondFormList(pList, nTab); |