1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 // MARKER(update_precomp.py): autogen include statement, do not remove 25 #include "precompiled_drawinglayer.hxx" 26 27 #include <drawinglayer/processor2d/objectinfoextractor2d.hxx> 28 #include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx> 29 #include <drawinglayer/primitive2d/objectinfoprimitive2d.hxx> 30 31 ////////////////////////////////////////////////////////////////////////////// 32 33 using namespace com::sun::star; 34 35 ////////////////////////////////////////////////////////////////////////////// 36 37 namespace drawinglayer 38 { 39 namespace processor2d 40 { processBasePrimitive2D(const primitive2d::BasePrimitive2D & rCandidate)41 void ObjectInfoPrimitiveExtractor2D::processBasePrimitive2D(const primitive2d::BasePrimitive2D& rCandidate) 42 { 43 if(!mpFound) 44 { 45 switch(rCandidate.getPrimitive2DID()) 46 { 47 case PRIMITIVE2D_ID_OBJECTINFOPRIMITIVE2D : 48 { 49 mpFound = dynamic_cast< const primitive2d::ObjectInfoPrimitive2D* >(&rCandidate); 50 break; 51 } 52 default : 53 { 54 // process recursively 55 process(rCandidate.get2DDecomposition(getViewInformation2D())); 56 break; 57 } 58 } 59 } 60 } 61 ObjectInfoPrimitiveExtractor2D(const geometry::ViewInformation2D & rViewInformation)62 ObjectInfoPrimitiveExtractor2D::ObjectInfoPrimitiveExtractor2D(const geometry::ViewInformation2D& rViewInformation) 63 : BaseProcessor2D(rViewInformation), 64 mpFound(0) 65 { 66 } 67 ~ObjectInfoPrimitiveExtractor2D()68 ObjectInfoPrimitiveExtractor2D::~ObjectInfoPrimitiveExtractor2D() 69 { 70 } 71 } // end of namespace processor2d 72 } // end of namespace drawinglayer 73 74 ////////////////////////////////////////////////////////////////////////////// 75 // eof 76