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: fragmenthandler2.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/fragmenthandler2.hxx"
33 using ::rtl::OUString
;
34 using ::com::sun::star::uno::Reference
;
35 using ::com::sun::star::uno::RuntimeException
;
36 using ::com::sun::star::xml::sax::SAXException
;
37 using ::com::sun::star::xml::sax::XFastAttributeList
;
38 using ::com::sun::star::xml::sax::XFastContextHandler
;
43 // ============================================================================
45 FragmentHandler2::FragmentHandler2( XmlFilterBase
& rFilter
, const OUString
& rFragmentPath
, bool bEnableTrimSpace
) :
46 FragmentHandler( rFilter
, rFragmentPath
),
47 ContextHandler2Helper( bEnableTrimSpace
)
51 FragmentHandler2::~FragmentHandler2()
55 ContextHandler
& FragmentHandler2::queryContextHandler()
60 // com.sun.star.xml.sax.XFastDocumentHandler interface --------------------
62 void SAL_CALL
FragmentHandler2::startDocument() throw( SAXException
, RuntimeException
)
67 void SAL_CALL
FragmentHandler2::endDocument() throw( SAXException
, RuntimeException
)
72 // com.sun.star.xml.sax.XFastContextHandler interface -------------------------
74 Reference
< XFastContextHandler
> SAL_CALL
FragmentHandler2::createFastChildContext(
75 sal_Int32 nElement
, const Reference
< XFastAttributeList
>& rxAttribs
) throw( SAXException
, RuntimeException
)
77 return implCreateChildContext( nElement
, rxAttribs
);
80 void SAL_CALL
FragmentHandler2::startFastElement(
81 sal_Int32 nElement
, const Reference
< XFastAttributeList
>& rxAttribs
) throw( SAXException
, RuntimeException
)
83 implStartCurrentContext( nElement
, rxAttribs
);
86 void SAL_CALL
FragmentHandler2::characters( const OUString
& rChars
) throw( SAXException
, RuntimeException
)
88 implCharacters( rChars
);
91 void SAL_CALL
FragmentHandler2::endFastElement( sal_Int32 nElement
) throw( SAXException
, RuntimeException
)
93 implEndCurrentContext( nElement
);
96 // oox.core.ContextHandler interface ------------------------------------------
98 ContextHandlerRef
FragmentHandler2::createRecordContext( sal_Int32 nRecId
, RecordInputStream
& rStrm
)
100 return implCreateRecordContext( nRecId
, rStrm
);
103 void FragmentHandler2::startRecord( sal_Int32 nRecId
, RecordInputStream
& rStrm
)
105 implStartRecord( nRecId
, rStrm
);
108 void FragmentHandler2::endRecord( sal_Int32 nRecId
)
110 implEndRecord( nRecId
);
113 // oox.core.ContextHandler2Helper interface -----------------------------------
115 ContextHandlerRef
FragmentHandler2::onCreateContext( sal_Int32
, const AttributeList
& )
120 void FragmentHandler2::onStartElement( const AttributeList
& )
124 void FragmentHandler2::onEndElement( const OUString
& )
128 ContextHandlerRef
FragmentHandler2::onCreateRecordContext( sal_Int32
, RecordInputStream
& )
133 void FragmentHandler2::onStartRecord( RecordInputStream
& )
137 void FragmentHandler2::onEndRecord()
141 // oox.core.FragmentHandler2 interface ----------------------------------------
143 void FragmentHandler2::initializeImport()
147 void FragmentHandler2::finalizeImport()
151 // ============================================================================