1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: contexthandler.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #include "oox/core/contexthandler.hxx"
32 #include "oox/core/fragmenthandler.hxx"
34 using ::rtl::OUString
;
35 using ::com::sun::star::uno::Reference
;
36 using ::com::sun::star::uno::RuntimeException
;
37 using ::com::sun::star::xml::sax::SAXException
;
38 using ::com::sun::star::xml::sax::XFastAttributeList
;
39 using ::com::sun::star::xml::sax::XFastContextHandler
;
40 using ::com::sun::star::xml::sax::XLocator
;
45 // ============================================================================
47 ContextHandler::ContextHandler( ContextHandler
& rParent
) :
48 ContextHandlerImplBase(),
49 mxBaseData( rParent
.mxBaseData
)
53 ContextHandler::ContextHandler( const FragmentBaseDataRef
& rxBaseData
) :
54 mxBaseData( rxBaseData
)
58 ContextHandler::~ContextHandler()
62 XmlFilterBase
& ContextHandler::getFilter() const
64 return mxBaseData
->mrFilter
;
67 const Relations
& ContextHandler::getRelations() const
69 return *mxBaseData
->mxRelations
;
72 const OUString
& ContextHandler::getFragmentPath() const
74 return mxBaseData
->maFragmentPath
;
77 OUString
ContextHandler::getFragmentPathFromRelation( const Relation
& rRelation
) const
79 return mxBaseData
->mxRelations
->getFragmentPathFromRelation( rRelation
);
82 OUString
ContextHandler::getFragmentPathFromRelId( const OUString
& rRelId
) const
84 return mxBaseData
->mxRelations
->getFragmentPathFromRelId( rRelId
);
87 OUString
ContextHandler::getFragmentPathFromFirstType( const OUString
& rType
) const
89 return mxBaseData
->mxRelations
->getFragmentPathFromFirstType( rType
);
92 void ContextHandler::implSetLocator( const Reference
< XLocator
>& rxLocator
)
94 mxBaseData
->mxLocator
= rxLocator
;
97 // com.sun.star.xml.sax.XFastContextHandler interface -------------------------
99 void ContextHandler::startFastElement( sal_Int32
, const Reference
< XFastAttributeList
>& ) throw( SAXException
, RuntimeException
)
103 void ContextHandler::startUnknownElement( const OUString
&, const OUString
&, const Reference
< XFastAttributeList
>& ) throw( SAXException
, RuntimeException
)
107 void ContextHandler::endFastElement( sal_Int32
) throw( SAXException
, RuntimeException
)
111 void ContextHandler::endUnknownElement( const OUString
&, const OUString
& ) throw( SAXException
, RuntimeException
)
115 Reference
< XFastContextHandler
> ContextHandler::createFastChildContext( sal_Int32
, const Reference
< XFastAttributeList
>& ) throw( SAXException
, RuntimeException
)
120 Reference
< XFastContextHandler
> ContextHandler::createUnknownChildContext( const OUString
&, const OUString
&, const Reference
< XFastAttributeList
>& ) throw( SAXException
, RuntimeException
)
125 void ContextHandler::characters( const OUString
& ) throw( SAXException
, RuntimeException
)
129 void ContextHandler::ignorableWhitespace( const OUString
& ) throw( SAXException
, RuntimeException
)
133 void ContextHandler::processingInstruction( const OUString
&, const OUString
& ) throw( SAXException
, RuntimeException
)
137 // record context interface ---------------------------------------------------
139 ContextHandlerRef
ContextHandler::createRecordContext( sal_Int32
, RecordInputStream
& )
144 void ContextHandler::startRecord( sal_Int32
, RecordInputStream
& )
148 void ContextHandler::endRecord( sal_Int32
)
152 // ============================================================================