LibreOffice Module oox (master) 1
fragmenthandler.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
21
23#include <utility>
24
25namespace oox::core {
26
27using namespace ::com::sun::star::io;
28using namespace ::com::sun::star::uno;
29using namespace ::com::sun::star::xml::sax;
30
31FragmentBaseData::FragmentBaseData( XmlFilterBase& rFilter, OUString aFragmentPath, RelationsRef xRelations ) :
32 mrFilter( rFilter ),
33 maFragmentPath(std::move( aFragmentPath )),
34 mxRelations(std::move( xRelations ))
35{
36}
37
38FragmentHandler::FragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath ) :
39 FragmentHandler_BASE( std::make_shared<FragmentBaseData>( rFilter, rFragmentPath, rFilter.importRelations( rFragmentPath ) ) )
40{
41}
42
43FragmentHandler::FragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath, RelationsRef xRelations ) :
44 FragmentHandler_BASE( std::make_shared<FragmentBaseData>( rFilter, rFragmentPath, xRelations ) )
45{
46}
47
49{
50}
51
52// com.sun.star.xml.sax.XFastDocumentHandler interface ------------------------
53
55{
56}
57
59{
60}
61
62void FragmentHandler::processingInstruction( const OUString& /*rTarget*/, const OUString& /*rData*/ )
63{
64}
65
66void FragmentHandler::setDocumentLocator( const Reference< XLocator >& rxLocator )
67{
68 implSetLocator( rxLocator );
69}
70
71// com.sun.star.xml.sax.XFastContextHandler interface -------------------------
72
73void FragmentHandler::startFastElement( sal_Int32, const Reference< XFastAttributeList >& )
74{
75}
76
77void FragmentHandler::startUnknownElement( const OUString&, const OUString&, const Reference< XFastAttributeList >& )
78{
79}
80
82{
83}
84
85void FragmentHandler::endUnknownElement( const OUString&, const OUString& )
86{
87}
88
89Reference< XFastContextHandler > FragmentHandler::createFastChildContext( sal_Int32, const Reference< XFastAttributeList >& )
90{
91 return nullptr;
92}
93
94Reference< XFastContextHandler > FragmentHandler::createUnknownChildContext( const OUString&, const OUString&, const Reference< XFastAttributeList >& )
95{
96 return nullptr;
97}
98
99void FragmentHandler::characters( const OUString& )
100{
101}
102
103// XML stream handling --------------------------------------------------------
104
105Reference< XInputStream > FragmentHandler::openFragmentStream() const
106{
107 return getFilter().openInputStream( getFragmentPath() );
108}
109
110// binary records -------------------------------------------------------------
111
113{
114 // default: no support for binary records
115 return nullptr;
116}
117
118} // namespace oox::core
119
120/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL endDocument() override
virtual void SAL_CALL startFastElement(::sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createUnknownChildContext(const OUString &Namespace, const OUString &Name, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
virtual void SAL_CALL startDocument() override
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(::sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
virtual css::uno::Reference< css::io::XInputStream > openFragmentStream() const
Opens the fragment stream referred by the own fragment path.
virtual void SAL_CALL endFastElement(::sal_Int32 Element) override
virtual void SAL_CALL endUnknownElement(const OUString &Namespace, const OUString &Name) override
virtual const RecordInfo * getRecordInfos() const
virtual void SAL_CALL setDocumentLocator(const css::uno::Reference< css::xml::sax::XLocator > &rxLocator) override
virtual void SAL_CALL processingInstruction(const OUString &rTarget, const OUString &rData) override
virtual void SAL_CALL startUnknownElement(const OUString &Namespace, const OUString &Name, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
virtual ~FragmentHandler() override
virtual void SAL_CALL characters(const OUString &aChars) override
FragmentHandler(XmlFilterBase &rFilter, const OUString &rFragmentPath)
std::shared_ptr< T > make_shared(Args &&... args)
std::shared_ptr< Relations > RelationsRef
Definition: relations.hxx:63
::cppu::ImplInheritanceHelper< ContextHandler, css::xml::sax::XFastDocumentHandler > FragmentHandler_BASE
const PowerPointImport & mrFilter
Definition: pptimport.cxx:264
Base data of a fragment.
FragmentBaseData(XmlFilterBase &rFilter, OUString aFragmentPath, RelationsRef xRelations)
Describes record identifiers used to create contexts in a binary stream.