2010-10-12 15:53:47 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 20:54:57 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 20:54:57 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 20:54:57 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 20:54:57 +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.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 20:54:57 +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).
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2008-04-10 20:54:57 +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.
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2010-04-16 23:04:00 +02:00
|
|
|
#include"xmloff/xmlnmspe.hxx"
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "ximpgrp.hxx"
|
2007-06-27 14:10:02 +00:00
|
|
|
#include <xmloff/xmltoken.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#include "ximpshap.hxx"
|
2001-04-30 13:29:26 +00:00
|
|
|
#include "eventimp.hxx"
|
2006-12-19 16:27:02 +00:00
|
|
|
#include "descriptionimp.hxx"
|
2001-04-30 13:29:26 +00:00
|
|
|
|
2008-03-12 09:37:53 +00:00
|
|
|
using ::rtl::OUString;
|
|
|
|
using ::rtl::OUStringBuffer;
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
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,
|
2010-11-10 13:50:33 +08:00
|
|
|
sal_uInt16 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()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2010-11-10 13:50:33 +08:00
|
|
|
SvXMLImportContext* SdXMLGroupShapeContext::CreateChildContext( sal_uInt16 nPrefix,
|
2000-09-18 16:07:07 +00:00
|
|
|
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(
|
2011-12-07 02:33:51 -08:00
|
|
|
GetImport(), nPrefix, rLocalName, xAttrList, mxChildren);
|
2001-04-30 13:29:26 +00:00
|
|
|
}
|
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 );
|
|
|
|
|
2011-12-07 02:33:51 -08:00
|
|
|
mxChildren = uno::Reference< drawing::XShapes >::query( mxShape );
|
|
|
|
if( mxChildren.is() )
|
|
|
|
GetImport().GetShapeImport()->pushGroupForSorting( mxChildren );
|
2000-12-13 18:16:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
GetImport().GetShapeImport()->finishShape( mxShape, mxAttrList, mxShapes );
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
void SdXMLGroupShapeContext::EndElement()
|
|
|
|
{
|
2011-12-07 02:33:51 -08:00
|
|
|
if( mxChildren.is() )
|
2000-12-13 18:16:42 +00:00
|
|
|
GetImport().GetShapeImport()->popGroupAndSort();
|
2004-06-28 12:52:57 +00:00
|
|
|
|
|
|
|
SdXMLShapeContext::EndElement();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-10-12 15:53:47 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|