[Libreoffice-commits] core.git: 3 commits - basic/source cui/source editeng/source include/svtools include/tools sc/source sd/source sfx2/source svtools/source svx/source sw/source tools/source uui/source
Michael Stahl
mstahl at redhat.com
Tue Feb 7 22:12:47 UTC 2017
basic/source/basmgr/basicmanagerrepository.cxx | 2
basic/source/basmgr/basmgr.cxx | 38 +++++++-------
basic/source/classes/sb.cxx | 6 +-
cui/source/options/optdict.cxx | 4 -
cui/source/tabpages/backgrnd.cxx | 4 -
editeng/source/misc/splwrap.cxx | 4 -
include/svtools/ehdl.hxx | 4 -
include/svtools/sfxecode.hxx | 1
include/tools/errcode.hxx | 19 +++++++
include/tools/errinf.hxx | 52 ++++----------------
sc/source/filter/xml/xmlwrap.cxx | 8 +--
sc/source/ui/docshell/docsh.cxx | 4 -
sc/source/ui/docshell/docsh8.cxx | 6 +-
sd/source/filter/xml/sdxmlwrp.cxx | 8 +--
sd/source/ui/func/fuinsert.cxx | 3 -
sd/source/ui/view/viewshe2.cxx | 2
sfx2/source/doc/objstor.cxx | 10 ++-
svtools/source/misc/ehdl.cxx | 65 ++++++++++++-------------
svx/source/src/errtxt.src | 5 +
sw/source/core/frmedt/fetab.cxx | 20 +++----
sw/source/filter/html/swhtml.cxx | 4 -
sw/source/filter/xml/swxml.cxx | 8 +--
sw/source/filter/xml/wrtxml.cxx | 8 +--
sw/source/uibase/misc/glosdoc.cxx | 8 +--
sw/source/uibase/uiview/viewling.cxx | 2
tools/source/ref/errinf.cxx | 60 +++++++++++------------
uui/source/iahndl-authentication.cxx | 26 +++++-----
uui/source/iahndl-errorhandler.cxx | 32 +++++-------
uui/source/iahndl.cxx | 26 ++++------
uui/source/loginerr.hxx | 10 +--
30 files changed, 219 insertions(+), 230 deletions(-)
New commits:
commit 653e181fb831a04c2845d99f79f72454a88bb948
Author: Michael Stahl <mstahl at redhat.com>
Date: Tue Feb 7 22:48:33 2017 +0100
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
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 286a9c4..9b0c92a 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -634,10 +634,10 @@ BasicManager::BasicManager( StarBASIC* pSLib, OUString* pLibPath, bool bDocMgr )
void BasicManager::ImpMgrNotLoaded( const OUString& rStorageName )
{
- // pErrInf is only destroyed if the error is processed by an
+ // pErrInf is only destroyed if the error os processed by an
// ErrorHandler
StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_MGROPEN, rStorageName, ERRCODE_BUTTON_OK );
- aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::OPENMGRSTREAM));
+ aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::OPENMGRSTREAM));
// Create a stdlib otherwise we crash!
BasicLibInfo* pStdLibInfo = CreateLibInfo();
@@ -777,7 +777,7 @@ void BasicManager::LoadOldBasicManager( SotStorage& rStorage )
if (!ImplLoadBasic( *xManagerStream, mpImpl->aLibs.front()->GetLibRef() ))
{
StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_MGROPEN, aStorName, ERRCODE_BUTTON_OK );
- aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::OPENMGRSTREAM));
+ aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::OPENMGRSTREAM));
// and it proceeds ...
}
xManagerStream->Seek( nBasicEndOff+1 ); // +1: 0x00 as separator
@@ -825,7 +825,7 @@ void BasicManager::LoadOldBasicManager( SotStorage& rStorage )
else
{
StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD, aStorName, ERRCODE_BUTTON_OK );
- aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::STORAGENOTFOUND));
+ aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::STORAGENOTFOUND));
}
}
}
@@ -908,7 +908,7 @@ bool BasicManager::ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurStora
if ( !xBasicStorage.is() || xBasicStorage->GetError() )
{
StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_MGROPEN, xStorage->GetName(), ERRCODE_BUTTON_OK );
- aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::OPENLIBSTORAGE));
+ aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::OPENLIBSTORAGE));
}
else
{
@@ -917,7 +917,7 @@ bool BasicManager::ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurStora
if ( !xBasicStream.is() || xBasicStream->GetError() )
{
StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD , pLibInfo->GetLibName(), ERRCODE_BUTTON_OK );
- aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::OPENLIBSTREAM));
+ aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::OPENLIBSTREAM));
}
else
{
@@ -940,7 +940,7 @@ bool BasicManager::ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurStora
if ( !bLoaded )
{
StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD, pLibInfo->GetLibName(), ERRCODE_BUTTON_OK );
- aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::BASICLOADERROR));
+ aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::BASICLOADERROR));
}
else
{
@@ -1124,7 +1124,7 @@ bool BasicManager::RemoveLib( sal_uInt16 nLib, bool bDelBasicFromStorage )
if( !nLib || nLib < mpImpl->aLibs.size() )
{
StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_REMOVELIB, OUString(), ERRCODE_BUTTON_OK );
- aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::STDLIB));
+ aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::STDLIB));
return false;
}
@@ -1160,7 +1160,7 @@ bool BasicManager::RemoveLib( sal_uInt16 nLib, bool bDelBasicFromStorage )
if ( !xBasicStorage.is() || xBasicStorage->GetError() )
{
StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_REMOVELIB, OUString(), ERRCODE_BUTTON_OK );
- aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::OPENLIBSTORAGE));
+ aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::OPENLIBSTORAGE));
}
else if (xBasicStorage->IsStream((*itLibInfo)->GetLibName()))
{
@@ -1295,7 +1295,7 @@ bool BasicManager::LoadLib( sal_uInt16 nLib )
else
{
StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD, OUString(), ERRCODE_BUTTON_OK );
- aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::LIBNOTFOUND));
+ aErrors.push_back(BasicError(*pErrInf, BasicErrorReason::LIBNOTFOUND));
}
return bDone;
}
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 74cec84..60d71c7 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -1663,7 +1663,7 @@ bool StarBASIC::CError( SbError code, const OUString& rMsg,
// Implementation of the code for the string transport to SFX-Error
if( !rMsg.isEmpty() )
{
- code = (SbError)(new StringErrorInfo( code, rMsg ))->GetErrorCode();
+ code = (SbError)*new StringErrorInfo( code, rMsg );
}
SetErrorData( code, l, c1, c2 );
GetSbData()->bCompilerError = true;
@@ -1702,11 +1702,11 @@ bool StarBASIC::RTError( SbError code, const OUString& rMsg, sal_Int32 l, sal_In
{
OUString aTmp = "\'" + OUString::number(SbxErrObject::getUnoErrObject()->getNumber()) +
"\'\n" + OUString(!GetSbData()->aErrMsg.isEmpty() ? GetSbData()->aErrMsg : rMsg);
- code = (SbError)(new StringErrorInfo( code, aTmp ))->GetErrorCode();
+ code = (SbError)*new StringErrorInfo( code, aTmp );
}
else
{
- code = (SbError)(new StringErrorInfo( code, rMsg ))->GetErrorCode();
+ code = (SbError)*new StringErrorInfo( code, rMsg );
}
}
diff --git a/cui/source/options/optdict.cxx b/cui/source/options/optdict.cxx
index 2747233..a28bd94 100644
--- a/cui/source/options/optdict.cxx
+++ b/cui/source/options/optdict.cxx
@@ -180,8 +180,8 @@ IMPL_LINK_NOARG(SvxNewDictionaryDialog, OKHdl_Impl, Button*, void)
// error: couldn't create new dictionary
SfxErrorContext aContext( ERRCTX_SVX_LINGU_DICTIONARY, OUString(),
this, RID_SVXERRCTX, &CUI_MGR() );
- ErrorHandler::HandleError( (new StringErrorInfo(
- ERRCODE_SVX_LINGU_DICT_NOTWRITEABLE, sDict ))->GetErrorCode() );
+ ErrorHandler::HandleError( *new StringErrorInfo(
+ ERRCODE_SVX_LINGU_DICT_NOTWRITEABLE, sDict ) );
EndDialog();
}
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 16981f5..f781f0c 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -973,8 +973,8 @@ void SvxBackgroundTabPage::RaiseLoadError_Impl()
&CUI_MGR() );
ErrorHandler::HandleError(
- (new StringErrorInfo( ERRCODE_SVX_GRAPHIC_NOTREADABLE,
- aBgdGraphicPath ))->GetErrorCode() );
+ *new StringErrorInfo( ERRCODE_SVX_GRAPHIC_NOTREADABLE,
+ aBgdGraphicPath ) );
}
bool SvxBackgroundTabPage::LoadLinkedGraphic_Impl()
diff --git a/editeng/source/misc/splwrap.cxx b/editeng/source/misc/splwrap.cxx
index fac731a..0ae986e 100644
--- a/editeng/source/misc/splwrap.cxx
+++ b/editeng/source/misc/splwrap.cxx
@@ -104,14 +104,14 @@ void SvxSpellWrapper::ShowLanguageErrors()
{
OUString aErr( SvtLanguageTable::GetLanguageString( nLang ) );
ErrorHandler::HandleError(
- (new StringErrorInfo( ERRCODE_SVX_LINGU_LANGUAGENOTEXISTS, aErr ))->GetErrorCode() );
+ *new StringErrorInfo( ERRCODE_SVX_LINGU_LANGUAGENOTEXISTS, aErr ) );
nTmpSpell = SVX_LANG_MISSING;
}
if (SVX_LANG_MISSING_DO_WARN == nTmpHyph)
{
OUString aErr( SvtLanguageTable::GetLanguageString( nLang ) );
ErrorHandler::HandleError(
- (new StringErrorInfo( ERRCODE_SVX_LINGU_LANGUAGENOTEXISTS, aErr ))->GetErrorCode() );
+ *new StringErrorInfo( ERRCODE_SVX_LINGU_LANGUAGENOTEXISTS, aErr ) );
nTmpHyph = SVX_LANG_MISSING;
}
diff --git a/include/tools/errinf.hxx b/include/tools/errinf.hxx
index 2b9f6b5..9559eec 100644
--- a/include/tools/errinf.hxx
+++ b/include/tools/errinf.hxx
@@ -62,7 +62,7 @@ public:
DynamicErrorInfo(sal_uIntPtr lUserId, sal_uInt16 nMask);
virtual ~DynamicErrorInfo() override;
- sal_uIntPtr GetErrorCode() const;
+ operator sal_uIntPtr() const;
sal_uInt16 GetDialogMask() const;
};
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index 82c90df..a79b75c 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 1a7fc52..0a4ecc9 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 72dde81..6bee8e6 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;
}
diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx
index d79ff01..f91acb5 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -245,17 +245,17 @@ sal_Int32 ReadThroughComponent(
if (!rStreamName.isEmpty())
{
- return (new TwoStringErrorInfo(
+ return *new TwoStringErrorInfo(
(bMustBeSuccessfull ? ERR_FORMAT_FILE_ROWCOL
: WARN_FORMAT_FILE_ROWCOL),
rStreamName, sErr,
- ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode();
+ ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR );
}
else
{
DBG_ASSERT( bMustBeSuccessfull, "Warnings are not supported" );
- return (new StringErrorInfo( ERR_FORMAT_ROWCOL, sErr,
- ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode();
+ return *new StringErrorInfo( ERR_FORMAT_ROWCOL, sErr,
+ ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR );
}
}
catch (const xml::sax::SAXException& r)
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index e9155f7..f91f066 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -452,7 +452,8 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
}
else
{
- ErrorHandler::HandleError( (new StringErrorInfo(ERRCODE_SFX_OLEGENERAL, ""))->GetErrorCode() );
+ ErrorHandler::HandleError(* new StringErrorInfo(ERRCODE_SFX_OLEGENERAL,
+ "" ) );
}
}
else
diff --git a/sd/source/ui/view/viewshe2.cxx b/sd/source/ui/view/viewshe2.cxx
index b0f3702..82b529e 100644
--- a/sd/source/ui/view/viewshe2.cxx
+++ b/sd/source/ui/view/viewshe2.cxx
@@ -864,7 +864,7 @@ bool ViewShell::ActivateObject(SdrOle2Obj* pObj, long nVerb)
if (aErrCode != 0 && !bAbort)
{
- ErrorHandler::HandleError( (new StringErrorInfo(aErrCode, ""))->GetErrorCode() );
+ ErrorHandler::HandleError(* new StringErrorInfo(aErrCode, OUString() ) );
}
return aErrCode == 0;
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 95c3557..3dda58b 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2296,8 +2296,8 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium,
io::WrongFormatException e;
if (rWrapped.TargetException >>= e)
{
- SetError((new StringErrorInfo(ERRCODE_SFX_FORMAT_ROWCOL,
- e.Message, ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode(), "");
+ SetError(*new StringErrorInfo(ERRCODE_SFX_FORMAT_ROWCOL,
+ e.Message, ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ), "");
}
}
catch (...)
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 830a9b0..7ba89d0 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -226,8 +226,8 @@ sal_uLong HTMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPam,
+ "," + OUString::number((sal_Int32)xParser->GetLinePos()));
// den Stream als Fehlernummer Transporter benutzen
- nRet = (new StringErrorInfo( ERR_FORMAT_ROWCOL, sErr,
- ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode();
+ nRet = *new StringErrorInfo( ERR_FORMAT_ROWCOL, sErr,
+ ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR );
}
return nRet;
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index 374029e..66327a2 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -206,17 +206,17 @@ sal_Int32 ReadThroughComponent(
if( !rStreamName.isEmpty() )
{
- return (new TwoStringErrorInfo(
+ return *new TwoStringErrorInfo(
(bMustBeSuccessfull ? ERR_FORMAT_FILE_ROWCOL
: WARN_FORMAT_FILE_ROWCOL),
rStreamName, sErr,
- ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode();
+ ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR );
}
else
{
OSL_ENSURE( bMustBeSuccessfull, "Warnings are not supported" );
- return (new StringErrorInfo( ERR_FORMAT_ROWCOL, sErr,
- ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode();
+ return *new StringErrorInfo( ERR_FORMAT_ROWCOL, sErr,
+ ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR );
}
}
catch(const xml::sax::SAXException& r)
diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx
index a2494ef..0447ac4 100644
--- a/sw/source/filter/xml/wrtxml.cxx
+++ b/sw/source/filter/xml/wrtxml.cxx
@@ -413,15 +413,15 @@ sal_uInt32 SwXMLWriter::Write_( const uno::Reference < task::XStatusIndicator >&
if( bErr )
{
if( !sErrFile.isEmpty() )
- return (new StringErrorInfo( ERR_WRITE_ERROR_FILE, sErrFile,
- ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode();
+ return *new StringErrorInfo( ERR_WRITE_ERROR_FILE, sErrFile,
+ ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR );
return ERR_SWG_WRITE_ERROR;
}
else if( bWarn )
{
if( !sWarnFile.isEmpty() )
- return (new StringErrorInfo( WARN_WRITE_ERROR_FILE, sWarnFile,
- ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode();
+ return *new StringErrorInfo( WARN_WRITE_ERROR_FILE, sWarnFile,
+ ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR );
return WARN_SWG_FEATURES_LOST;
}
diff --git a/sw/source/uibase/misc/glosdoc.cxx b/sw/source/uibase/misc/glosdoc.cxx
index 513aba7..0959f92 100644
--- a/sw/source/uibase/misc/glosdoc.cxx
+++ b/sw/source/uibase/misc/glosdoc.cxx
@@ -398,9 +398,9 @@ void SwGlossaries::UpdateGlosPath(bool bFull)
m_aInvalidPaths = aInvalidPaths;
// wrong path, that means AutoText directory doesn't exist
- ErrorHandler::HandleError( (new StringErrorInfo(
+ ErrorHandler::HandleError( *new StringErrorInfo(
ERR_AUTOPATH_ERROR, lcl_makePath(m_aInvalidPaths),
- ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode());
+ ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ));
m_bError = true;
}
else
@@ -419,8 +419,8 @@ void SwGlossaries::UpdateGlosPath(bool bFull)
void SwGlossaries::ShowError()
{
- sal_uInt32 nPathError = (new StringErrorInfo(ERR_AUTOPATH_ERROR,
- lcl_makePath(m_aInvalidPaths), ERRCODE_BUTTON_OK ))->GetErrorCode();
+ sal_uInt32 nPathError = *new StringErrorInfo(ERR_AUTOPATH_ERROR,
+ lcl_makePath(m_aInvalidPaths), ERRCODE_BUTTON_OK );
ErrorHandler::HandleError( nPathError );
}
diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx
index a1479f9..0e74a3d 100644
--- a/sw/source/uibase/uiview/viewling.cxx
+++ b/sw/source/uibase/uiview/viewling.cxx
@@ -359,7 +359,7 @@ void SwView::SpellError(LanguageType eLang)
if ( LANGUAGE_NONE == eLang )
ErrorHandler::HandleError( ERRCODE_SVX_LINGU_NOLANGUAGE );
else
- ErrorHandler::HandleError( (new StringErrorInfo( ERRCODE_SVX_LINGU_LANGUAGENOTEXISTS, aErr ))->GetErrorCode() );
+ ErrorHandler::HandleError( *new StringErrorInfo( ERRCODE_SVX_LINGU_LANGUAGENOTEXISTS, aErr ) );
while( nWaitCnt )
{
diff --git a/tools/source/ref/errinf.cxx b/tools/source/ref/errinf.cxx
index 539151c..4c3eb52 100644
--- a/tools/source/ref/errinf.cxx
+++ b/tools/source/ref/errinf.cxx
@@ -86,7 +86,7 @@ void DynamicErrorInfo_Impl::RegisterEDcr(DynamicErrorInfo *pDcr)
void DynamicErrorInfo_Impl::UnRegisterEDcr(DynamicErrorInfo const *pDcr)
{
DynamicErrorInfo **ppDcr = TheEDcrData::get().ppDcr;
- sal_uIntPtr lIdx = ((pDcr->GetErrorCode() & ERRCODE_DYNAMIC_MASK) >> ERRCODE_DYNAMIC_SHIFT) - 1;
+ sal_uIntPtr lIdx = (((sal_uIntPtr)(*pDcr) & ERRCODE_DYNAMIC_MASK) >> ERRCODE_DYNAMIC_SHIFT) - 1;
DBG_ASSERT(ppDcr[lIdx]==pDcr,"ErrHdl: Error nicht gefunden");
if(ppDcr[lIdx]==pDcr)
ppDcr[lIdx]=nullptr;
@@ -105,7 +105,7 @@ ErrorInfo *ErrorInfo::GetErrorInfo(sal_uIntPtr lId)
return new ErrorInfo(lId);
}
-sal_uIntPtr DynamicErrorInfo::GetErrorCode() const
+DynamicErrorInfo::operator sal_uIntPtr() const
{
return pImpl->lErrId;
}
@@ -127,7 +127,7 @@ ErrorInfo* DynamicErrorInfo_Impl::GetDynamicErrorInfo(sal_uIntPtr lId)
{
sal_uIntPtr lIdx = ((lId & ERRCODE_DYNAMIC_MASK)>>ERRCODE_DYNAMIC_SHIFT)-1;
DynamicErrorInfo* pDcr = TheEDcrData::get().ppDcr[lIdx];
- if(pDcr && pDcr->GetErrorCode()==lId)
+ if(pDcr && (sal_uIntPtr)(*pDcr)==lId)
return pDcr;
else
return new ErrorInfo(lId & ~ERRCODE_DYNAMIC_MASK);
commit 32cae6a2eaa41568888df9c8fc5605debd8d704a
Author: Michael Stahl <mstahl at redhat.com>
Date: Tue Feb 7 23:02:28 2017 +0100
Revert "create ErrorHandlerFlags scoped enum for error handling flags"
This reverts commit 05e78bde26d8b8b257ed22a0ce20c5b386a629d1.
Depends on the other commit that needs reverting
diff --git a/basic/source/basmgr/basicmanagerrepository.cxx b/basic/source/basmgr/basicmanagerrepository.cxx
index 500f314..f7bff18 100644
--- a/basic/source/basmgr/basicmanagerrepository.cxx
+++ b/basic/source/basmgr/basicmanagerrepository.cxx
@@ -441,7 +441,7 @@ namespace basic
for(const auto& rError : aErrors)
{
// show message to user
- if ( ErrorHandlerFlags::ButtonsCancel == ErrorHandler::HandleError( rError.GetErrorId() ) )
+ if ( ERRCODE_BUTTON_CANCEL == ErrorHandler::HandleError( rError.GetErrorId() ) )
{
// user wants to break loading of BASIC-manager
delete _out_rpBasicManager;
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 2a75286..286a9c4 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -636,7 +636,7 @@ void BasicManager::ImpMgrNotLoaded( const OUString& rStorageName )
{
// pErrInf is only destroyed if the error is processed by an
// ErrorHandler
- StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_MGROPEN, rStorageName, ErrorHandlerFlags::ButtonsOk );
+ StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_MGROPEN, rStorageName, ERRCODE_BUTTON_OK );
aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::OPENMGRSTREAM));
// Create a stdlib otherwise we crash!
@@ -776,7 +776,7 @@ void BasicManager::LoadOldBasicManager( SotStorage& rStorage )
xManagerStream->Seek( nBasicStartOff );
if (!ImplLoadBasic( *xManagerStream, mpImpl->aLibs.front()->GetLibRef() ))
{
- StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_MGROPEN, aStorName, ErrorHandlerFlags::ButtonsOk );
+ StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_MGROPEN, aStorName, ERRCODE_BUTTON_OK );
aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::OPENMGRSTREAM));
// and it proceeds ...
}
@@ -824,7 +824,7 @@ void BasicManager::LoadOldBasicManager( SotStorage& rStorage )
}
else
{
- StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD, aStorName, ErrorHandlerFlags::ButtonsOk );
+ StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD, aStorName, ERRCODE_BUTTON_OK );
aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::STORAGENOTFOUND));
}
}
@@ -907,7 +907,7 @@ bool BasicManager::ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurStora
if ( !xBasicStorage.is() || xBasicStorage->GetError() )
{
- StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_MGROPEN, xStorage->GetName(), ErrorHandlerFlags::ButtonsOk );
+ StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_MGROPEN, xStorage->GetName(), ERRCODE_BUTTON_OK );
aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::OPENLIBSTORAGE));
}
else
@@ -916,7 +916,7 @@ bool BasicManager::ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurStora
tools::SvRef<SotStorageStream> xBasicStream = xBasicStorage->OpenSotStream( pLibInfo->GetLibName(), eStreamReadMode );
if ( !xBasicStream.is() || xBasicStream->GetError() )
{
- StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD , pLibInfo->GetLibName(), ErrorHandlerFlags::ButtonsOk );
+ StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD , pLibInfo->GetLibName(), ERRCODE_BUTTON_OK );
aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::OPENLIBSTREAM));
}
else
@@ -939,7 +939,7 @@ bool BasicManager::ImpLoadLibrary( BasicLibInfo* pLibInfo, SotStorage* pCurStora
}
if ( !bLoaded )
{
- StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD, pLibInfo->GetLibName(), ErrorHandlerFlags::ButtonsOk );
+ StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD, pLibInfo->GetLibName(), ERRCODE_BUTTON_OK );
aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::BASICLOADERROR));
}
else
@@ -1123,7 +1123,7 @@ bool BasicManager::RemoveLib( sal_uInt16 nLib, bool bDelBasicFromStorage )
if( !nLib || nLib < mpImpl->aLibs.size() )
{
- StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_REMOVELIB, OUString(), ErrorHandlerFlags::ButtonsOk );
+ StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_REMOVELIB, OUString(), ERRCODE_BUTTON_OK );
aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::STDLIB));
return false;
}
@@ -1159,7 +1159,7 @@ bool BasicManager::RemoveLib( sal_uInt16 nLib, bool bDelBasicFromStorage )
if ( !xBasicStorage.is() || xBasicStorage->GetError() )
{
- StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_REMOVELIB, OUString(), ErrorHandlerFlags::ButtonsOk );
+ StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_REMOVELIB, OUString(), ERRCODE_BUTTON_OK );
aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::OPENLIBSTORAGE));
}
else if (xBasicStorage->IsStream((*itLibInfo)->GetLibName()))
@@ -1294,7 +1294,7 @@ bool BasicManager::LoadLib( sal_uInt16 nLib )
}
else
{
- StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD, OUString(), ErrorHandlerFlags::ButtonsOk );
+ StringErrorInfo* pErrInf = new StringErrorInfo( ERRCODE_BASMGR_LIBLOAD, OUString(), ERRCODE_BUTTON_OK );
aErrors.push_back(BasicError(pErrInf->GetErrorCode(), BasicErrorReason::LIBNOTFOUND));
}
return bDone;
diff --git a/include/svtools/ehdl.hxx b/include/svtools/ehdl.hxx
index 2865e26..cb73990 100644
--- a/include/svtools/ehdl.hxx
+++ b/include/svtools/ehdl.hxx
@@ -54,7 +54,7 @@ public:
virtual ~SfxErrorHandler() override;
protected:
- bool GetErrorString(sal_uLong lErrId, OUString &, ErrorHandlerFlags&) const;
+ bool GetErrorString(sal_uLong lErrId, OUString &, sal_uInt16&) const;
private:
@@ -66,7 +66,7 @@ private:
pFreeMgr;
SVT_DLLPRIVATE static void GetClassString(sal_uLong lErrId, OUString &);
- virtual bool CreateString( const ErrorInfo *, OUString &, ErrorHandlerFlags &) const override;
+ virtual bool CreateString( const ErrorInfo *, OUString &, sal_uInt16 &) const override;
};
#endif
diff --git a/include/svtools/sfxecode.hxx b/include/svtools/sfxecode.hxx
index 77c3ee4..99083f2 100644
--- a/include/svtools/sfxecode.hxx
+++ b/include/svtools/sfxecode.hxx
@@ -34,6 +34,7 @@
#define ERRCODE_SFX_WRONGPASSWORD (ERRCODE_AREA_SFX|ERRCODE_CLASS_READ|11)
#define ERRCODE_SFX_DOCUMENTREADONLY (ERRCODE_AREA_SFX|ERRCODE_CLASS_WRITE|12)
#define ERRCODE_SFX_OLEGENERAL (ERRCODE_AREA_SFX|ERRCODE_CLASS_NONE|14)
+#define ERRCODE_SFXMSG_STYLEREPLACE (ERRCODE_WARNING_MASK|ERRCODE_AREA_SFX|ERRCODE_CLASS_NONE|13)
#define ERRCODE_SFX_TEMPLATENOTFOUND (ERRCODE_AREA_SFX|ERRCODE_CLASS_NOTEXISTS|15)
#define ERRCODE_SFX_ISRELATIVE (ERRCODE_WARNING_MASK|ERRCODE_AREA_SFX|ERRCODE_CLASS_NOTEXISTS|16)
#define ERRCODE_SFX_FORCEDOCLOAD (ERRCODE_WARNING_MASK|ERRCODE_AREA_SFX|ERRCODE_CLASS_NONE|17)
diff --git a/include/tools/errcode.hxx b/include/tools/errcode.hxx
index 6eaef4b..32edbe7 100644
--- a/include/tools/errcode.hxx
+++ b/include/tools/errcode.hxx
@@ -46,6 +46,25 @@ Warning || || |
Code
*/
+#define ERRCODE_BUTTON_OK 0x01
+#define ERRCODE_BUTTON_CANCEL 0x02
+#define ERRCODE_BUTTON_RETRY 0x04
+#define ERRCODE_BUTTON_OK_CANCEL 0x03
+#define ERRCODE_BUTTON_NO 0x08
+#define ERRCODE_BUTTON_YES 0x10
+#define ERRCODE_BUTTON_YES_NO 0x18
+#define ERRCODE_BUTTON_YES_NO_CANCEL 0x1a
+
+#define ERRCODE_BUTTON_DEF_OK 0x100
+#define ERRCODE_BUTTON_DEF_CANCEL 0x200
+#define ERRCODE_BUTTON_DEF_YES 0x300
+#define ERRCODE_BUTTON_DEF_NO 0x400
+
+#define ERRCODE_MSG_ERROR 0x1000
+#define ERRCODE_MSG_WARNING 0x2000
+#define ERRCODE_MSG_INFO 0x3000
+#define ERRCODE_MSG_QUERY 0x4000
+
#define ERRCODE_ERROR_MASK 0x3fffffffUL
#define ERRCODE_WARNING_MASK 0x80000000UL
#define ERRCODE_RES_MASK 0x7fff
diff --git a/include/tools/errinf.hxx b/include/tools/errinf.hxx
index d83fa54..2b9f6b5 100644
--- a/include/tools/errinf.hxx
+++ b/include/tools/errinf.hxx
@@ -26,7 +26,6 @@
#include <rtl/ustring.hxx>
#include <tools/errcode.hxx>
#include <tools/toolsdllapi.h>
-#include <o3tl/typed_flags_set.hxx>
#include <memory>
// FIXME: horrible legacy dependency on VCL from tools.
@@ -35,35 +34,6 @@ namespace vcl { class Window; }
class DynamicErrorInfo_Impl;
class ErrorHandler_Impl;
-enum class ErrorHandlerFlags
-{
- NONE = 0x0000,
- ButtonsOk = 0x0001,
- ButtonsCancel = 0x0002,
- ButtonsRetry = 0x0004,
- ButtonsOkCancel = 0x0003,
- ButtonsNo = 0x0008,
- ButtonsYes = 0x0010,
- ButtonsYesNo = 0x0018,
- ButtonsYesNoCancel = 0x001a,
-
- ButtonDefaultsOk = 0x0100,
- ButtonDefaultsCancel = 0x0200,
- ButtonDefaultsYes = 0x0300,
- ButtonDefaultsNo = 0x0400,
-
- MessageError = 0x1000,
- MessageWarning = 0x2000,
- MessageInfo = 0x3000,
- MessageQuery = 0x4000,
-
- MAX = USHRT_MAX,
-};
-namespace o3tl
-{
- template<> struct typed_flags<ErrorHandlerFlags> : is_typed_flags<ErrorHandlerFlags, 0xffff> {};
-}
-
class SAL_WARN_UNUSED TOOLS_DLLPUBLIC ErrorInfo
{
private:
@@ -89,11 +59,11 @@ private:
public:
- DynamicErrorInfo(sal_uIntPtr lUserId, ErrorHandlerFlags nMask);
+ DynamicErrorInfo(sal_uIntPtr lUserId, sal_uInt16 nMask);
virtual ~DynamicErrorInfo() override;
sal_uIntPtr GetErrorCode() const;
- ErrorHandlerFlags GetDialogMask() const;
+ sal_uInt16 GetDialogMask() const;
};
class SAL_WARN_UNUSED TOOLS_DLLPUBLIC StringErrorInfo : public DynamicErrorInfo
@@ -105,7 +75,7 @@ public:
StringErrorInfo( sal_uIntPtr lUserId,
const OUString& aStringP,
- ErrorHandlerFlags nMask = ErrorHandlerFlags::NONE);
+ sal_uInt16 nMask = 0);
const OUString& GetErrorString() const { return aString; }
};
@@ -118,7 +88,7 @@ private:
public:
TwoStringErrorInfo(sal_uIntPtr nUserID, const OUString & rTheArg1,
- const OUString & rTheArg2, ErrorHandlerFlags nMask):
+ const OUString & rTheArg2, sal_uInt16 nMask):
DynamicErrorInfo(nUserID, nMask), aArg1(rTheArg1), aArg2(rTheArg2) {}
const OUString& GetArg1() const { return aArg1; }
@@ -143,8 +113,8 @@ public:
static ErrorContext* GetContext();
};
-typedef ErrorHandlerFlags WindowDisplayErrorFunc(
- vcl::Window *, ErrorHandlerFlags nMask, const OUString &rErr, const OUString &rAction);
+typedef sal_uInt16 WindowDisplayErrorFunc(
+ vcl::Window *, sal_uInt16 nMask, const OUString &rErr, const OUString &rAction);
typedef void BasicDisplayErrorFunc(
const OUString &rErr, const OUString &rAction);
@@ -154,19 +124,19 @@ class SAL_WARN_UNUSED TOOLS_DLLPUBLIC ErrorHandler
friend class ErrorHandler_Impl;
private:
- static ErrorHandlerFlags HandleError_Impl( sal_uIntPtr lId,
- ErrorHandlerFlags nFlags,
+ static sal_uInt16 HandleError_Impl( sal_uIntPtr lId,
+ sal_uInt16 nFlags,
bool bJustCreateString,
OUString & rError);
protected:
virtual bool CreateString( const ErrorInfo *,
- OUString &, ErrorHandlerFlags& nMask ) const = 0;
+ OUString &, sal_uInt16& nMask ) const = 0;
public:
ErrorHandler();
virtual ~ErrorHandler();
- static ErrorHandlerFlags HandleError ( sal_uIntPtr lId, ErrorHandlerFlags nMask = ErrorHandlerFlags::MAX );
+ static sal_uInt16 HandleError ( sal_uIntPtr lId, sal_uInt16 nMask = USHRT_MAX );
static bool GetErrorString( sal_uIntPtr lId, OUString& rStr );
static void RegisterDisplay( BasicDisplayErrorFunc* );
diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx
index 0bf1475..82c90df 100644
--- a/sc/source/filter/xml/xmlwrap.cxx
+++ b/sc/source/filter/xml/xmlwrap.cxx
@@ -220,13 +220,13 @@ sal_uInt32 ScXMLImportWrapper::ImportFromComponent(const uno::Reference<uno::XCo
(bMustBeSuccessfull ? SCERR_IMPORT_FILE_ROWCOL
: SCWARN_IMPORT_FILE_ROWCOL),
sDocName, sErr,
- ErrorHandlerFlags::ButtonsOk | ErrorHandlerFlags::MessageError ))->GetErrorCode();
+ ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode();
}
else
{
OSL_ENSURE( bMustBeSuccessfull, "Warnings are not supported" );
nReturn = (new StringErrorInfo( SCERR_IMPORT_FORMAT_ROWCOL, sErr,
- ErrorHandlerFlags::ButtonsOk | ErrorHandlerFlags::MessageError ))->GetErrorCode();
+ ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode();
}
}
}
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 9fe756c..1a7fc52 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -2468,7 +2468,7 @@ bool ScDocShell::ConvertTo( SfxMedium &rMed )
SetError((new StringErrorInfo(
SCWARN_EXPORT_NONCONVERTIBLE_CHARS,
aImExport.GetNonConvertibleChars(),
- ErrorHandlerFlags::ButtonsOk | ErrorHandlerFlags::MessageInfo))->GetErrorCode(), OSL_LOG_PREFIX);
+ ERRCODE_BUTTON_OK | ERRCODE_MSG_INFO))->GetErrorCode(), OSL_LOG_PREFIX);
}
}
}
diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx
index 29aa6b8..72dde81 100644
--- a/sc/source/ui/docshell/docsh8.cxx
+++ b/sc/source/ui/docshell/docsh8.cxx
@@ -1090,10 +1090,10 @@ sal_uLong ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncodi
OUString sEncoding( SvxTextEncodingTable().GetTextString( eCharSet));
nErr = (new TwoStringErrorInfo( (bEncErr ? SCERR_EXPORT_ENCODING :
SCERR_EXPORT_FIELDWIDTH), sPosition, sEncoding,
- ErrorHandlerFlags::ButtonsOk | ErrorHandlerFlags::MessageError))->GetErrorCode();
+ ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR))->GetErrorCode();
}
else if ( !aException.Message.isEmpty() )
- nErr = (new StringErrorInfo( SCERR_EXPORT_SQLEXCEPTION, aException.Message, ErrorHandlerFlags::ButtonsOk | ErrorHandlerFlags::MessageError))->GetErrorCode();
+ nErr = (new StringErrorInfo( SCERR_EXPORT_SQLEXCEPTION, aException.Message, ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR))->GetErrorCode();
else
nErr = SCERR_EXPORT_DATA;
}
diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx
index 9f8c176..d79ff01 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -249,13 +249,13 @@ sal_Int32 ReadThroughComponent(
(bMustBeSuccessfull ? ERR_FORMAT_FILE_ROWCOL
: WARN_FORMAT_FILE_ROWCOL),
rStreamName, sErr,
- ErrorHandlerFlags::ButtonsOk | ErrorHandlerFlags::MessageError ))->GetErrorCode();
+ ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode();
}
else
{
DBG_ASSERT( bMustBeSuccessfull, "Warnings are not supported" );
return (new StringErrorInfo( ERR_FORMAT_ROWCOL, sErr,
- ErrorHandlerFlags::ButtonsOk | ErrorHandlerFlags::MessageError ))->GetErrorCode();
+ ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode();
}
}
catch (const xml::sax::SAXException& r)
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 8c2faed..95c3557 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2297,7 +2297,7 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium,
if (rWrapped.TargetException >>= e)
{
SetError((new StringErrorInfo(ERRCODE_SFX_FORMAT_ROWCOL,
- e.Message, ErrorHandlerFlags::ButtonsOk | ErrorHandlerFlags::MessageError ))->GetErrorCode(), "");
+ e.Message, ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode(), "");
}
}
catch (...)
diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx
index 6a3481f..577953b 100644
--- a/svtools/source/misc/ehdl.cxx
+++ b/svtools/source/misc/ehdl.cxx
@@ -31,9 +31,9 @@
#include <memory>
-static ErrorHandlerFlags aWndFunc(
+static sal_uInt16 aWndFunc(
vcl::Window *pWin, // Parent of the dialog
- ErrorHandlerFlags nFlags,
+ sal_uInt16 nFlags,
const OUString &rErr, // error text
const OUString &rAction) // action text
@@ -52,35 +52,34 @@ static ErrorHandlerFlags aWndFunc(
// determine necessary WinBits from the flags
WinBits eBits=0;
- if ( nFlags & (ErrorHandlerFlags::ButtonsCancel | ErrorHandlerFlags::ButtonsRetry) )
+ if ( (ERRCODE_BUTTON_CANCEL|ERRCODE_BUTTON_RETRY) == (nFlags & (ERRCODE_BUTTON_CANCEL|ERRCODE_BUTTON_RETRY)) )
eBits = WB_RETRY_CANCEL;
- else if ( nFlags & ErrorHandlerFlags::ButtonsOkCancel )
+ else if ( ERRCODE_BUTTON_OK_CANCEL == (nFlags & ERRCODE_BUTTON_OK_CANCEL) )
eBits = WB_OK_CANCEL;
- else if ( nFlags & ErrorHandlerFlags::ButtonsOk )
+ else if ( ERRCODE_BUTTON_OK == (nFlags & ERRCODE_BUTTON_OK) )
eBits = WB_OK;
- else if ( nFlags & ErrorHandlerFlags::ButtonsYesNoCancel )
+ else if ( ERRCODE_BUTTON_YES_NO_CANCEL == (nFlags & ERRCODE_BUTTON_YES_NO_CANCEL) )
eBits = WB_YES_NO_CANCEL;
- else if ( nFlags & ErrorHandlerFlags::ButtonsYesNo )
+ else if ( ERRCODE_BUTTON_YES_NO == (nFlags & ERRCODE_BUTTON_YES_NO) )
eBits = WB_YES_NO;
- switch(nFlags & ErrorHandlerFlags(0x0f00))
+ switch(nFlags & 0x0f00)
{
- case ErrorHandlerFlags::ButtonDefaultsOk:
+ case ERRCODE_BUTTON_DEF_OK:
eBits |= WB_DEF_OK;
break;
- case ErrorHandlerFlags::ButtonDefaultsCancel:
+ case ERRCODE_BUTTON_DEF_CANCEL:
eBits |= WB_DEF_CANCEL;
break;
- case ErrorHandlerFlags::ButtonDefaultsYes:
+ case ERRCODE_BUTTON_DEF_YES:
eBits |= WB_DEF_YES;
break;
- case ErrorHandlerFlags::ButtonDefaultsNo:
+ case ERRCODE_BUTTON_DEF_NO:
eBits |= WB_DEF_NO;
break;
- default: break;
}
OUString aErr(SvtResId(STR_ERR_HDLMESS).toString());
@@ -91,48 +90,48 @@ static ErrorHandlerFlags aWndFunc(
aErr = aErr.replaceAll("$(ERROR)", rErr);
VclPtr<MessBox> pBox;
- switch ( nFlags & ErrorHandlerFlags(0xf000) )
+ switch ( nFlags & 0xf000 )
{
- case ErrorHandlerFlags::MessageError:
+ case ERRCODE_MSG_ERROR:
pBox.reset(VclPtr<ErrorBox>::Create(pWin, eBits, aErr));
break;
- case ErrorHandlerFlags::MessageWarning:
+ case ERRCODE_MSG_WARNING:
pBox.reset(VclPtr<WarningBox>::Create(pWin, eBits, aErr));
break;
- case ErrorHandlerFlags::MessageInfo:
+ case ERRCODE_MSG_INFO:
pBox.reset(VclPtr<InfoBox>::Create(pWin, aErr));
break;
- case ErrorHandlerFlags::MessageQuery:
+ case ERRCODE_MSG_QUERY:
pBox.reset(VclPtr<QueryBox>::Create(pWin, eBits, aErr));
break;
default:
{
SAL_WARN( "svtools.misc", "no MessBox type");
- return ErrorHandlerFlags::ButtonsOk;
+ return ERRCODE_BUTTON_OK;
}
}
- ErrorHandlerFlags nRet = ErrorHandlerFlags::NONE;
+ sal_uInt16 nRet = RET_CANCEL;
switch ( pBox->Execute() )
{
case RET_OK:
- nRet = ErrorHandlerFlags::ButtonsOk;
+ nRet = ERRCODE_BUTTON_OK;
break;
case RET_CANCEL:
- nRet = ErrorHandlerFlags::ButtonsCancel;
+ nRet = ERRCODE_BUTTON_CANCEL;
break;
case RET_RETRY:
- nRet = ErrorHandlerFlags::ButtonsRetry;
+ nRet = ERRCODE_BUTTON_RETRY;
break;
case RET_YES:
- nRet = ErrorHandlerFlags::ButtonsYes;
+ nRet = ERRCODE_BUTTON_YES;
break;
case RET_NO:
- nRet = ErrorHandlerFlags::ButtonsNo;
+ nRet = ERRCODE_BUTTON_NO;
break;
default:
SAL_WARN( "svtools.misc", "Unknown MessBox return value" );
@@ -163,7 +162,7 @@ SfxErrorHandler::~SfxErrorHandler()
bool SfxErrorHandler::CreateString(
- const ErrorInfo *pErr, OUString &rStr, ErrorHandlerFlags& nFlags) const
+ const ErrorInfo *pErr, OUString &rStr, sal_uInt16& nFlags) const
/* [Description]
@@ -207,9 +206,9 @@ class ResString: public OUString
*/
{
- ErrorHandlerFlags nFlags;
+ sal_uInt16 nFlags;
public:
- ErrorHandlerFlags GetFlags() const {return nFlags;}
+ sal_uInt16 GetFlags() const {return nFlags;}
const OUString & GetString() const {return *this;}
explicit ResString( ResId &rId);
};
@@ -217,12 +216,12 @@ class ResString: public OUString
ResString::ResString(ResId & rId):
OUString(rId.SetAutoRelease(false).toString()),
- nFlags(ErrorHandlerFlags::NONE)
+ nFlags(0)
{
ResMgr * pResMgr = rId.GetResMgr();
// String ctor temporarily sets global ResManager
if (pResMgr->GetRemainSize())
- nFlags = ErrorHandlerFlags(pResMgr->ReadShort());
+ nFlags = sal_uInt16(pResMgr->ReadShort());
rId.SetAutoRelease(true);
pResMgr->PopContext();
}
@@ -274,7 +273,7 @@ void SfxErrorHandler::GetClassString(sal_uLong lClassId, OUString &rStr)
bool SfxErrorHandler::GetErrorString(
- sal_uLong lErrId, OUString &rStr, ErrorHandlerFlags &nFlags) const
+ sal_uLong lErrId, OUString &rStr, sal_uInt16 &nFlags) const
/* [Description]
@@ -296,8 +295,8 @@ bool SfxErrorHandler::GetErrorString(
{
ResString aErrorString(aEr.GetResString());
- ErrorHandlerFlags nResFlags = aErrorString.GetFlags();
- if ( nResFlags != ErrorHandlerFlags::NONE )
+ sal_uInt16 nResFlags = aErrorString.GetFlags();
+ if ( nResFlags )
nFlags = nResFlags;
rStr = rStr.replaceAll("$(ERROR)", aErrorString.GetString());
bRet = true;
diff --git a/svx/source/src/errtxt.src b/svx/source/src/errtxt.src
index af5e40e..40ff546 100644
--- a/svx/source/src/errtxt.src
+++ b/svx/source/src/errtxt.src
@@ -338,6 +338,11 @@ Resource RID_ERRHDL
{
Text [ en-US ] = "The requested Internet data is not available in the cache and cannot be transmitted as the Online mode has not be activated." ;
};
+ String ERRCODE_SFXMSG_STYLEREPLACE
+ {
+ ExtraData = ERRCODE_MSG_ERROR | ERRCODE_BUTTON_OK_CANCEL ;
+ Text [ en-US ] = "Should the $(ARG1) Style be replaced?" ;
+ };
String ERRCODE_SFX_NOFILTER
{
Text [ en-US ] = "A filter has not been found." ;
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index c795569..86c4fd7 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -189,7 +189,7 @@ bool SwFEShell::InsertRow( sal_uInt16 nCnt, bool bBehind )
if( dynamic_cast< const SwDDETable* >(pFrame->ImplFindTabFrame()->GetTable()) != nullptr )
{
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
- ErrorHandlerFlags::MessageInfo | ErrorHandlerFlags::ButtonDefaultsOk );
+ ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
return false;
}
@@ -230,7 +230,7 @@ bool SwFEShell::InsertCol( sal_uInt16 nCnt, bool bBehind )
if( dynamic_cast< const SwDDETable* >(pFrame->ImplFindTabFrame()->GetTable()) != nullptr )
{
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
- ErrorHandlerFlags::MessageInfo | ErrorHandlerFlags::ButtonDefaultsOk );
+ ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
return false;
}
@@ -239,7 +239,7 @@ bool SwFEShell::InsertCol( sal_uInt16 nCnt, bool bBehind )
if( !CheckSplitCells( *this, nCnt + 1, nsSwTableSearchType::TBLSEARCH_COL ) )
{
ErrorHandler::HandleError( ERR_TBLINSCOL_ERROR,
- ErrorHandlerFlags::MessageInfo | ErrorHandlerFlags::ButtonDefaultsOk );
+ ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
return false;
}
@@ -285,7 +285,7 @@ bool SwFEShell::DeleteCol()
if( dynamic_cast< const SwDDETable* >(pFrame->ImplFindTabFrame()->GetTable()) != nullptr )
{
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
- ErrorHandlerFlags::MessageInfo | ErrorHandlerFlags::ButtonDefaultsOk );
+ ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
return false;
}
@@ -336,7 +336,7 @@ bool SwFEShell::DeleteRow(bool bCompleteTable)
if( dynamic_cast< const SwDDETable* >(pFrame->ImplFindTabFrame()->GetTable()) != nullptr )
{
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
- ErrorHandlerFlags::MessageInfo | ErrorHandlerFlags::ButtonDefaultsOk );
+ ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
return false;
}
@@ -455,7 +455,7 @@ sal_uInt16 SwFEShell::MergeTab()
if( dynamic_cast< const SwDDETable* >(&pTableNd->GetTable()) != nullptr )
{
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
- ErrorHandlerFlags::MessageInfo | ErrorHandlerFlags::ButtonDefaultsOk );
+ ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
}
else
{
@@ -486,7 +486,7 @@ bool SwFEShell::SplitTab( bool bVert, sal_uInt16 nCnt, bool bSameHeight )
if( dynamic_cast< const SwDDETable* >(pFrame->ImplFindTabFrame()->GetTable()) != nullptr )
{
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
- ErrorHandlerFlags::MessageInfo | ErrorHandlerFlags::ButtonDefaultsOk );
+ ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
return false;
}
@@ -495,7 +495,7 @@ bool SwFEShell::SplitTab( bool bVert, sal_uInt16 nCnt, bool bSameHeight )
if( bVert && !CheckSplitCells( *this, nCnt + 1 ) )
{
ErrorHandler::HandleError( ERR_TBLSPLIT_ERROR,
- ErrorHandlerFlags::MessageInfo | ErrorHandlerFlags::ButtonDefaultsOk );
+ ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
return false;
}
StartAllAction();
@@ -1295,7 +1295,7 @@ bool SwFEShell::DeleteTableSel()
if( dynamic_cast< const SwDDETable* >(pFrame->ImplFindTabFrame()->GetTable()) != nullptr )
{
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
- ErrorHandlerFlags::MessageInfo | ErrorHandlerFlags::ButtonDefaultsOk );
+ ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
return false;
}
@@ -2162,7 +2162,7 @@ bool SwFEShell::SetColRowWidthHeight( sal_uInt16 eType, sal_uInt16 nDiff )
dynamic_cast< const SwDDETable* >(pFrame->ImplFindTabFrame()->GetTable()) != nullptr )
{
ErrorHandler::HandleError( ERR_TBLDDECHG_ERROR,
- ErrorHandlerFlags::MessageInfo | ErrorHandlerFlags::ButtonDefaultsOk );
+ ERRCODE_MSG_INFO | ERRCODE_BUTTON_DEF_OK );
return false;
}
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx
index 3df726b..830a9b0 100644
--- a/sw/source/filter/html/swhtml.cxx
+++ b/sw/source/filter/html/swhtml.cxx
@@ -227,7 +227,7 @@ sal_uLong HTMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPam,
// den Stream als Fehlernummer Transporter benutzen
nRet = (new StringErrorInfo( ERR_FORMAT_ROWCOL, sErr,
- ErrorHandlerFlags::ButtonsOk | ErrorHandlerFlags::MessageError ))->GetErrorCode();
+ ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode();
}
return nRet;
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index 675599e..374029e 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -210,13 +210,13 @@ sal_Int32 ReadThroughComponent(
(bMustBeSuccessfull ? ERR_FORMAT_FILE_ROWCOL
: WARN_FORMAT_FILE_ROWCOL),
rStreamName, sErr,
- ErrorHandlerFlags::ButtonsOk | ErrorHandlerFlags::MessageError ))->GetErrorCode();
+ ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode();
}
else
{
OSL_ENSURE( bMustBeSuccessfull, "Warnings are not supported" );
return (new StringErrorInfo( ERR_FORMAT_ROWCOL, sErr,
- ErrorHandlerFlags::ButtonsOk | ErrorHandlerFlags::MessageError ))->GetErrorCode();
+ ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode();
}
}
catch(const xml::sax::SAXException& r)
diff --git a/sw/source/filter/xml/wrtxml.cxx b/sw/source/filter/xml/wrtxml.cxx
index 92081a4..a2494ef 100644
--- a/sw/source/filter/xml/wrtxml.cxx
+++ b/sw/source/filter/xml/wrtxml.cxx
@@ -414,14 +414,14 @@ sal_uInt32 SwXMLWriter::Write_( const uno::Reference < task::XStatusIndicator >&
{
if( !sErrFile.isEmpty() )
return (new StringErrorInfo( ERR_WRITE_ERROR_FILE, sErrFile,
- ErrorHandlerFlags::ButtonsOk | ErrorHandlerFlags::MessageError ))->GetErrorCode();
+ ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode();
return ERR_SWG_WRITE_ERROR;
}
else if( bWarn )
{
if( !sWarnFile.isEmpty() )
return (new StringErrorInfo( WARN_WRITE_ERROR_FILE, sWarnFile,
- ErrorHandlerFlags::ButtonsOk | ErrorHandlerFlags::MessageError ))->GetErrorCode();
+ ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode();
return WARN_SWG_FEATURES_LOST;
}
diff --git a/sw/source/uibase/misc/glosdoc.cxx b/sw/source/uibase/misc/glosdoc.cxx
index 25210bc..513aba7 100644
--- a/sw/source/uibase/misc/glosdoc.cxx
+++ b/sw/source/uibase/misc/glosdoc.cxx
@@ -400,7 +400,7 @@ void SwGlossaries::UpdateGlosPath(bool bFull)
ErrorHandler::HandleError( (new StringErrorInfo(
ERR_AUTOPATH_ERROR, lcl_makePath(m_aInvalidPaths),
- ErrorHandlerFlags::ButtonsOk | ErrorHandlerFlags::MessageError ))->GetErrorCode());
+ ERRCODE_BUTTON_OK | ERRCODE_MSG_ERROR ))->GetErrorCode());
m_bError = true;
}
else
@@ -420,7 +420,7 @@ void SwGlossaries::UpdateGlosPath(bool bFull)
void SwGlossaries::ShowError()
{
sal_uInt32 nPathError = (new StringErrorInfo(ERR_AUTOPATH_ERROR,
- lcl_makePath(m_aInvalidPaths), ErrorHandlerFlags::ButtonsOk ))->GetErrorCode();
+ lcl_makePath(m_aInvalidPaths), ERRCODE_BUTTON_OK ))->GetErrorCode();
ErrorHandler::HandleError( nPathError );
}
diff --git a/tools/source/ref/errinf.cxx b/tools/source/ref/errinf.cxx
index 754a888..539151c 100644
--- a/tools/source/ref/errinf.cxx
+++ b/tools/source/ref/errinf.cxx
@@ -47,8 +47,8 @@ struct TheEDcrData: public rtl::Static<EDcrData, TheEDcrData> {};
class DynamicErrorInfo_Impl
{
- ErrCode lErrId;
- ErrorHandlerFlags nMask;
+ sal_uIntPtr lErrId;
+ sal_uInt16 nMask;
void RegisterEDcr(DynamicErrorInfo *);
static void UnRegisterEDcr(DynamicErrorInfo const *);
@@ -110,7 +110,7 @@ sal_uIntPtr DynamicErrorInfo::GetErrorCode() const
return pImpl->lErrId;
}
-DynamicErrorInfo::DynamicErrorInfo(sal_uIntPtr lArgUserId, ErrorHandlerFlags nMask)
+DynamicErrorInfo::DynamicErrorInfo(sal_uIntPtr lArgUserId, sal_uInt16 nMask)
: ErrorInfo(lArgUserId),
pImpl(new DynamicErrorInfo_Impl)
{
@@ -133,13 +133,13 @@ ErrorInfo* DynamicErrorInfo_Impl::GetDynamicErrorInfo(sal_uIntPtr lId)
return new ErrorInfo(lId & ~ERRCODE_DYNAMIC_MASK);
}
-ErrorHandlerFlags DynamicErrorInfo::GetDialogMask() const
+sal_uInt16 DynamicErrorInfo::GetDialogMask() const
{
return pImpl->nMask;
}
StringErrorInfo::StringErrorInfo(
- sal_uIntPtr UserId, const OUString& aStringP, ErrorHandlerFlags nMask)
+ sal_uIntPtr UserId, const OUString& aStringP, sal_uInt16 nMask)
: DynamicErrorInfo(UserId, nMask), aString(aStringP)
{
}
@@ -147,7 +147,7 @@ StringErrorInfo::StringErrorInfo(
class ErrorHandler_Impl
{
public:
- static bool CreateString(const ErrorInfo*, OUString&, ErrorHandlerFlags&);
+ static bool CreateString(const ErrorInfo*, OUString&, sal_uInt16&);
};
static void aDspFunc(const OUString &rErr, const OUString &rAction)
@@ -226,25 +226,25 @@ void ErrorHandler::RegisterDisplay(BasicDisplayErrorFunc *aDsp)
1. nFlags,
2. Resource Flags
3. Dynamic Flags
- 4. Default ButtonsOk, MessageError
+ 4. Default ERRCODE_BUTTON_OK, ERRCODE_MSG_ERROR
- @param nErrCodeId error id
+ @param lId error id
@param nFlags error flags.
@param bJustCreateString ???
@param rError ???
@return ???
*/
-ErrorHandlerFlags ErrorHandler::HandleError_Impl(
- sal_uIntPtr nErrCodeId, ErrorHandlerFlags nFlags, bool bJustCreateString, OUString & rError)
+sal_uInt16 ErrorHandler::HandleError_Impl(
+ sal_uIntPtr lId, sal_uInt16 nFlags, bool bJustCreateString, OUString & rError)
{
OUString aErr;
OUString aAction;
- if(!nErrCodeId || nErrCodeId == ERRCODE_ABORT)
- return ErrorHandlerFlags::NONE;
+ if(!lId || lId == ERRCODE_ABORT)
+ return 0;
EDcrData &rData = TheEDcrData::get();
vcl::Window *pParent = nullptr;
- ErrorInfo *pInfo = ErrorInfo::GetErrorInfo(nErrCodeId);
+ ErrorInfo *pInfo = ErrorInfo::GetErrorInfo(lId);
if (!rData.contexts.empty())
{
rData.contexts.front()->GetString(pInfo->GetErrorCode(), aAction);
@@ -257,18 +257,18 @@ ErrorHandlerFlags ErrorHandler::HandleError_Impl(
}
}
- bool bWarning = ((nErrCodeId & ERRCODE_WARNING_MASK) == ERRCODE_WARNING_MASK);
- ErrorHandlerFlags nErrFlags = ErrorHandlerFlags::ButtonDefaultsOk | ErrorHandlerFlags::ButtonsOk;
+ bool bWarning = ((lId & ERRCODE_WARNING_MASK) == ERRCODE_WARNING_MASK);
+ sal_uInt16 nErrFlags = ERRCODE_BUTTON_DEF_OK | ERRCODE_BUTTON_OK;
if (bWarning)
- nErrFlags |= ErrorHandlerFlags::MessageWarning;
+ nErrFlags |= ERRCODE_MSG_WARNING;
else
- nErrFlags |= ErrorHandlerFlags::MessageError;
+ nErrFlags |= ERRCODE_MSG_ERROR;
DynamicErrorInfo* pDynPtr=dynamic_cast<DynamicErrorInfo*>(pInfo);
if(pDynPtr)
{
- ErrorHandlerFlags nDynFlags = pDynPtr->GetDialogMask();
- if( nDynFlags != ErrorHandlerFlags::NONE )
+ sal_uInt16 nDynFlags = pDynPtr->GetDialogMask();
+ if( nDynFlags )
nErrFlags = nDynFlags;
}
@@ -277,7 +277,7 @@ ErrorHandlerFlags ErrorHandler::HandleError_Impl(
if (bJustCreateString)
{
rError = aErr;
- return ErrorHandlerFlags::ButtonsOk;
+ return 1;
}
else
{
@@ -295,11 +295,11 @@ ErrorHandlerFlags ErrorHandler::HandleError_Impl(
if(!rData.bIsWindowDsp)
{
(*reinterpret_cast<BasicDisplayErrorFunc*>(rData.pDsp))(aErr,aAction);
- return ErrorHandlerFlags::NONE;
+ return 0;
}
else
{
- if (nFlags != ErrorHandlerFlags::MAX)
+ if (nFlags != USHRT_MAX)
nErrFlags = nFlags;
return (*reinterpret_cast<WindowDisplayErrorFunc*>(rData.pDsp))(
pParent, nErrFlags, aErr, aAction);
@@ -311,34 +311,34 @@ ErrorHandlerFlags ErrorHandler::HandleError_Impl(
// Error 1 is General Error in the Sfx
if(pInfo->GetErrorCode()!=1)
{
- HandleError_Impl(1, ErrorHandlerFlags::MAX, bJustCreateString, rError);
+ HandleError_Impl(1, USHRT_MAX, bJustCreateString, rError);
}
else
{
OSL_FAIL("Error 1 nicht gehandeled");
}
delete pInfo;
- return ErrorHandlerFlags::NONE;
+ return 0;
}
// static
bool ErrorHandler::GetErrorString(sal_uIntPtr lId, OUString& rStr)
{
- return HandleError_Impl( lId, ErrorHandlerFlags::MAX, true, rStr ) != ErrorHandlerFlags::NONE;
+ return (bool)HandleError_Impl( lId, USHRT_MAX, true, rStr );
}
/** Handles an error.
@see ErrorHandler::HandleError_Impl
*/
-ErrorHandlerFlags ErrorHandler::HandleError(sal_uIntPtr lId, ErrorHandlerFlags nFlags)
+sal_uInt16 ErrorHandler::HandleError(sal_uIntPtr lId, sal_uInt16 nFlags)
{
OUString aDummy;
return HandleError_Impl( lId, nFlags, false, aDummy );
}
bool ErrorHandler_Impl::CreateString( const ErrorInfo* pInfo, OUString& pStr,
- ErrorHandlerFlags &rFlags)
+ sal_uInt16 &rFlags)
{
for(const ErrorHandler *pHdl : TheEDcrData::get().errorHandlers)
{
diff --git a/uui/source/iahndl-authentication.cxx b/uui/source/iahndl-authentication.cxx
index 3701f73..9e07550 100644
--- a/uui/source/iahndl-authentication.cxx
+++ b/uui/source/iahndl-authentication.cxx
@@ -113,8 +113,8 @@ executeLoginDialog(
if ( bCanUseSysCreds )
xDialog->SetUseSystemCredentials( rInfo.GetIsUseSystemCredentials() );
- rInfo.SetResult(xDialog->Execute() == RET_OK ? ErrorHandlerFlags::ButtonsOk :
- ErrorHandlerFlags::ButtonsCancel);
+ rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK :
+ ERRCODE_BUTTON_CANCEL);
rInfo.SetUserName(xDialog->GetName());
rInfo.SetPassword(xDialog->GetPassword());
rInfo.SetAccount(xDialog->GetAccount());
@@ -276,7 +276,7 @@ handleAuthenticationRequest_(
rRequest.HasRealm ? rRequest.Realm : OUString());
switch (aInfo.GetResult())
{
- case ErrorHandlerFlags::ButtonsOk:
+ case ERRCODE_BUTTON_OK:
if (xSupplyAuthentication.is())
{
if (xSupplyAuthentication->canSetUserName())
@@ -390,7 +390,7 @@ handleAuthenticationRequest_(
}
break;
- case ErrorHandlerFlags::ButtonsRetry:
+ case ERRCODE_BUTTON_RETRY:
if (xRetry.is())
xRetry->select();
break;
@@ -419,7 +419,7 @@ executeMasterPasswordDialog(
ScopedVclPtrInstance< MasterPasswordCreateDialog > xDialog(
pParent, xManager.get());
rInfo.SetResult(xDialog->Execute()
- == RET_OK ? ErrorHandlerFlags::ButtonsOk : ErrorHandlerFlags::ButtonsCancel);
+ == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL);
aMaster = OUStringToOString(
xDialog->GetMasterPassword(), RTL_TEXTENCODING_UTF8);
}
@@ -428,7 +428,7 @@ executeMasterPasswordDialog(
ScopedVclPtrInstance< MasterPasswordDialog > xDialog(
pParent, nMode, xManager.get());
rInfo.SetResult(xDialog->Execute()
- == RET_OK ? ErrorHandlerFlags::ButtonsOk : ErrorHandlerFlags::ButtonsCancel);
+ == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL);
aMaster = OUStringToOString(
xDialog->GetMasterPassword(), RTL_TEXTENCODING_UTF8);
}
@@ -476,7 +476,7 @@ handleMasterPasswordRequest_(
switch (aInfo.GetResult())
{
- case ErrorHandlerFlags::ButtonsOk:
+ case ERRCODE_BUTTON_OK:
if (xSupplyAuthentication.is())
{
if (xSupplyAuthentication->canSetPassword())
@@ -485,7 +485,7 @@ handleMasterPasswordRequest_(
}
break;
- case ErrorHandlerFlags::ButtonsRetry:
+ case ERRCODE_BUTTON_RETRY:
if (xRetry.is())
xRetry->select();
break;
@@ -520,7 +520,7 @@ executePasswordDialog(
bIsPasswordToModify, bIsSimplePasswordRequest);
xDialog->SetMinLen(0);
- rInfo.SetResult(xDialog->Execute() == RET_OK ? ErrorHandlerFlags::ButtonsOk : ErrorHandlerFlags::ButtonsCancel);
+ rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL);
rInfo.SetPassword(xDialog->GetPassword());
}
else
@@ -531,7 +531,7 @@ executePasswordDialog(
ScopedVclPtr<AbstractPasswordToOpenModifyDialog> const pDialog(
pFact->CreatePasswordToOpenModifyDialog(pParent, nMaxPasswdLen, bIsPasswordToModify));
- rInfo.SetResult( pDialog->Execute() == RET_OK ? ErrorHandlerFlags::ButtonsOk : ErrorHandlerFlags::ButtonsCancel );
+ rInfo.SetResult( pDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL );
rInfo.SetPassword( pDialog->GetPasswordToOpen() );
rInfo.SetPasswordToModify( pDialog->GetPasswordToModify() );
rInfo.SetRecommendToOpenReadonly( pDialog->IsRecommendToOpenReadonly() );
@@ -543,7 +543,7 @@ executePasswordDialog(
bIsPasswordToModify, bIsSimplePasswordRequest);
xDialog->SetMinLen(0);
- rInfo.SetResult(xDialog->Execute() == RET_OK ? ErrorHandlerFlags::ButtonsOk : ErrorHandlerFlags::ButtonsCancel);
+ rInfo.SetResult(xDialog->Execute() == RET_OK ? ERRCODE_BUTTON_OK : ERRCODE_BUTTON_CANCEL);
rInfo.SetPassword(bIsPasswordToModify ? OUString() : xDialog->GetPassword());
rInfo.SetPasswordToModify(bIsPasswordToModify ? xDialog->GetPassword() : OUString());
}
@@ -582,7 +582,7 @@ handlePasswordRequest_(
switch (aInfo.GetResult())
{
- case ErrorHandlerFlags::ButtonsOk:
+ case ERRCODE_BUTTON_OK:
OSL_ENSURE( !bIsPasswordToModify || xPassword2.is(), "PasswordToModify is requested, but there is no Interaction!" );
if (xPassword.is())
{
@@ -597,7 +597,7 @@ handlePasswordRequest_(
}
break;
- case ErrorHandlerFlags::ButtonsRetry:
+ case ERRCODE_BUTTON_RETRY:
if (xRetry.is())
xRetry->select();
break;
diff --git a/uui/source/iahndl-errorhandler.cxx b/uui/source/iahndl-errorhandler.cxx
index a549cc2..786ba75 100644
--- a/uui/source/iahndl-errorhandler.cxx
+++ b/uui/source/iahndl-errorhandler.cxx
@@ -40,7 +40,7 @@ using namespace com::sun::star;
namespace {
-ErrorHandlerFlags
+sal_uInt16
executeErrorDialog(
vcl::Window * pParent,
task::InteractionClassification eClassification,
@@ -101,29 +101,27 @@ executeErrorDialog(
throw uno::RuntimeException("out of memory");
}
- sal_uInt16 aMessResult = xBox->Execute();
+ sal_uInt16 aResult = xBox->Execute();
xBox.disposeAndClear();
- ErrorHandlerFlags aResult = ErrorHandlerFlags::NONE;
- switch( aMessResult )
+ switch( aResult )
{
case RET_OK:
- aResult = ErrorHandlerFlags::ButtonsOk;
+ aResult = ERRCODE_BUTTON_OK;
break;
case RET_CANCEL:
- aResult = ErrorHandlerFlags::ButtonsCancel;
+ aResult = ERRCODE_BUTTON_CANCEL;
break;
case RET_YES:
- aResult = ErrorHandlerFlags::ButtonsYes;
+ aResult = ERRCODE_BUTTON_YES;
break;
case RET_NO:
- aResult = ErrorHandlerFlags::ButtonsNo;
+ aResult = ERRCODE_BUTTON_NO;
break;
case RET_RETRY:
- aResult = ErrorHandlerFlags::ButtonsRetry;
+ aResult = ERRCODE_BUTTON_RETRY;
break;
- default: assert(false);
}
return aResult;
@@ -259,12 +257,12 @@ UUIInteractionHelper::handleErrorHandlerRequest(
}
}
- ErrorHandlerFlags nResult = executeErrorDialog(
+ sal_uInt16 nResult = executeErrorDialog(
getParentProperty(), eClassification, aContext, aMessage, nButtonMask );
switch (nResult)
{
- case ErrorHandlerFlags::ButtonsOk:
+ case ERRCODE_BUTTON_OK:
OSL_ENSURE(xApprove.is() || xAbort.is(), "unexpected situation");
if (xApprove.is())
xApprove->select();
@@ -272,31 +270,29 @@ UUIInteractionHelper::handleErrorHandlerRequest(
xAbort->select();
break;
- case ErrorHandlerFlags::ButtonsCancel:
+ case ERRCODE_BUTTON_CANCEL:
OSL_ENSURE(xAbort.is(), "unexpected situation");
if (xAbort.is())
xAbort->select();
break;
- case ErrorHandlerFlags::ButtonsRetry:
+ case ERRCODE_BUTTON_RETRY:
OSL_ENSURE(xRetry.is(), "unexpected situation");
if (xRetry.is())
xRetry->select();
break;
- case ErrorHandlerFlags::ButtonsNo:
+ case ERRCODE_BUTTON_NO:
OSL_ENSURE(xDisapprove.is(), "unexpected situation");
if (xDisapprove.is())
xDisapprove->select();
break;
- case ErrorHandlerFlags::ButtonsYes:
+ case ERRCODE_BUTTON_YES:
OSL_ENSURE(xApprove.is(), "unexpected situation");
if (xApprove.is())
xApprove->select();
break;
-
- default: break;
}
}
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx
index f2915b1..31074fb 100644
--- a/uui/source/iahndl.cxx
+++ b/uui/source/iahndl.cxx
@@ -987,7 +987,7 @@ UUIInteractionHelper::getInteractionHandler()
namespace {
-ErrorHandlerFlags
+sal_uInt16
executeMessageBox(
vcl::Window * pParent,
OUString const & rTitle,
@@ -998,26 +998,24 @@ executeMessageBox(
ScopedVclPtrInstance< MessBox > xBox(pParent, nButtonMask, rTitle, rMessage);
- sal_uInt16 aMessResult = xBox->Execute();
- ErrorHandlerFlags aResult = ErrorHandlerFlags::NONE;
- switch( aMessResult )
+ sal_uInt16 aResult = xBox->Execute();
+ switch( aResult )
{
case RET_OK:
- aResult = ErrorHandlerFlags::ButtonsOk;
+ aResult = ERRCODE_BUTTON_OK;
break;
case RET_CANCEL:
- aResult = ErrorHandlerFlags::ButtonsCancel;
+ aResult = ERRCODE_BUTTON_CANCEL;
break;
case RET_YES:
- aResult = ErrorHandlerFlags::ButtonsYes;
+ aResult = ERRCODE_BUTTON_YES;
break;
case RET_NO:
- aResult = ErrorHandlerFlags::ButtonsNo;
+ aResult = ERRCODE_BUTTON_NO;
break;
case RET_RETRY:
- aResult = ErrorHandlerFlags::ButtonsRetry;
+ aResult = ERRCODE_BUTTON_RETRY;
break;
- default: assert(false);
}
return aResult;
@@ -1272,25 +1270,23 @@ UUIInteractionHelper::handleBrokenPackageRequest(
switch (
executeMessageBox( getParentProperty(), title, aMessage, nButtonMask ) )
{
- case ErrorHandlerFlags::ButtonsOk:
+ case ERRCODE_BUTTON_OK:
OSL_ENSURE( xAbort.is(), "unexpected situation" );
if (xAbort.is())
xAbort->select();
break;
- case ErrorHandlerFlags::ButtonsNo:
+ case ERRCODE_BUTTON_NO:
OSL_ENSURE(xDisapprove.is(), "unexpected situation");
if (xDisapprove.is())
xDisapprove->select();
break;
- case ErrorHandlerFlags::ButtonsYes:
+ case ERRCODE_BUTTON_YES:
OSL_ENSURE(xApprove.is(), "unexpected situation");
if (xApprove.is())
xApprove->select();
break;
-
- default: break;
}
}
diff --git a/uui/source/loginerr.hxx b/uui/source/loginerr.hxx
index ae0775a..db4ce88 100644
--- a/uui/source/loginerr.hxx
+++ b/uui/source/loginerr.hxx
@@ -43,13 +43,13 @@ private:
OUString m_aPath;
OUString m_aErrorText;
sal_uInt8 m_nFlags;
- ErrorHandlerFlags m_nRet;
+ sal_uInt16 m_nRet;
bool m_bRecommendToOpenReadonly;
public:
LoginErrorInfo()
: m_nFlags(LOGINERROR_FLAG_MODIFY_USER_NAME)
- , m_nRet(ErrorHandlerFlags::ButtonsCancel)
+ , m_nRet(ERRCODE_BUTTON_CANCEL)
, m_bRecommendToOpenReadonly(false)
{
}
@@ -71,8 +71,8 @@ public:
bool GetIsUseSystemCredentials() const
{ return ( m_nFlags & LOGINERROR_FLAG_IS_USE_SYSCREDS ) ==
LOGINERROR_FLAG_IS_USE_SYSCREDS; }
- sal_uInt8 GetFlags() const { return m_nFlags; }
- ErrorHandlerFlags GetResult() const { return m_nRet; }
+ sal_uInt8 GetFlags() const { return m_nFlags; }
+ sal_uInt16 GetResult() const { return m_nRet; }
void SetTitle( const OUString& aTitle )
{ m_aTitle = aTitle; }
@@ -100,7 +100,7 @@ public:
inline void SetModifyAccount( bool bSet );
inline void SetModifyUserName( bool bSet );
- void SetResult( ErrorHandlerFlags nRet )
+ void SetResult( sal_uInt16 nRet )
{ m_nRet = nRet; }
};
commit 178f5306979ef55a5682191dcdafb9e926e57cde
Author: Michael Stahl <mstahl at redhat.com>
Date: Tue Feb 7 21:39:27 2017 +0100
sfx2: if the exception thrown by filter isn't known...
... then don't silently ignore it but just abort. Evidently this cannot
happen, because if it were a real possibility the author of this
exception handler would have at least called SetError here.
Change-Id: Iaa5f1f1d4cac388ae08214f6031a8bc279e6fceb
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 4135b54..8c2faed 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2300,8 +2300,10 @@ bool SfxObjectShell::ImportFrom(SfxMedium& rMedium,
e.Message, ErrorHandlerFlags::ButtonsOk | ErrorHandlerFlags::MessageError ))->GetErrorCode(), "");
}
}
- catch(...)
- {}
+ catch (...)
+ {
+ std::abort(); // cannot happen
+ }
}
return false;
More information about the Libreoffice-commits
mailing list