/* -*- 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_XMLEVENTEXPORT_HXX #define INCLUDED_XMLOFF_XMLEVENTEXPORT_HXX #include #include #include #include #include #include #include class SvXMLExport; namespace com { namespace sun { namespace star { namespace document { class XEventsSupplier; } namespace container { class XNameReplace; } namespace container { class XNameAccess; } namespace beans { struct PropertyValue; } } } } namespace com { namespace sun { namespace star { namespace uno { template class Reference; } } } } namespace com { namespace sun { namespace star { namespace uno { template class Sequence; } } } } typedef ::std::map< OUString, std::unique_ptr > HandlerMap; typedef ::std::map< OUString, XMLEventName > NameMap; /** * Export instances of EventsSupplier services. To use this class you * must fulfill two conditions: * * 1) provide a translation from the API event names to XML event * names * 2) Register XMLEventExportHandler instances for all script types * that you would like to export. * * The Export()-Methods all have a bUseWhitespace parameter that * causes the exported elements to be surrounded by whitespace, which * in turn causes the elements to be indented properly. By default, * whitespace is used, but it may not be called for in all cases (e.g * events attached to hyperlink within a paragraph.) */ class XMLOFF_DLLPUBLIC XMLEventExport { SvXMLExport& rExport; HandlerMap aHandlerMap; NameMap aNameTranslationMap; bool bExtNamespace; public: XMLEventExport(SvXMLExport& rExport); ~XMLEventExport(); XMLEventExport& operator=( XMLEventExport const & ) = delete; // MSVC2017 workaround XMLEventExport( XMLEventExport const & ) = delete; // MSVC2017 workaround /// register an EventExportHandler for a particular script type /// /// The handlers will be deleted when the object is destroyed, hence /// no pointers to a handler registered with AddHandler() should be /// held by anyone. void AddHandler( const OUString& rName, std::unique_ptr pHandler ); /// register additional event names void AddTranslationTable( const XMLEventNameTranslation* pTransTable ); /// export the events (calls EventExport::Export(Reference) ) void Export( css::uno::Reference const & xAccess, bool bUseWhitespace = true); /// export the events (calls EventExport::Export(Reference) ) void Export( css::uno::Reference const & xAccess, bool bUseWhitespace = true); /// export the events (writes element) void Export( css::uno::Reference const & xAccess, bool bUseWhitespace = true); /// export the events, but write element /// (for new file format additions) void ExportExt( css::uno::Reference const & xAccess); /// export a single event (writes element) void ExportSingleEvent( css::uno::Sequence& rEventValues, const OUString& rApiEventName, bool bUseWhitespace = true ); private: /// export one event (start container-element if necessary) SAL_DLLPRIVATE void ExportEvent( css::uno::Sequence& rEventValues, const XMLEventName& rXmlEventName, bool bUseWhitespace, bool& rExported); /// export the start element SAL_DLLPRIVATE void StartElement(bool bUseWhitespace); /// export the end element SAL_DLLPRIVATE void EndElement(bool bUseWhitespace); }; #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ion> LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-11-24loplugin:unusedfields make some fields privateNoel Grandin
this is one of the secondary analyses this plugin performs Change-Id: I6fac8c926b53f1d909c5b183304744126549f2bc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143181 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2021-06-19loplugin:finalclassesNoel Grandin
improve the plugin to detect more cases. I only apply the new final changes to classes in /include here. Which reveals that RoadmapWizard::getPageController( TabPage* _pCurrentPage ) will always return nullptr Also needed to sprinkle some SAL_DLLPUBLIC_TEMPLATE around to workaround Visual Studio linking problems. Change-Id: Iadb7d46a9e0e73dabce562375ca013c0fea6690c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117365 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-07-19compact namespace: ooxNoel Grandin
Change-Id: I9ea016adcec334437da45296ee325453347836ae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99002 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-05-03use more compact namespace syntax in /includeNoel Grandin
excluding the UDK headers of course Change-Id: Iac7ab83d60265f7d362c860776f1de9d5e444ec0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93268 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2020-03-12Revert "loplugin:constfields in oox"Noel Grandin
This reverts commit a84e3df74eecc8778e3d5be5dd80ad4ddb511edf. Now that we know that making fields has negative side effects like disabling assignment operator generation. Change-Id: I7b45b7ead281cf3a9202ca6aabc55ee5033e5331 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90332 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-10-29loplugin:finalclasses in ooxNoel Grandin
Change-Id: I95f69d99194f91851b2ef86bebf20006fa32fef3 Reviewed-on: https://gerrit.libreoffice.org/81656 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2018-12-08Clean up LIBO_INTERNAL_ONLY uses of SAL_WARN_UNUSED_RESULTStephan Bergmann
Change-Id: I98b2d90c8345f07010f6defd82557188d5cd35c7 Reviewed-on: https://gerrit.libreoffice.org/64808 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2018-10-15loplugin:constfields in ooxNoel Grandin
Change-Id: I1e110d193ebfa30ab1ab0d85bfb6dc409e341439 Reviewed-on: https://gerrit.libreoffice.org/61728 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-05-13tdf#42949: clean up includes in include/oox/ole with iwyuJorenz Paragas
Change-Id: I9cbdc78b540b0f735c451ac561f0f0ccdaf7efbd Reviewed-on: https://gerrit.libreoffice.org/24911 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2016-02-09Remove excess newlinesChris Sherlock
A ridiculously fast way of doing this is: for i in $(pcregrep -l -M -r --include='.*[hc]xx$' \ --exclude-dir=workdir --exclude-dir=instdir '^ {3,}' .) do perl -0777 -i -pe 's/^ {3,}/ /gm' $i done Change-Id: Iebb93eccbee9e4fc5c4380474ba595858a27ac2c Reviewed-on: https://gerrit.libreoffice.org/22224 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
2015-12-23loplugin:unusedfields in /includeNoel Grandin
Change-Id: Ia406e727890a365cc89831c96140cad8240f9b61
2015-10-12Replace "SAL_OVERRIDE" with "override" in LIBO_INTERNAL_ONLY codeStephan Bergmann
Change-Id: I2ea407acd763ef2d7dae2d3b8f32525523ac8274
2015-07-21loplugin:unusedmethods ooxNoel Grandin
Change-Id: I5381e0da0efc1f951e248cfcfb35fc680ace94e4 Reviewed-on: https://gerrit.libreoffice.org/17225 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
2014-12-19remove operator>> and operator<< methodsNoel Grandin
in favour of ReadXXX/WriteXXX methods Change-Id: I75fcb04cb9e2981a10146a96de27916ca7f6bc57
2014-12-12remove operator>> and operator<< methodsNoel Grandin
in favour of ReadXXX/WriteXXX methods Change-Id: I69eebee3a8ce5b40301db7940a1d85915c0bf6f4