1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 29*cdf0e10cSrcweir #include "precompiled_sd.hxx" 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir #include "fuconrec.hxx" 32*cdf0e10cSrcweir #include <svx/svdpagv.hxx> 33*cdf0e10cSrcweir 34*cdf0e10cSrcweir 35*cdf0e10cSrcweir #include <svx/svxids.hrc> 36*cdf0e10cSrcweir #include <svx/dialogs.hrc> 37*cdf0e10cSrcweir #include <svx/dialmgr.hxx> 38*cdf0e10cSrcweir 39*cdf0e10cSrcweir #include "app.hrc" 40*cdf0e10cSrcweir #include <svl/aeitem.hxx> 41*cdf0e10cSrcweir #include <svx/xlnstwit.hxx> 42*cdf0e10cSrcweir #include <svx/xlnedwit.hxx> 43*cdf0e10cSrcweir #include <svx/xlnedit.hxx> 44*cdf0e10cSrcweir #include <svx/xlnstit.hxx> 45*cdf0e10cSrcweir #include <svx/xlnwtit.hxx> 46*cdf0e10cSrcweir #include <sfx2/viewfrm.hxx> 47*cdf0e10cSrcweir #include <svx/sdtmfitm.hxx> 48*cdf0e10cSrcweir #include <svx/sxekitm.hxx> 49*cdf0e10cSrcweir #include <svx/sderitm.hxx> 50*cdf0e10cSrcweir #include <sfx2/dispatch.hxx> 51*cdf0e10cSrcweir #include <svx/svdopath.hxx> 52*cdf0e10cSrcweir #include <svx/svdocirc.hxx> 53*cdf0e10cSrcweir #include <svl/intitem.hxx> 54*cdf0e10cSrcweir #include <sfx2/request.hxx> 55*cdf0e10cSrcweir #include <editeng/adjitem.hxx> 56*cdf0e10cSrcweir #include <svx/xtable.hxx> 57*cdf0e10cSrcweir 58*cdf0e10cSrcweir // #88751# 59*cdf0e10cSrcweir #include <svx/svdocapt.hxx> 60*cdf0e10cSrcweir 61*cdf0e10cSrcweir // #97016# 62*cdf0e10cSrcweir #include <svx/svdomeas.hxx> 63*cdf0e10cSrcweir #include "ViewShell.hxx" 64*cdf0e10cSrcweir #include "ViewShellBase.hxx" 65*cdf0e10cSrcweir #include "ToolBarManager.hxx" 66*cdf0e10cSrcweir // #109583# 67*cdf0e10cSrcweir #include <editeng/writingmodeitem.hxx> 68*cdf0e10cSrcweir #include <basegfx/polygon/b2dpolygontools.hxx> 69*cdf0e10cSrcweir #include <basegfx/polygon/b2dpolygon.hxx> 70*cdf0e10cSrcweir 71*cdf0e10cSrcweir #include "sdresid.hxx" 72*cdf0e10cSrcweir #include "View.hxx" 73*cdf0e10cSrcweir #include "sdpage.hxx" 74*cdf0e10cSrcweir #include "Window.hxx" 75*cdf0e10cSrcweir #include "stlpool.hxx" 76*cdf0e10cSrcweir #include "drawdoc.hxx" 77*cdf0e10cSrcweir #include "res_bmp.hrc" 78*cdf0e10cSrcweir #include "glob.hrc" 79*cdf0e10cSrcweir 80*cdf0e10cSrcweir namespace sd { 81*cdf0e10cSrcweir 82*cdf0e10cSrcweir TYPEINIT1( FuConstructRectangle, FuConstruct ); 83*cdf0e10cSrcweir 84*cdf0e10cSrcweir /************************************************************************* 85*cdf0e10cSrcweir |* 86*cdf0e10cSrcweir |* Konstruktor 87*cdf0e10cSrcweir |* 88*cdf0e10cSrcweir \************************************************************************/ 89*cdf0e10cSrcweir 90*cdf0e10cSrcweir FuConstructRectangle::FuConstructRectangle ( 91*cdf0e10cSrcweir ViewShell* pViewSh, 92*cdf0e10cSrcweir ::sd::Window* pWin, 93*cdf0e10cSrcweir ::sd::View* pView, 94*cdf0e10cSrcweir SdDrawDocument* pDoc, 95*cdf0e10cSrcweir SfxRequest& rReq) 96*cdf0e10cSrcweir : FuConstruct(pViewSh, pWin, pView, pDoc, rReq) 97*cdf0e10cSrcweir { 98*cdf0e10cSrcweir } 99*cdf0e10cSrcweir 100*cdf0e10cSrcweir FunctionReference FuConstructRectangle::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq, bool bPermanent ) 101*cdf0e10cSrcweir { 102*cdf0e10cSrcweir FuConstructRectangle* pFunc; 103*cdf0e10cSrcweir FunctionReference xFunc( pFunc = new FuConstructRectangle( pViewSh, pWin, pView, pDoc, rReq ) ); 104*cdf0e10cSrcweir xFunc->DoExecute(rReq); 105*cdf0e10cSrcweir pFunc->SetPermanent(bPermanent); 106*cdf0e10cSrcweir return xFunc; 107*cdf0e10cSrcweir } 108*cdf0e10cSrcweir 109*cdf0e10cSrcweir void FuConstructRectangle::DoExecute( SfxRequest& rReq ) 110*cdf0e10cSrcweir { 111*cdf0e10cSrcweir FuConstruct::DoExecute( rReq ); 112*cdf0e10cSrcweir 113*cdf0e10cSrcweir mpViewShell->GetViewShellBase().GetToolBarManager()->SetToolBar( 114*cdf0e10cSrcweir ToolBarManager::TBG_FUNCTION, 115*cdf0e10cSrcweir ToolBarManager::msDrawingObjectToolBar); 116*cdf0e10cSrcweir 117*cdf0e10cSrcweir const SfxItemSet *pArgs = rReq.GetArgs (); 118*cdf0e10cSrcweir 119*cdf0e10cSrcweir if (pArgs) 120*cdf0e10cSrcweir { 121*cdf0e10cSrcweir switch (nSlotId) 122*cdf0e10cSrcweir { 123*cdf0e10cSrcweir case SID_DRAW_ELLIPSE : 124*cdf0e10cSrcweir { 125*cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pCenterX, SfxUInt32Item, ID_VAL_CENTER_X, sal_False); 126*cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pCenterY, SfxUInt32Item, ID_VAL_CENTER_Y, sal_False); 127*cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pAxisX, SfxUInt32Item, ID_VAL_AXIS_X, sal_False); 128*cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pAxisY, SfxUInt32Item, ID_VAL_AXIS_Y, sal_False); 129*cdf0e10cSrcweir 130*cdf0e10cSrcweir Rectangle aNewRectangle (pCenterX->GetValue () - pAxisX->GetValue () / 2, 131*cdf0e10cSrcweir pCenterY->GetValue () - pAxisY->GetValue () / 2, 132*cdf0e10cSrcweir pCenterX->GetValue () + pAxisX->GetValue () / 2, 133*cdf0e10cSrcweir pCenterY->GetValue () + pAxisY->GetValue () / 2); 134*cdf0e10cSrcweir SdrCircObj *pNewCircle = new SdrCircObj (OBJ_CIRC, aNewRectangle); 135*cdf0e10cSrcweir SdrPageView *pPV = mpView->GetSdrPageView(); 136*cdf0e10cSrcweir 137*cdf0e10cSrcweir mpView->InsertObjectAtView(pNewCircle, *pPV, SDRINSERT_SETDEFLAYER | SDRINSERT_SETDEFATTR); 138*cdf0e10cSrcweir } 139*cdf0e10cSrcweir break; 140*cdf0e10cSrcweir 141*cdf0e10cSrcweir case SID_DRAW_RECT : 142*cdf0e10cSrcweir { 143*cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pMouseStartX, SfxUInt32Item, ID_VAL_MOUSESTART_X, sal_False); 144*cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pMouseStartY, SfxUInt32Item, ID_VAL_MOUSESTART_Y, sal_False); 145*cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pMouseEndX, SfxUInt32Item, ID_VAL_MOUSEEND_X, sal_False); 146*cdf0e10cSrcweir SFX_REQUEST_ARG (rReq, pMouseEndY, SfxUInt32Item, ID_VAL_MOUSEEND_Y, sal_False); 147*cdf0e10cSrcweir 148*cdf0e10cSrcweir Rectangle aNewRectangle (pMouseStartX->GetValue (), 149*cdf0e10cSrcweir pMouseStartY->GetValue (), 150*cdf0e10cSrcweir pMouseEndX->GetValue (), 151*cdf0e10cSrcweir pMouseEndY->GetValue ()); 152*cdf0e10cSrcweir SdrRectObj *pNewRect = new SdrRectObj (aNewRectangle); 153*cdf0e10cSrcweir SdrPageView *pPV = mpView->GetSdrPageView(); 154*cdf0e10cSrcweir 155*cdf0e10cSrcweir mpView->InsertObjectAtView(pNewRect, *pPV, SDRINSERT_SETDEFLAYER | SDRINSERT_SETDEFATTR); 156*cdf0e10cSrcweir } 157*cdf0e10cSrcweir break; 158*cdf0e10cSrcweir } 159*cdf0e10cSrcweir } 160*cdf0e10cSrcweir 161*cdf0e10cSrcweir if (nSlotId == SID_TOOL_CONNECTOR || 162*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_ARROW_START || 163*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_ARROW_END || 164*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_ARROWS || 165*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_CIRCLE_START || 166*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_CIRCLE_END || 167*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_CIRCLES || 168*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINE || 169*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINE_ARROW_START || 170*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINE_ARROW_END || 171*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINE_ARROWS || 172*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINE_CIRCLE_START || 173*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINE_CIRCLE_END || 174*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINE_CIRCLES || 175*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_CURVE || 176*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_CURVE_ARROW_START || 177*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_CURVE_ARROW_END || 178*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_CURVE_ARROWS || 179*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_CURVE_CIRCLE_START || 180*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_CURVE_CIRCLE_END || 181*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_CURVE_CIRCLES || 182*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINES || 183*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINES_ARROW_START || 184*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINES_ARROW_END || 185*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINES_ARROWS || 186*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINES_CIRCLE_START || 187*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINES_CIRCLE_END || 188*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINES_CIRCLES || 189*cdf0e10cSrcweir nSlotId == SID_LINE_ARROW_START || 190*cdf0e10cSrcweir nSlotId == SID_LINE_ARROW_END || 191*cdf0e10cSrcweir nSlotId == SID_LINE_ARROWS || 192*cdf0e10cSrcweir nSlotId == SID_LINE_ARROW_CIRCLE || 193*cdf0e10cSrcweir nSlotId == SID_LINE_CIRCLE_ARROW || 194*cdf0e10cSrcweir nSlotId == SID_LINE_ARROW_SQUARE || 195*cdf0e10cSrcweir nSlotId == SID_LINE_SQUARE_ARROW ) 196*cdf0e10cSrcweir { 197*cdf0e10cSrcweir mpView->UnmarkAll(); 198*cdf0e10cSrcweir } 199*cdf0e10cSrcweir } 200*cdf0e10cSrcweir 201*cdf0e10cSrcweir /************************************************************************* 202*cdf0e10cSrcweir |* 203*cdf0e10cSrcweir |* MouseButtonDown-event 204*cdf0e10cSrcweir |* 205*cdf0e10cSrcweir \************************************************************************/ 206*cdf0e10cSrcweir 207*cdf0e10cSrcweir sal_Bool FuConstructRectangle::MouseButtonDown(const MouseEvent& rMEvt) 208*cdf0e10cSrcweir { 209*cdf0e10cSrcweir sal_Bool bReturn = FuConstruct::MouseButtonDown(rMEvt); 210*cdf0e10cSrcweir 211*cdf0e10cSrcweir if ( rMEvt.IsLeft() && !mpView->IsAction() ) 212*cdf0e10cSrcweir { 213*cdf0e10cSrcweir Point aPnt( mpWindow->PixelToLogic( rMEvt.GetPosPixel() ) ); 214*cdf0e10cSrcweir 215*cdf0e10cSrcweir mpWindow->CaptureMouse(); 216*cdf0e10cSrcweir sal_uInt16 nDrgLog = sal_uInt16 ( mpWindow->PixelToLogic(Size(DRGPIX,0)).Width() ); 217*cdf0e10cSrcweir 218*cdf0e10cSrcweir if (mpView->GetCurrentObjIdentifier() == OBJ_CAPTION) 219*cdf0e10cSrcweir { 220*cdf0e10cSrcweir Size aCaptionSize(846, 846); // (4x2)cm 221*cdf0e10cSrcweir bReturn = mpView->BegCreateCaptionObj(aPnt, aCaptionSize, 222*cdf0e10cSrcweir (OutputDevice*) NULL, nDrgLog); 223*cdf0e10cSrcweir } 224*cdf0e10cSrcweir else 225*cdf0e10cSrcweir { 226*cdf0e10cSrcweir mpView->BegCreateObj(aPnt, (OutputDevice*) NULL, nDrgLog); 227*cdf0e10cSrcweir } 228*cdf0e10cSrcweir 229*cdf0e10cSrcweir SdrObject* pObj = mpView->GetCreateObj(); 230*cdf0e10cSrcweir 231*cdf0e10cSrcweir if (pObj) 232*cdf0e10cSrcweir { 233*cdf0e10cSrcweir SfxItemSet aAttr(mpDoc->GetPool()); 234*cdf0e10cSrcweir SetStyleSheet(aAttr, pObj); 235*cdf0e10cSrcweir SetAttributes(aAttr, pObj); 236*cdf0e10cSrcweir SetLineEnds(aAttr, pObj); 237*cdf0e10cSrcweir pObj->SetMergedItemSet(aAttr); 238*cdf0e10cSrcweir 239*cdf0e10cSrcweir if( nSlotId == SID_DRAW_CAPTION_VERTICAL ) 240*cdf0e10cSrcweir ( (SdrTextObj*) pObj)->SetVerticalWriting( sal_True ); 241*cdf0e10cSrcweir } 242*cdf0e10cSrcweir } 243*cdf0e10cSrcweir return bReturn; 244*cdf0e10cSrcweir } 245*cdf0e10cSrcweir 246*cdf0e10cSrcweir /************************************************************************* 247*cdf0e10cSrcweir |* 248*cdf0e10cSrcweir |* MouseMove-event 249*cdf0e10cSrcweir |* 250*cdf0e10cSrcweir \************************************************************************/ 251*cdf0e10cSrcweir 252*cdf0e10cSrcweir sal_Bool FuConstructRectangle::MouseMove(const MouseEvent& rMEvt) 253*cdf0e10cSrcweir { 254*cdf0e10cSrcweir return FuConstruct::MouseMove(rMEvt); 255*cdf0e10cSrcweir } 256*cdf0e10cSrcweir 257*cdf0e10cSrcweir /************************************************************************* 258*cdf0e10cSrcweir |* 259*cdf0e10cSrcweir |* MouseButtonUp-event 260*cdf0e10cSrcweir |* 261*cdf0e10cSrcweir \************************************************************************/ 262*cdf0e10cSrcweir 263*cdf0e10cSrcweir sal_Bool FuConstructRectangle::MouseButtonUp(const MouseEvent& rMEvt) 264*cdf0e10cSrcweir { 265*cdf0e10cSrcweir sal_Bool bReturn(sal_False); 266*cdf0e10cSrcweir 267*cdf0e10cSrcweir if(mpView->IsCreateObj() && rMEvt.IsLeft()) 268*cdf0e10cSrcweir { 269*cdf0e10cSrcweir SdrObject* pObj = mpView->GetCreateObj(); 270*cdf0e10cSrcweir 271*cdf0e10cSrcweir if(pObj && mpView->EndCreateObj(SDRCREATE_FORCEEND)) 272*cdf0e10cSrcweir { 273*cdf0e10cSrcweir if(SID_DRAW_MEASURELINE == nSlotId) 274*cdf0e10cSrcweir { 275*cdf0e10cSrcweir SdrLayerAdmin& rAdmin = mpDoc->GetLayerAdmin(); 276*cdf0e10cSrcweir String aStr(SdResId(STR_LAYER_MEASURELINES)); 277*cdf0e10cSrcweir pObj->SetLayer(rAdmin.GetLayerID(aStr, sal_False)); 278*cdf0e10cSrcweir } 279*cdf0e10cSrcweir 280*cdf0e10cSrcweir // #88751# init text position when vertica caption object is created 281*cdf0e10cSrcweir if(pObj->ISA(SdrCaptionObj) && SID_DRAW_CAPTION_VERTICAL == nSlotId) 282*cdf0e10cSrcweir { 283*cdf0e10cSrcweir // draw text object, needs to be initialized when vertical text is used 284*cdf0e10cSrcweir SfxItemSet aSet(pObj->GetMergedItemSet()); 285*cdf0e10cSrcweir 286*cdf0e10cSrcweir aSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_CENTER)); 287*cdf0e10cSrcweir aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT)); 288*cdf0e10cSrcweir 289*cdf0e10cSrcweir // #109583# 290*cdf0e10cSrcweir // Correct the value of SDRATTR_TEXTDIRECTION to avoid SetItemSet 291*cdf0e10cSrcweir // calling SetVerticalWriting() again since this item may not yet 292*cdf0e10cSrcweir // be set at the object and thus may differ from verical state of 293*cdf0e10cSrcweir // the object. 294*cdf0e10cSrcweir aSet.Put(SvxWritingModeItem(com::sun::star::text::WritingMode_TB_RL, SDRATTR_TEXTDIRECTION)); 295*cdf0e10cSrcweir pObj->SetMergedItemSet(aSet); 296*cdf0e10cSrcweir } 297*cdf0e10cSrcweir 298*cdf0e10cSrcweir bReturn = sal_True; 299*cdf0e10cSrcweir } 300*cdf0e10cSrcweir } 301*cdf0e10cSrcweir 302*cdf0e10cSrcweir bReturn = FuConstruct::MouseButtonUp (rMEvt) || bReturn; 303*cdf0e10cSrcweir 304*cdf0e10cSrcweir if (!bPermanent) 305*cdf0e10cSrcweir mpViewShell->GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON); 306*cdf0e10cSrcweir 307*cdf0e10cSrcweir return bReturn; 308*cdf0e10cSrcweir } 309*cdf0e10cSrcweir 310*cdf0e10cSrcweir /************************************************************************* 311*cdf0e10cSrcweir |* 312*cdf0e10cSrcweir |* Tastaturereignisse bearbeiten 313*cdf0e10cSrcweir |* 314*cdf0e10cSrcweir |* Wird ein KeyEvent bearbeitet, so ist der Return-Wert sal_True, andernfalls 315*cdf0e10cSrcweir |* sal_False. 316*cdf0e10cSrcweir |* 317*cdf0e10cSrcweir \************************************************************************/ 318*cdf0e10cSrcweir 319*cdf0e10cSrcweir sal_Bool FuConstructRectangle::KeyInput(const KeyEvent& rKEvt) 320*cdf0e10cSrcweir { 321*cdf0e10cSrcweir sal_Bool bReturn = FuConstruct::KeyInput(rKEvt); 322*cdf0e10cSrcweir return(bReturn); 323*cdf0e10cSrcweir } 324*cdf0e10cSrcweir 325*cdf0e10cSrcweir /************************************************************************* 326*cdf0e10cSrcweir |* 327*cdf0e10cSrcweir |* Function aktivieren 328*cdf0e10cSrcweir |* 329*cdf0e10cSrcweir \************************************************************************/ 330*cdf0e10cSrcweir 331*cdf0e10cSrcweir void FuConstructRectangle::Activate() 332*cdf0e10cSrcweir { 333*cdf0e10cSrcweir SdrObjKind aObjKind; 334*cdf0e10cSrcweir 335*cdf0e10cSrcweir switch (nSlotId) 336*cdf0e10cSrcweir { 337*cdf0e10cSrcweir case SID_LINE_ARROW_START: 338*cdf0e10cSrcweir case SID_LINE_ARROW_END: 339*cdf0e10cSrcweir case SID_LINE_ARROWS: 340*cdf0e10cSrcweir case SID_LINE_ARROW_CIRCLE: 341*cdf0e10cSrcweir case SID_LINE_CIRCLE_ARROW: 342*cdf0e10cSrcweir case SID_LINE_ARROW_SQUARE: 343*cdf0e10cSrcweir case SID_LINE_SQUARE_ARROW: 344*cdf0e10cSrcweir mpView->SetGlueVisible(); 345*cdf0e10cSrcweir // keine break ! 346*cdf0e10cSrcweir case SID_DRAW_LINE : 347*cdf0e10cSrcweir case SID_DRAW_XLINE: 348*cdf0e10cSrcweir aObjKind = OBJ_LINE; 349*cdf0e10cSrcweir break; 350*cdf0e10cSrcweir 351*cdf0e10cSrcweir case SID_DRAW_MEASURELINE: 352*cdf0e10cSrcweir { 353*cdf0e10cSrcweir aObjKind = OBJ_MEASURE; 354*cdf0e10cSrcweir } 355*cdf0e10cSrcweir break; 356*cdf0e10cSrcweir 357*cdf0e10cSrcweir case SID_DRAW_RECT : 358*cdf0e10cSrcweir case SID_DRAW_RECT_NOFILL : 359*cdf0e10cSrcweir case SID_DRAW_RECT_ROUND : 360*cdf0e10cSrcweir case SID_DRAW_RECT_ROUND_NOFILL: 361*cdf0e10cSrcweir case SID_DRAW_SQUARE : 362*cdf0e10cSrcweir case SID_DRAW_SQUARE_NOFILL : 363*cdf0e10cSrcweir case SID_DRAW_SQUARE_ROUND : 364*cdf0e10cSrcweir case SID_DRAW_SQUARE_ROUND_NOFILL: 365*cdf0e10cSrcweir { 366*cdf0e10cSrcweir aObjKind = OBJ_RECT; 367*cdf0e10cSrcweir } 368*cdf0e10cSrcweir break; 369*cdf0e10cSrcweir 370*cdf0e10cSrcweir case SID_DRAW_ELLIPSE : 371*cdf0e10cSrcweir case SID_DRAW_ELLIPSE_NOFILL: 372*cdf0e10cSrcweir case SID_DRAW_CIRCLE : 373*cdf0e10cSrcweir case SID_DRAW_CIRCLE_NOFILL : 374*cdf0e10cSrcweir { 375*cdf0e10cSrcweir aObjKind = OBJ_CIRC; 376*cdf0e10cSrcweir } 377*cdf0e10cSrcweir break; 378*cdf0e10cSrcweir 379*cdf0e10cSrcweir case SID_DRAW_CAPTION: 380*cdf0e10cSrcweir case SID_DRAW_CAPTION_VERTICAL: 381*cdf0e10cSrcweir { 382*cdf0e10cSrcweir aObjKind = OBJ_CAPTION; 383*cdf0e10cSrcweir } 384*cdf0e10cSrcweir break; 385*cdf0e10cSrcweir 386*cdf0e10cSrcweir case SID_TOOL_CONNECTOR: 387*cdf0e10cSrcweir case SID_CONNECTOR_ARROW_START: 388*cdf0e10cSrcweir case SID_CONNECTOR_ARROW_END: 389*cdf0e10cSrcweir case SID_CONNECTOR_ARROWS: 390*cdf0e10cSrcweir case SID_CONNECTOR_CIRCLE_START: 391*cdf0e10cSrcweir case SID_CONNECTOR_CIRCLE_END: 392*cdf0e10cSrcweir case SID_CONNECTOR_CIRCLES: 393*cdf0e10cSrcweir case SID_CONNECTOR_LINE: 394*cdf0e10cSrcweir case SID_CONNECTOR_LINE_ARROW_START: 395*cdf0e10cSrcweir case SID_CONNECTOR_LINE_ARROW_END: 396*cdf0e10cSrcweir case SID_CONNECTOR_LINE_ARROWS: 397*cdf0e10cSrcweir case SID_CONNECTOR_LINE_CIRCLE_START: 398*cdf0e10cSrcweir case SID_CONNECTOR_LINE_CIRCLE_END: 399*cdf0e10cSrcweir case SID_CONNECTOR_LINE_CIRCLES: 400*cdf0e10cSrcweir case SID_CONNECTOR_CURVE: 401*cdf0e10cSrcweir case SID_CONNECTOR_CURVE_ARROW_START: 402*cdf0e10cSrcweir case SID_CONNECTOR_CURVE_ARROW_END: 403*cdf0e10cSrcweir case SID_CONNECTOR_CURVE_ARROWS: 404*cdf0e10cSrcweir case SID_CONNECTOR_CURVE_CIRCLE_START: 405*cdf0e10cSrcweir case SID_CONNECTOR_CURVE_CIRCLE_END: 406*cdf0e10cSrcweir case SID_CONNECTOR_CURVE_CIRCLES: 407*cdf0e10cSrcweir case SID_CONNECTOR_LINES: 408*cdf0e10cSrcweir case SID_CONNECTOR_LINES_ARROW_START: 409*cdf0e10cSrcweir case SID_CONNECTOR_LINES_ARROW_END: 410*cdf0e10cSrcweir case SID_CONNECTOR_LINES_ARROWS: 411*cdf0e10cSrcweir case SID_CONNECTOR_LINES_CIRCLE_START: 412*cdf0e10cSrcweir case SID_CONNECTOR_LINES_CIRCLE_END: 413*cdf0e10cSrcweir case SID_CONNECTOR_LINES_CIRCLES: 414*cdf0e10cSrcweir { 415*cdf0e10cSrcweir aObjKind = OBJ_EDGE; 416*cdf0e10cSrcweir mpView->SetGlueVisible(); 417*cdf0e10cSrcweir } 418*cdf0e10cSrcweir break; 419*cdf0e10cSrcweir 420*cdf0e10cSrcweir default: 421*cdf0e10cSrcweir { 422*cdf0e10cSrcweir aObjKind = OBJ_RECT; 423*cdf0e10cSrcweir } 424*cdf0e10cSrcweir break; 425*cdf0e10cSrcweir } 426*cdf0e10cSrcweir 427*cdf0e10cSrcweir mpView->SetCurrentObj((sal_uInt16)aObjKind); 428*cdf0e10cSrcweir 429*cdf0e10cSrcweir FuConstruct::Activate(); 430*cdf0e10cSrcweir } 431*cdf0e10cSrcweir 432*cdf0e10cSrcweir /************************************************************************* 433*cdf0e10cSrcweir |* 434*cdf0e10cSrcweir |* Function deaktivieren 435*cdf0e10cSrcweir |* 436*cdf0e10cSrcweir \************************************************************************/ 437*cdf0e10cSrcweir 438*cdf0e10cSrcweir void FuConstructRectangle::Deactivate() 439*cdf0e10cSrcweir { 440*cdf0e10cSrcweir if( nSlotId == SID_TOOL_CONNECTOR || 441*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_ARROW_START || 442*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_ARROW_END || 443*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_ARROWS || 444*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_CIRCLE_START || 445*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_CIRCLE_END || 446*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_CIRCLES || 447*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINE || 448*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINE_ARROW_START || 449*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINE_ARROW_END || 450*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINE_ARROWS || 451*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINE_CIRCLE_START || 452*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINE_CIRCLE_END || 453*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINE_CIRCLES || 454*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_CURVE || 455*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_CURVE_ARROW_START || 456*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_CURVE_ARROW_END || 457*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_CURVE_ARROWS || 458*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_CURVE_CIRCLE_START || 459*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_CURVE_CIRCLE_END || 460*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_CURVE_CIRCLES || 461*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINES || 462*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINES_ARROW_START || 463*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINES_ARROW_END || 464*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINES_ARROWS || 465*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINES_CIRCLE_START || 466*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINES_CIRCLE_END || 467*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINES_CIRCLES || 468*cdf0e10cSrcweir nSlotId == SID_LINE_ARROW_START || 469*cdf0e10cSrcweir nSlotId == SID_LINE_ARROW_END || 470*cdf0e10cSrcweir nSlotId == SID_LINE_ARROWS || 471*cdf0e10cSrcweir nSlotId == SID_LINE_ARROW_CIRCLE || 472*cdf0e10cSrcweir nSlotId == SID_LINE_CIRCLE_ARROW || 473*cdf0e10cSrcweir nSlotId == SID_LINE_ARROW_SQUARE || 474*cdf0e10cSrcweir nSlotId == SID_LINE_SQUARE_ARROW ) 475*cdf0e10cSrcweir { 476*cdf0e10cSrcweir mpView->SetGlueVisible( sal_False ); 477*cdf0e10cSrcweir } 478*cdf0e10cSrcweir FuConstruct::Deactivate(); 479*cdf0e10cSrcweir } 480*cdf0e10cSrcweir 481*cdf0e10cSrcweir 482*cdf0e10cSrcweir /************************************************************************* 483*cdf0e10cSrcweir |* 484*cdf0e10cSrcweir |* Attribute fuer das zu erzeugende Objekt setzen 485*cdf0e10cSrcweir |* 486*cdf0e10cSrcweir \************************************************************************/ 487*cdf0e10cSrcweir 488*cdf0e10cSrcweir void FuConstructRectangle::SetAttributes(SfxItemSet& rAttr, SdrObject* pObj) 489*cdf0e10cSrcweir { 490*cdf0e10cSrcweir if (nSlotId == SID_DRAW_RECT_ROUND || 491*cdf0e10cSrcweir nSlotId == SID_DRAW_RECT_ROUND_NOFILL || 492*cdf0e10cSrcweir nSlotId == SID_DRAW_SQUARE_ROUND || 493*cdf0e10cSrcweir nSlotId == SID_DRAW_SQUARE_ROUND_NOFILL) 494*cdf0e10cSrcweir { 495*cdf0e10cSrcweir /********************************************************************** 496*cdf0e10cSrcweir * Abgerundete Ecken 497*cdf0e10cSrcweir **********************************************************************/ 498*cdf0e10cSrcweir rAttr.Put(SdrEckenradiusItem(500)); 499*cdf0e10cSrcweir } 500*cdf0e10cSrcweir else if (nSlotId == SID_CONNECTOR_LINE || 501*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINE_ARROW_START || 502*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINE_ARROW_END || 503*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINE_ARROWS || 504*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINE_CIRCLE_START || 505*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINE_CIRCLE_END || 506*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINE_CIRCLES) 507*cdf0e10cSrcweir { 508*cdf0e10cSrcweir /********************************************************************** 509*cdf0e10cSrcweir * Direkt-Verbinder 510*cdf0e10cSrcweir **********************************************************************/ 511*cdf0e10cSrcweir rAttr.Put(SdrEdgeKindItem(SDREDGE_ONELINE)); 512*cdf0e10cSrcweir } 513*cdf0e10cSrcweir else if (nSlotId == SID_CONNECTOR_LINES || 514*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINES_ARROW_START || 515*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINES_ARROW_END || 516*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINES_ARROWS || 517*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINES_CIRCLE_START || 518*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINES_CIRCLE_END || 519*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_LINES_CIRCLES) 520*cdf0e10cSrcweir { 521*cdf0e10cSrcweir /********************************************************************** 522*cdf0e10cSrcweir * Linien-Verbinder 523*cdf0e10cSrcweir **********************************************************************/ 524*cdf0e10cSrcweir rAttr.Put(SdrEdgeKindItem(SDREDGE_THREELINES)); 525*cdf0e10cSrcweir } 526*cdf0e10cSrcweir else if (nSlotId == SID_CONNECTOR_CURVE || 527*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_CURVE_ARROW_START || 528*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_CURVE_ARROW_END || 529*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_CURVE_ARROWS || 530*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_CURVE_CIRCLE_START || 531*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_CURVE_CIRCLE_END || 532*cdf0e10cSrcweir nSlotId == SID_CONNECTOR_CURVE_CIRCLES) 533*cdf0e10cSrcweir { 534*cdf0e10cSrcweir /********************************************************************** 535*cdf0e10cSrcweir * Kurven-Verbinder 536*cdf0e10cSrcweir **********************************************************************/ 537*cdf0e10cSrcweir rAttr.Put(SdrEdgeKindItem(SDREDGE_BEZIER)); 538*cdf0e10cSrcweir } 539*cdf0e10cSrcweir else if ( nSlotId == SID_DRAW_CAPTION || nSlotId == SID_DRAW_CAPTION_VERTICAL ) 540*cdf0e10cSrcweir { 541*cdf0e10cSrcweir /********************************************************************** 542*cdf0e10cSrcweir * Legendenobjekt 543*cdf0e10cSrcweir **********************************************************************/ 544*cdf0e10cSrcweir Size aSize(pObj->GetLogicRect().GetSize()); 545*cdf0e10cSrcweir rAttr.Put( SdrTextMinFrameHeightItem( aSize.Height() ) ); 546*cdf0e10cSrcweir rAttr.Put( SdrTextMinFrameWidthItem( aSize.Width() ) ); 547*cdf0e10cSrcweir rAttr.Put( SdrTextAutoGrowHeightItem( sal_True ) ); 548*cdf0e10cSrcweir rAttr.Put( SdrTextAutoGrowWidthItem( sal_True ) ); 549*cdf0e10cSrcweir 550*cdf0e10cSrcweir // #103516# Support full with for vertical caption objects, too 551*cdf0e10cSrcweir if(SID_DRAW_CAPTION == nSlotId) 552*cdf0e10cSrcweir rAttr.Put( SdrTextHorzAdjustItem( SDRTEXTHORZADJUST_BLOCK ) ); 553*cdf0e10cSrcweir else 554*cdf0e10cSrcweir rAttr.Put( SdrTextVertAdjustItem( SDRTEXTVERTADJUST_BLOCK ) ); 555*cdf0e10cSrcweir 556*cdf0e10cSrcweir rAttr.Put( SvxAdjustItem( SVX_ADJUST_CENTER, EE_PARA_JUST ) ); 557*cdf0e10cSrcweir rAttr.Put( SdrTextLeftDistItem( 100 ) ); 558*cdf0e10cSrcweir rAttr.Put( SdrTextRightDistItem( 100 ) ); 559*cdf0e10cSrcweir rAttr.Put( SdrTextUpperDistItem( 100 ) ); 560*cdf0e10cSrcweir rAttr.Put( SdrTextLowerDistItem( 100 ) ); 561*cdf0e10cSrcweir } 562*cdf0e10cSrcweir else if (nSlotId == SID_DRAW_MEASURELINE) 563*cdf0e10cSrcweir { 564*cdf0e10cSrcweir /********************************************************************** 565*cdf0e10cSrcweir * Masslinie 566*cdf0e10cSrcweir **********************************************************************/ 567*cdf0e10cSrcweir SdPage* pPage = (SdPage*) mpView->GetSdrPageView()->GetPage(); 568*cdf0e10cSrcweir String aName(SdResId(STR_POOLSHEET_MEASURE)); 569*cdf0e10cSrcweir SfxStyleSheet* pSheet = (SfxStyleSheet*) pPage->GetModel()-> 570*cdf0e10cSrcweir GetStyleSheetPool()-> 571*cdf0e10cSrcweir Find(aName, SD_STYLE_FAMILY_GRAPHICS); 572*cdf0e10cSrcweir DBG_ASSERT(pSheet, "Objektvorlage nicht gefunden"); 573*cdf0e10cSrcweir 574*cdf0e10cSrcweir if (pSheet) 575*cdf0e10cSrcweir { 576*cdf0e10cSrcweir pObj->SetStyleSheet(pSheet, sal_False); 577*cdf0e10cSrcweir } 578*cdf0e10cSrcweir 579*cdf0e10cSrcweir SdrLayerAdmin& rAdmin = mpDoc->GetLayerAdmin(); 580*cdf0e10cSrcweir String aStr(SdResId(STR_LAYER_MEASURELINES)); 581*cdf0e10cSrcweir pObj->SetLayer(rAdmin.GetLayerID(aStr, sal_False)); 582*cdf0e10cSrcweir } 583*cdf0e10cSrcweir else if (nSlotId == OBJ_CUSTOMSHAPE ) 584*cdf0e10cSrcweir { 585*cdf0e10cSrcweir } 586*cdf0e10cSrcweir } 587*cdf0e10cSrcweir 588*cdf0e10cSrcweir 589*cdf0e10cSrcweir /************************************************************************* 590*cdf0e10cSrcweir |* 591*cdf0e10cSrcweir |* Linienanfaenge und -enden fuer das zu erzeugende Objekt setzen 592*cdf0e10cSrcweir |* 593*cdf0e10cSrcweir \************************************************************************/ 594*cdf0e10cSrcweir 595*cdf0e10cSrcweir ::basegfx::B2DPolyPolygon getPolygon( sal_uInt16 nResId, SdrModel* pDoc ) 596*cdf0e10cSrcweir { 597*cdf0e10cSrcweir ::basegfx::B2DPolyPolygon aRetval; 598*cdf0e10cSrcweir XLineEndList* pLineEndList = pDoc->GetLineEndList(); 599*cdf0e10cSrcweir 600*cdf0e10cSrcweir if( pLineEndList ) 601*cdf0e10cSrcweir { 602*cdf0e10cSrcweir String aArrowName( SVX_RES(nResId) ); 603*cdf0e10cSrcweir long nCount = pLineEndList->Count(); 604*cdf0e10cSrcweir long nIndex; 605*cdf0e10cSrcweir for( nIndex = 0L; nIndex < nCount; nIndex++ ) 606*cdf0e10cSrcweir { 607*cdf0e10cSrcweir XLineEndEntry* pEntry = pLineEndList->GetLineEnd(nIndex); 608*cdf0e10cSrcweir if( pEntry->GetName() == aArrowName ) 609*cdf0e10cSrcweir { 610*cdf0e10cSrcweir aRetval = pEntry->GetLineEnd(); 611*cdf0e10cSrcweir break; 612*cdf0e10cSrcweir } 613*cdf0e10cSrcweir } 614*cdf0e10cSrcweir } 615*cdf0e10cSrcweir 616*cdf0e10cSrcweir return aRetval; 617*cdf0e10cSrcweir } 618*cdf0e10cSrcweir 619*cdf0e10cSrcweir void FuConstructRectangle::SetLineEnds(SfxItemSet& rAttr, SdrObject* pObj) 620*cdf0e10cSrcweir { 621*cdf0e10cSrcweir if ( (pObj->GetObjIdentifier() == OBJ_EDGE && 622*cdf0e10cSrcweir nSlotId != SID_TOOL_CONNECTOR && 623*cdf0e10cSrcweir nSlotId != SID_CONNECTOR_LINE && 624*cdf0e10cSrcweir nSlotId != SID_CONNECTOR_LINES && 625*cdf0e10cSrcweir nSlotId != SID_CONNECTOR_CURVE) || 626*cdf0e10cSrcweir nSlotId == SID_LINE_ARROW_START || 627*cdf0e10cSrcweir nSlotId == SID_LINE_ARROW_END || 628*cdf0e10cSrcweir nSlotId == SID_LINE_ARROWS || 629*cdf0e10cSrcweir nSlotId == SID_LINE_ARROW_CIRCLE || 630*cdf0e10cSrcweir nSlotId == SID_LINE_CIRCLE_ARROW || 631*cdf0e10cSrcweir nSlotId == SID_LINE_ARROW_SQUARE || 632*cdf0e10cSrcweir nSlotId == SID_LINE_SQUARE_ARROW ) 633*cdf0e10cSrcweir { 634*cdf0e10cSrcweir /************************************************************** 635*cdf0e10cSrcweir * Linienanfaenge und -enden attributieren 636*cdf0e10cSrcweir **************************************************************/ 637*cdf0e10cSrcweir 638*cdf0e10cSrcweir // Pfeilspitze 639*cdf0e10cSrcweir ::basegfx::B2DPolyPolygon aArrow( getPolygon( RID_SVXSTR_ARROW, mpDoc ) ); 640*cdf0e10cSrcweir if( !aArrow.count() ) 641*cdf0e10cSrcweir { 642*cdf0e10cSrcweir ::basegfx::B2DPolygon aNewArrow; 643*cdf0e10cSrcweir aNewArrow.append(::basegfx::B2DPoint(10.0, 0.0)); 644*cdf0e10cSrcweir aNewArrow.append(::basegfx::B2DPoint(0.0, 30.0)); 645*cdf0e10cSrcweir aNewArrow.append(::basegfx::B2DPoint(20.0, 30.0)); 646*cdf0e10cSrcweir aNewArrow.setClosed(true); 647*cdf0e10cSrcweir aArrow.append(aNewArrow); 648*cdf0e10cSrcweir } 649*cdf0e10cSrcweir 650*cdf0e10cSrcweir // Kreis 651*cdf0e10cSrcweir ::basegfx::B2DPolyPolygon aCircle( getPolygon( RID_SVXSTR_CIRCLE, mpDoc ) ); 652*cdf0e10cSrcweir if( !aCircle.count() ) 653*cdf0e10cSrcweir { 654*cdf0e10cSrcweir ::basegfx::B2DPolygon aNewCircle; 655*cdf0e10cSrcweir aNewCircle = ::basegfx::tools::createPolygonFromEllipse(::basegfx::B2DPoint(0.0, 0.0), 250.0, 250.0); 656*cdf0e10cSrcweir aNewCircle.setClosed(true); 657*cdf0e10cSrcweir aCircle.append(aNewCircle); 658*cdf0e10cSrcweir } 659*cdf0e10cSrcweir 660*cdf0e10cSrcweir // Quadrat 661*cdf0e10cSrcweir ::basegfx::B2DPolyPolygon aSquare( getPolygon( RID_SVXSTR_SQUARE, mpDoc ) ); 662*cdf0e10cSrcweir if( !aSquare.count() ) 663*cdf0e10cSrcweir { 664*cdf0e10cSrcweir ::basegfx::B2DPolygon aNewSquare; 665*cdf0e10cSrcweir aNewSquare.append(::basegfx::B2DPoint(0.0, 0.0)); 666*cdf0e10cSrcweir aNewSquare.append(::basegfx::B2DPoint(10.0, 0.0)); 667*cdf0e10cSrcweir aNewSquare.append(::basegfx::B2DPoint(10.0, 10.0)); 668*cdf0e10cSrcweir aNewSquare.append(::basegfx::B2DPoint(0.0, 10.0)); 669*cdf0e10cSrcweir aNewSquare.setClosed(true); 670*cdf0e10cSrcweir aSquare.append(aNewSquare); 671*cdf0e10cSrcweir } 672*cdf0e10cSrcweir 673*cdf0e10cSrcweir SfxItemSet aSet( mpDoc->GetPool() ); 674*cdf0e10cSrcweir mpView->GetAttributes( aSet ); 675*cdf0e10cSrcweir 676*cdf0e10cSrcweir // #i3908# Here, the default Line Start/End width for arrow construction is 677*cdf0e10cSrcweir // set. To have the same value in all situations (construction) in i3908 678*cdf0e10cSrcweir // it was decided to change the default to 0.03 cm for all situations. 679*cdf0e10cSrcweir long nWidth = 300; // (1/100th mm) 680*cdf0e10cSrcweir 681*cdf0e10cSrcweir // Linienstaerke ermitteln und daraus die Linienendenstaerke berechnen 682*cdf0e10cSrcweir if( aSet.GetItemState( XATTR_LINEWIDTH ) != SFX_ITEM_DONTCARE ) 683*cdf0e10cSrcweir { 684*cdf0e10cSrcweir long nValue = ( ( const XLineWidthItem& ) aSet.Get( XATTR_LINEWIDTH ) ).GetValue(); 685*cdf0e10cSrcweir if( nValue > 0 ) 686*cdf0e10cSrcweir nWidth = nValue * 3; 687*cdf0e10cSrcweir } 688*cdf0e10cSrcweir 689*cdf0e10cSrcweir switch (nSlotId) 690*cdf0e10cSrcweir { 691*cdf0e10cSrcweir case SID_CONNECTOR_ARROWS: 692*cdf0e10cSrcweir case SID_CONNECTOR_LINE_ARROWS: 693*cdf0e10cSrcweir case SID_CONNECTOR_LINES_ARROWS: 694*cdf0e10cSrcweir case SID_CONNECTOR_CURVE_ARROWS: 695*cdf0e10cSrcweir case SID_LINE_ARROWS: 696*cdf0e10cSrcweir { 697*cdf0e10cSrcweir // Verbinder mit Pfeil-Enden 698*cdf0e10cSrcweir rAttr.Put(XLineStartItem(SVX_RESSTR(RID_SVXSTR_ARROW), aArrow)); 699*cdf0e10cSrcweir rAttr.Put(XLineStartWidthItem(nWidth)); 700*cdf0e10cSrcweir rAttr.Put(XLineEndItem(SVX_RESSTR(RID_SVXSTR_ARROW), aArrow)); 701*cdf0e10cSrcweir rAttr.Put(XLineEndWidthItem(nWidth)); 702*cdf0e10cSrcweir } 703*cdf0e10cSrcweir break; 704*cdf0e10cSrcweir 705*cdf0e10cSrcweir case SID_CONNECTOR_ARROW_START: 706*cdf0e10cSrcweir case SID_CONNECTOR_LINE_ARROW_START: 707*cdf0e10cSrcweir case SID_CONNECTOR_LINES_ARROW_START: 708*cdf0e10cSrcweir case SID_CONNECTOR_CURVE_ARROW_START: 709*cdf0e10cSrcweir case SID_LINE_ARROW_START: 710*cdf0e10cSrcweir case SID_LINE_ARROW_CIRCLE: 711*cdf0e10cSrcweir case SID_LINE_ARROW_SQUARE: 712*cdf0e10cSrcweir { 713*cdf0e10cSrcweir // Verbinder mit Pfeil-Anfang 714*cdf0e10cSrcweir rAttr.Put(XLineStartItem(SVX_RESSTR(RID_SVXSTR_ARROW), aArrow)); 715*cdf0e10cSrcweir rAttr.Put(XLineStartWidthItem(nWidth)); 716*cdf0e10cSrcweir } 717*cdf0e10cSrcweir break; 718*cdf0e10cSrcweir 719*cdf0e10cSrcweir case SID_CONNECTOR_ARROW_END: 720*cdf0e10cSrcweir case SID_CONNECTOR_LINE_ARROW_END: 721*cdf0e10cSrcweir case SID_CONNECTOR_LINES_ARROW_END: 722*cdf0e10cSrcweir case SID_CONNECTOR_CURVE_ARROW_END: 723*cdf0e10cSrcweir case SID_LINE_ARROW_END: 724*cdf0e10cSrcweir case SID_LINE_CIRCLE_ARROW: 725*cdf0e10cSrcweir case SID_LINE_SQUARE_ARROW: 726*cdf0e10cSrcweir { 727*cdf0e10cSrcweir // Verbinder mit Pfeil-Ende 728*cdf0e10cSrcweir rAttr.Put(XLineEndItem(SVX_RESSTR(RID_SVXSTR_ARROW), aArrow)); 729*cdf0e10cSrcweir rAttr.Put(XLineEndWidthItem(nWidth)); 730*cdf0e10cSrcweir } 731*cdf0e10cSrcweir break; 732*cdf0e10cSrcweir 733*cdf0e10cSrcweir case SID_CONNECTOR_CIRCLES: 734*cdf0e10cSrcweir case SID_CONNECTOR_LINE_CIRCLES: 735*cdf0e10cSrcweir case SID_CONNECTOR_LINES_CIRCLES: 736*cdf0e10cSrcweir case SID_CONNECTOR_CURVE_CIRCLES: 737*cdf0e10cSrcweir { 738*cdf0e10cSrcweir // Verbinder mit Kreis-Enden 739*cdf0e10cSrcweir rAttr.Put(XLineStartItem(SVX_RESSTR(RID_SVXSTR_CIRCLE), aCircle)); 740*cdf0e10cSrcweir rAttr.Put(XLineStartWidthItem(nWidth)); 741*cdf0e10cSrcweir rAttr.Put(XLineEndItem(SVX_RESSTR(RID_SVXSTR_CIRCLE), aCircle)); 742*cdf0e10cSrcweir rAttr.Put(XLineEndWidthItem(nWidth)); 743*cdf0e10cSrcweir } 744*cdf0e10cSrcweir break; 745*cdf0e10cSrcweir 746*cdf0e10cSrcweir case SID_CONNECTOR_CIRCLE_START: 747*cdf0e10cSrcweir case SID_CONNECTOR_LINE_CIRCLE_START: 748*cdf0e10cSrcweir case SID_CONNECTOR_LINES_CIRCLE_START: 749*cdf0e10cSrcweir case SID_CONNECTOR_CURVE_CIRCLE_START: 750*cdf0e10cSrcweir { 751*cdf0e10cSrcweir // Verbinder mit Kreis-Anfang 752*cdf0e10cSrcweir rAttr.Put(XLineStartItem(SVX_RESSTR(RID_SVXSTR_CIRCLE), aCircle)); 753*cdf0e10cSrcweir rAttr.Put(XLineStartWidthItem(nWidth)); 754*cdf0e10cSrcweir } 755*cdf0e10cSrcweir break; 756*cdf0e10cSrcweir 757*cdf0e10cSrcweir case SID_CONNECTOR_CIRCLE_END: 758*cdf0e10cSrcweir case SID_CONNECTOR_LINE_CIRCLE_END: 759*cdf0e10cSrcweir case SID_CONNECTOR_LINES_CIRCLE_END: 760*cdf0e10cSrcweir case SID_CONNECTOR_CURVE_CIRCLE_END: 761*cdf0e10cSrcweir { 762*cdf0e10cSrcweir // Verbinder mit Kreis-Ende 763*cdf0e10cSrcweir rAttr.Put(XLineEndItem(SVX_RESSTR(RID_SVXSTR_CIRCLE), aCircle)); 764*cdf0e10cSrcweir rAttr.Put(XLineEndWidthItem(nWidth)); 765*cdf0e10cSrcweir } 766*cdf0e10cSrcweir break; 767*cdf0e10cSrcweir }; 768*cdf0e10cSrcweir 769*cdf0e10cSrcweir // Und nochmal fuer die noch fehlenden Enden 770*cdf0e10cSrcweir switch (nSlotId) 771*cdf0e10cSrcweir { 772*cdf0e10cSrcweir case SID_LINE_ARROW_CIRCLE: 773*cdf0e10cSrcweir { 774*cdf0e10cSrcweir // Kreis-Ende 775*cdf0e10cSrcweir rAttr.Put(XLineEndItem(SVX_RESSTR(RID_SVXSTR_CIRCLE), aCircle)); 776*cdf0e10cSrcweir rAttr.Put(XLineEndWidthItem(nWidth)); 777*cdf0e10cSrcweir } 778*cdf0e10cSrcweir break; 779*cdf0e10cSrcweir 780*cdf0e10cSrcweir case SID_LINE_CIRCLE_ARROW: 781*cdf0e10cSrcweir { 782*cdf0e10cSrcweir // Kreis-Anfang 783*cdf0e10cSrcweir rAttr.Put(XLineStartItem(SVX_RESSTR(RID_SVXSTR_CIRCLE), aCircle)); 784*cdf0e10cSrcweir rAttr.Put(XLineStartWidthItem(nWidth)); 785*cdf0e10cSrcweir } 786*cdf0e10cSrcweir break; 787*cdf0e10cSrcweir 788*cdf0e10cSrcweir case SID_LINE_ARROW_SQUARE: 789*cdf0e10cSrcweir { 790*cdf0e10cSrcweir // Quadrat-Ende 791*cdf0e10cSrcweir rAttr.Put(XLineEndItem(SVX_RESSTR(RID_SVXSTR_SQUARE), aSquare)); 792*cdf0e10cSrcweir rAttr.Put(XLineEndWidthItem(nWidth)); 793*cdf0e10cSrcweir } 794*cdf0e10cSrcweir break; 795*cdf0e10cSrcweir 796*cdf0e10cSrcweir case SID_LINE_SQUARE_ARROW: 797*cdf0e10cSrcweir { 798*cdf0e10cSrcweir // Quadrat-Anfang 799*cdf0e10cSrcweir rAttr.Put(XLineStartItem(SVX_RESSTR(RID_SVXSTR_SQUARE), aSquare)); 800*cdf0e10cSrcweir rAttr.Put(XLineStartWidthItem(nWidth)); 801*cdf0e10cSrcweir } 802*cdf0e10cSrcweir break; 803*cdf0e10cSrcweir } 804*cdf0e10cSrcweir } 805*cdf0e10cSrcweir } 806*cdf0e10cSrcweir 807*cdf0e10cSrcweir // #97016# 808*cdf0e10cSrcweir SdrObject* FuConstructRectangle::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle) 809*cdf0e10cSrcweir { 810*cdf0e10cSrcweir DBG_ASSERT( (nID != SID_DRAW_FONTWORK) && (nID != SID_DRAW_FONTWORK_VERTICAL ), "FuConstRectangle::CreateDefaultObject can not create Fontwork shapes!" ); 811*cdf0e10cSrcweir 812*cdf0e10cSrcweir // case SID_DRAW_LINE: 813*cdf0e10cSrcweir // case SID_DRAW_XLINE: 814*cdf0e10cSrcweir // case SID_DRAW_MEASURELINE: 815*cdf0e10cSrcweir // case SID_LINE_ARROW_START: 816*cdf0e10cSrcweir // case SID_LINE_ARROW_END: 817*cdf0e10cSrcweir // case SID_LINE_ARROWS: 818*cdf0e10cSrcweir // case SID_LINE_ARROW_CIRCLE: 819*cdf0e10cSrcweir // case SID_LINE_CIRCLE_ARROW: 820*cdf0e10cSrcweir // case SID_LINE_ARROW_SQUARE: 821*cdf0e10cSrcweir // case SID_LINE_SQUARE_ARROW: 822*cdf0e10cSrcweir // case SID_DRAW_RECT: 823*cdf0e10cSrcweir // case SID_DRAW_RECT_NOFILL: 824*cdf0e10cSrcweir // case SID_DRAW_RECT_ROUND: 825*cdf0e10cSrcweir // case SID_DRAW_RECT_ROUND_NOFILL: 826*cdf0e10cSrcweir // case SID_DRAW_SQUARE: 827*cdf0e10cSrcweir // case SID_DRAW_SQUARE_NOFILL: 828*cdf0e10cSrcweir // case SID_DRAW_SQUARE_ROUND: 829*cdf0e10cSrcweir // case SID_DRAW_SQUARE_ROUND_NOFILL: 830*cdf0e10cSrcweir // case SID_DRAW_ELLIPSE: 831*cdf0e10cSrcweir // case SID_DRAW_ELLIPSE_NOFILL: 832*cdf0e10cSrcweir // case SID_DRAW_CIRCLE: 833*cdf0e10cSrcweir // case SID_DRAW_CIRCLE_NOFILL: 834*cdf0e10cSrcweir // case SID_DRAW_CAPTION: 835*cdf0e10cSrcweir // case SID_DRAW_CAPTION_VERTICAL: 836*cdf0e10cSrcweir // case SID_TOOL_CONNECTOR: 837*cdf0e10cSrcweir // case SID_CONNECTOR_ARROW_START: 838*cdf0e10cSrcweir // case SID_CONNECTOR_ARROW_END: 839*cdf0e10cSrcweir // case SID_CONNECTOR_ARROWS: 840*cdf0e10cSrcweir // case SID_CONNECTOR_CIRCLE_START: 841*cdf0e10cSrcweir // case SID_CONNECTOR_CIRCLE_END: 842*cdf0e10cSrcweir // case SID_CONNECTOR_CIRCLES: 843*cdf0e10cSrcweir // case SID_CONNECTOR_LINE: 844*cdf0e10cSrcweir // case SID_CONNECTOR_LINE_ARROW_START: 845*cdf0e10cSrcweir // case SID_CONNECTOR_LINE_ARROW_END: 846*cdf0e10cSrcweir // case SID_CONNECTOR_LINE_ARROWS: 847*cdf0e10cSrcweir // case SID_CONNECTOR_LINE_CIRCLE_START: 848*cdf0e10cSrcweir // case SID_CONNECTOR_LINE_CIRCLE_END: 849*cdf0e10cSrcweir // case SID_CONNECTOR_LINE_CIRCLES: 850*cdf0e10cSrcweir // case SID_CONNECTOR_CURVE: 851*cdf0e10cSrcweir // case SID_CONNECTOR_CURVE_ARROW_START: 852*cdf0e10cSrcweir // case SID_CONNECTOR_CURVE_ARROW_END: 853*cdf0e10cSrcweir // case SID_CONNECTOR_CURVE_ARROWS: 854*cdf0e10cSrcweir // case SID_CONNECTOR_CURVE_CIRCLE_START: 855*cdf0e10cSrcweir // case SID_CONNECTOR_CURVE_CIRCLE_END: 856*cdf0e10cSrcweir // case SID_CONNECTOR_CURVE_CIRCLES: 857*cdf0e10cSrcweir // case SID_CONNECTOR_LINES: 858*cdf0e10cSrcweir // case SID_CONNECTOR_LINES_ARROW_START: 859*cdf0e10cSrcweir // case SID_CONNECTOR_LINES_ARROW_END: 860*cdf0e10cSrcweir // case SID_CONNECTOR_LINES_ARROWS: 861*cdf0e10cSrcweir // case SID_CONNECTOR_LINES_CIRCLE_START: 862*cdf0e10cSrcweir // case SID_CONNECTOR_LINES_CIRCLE_END: 863*cdf0e10cSrcweir // case SID_CONNECTOR_LINES_CIRCLES: 864*cdf0e10cSrcweir 865*cdf0e10cSrcweir SdrObject* pObj = SdrObjFactory::MakeNewObject( 866*cdf0e10cSrcweir mpView->GetCurrentObjInventor(), mpView->GetCurrentObjIdentifier(), 867*cdf0e10cSrcweir 0L, mpDoc); 868*cdf0e10cSrcweir 869*cdf0e10cSrcweir if(pObj) 870*cdf0e10cSrcweir { 871*cdf0e10cSrcweir Rectangle aRect(rRectangle); 872*cdf0e10cSrcweir 873*cdf0e10cSrcweir if(SID_DRAW_SQUARE == nID || 874*cdf0e10cSrcweir SID_DRAW_SQUARE_NOFILL == nID || 875*cdf0e10cSrcweir SID_DRAW_SQUARE_ROUND == nID || 876*cdf0e10cSrcweir SID_DRAW_SQUARE_ROUND_NOFILL == nID || 877*cdf0e10cSrcweir SID_DRAW_CIRCLE == nID || 878*cdf0e10cSrcweir SID_DRAW_CIRCLE_NOFILL == nID) 879*cdf0e10cSrcweir { 880*cdf0e10cSrcweir // force quadratic 881*cdf0e10cSrcweir ImpForceQuadratic(aRect); 882*cdf0e10cSrcweir } 883*cdf0e10cSrcweir 884*cdf0e10cSrcweir Point aStart = aRect.TopLeft(); 885*cdf0e10cSrcweir Point aEnd = aRect.BottomRight(); 886*cdf0e10cSrcweir 887*cdf0e10cSrcweir switch(nID) 888*cdf0e10cSrcweir { 889*cdf0e10cSrcweir case SID_DRAW_LINE: 890*cdf0e10cSrcweir case SID_DRAW_XLINE: 891*cdf0e10cSrcweir case SID_LINE_ARROW_START: 892*cdf0e10cSrcweir case SID_LINE_ARROW_END: 893*cdf0e10cSrcweir case SID_LINE_ARROWS: 894*cdf0e10cSrcweir case SID_LINE_ARROW_CIRCLE: 895*cdf0e10cSrcweir case SID_LINE_CIRCLE_ARROW: 896*cdf0e10cSrcweir case SID_LINE_ARROW_SQUARE: 897*cdf0e10cSrcweir case SID_LINE_SQUARE_ARROW: 898*cdf0e10cSrcweir { 899*cdf0e10cSrcweir if(pObj->ISA(SdrPathObj)) 900*cdf0e10cSrcweir { 901*cdf0e10cSrcweir sal_Int32 nYMiddle((aRect.Top() + aRect.Bottom()) / 2); 902*cdf0e10cSrcweir 903*cdf0e10cSrcweir ::basegfx::B2DPolygon aB2DPolygon; 904*cdf0e10cSrcweir aB2DPolygon.append(::basegfx::B2DPoint(aStart.X(), nYMiddle)); 905*cdf0e10cSrcweir aB2DPolygon.append(::basegfx::B2DPoint(aEnd.X(), nYMiddle)); 906*cdf0e10cSrcweir ((SdrPathObj*)pObj)->SetPathPoly(::basegfx::B2DPolyPolygon(aB2DPolygon)); 907*cdf0e10cSrcweir } 908*cdf0e10cSrcweir else 909*cdf0e10cSrcweir { 910*cdf0e10cSrcweir DBG_ERROR("Object is NO line object"); 911*cdf0e10cSrcweir } 912*cdf0e10cSrcweir 913*cdf0e10cSrcweir break; 914*cdf0e10cSrcweir } 915*cdf0e10cSrcweir 916*cdf0e10cSrcweir case SID_DRAW_MEASURELINE: 917*cdf0e10cSrcweir { 918*cdf0e10cSrcweir if(pObj->ISA(SdrMeasureObj)) 919*cdf0e10cSrcweir { 920*cdf0e10cSrcweir sal_Int32 nYMiddle((aRect.Top() + aRect.Bottom()) / 2); 921*cdf0e10cSrcweir ((SdrMeasureObj*)pObj)->SetPoint(Point(aStart.X(), nYMiddle), 0); 922*cdf0e10cSrcweir ((SdrMeasureObj*)pObj)->SetPoint(Point(aEnd.X(), nYMiddle), 1); 923*cdf0e10cSrcweir } 924*cdf0e10cSrcweir else 925*cdf0e10cSrcweir { 926*cdf0e10cSrcweir DBG_ERROR("Object is NO measure object"); 927*cdf0e10cSrcweir } 928*cdf0e10cSrcweir 929*cdf0e10cSrcweir break; 930*cdf0e10cSrcweir } 931*cdf0e10cSrcweir 932*cdf0e10cSrcweir case SID_TOOL_CONNECTOR: 933*cdf0e10cSrcweir case SID_CONNECTOR_ARROW_START: 934*cdf0e10cSrcweir case SID_CONNECTOR_ARROW_END: 935*cdf0e10cSrcweir case SID_CONNECTOR_ARROWS: 936*cdf0e10cSrcweir case SID_CONNECTOR_CIRCLE_START: 937*cdf0e10cSrcweir case SID_CONNECTOR_CIRCLE_END: 938*cdf0e10cSrcweir case SID_CONNECTOR_CIRCLES: 939*cdf0e10cSrcweir case SID_CONNECTOR_LINE: 940*cdf0e10cSrcweir case SID_CONNECTOR_LINE_ARROW_START: 941*cdf0e10cSrcweir case SID_CONNECTOR_LINE_ARROW_END: 942*cdf0e10cSrcweir case SID_CONNECTOR_LINE_ARROWS: 943*cdf0e10cSrcweir case SID_CONNECTOR_LINE_CIRCLE_START: 944*cdf0e10cSrcweir case SID_CONNECTOR_LINE_CIRCLE_END: 945*cdf0e10cSrcweir case SID_CONNECTOR_LINE_CIRCLES: 946*cdf0e10cSrcweir case SID_CONNECTOR_CURVE: 947*cdf0e10cSrcweir case SID_CONNECTOR_CURVE_ARROW_START: 948*cdf0e10cSrcweir case SID_CONNECTOR_CURVE_ARROW_END: 949*cdf0e10cSrcweir case SID_CONNECTOR_CURVE_ARROWS: 950*cdf0e10cSrcweir case SID_CONNECTOR_CURVE_CIRCLE_START: 951*cdf0e10cSrcweir case SID_CONNECTOR_CURVE_CIRCLE_END: 952*cdf0e10cSrcweir case SID_CONNECTOR_CURVE_CIRCLES: 953*cdf0e10cSrcweir case SID_CONNECTOR_LINES: 954*cdf0e10cSrcweir case SID_CONNECTOR_LINES_ARROW_START: 955*cdf0e10cSrcweir case SID_CONNECTOR_LINES_ARROW_END: 956*cdf0e10cSrcweir case SID_CONNECTOR_LINES_ARROWS: 957*cdf0e10cSrcweir case SID_CONNECTOR_LINES_CIRCLE_START: 958*cdf0e10cSrcweir case SID_CONNECTOR_LINES_CIRCLE_END: 959*cdf0e10cSrcweir case SID_CONNECTOR_LINES_CIRCLES: 960*cdf0e10cSrcweir { 961*cdf0e10cSrcweir if(pObj->ISA(SdrEdgeObj)) 962*cdf0e10cSrcweir { 963*cdf0e10cSrcweir ((SdrEdgeObj*)pObj)->SetTailPoint(sal_False, aStart); 964*cdf0e10cSrcweir ((SdrEdgeObj*)pObj)->SetTailPoint(sal_True, aEnd); 965*cdf0e10cSrcweir } 966*cdf0e10cSrcweir else 967*cdf0e10cSrcweir { 968*cdf0e10cSrcweir DBG_ERROR("Object is NO connector object"); 969*cdf0e10cSrcweir } 970*cdf0e10cSrcweir 971*cdf0e10cSrcweir break; 972*cdf0e10cSrcweir } 973*cdf0e10cSrcweir case SID_DRAW_CAPTION: 974*cdf0e10cSrcweir case SID_DRAW_CAPTION_VERTICAL: 975*cdf0e10cSrcweir { 976*cdf0e10cSrcweir if(pObj->ISA(SdrCaptionObj)) 977*cdf0e10cSrcweir { 978*cdf0e10cSrcweir sal_Bool bIsVertical(SID_DRAW_CAPTION_VERTICAL == nID); 979*cdf0e10cSrcweir 980*cdf0e10cSrcweir ((SdrTextObj*)pObj)->SetVerticalWriting(bIsVertical); 981*cdf0e10cSrcweir 982*cdf0e10cSrcweir if(bIsVertical) 983*cdf0e10cSrcweir { 984*cdf0e10cSrcweir SfxItemSet aSet(pObj->GetMergedItemSet()); 985*cdf0e10cSrcweir aSet.Put(SdrTextVertAdjustItem(SDRTEXTVERTADJUST_CENTER)); 986*cdf0e10cSrcweir aSet.Put(SdrTextHorzAdjustItem(SDRTEXTHORZADJUST_RIGHT)); 987*cdf0e10cSrcweir pObj->SetMergedItemSet(aSet); 988*cdf0e10cSrcweir } 989*cdf0e10cSrcweir 990*cdf0e10cSrcweir // For task #105815# the default text is not inserted anymore. 991*cdf0e10cSrcweir // String aText(SdResId(STR_POOLSHEET_TEXT)); 992*cdf0e10cSrcweir // ((SdrCaptionObj*)pObj)->SetText(aText); 993*cdf0e10cSrcweir 994*cdf0e10cSrcweir ((SdrCaptionObj*)pObj)->SetLogicRect(aRect); 995*cdf0e10cSrcweir ((SdrCaptionObj*)pObj)->SetTailPos( 996*cdf0e10cSrcweir aRect.TopLeft() - Point(aRect.GetWidth() / 2, aRect.GetHeight() / 2)); 997*cdf0e10cSrcweir } 998*cdf0e10cSrcweir else 999*cdf0e10cSrcweir { 1000*cdf0e10cSrcweir DBG_ERROR("Object is NO caption object"); 1001*cdf0e10cSrcweir } 1002*cdf0e10cSrcweir 1003*cdf0e10cSrcweir break; 1004*cdf0e10cSrcweir } 1005*cdf0e10cSrcweir 1006*cdf0e10cSrcweir default: 1007*cdf0e10cSrcweir { 1008*cdf0e10cSrcweir pObj->SetLogicRect(aRect); 1009*cdf0e10cSrcweir 1010*cdf0e10cSrcweir break; 1011*cdf0e10cSrcweir } 1012*cdf0e10cSrcweir } 1013*cdf0e10cSrcweir 1014*cdf0e10cSrcweir SfxItemSet aAttr(mpDoc->GetPool()); 1015*cdf0e10cSrcweir SetStyleSheet(aAttr, pObj); 1016*cdf0e10cSrcweir SetAttributes(aAttr, pObj); 1017*cdf0e10cSrcweir SetLineEnds(aAttr, pObj); 1018*cdf0e10cSrcweir pObj->SetMergedItemSet(aAttr); 1019*cdf0e10cSrcweir } 1020*cdf0e10cSrcweir 1021*cdf0e10cSrcweir return pObj; 1022*cdf0e10cSrcweir } 1023*cdf0e10cSrcweir 1024*cdf0e10cSrcweir } // end of namespace sd 1025