summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-01-08 12:59:15 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-01-08 13:08:29 +0100
commit371727c78fdfd80b4d4ec33dc2129da96c38e777 (patch)
treeb0d3b3399706b800fbc9ec2f1a65352ab388a117
parent28f5f06d7099f0d634ac3e7f48c993e7c1116c1d (diff)
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
-rw-r--r--sc/source/filter/xml/xmlwrap.cxx4
-rw-r--r--sc/source/ui/docshell/docsh.cxx2
-rw-r--r--sc/source/ui/docshell/docsh8.cxx4
-rw-r--r--sd/source/filter/xml/sdxmlwrp.cxx4
4 files changed, 7 insertions, 7 deletions
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index 439e5e6d0bbf..5913788f986a 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 37e5e642c66e..f91007050774 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 af33ea2945fa..2bfbcb061fc6 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 285af4395616..4020a628889e 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 );
}
}