LibreOffice Module oox (master) 1
contexthandler.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::uno;
28using namespace ::com::sun::star::xml::sax;
29
31 ContextHandler_BASE(rParent),
32 mxBaseData( rParent.mxBaseData )
33{
34}
35
37 mxBaseData(std::move( xBaseData ))
38{
39}
40
42{
43}
44
46{
47 return mxBaseData->mrFilter;
48}
49
51{
52 return *mxBaseData->mxRelations;
53}
54
55const OUString& ContextHandler::getFragmentPath() const
56{
57 return mxBaseData->maFragmentPath;
58}
59
60OUString ContextHandler::getFragmentPathFromRelation( const Relation& rRelation ) const
61{
62 return mxBaseData->mxRelations->getFragmentPathFromRelation( rRelation );
63}
64
65OUString ContextHandler::getFragmentPathFromRelId( const OUString& rRelId ) const
66{
67 return mxBaseData->mxRelations->getFragmentPathFromRelId( rRelId );
68}
69
70OUString ContextHandler::getFragmentPathFromFirstType( std::u16string_view rType ) const
71{
72 return mxBaseData->mxRelations->getFragmentPathFromFirstType( rType );
73}
74
76 const
77{
78 return mxBaseData->mxRelations->getFragmentPathFromFirstTypeFromOfficeDoc( rType );
79}
80
81void ContextHandler::implSetLocator( const Reference< XLocator >& rxLocator )
82{
83 mxBaseData->mxLocator = rxLocator;
84}
85
86// com.sun.star.xml.sax.XFastContextHandler interface -------------------------
87
88void ContextHandler::startFastElement( sal_Int32, const Reference< XFastAttributeList >& )
89{
90}
91
92void ContextHandler::startUnknownElement( const OUString&, const OUString&, const Reference< XFastAttributeList >& )
93{
94}
95
97{
98}
99
100void ContextHandler::endUnknownElement( const OUString&, const OUString& )
101{
102}
103
104Reference< XFastContextHandler > ContextHandler::createFastChildContext( sal_Int32, const Reference< XFastAttributeList >& )
105{
106 return nullptr;
107}
108
109Reference< XFastContextHandler > ContextHandler::createUnknownChildContext( const OUString&, const OUString&, const Reference< XFastAttributeList >& )
110{
111 return nullptr;
112}
113
114void ContextHandler::characters( const OUString& )
115{
116}
117
118// record context interface ---------------------------------------------------
119
121{
122 return nullptr;
123}
124
126{
127}
128
130{
131}
132
133} // namespace oox::core
134
135/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Wraps a StreamDataSequence and provides convenient access functions.
XmlFilterBase & getFilter() const
Returns the filter instance.
const OUString & getFragmentPath() const
Returns the full path of the current fragment.
virtual void SAL_CALL endUnknownElement(const OUString &Namespace, const OUString &Name) override
virtual void SAL_CALL startUnknownElement(const OUString &Namespace, const OUString &Name, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
OUString getFragmentPathFromFirstType(std::u16string_view rType) const
Returns the full fragment path for the first relation of the passed type.
OUString getFragmentPathFromRelation(const Relation &rRelation) const
Returns the full fragment path for the target of the passed relation.
OUString getFragmentPathFromRelId(const OUString &rRelId) const
Returns the full fragment path for the passed relation identifier.
virtual void SAL_CALL startFastElement(::sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
virtual void endRecord(sal_Int32 nRecId)
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(::sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
OUString getFragmentPathFromFirstTypeFromOfficeDoc(std::u16string_view rType) const
virtual void startRecord(sal_Int32 nRecId, SequenceInputStream &rStrm)
void implSetLocator(const css::uno::Reference< css::xml::sax::XLocator > &rxLocator)
ContextHandler(const ContextHandler &rParent)
FragmentBaseDataRef mxBaseData
Base data of the fragment.
virtual ~ContextHandler() override
virtual ContextHandlerRef createRecordContext(sal_Int32 nRecId, SequenceInputStream &rStrm)
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
const Relations & getRelations() const
Returns the relations of the current fragment.
virtual void SAL_CALL endFastElement(::sal_Int32 Element) override
virtual void SAL_CALL characters(const OUString &aChars) override
std::shared_ptr< FragmentBaseData > FragmentBaseDataRef
::cppu::WeakImplHelper< css::xml::sax::XFastContextHandler > ContextHandler_BASE