diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2011-06-07 17:09:21 -0400 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2011-06-07 17:09:21 -0400 |
commit | 1fd8c2d3c6e1caaca4755a06e4f5d3b547c17089 (patch) | |
tree | b3a4a9ea130d0263331a7b3232c6b2d0f1c82ac0 /sc/source/ui/unoobj | |
parent | e305b905c1cf175195ef8bbdcc38e710812a61f2 (diff) |
Shared commonly used STL function objects & remove memory leak.
Diffstat (limited to 'sc/source/ui/unoobj')
-rw-r--r-- | sc/source/ui/unoobj/chart2uno.cxx | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 95241f35d..609c920ec 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -43,6 +43,7 @@ #include "compiler.hxx" #include "reftokenhelper.hxx" #include "chartlis.hxx" +#include "stlalgorithm.hxx" #include <sfx2/objsh.hxx> #include <tools/table.hxx> @@ -156,20 +157,6 @@ uno::Reference< sheet::XSpreadsheetDocument > lcl_GetSpreadSheetDocument( ScDocu return uno::Reference< sheet::XSpreadsheetDocument >( lcl_GetXModel( pDoc ), uno::UNO_QUERY ); } -// ============================================================================ - -namespace { - -struct DeleteInstance : public unary_function<FormulaToken*, void> -{ - void operator() (FormulaToken* p) const - { - delete p; - } -}; - -} - struct TokenTable { SCROW mnRowCount; @@ -184,7 +171,7 @@ struct TokenTable } void clear() { - ::std::for_each(maTokens.begin(), maTokens.end(), DeleteInstance()); + ::std::for_each(maTokens.begin(), maTokens.end(), ScDeleteObjectByPtr<FormulaToken>()); } void push_back( FormulaToken* pToken ) |