diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-02-02 19:31:46 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-02-03 08:12:09 +0100 |
commit | cdd3c6851027a8a66baefcc4f1e58b7c4ad4ee6a (patch) | |
tree | c10c7b33444ee71fc37c3faa496560042c097f04 /xmloff | |
parent | 18b2cecfef3dd26bac15522667b465802ff3f96b (diff) |
move some xmloff/ headers inside the module
Change-Id: I57e97da952c18c33af85a8fe24ebf021fc0631d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87828
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff')
27 files changed, 482 insertions, 22 deletions
diff --git a/xmloff/inc/PageMasterStyleMap.hxx b/xmloff/inc/PageMasterStyleMap.hxx new file mode 100644 index 000000000000..e3df3350720d --- /dev/null +++ b/xmloff/inc/PageMasterStyleMap.hxx @@ -0,0 +1,195 @@ +/* -*- 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 XMLOFF_INC_PAGEMASTERSTYLEMAP_HXX +#define XMLOFF_INC_PAGEMASTERSTYLEMAP_HXX + +#include <xmloff/maptype.hxx> +#include <xmloff/xmltypes.hxx> +#include <xmloff/contextid.hxx> + + +#define XML_PM_TYPE_PAGESTYLELAYOUT (XML_PM_TYPES_START + 0) +#define XML_PM_TYPE_NUMFORMAT (XML_PM_TYPES_START + 1) +#define XML_PM_TYPE_NUMLETTERSYNC (XML_PM_TYPES_START + 2) +#define XML_PM_TYPE_PAPERTRAYNUMBER (XML_PM_TYPES_START + 3) +#define XML_PM_TYPE_PRINTORIENTATION (XML_PM_TYPES_START + 4) +#define XML_PM_TYPE_PRINTANNOTATIONS (XML_PM_TYPES_START + 5) +#define XML_PM_TYPE_PRINTCHARTS (XML_PM_TYPES_START + 6) +#define XML_PM_TYPE_PRINTDRAWING (XML_PM_TYPES_START + 7) +#define XML_PM_TYPE_PRINTFORMULAS (XML_PM_TYPES_START + 8) +#define XML_PM_TYPE_PRINTGRID (XML_PM_TYPES_START + 9) +#define XML_PM_TYPE_PRINTHEADERS (XML_PM_TYPES_START + 10) +#define XML_PM_TYPE_PRINTOBJECTS (XML_PM_TYPES_START + 11) +#define XML_PM_TYPE_PRINTZEROVALUES (XML_PM_TYPES_START + 12) +#define XML_PM_TYPE_PRINTPAGEORDER (XML_PM_TYPES_START + 13) +#define XML_PM_TYPE_FIRSTPAGENUMBER (XML_PM_TYPES_START + 14) +#define XML_PM_TYPE_CENTER_HORIZONTAL (XML_PM_TYPES_START + 15) +#define XML_PM_TYPE_CENTER_VERTICAL (XML_PM_TYPES_START + 16) + +// control flags +#define CTF_PM_FLAGMASK (XML_PM_CTF_START + 0x0F00) +#define CTF_PM_HEADERFLAG (XML_PM_CTF_START + 0x0100) +#define CTF_PM_FOOTERFLAG (XML_PM_CTF_START + 0x0200) +#define CTF_PM_PRINTMASK (XML_PM_CTF_START + 0x1000) +// page master +#define CTF_PM_BORDERALL (XML_PM_CTF_START + 0x0001) +#define CTF_PM_BORDERTOP (XML_PM_CTF_START + 0x0002) +#define CTF_PM_BORDERBOTTOM (XML_PM_CTF_START + 0x0003) +#define CTF_PM_BORDERLEFT (XML_PM_CTF_START + 0x0004) +#define CTF_PM_BORDERRIGHT (XML_PM_CTF_START + 0x0005) +#define CTF_PM_BORDERWIDTHALL (XML_PM_CTF_START + 0x0006) +#define CTF_PM_BORDERWIDTHTOP (XML_PM_CTF_START + 0x0007) +#define CTF_PM_BORDERWIDTHBOTTOM (XML_PM_CTF_START + 0x0008) +#define CTF_PM_BORDERWIDTHLEFT (XML_PM_CTF_START + 0x0009) +#define CTF_PM_BORDERWIDTHRIGHT (XML_PM_CTF_START + 0x000A) +#define CTF_PM_PADDINGALL (XML_PM_CTF_START + 0x000B) +#define CTF_PM_PADDINGTOP (XML_PM_CTF_START + 0x000C) +#define CTF_PM_PADDINGBOTTOM (XML_PM_CTF_START + 0x000D) +#define CTF_PM_PADDINGLEFT (XML_PM_CTF_START + 0x000E) +#define CTF_PM_PADDINGRIGHT (XML_PM_CTF_START + 0x000F) +#define CTF_PM_TEXTCOLUMNS (XML_PM_CTF_START + 0x0010) +#define CTF_PM_REGISTER_STYLE (XML_PM_CTF_START + 0x0011) +#define CTF_PM_PRINT_ANNOTATIONS (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0012)) +#define CTF_PM_PRINT_CHARTS (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0013)) +#define CTF_PM_PRINT_DRAWING (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0014)) +#define CTF_PM_PRINT_FORMULAS (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0015)) +#define CTF_PM_PRINT_GRID (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0016)) +#define CTF_PM_PRINT_HEADERS (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0017)) +#define CTF_PM_PRINT_OBJECTS (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0018)) +#define CTF_PM_PRINT_ZEROVALUES (CTF_PM_PRINTMASK|(XML_PM_CTF_START + 0x0019)) +#define CTF_PM_MARGINALL (XML_PM_CTF_START + 0x001A) +#define CTF_PM_MARGINTOP (XML_PM_CTF_START + 0x001B) +#define CTF_PM_MARGINBOTTOM (XML_PM_CTF_START + 0x001C) +#define CTF_PM_MARGINLEFT (XML_PM_CTF_START + 0x001D) +#define CTF_PM_MARGINRIGHT (XML_PM_CTF_START + 0x001E) + +#define CTF_PM_PAGEUSAGE (XML_PM_CTF_START + 0x0031) +#define CTF_PM_GRAPHICPOSITION (XML_PM_CTF_START + 0x0032) +#define CTF_PM_GRAPHICFILTER (XML_PM_CTF_START + 0x0033) +#define CTF_PM_GRAPHICURL (XML_PM_CTF_START + 0x0034) + +// Need own entries for PageMasterStyleMap since these get *filtered* +// at export time using CTF_PM_FLAGMASK and XML_PM_CTF_START as detector +// to find the first entry for header/footer (!), see +// SvXMLAutoStylePoolP_Impl::exportXML, look for XML_STYLE_FAMILY_PAGE_MASTER +#define CTF_PM_REPEAT_OFFSET_X (XML_PM_CTF_START + 0x0037) +#define CTF_PM_REPEAT_OFFSET_Y (XML_PM_CTF_START + 0x0038) +#define CTF_PM_FILLGRADIENTNAME (XML_PM_CTF_START + 0x0039) +#define CTF_PM_FILLHATCHNAME (XML_PM_CTF_START + 0x0040) +#define CTF_PM_FILLBITMAPNAME (XML_PM_CTF_START + 0x0041) +#define CTF_PM_FILLTRANSNAME (XML_PM_CTF_START + 0x0042) +#define CTF_PM_FILLBITMAPMODE (XML_PM_CTF_START + 0x0043) + +#define CTF_PM_SCALETO (XML_PM_CTF_START + 0x0051) // calc specific +#define CTF_PM_SCALETOPAGES (XML_PM_CTF_START + 0x0052) +#define CTF_PM_SCALETOX (XML_PM_CTF_START + 0x0053) +#define CTF_PM_SCALETOY (XML_PM_CTF_START + 0x0054) +#define CTF_PM_STANDARD_MODE (XML_PM_CTF_START + 0x0055) +#define CTP_PM_GRID_BASE_WIDTH (XML_PM_CTF_START + 0x0056) +#define CTP_PM_GRID_SNAP_TO_CHARS (XML_PM_CTF_START + 0x0057) +#define CTP_PM_GRID_SNAP_TO (XML_PM_CTF_START + 0x0058) +// header +#define CTF_PM_HEADERBORDERALL (CTF_PM_HEADERFLAG|CTF_PM_BORDERALL) +#define CTF_PM_HEADERBORDERTOP (CTF_PM_HEADERFLAG|CTF_PM_BORDERTOP) +#define CTF_PM_HEADERBORDERBOTTOM (CTF_PM_HEADERFLAG|CTF_PM_BORDERBOTTOM) +#define CTF_PM_HEADERBORDERLEFT (CTF_PM_HEADERFLAG|CTF_PM_BORDERLEFT) +#define CTF_PM_HEADERBORDERRIGHT (CTF_PM_HEADERFLAG|CTF_PM_BORDERRIGHT) +#define CTF_PM_HEADERBORDERWIDTHALL (CTF_PM_HEADERFLAG|CTF_PM_BORDERWIDTHALL) +#define CTF_PM_HEADERBORDERWIDTHTOP (CTF_PM_HEADERFLAG|CTF_PM_BORDERWIDTHTOP) +#define CTF_PM_HEADERBORDERWIDTHBOTTOM (CTF_PM_HEADERFLAG|CTF_PM_BORDERWIDTHBOTTOM) +#define CTF_PM_HEADERBORDERWIDTHLEFT (CTF_PM_HEADERFLAG|CTF_PM_BORDERWIDTHLEFT) +#define CTF_PM_HEADERBORDERWIDTHRIGHT (CTF_PM_HEADERFLAG|CTF_PM_BORDERWIDTHRIGHT) +#define CTF_PM_HEADERPADDINGALL (CTF_PM_HEADERFLAG|CTF_PM_PADDINGALL) +#define CTF_PM_HEADERPADDINGTOP (CTF_PM_HEADERFLAG|CTF_PM_PADDINGTOP) +#define CTF_PM_HEADERPADDINGBOTTOM (CTF_PM_HEADERFLAG|CTF_PM_PADDINGBOTTOM) +#define CTF_PM_HEADERPADDINGLEFT (CTF_PM_HEADERFLAG|CTF_PM_PADDINGLEFT) +#define CTF_PM_HEADERPADDINGRIGHT (CTF_PM_HEADERFLAG|CTF_PM_PADDINGRIGHT) +#define CTF_PM_HEADERHEIGHT (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0031)) +#define CTF_PM_HEADERMINHEIGHT (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0032)) +#define CTF_PM_HEADERDYNAMIC (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0033)) +#define CTF_PM_HEADERGRAPHICPOSITION (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0034)) +#define CTF_PM_HEADERGRAPHICFILTER (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0035)) +#define CTF_PM_HEADERGRAPHICURL (CTF_PM_HEADERFLAG|(XML_PM_CTF_START + 0x0036)) +#define CTF_PM_HEADERMARGINALL (CTF_PM_HEADERFLAG|CTF_PM_MARGINALL) +#define CTF_PM_HEADERMARGINTOP (CTF_PM_HEADERFLAG|CTF_PM_MARGINTOP) +#define CTF_PM_HEADERMARGINBOTTOM (CTF_PM_HEADERFLAG|CTF_PM_MARGINBOTTOM) +#define CTF_PM_HEADERMARGINLEFT (CTF_PM_HEADERFLAG|CTF_PM_MARGINLEFT) +#define CTF_PM_HEADERMARGINRIGHT (CTF_PM_HEADERFLAG|CTF_PM_MARGINRIGHT) + +// Need own entries for PageMasterStyleMap ORed with the CTF_PM_HEADERFLAG +#define CTF_PM_HEADERREPEAT_OFFSET_X (CTF_PM_HEADERFLAG|CTF_PM_REPEAT_OFFSET_X) +#define CTF_PM_HEADERREPEAT_OFFSET_Y (CTF_PM_HEADERFLAG|CTF_PM_REPEAT_OFFSET_Y) +#define CTF_PM_HEADERFILLGRADIENTNAME (CTF_PM_HEADERFLAG|CTF_PM_FILLGRADIENTNAME) +#define CTF_PM_HEADERFILLHATCHNAME (CTF_PM_HEADERFLAG|CTF_PM_FILLHATCHNAME) +#define CTF_PM_HEADERFILLBITMAPNAME (CTF_PM_HEADERFLAG|CTF_PM_FILLBITMAPNAME) +#define CTF_PM_HEADERFILLTRANSNAME (CTF_PM_HEADERFLAG|CTF_PM_FILLTRANSNAME) + +// footer +#define CTF_PM_FOOTERBORDERALL (CTF_PM_FOOTERFLAG|CTF_PM_BORDERALL) +#define CTF_PM_FOOTERBORDERTOP (CTF_PM_FOOTERFLAG|CTF_PM_BORDERTOP) +#define CTF_PM_FOOTERBORDERBOTTOM (CTF_PM_FOOTERFLAG|CTF_PM_BORDERBOTTOM) +#define CTF_PM_FOOTERBORDERLEFT (CTF_PM_FOOTERFLAG|CTF_PM_BORDERLEFT) +#define CTF_PM_FOOTERBORDERRIGHT (CTF_PM_FOOTERFLAG|CTF_PM_BORDERRIGHT) +#define CTF_PM_FOOTERBORDERWIDTHALL (CTF_PM_FOOTERFLAG|CTF_PM_BORDERWIDTHALL) +#define CTF_PM_FOOTERBORDERWIDTHTOP (CTF_PM_FOOTERFLAG|CTF_PM_BORDERWIDTHTOP) +#define CTF_PM_FOOTERBORDERWIDTHBOTTOM (CTF_PM_FOOTERFLAG|CTF_PM_BORDERWIDTHBOTTOM) +#define CTF_PM_FOOTERBORDERWIDTHLEFT (CTF_PM_FOOTERFLAG|CTF_PM_BORDERWIDTHLEFT) +#define CTF_PM_FOOTERBORDERWIDTHRIGHT (CTF_PM_FOOTERFLAG|CTF_PM_BORDERWIDTHRIGHT) +#define CTF_PM_FOOTERPADDINGALL (CTF_PM_FOOTERFLAG|CTF_PM_PADDINGALL) +#define CTF_PM_FOOTERPADDINGTOP (CTF_PM_FOOTERFLAG|CTF_PM_PADDINGTOP) +#define CTF_PM_FOOTERPADDINGBOTTOM (CTF_PM_FOOTERFLAG|CTF_PM_PADDINGBOTTOM) +#define CTF_PM_FOOTERPADDINGLEFT (CTF_PM_FOOTERFLAG|CTF_PM_PADDINGLEFT) +#define CTF_PM_FOOTERPADDINGRIGHT (CTF_PM_FOOTERFLAG|CTF_PM_PADDINGRIGHT) +#define CTF_PM_FOOTERHEIGHT (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0031)) +#define CTF_PM_FOOTERMINHEIGHT (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0032)) +#define CTF_PM_FOOTERDYNAMIC (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0033)) +#define CTF_PM_FOOTERGRAPHICPOSITION (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0034)) +#define CTF_PM_FOOTERGRAPHICFILTER (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0035)) +#define CTF_PM_FOOTERGRAPHICURL (CTF_PM_FOOTERFLAG|(XML_PM_CTF_START + 0x0036)) +#define CTF_PM_FOOTERMARGINALL (CTF_PM_FOOTERFLAG|CTF_PM_MARGINALL) +#define CTF_PM_FOOTERMARGINTOP (CTF_PM_FOOTERFLAG|CTF_PM_MARGINTOP) +#define CTF_PM_FOOTERMARGINBOTTOM (CTF_PM_FOOTERFLAG|CTF_PM_MARGINBOTTOM) +#define CTF_PM_FOOTERMARGINLEFT (CTF_PM_FOOTERFLAG|CTF_PM_MARGINLEFT) +#define CTF_PM_FOOTERMARGINRIGHT (CTF_PM_FOOTERFLAG|CTF_PM_MARGINRIGHT) + +// Need own entries for PageMasterStyleMap ORed with the CTF_PM_FOOTERFLAG +#define CTF_PM_FOOTERREPEAT_OFFSET_X (CTF_PM_FOOTERFLAG|CTF_PM_REPEAT_OFFSET_X) +#define CTF_PM_FOOTERREPEAT_OFFSET_Y (CTF_PM_FOOTERFLAG|CTF_PM_REPEAT_OFFSET_Y) +#define CTF_PM_FOOTERFILLGRADIENTNAME (CTF_PM_FOOTERFLAG|CTF_PM_FILLGRADIENTNAME) +#define CTF_PM_FOOTERFILLHATCHNAME (CTF_PM_FOOTERFLAG|CTF_PM_FILLHATCHNAME) +#define CTF_PM_FOOTERFILLBITMAPNAME (CTF_PM_FOOTERFLAG|CTF_PM_FILLBITMAPNAME) +#define CTF_PM_FOOTERFILLTRANSNAME (CTF_PM_FOOTERFLAG|CTF_PM_FILLTRANSNAME) + +#define CTF_PM_FTN_HEIGHT (XML_PM_CTF_START + 0x0060) +#define CTF_PM_FTN_LINE_WEIGHT (XML_PM_CTF_START + 0x0061) +#define CTF_PM_FTN_LINE_COLOR (XML_PM_CTF_START + 0x0062) +#define CTF_PM_FTN_LINE_WIDTH (XML_PM_CTF_START + 0x0063) +#define CTF_PM_FTN_LINE_ADJUST (XML_PM_CTF_START + 0x0064) +#define CTF_PM_FTN_LINE_DISTANCE (XML_PM_CTF_START + 0x0065) +#define CTF_PM_FTN_DISTANCE (XML_PM_CTF_START + 0x0066) +#define CTF_PM_FTN_LINE_STYLE (XML_PM_CTF_START + 0x0067) + +extern const XMLPropertyMapEntry aXMLPageMasterStyleMap[]; +extern const XMLPropertyMapEntry aXMLPageMasterHeaderImportStyleMap[]; +extern const XMLPropertyMapEntry aXMLPageMasterFooterImportStyleMap[]; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/WordWrapPropertyHdl.hxx b/xmloff/inc/WordWrapPropertyHdl.hxx new file mode 100644 index 000000000000..12fca72171e3 --- /dev/null +++ b/xmloff/inc/WordWrapPropertyHdl.hxx @@ -0,0 +1,44 @@ +/* -*- 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_WORDWRAPPROPERTYHDL_HXX +#define INCLUDED_XMLOFF_WORDWRAPPROPERTYHDL_HXX + +#include <xmloff/xmlprhdl.hxx> + +/** + PropertyHandler for a named xml bool type: +*/ +class SvXMLImport; +class XMLWordWrapPropertyHdl final : public XMLPropertyHandler +{ +private: + SvXMLImport* const mpImport; + +public: + XMLWordWrapPropertyHdl( SvXMLImport* pImport ); + virtual ~XMLWordWrapPropertyHdl() override; + + virtual bool importXML( const OUString& rStrImpValue, css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override; + virtual bool exportXML( OUString& rStrExpValue, const css::uno::Any& rValue, const SvXMLUnitConverter& rUnitConverter ) const override; +}; + +#endif // INCLUDED_XMLOFF_WORDWRAPPROPERTYHDL_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/XMLEmbeddedObjectExportFilter.hxx b/xmloff/inc/XMLEmbeddedObjectExportFilter.hxx new file mode 100644 index 000000000000..1513215fb776 --- /dev/null +++ b/xmloff/inc/XMLEmbeddedObjectExportFilter.hxx @@ -0,0 +1,71 @@ +/* -*- 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 XMLOFF_INC_XMLEMBEDDEDOBJECTEXPORTFILTER_HXX +#define XMLOFF_INC_XMLEMBEDDEDOBJECTEXPORTFILTER_HXX + +#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp> +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <cppuhelper/implbase.hxx> + +class XMLEmbeddedObjectExportFilter final : public cppu::WeakImplHelper< + css::xml::sax::XExtendedDocumentHandler, + css::lang::XServiceInfo, + css::lang::XInitialization> +{ + css::uno::Reference< css::xml::sax::XDocumentHandler > xHandler; + css::uno::Reference< css::xml::sax::XExtendedDocumentHandler > xExtHandler; + +public: + XMLEmbeddedObjectExportFilter( const css::uno::Reference< css::xml::sax::XDocumentHandler > & rHandler ) throw(); + virtual ~XMLEmbeddedObjectExportFilter () throw() override; + + // css::xml::sax::XDocumentHandler + virtual void SAL_CALL startDocument() override; + virtual void SAL_CALL endDocument() override; + virtual void SAL_CALL startElement(const OUString& aName, + const css::uno::Reference< css::xml::sax::XAttributeList > & xAttribs) override; + virtual void SAL_CALL endElement(const OUString& aName) override; + virtual void SAL_CALL characters(const OUString& aChars) override; + virtual void SAL_CALL ignorableWhitespace(const OUString& aWhitespaces) override; + virtual void SAL_CALL processingInstruction(const OUString& aTarget, + const OUString& aData) override; + virtual void SAL_CALL setDocumentLocator(const css::uno::Reference< css::xml::sax::XLocator > & xLocator) override; + + // css::xml::sax::XExtendedDocumentHandler + virtual void SAL_CALL startCDATA() override; + virtual void SAL_CALL endCDATA() override; + virtual void SAL_CALL comment(const OUString& sComment) override; + virtual void SAL_CALL allowLineBreak() override; + virtual void SAL_CALL unknown(const OUString& sString) override; + + // XInitialization + virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override; + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName( ) override; + virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; + virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; + +}; + +#endif // XMLOFF_INC_XMLEMBEDDEDOBJECTEXPORTFILTER_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/fasttokenhandler.hxx b/xmloff/inc/fasttokenhandler.hxx new file mode 100644 index 000000000000..b0d0fb9f92ce --- /dev/null +++ b/xmloff/inc/fasttokenhandler.hxx @@ -0,0 +1,98 @@ +/* -*- 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/. + */ + +#ifndef XMLOFF_INC_FASTTOKENHANDLER_HXX +#define XMLOFF_INC_FASTTOKENHANDLER_HXX + +#include <com/sun/star/xml/sax/XFastTokenHandler.hpp> +#include <cppuhelper/implbase.hxx> +#include <sax/fastattribs.hxx> +#include <xmloff/token/tokens.hxx> +#include <rtl/instance.hxx> +#include <sal/log.hxx> +#include <xmloff/dllapi.h> + +namespace xmloff { +namespace token { + +class TokenMap +{ +public: + explicit TokenMap(); + ~TokenMap(); + + /** Returns the UTF-8 name of the passed token identifier as byte sequence. */ + css::uno::Sequence< sal_Int8 > const & getUtf8TokenName( sal_Int32 nToken ) const + { + SAL_WARN_IF(nToken < 0 || nToken >= XML_TOKEN_COUNT, "xmloff", "Wrong nToken parameter"); + if( 0 <= nToken && nToken < XML_TOKEN_COUNT ) + return maTokenNamesUtf8[ nToken ]; + return EMPTY_BYTE_SEQ; + } + + const OUString& getTokenName( sal_Int32 nToken ) const + { + SAL_WARN_IF(nToken < 0 || nToken >= XML_TOKEN_COUNT, "xmloff", "Wrong nToken parameter"); + if( 0 <= nToken && nToken < XML_TOKEN_COUNT ) + return maTokenNames[ nToken ]; + return EMPTY_STRING; + } + + /** Returns the token identifier for the passed UTF-8 token name. */ + static sal_Int32 getTokenFromUtf8( const css::uno::Sequence< sal_Int8 >& rUtf8Name ) + { + return getTokenFromUTF8( reinterpret_cast< const char* >( + rUtf8Name.getConstArray() ), rUtf8Name.getLength() ); + } + + /** Returns the token identifier for a UTF-8 string */ + static sal_Int32 getTokenFromUTF8( const char *pToken, sal_Int32 nLength ) + { + return getTokenPerfectHash( pToken, nLength ); + } + +private: + static sal_Int32 getTokenPerfectHash( const char *pToken, sal_Int32 nLength ); + + std::vector< css::uno::Sequence< sal_Int8 > > maTokenNamesUtf8; + std::vector< OUString > maTokenNames; + + static const css::uno::Sequence< sal_Int8 > EMPTY_BYTE_SEQ; + static const OUString EMPTY_STRING; +}; + +struct StaticTokenMap : public rtl::Static< TokenMap, StaticTokenMap > {}; + +class FastTokenHandler final : public cppu::WeakImplHelper< + css::xml::sax::XFastTokenHandler >, + public sax_fastparser::FastTokenHandlerBase +{ +public: + explicit FastTokenHandler(); + virtual ~FastTokenHandler() override; + + // XFastTokenHandler + virtual css::uno::Sequence< sal_Int8 > SAL_CALL getUTF8Identifier( sal_Int32 nToken ) override; + virtual sal_Int32 SAL_CALL getTokenFromUTF8( const css::uno::Sequence< sal_Int8 >& Identifier ) override; + + const OUString & getIdentifier( sal_Int32 nToken ) const; + + // Much faster direct C++ shortcut to the method that matters + virtual sal_Int32 getTokenDirect( const char *pToken, sal_Int32 nLength ) const override; + +private: + TokenMap& mrTokenMap; +}; + +} // namespace token +} // namespace xmloff + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/inc/pch/precompiled_xo.hxx b/xmloff/inc/pch/precompiled_xo.hxx index 138a80638935..7bbc24d6e58a 100644 --- a/xmloff/inc/pch/precompiled_xo.hxx +++ b/xmloff/inc/pch/precompiled_xo.hxx @@ -196,7 +196,7 @@ #include <XMLStringBufferImportContext.hxx> #include <facreg.hxx> #include <xexptran.hxx> -#include <xmloff/PageMasterStyleMap.hxx> +#include <PageMasterStyleMap.hxx> #include <xmloff/ProgressBarHelper.hxx> #include <xmloff/XMLBase64ImportContext.hxx> #include <xmloff/XMLEventsImportContext.hxx> diff --git a/xmloff/inc/xmltabe.hxx b/xmloff/inc/xmltabe.hxx new file mode 100644 index 000000000000..19d55234517c --- /dev/null +++ b/xmloff/inc/xmltabe.hxx @@ -0,0 +1,52 @@ +/* -*- 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 XMLOFF_INC_XMLTABE_HXX +#define XMLOFF_INC_XMLTABE_HXX + +// prevent funny things like "#define sun 1" from the compiler +#include <sal/config.h> +#include <sal/types.h> + +class SvXMLExport; +namespace com { namespace sun { namespace star { + namespace style { struct TabStop; } + namespace uno { class Any; } +} } } + + +class SvxXMLTabStopExport final +{ + SvXMLExport& rExport; // for access to document handler + + void exportTabStop( const css::style::TabStop* pTabStop ); + +public: + + SvxXMLTabStopExport( SvXMLExport& rExport ); + ~SvxXMLTabStopExport(); + + // core API + void Export( const css::uno::Any& rAny ); +}; + + +#endif // XMLOFF_INC_XMLTABE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/qa/unit/tokenmap-test.cxx b/xmloff/qa/unit/tokenmap-test.cxx index 540836b66f8a..fb6916444454 100644 --- a/xmloff/qa/unit/tokenmap-test.cxx +++ b/xmloff/qa/unit/tokenmap-test.cxx @@ -12,7 +12,7 @@ #include <cppunit/TestFixture.h> #include <cppunit/extensions/HelperMacros.h> -#include <xmloff/fasttokenhandler.hxx> +#include <fasttokenhandler.hxx> #include <xmloff/token/tokens.hxx> #include <xmloff/xmltoken.hxx> diff --git a/xmloff/source/core/XMLEmbeddedObjectExportFilter.cxx b/xmloff/source/core/XMLEmbeddedObjectExportFilter.cxx index 87a1c0b45f4a..e89c192a052f 100644 --- a/xmloff/source/core/XMLEmbeddedObjectExportFilter.cxx +++ b/xmloff/source/core/XMLEmbeddedObjectExportFilter.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <xmloff/XMLEmbeddedObjectExportFilter.hxx> +#include <XMLEmbeddedObjectExportFilter.hxx> #include <cppuhelper/supportsservice.hxx> using namespace ::com::sun::star::uno; diff --git a/xmloff/source/core/fasttokenhandler.cxx b/xmloff/source/core/fasttokenhandler.cxx index d2a44b1228a8..8d63cb74f8fc 100644 --- a/xmloff/source/core/fasttokenhandler.cxx +++ b/xmloff/source/core/fasttokenhandler.cxx @@ -7,7 +7,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include <xmloff/fasttokenhandler.hxx> +#include <fasttokenhandler.hxx> #include <xmloff/token/tokens.hxx> diff --git a/xmloff/source/core/xmlexp.cxx b/xmloff/source/core/xmlexp.cxx index 7ee74bb4e6ce..9ba14a6f4840 100644 --- a/xmloff/source/core/xmlexp.cxx +++ b/xmloff/source/core/xmlexp.cxx @@ -72,7 +72,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <xmloff/XMLFilterServiceNames.h> -#include <xmloff/XMLEmbeddedObjectExportFilter.hxx> +#include <XMLEmbeddedObjectExportFilter.hxx> #include <XMLBasicExportFilter.hxx> #include <cppuhelper/exc_hlp.hxx> #include <cppuhelper/implbase.hxx> diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index 09a7f8665ab5..9c1059f852d9 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -65,7 +65,7 @@ #include <comphelper/storagehelper.hxx> #include <comphelper/attributelist.hxx> #include <unotools/fontcvt.hxx> -#include <xmloff/fasttokenhandler.hxx> +#include <fasttokenhandler.hxx> #include <vcl/GraphicExternalLink.hxx> #include <com/sun/star/rdf/XMetadatable.hpp> diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx index b2325aa84769..aeeb4f788edb 100644 --- a/xmloff/source/draw/sdpropls.cxx +++ b/xmloff/source/draw/sdpropls.cxx @@ -30,7 +30,7 @@ #include <com/sun/star/text/WritingMode2.hpp> #include <xmloff/EnumPropertyHdl.hxx> #include <xmloff/NamedBoolPropertyHdl.hxx> -#include <xmloff/WordWrapPropertyHdl.hxx> +#include <WordWrapPropertyHdl.hxx> #include <enummaps.hxx> #include "numithdl.hxx" #include <XMLBitmapRepeatOffsetPropertyHandler.hxx> diff --git a/xmloff/source/style/PageMasterExportPropMapper.cxx b/xmloff/source/style/PageMasterExportPropMapper.cxx index c19d145ed299..3581c9d6a720 100644 --- a/xmloff/source/style/PageMasterExportPropMapper.cxx +++ b/xmloff/source/style/PageMasterExportPropMapper.cxx @@ -23,7 +23,7 @@ #include <comphelper/types.hxx> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/table/BorderLine2.hpp> -#include <xmloff/PageMasterStyleMap.hxx> +#include <PageMasterStyleMap.hxx> #include <rtl/ref.hxx> #include <comphelper/extract.hxx> diff --git a/xmloff/source/style/PageMasterImportContext.cxx b/xmloff/source/style/PageMasterImportContext.cxx index 1634f1457117..4334fa09d6f8 100644 --- a/xmloff/source/style/PageMasterImportContext.cxx +++ b/xmloff/source/style/PageMasterImportContext.cxx @@ -25,7 +25,7 @@ #include "PageMasterPropHdl.hxx" #include "PagePropertySetContext.hxx" #include "PageHeaderFooterContext.hxx" -#include <xmloff/PageMasterStyleMap.hxx> +#include <PageMasterStyleMap.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <osl/diagnose.h> diff --git a/xmloff/source/style/PageMasterImportPropMapper.cxx b/xmloff/source/style/PageMasterImportPropMapper.cxx index 0b8565a570b3..13f1bbd12299 100644 --- a/xmloff/source/style/PageMasterImportPropMapper.cxx +++ b/xmloff/source/style/PageMasterImportPropMapper.cxx @@ -19,7 +19,7 @@ #include "PageMasterImportPropMapper.hxx" -#include <xmloff/PageMasterStyleMap.hxx> +#include <PageMasterStyleMap.hxx> #include <xmloff/maptype.hxx> #include <com/sun/star/table/BorderLine2.hpp> #include <com/sun/star/container/XNameContainer.hpp> diff --git a/xmloff/source/style/PageMasterPropHdlFactory.cxx b/xmloff/source/style/PageMasterPropHdlFactory.cxx index 9aabc961a445..6f40f439307a 100644 --- a/xmloff/source/style/PageMasterPropHdlFactory.cxx +++ b/xmloff/source/style/PageMasterPropHdlFactory.cxx @@ -27,7 +27,7 @@ #include <XMLTextColumnsPropertyHandler.hxx> #include <xmloff/XMLConstantsPropertyHandler.hxx> #include "PageMasterPropHdl.hxx" -#include <xmloff/PageMasterStyleMap.hxx> +#include <PageMasterStyleMap.hxx> #include <com/sun/star/text/TextGridMode.hpp> #include <xmloff/EnumPropertyHdl.hxx> #include <osl/diagnose.h> diff --git a/xmloff/source/style/PageMasterPropMapper.cxx b/xmloff/source/style/PageMasterPropMapper.cxx index 3134ef8e1533..c741632ad9dd 100644 --- a/xmloff/source/style/PageMasterPropMapper.cxx +++ b/xmloff/source/style/PageMasterPropMapper.cxx @@ -20,7 +20,7 @@ #include "PageMasterPropMapper.hxx" #include <rtl/ref.hxx> -#include <xmloff/PageMasterStyleMap.hxx> +#include <PageMasterStyleMap.hxx> #include "PageMasterPropHdlFactory.hxx" #include <com/sun/star/beans/XPropertySet.hpp> diff --git a/xmloff/source/style/PageMasterStyleMap.cxx b/xmloff/source/style/PageMasterStyleMap.cxx index 963b905d4eec..f774186562c4 100644 --- a/xmloff/source/style/PageMasterStyleMap.cxx +++ b/xmloff/source/style/PageMasterStyleMap.cxx @@ -17,7 +17,7 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <xmloff/PageMasterStyleMap.hxx> +#include <PageMasterStyleMap.hxx> #include <xmloff/xmlnmspe.hxx> #include <xmloff/xmltoken.hxx> diff --git a/xmloff/source/style/PagePropertySetContext.cxx b/xmloff/source/style/PagePropertySetContext.cxx index 1af2181c034d..6c46c174671e 100644 --- a/xmloff/source/style/PagePropertySetContext.cxx +++ b/xmloff/source/style/PagePropertySetContext.cxx @@ -21,7 +21,7 @@ #include "PagePropertySetContext.hxx" #include <XMLBackgroundImageContext.hxx> #include <XMLTextColumnsContext.hxx> -#include <xmloff/PageMasterStyleMap.hxx> +#include <PageMasterStyleMap.hxx> #include "XMLFootnoteSeparatorImport.hxx" #include <xmloff/xmlimppr.hxx> #include <xmloff/xmlprmap.hxx> diff --git a/xmloff/source/style/WordWrapPropertyHdl.cxx b/xmloff/source/style/WordWrapPropertyHdl.cxx index 1d857b850621..0a01bd11dda9 100644 --- a/xmloff/source/style/WordWrapPropertyHdl.cxx +++ b/xmloff/source/style/WordWrapPropertyHdl.cxx @@ -18,7 +18,7 @@ */ #include <xmloff/xmlimp.hxx> -#include <xmloff/WordWrapPropertyHdl.hxx> +#include <WordWrapPropertyHdl.hxx> #include <xmloff/xmltoken.hxx> #include <xmloff/xmluconv.hxx> #include <comphelper/extract.hxx> diff --git a/xmloff/source/style/XMLFootnoteSeparatorExport.cxx b/xmloff/source/style/XMLFootnoteSeparatorExport.cxx index 3c709b005993..e79bc6f07a86 100644 --- a/xmloff/source/style/XMLFootnoteSeparatorExport.cxx +++ b/xmloff/source/style/XMLFootnoteSeparatorExport.cxx @@ -29,7 +29,7 @@ #include <xmloff/xmlprmap.hxx> #include <xmloff/xmlement.hxx> -#include <xmloff/PageMasterStyleMap.hxx> +#include <PageMasterStyleMap.hxx> #include <com/sun/star/text/HorizontalAdjust.hpp> #include <rtl/ustrbuf.hxx> diff --git a/xmloff/source/style/XMLFootnoteSeparatorImport.cxx b/xmloff/source/style/XMLFootnoteSeparatorImport.cxx index 5e928fe196f8..f4f72883314f 100644 --- a/xmloff/source/style/XMLFootnoteSeparatorImport.cxx +++ b/xmloff/source/style/XMLFootnoteSeparatorImport.cxx @@ -39,7 +39,7 @@ #include <xmloff/maptype.hxx> #include <xmloff/xmlement.hxx> -#include <xmloff/PageMasterStyleMap.hxx> +#include <PageMasterStyleMap.hxx> #include <vector> diff --git a/xmloff/source/style/XMLPageExport.cxx b/xmloff/source/style/XMLPageExport.cxx index 4f78e273c8b5..9ac210aadde5 100644 --- a/xmloff/source/style/XMLPageExport.cxx +++ b/xmloff/source/style/XMLPageExport.cxx @@ -29,7 +29,7 @@ #include <xmloff/families.hxx> #include <xmloff/xmlexp.hxx> #include "PageMasterPropHdlFactory.hxx" -#include <xmloff/PageMasterStyleMap.hxx> +#include <PageMasterStyleMap.hxx> #include "PageMasterPropMapper.hxx" #include "PageMasterExportPropMapper.hxx" diff --git a/xmloff/source/style/impastpl.cxx b/xmloff/source/style/impastpl.cxx index 6934de7383e2..22939b13af31 100644 --- a/xmloff/source/style/impastpl.cxx +++ b/xmloff/source/style/impastpl.cxx @@ -23,7 +23,7 @@ #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> #include <tools/solar.h> -#include <xmloff/PageMasterStyleMap.hxx> +#include <PageMasterStyleMap.hxx> #include <xmloff/families.hxx> #include <xmloff/xmlaustp.hxx> #include <xmloff/xmlexp.hxx> diff --git a/xmloff/source/style/xmlaustp.cxx b/xmloff/source/style/xmlaustp.cxx index 61cc664c3180..fe3d89188006 100644 --- a/xmloff/source/style/xmlaustp.cxx +++ b/xmloff/source/style/xmlaustp.cxx @@ -28,7 +28,7 @@ #include <xmloff/xmlprmap.hxx> #include <xmloff/XMLTextListAutoStylePool.hxx> -#include <xmloff/PageMasterStyleMap.hxx> +#include <PageMasterStyleMap.hxx> #include <osl/diagnose.h> diff --git a/xmloff/source/style/xmltabe.cxx b/xmloff/source/style/xmltabe.cxx index 8448c6255dd4..ac58af3f32e1 100644 --- a/xmloff/source/style/xmltabe.cxx +++ b/xmloff/source/style/xmltabe.cxx @@ -27,7 +27,7 @@ #include <xmloff/xmltoken.hxx> #include <xmloff/xmluconv.hxx> #include <xmloff/xmlexp.hxx> -#include <xmloff/xmltabe.hxx> +#include <xmltabe.hxx> using namespace ::com::sun::star; diff --git a/xmloff/source/text/txtexppr.hxx b/xmloff/source/text/txtexppr.hxx index be456afd0a14..7e13180e1543 100644 --- a/xmloff/source/text/txtexppr.hxx +++ b/xmloff/source/text/txtexppr.hxx @@ -22,7 +22,7 @@ #include <xmloff/xmlexppr.hxx> #include "txtdrope.hxx" -#include <xmloff/xmltabe.hxx> +#include <xmltabe.hxx> #include <XMLTextColumnsExport.hxx> #include <XMLBackgroundImageExport.hxx> |