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