1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <oox/core/fragmenthandler.hxx>
22 #include <oox/core/xmlfilterbase.hxx>
26 using namespace ::com::sun::star::io
;
27 using namespace ::com::sun::star::uno
;
28 using namespace ::com::sun::star::xml::sax
;
30 FragmentBaseData::FragmentBaseData( XmlFilterBase
& rFilter
, const OUString
& rFragmentPath
, RelationsRef
const & xRelations
) :
32 maFragmentPath( rFragmentPath
),
33 mxRelations( xRelations
)
37 FragmentHandler::FragmentHandler( XmlFilterBase
& rFilter
, const OUString
& rFragmentPath
) :
38 FragmentHandler_BASE( std::make_shared
<FragmentBaseData
>( rFilter
, rFragmentPath
, rFilter
.importRelations( rFragmentPath
) ) )
42 FragmentHandler::FragmentHandler( XmlFilterBase
& rFilter
, const OUString
& rFragmentPath
, RelationsRef xRelations
) :
43 FragmentHandler_BASE( std::make_shared
<FragmentBaseData
>( rFilter
, rFragmentPath
, xRelations
) )
47 FragmentHandler::~FragmentHandler()
51 // com.sun.star.xml.sax.XFastDocumentHandler interface ------------------------
53 void FragmentHandler::startDocument()
57 void FragmentHandler::endDocument()
61 void FragmentHandler::processingInstruction( const OUString
& /*rTarget*/, const OUString
& /*rData*/ )
65 void FragmentHandler::setDocumentLocator( const Reference
< XLocator
>& rxLocator
)
67 implSetLocator( rxLocator
);
70 // com.sun.star.xml.sax.XFastContextHandler interface -------------------------
72 void FragmentHandler::startFastElement( sal_Int32
, const Reference
< XFastAttributeList
>& )
76 void FragmentHandler::startUnknownElement( const OUString
&, const OUString
&, const Reference
< XFastAttributeList
>& )
80 void FragmentHandler::endFastElement( sal_Int32
)
84 void FragmentHandler::endUnknownElement( const OUString
&, const OUString
& )
88 Reference
< XFastContextHandler
> FragmentHandler::createFastChildContext( sal_Int32
, const Reference
< XFastAttributeList
>& )
93 Reference
< XFastContextHandler
> FragmentHandler::createUnknownChildContext( const OUString
&, const OUString
&, const Reference
< XFastAttributeList
>& )
98 void FragmentHandler::characters( const OUString
& )
102 // XML stream handling --------------------------------------------------------
104 Reference
< XInputStream
> FragmentHandler::openFragmentStream() const
106 return getFilter().openInputStream( getFragmentPath() );
109 // binary records -------------------------------------------------------------
111 const RecordInfo
* FragmentHandler::getRecordInfos() const
113 // default: no support for binary records
117 } // namespace oox::core
119 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */