2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2005-09-09 12:58:36 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2005-09-09 12:58:36 +00:00
|
|
|
* $RCSfile: ximpgrp.cxx,v $
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2007-06-27 14:10:02 +00:00
|
|
|
* $Revision: 1.18 $
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2007-06-27 14:10:02 +00:00
|
|
|
* last change: $Author: hr $ $Date: 2007-06-27 15:10:02 $
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2005-09-09 12:58:36 +00:00
|
|
|
* The Contents of this file are made available subject to
|
|
|
|
* the terms of GNU Lesser General Public License Version 2.1.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
|
|
|
*
|
2005-09-09 12:58:36 +00:00
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
* =============================================
|
|
|
|
* Copyright 2005 by Sun Microsystems, Inc.
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2005-09-09 12:58:36 +00:00
|
|
|
* 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.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2005-09-09 12:58:36 +00:00
|
|
|
* 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.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2005-09-09 12:58:36 +00:00
|
|
|
* 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
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-17 09:31:34 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_xmloff.hxx"
|
|
|
|
|
2001-04-30 13:29:26 +00:00
|
|
|
#ifndef _XMLOFF_XMLNMSPE_HXX
|
|
|
|
#include"xmlnmspe.hxx"
|
|
|
|
#endif
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#ifndef _XIMPGROUP_HXX
|
|
|
|
#include "ximpgrp.hxx"
|
|
|
|
#endif
|
|
|
|
|
2001-06-29 20:07:26 +00:00
|
|
|
#ifndef _XMLOFF_XMLTOKEN_HXX
|
2007-06-27 14:10:02 +00:00
|
|
|
#include <xmloff/xmltoken.hxx>
|
2001-04-30 13:29:26 +00:00
|
|
|
#endif
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#ifndef _XIMPSHAPE_HXX
|
|
|
|
#include "ximpshap.hxx"
|
|
|
|
#endif
|
|
|
|
|
2001-04-30 13:29:26 +00:00
|
|
|
#ifndef _XMLOFF_EVENTIMP_HXX
|
|
|
|
#include "eventimp.hxx"
|
|
|
|
#endif
|
2006-12-19 16:27:02 +00:00
|
|
|
#include "descriptionimp.hxx"
|
2001-04-30 13:29:26 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
using namespace ::rtl;
|
|
|
|
using namespace ::com::sun::star;
|
2006-12-19 16:27:02 +00:00
|
|
|
using namespace ::xmloff::token;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
TYPEINIT1( SdXMLGroupShapeContext, SvXMLImportContext );
|
|
|
|
|
|
|
|
SdXMLGroupShapeContext::SdXMLGroupShapeContext(
|
|
|
|
SvXMLImport& rImport,
|
|
|
|
USHORT nPrfx, const OUString& rLocalName,
|
2000-11-23 17:30:39 +00:00
|
|
|
const uno::Reference< xml::sax::XAttributeList>& xAttrList,
|
2004-10-22 06:54:45 +00:00
|
|
|
uno::Reference< drawing::XShapes >& rShapes,
|
|
|
|
sal_Bool bTemporaryShape)
|
|
|
|
: SdXMLShapeContext( rImport, nPrfx, rLocalName, xAttrList, rShapes, bTemporaryShape )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
SdXMLGroupShapeContext::~SdXMLGroupShapeContext()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
SvXMLImportContext* SdXMLGroupShapeContext::CreateChildContext( USHORT nPrefix,
|
|
|
|
const OUString& rLocalName,
|
|
|
|
const uno::Reference< xml::sax::XAttributeList>& xAttrList )
|
|
|
|
{
|
|
|
|
SvXMLImportContext* pContext = 0L;
|
|
|
|
|
2006-12-19 16:27:02 +00:00
|
|
|
// #i68101#
|
|
|
|
if( nPrefix == XML_NAMESPACE_SVG &&
|
|
|
|
(IsXMLToken( rLocalName, XML_TITLE ) || IsXMLToken( rLocalName, XML_DESC ) ) )
|
|
|
|
{
|
|
|
|
pContext = new SdXMLDescriptionContext( GetImport(), nPrefix, rLocalName, xAttrList, mxShape );
|
|
|
|
}
|
|
|
|
else if( nPrefix == XML_NAMESPACE_OFFICE && IsXMLToken( rLocalName, XML_EVENT_LISTENERS ) )
|
2001-04-30 13:29:26 +00:00
|
|
|
{
|
|
|
|
pContext = new SdXMLEventsContext( GetImport(), nPrefix, rLocalName, xAttrList, mxShape );
|
|
|
|
}
|
2001-12-14 14:39:26 +00:00
|
|
|
else if( nPrefix == XML_NAMESPACE_DRAW && IsXMLToken( rLocalName, XML_GLUE_POINT ) )
|
|
|
|
{
|
|
|
|
addGluePoint( xAttrList );
|
|
|
|
}
|
2001-04-30 13:29:26 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
// call GroupChildContext function at common ShapeImport
|
|
|
|
pContext = GetImport().GetShapeImport()->CreateGroupChildContext(
|
|
|
|
GetImport(), nPrefix, rLocalName, xAttrList, mxChilds);
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// call parent when no own context was created
|
|
|
|
if(!pContext)
|
|
|
|
pContext = SvXMLImportContext::CreateChildContext(
|
|
|
|
nPrefix, rLocalName, xAttrList);
|
|
|
|
|
|
|
|
return pContext;
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2006-06-19 17:14:30 +00:00
|
|
|
void SdXMLGroupShapeContext::StartElement(const uno::Reference< xml::sax::XAttributeList>&)
|
2000-12-13 18:16:42 +00:00
|
|
|
{
|
|
|
|
// 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())
|
|
|
|
{
|
2003-03-27 17:21:03 +00:00
|
|
|
SetStyle( false );
|
|
|
|
|
2000-12-13 18:16:42 +00:00
|
|
|
mxChilds = uno::Reference< drawing::XShapes >::query( mxShape );
|
|
|
|
if( mxChilds.is() )
|
|
|
|
GetImport().GetShapeImport()->pushGroupForSorting( mxChilds );
|
|
|
|
}
|
|
|
|
|
|
|
|
GetImport().GetShapeImport()->finishShape( mxShape, mxAttrList, mxShapes );
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
void SdXMLGroupShapeContext::EndElement()
|
|
|
|
{
|
2000-12-13 18:16:42 +00:00
|
|
|
if( mxChilds.is() )
|
|
|
|
GetImport().GetShapeImport()->popGroupAndSort();
|
2004-06-28 12:52:57 +00:00
|
|
|
|
|
|
|
SdXMLShapeContext::EndElement();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|