diff options
author | Noel Grandin <noel@peralex.com> | 2016-02-11 14:33:36 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2016-02-11 14:47:01 +0200 |
commit | 4e13a6911259d3d7d23b61cb76614263608bbd95 (patch) | |
tree | 7dcd289f650a0a179b6ab3fd2934dea2252c42d5 /idl/inc | |
parent | 489dd9027f53e6328f281bf087bb5a59246f9500 (diff) |
use exceptions for error handling in .SDI parsing
to simplify the normal control flow
Change-Id: If325ec0507a51d8e2d3340fc5b628bb75a078a44
Diffstat (limited to 'idl/inc')
-rw-r--r-- | idl/inc/basobj.hxx | 2 | ||||
-rw-r--r-- | idl/inc/database.hxx | 15 | ||||
-rw-r--r-- | idl/inc/slot.hxx | 2 | ||||
-rw-r--r-- | idl/inc/types.hxx | 2 |
4 files changed, 14 insertions, 7 deletions
diff --git a/idl/inc/basobj.hxx b/idl/inc/basobj.hxx index 8b301264479a..12a1dc769c19 100644 --- a/idl/inc/basobj.hxx +++ b/idl/inc/basobj.hxx @@ -103,7 +103,7 @@ public: void SetName( const OString& rName ); virtual const OString & GetName() const { return aName; } - virtual bool Test( SvIdlDataBase &, SvTokenStream & rInStm ); + virtual bool Test( SvTokenStream & rInStm ); virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ); }; diff --git a/idl/inc/database.hxx b/idl/inc/database.hxx index 3b7f15f02534..22d6b7801f4b 100644 --- a/idl/inc/database.hxx +++ b/idl/inc/database.hxx @@ -28,6 +28,7 @@ #include <rtl/ustring.hxx> #include <set> +#include <exception> class SvCommand; @@ -53,6 +54,16 @@ public: } }; +class SvParseException : public std::exception +{ +public: + SvIdlError aError; + SvParseException( SvTokenStream & rInStm, const OString& rError ); + SvParseException( const OString& rError, SvToken& rTok ); +}; + + + class SvIdlDataBase { bool bExport; @@ -106,10 +117,6 @@ public: SvRefMemberList<SvMetaObject *>& GetStack() { return aContextStack; } void Write(const OString& rText); - static void WriteError(const OString& rErrWrn, - const OString& rFileName, - const OString& rErrorText, - sal_uLong nRow = 0, sal_uLong nColumn = 0 ); void WriteError( SvTokenStream & rInStm ); void SetError( const OString& rError, SvToken& rTok ); void SetAndWriteError( SvTokenStream & rInStm, const OString& rError ); diff --git a/idl/inc/slot.hxx b/idl/inc/slot.hxx index 8c838ad02633..93f127dd2a7a 100644 --- a/idl/inc/slot.hxx +++ b/idl/inc/slot.hxx @@ -136,7 +136,7 @@ public: void ResetSlotPointer() { pNextSlot = pLinkedSlot = nullptr; } - virtual bool Test( SvIdlDataBase &, SvTokenStream & rInStm ) override; + virtual bool Test( SvTokenStream & rInStm ) override; virtual void ReadAttributesSvIdl( SvIdlDataBase & rBase, SvTokenStream & rInStm ) override; virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override; diff --git a/idl/inc/types.hxx b/idl/inc/types.hxx index 34f12d740db2..748dc6ef637d 100644 --- a/idl/inc/types.hxx +++ b/idl/inc/types.hxx @@ -45,7 +45,7 @@ public: const SvIdentifier& GetSlotId() const; SvMetaType * GetType() const; - virtual bool Test( SvIdlDataBase &, SvTokenStream & rInStm ) override; + virtual bool Test( SvTokenStream & rInStm ) override; virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override; sal_uLong MakeSfx( OStringBuffer& rAtrrArray ); virtual void Insert( SvSlotElementList&, const OString& rPrefix, |