Files
libreoffice/xmloff/source/draw/ximpgrp.cxx
Jens-Heiner Rechtien b65cca5dd1 INTEGRATION: CWS warnings01 (1.14.32); FILE MERGED
2005/11/16 21:34:15 pl 1.14.32.2: #i55991# removed warnings
2005/11/02 14:57:52 cl 1.14.32.1: warning free code changes
2006-06-19 17:14:30 +00:00

144 lines
4.3 KiB
C++

/*************************************************************************
*
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: ximpgrp.cxx,v $
*
* $Revision: 1.15 $
*
* last change: $Author: hr $ $Date: 2006-06-19 18:14:30 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
*
*
* GNU Lesser General Public License Version 2.1
* =============================================
* Copyright 2005 by Sun Microsystems, Inc.
* 901 San Antonio Road, Palo Alto, CA 94303, USA
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License version 2.1, as published by the Free Software Foundation.
*
* This library 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 for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
************************************************************************/
#ifndef _XMLOFF_XMLNMSPE_HXX
#include"xmlnmspe.hxx"
#endif
#ifndef _XIMPGROUP_HXX
#include "ximpgrp.hxx"
#endif
#ifndef _XMLOFF_XMLTOKEN_HXX
#include "xmltoken.hxx"
#endif
#ifndef _XIMPSHAPE_HXX
#include "ximpshap.hxx"
#endif
#ifndef _XMLOFF_EVENTIMP_HXX
#include "eventimp.hxx"
#endif
using namespace ::rtl;
using namespace ::com::sun::star;
using ::xmloff::token::IsXMLToken;
using ::xmloff::token::XML_EVENT_LISTENERS;
using ::xmloff::token::XML_GLUE_POINT;
//////////////////////////////////////////////////////////////////////////////
TYPEINIT1( SdXMLGroupShapeContext, SvXMLImportContext );
SdXMLGroupShapeContext::SdXMLGroupShapeContext(
SvXMLImport& rImport,
USHORT nPrfx, const OUString& rLocalName,
const uno::Reference< xml::sax::XAttributeList>& xAttrList,
uno::Reference< drawing::XShapes >& rShapes,
sal_Bool bTemporaryShape)
: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape )
{
}
//////////////////////////////////////////////////////////////////////////////
SdXMLGroupShapeContext::~SdXMLGroupShapeContext()
{
}
//////////////////////////////////////////////////////////////////////////////
SvXMLImportContext* SdXMLGroupShapeContext::CreateChildContext( USHORT nPrefix,
const OUString& rLocalName,
const uno::Reference< xml::sax::XAttributeList>& xAttrList )
{
SvXMLImportContext* pContext = 0L;
if( nPrefix == XML_NAMESPACE_OFFICE && IsXMLToken( rLocalName, XML_EVENT_LISTENERS ) )
{
pContext = new SdXMLEventsContext( GetImport(), nPrefix, rLocalName, xAttrList, mxShape );
}
else if( nPrefix == XML_NAMESPACE_DRAW && IsXMLToken( rLocalName, XML_GLUE_POINT ) )
{
addGluePoint( xAttrList );
}
else
{
// call GroupChildContext function at common ShapeImport
pContext = GetImport().GetShapeImport()->CreateGroupChildContext(
GetImport(), nPrefix, rLocalName, xAttrList, mxChilds);
}
// call parent when no own context was created
if(!pContext)
pContext = SvXMLImportContext::CreateChildContext(
nPrefix, rLocalName, xAttrList);
return pContext;
}
//////////////////////////////////////////////////////////////////////////////
void SdXMLGroupShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>&)
{
// create new group shape and add it to rShapes, use it
// as base for the new group import
AddShape( "com.sun.star.drawing.GroupShape" );
if(mxShape.is())
{
SetStyle( false );
mxChilds = uno::Reference< drawing::XShapes >::query( mxShape );
if( mxChilds.is() )
GetImport().GetShapeImport()->pushGroupForSorting( mxChilds );
}
GetImport().GetShapeImport()->finishShape( mxShape, mxAttrList, mxShapes );
}
//////////////////////////////////////////////////////////////////////////////
void SdXMLGroupShapeContext::EndElement()
{
if( mxChilds.is() )
GetImport().GetShapeImport()->popGroupAndSort();
SdXMLShapeContext::EndElement();
}