2007/08/01 14:14:48 cl 1.17.30.2: RESYNC: (1.17-1.18); FILE MERGED 2007/07/27 09:09:52 cl 1.17.30.1: fixed build issues due to pch and namespace ::rtl
154 lines
4.7 KiB
C++
154 lines
4.7 KiB
C++
/*************************************************************************
|
|
*
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
|
*
|
|
* $RCSfile: ximpgrp.cxx,v $
|
|
*
|
|
* $Revision: 1.19 $
|
|
*
|
|
* last change: $Author: rt $ $Date: 2008-03-12 10:37:52 $
|
|
*
|
|
* 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
|
|
*
|
|
************************************************************************/
|
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
#include "precompiled_xmloff.hxx"
|
|
|
|
#ifndef _XMLOFF_XMLNMSPE_HXX
|
|
#include"xmlnmspe.hxx"
|
|
#endif
|
|
|
|
#ifndef _XIMPGROUP_HXX
|
|
#include "ximpgrp.hxx"
|
|
#endif
|
|
|
|
#ifndef _XMLOFF_XMLTOKEN_HXX
|
|
#include <xmloff/xmltoken.hxx>
|
|
#endif
|
|
|
|
#ifndef _XIMPSHAPE_HXX
|
|
#include "ximpshap.hxx"
|
|
#endif
|
|
|
|
#ifndef _XMLOFF_EVENTIMP_HXX
|
|
#include "eventimp.hxx"
|
|
#endif
|
|
#include "descriptionimp.hxx"
|
|
|
|
using ::rtl::OUString;
|
|
using ::rtl::OUStringBuffer;
|
|
|
|
using namespace ::com::sun::star;
|
|
using namespace ::xmloff::token;
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
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;
|
|
|
|
// #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 ) )
|
|
{
|
|
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();
|
|
}
|
|
|
|
|