22#include <rtl/ustring.hxx>
24#include <com/sun/star/xml/sax/XLocator.hpp>
25#include <com/sun/star/xml/sax/SAXParseException.hpp>
26#include <com/sun/star/uno/Any.hxx>
27#include <com/sun/star/uno/Reference.hxx>
28#include <com/sun/star/uno/Sequence.hxx>
30#include <rtl/ustrbuf.hxx>
32using ::com::sun::star::uno::Any;
33using ::com::sun::star::uno::Sequence;
34using ::com::sun::star::uno::Reference;
35using ::com::sun::star::xml::sax::XLocator;
36using ::com::sun::star::xml::sax::SAXParseException;
47 const Sequence<OUString>& rParams,
48 OUString aExceptionMessage,
70 OUString aExceptionMessage, sal_Int32 nRowNumber, sal_Int32 nCol,
71 OUString aPublicId, OUString aSystemId) :
73 sExceptionMessage(
std::move(aExceptionMessage)),
76 sPublicId(
std::move(aPublicId)),
77 sSystemId(
std::move(aSystemId)),
92 const Sequence<OUString> & rParams,
93 const OUString& rExceptionMessage,
96 const OUString& rPublicId,
97 const OUString& rSystemId )
99 m_aErrors.emplace_back( nId, rParams, rExceptionMessage,
100 nRow, nColumn, rPublicId, rSystemId );
106 OUStringBuffer
sMessage(
"An error or a warning has occurred during XML import/export!\n" );
111 + OUString::number( nId, 16 )
114 sMessage.append( nFlags >> 28, 16 );
123 sMessage.append( nClass >> 16, 16 );
134 sMessage.append( OUString::number(nNumber, 16)
139 sal_Int32
nLength = rParams.getLength();
140 const OUString* pParams = rParams.getConstArray();
143 sMessage.append(
" " + OUString::number(i) +
": " + pParams[
i] +
"\n" );
147 sMessage.append(
"Exception-Message: " + rExceptionMessage +
"\n" );
150 if( (nRow != -1) || (nColumn != -1) )
152 sMessage.append(
"Position:\n Public Identifier: "
154 +
"\n System Identifier: "
157 + OUString::number( nRow )
159 + OUString::number( nColumn )
169 const Sequence<OUString> & rParams,
170 const OUString& rExceptionMessage,
171 const Reference<XLocator> & rLocator)
175 AddRecord( nId, rParams, rExceptionMessage,
176 rLocator->getLineNumber(), rLocator->getColumnNumber(),
177 rLocator->getPublicId(), rLocator->getSystemId() );
181 AddRecord( nId, rParams, rExceptionMessage,
191 if ( (rError.nId & nIdMask) != 0 )
195 throw SAXParseException(
ErrorRecord: contains all information for one error.
sal_Int32 nRow
message of original exception (if available)
sal_Int32 nColumn
row number where error occurred (or -1 for unknown)
Sequence< OUString > aParams
public identifier
OUString sPublicId
column number where error occurred (or -1)
OUString sExceptionMessage
error ID
ErrorRecord(sal_Int32 nId, const Sequence< OUString > &rParams, OUString aExceptionMessage, sal_Int32 nRow, sal_Int32 nColumn, OUString aPublicId, OUString aSystemId)
OUString sSystemId
public identifier
XMLErrors()
list of error records
void ThrowErrorAsSAXException(sal_Int32 nIdMask)
location
void AddRecord(sal_Int32 nId, const css::uno::Sequence< OUString > &rParams, const OUString &rExceptionMessage, sal_Int32 nRow, sal_Int32 nColumn, const OUString &rPublicId, const OUString &rSystemId)
add a new entry to the list of error messages
#define SAL_WARN(area, stream)
#define XMLERROR_CLASS_OTHER
#define XMLERROR_MASK_FLAG
#define XMLERROR_CLASS_FORMAT
#define XMLERROR_CLASS_IO
#define XMLERROR_MASK_NUMBER
#define XMLERROR_FLAG_ERROR
#define XMLERROR_CLASS_API
#define XMLERROR_FLAG_SEVERE
#define XMLERROR_FLAG_WARNING
#define XMLERROR_MASK_CLASS