Branch data Line data Source code
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 : :
20 : : #include "oox/core/fragmenthandler.hxx"
21 : :
22 : : #include "oox/core/xmlfilterbase.hxx"
23 : :
24 : : namespace oox {
25 : : namespace core {
26 : :
27 : : // ============================================================================
28 : :
29 : : using namespace ::com::sun::star::io;
30 : : using namespace ::com::sun::star::uno;
31 : : using namespace ::com::sun::star::xml::sax;
32 : :
33 : : using ::rtl::OUString;
34 : :
35 : : // ============================================================================
36 : :
37 : 531 : FragmentBaseData::FragmentBaseData( XmlFilterBase& rFilter, const OUString& rFragmentPath, RelationsRef xRelations ) :
38 : : mrFilter( rFilter ),
39 : : maFragmentPath( rFragmentPath ),
40 [ + - ]: 531 : mxRelations( xRelations )
41 : : {
42 : 531 : }
43 : :
44 : : // ============================================================================
45 : :
46 : 258 : FragmentHandler::FragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath ) :
47 [ + - ][ + - ]: 258 : FragmentHandler_BASE( FragmentBaseDataRef( new FragmentBaseData( rFilter, rFragmentPath, rFilter.importRelations( rFragmentPath ) ) ) )
[ + - ][ + - ]
[ + - ]
48 : : {
49 : 258 : }
50 : :
51 : 273 : FragmentHandler::FragmentHandler( XmlFilterBase& rFilter, const OUString& rFragmentPath, RelationsRef xRelations ) :
52 [ + - ][ + - ]: 273 : FragmentHandler_BASE( FragmentBaseDataRef( new FragmentBaseData( rFilter, rFragmentPath, xRelations ) ) )
[ + - ][ + - ]
[ + - ]
53 : : {
54 : 273 : }
55 : :
56 : 549 : FragmentHandler::~FragmentHandler()
57 : : {
58 [ - + ]: 549 : }
59 : :
60 : : // com.sun.star.xml.sax.XFastDocumentHandler interface ------------------------
61 : :
62 : 147 : void FragmentHandler::startDocument() throw( SAXException, RuntimeException )
63 : : {
64 : 147 : }
65 : :
66 : 141 : void FragmentHandler::endDocument() throw( SAXException, RuntimeException )
67 : : {
68 : 141 : }
69 : :
70 : 333 : void FragmentHandler::setDocumentLocator( const Reference< XLocator >& rxLocator ) throw( SAXException, RuntimeException )
71 : : {
72 : 333 : implSetLocator( rxLocator );
73 : 333 : }
74 : :
75 : : // com.sun.star.xml.sax.XFastContextHandler interface -------------------------
76 : :
77 : 144 : void FragmentHandler::startFastElement( sal_Int32, const Reference< XFastAttributeList >& ) throw( SAXException, RuntimeException )
78 : : {
79 : 144 : }
80 : :
81 : 0 : void FragmentHandler::startUnknownElement( const OUString&, const OUString&, const Reference< XFastAttributeList >& ) throw( SAXException, RuntimeException )
82 : : {
83 : 0 : }
84 : :
85 : 144 : void FragmentHandler::endFastElement( sal_Int32 ) throw( SAXException, RuntimeException )
86 : : {
87 : 144 : }
88 : :
89 : 0 : void FragmentHandler::endUnknownElement( const OUString&, const OUString& ) throw( SAXException, RuntimeException )
90 : : {
91 : 0 : }
92 : :
93 : 0 : Reference< XFastContextHandler > FragmentHandler::createFastChildContext( sal_Int32, const Reference< XFastAttributeList >& ) throw( SAXException, RuntimeException )
94 : : {
95 : 0 : return 0;
96 : : }
97 : :
98 : 12 : Reference< XFastContextHandler > FragmentHandler::createUnknownChildContext( const OUString&, const OUString&, const Reference< XFastAttributeList >& ) throw( SAXException, RuntimeException )
99 : : {
100 : 12 : return 0;
101 : : }
102 : :
103 : 66 : void FragmentHandler::characters( const OUString& ) throw( SAXException, RuntimeException )
104 : : {
105 : 66 : }
106 : :
107 : 0 : void FragmentHandler::ignorableWhitespace( const OUString& ) throw( SAXException, RuntimeException )
108 : : {
109 : 0 : }
110 : :
111 : 0 : void FragmentHandler::processingInstruction( const OUString&, const OUString& ) throw( SAXException, RuntimeException )
112 : : {
113 : 0 : }
114 : :
115 : : // XML stream handling --------------------------------------------------------
116 : :
117 : 465 : Reference< XInputStream > FragmentHandler::openFragmentStream() const
118 : : {
119 : 465 : return getFilter().openInputStream( getFragmentPath() );
120 : : }
121 : :
122 : : // binary records -------------------------------------------------------------
123 : :
124 : 0 : const RecordInfo* FragmentHandler::getRecordInfos() const
125 : : {
126 : : // default: no support for binary records
127 : 0 : return 0;
128 : : }
129 : :
130 : : // ============================================================================
131 : :
132 : : } // namespace core
133 [ + - ][ + - ]: 285 : } // namespace oox
134 : :
135 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|