LCOV - code coverage report
Current view: top level - sd/source/ui/func - fuconbez.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 186 0.0 %
Date: 2012-08-25 Functions: 0 17 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 287 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : 
      30                 :            : #include <com/sun/star/presentation/EffectNodeType.hpp>
      31                 :            : 
      32                 :            : #include "fuconbez.hxx"
      33                 :            : #include <svl/aeitem.hxx>
      34                 :            : #include <svx/svdopath.hxx>
      35                 :            : #include <svl/intitem.hxx>
      36                 :            : #include <sfx2/dispatch.hxx>
      37                 :            : #include <svx/svdobj.hxx>
      38                 :            : #include <sfx2/bindings.hxx>
      39                 :            : #include <sfx2/request.hxx>
      40                 :            : #include <sfx2/viewfrm.hxx>
      41                 :            : 
      42                 :            : 
      43                 :            : #include <svx/svxids.hrc>
      44                 :            : #include <svx/svdpagv.hxx>
      45                 :            : 
      46                 :            : #include "app.hrc"
      47                 :            : #include "ViewShell.hxx"
      48                 :            : #include "ViewShellBase.hxx"
      49                 :            : #include "View.hxx"
      50                 :            : #include "Window.hxx"
      51                 :            : #include "ToolBarManager.hxx"
      52                 :            : #include "drawdoc.hxx"
      53                 :            : #include "res_bmp.hrc"
      54                 :            : #include <basegfx/polygon/b2dpolygon.hxx>
      55                 :            : #include <basegfx/polygon/b2dpolygontools.hxx>
      56                 :            : 
      57                 :            : #include "CustomAnimationEffect.hxx"
      58                 :            : 
      59                 :            : using namespace ::com::sun::star::uno;
      60                 :            : 
      61                 :            : namespace sd {
      62                 :            : 
      63 [ #  # ][ #  # ]:          0 : TYPEINIT1( FuConstructBezierPolygon, FuConstruct );
      64                 :            : 
      65                 :            : 
      66                 :            : /*************************************************************************
      67                 :            : |*
      68                 :            : |* Konstruktor
      69                 :            : |*
      70                 :            : \************************************************************************/
      71                 :            : 
      72                 :          0 : FuConstructBezierPolygon::FuConstructBezierPolygon (
      73                 :            :     ViewShell* pViewSh,
      74                 :            :     ::sd::Window* pWin,
      75                 :            :     ::sd::View* pView,
      76                 :            :     SdDrawDocument* pDoc,
      77                 :            :     SfxRequest& rReq)
      78                 :            :     : FuConstruct(pViewSh, pWin, pView, pDoc, rReq),
      79                 :          0 :       nEditMode(SID_BEZIER_MOVE)
      80                 :            : {
      81                 :          0 : }
      82                 :            : 
      83                 :          0 : FunctionReference FuConstructBezierPolygon::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq, bool bPermanent )
      84                 :            : {
      85                 :            :     FuConstructBezierPolygon* pFunc;
      86 [ #  # ][ #  # ]:          0 :     FunctionReference xFunc( pFunc = new FuConstructBezierPolygon( pViewSh, pWin, pView, pDoc, rReq ) );
      87         [ #  # ]:          0 :     xFunc->DoExecute(rReq);
      88                 :          0 :     pFunc->SetPermanent(bPermanent);
      89                 :          0 :     return xFunc;
      90                 :            : }
      91                 :            : 
      92                 :          0 : void FuConstructBezierPolygon::DoExecute( SfxRequest& rReq )
      93                 :            : {
      94                 :          0 :     FuConstruct::DoExecute( rReq );
      95                 :            : 
      96                 :          0 :     const SfxItemSet* pArgs = rReq.GetArgs();
      97         [ #  # ]:          0 :     if( pArgs )
      98                 :            :     {
      99                 :          0 :         const SfxPoolItem*  pPoolItem = NULL;
     100 [ #  # ][ #  # ]:          0 :         if( SFX_ITEM_SET == pArgs->GetItemState( SID_ADD_MOTION_PATH, sal_True, &pPoolItem ) )
     101                 :          0 :             maTargets = ( ( const SfxUnoAnyItem* ) pPoolItem )->GetValue();
     102                 :            :     }
     103                 :          0 : }
     104                 :            : 
     105                 :            : /*************************************************************************
     106                 :            : |*
     107                 :            : |* MouseButtonDown-event
     108                 :            : |*
     109                 :            : \************************************************************************/
     110                 :            : 
     111                 :          0 : sal_Bool FuConstructBezierPolygon::MouseButtonDown(const MouseEvent& rMEvt)
     112                 :            : {
     113         [ #  # ]:          0 :     sal_Bool bReturn = FuConstruct::MouseButtonDown(rMEvt);
     114                 :            : 
     115         [ #  # ]:          0 :     SdrViewEvent aVEvt;
     116         [ #  # ]:          0 :     SdrHitKind eHit = mpView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt);
     117                 :            : 
     118 [ #  # ][ #  # ]:          0 :     if (eHit == SDRHIT_HANDLE || rMEvt.IsMod1())
                 [ #  # ]
     119                 :            :     {
     120         [ #  # ]:          0 :         mpView->SetEditMode(SDREDITMODE_EDIT);
     121                 :            :     }
     122                 :            :     else
     123                 :            :     {
     124         [ #  # ]:          0 :         mpView->SetEditMode(SDREDITMODE_CREATE);
     125                 :            :     }
     126                 :            : 
     127         [ #  # ]:          0 :     if (aVEvt.eEvent == SDREVENT_BEGTEXTEDIT)
     128                 :            :     {
     129                 :            :         // Texteingabe hier nicht zulassen
     130                 :          0 :         aVEvt.eEvent = SDREVENT_BEGDRAGOBJ;
     131                 :          0 :         mpView->EnableExtendedMouseEventDispatcher(sal_False);
     132                 :            :     }
     133                 :            :     else
     134                 :            :     {
     135                 :          0 :         mpView->EnableExtendedMouseEventDispatcher(sal_True);
     136                 :            :     }
     137                 :            : 
     138 [ #  # ][ #  # ]:          0 :     if (eHit == SDRHIT_MARKEDOBJECT && nEditMode == SID_BEZIER_INSERT)
     139                 :            :     {
     140                 :            :         /******************************************************************
     141                 :            :         * Klebepunkt einfuegen
     142                 :            :         ******************************************************************/
     143         [ #  # ]:          0 :         mpView->BegInsObjPoint(aMDPos, rMEvt.IsMod1());
     144                 :            :     }
     145                 :            :     else
     146                 :            :     {
     147         [ #  # ]:          0 :         mpView->MouseButtonDown(rMEvt, mpWindow);
     148                 :            : 
     149                 :          0 :         SdrObject* pObj = mpView->GetCreateObj();
     150                 :            : 
     151         [ #  # ]:          0 :         if (pObj)
     152                 :            :         {
     153         [ #  # ]:          0 :             SfxItemSet aAttr(mpDoc->GetPool());
     154         [ #  # ]:          0 :             SetStyleSheet(aAttr, pObj);
     155 [ #  # ][ #  # ]:          0 :             pObj->SetMergedItemSet(aAttr);
     156                 :            :         }
     157                 :            :     }
     158                 :            : 
     159         [ #  # ]:          0 :     return(bReturn);
     160                 :            : }
     161                 :            : 
     162                 :            : /*************************************************************************
     163                 :            : |*
     164                 :            : |* MouseMove-event
     165                 :            : |*
     166                 :            : \************************************************************************/
     167                 :            : 
     168                 :          0 : sal_Bool FuConstructBezierPolygon::MouseMove(const MouseEvent& rMEvt)
     169                 :            : {
     170                 :          0 :     sal_Bool bReturn = FuConstruct::MouseMove(rMEvt);
     171                 :          0 :     return(bReturn);
     172                 :            : }
     173                 :            : 
     174                 :            : /*************************************************************************
     175                 :            : |*
     176                 :            : |* MouseButtonUp-event
     177                 :            : |*
     178                 :            : \************************************************************************/
     179                 :            : 
     180                 :          0 : sal_Bool FuConstructBezierPolygon::MouseButtonUp(const MouseEvent& rMEvt )
     181                 :            : {
     182                 :          0 :     sal_Bool bReturn = sal_False;
     183                 :          0 :     sal_Bool bCreated = sal_False;
     184                 :            : 
     185         [ #  # ]:          0 :     SdrViewEvent aVEvt;
     186         [ #  # ]:          0 :     mpView->PickAnything(rMEvt, SDRMOUSEBUTTONUP, aVEvt);
     187                 :            : 
     188         [ #  # ]:          0 :     sal_uLong nCount = mpView->GetSdrPageView()->GetObjList()->GetObjCount();
     189                 :            : 
     190         [ #  # ]:          0 :     if (mpView->IsInsObjPoint())
     191                 :            :     {
     192         [ #  # ]:          0 :         mpView->EndInsObjPoint(SDRCREATE_FORCEEND);
     193                 :            :     }
     194                 :            :     else
     195                 :            :     {
     196         [ #  # ]:          0 :         mpView->MouseButtonUp(rMEvt, mpWindow);
     197                 :            :     }
     198                 :            : 
     199         [ #  # ]:          0 :     if (aVEvt.eEvent == SDREVENT_ENDCREATE)
     200                 :            :     {
     201                 :          0 :         bReturn = sal_True;
     202                 :            : 
     203 [ #  # ][ #  # ]:          0 :         if (nCount == (mpView->GetSdrPageView()->GetObjList()->GetObjCount() - 1))
     204                 :            :         {
     205                 :          0 :             bCreated = sal_True;
     206                 :            :         }
     207                 :            : 
     208                 :            :         // Trick, um FuDraw::DoubleClick nicht auszuloesen
     209                 :          0 :         bMBDown = sal_False;
     210                 :            : 
     211                 :            :     }
     212                 :            : 
     213 [ #  # ][ #  # ]:          0 :     bReturn = FuConstruct::MouseButtonUp(rMEvt) || bReturn;
                 [ #  # ]
     214                 :            : 
     215                 :          0 :     bool bDeleted = false;
     216 [ #  # ][ #  # ]:          0 :     if( bCreated && maTargets.hasValue() )
                 [ #  # ]
     217                 :            :     {
     218 [ #  # ][ #  # ]:          0 :         SdrPathObj* pPathObj = dynamic_cast< SdrPathObj* >( mpView->GetSdrPageView()->GetObjList()->GetObj( nCount ) );
     219 [ #  # ][ #  # ]:          0 :         SdPage* pPage = dynamic_cast< SdPage* >( pPathObj ? pPathObj->GetPage() : 0 );
                 [ #  # ]
     220         [ #  # ]:          0 :         if( pPage )
     221                 :            :         {
     222         [ #  # ]:          0 :             boost::shared_ptr< sd::MainSequence > pMainSequence( pPage->getMainSequence() );
     223         [ #  # ]:          0 :             if( pMainSequence.get() )
     224                 :            :             {
     225         [ #  # ]:          0 :                 Sequence< Any > aTargets;
     226         [ #  # ]:          0 :                 maTargets >>= aTargets;
     227                 :            : 
     228                 :          0 :                 sal_Int32 nTCount = aTargets.getLength();
     229         [ #  # ]:          0 :                 if( nTCount > 1 )
     230                 :            :                 {
     231                 :          0 :                     const Any* pTarget = aTargets.getConstArray();
     232                 :          0 :                     double fDuration = 0.0;
     233                 :          0 :                     *pTarget++ >>= fDuration;
     234                 :          0 :                     bool bFirst = true;
     235         [ #  # ]:          0 :                     while( --nTCount )
     236                 :            :                     {
     237         [ #  # ]:          0 :                         CustomAnimationEffectPtr pCreated( pMainSequence->append( *pPathObj, *pTarget++, fDuration ) );
     238         [ #  # ]:          0 :                         if( bFirst )
     239                 :          0 :                             bFirst = false;
     240                 :            :                         else
     241         [ #  # ]:          0 :                             pCreated->setNodeType( ::com::sun::star::presentation::EffectNodeType::WITH_PREVIOUS );
     242         [ #  # ]:          0 :                     }
     243         [ #  # ]:          0 :                 }
     244         [ #  # ]:          0 :             }
     245                 :            :         }
     246         [ #  # ]:          0 :         mpView->DeleteMarked();
     247                 :          0 :         bDeleted = true;
     248                 :            :     }
     249                 :            : 
     250 [ #  # ][ #  # ]:          0 :     if ((!bPermanent && bCreated) || bDeleted)
                 [ #  # ]
     251                 :            :     {
     252 [ #  # ][ #  # ]:          0 :         mpViewShell->GetViewFrame()->GetDispatcher()->Execute(SID_OBJECT_SELECT, SFX_CALLMODE_ASYNCHRON);
     253                 :            :     }
     254                 :            : 
     255         [ #  # ]:          0 :     return(bReturn);
     256                 :            : }
     257                 :            : 
     258                 :            : /*************************************************************************
     259                 :            : |*
     260                 :            : |* Tastaturereignisse bearbeiten
     261                 :            : |*
     262                 :            : |* Wird ein KeyEvent bearbeitet, so ist der Return-Wert sal_True, andernfalls
     263                 :            : |* sal_False.
     264                 :            : |*
     265                 :            : \************************************************************************/
     266                 :            : 
     267                 :          0 : sal_Bool FuConstructBezierPolygon::KeyInput(const KeyEvent& rKEvt)
     268                 :            : {
     269                 :          0 :     sal_Bool bReturn = FuConstruct::KeyInput(rKEvt);
     270                 :            : 
     271                 :          0 :     return(bReturn);
     272                 :            : }
     273                 :            : 
     274                 :            : /*************************************************************************
     275                 :            : |*
     276                 :            : |* Function aktivieren
     277                 :            : |*
     278                 :            : \************************************************************************/
     279                 :            : 
     280                 :          0 : void FuConstructBezierPolygon::Activate()
     281                 :            : {
     282                 :          0 :     mpView->EnableExtendedMouseEventDispatcher(sal_True);
     283                 :            : 
     284                 :            :     SdrObjKind eKind;
     285                 :            : 
     286   [ #  #  #  #  :          0 :     switch (nSlotId)
                #  #  # ]
     287                 :            :     {
     288                 :            :         case SID_DRAW_POLYGON_NOFILL:
     289                 :            :         case SID_DRAW_XPOLYGON_NOFILL:
     290                 :            :         {
     291                 :          0 :             eKind = OBJ_PLIN;
     292                 :            :         }
     293                 :          0 :         break;
     294                 :            : 
     295                 :            :         case SID_DRAW_POLYGON:
     296                 :            :         case SID_DRAW_XPOLYGON:
     297                 :            :         {
     298                 :          0 :             eKind = OBJ_POLY;
     299                 :            :         }
     300                 :          0 :         break;
     301                 :            : 
     302                 :            :         case SID_DRAW_BEZIER_NOFILL:
     303                 :            :         {
     304                 :          0 :             eKind = OBJ_PATHLINE;
     305                 :            :         }
     306                 :          0 :         break;
     307                 :            : 
     308                 :            :         case SID_DRAW_BEZIER_FILL:
     309                 :            :         {
     310                 :          0 :             eKind = OBJ_PATHFILL;
     311                 :            :         }
     312                 :          0 :         break;
     313                 :            : 
     314                 :            :         case SID_DRAW_FREELINE_NOFILL:
     315                 :            :         {
     316                 :          0 :             eKind = OBJ_FREELINE;
     317                 :            :         }
     318                 :          0 :         break;
     319                 :            : 
     320                 :            :         case SID_DRAW_FREELINE:
     321                 :            :         {
     322                 :          0 :             eKind = OBJ_FREEFILL;
     323                 :            :         }
     324                 :          0 :         break;
     325                 :            : 
     326                 :            :         default:
     327                 :            :         {
     328                 :          0 :             eKind = OBJ_PATHLINE;
     329                 :            :         }
     330                 :          0 :         break;
     331                 :            :     }
     332                 :            : 
     333                 :          0 :     mpView->SetCurrentObj((sal_uInt16)eKind);
     334                 :            : 
     335                 :          0 :     FuConstruct::Activate();
     336                 :          0 : }
     337                 :            : 
     338                 :            : /*************************************************************************
     339                 :            : |*
     340                 :            : |* Function deaktivieren
     341                 :            : |*
     342                 :            : \************************************************************************/
     343                 :            : 
     344                 :          0 : void FuConstructBezierPolygon::Deactivate()
     345                 :            : {
     346                 :          0 :     mpView->EnableExtendedMouseEventDispatcher(sal_False);
     347                 :            : 
     348                 :          0 :     FuConstruct::Deactivate();
     349                 :          0 : }
     350                 :            : 
     351                 :            : 
     352                 :            : /*************************************************************************
     353                 :            : |*
     354                 :            : |* Selektion hat sich geaendert
     355                 :            : |*
     356                 :            : \************************************************************************/
     357                 :            : 
     358                 :          0 : void FuConstructBezierPolygon::SelectionHasChanged()
     359                 :            : {
     360                 :          0 :     FuDraw::SelectionHasChanged();
     361                 :            : 
     362                 :          0 :     mpViewShell->GetViewShellBase().GetToolBarManager()->SelectionHasChanged(
     363                 :            :         *mpViewShell,
     364         [ #  # ]:          0 :         *mpView);
     365                 :          0 : }
     366                 :            : 
     367                 :            : 
     368                 :            : 
     369                 :            : /*************************************************************************
     370                 :            : |*
     371                 :            : |* Aktuellen Bezier-Editmodus setzen
     372                 :            : |*
     373                 :            : \************************************************************************/
     374                 :            : 
     375                 :          0 : void FuConstructBezierPolygon::SetEditMode(sal_uInt16 nMode)
     376                 :            : {
     377                 :          0 :     nEditMode = nMode;
     378                 :          0 :     ForcePointer();
     379                 :            : 
     380                 :          0 :     SfxBindings& rBindings = mpViewShell->GetViewFrame()->GetBindings();
     381                 :          0 :     rBindings.Invalidate(SID_BEZIER_MOVE);
     382                 :          0 :     rBindings.Invalidate(SID_BEZIER_INSERT);
     383                 :          0 : }
     384                 :            : 
     385                 :          0 : SdrObject* FuConstructBezierPolygon::CreateDefaultObject(const sal_uInt16 nID, const Rectangle& rRectangle)
     386                 :            : {
     387                 :            :     // case SID_DRAW_POLYGON:
     388                 :            :     // case SID_DRAW_POLYGON_NOFILL:
     389                 :            :     // case SID_DRAW_XPOLYGON:
     390                 :            :     // case SID_DRAW_XPOLYGON_NOFILL:
     391                 :            :     // case SID_DRAW_FREELINE:
     392                 :            :     // case SID_DRAW_FREELINE_NOFILL:
     393                 :            :     // case SID_DRAW_BEZIER_FILL:          // BASIC
     394                 :            :     // case SID_DRAW_BEZIER_NOFILL:        // BASIC
     395                 :            : 
     396                 :            :     SdrObject* pObj = SdrObjFactory::MakeNewObject(
     397                 :          0 :         mpView->GetCurrentObjInventor(), mpView->GetCurrentObjIdentifier(),
     398                 :          0 :         0L, mpDoc);
     399                 :            : 
     400         [ #  # ]:          0 :     if(pObj)
     401                 :            :     {
     402         [ #  # ]:          0 :         if(pObj->ISA(SdrPathObj))
     403                 :            :         {
     404         [ #  # ]:          0 :             basegfx::B2DPolyPolygon aPoly;
     405                 :            : 
     406   [ #  #  #  #  :          0 :             switch(nID)
                   #  # ]
     407                 :            :             {
     408                 :            :                 case SID_DRAW_BEZIER_FILL:
     409                 :            :                 {
     410         [ #  # ]:          0 :                     const sal_Int32 nWdt(rRectangle.GetWidth() / 2);
     411         [ #  # ]:          0 :                     const sal_Int32 nHgt(rRectangle.GetHeight() / 2);
     412 [ #  # ][ #  # ]:          0 :                     const basegfx::B2DPolygon aInnerPoly(basegfx::tools::createPolygonFromEllipse(basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Center().Y()), nWdt, nHgt));
                 [ #  # ]
     413                 :            : 
     414         [ #  # ]:          0 :                     aPoly.append(aInnerPoly);
     415         [ #  # ]:          0 :                     break;
     416                 :            :                 }
     417                 :            :                 case SID_DRAW_BEZIER_NOFILL:
     418                 :            :                 {
     419         [ #  # ]:          0 :                     basegfx::B2DPolygon aInnerPoly;
     420                 :            : 
     421         [ #  # ]:          0 :                     aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left(), rRectangle.Bottom()));
     422                 :            : 
     423         [ #  # ]:          0 :                     const basegfx::B2DPoint aCenterBottom(rRectangle.Center().X(), rRectangle.Bottom());
     424                 :            :                     aInnerPoly.appendBezierSegment(
     425                 :            :                         aCenterBottom,
     426                 :            :                         aCenterBottom,
     427 [ #  # ][ #  # ]:          0 :                         basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Center().Y()));
                 [ #  # ]
     428                 :            : 
     429         [ #  # ]:          0 :                     const basegfx::B2DPoint aCenterTop(rRectangle.Center().X(), rRectangle.Top());
     430                 :            :                     aInnerPoly.appendBezierSegment(
     431                 :            :                         aCenterTop,
     432                 :            :                         aCenterTop,
     433         [ #  # ]:          0 :                         basegfx::B2DPoint(rRectangle.Right(), rRectangle.Top()));
     434                 :            : 
     435         [ #  # ]:          0 :                     aPoly.append(aInnerPoly);
     436         [ #  # ]:          0 :                     break;
     437                 :            :                 }
     438                 :            :                 case SID_DRAW_FREELINE:
     439                 :            :                 case SID_DRAW_FREELINE_NOFILL:
     440                 :            :                 {
     441         [ #  # ]:          0 :                     basegfx::B2DPolygon aInnerPoly;
     442                 :            : 
     443         [ #  # ]:          0 :                     aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left(), rRectangle.Bottom()));
     444                 :            : 
     445                 :            :                     aInnerPoly.appendBezierSegment(
     446                 :          0 :                         basegfx::B2DPoint(rRectangle.Left(), rRectangle.Top()),
     447         [ #  # ]:          0 :                         basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Top()),
     448 [ #  # ][ #  # ]:          0 :                         basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Center().Y()));
                 [ #  # ]
     449                 :            : 
     450                 :            :                     aInnerPoly.appendBezierSegment(
     451         [ #  # ]:          0 :                         basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Bottom()),
     452                 :          0 :                         basegfx::B2DPoint(rRectangle.Right(), rRectangle.Bottom()),
     453         [ #  # ]:          0 :                         basegfx::B2DPoint(rRectangle.Right(), rRectangle.Top()));
     454                 :            : 
     455         [ #  # ]:          0 :                     if(SID_DRAW_FREELINE == nID)
     456                 :            :                     {
     457         [ #  # ]:          0 :                         aInnerPoly.append(basegfx::B2DPoint(rRectangle.Right(), rRectangle.Bottom()));
     458                 :            :                     }
     459                 :            :                     else
     460                 :            :                     {
     461         [ #  # ]:          0 :                         aInnerPoly.setClosed(true);
     462                 :            :                     }
     463                 :            : 
     464         [ #  # ]:          0 :                     aPoly.append(aInnerPoly);
     465         [ #  # ]:          0 :                     break;
     466                 :            :                 }
     467                 :            :                 case SID_DRAW_XPOLYGON:
     468                 :            :                 case SID_DRAW_XPOLYGON_NOFILL:
     469                 :            :                 {
     470         [ #  # ]:          0 :                     basegfx::B2DPolygon aInnerPoly;
     471                 :            : 
     472         [ #  # ]:          0 :                     aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left(), rRectangle.Bottom()));
     473         [ #  # ]:          0 :                     aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left(), rRectangle.Top()));
     474 [ #  # ][ #  # ]:          0 :                     aInnerPoly.append(basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Top()));
     475 [ #  # ][ #  # ]:          0 :                     aInnerPoly.append(basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Center().Y()));
                 [ #  # ]
     476 [ #  # ][ #  # ]:          0 :                     aInnerPoly.append(basegfx::B2DPoint(rRectangle.Right(), rRectangle.Center().Y()));
     477         [ #  # ]:          0 :                     aInnerPoly.append(basegfx::B2DPoint(rRectangle.Right(), rRectangle.Bottom()));
     478                 :            : 
     479         [ #  # ]:          0 :                     if(SID_DRAW_XPOLYGON_NOFILL == nID)
     480                 :            :                     {
     481 [ #  # ][ #  # ]:          0 :                         aInnerPoly.append(basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Bottom()));
     482                 :            :                     }
     483                 :            :                     else
     484                 :            :                     {
     485         [ #  # ]:          0 :                         aInnerPoly.setClosed(true);
     486                 :            :                     }
     487                 :            : 
     488         [ #  # ]:          0 :                     aPoly.append(aInnerPoly);
     489         [ #  # ]:          0 :                     break;
     490                 :            :                 }
     491                 :            :                 case SID_DRAW_POLYGON:
     492                 :            :                 case SID_DRAW_POLYGON_NOFILL:
     493                 :            :                 {
     494         [ #  # ]:          0 :                     basegfx::B2DPolygon aInnerPoly;
     495         [ #  # ]:          0 :                     const sal_Int32 nWdt(rRectangle.GetWidth());
     496         [ #  # ]:          0 :                     const sal_Int32 nHgt(rRectangle.GetHeight());
     497                 :            : 
     498         [ #  # ]:          0 :                     aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left(), rRectangle.Bottom()));
     499         [ #  # ]:          0 :                     aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left() + (nWdt * 30) / 100, rRectangle.Top() + (nHgt * 70) / 100));
     500         [ #  # ]:          0 :                     aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left(), rRectangle.Top() + (nHgt * 15) / 100));
     501         [ #  # ]:          0 :                     aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left() + (nWdt * 65) / 100, rRectangle.Top()));
     502         [ #  # ]:          0 :                     aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left() + nWdt, rRectangle.Top() + (nHgt * 30) / 100));
     503         [ #  # ]:          0 :                     aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left() + (nWdt * 80) / 100, rRectangle.Top() + (nHgt * 50) / 100));
     504         [ #  # ]:          0 :                     aInnerPoly.append(basegfx::B2DPoint(rRectangle.Left() + (nWdt * 80) / 100, rRectangle.Top() + (nHgt * 75) / 100));
     505         [ #  # ]:          0 :                     aInnerPoly.append(basegfx::B2DPoint(rRectangle.Bottom(), rRectangle.Right()));
     506                 :            : 
     507         [ #  # ]:          0 :                     if(SID_DRAW_POLYGON_NOFILL == nID)
     508                 :            :                     {
     509 [ #  # ][ #  # ]:          0 :                         aInnerPoly.append(basegfx::B2DPoint(rRectangle.Center().X(), rRectangle.Bottom()));
     510                 :            :                     }
     511                 :            :                     else
     512                 :            :                     {
     513         [ #  # ]:          0 :                         aInnerPoly.setClosed(true);
     514                 :            :                     }
     515                 :            : 
     516         [ #  # ]:          0 :                     aPoly.append(aInnerPoly);
     517         [ #  # ]:          0 :                     break;
     518                 :            :                 }
     519                 :            :             }
     520                 :            : 
     521 [ #  # ][ #  # ]:          0 :             ((SdrPathObj*)pObj)->SetPathPoly(aPoly);
     522                 :            :         }
     523                 :            :         else
     524                 :            :         {
     525                 :            :             OSL_FAIL("Object is NO path object");
     526                 :            :         }
     527                 :            : 
     528                 :          0 :         pObj->SetLogicRect(rRectangle);
     529                 :            :     }
     530                 :            : 
     531                 :          0 :     return pObj;
     532                 :            : }
     533                 :            : 
     534                 :            : } // end of namespace sd
     535                 :            : 
     536                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10