diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2014-05-02 16:35:17 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2014-05-02 16:40:07 +0900 |
commit | f3816179a0b81c7d122006435a1ebf518309c392 (patch) | |
tree | dbdff36bad1fac7380c85df91c9cb3ee327849a1 /sc/source/ui/docshell | |
parent | e23c98d713ababb72de0616831a2abe0e48387f5 (diff) |
Avoid possible memory leaks in case of exceptions
Change-Id: Id1c7cb886a892bf0ce7be6774be5408afad44432
Diffstat (limited to 'sc/source/ui/docshell')
-rw-r--r-- | sc/source/ui/docshell/docsh6.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx index 87404c7457c7..7dd8d0eaf46e 100644 --- a/sc/source/ui/docshell/docsh6.cxx +++ b/sc/source/ui/docshell/docsh6.cxx @@ -42,6 +42,7 @@ #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/util/XChangesBatch.hpp> +#include <boost/scoped_array.hpp> using ::com::sun::star::beans::XPropertySet; using ::com::sun::star::lang::XMultiServiceFactory; @@ -289,7 +290,7 @@ void ScDocShell::LoadStylesArgs( ScDocShell& rSource, bool bReplace, bool bCellS if ( nSourceCount == 0 ) return; // no source styles - ScStylePair* pStyles = new ScStylePair[ nSourceCount ]; + boost::scoped_array<ScStylePair> pStyles(new ScStylePair[ nSourceCount ]); sal_uInt16 nFound = 0; // first create all new styles @@ -333,8 +334,6 @@ void ScDocShell::LoadStylesArgs( ScDocShell& rSource, bool bReplace, bool bCellS lcl_AdjustPool( GetStyleSheetPool() ); // adjust SetItems UpdateAllRowHeights(); PostPaint( 0,0,0, MAXCOL,MAXROW,MAXTAB, PAINT_GRID | PAINT_LEFT ); // Paint - - delete[] pStyles; } |