/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ #ifndef INCLUDED_XMLOFF_XMLERROR_HXX #define INCLUDED_XMLOFF_XMLERROR_HXX #include #include #include #include // masks for the error ID fields #define XMLERROR_MASK_FLAG 0xF0000000 #define XMLERROR_MASK_CLASS 0x00FF0000 #define XMLERROR_MASK_NUMBER 0x0000FFFF // error flags: #define XMLERROR_FLAG_WARNING 0x10000000 #define XMLERROR_FLAG_ERROR 0x20000000 #define XMLERROR_FLAG_SEVERE 0x40000000 // error classes: Error ID #define XMLERROR_CLASS_IO 0x00010000 #define XMLERROR_CLASS_FORMAT 0x00020000 #define XMLERROR_CLASS_API 0x00040000 #define XMLERROR_CLASS_OTHER 0x00080000 // error numbers, listed by error class // Within each class, errors should be numbered consecutively. Please // always add to error code below the appropriate comment. // I/O errors: // format errors: #define XMLERROR_SAX ( XMLERROR_CLASS_FORMAT | 0x00000001 ) #define XMLERROR_STYLE_ATTR_VALUE ( XMLERROR_CLASS_FORMAT | 0x00000002 ) #define XMLERROR_NO_INDEX_ALLOWED_HERE ( XMLERROR_CLASS_FORMAT | 0x00000003 ) #define XMLERROR_PARENT_STYLE_NOT_ALLOWED ( XMLERROR_CLASS_FORMAT | 0x00000004 ) #define XMLERROR_ILLEGAL_EVENT (XMLERROR_CLASS_FORMAT | 0x00000005 ) #define XMLERROR_NAMESPACE_TROUBLE (XMLERROR_CLASS_FORMAT | 0x00000006 ) #define XMLERROR_XFORMS_NO_SCHEMA_SUPPORT ( XMLERROR_CLASS_FORMAT | XMLERROR_FLAG_WARNING | 0x00000007 ) #define XMLERROR_XFORMS_UNKNOWN ( XMLERROR_CLASS_FORMAT | XMLERROR_FLAG_WARNING | 0x00000008 ) #define XMLERROR_XFORMS_ONLY_ONE_INSTANCE_ELEMENT ( XMLERROR_CLASS_FORMAT | XMLERROR_FLAG_WARNING | 0x00000009 ) #define XMLERROR_UNKNOWN_ATTRIBUTE ( XMLERROR_CLASS_FORMAT | XMLERROR_FLAG_WARNING | 0x0000000a ) #define XMLERROR_UNKNOWN_ELEMENT ( XMLERROR_CLASS_FORMAT | XMLERROR_FLAG_WARNING | 0x0000000b ) #define XMLERROR_UNKNOWN_CHARACTERS ( XMLERROR_CLASS_FORMAT | XMLERROR_FLAG_WARNING | 0x0000000c ) #define XMLERROR_UNKNOWN_ROOT (XMLERROR_CLASS_FORMAT | 0x0000000d ) // API errors: #define XMLERROR_STYLE_PROP_VALUE ( XMLERROR_CLASS_API | 0x00000001 ) #define XMLERROR_STYLE_PROP_UNKNOWN ( XMLERROR_CLASS_API | 0x00000002 ) #define XMLERROR_STYLE_PROP_OTHER ( XMLERROR_CLASS_API | 0x00000003 ) #define XMLERROR_API ( XMLERROR_CLASS_API | 0x00000004 ) // other errors: #define XMLERROR_CANCEL ( XMLERROR_CLASS_OTHER | 0x00000001 ) // 16bit error flag constants for use in the // SvXMLExport/SvXMLImport error flags enum class SvXMLErrorFlags { NO = 0x0000, DO_NOTHING = 0x0001, ERROR_OCCURRED = 0x0002, WARNING_OCCURRED = 0x0004, }; namespace o3tl { template<> struct typed_flags : is_typed_flags {}; } namespace com::sun::star { namespace uno { template class Sequence; } namespace uno { template class Reference; } namespace xml::sax { class XLocator; } } class ErrorRecord; /** * The XMLErrors is used to collect all errors and warnings that occur * for appropriate processing. */ class XMLErrors { /// definition of type for error list typedef ::std::vector ErrorList; ErrorList m_aErrors; /// list of error records public: XMLErrors(); ~XMLErrors(); /// add a new entry to the list of error messages void AddRecord( sal_Int32 nId, /// error ID == error flags + error class + error number const css::uno::Sequence< OUString> & rParams, /// parameters for error message const OUString& rExceptionMessage, /// original exception string sal_Int32 nRow, /// XLocator: file row number sal_Int32 nColumn, /// XLocator: file column number const OUString& rPublicId, /// XLocator: file public ID const OUString& rSystemId ); /// XLocator: file system ID void AddRecord( sal_Int32 nId, /// error ID == error flags + error class + error number const css::uno::Sequence & rParams, /// parameters for error message const OUString& rExceptionMessage, /// original exception string const css::uno::Reference & rLocator); /// location /** * throw a SAXParseException that describes the first error that matches * the given mask */ /// @throws css::xml::sax::SAXParseException void ThrowErrorAsSAXException( sal_Int32 nIdMask ); }; #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /lov-6.0.4'>distro/collabora/lov-6.0.4 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-04-01tdf#146619 Drop unused 'using namespace' in: connectivity/Gabor Kelemen
Change-Id: Ie185575d699751b79e98c4fae0bc5405a165df9a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165529 Tested-by: Jenkins Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
2020-05-26Fix loplugin:simplifypointertobool for libstdc++ std::shared_ptrStephan Bergmann
...where the get member function is defined on a std::__shared_ptr base class, so loplugin:simplifypointertobool used to miss those until now. (While e.g. using libc++ on macOS found those cases.) 366d08f2f6d4de922f6099c62bb81b49d89e0a68 "new loplugin:simplifypointertobool" was mistaken in breaking isSmartPointerType(const clang::Type* t) out of isSmartPointerType(const Expr* e); c874294ad9fb178df47c66875bfbdec466e39763 "Fix detection of std::unique_ptr/shared_ptr in loplugin:redundantpointerops" had introduced that indivisible two-step algorithm on purpose. The amount of additional hits (on Linux) apparently asked for turning loplugin:simplifypointertobool into a rewriting plugin. Which in turn showed that the naive adivce to just "drop the get()" is not sufficient in places that are not contextually converted to bool, as those places need to be wrapped in a bool(...) functional cast now. If the expression was already wrapped in parentheses, those could be reused as part of the functional cast, but implementing that showed that such cases are not yet found at all by the existing loplugin:simplifypointertobool. Lets leave that TODO for another commit. Besides the changes to compilerplugins/ itself, this change has been generated fully automatically with the rewriting plugin on Linux. Change-Id: I83107d6f634fc9ac232986f49044d7017df83e2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94888 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
2020-01-14tdf#42949 Fix IWYU warnings in connectivity/*/*cxxGabor Kelemen
Except for platform specific drivers/ado and drivers/macab dirs Found with bin/find-unneeded-includes Only removal proposals are dealt with here. Change-Id: I24b741cded8995e29ac3d518aeaa0d60b3c55b56 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86317 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
2018-06-05tdf#42949 remove unused compheler includes ..Jochen Nitschke
and fix the fallout Change-Id: I15bc5d626f4d157cbc69a87392078b41e621d14e Reviewed-on: https://gerrit.libreoffice.org/54882 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
2018-04-01remove unused processfactory.hxx includesJochen Nitschke
and fix fallout Change-Id: Id06bf31f2075111e426ba40c84c885ae70697bee Reviewed-on: https://gerrit.libreoffice.org/52206 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
2017-10-23loplugin:includeform: connectivityStephan Bergmann
Change-Id: I06596fac09f0568b8bab2e2e235a2b88bcd3fc7a
2017-08-01loplugin:checkunusedparamsNoel Grandin
the "check for taking address of function" part was generating false+ Change-Id: Iad6203850901229b7b1b2f8938c68ec703cd343f Reviewed-on: https://gerrit.libreoffice.org/40613 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2015-10-13connectivity: drop unused headersDouglas Mencken
add to MacabRecord.hxx only what's really needed Change-Id: I7b11fb6f403957009ac590714b9972e2989d7aff Reviewed-on: https://gerrit.libreoffice.org/19332 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2015-09-14boost->stdCaolán McNamara
Change-Id: Iff14f69c200217c5d868978e8ffc06962b99ac09 Reviewed-on: https://gerrit.libreoffice.org/18568 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2015-09-09Get rid of connectivity's diagnose_ex.hStephan Bergmann
...that rather trivially wrapped some osl/diagnose.h functionality Change-Id: I4105708488114a9c87aa415affb997a783241248
2015-09-09Get rid of OSL_UNUSEDStephan Bergmann
In many cases it was originally used to silence warnings about variables used only in OSL_ENSURE etc., but that's no longer necessary since OSL_ENSURE is based on SAL_WARN etc. In some other cases it was apparently used as a speculative debugging aid, to have a value assigned to a variable to be easily able to view the value in a debugger. And in some cases it was used with (otherwise ignored) return values of (typically SQL-related) function calls, but it is probably better to eventually find and fix all the problematic ones among such calls via function declarations annotated SAL_WARN_UNUSED_RESULT. Change-Id: Ib925b38da70073b546fdcd00fa8524dc302accbf