update dev300-m58
[ooovba.git] / drawinglayer / source / processor2d / baseprocessor2d.cxx
blob5d7e85b467cd85186696cad0e59277866c26e8eb
1 /*************************************************************************
3 * OpenOffice.org - a multi-platform office productivity suite
5 * $RCSfile: baseprocessor2d.cxx,v $
7 * $Revision: 1.5 $
9 * last change: $Author: aw $ $Date: 2008-06-24 15:31:08 $
11 * The Contents of this file are made available subject to
12 * the terms of GNU Lesser General Public License Version 2.1.
15 * GNU Lesser General Public License Version 2.1
16 * =============================================
17 * Copyright 2005 by Sun Microsystems, Inc.
18 * 901 San Antonio Road, Palo Alto, CA 94303, USA
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License version 2.1, as published by the Free Software Foundation.
24 * This library is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 * Lesser General Public License for more details.
29 * You should have received a copy of the GNU Lesser General Public
30 * License along with this library; if not, write to the Free Software
31 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32 * MA 02111-1307 USA
34 ************************************************************************/
36 // MARKER(update_precomp.py): autogen include statement, do not remove
37 #include "precompiled_drawinglayer.hxx"
39 #include <drawinglayer/processor2d/baseprocessor2d.hxx>
41 //////////////////////////////////////////////////////////////////////////////
43 using namespace com::sun::star;
45 //////////////////////////////////////////////////////////////////////////////
47 namespace drawinglayer
49 namespace processor2d
51 void BaseProcessor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D& /*rCandidate*/)
55 BaseProcessor2D::BaseProcessor2D(const geometry::ViewInformation2D& rViewInformation)
56 : maViewInformation2D(rViewInformation)
60 BaseProcessor2D::~BaseProcessor2D()
64 void BaseProcessor2D::process(const primitive2d::Primitive2DSequence& rSource)
66 if(rSource.hasElements())
68 const sal_Int32 nCount(rSource.getLength());
70 for(sal_Int32 a(0L); a < nCount; a++)
72 // get reference
73 const primitive2d::Primitive2DReference xReference(rSource[a]);
75 if(xReference.is())
77 // try to cast to BasePrimitive2D implementation
78 const primitive2d::BasePrimitive2D* pBasePrimitive = dynamic_cast< const primitive2d::BasePrimitive2D* >(xReference.get());
80 if(pBasePrimitive)
82 // it is a BasePrimitive2D implementation, use local processor
83 processBasePrimitive2D(*pBasePrimitive);
85 else
87 // unknown implementation, use UNO API call instead and process recursively
88 const uno::Sequence< beans::PropertyValue >& rViewParameters(getViewInformation2D().getViewInformationSequence());
89 process(xReference->getDecomposition(rViewParameters));
95 } // end of namespace processor2d
96 } // end of namespace drawinglayer
98 //////////////////////////////////////////////////////////////////////////////
99 // eof