[Libreoffice-commits] .: sc/source sd/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Jan 8 04:08:50 PST 2013


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

New commits:
commit 371727c78fdfd80b4d4ec33dc2129da96c38e777
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Jan 8 12:59:15 2013 +0100

    DynamicErrorInfo objects must be allocated on the heap
    
    cf. "delete pInfo;" in ErrorHandler::HandleError_Impl
    (tools/source/ref/errinf.cxx).  This reverts the remaining (non UNO related)
    changes from e48d47469508dee55ae6abcb3988222b5612e1e9 "fix some memory leaks in
    sc" and 5ea7e74c29f7279b6c31d38185ace576f68f4fb2 "fix some memory leaks in sd"
    that had not already been reverted.  Whether any of these instantiations are
    really leaked (i.e., never deleted again in calls to
    ErrorHandler::HandleError_Impl) is unclear to me, but that would need to be
    fixed in a different way.
    
    Change-Id: I6d9e7a2f6fce6d6a4d5d390c09a5a12f593028a6

diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index 439e5e6..5913788 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 = TwoStringErrorInfo(
+                nReturn = *new 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 = StringErrorInfo( SCERR_IMPORT_FORMAT_ROWCOL, sErr,
+                nReturn = *new 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 37e5e64..f910070 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( StringErrorInfo(
+                SetError( *new 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 af33ea2..2bfbcb0 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 = TwoStringErrorInfo( (bEncErr ? SCERR_EXPORT_ENCODING :
+            nErr = *new TwoStringErrorInfo( (bEncErr ? SCERR_EXPORT_ENCODING :
                         SCERR_EXPORT_FIELDWIDTH), sPosition, sEncoding,
                     ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR);
         }
         else if ( !aException.Message.isEmpty() )
-            nErr = StringErrorInfo( (SCERR_EXPORT_SQLEXCEPTION), aException.Message, ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR);
+            nErr = *new StringErrorInfo( (SCERR_EXPORT_SQLEXCEPTION), aException.Message, ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR);
         else
             nErr = SCERR_EXPORT_DATA;
     }
diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx
index 285af43..4020a62 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -282,7 +282,7 @@ sal_Int32 ReadThroughComponent(
 
         if( rStreamName.Len() )
         {
-            return TwoStringErrorInfo(
+            return *new TwoStringErrorInfo(
                             (bMustBeSuccessfull ? ERR_FORMAT_FILE_ROWCOL
                                                     : WARN_FORMAT_FILE_ROWCOL),
                             rStreamName, sErr,
@@ -291,7 +291,7 @@ sal_Int32 ReadThroughComponent(
         else
         {
             DBG_ASSERT( bMustBeSuccessfull, "Warnings are not supported" );
-            return StringErrorInfo( ERR_FORMAT_ROWCOL, sErr,
+            return *new StringErrorInfo( ERR_FORMAT_ROWCOL, sErr,
                              ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR );
         }
     }


More information about the Libreoffice-commits mailing list