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_svx.hxx" 26 27 #include <svx/sdr/contact/viewcontactofsdredgeobj.hxx> 28 #include <svx/svdoedge.hxx> 29 #include <svx/sdr/primitive2d/sdrattributecreator.hxx> 30 #include <svx/sdr/primitive2d/sdrconnectorprimitive2d.hxx> 31 32 ////////////////////////////////////////////////////////////////////////////// 33 34 namespace sdr 35 { 36 namespace contact 37 { ViewContactOfSdrEdgeObj(SdrEdgeObj & rEdgeObj)38 ViewContactOfSdrEdgeObj::ViewContactOfSdrEdgeObj(SdrEdgeObj& rEdgeObj) 39 : ViewContactOfTextObj(rEdgeObj) 40 { 41 } 42 ~ViewContactOfSdrEdgeObj()43 ViewContactOfSdrEdgeObj::~ViewContactOfSdrEdgeObj() 44 { 45 } 46 createViewIndependentPrimitive2DSequence() const47 drawinglayer::primitive2d::Primitive2DSequence ViewContactOfSdrEdgeObj::createViewIndependentPrimitive2DSequence() const 48 { 49 const basegfx::B2DPolygon& rEdgeTrack = GetEdgeObj().getEdgeTrack(); 50 51 // what to do when no EdgeTrack is provided (HitTest and selectability) ? 52 OSL_ENSURE(0 != rEdgeTrack.count(), "Connectors with no geometry are not allowed (!)"); 53 54 // ckeck attributes 55 const SfxItemSet& rItemSet = GetEdgeObj().GetMergedItemSet(); 56 const drawinglayer::attribute::SdrLineShadowTextAttribute aAttribute( 57 drawinglayer::primitive2d::createNewSdrLineShadowTextAttribute( 58 rItemSet, 59 GetEdgeObj().getText(0))); 60 61 // create primitive. Always create primitives to allow the decomposition of 62 // SdrConnectorPrimitive2D to create needed invisible elements for HitTest 63 // and/or BoundRect 64 const drawinglayer::primitive2d::Primitive2DReference xReference( 65 new drawinglayer::primitive2d::SdrConnectorPrimitive2D( 66 aAttribute, 67 rEdgeTrack)); 68 69 return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); 70 } 71 } // end of namespace contact 72 } // end of namespace sdr 73 74 ////////////////////////////////////////////////////////////////////////////// 75 // eof 76