diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-02-07 22:48:33 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2017-02-07 23:02:57 +0100 |
commit | 653e181fb831a04c2845d99f79f72454a88bb948 (patch) | |
tree | 3ec424e8c21f15573226f7f40eb9bd7e97f49107 /sc/source | |
parent | 32cae6a2eaa41568888df9c8fc5605debd8d704a (diff) |
Revert "remove ugly operator* in DynamicErrorInfo"
This reverts commit b5e3f8a5fa98a249ecd50021c33cf2a5c7a3b4fc.
The problem is this:
==24217== Conditional jump or move depends on uninitialised value(s)
==24217== at 0x29A25FCE: SfxObjectShell::SetError(unsigned int, rtl::OUString const&) (objmisc.cxx:220)
==24217== by 0x29A35E6E: SfxObjectShell::ImportFrom(SfxMedium&, com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&) (objstor.cxx:2300)
==24217== by 0x29A3705C: SfxObjectShell::DoLoad(SfxMedium*) (objstor.cxx:765)
==24217== by 0x29A6BC48:
SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) (sfxbasemodel.cxx:1802)
The commit is bogus because it introduces a
DynamicErrorInfo::GetErrorCode(), which overloads
ErrorInfo::GetErrorCode(), which is used at least in
DynamicErrorInfo_Impl::RegisterEDcr() and used to return a constructor
argument of DynamicErrorInfo but now returns pImpl->lErrId,
which is what this statement is trying to initialize.
Ultimately this causes my clang+ASAN build to fail because the
uninitialized error code happens to be detected as a mere Warning:
Test name: testMathMalformedXml::Import
assertion failed
- Expression: !xComponent.is()
- loading succeeded: sw/qa/extras/ooxmlimport/data/math-malformed_xml.docx
Change-Id: I9141144e0bc356ee54279948f2fce036d1831a86
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/filter/xml/xmlwrap.cxx | 8 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh8.cxx | 6 |
3 files changed, 9 insertions, 9 deletions
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx index 82c90dff5ef2..a79b75ccc8da 100644 --- a/sc/source/filter/xml/xmlwrap.cxx +++ b/sc/source/filter/xml/xmlwrap.cxx @@ -216,17 +216,17 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(const uno::Reference<uno::XCo if( !sDocName.isEmpty() ) { - nReturn = (new TwoStringErrorInfo( + nReturn = *new TwoStringErrorInfo( (bMustBeSuccessfull ? SCERR_IMPORT_FILE_ROWCOL : SCWARN_IMPORT_FILE_ROWCOL), sDocName, sErr, - ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode(); + ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ); } else { OSL_ENSURE( bMustBeSuccessfull, "Warnings are not supported" ); - nReturn = (new StringErrorInfo( SCERR_IMPORT_FORMAT_ROWCOL, sErr, - ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode(); + 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 1a7fc52e0857..0a4ecc92afd6 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -2465,10 +2465,10 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed ) bRet = aImExport.ExportStream(*pStream, rMed.GetBaseURL(true), SotClipboardFormatId::HTML); if (bRet && !aImExport.GetNonConvertibleChars().isEmpty()) { - SetError((new StringErrorInfo( + SetError(*new StringErrorInfo( SCWARN_EXPORT_NONCONVERTIBLE_CHARS, aImExport.GetNonConvertibleChars(), - ERRCODE_BUTTON_OK | ERRCODE_MSG_INFO))->GetErrorCode(), OSL_LOG_PREFIX); + ERRCODE_BUTTON_OK | ERRCODE_MSG_INFO), OSL_LOG_PREFIX); } } } diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index 72dde819d5de..6bee8e683222 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -1088,12 +1088,12 @@ sal_uLong ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncodi } OUString sPosition( ScAddress( nDocCol, nDocRow, nTab).GetColRowString()); OUString sEncoding( SvxTextEncodingTable().GetTextString( eCharSet)); - nErr = (new TwoStringErrorInfo( (bEncErr ? SCERR_EXPORT_ENCODING : + nErr = *new TwoStringErrorInfo( (bEncErr ? SCERR_EXPORT_ENCODING : SCERR_EXPORT_FIELDWIDTH), sPosition, sEncoding, - ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR))->GetErrorCode(); + 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))->GetErrorCode(); + nErr = *new StringErrorInfo( (SCERR_EXPORT_SQLEXCEPTION), aException.Message, ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR); else nErr = SCERR_EXPORT_DATA; } |