2008-03-05 17:12:18 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 14:06:24 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2008-03-05 17:12:18 +00:00
|
|
|
*
|
2008-04-10 14:06:24 +00:00
|
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
2008-03-05 17:12:18 +00:00
|
|
|
*
|
2008-04-10 14:06:24 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2008-03-05 17:12:18 +00:00
|
|
|
*
|
2008-04-10 14:06:24 +00:00
|
|
|
* $RCSfile: contexthandler.cxx,v $
|
2008-04-18 19:06:48 +00:00
|
|
|
* $Revision: 1.4 $
|
2008-03-05 17:12:18 +00:00
|
|
|
*
|
2008-04-10 14:06:24 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2008-03-05 17:12:18 +00:00
|
|
|
*
|
2008-04-10 14:06:24 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2008-03-05 17:12:18 +00:00
|
|
|
*
|
2008-04-10 14:06:24 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2008-03-05 17:12:18 +00:00
|
|
|
*
|
2008-04-10 14:06:24 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2008-03-05 17:12:18 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#include "oox/core/contexthandler.hxx"
|
|
|
|
#include "oox/core/fragmenthandler.hxx"
|
|
|
|
|
|
|
|
using ::rtl::OUString;
|
|
|
|
using ::com::sun::star::uno::Reference;
|
|
|
|
using ::com::sun::star::uno::RuntimeException;
|
|
|
|
using ::com::sun::star::xml::sax::SAXException;
|
|
|
|
using ::com::sun::star::xml::sax::XFastAttributeList;
|
|
|
|
using ::com::sun::star::xml::sax::XFastContextHandler;
|
|
|
|
using ::com::sun::star::xml::sax::XLocator;
|
|
|
|
|
|
|
|
namespace oox {
|
|
|
|
namespace core {
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
ContextHandler::ContextHandler( ContextHandler& rParent ) :
|
2008-04-18 19:06:48 +00:00
|
|
|
ContextHandlerImplBase(),
|
|
|
|
mxBaseData( rParent.mxBaseData )
|
2008-03-05 17:12:18 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
ContextHandler::ContextHandler( const FragmentBaseDataRef& rxBaseData ) :
|
2008-04-18 19:06:48 +00:00
|
|
|
mxBaseData( rxBaseData )
|
2008-03-05 17:12:18 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
ContextHandler::~ContextHandler()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
XmlFilterBase& ContextHandler::getFilter() const
|
|
|
|
{
|
|
|
|
return mxBaseData->mrFilter;
|
|
|
|
}
|
|
|
|
|
|
|
|
const Relations& ContextHandler::getRelations() const
|
|
|
|
{
|
|
|
|
return *mxBaseData->mxRelations;
|
|
|
|
}
|
|
|
|
|
|
|
|
const OUString& ContextHandler::getFragmentPath() const
|
|
|
|
{
|
|
|
|
return mxBaseData->maFragmentPath;
|
|
|
|
}
|
|
|
|
|
|
|
|
OUString ContextHandler::getFragmentPathFromTarget( const OUString& rTarget ) const
|
|
|
|
{
|
|
|
|
return mxBaseData->mxRelations->getFragmentPathFromTarget( rTarget );
|
|
|
|
}
|
|
|
|
|
|
|
|
OUString ContextHandler::getFragmentPathFromRelId( const OUString& rRelId ) const
|
|
|
|
{
|
|
|
|
return mxBaseData->mxRelations->getFragmentPathFromRelId( rRelId );
|
|
|
|
}
|
|
|
|
|
|
|
|
OUString ContextHandler::getFragmentPathFromType( const OUString& rType ) const
|
|
|
|
{
|
|
|
|
return mxBaseData->mxRelations->getFragmentPathFromType( rType );
|
|
|
|
}
|
|
|
|
|
|
|
|
void ContextHandler::implSetLocator( const Reference< XLocator >& rxLocator )
|
|
|
|
{
|
|
|
|
mxBaseData->mxLocator = rxLocator;
|
|
|
|
}
|
|
|
|
|
|
|
|
// com.sun.star.xml.sax.XFastContextHandler interface -------------------------
|
|
|
|
|
|
|
|
void ContextHandler::startFastElement( sal_Int32, const Reference< XFastAttributeList >& ) throw( SAXException, RuntimeException )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void ContextHandler::startUnknownElement( const OUString&, const OUString&, const Reference< XFastAttributeList >& ) throw( SAXException, RuntimeException )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void ContextHandler::endFastElement( sal_Int32 ) throw( SAXException, RuntimeException )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void ContextHandler::endUnknownElement( const OUString&, const OUString& ) throw( SAXException, RuntimeException )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Reference< XFastContextHandler > ContextHandler::createFastChildContext( sal_Int32, const Reference< XFastAttributeList >& ) throw( SAXException, RuntimeException )
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
Reference< XFastContextHandler > ContextHandler::createUnknownChildContext( const OUString&, const OUString&, const Reference< XFastAttributeList >& ) throw( SAXException, RuntimeException )
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ContextHandler::characters( const OUString& ) throw( SAXException, RuntimeException )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void ContextHandler::ignorableWhitespace( const OUString& ) throw( SAXException, RuntimeException )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void ContextHandler::processingInstruction( const OUString&, const OUString& ) throw( SAXException, RuntimeException )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// record context interface ---------------------------------------------------
|
|
|
|
|
|
|
|
ContextHandlerRef ContextHandler::createRecordContext( sal_Int32, RecordInputStream& )
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
void ContextHandler::startRecord( sal_Int32, RecordInputStream& )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void ContextHandler::endRecord( sal_Int32 )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
} // namespace core
|
|
|
|
} // namespace oox
|
|
|
|
|