LCOV - code coverage report
Current view: top level - svx/source/svdraw - svdglue.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 2 251 0.8 %
Date: 2012-08-25 Functions: 2 25 8.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 2 291 0.7 %

           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                 :            : #include <tools/debug.hxx>
      30                 :            : 
      31                 :            : #include <svx/svdglue.hxx>
      32                 :            : #include <svx/svdobj.hxx>
      33                 :            : #include <svx/svdtrans.hxx>
      34                 :            : 
      35                 :        150 : static const Size aGlueHalfSize(4,4);
      36                 :            : 
      37                 :          0 : void SdrGluePoint::SetReallyAbsolute(bool bOn, const SdrObject& rObj)
      38                 :            : {
      39         [ #  # ]:          0 :     if ( bReallyAbsolute != bOn )
      40                 :            :     {
      41         [ #  # ]:          0 :        if ( bOn )
      42                 :            :        {
      43                 :          0 :            aPos=GetAbsolutePos(rObj);
      44                 :          0 :            bReallyAbsolute=bOn;
      45                 :            :        }
      46                 :            :        else
      47                 :            :        {
      48                 :          0 :            bReallyAbsolute=bOn;
      49                 :          0 :            Point aPt(aPos);
      50         [ #  # ]:          0 :            SetAbsolutePos(aPt,rObj);
      51                 :            :        }
      52                 :            :     }
      53                 :          0 : }
      54                 :            : 
      55                 :          0 : Point SdrGluePoint::GetAbsolutePos(const SdrObject& rObj) const
      56                 :            : {
      57         [ #  # ]:          0 :     if (bReallyAbsolute) return aPos;
      58         [ #  # ]:          0 :     Rectangle aSnap(rObj.GetSnapRect());
      59         [ #  # ]:          0 :     Rectangle aBound(rObj.GetSnapRect());
      60                 :          0 :     Point aPt(aPos);
      61                 :            : 
      62         [ #  # ]:          0 :     Point aOfs(aSnap.Center());
      63      [ #  #  # ]:          0 :     switch (GetHorzAlign()) {
      64                 :          0 :         case SDRHORZALIGN_LEFT  : aOfs.X()=aSnap.Left(); break;
      65                 :          0 :         case SDRHORZALIGN_RIGHT : aOfs.X()=aSnap.Right(); break;
      66                 :            :     }
      67      [ #  #  # ]:          0 :     switch (GetVertAlign()) {
      68                 :          0 :         case SDRVERTALIGN_TOP   : aOfs.Y()=aSnap.Top(); break;
      69                 :          0 :         case SDRVERTALIGN_BOTTOM: aOfs.Y()=aSnap.Bottom(); break;
      70                 :            :     }
      71         [ #  # ]:          0 :     if (!bNoPercent) {
      72                 :          0 :         long nXMul=aSnap.Right()-aSnap.Left();
      73                 :          0 :         long nYMul=aSnap.Bottom()-aSnap.Top();
      74                 :          0 :         long nXDiv=10000;
      75                 :          0 :         long nYDiv=10000;
      76         [ #  # ]:          0 :         if (nXMul!=nXDiv) {
      77                 :          0 :             aPt.X()*=nXMul;
      78                 :          0 :             aPt.X()/=nXDiv;
      79                 :            :         }
      80         [ #  # ]:          0 :         if (nYMul!=nYDiv) {
      81                 :          0 :             aPt.Y()*=nYMul;
      82                 :          0 :             aPt.Y()/=nYDiv;
      83                 :            :         }
      84                 :            :     }
      85                 :          0 :     aPt+=aOfs;
      86                 :            :     // Now limit to the BoundRect of the object
      87         [ #  # ]:          0 :     if (aPt.X()<aBound.Left  ()) aPt.X()=aBound.Left  ();
      88         [ #  # ]:          0 :     if (aPt.X()>aBound.Right ()) aPt.X()=aBound.Right ();
      89         [ #  # ]:          0 :     if (aPt.Y()<aBound.Top   ()) aPt.Y()=aBound.Top   ();
      90         [ #  # ]:          0 :     if (aPt.Y()>aBound.Bottom()) aPt.Y()=aBound.Bottom();
      91                 :          0 :     return aPt;
      92                 :            : }
      93                 :            : 
      94                 :          0 : void SdrGluePoint::SetAbsolutePos(const Point& rNewPos, const SdrObject& rObj)
      95                 :            : {
      96         [ #  # ]:          0 :     if (bReallyAbsolute) {
      97                 :          0 :         aPos=rNewPos;
      98                 :          0 :         return;
      99                 :            :     }
     100         [ #  # ]:          0 :     Rectangle aSnap(rObj.GetSnapRect());
     101                 :          0 :     Point aPt(rNewPos);
     102                 :            : 
     103         [ #  # ]:          0 :     Point aOfs(aSnap.Center());
     104      [ #  #  # ]:          0 :     switch (GetHorzAlign()) {
     105                 :          0 :         case SDRHORZALIGN_LEFT  : aOfs.X()=aSnap.Left(); break;
     106                 :          0 :         case SDRHORZALIGN_RIGHT : aOfs.X()=aSnap.Right(); break;
     107                 :            :     }
     108      [ #  #  # ]:          0 :     switch (GetVertAlign()) {
     109                 :          0 :         case SDRVERTALIGN_TOP   : aOfs.Y()=aSnap.Top(); break;
     110                 :          0 :         case SDRVERTALIGN_BOTTOM: aOfs.Y()=aSnap.Bottom(); break;
     111                 :            :     }
     112                 :          0 :     aPt-=aOfs;
     113         [ #  # ]:          0 :     if (!bNoPercent) {
     114                 :          0 :         long nXMul=aSnap.Right()-aSnap.Left();
     115                 :          0 :         long nYMul=aSnap.Bottom()-aSnap.Top();
     116         [ #  # ]:          0 :         if (nXMul==0) nXMul=1;
     117         [ #  # ]:          0 :         if (nYMul==0) nYMul=1;
     118                 :          0 :         long nXDiv=10000;
     119                 :          0 :         long nYDiv=10000;
     120         [ #  # ]:          0 :         if (nXMul!=nXDiv) {
     121                 :          0 :             aPt.X()*=nXDiv;
     122                 :          0 :             aPt.X()/=nXMul;
     123                 :            :         }
     124         [ #  # ]:          0 :         if (nYMul!=nYDiv) {
     125                 :          0 :             aPt.Y()*=nYDiv;
     126                 :          0 :             aPt.Y()/=nYMul;
     127                 :            :         }
     128                 :            :     }
     129                 :          0 :     aPos=aPt;
     130                 :            : }
     131                 :            : 
     132                 :          0 : long SdrGluePoint::GetAlignAngle() const
     133                 :            : {
     134   [ #  #  #  #  :          0 :     switch (nAlign) {
          #  #  #  #  #  
                      # ]
     135                 :          0 :         case SDRHORZALIGN_CENTER|SDRVERTALIGN_CENTER: return 0; // Invalid!
     136                 :          0 :         case SDRHORZALIGN_RIGHT |SDRVERTALIGN_CENTER: return 0;
     137                 :          0 :         case SDRHORZALIGN_RIGHT |SDRVERTALIGN_TOP   : return 4500;
     138                 :          0 :         case SDRHORZALIGN_CENTER|SDRVERTALIGN_TOP   : return 9000;
     139                 :          0 :         case SDRHORZALIGN_LEFT  |SDRVERTALIGN_TOP   : return 13500;
     140                 :          0 :         case SDRHORZALIGN_LEFT  |SDRVERTALIGN_CENTER: return 18000;
     141                 :          0 :         case SDRHORZALIGN_LEFT  |SDRVERTALIGN_BOTTOM: return 22500;
     142                 :          0 :         case SDRHORZALIGN_CENTER|SDRVERTALIGN_BOTTOM: return 27000;
     143                 :          0 :         case SDRHORZALIGN_RIGHT |SDRVERTALIGN_BOTTOM: return 31500;
     144                 :            :     } // switch
     145                 :          0 :     return 0;
     146                 :            : }
     147                 :            : 
     148                 :          0 : void SdrGluePoint::SetAlignAngle(long nWink)
     149                 :            : {
     150                 :          0 :     nWink=NormAngle360(nWink);
     151 [ #  # ][ #  # ]:          0 :     if (nWink>=33750 || nWink<2250) nAlign=SDRHORZALIGN_RIGHT |SDRVERTALIGN_CENTER;
     152         [ #  # ]:          0 :     else if (nWink< 6750) nAlign=SDRHORZALIGN_RIGHT |SDRVERTALIGN_TOP   ;
     153         [ #  # ]:          0 :     else if (nWink<11250) nAlign=SDRHORZALIGN_CENTER|SDRVERTALIGN_TOP   ;
     154         [ #  # ]:          0 :     else if (nWink<15750) nAlign=SDRHORZALIGN_LEFT  |SDRVERTALIGN_TOP   ;
     155         [ #  # ]:          0 :     else if (nWink<20250) nAlign=SDRHORZALIGN_LEFT  |SDRVERTALIGN_CENTER;
     156         [ #  # ]:          0 :     else if (nWink<24750) nAlign=SDRHORZALIGN_LEFT  |SDRVERTALIGN_BOTTOM;
     157         [ #  # ]:          0 :     else if (nWink<29250) nAlign=SDRHORZALIGN_CENTER|SDRVERTALIGN_BOTTOM;
     158         [ #  # ]:          0 :     else if (nWink<33750) nAlign=SDRHORZALIGN_RIGHT |SDRVERTALIGN_BOTTOM;
     159                 :          0 : }
     160                 :            : 
     161                 :          0 : long SdrGluePoint::EscDirToAngle(sal_uInt16 nEsc) const
     162                 :            : {
     163   [ #  #  #  #  :          0 :     switch (nEsc) {
                      # ]
     164                 :          0 :         case SDRESC_RIGHT : return 0;
     165                 :          0 :         case SDRESC_TOP   : return 9000;
     166                 :          0 :         case SDRESC_LEFT  : return 18000;
     167                 :          0 :         case SDRESC_BOTTOM: return 27000;
     168                 :            :     } // switch
     169                 :          0 :     return 0;
     170                 :            : }
     171                 :            : 
     172                 :          0 : sal_uInt16 SdrGluePoint::EscAngleToDir(long nWink) const
     173                 :            : {
     174                 :          0 :     nWink=NormAngle360(nWink);
     175 [ #  # ][ #  # ]:          0 :     if (nWink>=31500 || nWink<4500) return SDRESC_RIGHT;
     176         [ #  # ]:          0 :     if (nWink<13500) return SDRESC_TOP;
     177         [ #  # ]:          0 :     if (nWink<22500) return SDRESC_LEFT;
     178         [ #  # ]:          0 :     if (nWink<31500) return SDRESC_BOTTOM;
     179                 :          0 :     return 0;
     180                 :            : }
     181                 :            : 
     182                 :          0 : void SdrGluePoint::Rotate(const Point& rRef, long nWink, double sn, double cs, const SdrObject* pObj)
     183                 :            : {
     184 [ #  # ][ #  # ]:          0 :     Point aPt(pObj!=NULL ? GetAbsolutePos(*pObj) : GetPos());
     185                 :          0 :     RotatePoint(aPt,rRef,sn,cs);
     186                 :            :     // rotate reference edge
     187         [ #  # ]:          0 :     if(nAlign != (SDRHORZALIGN_CENTER|SDRVERTALIGN_CENTER))
     188                 :            :     {
     189 [ #  # ][ #  # ]:          0 :         SetAlignAngle(GetAlignAngle()+nWink);
     190                 :            :     }
     191                 :            :     // rotate exit directions
     192                 :          0 :     sal_uInt16 nEscDir0=nEscDir;
     193                 :          0 :     sal_uInt16 nEscDir1=0;
     194 [ #  # ][ #  # ]:          0 :     if ((nEscDir0&SDRESC_LEFT  )!=0) nEscDir1|=EscAngleToDir(EscDirToAngle(SDRESC_LEFT  )+nWink);
                 [ #  # ]
     195 [ #  # ][ #  # ]:          0 :     if ((nEscDir0&SDRESC_TOP   )!=0) nEscDir1|=EscAngleToDir(EscDirToAngle(SDRESC_TOP   )+nWink);
                 [ #  # ]
     196 [ #  # ][ #  # ]:          0 :     if ((nEscDir0&SDRESC_RIGHT )!=0) nEscDir1|=EscAngleToDir(EscDirToAngle(SDRESC_RIGHT )+nWink);
                 [ #  # ]
     197 [ #  # ][ #  # ]:          0 :     if ((nEscDir0&SDRESC_BOTTOM)!=0) nEscDir1|=EscAngleToDir(EscDirToAngle(SDRESC_BOTTOM)+nWink);
                 [ #  # ]
     198                 :          0 :     nEscDir=nEscDir1;
     199 [ #  # ][ #  # ]:          0 :     if (pObj!=NULL) SetAbsolutePos(aPt,*pObj); else SetPos(aPt);
     200                 :          0 : }
     201                 :            : 
     202                 :          0 : void SdrGluePoint::Mirror(const Point& rRef1, const Point& rRef2, long nWink, const SdrObject* pObj)
     203                 :            : {
     204 [ #  # ][ #  # ]:          0 :     Point aPt(pObj!=NULL ? GetAbsolutePos(*pObj) : GetPos());
     205         [ #  # ]:          0 :     MirrorPoint(aPt,rRef1,rRef2);
     206                 :            :     // mirror reference edge
     207         [ #  # ]:          0 :     if(nAlign != (SDRHORZALIGN_CENTER|SDRVERTALIGN_CENTER))
     208                 :            :     {
     209         [ #  # ]:          0 :         long nAW=GetAlignAngle();
     210                 :          0 :         nAW+=2*(nWink-nAW);
     211         [ #  # ]:          0 :         SetAlignAngle(nAW);
     212                 :            :     }
     213                 :            :     // mirror exit directions
     214                 :          0 :     sal_uInt16 nEscDir0=nEscDir;
     215                 :          0 :     sal_uInt16 nEscDir1=0;
     216         [ #  # ]:          0 :     if ((nEscDir0&SDRESC_LEFT)!=0) {
     217         [ #  # ]:          0 :         long nEW=EscDirToAngle(SDRESC_LEFT);
     218                 :          0 :         nEW+=2*(nWink-nEW);
     219         [ #  # ]:          0 :         nEscDir1|=EscAngleToDir(nEW);
     220                 :            :     }
     221         [ #  # ]:          0 :     if ((nEscDir0&SDRESC_TOP)!=0) {
     222         [ #  # ]:          0 :         long nEW=EscDirToAngle(SDRESC_TOP);
     223                 :          0 :         nEW+=2*(nWink-nEW);
     224         [ #  # ]:          0 :         nEscDir1|=EscAngleToDir(nEW);
     225                 :            :     }
     226         [ #  # ]:          0 :     if ((nEscDir0&SDRESC_RIGHT)!=0) {
     227         [ #  # ]:          0 :         long nEW=EscDirToAngle(SDRESC_RIGHT);
     228                 :          0 :         nEW+=2*(nWink-nEW);
     229         [ #  # ]:          0 :         nEscDir1|=EscAngleToDir(nEW);
     230                 :            :     }
     231         [ #  # ]:          0 :     if ((nEscDir0&SDRESC_BOTTOM)!=0) {
     232         [ #  # ]:          0 :         long nEW=EscDirToAngle(SDRESC_BOTTOM);
     233                 :          0 :         nEW+=2*(nWink-nEW);
     234         [ #  # ]:          0 :         nEscDir1|=EscAngleToDir(nEW);
     235                 :            :     }
     236                 :          0 :     nEscDir=nEscDir1;
     237 [ #  # ][ #  # ]:          0 :     if (pObj!=NULL) SetAbsolutePos(aPt,*pObj); else SetPos(aPt);
     238                 :          0 : }
     239                 :            : 
     240                 :          0 : void SdrGluePoint::Shear(const Point& rRef, long /*nWink*/, double tn, bool bVShear, const SdrObject* pObj)
     241                 :            : {
     242 [ #  # ][ #  # ]:          0 :     Point aPt(pObj!=NULL ? GetAbsolutePos(*pObj) : GetPos());
     243                 :          0 :     ShearPoint(aPt,rRef,tn,bVShear);
     244 [ #  # ][ #  # ]:          0 :     if (pObj!=NULL) SetAbsolutePos(aPt,*pObj); else SetPos(aPt);
     245                 :          0 : }
     246                 :            : 
     247                 :          0 : void SdrGluePoint::Invalidate(Window& rWin, const SdrObject* pObj) const
     248                 :            : {
     249                 :          0 :     bool bMapMerk=rWin.IsMapModeEnabled();
     250 [ #  # ][ #  # ]:          0 :     Point aPt(pObj!=NULL ? GetAbsolutePos(*pObj) : GetPos());
     251         [ #  # ]:          0 :     aPt=rWin.LogicToPixel(aPt);
     252         [ #  # ]:          0 :     rWin.EnableMapMode(sal_False);
     253                 :            : 
     254                 :          0 :     Size aSiz( aGlueHalfSize );
     255                 :          0 :     Rectangle aRect(aPt.X()-aSiz.Width(),aPt.Y()-aSiz.Height(),
     256         [ #  # ]:          0 :                     aPt.X()+aSiz.Width(),aPt.Y()+aSiz.Height());
     257                 :            : 
     258                 :            :     // do not erase background, that causes flicker (!)
     259         [ #  # ]:          0 :     rWin.Invalidate(aRect, INVALIDATE_NOERASE);
     260                 :            : 
     261         [ #  # ]:          0 :     rWin.EnableMapMode(bMapMerk);
     262                 :          0 : }
     263                 :            : 
     264                 :          0 : bool SdrGluePoint::IsHit(const Point& rPnt, const OutputDevice& rOut, const SdrObject* pObj) const
     265                 :            : {
     266 [ #  # ][ #  # ]:          0 :     Point aPt(pObj!=NULL ? GetAbsolutePos(*pObj) : GetPos());
     267         [ #  # ]:          0 :     Size aSiz=rOut.PixelToLogic(aGlueHalfSize);
     268         [ #  # ]:          0 :     Rectangle aRect(aPt.X()-aSiz.Width(),aPt.Y()-aSiz.Height(),aPt.X()+aSiz.Width(),aPt.Y()+aSiz.Height());
     269         [ #  # ]:          0 :     return aRect.IsInside(rPnt);
     270                 :            : }
     271                 :            : 
     272                 :            : ////////////////////////////////////////////////////////////////////////////////////////////////////
     273                 :            : 
     274                 :          0 : void SdrGluePointList::Clear()
     275                 :            : {
     276                 :          0 :     sal_uInt16 nAnz=GetCount();
     277         [ #  # ]:          0 :     for (sal_uInt16 i=0; i<nAnz; i++) {
     278                 :          0 :         delete GetObject(i);
     279                 :            :     }
     280                 :          0 :     aList.clear();
     281                 :          0 : }
     282                 :            : 
     283                 :          0 : void SdrGluePointList::operator=(const SdrGluePointList& rSrcList)
     284                 :            : {
     285         [ #  # ]:          0 :     if (GetCount()!=0) Clear();
     286                 :          0 :     sal_uInt16 nAnz=rSrcList.GetCount();
     287         [ #  # ]:          0 :     for (sal_uInt16 i=0; i<nAnz; i++) {
     288                 :          0 :         Insert(rSrcList[i]);
     289                 :            :     }
     290                 :          0 : }
     291                 :            : 
     292                 :            : // The ID's of the glue points always increase monotonously!
     293                 :            : // If an ID is taken already, the new glue point gets a new ID. ID 0 is reserved.
     294                 :          0 : sal_uInt16 SdrGluePointList::Insert(const SdrGluePoint& rGP)
     295                 :            : {
     296         [ #  # ]:          0 :     SdrGluePoint* pGP=new SdrGluePoint(rGP);
     297                 :          0 :     sal_uInt16 nId=pGP->GetId();
     298                 :          0 :     sal_uInt16 nAnz=GetCount();
     299                 :          0 :     sal_uInt16 nInsPos=nAnz;
     300 [ #  # ][ #  # ]:          0 :     sal_uInt16 nLastId=nAnz!=0 ? GetObject(nAnz-1)->GetId() : 0;
     301                 :            :     DBG_ASSERT(nLastId>=nAnz,"SdrGluePointList::Insert(): nLastId<nAnz");
     302                 :          0 :     bool bHole = nLastId>nAnz;
     303         [ #  # ]:          0 :     if (nId<=nLastId) {
     304 [ #  # ][ #  # ]:          0 :         if (!bHole || nId==0) {
     305                 :          0 :             nId=nLastId+1;
     306                 :            :         } else {
     307                 :          0 :             bool bBrk = false;
     308 [ #  # ][ #  # ]:          0 :             for (sal_uInt16 nNum=0; nNum<nAnz && !bBrk; nNum++) {
                 [ #  # ]
     309         [ #  # ]:          0 :                 const SdrGluePoint* pGP2=GetObject(nNum);
     310                 :          0 :                 sal_uInt16 nTmpId=pGP2->GetId();
     311         [ #  # ]:          0 :                 if (nTmpId==nId) {
     312                 :          0 :                     nId=nLastId+1; // already in use
     313                 :          0 :                     bBrk = true;
     314                 :            :                 }
     315         [ #  # ]:          0 :                 if (nTmpId>nId) {
     316                 :          0 :                     nInsPos=nNum; // insert here (sort)
     317                 :          0 :                     bBrk = true;
     318                 :            :                 }
     319                 :            :             }
     320                 :            :         }
     321                 :          0 :         pGP->SetId(nId);
     322                 :            :     }
     323 [ #  # ][ #  # ]:          0 :     aList.insert(aList.begin()+nInsPos, pGP);
     324                 :          0 :     return nInsPos;
     325                 :            : }
     326                 :            : 
     327                 :          0 : void SdrGluePointList::Invalidate(Window& rWin, const SdrObject* pObj) const
     328                 :            : {
     329                 :          0 :     sal_uInt16 nAnz=GetCount();
     330         [ #  # ]:          0 :     for (sal_uInt16 nNum=0; nNum<nAnz; nNum++) {
     331                 :          0 :         GetObject(nNum)->Invalidate(rWin,pObj);
     332                 :            :     }
     333                 :          0 : }
     334                 :            : 
     335                 :          0 : sal_uInt16 SdrGluePointList::FindGluePoint(sal_uInt16 nId) const
     336                 :            : {
     337                 :            :     // TODO: Implement a better search algorithm
     338                 :            :     // List should be sorted at all times!
     339                 :          0 :     sal_uInt16 nAnz=GetCount();
     340                 :          0 :     sal_uInt16 nRet=SDRGLUEPOINT_NOTFOUND;
     341 [ #  # ][ #  # ]:          0 :     for (sal_uInt16 nNum=0; nNum<nAnz && nRet==SDRGLUEPOINT_NOTFOUND; nNum++) {
                 [ #  # ]
     342                 :          0 :         const SdrGluePoint* pGP=GetObject(nNum);
     343         [ #  # ]:          0 :         if (pGP->GetId()==nId) nRet=nNum;
     344                 :            :     }
     345                 :          0 :     return nRet;
     346                 :            : }
     347                 :            : 
     348                 :          0 : sal_uInt16 SdrGluePointList::HitTest(const Point& rPnt, const OutputDevice& rOut, const SdrObject* pObj, bool bBack, bool bNext, sal_uInt16 nId0) const
     349                 :            : {
     350                 :          0 :     sal_uInt16 nAnz=GetCount();
     351                 :          0 :     sal_uInt16 nRet=SDRGLUEPOINT_NOTFOUND;
     352         [ #  # ]:          0 :     sal_uInt16 nNum=bBack ? 0 : nAnz;
     353 [ #  # ][ #  # ]:          0 :     while ((bBack ? nNum<nAnz : nNum>0) && nRet==SDRGLUEPOINT_NOTFOUND) {
         [ #  # ][ #  # ]
                 [ #  # ]
     354         [ #  # ]:          0 :         if (!bBack) nNum--;
     355                 :          0 :         const SdrGluePoint* pGP=GetObject(nNum);
     356         [ #  # ]:          0 :         if (bNext) {
     357         [ #  # ]:          0 :             if (pGP->GetId()==nId0) bNext=sal_False;
     358                 :            :         } else {
     359         [ #  # ]:          0 :             if (pGP->IsHit(rPnt,rOut,pObj)) nRet=nNum;
     360                 :            :         }
     361         [ #  # ]:          0 :         if (bBack) nNum++;
     362                 :            :     }
     363                 :          0 :     return nRet;
     364                 :            : }
     365                 :            : 
     366                 :          0 : void SdrGluePointList::SetReallyAbsolute(bool bOn, const SdrObject& rObj)
     367                 :            : {
     368                 :          0 :     sal_uInt16 nAnz=GetCount();
     369         [ #  # ]:          0 :     for (sal_uInt16 nNum=0; nNum<nAnz; nNum++) {
     370                 :          0 :         GetObject(nNum)->SetReallyAbsolute(bOn,rObj);
     371                 :            :     }
     372                 :          0 : }
     373                 :            : 
     374                 :          0 : void SdrGluePointList::Rotate(const Point& rRef, long nWink, double sn, double cs, const SdrObject* pObj)
     375                 :            : {
     376                 :          0 :     sal_uInt16 nAnz=GetCount();
     377         [ #  # ]:          0 :     for (sal_uInt16 nNum=0; nNum<nAnz; nNum++) {
     378                 :          0 :         GetObject(nNum)->Rotate(rRef,nWink,sn,cs,pObj);
     379                 :            :     }
     380                 :          0 : }
     381                 :            : 
     382                 :          0 : void SdrGluePointList::Mirror(const Point& rRef1, const Point& rRef2, const SdrObject* pObj)
     383                 :            : {
     384                 :          0 :     Point aPt(rRef2); aPt-=rRef1;
     385         [ #  # ]:          0 :     long nWink=GetAngle(aPt);
     386         [ #  # ]:          0 :     Mirror(rRef1,rRef2,nWink,pObj);
     387                 :          0 : }
     388                 :            : 
     389                 :          0 : void SdrGluePointList::Mirror(const Point& rRef1, const Point& rRef2, long nWink, const SdrObject* pObj)
     390                 :            : {
     391                 :          0 :     sal_uInt16 nAnz=GetCount();
     392         [ #  # ]:          0 :     for (sal_uInt16 nNum=0; nNum<nAnz; nNum++) {
     393                 :          0 :         GetObject(nNum)->Mirror(rRef1,rRef2,nWink,pObj);
     394                 :            :     }
     395                 :          0 : }
     396                 :            : 
     397                 :          0 : void SdrGluePointList::Shear(const Point& rRef, long nWink, double tn, bool bVShear, const SdrObject* pObj)
     398                 :            : {
     399                 :          0 :     sal_uInt16 nAnz=GetCount();
     400         [ #  # ]:          0 :     for (sal_uInt16 nNum=0; nNum<nAnz; nNum++) {
     401                 :          0 :         GetObject(nNum)->Shear(rRef,nWink,tn,bVShear,pObj);
     402                 :            :     }
     403 [ +  - ][ +  - ]:        450 : }
     404                 :            : 
     405                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10