2010-10-12 15:53:47 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-11-12 17:21:24 +00:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
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
|
|
|
|
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,
|
2014-04-07 16:42:18 +02:00
|
|
|
bool bTemporaryShape)
|
2004-10-22 06:54:45 +00:00
|
|
|
: 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: */
|