LCOV - code coverage report
Current view: top level - libreoffice/sd/source/ui/func - fuconrec.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 278 0.0 %
Date: 2012-12-27 Functions: 0 18 0.0 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.10