[Libreoffice-commits] .: sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Jan 6 14:36:32 PST 2013


 sc/source/filter/xml/xmlwrap.cxx |    4 ++--
 sc/source/ui/docshell/docsh.cxx  |    2 +-
 sc/source/ui/docshell/docsh8.cxx |    4 ++--
 sc/source/ui/unoobj/scdetect.cxx |    2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit e48d47469508dee55ae6abcb3988222b5612e1e9
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sun Jan 6 23:34:38 2013 +0100

    fix some memory leaks in sc
    
    Change-Id: I1e3b9a55561f941346cb9f553f960dc2bafbb1b6

diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index 5913788..439e5e6 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -219,7 +219,7 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Reference<lang::XMultiSe
 
             if( !sDocName.isEmpty() )
             {
-                nReturn = *new TwoStringErrorInfo(
+                nReturn = TwoStringErrorInfo(
                                 (bMustBeSuccessfull ? SCERR_IMPORT_FILE_ROWCOL
                                                         : SCWARN_IMPORT_FILE_ROWCOL),
                                 sDocName, sErr,
@@ -228,7 +228,7 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(uno::Reference<lang::XMultiSe
             else
             {
                 OSL_ENSURE( bMustBeSuccessfull, "Warnings are not supported" );
-                nReturn = *new StringErrorInfo( SCERR_IMPORT_FORMAT_ROWCOL, sErr,
+                nReturn = StringErrorInfo( SCERR_IMPORT_FORMAT_ROWCOL, sErr,
                                  ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR );
             }
         }
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index f910070..37e5e64 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2293,7 +2293,7 @@ sal_Bool ScDocShell::ConvertTo( SfxMedium &rMed )
             aImExport.SetStreamPath( rMed.GetName() );
             bRet = aImExport.ExportStream( *pStream, rMed.GetBaseURL( true ), SOT_FORMATSTR_ID_HTML );
             if ( bRet && aImExport.GetNonConvertibleChars().Len() )
-                SetError( *new StringErrorInfo(
+                SetError( StringErrorInfo(
                     SCWARN_EXPORT_NONCONVERTIBLE_CHARS,
                     aImExport.GetNonConvertibleChars(),
                     ERRCODE_BUTTON_OK | ERRCODE_MSG_INFO ), ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index 2bfbcb0..af33ea2 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -1156,12 +1156,12 @@ sal_uLong ScDocShell::DBaseExport( const rtl::OUString& rFullFileName, CharSet e
             }
             String sPosition( ScAddress( nDocCol, nDocRow, nTab).GetColRowString());
             String sEncoding( SvxTextEncodingTable().GetTextString( eCharSet));
-            nErr = *new TwoStringErrorInfo( (bEncErr ? SCERR_EXPORT_ENCODING :
+            nErr = TwoStringErrorInfo( (bEncErr ? SCERR_EXPORT_ENCODING :
                         SCERR_EXPORT_FIELDWIDTH), sPosition, sEncoding,
                     ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR);
         }
         else if ( !aException.Message.isEmpty() )
-            nErr = *new StringErrorInfo( (SCERR_EXPORT_SQLEXCEPTION), aException.Message, ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR);
+            nErr = StringErrorInfo( (SCERR_EXPORT_SQLEXCEPTION), aException.Message, ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR);
         else
             nErr = SCERR_EXPORT_DATA;
     }
diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx
index c9d892f..9ef418e 100644
--- a/sc/source/ui/unoobj/scdetect.cxx
+++ b/sc/source/ui/unoobj/scdetect.cxx
@@ -930,7 +930,7 @@ OUString ScFilterDetect::impl_getStaticImplementationName()
 /* Helper for registry */
 UNOREFERENCE< UNOXINTERFACE > SAL_CALL ScFilterDetect::impl_createInstance( const UNOREFERENCE< UNOXMULTISERVICEFACTORY >& xServiceManager ) throw( UNOEXCEPTION )
 {
-    return UNOREFERENCE< UNOXINTERFACE >( *new ScFilterDetect( xServiceManager ) );
+    return UNOREFERENCE< UNOXINTERFACE >( ScFilterDetect( xServiceManager ) );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list