1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #include <drawinglayer/processor2d/baseprocessor2d.hxx>
31 //////////////////////////////////////////////////////////////////////////////
33 using namespace com::sun::star
;
35 //////////////////////////////////////////////////////////////////////////////
37 namespace drawinglayer
41 void BaseProcessor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D
& /*rCandidate*/)
45 BaseProcessor2D::BaseProcessor2D(const geometry::ViewInformation2D
& rViewInformation
)
46 : maViewInformation2D(rViewInformation
)
50 BaseProcessor2D::~BaseProcessor2D()
54 void BaseProcessor2D::process(const primitive2d::Primitive2DSequence
& rSource
)
56 if(rSource
.hasElements())
58 const sal_Int32
nCount(rSource
.getLength());
60 for(sal_Int32
a(0L); a
< nCount
; a
++)
63 const primitive2d::Primitive2DReference
xReference(rSource
[a
]);
67 // try to cast to BasePrimitive2D implementation
68 const primitive2d::BasePrimitive2D
* pBasePrimitive
= dynamic_cast< const primitive2d::BasePrimitive2D
* >(xReference
.get());
72 // it is a BasePrimitive2D implementation, use local processor
73 processBasePrimitive2D(*pBasePrimitive
);
77 // unknown implementation, use UNO API call instead and process recursively
78 const uno::Sequence
< beans::PropertyValue
>& rViewParameters(getViewInformation2D().getViewInformationSequence());
79 process(xReference
->getDecomposition(rViewParameters
));
85 } // end of namespace processor2d
86 } // end of namespace drawinglayer
88 //////////////////////////////////////////////////////////////////////////////
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */