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 
24 namespace oox::core {
25 
26 using namespace ::com::sun::star::io;
27 using namespace ::com::sun::star::uno;
28 using namespace ::com::sun::star::xml::sax;
29 
30 FragmentBaseData::FragmentBaseData( XmlFilterBase& rFilter, const OUString& rFragmentPath, RelationsRef const & xRelations ) :
31  mrFilter( rFilter ),
32  maFragmentPath( rFragmentPath ),
33  mxRelations( xRelations )
34 {
35 }
36 
37 FragmentHandler::FragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath ) :
38  FragmentHandler_BASE( std::make_shared<FragmentBaseData>( rFilter, rFragmentPath, rFilter.importRelations( rFragmentPath ) ) )
39 {
40 }
41 
42 FragmentHandler::FragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath, RelationsRef xRelations ) :
43  FragmentHandler_BASE( std::make_shared<FragmentBaseData>( rFilter, rFragmentPath, xRelations ) )
44 {
45 }
46 
48 {
49 }
50 
51 // com.sun.star.xml.sax.XFastDocumentHandler interface ------------------------
52 
54 {
55 }
56 
58 {
59 }
60 
61 void FragmentHandler::processingInstruction( const OUString& /*rTarget*/, const OUString& /*rData*/ )
62 {
63 }
64 
65 void FragmentHandler::setDocumentLocator( const Reference< XLocator >& rxLocator )
66 {
67  implSetLocator( rxLocator );
68 }
69 
70 // com.sun.star.xml.sax.XFastContextHandler interface -------------------------
71 
72 void FragmentHandler::startFastElement( sal_Int32, const Reference< XFastAttributeList >& )
73 {
74 }
75 
76 void FragmentHandler::startUnknownElement( const OUString&, const OUString&, const Reference< XFastAttributeList >& )
77 {
78 }
79 
81 {
82 }
83 
84 void FragmentHandler::endUnknownElement( const OUString&, const OUString& )
85 {
86 }
87 
88 Reference< XFastContextHandler > FragmentHandler::createFastChildContext( sal_Int32, const Reference< XFastAttributeList >& )
89 {
90  return nullptr;
91 }
92 
93 Reference< XFastContextHandler > FragmentHandler::createUnknownChildContext( const OUString&, const OUString&, const Reference< XFastAttributeList >& )
94 {
95  return nullptr;
96 }
97 
98 void FragmentHandler::characters( const OUString& )
99 {
100 }
101 
102 // XML stream handling --------------------------------------------------------
103 
105 {
106  return getFilter().openInputStream( getFragmentPath() );
107 }
108 
109 // binary records -------------------------------------------------------------
110 
112 {
113  // default: no support for binary records
114  return nullptr;
115 }
116 
117 } // namespace oox::core
118 
119 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::shared_ptr< Relations > RelationsRef
Definition: relations.hxx:63
Describes record identifiers used to create contexts in a binary stream.
virtual void SAL_CALL endDocument() override
virtual void SAL_CALL startFastElement(::sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
std::shared_ptr< T > make_shared(Args &&...args)
virtual const RecordInfo * getRecordInfos() const
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
FragmentHandler(XmlFilterBase &rFilter, const OUString &rFragmentPath)
virtual ~FragmentHandler() override
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 css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(::sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
virtual void SAL_CALL startDocument() override
virtual css::uno::Reference< css::io::XInputStream > openFragmentStream() const
Opens the fragment stream referred by the own fragment path.
virtual void SAL_CALL characters(const OUString &aChars) override
::cppu::ImplInheritanceHelper< ContextHandler, css::xml::sax::XFastDocumentHandler > FragmentHandler_BASE
FragmentBaseData(XmlFilterBase &rFilter, const OUString &rFragmentPath, RelationsRef const &xRelations)
virtual void SAL_CALL endFastElement(::sal_Int32 Element) override
virtual void SAL_CALL endUnknownElement(const OUString &Namespace, const OUString &Name) override
Base data of a fragment.
virtual void SAL_CALL startUnknownElement(const OUString &Namespace, const OUString &Name, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
const PowerPointImport & mrFilter
Definition: pptimport.cxx:253