LCOV - code coverage report
Current view: top level - svx/source/svdraw - svdedtv.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 529 0.0 %
Date: 2014-04-14 Functions: 0 32 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             : #include <vcl/metaact.hxx>
      21             : #include <svx/svdedtv.hxx>
      22             : #include <svx/svdundo.hxx>
      23             : #include <svx/svdograf.hxx>
      24             : #include <svx/svdopath.hxx>
      25             : #include <svx/svdoole2.hxx>
      26             : #include <svx/svdopage.hxx>
      27             : #include <svx/svdoedge.hxx>
      28             : #include <svx/svdlayer.hxx>
      29             : #include <svx/svdpagv.hxx>
      30             : #include <svx/svdpage.hxx>
      31             : #include <svx/svdpoev.hxx>
      32             : #include "svx/svdstr.hrc"
      33             : #include "svx/svdglob.hxx"
      34             : #include <svx/e3dsceneupdater.hxx>
      35             : #include <rtl/strbuf.hxx>
      36             : #include <svx/svdview.hxx>
      37             : 
      38             : // #i13033#
      39             : #include <clonelist.hxx>
      40             : 
      41           0 : void SdrEditView::ImpResetPossibilityFlags()
      42             : {
      43           0 :     bReadOnly               =false;
      44             : 
      45           0 :     bGroupPossible          =false;
      46           0 :     bUnGroupPossible        =false;
      47           0 :     bGrpEnterPossible       =false;
      48           0 :     bDeletePossible         =false;
      49           0 :     bToTopPossible          =false;
      50           0 :     bToBtmPossible          =false;
      51           0 :     bReverseOrderPossible   =false;
      52             : 
      53           0 :     bImportMtfPossible      =false;
      54           0 :     bCombinePossible        =false;
      55           0 :     bDismantlePossible      =false;
      56           0 :     bCombineNoPolyPolyPossible =false;
      57           0 :     bDismantleMakeLinesPossible=false;
      58           0 :     bOrthoDesiredOnMarked   =false;
      59             : 
      60           0 :     bMoreThanOneNotMovable  =false;
      61           0 :     bOneOrMoreMovable       =false;
      62           0 :     bMoreThanOneNoMovRot    =false;
      63           0 :     bContortionPossible     =false;
      64           0 :     bAllPolys               =false;
      65           0 :     bOneOrMorePolys         =false;
      66           0 :     bMoveAllowed            =false;
      67           0 :     bResizeFreeAllowed      =false;
      68           0 :     bResizePropAllowed      =false;
      69           0 :     bRotateFreeAllowed      =false;
      70           0 :     bRotate90Allowed        =false;
      71           0 :     bMirrorFreeAllowed      =false;
      72           0 :     bMirror45Allowed        =false;
      73           0 :     bMirror90Allowed        =false;
      74           0 :     bTransparenceAllowed    =false;
      75           0 :     bGradientAllowed        =false;
      76           0 :     bShearAllowed           =false;
      77           0 :     bEdgeRadiusAllowed      =false;
      78           0 :     bCanConvToPath          =false;
      79           0 :     bCanConvToPoly          =false;
      80           0 :     bCanConvToContour       =false;
      81           0 :     bCanConvToPathLineToArea=false;
      82           0 :     bCanConvToPolyLineToArea=false;
      83           0 :     bMoveProtect            =false;
      84           0 :     bResizeProtect          =false;
      85           0 : }
      86             : 
      87           0 : void SdrEditView::ImpClearVars()
      88             : {
      89           0 :     ImpResetPossibilityFlags();
      90           0 :     bPossibilitiesDirty=true;   // << Purify didn't like this
      91           0 :     bBundleVirtObj=false;
      92           0 : }
      93             : 
      94           0 : SdrEditView::SdrEditView(SdrModel* pModel1, OutputDevice* pOut):
      95           0 :     SdrMarkView(pModel1,pOut)
      96             : {
      97           0 :     ImpClearVars();
      98           0 : }
      99             : 
     100           0 : SdrEditView::~SdrEditView()
     101             : {
     102           0 : }
     103             : 
     104             : 
     105             : 
     106           0 : SdrLayer* SdrEditView::InsertNewLayer(const OUString& rName, sal_uInt16 nPos)
     107             : {
     108           0 :     SdrLayerAdmin& rLA=pMod->GetLayerAdmin();
     109           0 :     sal_uInt16 nMax=rLA.GetLayerCount();
     110           0 :     if (nPos>nMax) nPos=nMax;
     111           0 :     SdrLayer* pNewLayer=rLA.NewLayer(rName,nPos);
     112             : 
     113           0 :     if( GetModel()->IsUndoEnabled() )
     114           0 :         AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewLayer(nPos,rLA,*pMod));
     115             : 
     116           0 :     pMod->SetChanged();
     117           0 :     return pNewLayer;
     118             : }
     119             : 
     120             : #include <svx/svdogrp.hxx>
     121             : #include <svx/scene3d.hxx>
     122             : 
     123           0 : bool SdrEditView::ImpDelLayerCheck(SdrObjList* pOL, SdrLayerID nDelID) const
     124             : {
     125           0 :     bool bDelAll(true);
     126           0 :     sal_uInt32 nObjAnz(pOL->GetObjCount());
     127             : 
     128           0 :     for(sal_uInt32 nObjNum(nObjAnz); nObjNum > 0 && bDelAll;)
     129             :     {
     130           0 :         nObjNum--;
     131           0 :         SdrObject* pObj = pOL->GetObj(nObjNum);
     132           0 :         SdrObjList* pSubOL = pObj->GetSubList();
     133             : 
     134             :         // explicitly test for group objects and 3d scenes
     135           0 :         if(pSubOL && (pObj->ISA(SdrObjGroup) || pObj->ISA(E3dScene)))
     136             :         {
     137           0 :             if(!ImpDelLayerCheck(pSubOL, nDelID))
     138             :             {
     139           0 :                 bDelAll = false;
     140             :             }
     141             :         }
     142             :         else
     143             :         {
     144           0 :             if(pObj->GetLayer() != nDelID)
     145             :             {
     146           0 :                 bDelAll = false;
     147             :             }
     148             :         }
     149             :     }
     150             : 
     151           0 :     return bDelAll;
     152             : }
     153             : 
     154           0 : void SdrEditView::ImpDelLayerDelObjs(SdrObjList* pOL, SdrLayerID nDelID)
     155             : {
     156           0 :     sal_uInt32 nObjAnz(pOL->GetObjCount());
     157             :     // make sure OrdNums are correct
     158           0 :     pOL->GetObj(0)->GetOrdNum();
     159             : 
     160           0 :     const bool bUndo = GetModel()->IsUndoEnabled();
     161             : 
     162           0 :     for(sal_uInt32 nObjNum(nObjAnz); nObjNum > 0;)
     163             :     {
     164           0 :         nObjNum--;
     165           0 :         SdrObject* pObj = pOL->GetObj(nObjNum);
     166           0 :         SdrObjList* pSubOL = pObj->GetSubList();
     167             : 
     168             : 
     169             :         // explicitly test for group objects and 3d scenes
     170           0 :         if(pSubOL && (pObj->ISA(SdrObjGroup) || pObj->ISA(E3dScene)))
     171             :         {
     172           0 :             if(ImpDelLayerCheck(pSubOL, nDelID))
     173             :             {
     174           0 :                 if( bUndo )
     175           0 :                     AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pObj, true));
     176           0 :                 pOL->RemoveObject(nObjNum);
     177             : 
     178           0 :                 if( !bUndo )
     179           0 :                     SdrObject::Free( pObj );
     180             :             }
     181             :             else
     182             :             {
     183           0 :                 ImpDelLayerDelObjs(pSubOL, nDelID);
     184             :             }
     185             :         }
     186             :         else
     187             :         {
     188           0 :             if(pObj->GetLayer() == nDelID)
     189             :             {
     190           0 :                 if( bUndo )
     191           0 :                     AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pObj, true));
     192           0 :                 pOL->RemoveObject(nObjNum);
     193           0 :                 if( !bUndo )
     194           0 :                     SdrObject::Free( pObj );
     195             :             }
     196             :         }
     197             :     }
     198           0 : }
     199             : 
     200           0 : void SdrEditView::DeleteLayer(const OUString& rName)
     201             : {
     202           0 :     SdrLayerAdmin& rLA = pMod->GetLayerAdmin();
     203           0 :     SdrLayer* pLayer = rLA.GetLayer(rName, true);
     204           0 :     sal_uInt16 nLayerNum(rLA.GetLayerPos(pLayer));
     205             : 
     206           0 :     if(SDRLAYER_NOTFOUND != nLayerNum)
     207             :     {
     208             : 
     209           0 :         SdrLayerID nDelID = pLayer->GetID();
     210             : 
     211           0 :         const bool bUndo = IsUndoEnabled();
     212           0 :         if( bUndo )
     213           0 :             BegUndo(ImpGetResStr(STR_UndoDelLayer));
     214             : 
     215           0 :         bool bMaPg(true);
     216             : 
     217           0 :         for(sal_uInt16 nPageKind(0); nPageKind < 2; nPageKind++)
     218             :         {
     219             :             // MasterPages and DrawPages
     220           0 :             sal_uInt16 nPgAnz(bMaPg ? pMod->GetMasterPageCount() : pMod->GetPageCount());
     221             : 
     222           0 :             for(sal_uInt16 nPgNum(0); nPgNum < nPgAnz; nPgNum++)
     223             :             {
     224             :                 // over all pages
     225           0 :                 SdrPage* pPage = (bMaPg) ? pMod->GetMasterPage(nPgNum) : pMod->GetPage(nPgNum);
     226           0 :                 sal_uInt32 nObjAnz(pPage->GetObjCount());
     227             : 
     228             :                 // make sure OrdNums are correct
     229           0 :                 if(nObjAnz)
     230           0 :                     pPage->GetObj(0)->GetOrdNum();
     231             : 
     232           0 :                 for(sal_uInt32 nObjNum(nObjAnz); nObjNum > 0;)
     233             :                 {
     234           0 :                     nObjNum--;
     235           0 :                     SdrObject* pObj = pPage->GetObj(nObjNum);
     236           0 :                     SdrObjList* pSubOL = pObj->GetSubList();
     237             : 
     238             :                     // explicitly test for group objects and 3d scenes
     239           0 :                     if(pSubOL && (pObj->ISA(SdrObjGroup) || pObj->ISA(E3dScene)))
     240             :                     {
     241           0 :                         if(ImpDelLayerCheck(pSubOL, nDelID))
     242             :                         {
     243           0 :                             if( bUndo )
     244           0 :                                 AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pObj, true));
     245           0 :                             pPage->RemoveObject(nObjNum);
     246           0 :                             if( !bUndo )
     247           0 :                                 SdrObject::Free(pObj);
     248             :                         }
     249             :                         else
     250             :                         {
     251           0 :                             ImpDelLayerDelObjs(pSubOL, nDelID);
     252             :                         }
     253             :                     }
     254             :                     else
     255             :                     {
     256           0 :                         if(pObj->GetLayer() == nDelID)
     257             :                         {
     258           0 :                             if( bUndo )
     259           0 :                                 AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pObj, true));
     260           0 :                             pPage->RemoveObject(nObjNum);
     261           0 :                             if( !bUndo )
     262           0 :                                 SdrObject::Free(pObj);
     263             :                         }
     264             :                     }
     265             :                 }
     266             :             }
     267           0 :             bMaPg = false;
     268             :         }
     269             : 
     270           0 :         if( bUndo )
     271             :         {
     272           0 :             AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoDeleteLayer(nLayerNum, rLA, *pMod));
     273           0 :             rLA.RemoveLayer(nLayerNum);
     274           0 :             EndUndo();
     275             :         }
     276             :         else
     277             :         {
     278           0 :             delete rLA.RemoveLayer(nLayerNum);
     279             :         }
     280             : 
     281           0 :         pMod->SetChanged();
     282             :     }
     283           0 : }
     284             : 
     285             : 
     286             : 
     287           0 : void SdrEditView::EndUndo()
     288             : {
     289             :     // #i13033#
     290             :     // Comparison changed to 1L since EndUndo() is called later now
     291             :     // and EndUndo WILL change count to count-1
     292           0 :     if(1L == pMod->GetUndoBracketLevel())
     293             :     {
     294           0 :         ImpBroadcastEdgesOfMarkedNodes();
     295             :     }
     296             : 
     297             :     // #i13033#
     298             :     // moved to bottom to still have access to UNDOs inside of
     299             :     // ImpBroadcastEdgesOfMarkedNodes()
     300           0 :     pMod->EndUndo();
     301           0 : }
     302             : 
     303           0 : void SdrEditView::ImpBroadcastEdgesOfMarkedNodes()
     304             : {
     305           0 :     std::vector<SdrObject*>::const_iterator iterPos;
     306           0 :     const std::vector<SdrObject*>& rAllMarkedObjects = GetTransitiveHullOfMarkedObjects();
     307             : 
     308             :     // #i13033#
     309             :     // New mechanism to search for necessary disconnections for
     310             :     // changed connectors inside the transitive hull of all at
     311             :     // the beginning of UNDO selected objects
     312           0 :     for(sal_uInt32 a(0L); a < rAllMarkedObjects.size(); a++)
     313             :     {
     314           0 :         SdrEdgeObj* pEdge = PTR_CAST(SdrEdgeObj, rAllMarkedObjects[a]);
     315             : 
     316           0 :         if(pEdge)
     317             :         {
     318           0 :             SdrObject* pObj1 = pEdge->GetConnectedNode(false);
     319           0 :             SdrObject* pObj2 = pEdge->GetConnectedNode(true);
     320             : 
     321           0 :             if(pObj1 && !pEdge->CheckNodeConnection(false))
     322             :             {
     323           0 :                 iterPos = std::find(rAllMarkedObjects.begin(),rAllMarkedObjects.end(),pObj1);
     324             : 
     325           0 :                 if (iterPos == rAllMarkedObjects.end())
     326             :                 {
     327           0 :                     if( IsUndoEnabled() )
     328           0 :                         AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pEdge));
     329           0 :                     pEdge->DisconnectFromNode(false);
     330             :                 }
     331             :             }
     332             : 
     333           0 :             if(pObj2 && !pEdge->CheckNodeConnection(true))
     334             :             {
     335           0 :                 iterPos = std::find(rAllMarkedObjects.begin(),rAllMarkedObjects.end(),pObj2);
     336             : 
     337           0 :                 if (iterPos == rAllMarkedObjects.end())
     338             :                 {
     339           0 :                     if( IsUndoEnabled() )
     340           0 :                         AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pEdge));
     341           0 :                     pEdge->DisconnectFromNode(true);
     342             :                 }
     343             :             }
     344             :         }
     345             :     }
     346             : 
     347           0 :     sal_uIntPtr nMarkedEdgeAnz = GetMarkedEdgesOfMarkedNodes().GetMarkCount();
     348             :     sal_uInt16 i;
     349             : 
     350           0 :     for (i=0; i<nMarkedEdgeAnz; i++) {
     351           0 :         SdrMark* pEM = GetMarkedEdgesOfMarkedNodes().GetMark(i);
     352           0 :         SdrObject* pEdgeTmp=pEM->GetMarkedSdrObj();
     353           0 :         SdrEdgeObj* pEdge=PTR_CAST(SdrEdgeObj,pEdgeTmp);
     354           0 :         if (pEdge!=NULL) {
     355           0 :             pEdge->SetEdgeTrackDirty();
     356             :         }
     357             :     }
     358           0 : }
     359             : 
     360             : 
     361             : // Possibilities
     362             : 
     363             : 
     364           0 : void SdrEditView::MarkListHasChanged()
     365             : {
     366           0 :     SdrMarkView::MarkListHasChanged();
     367           0 :     bPossibilitiesDirty=true;
     368           0 : }
     369             : 
     370           0 : void SdrEditView::ModelHasChanged()
     371             : {
     372           0 :     SdrMarkView::ModelHasChanged();
     373           0 :     bPossibilitiesDirty=true;
     374           0 : }
     375             : 
     376           0 : bool SdrEditView::IsResizeAllowed(bool bProp) const
     377             : {
     378           0 :     ForcePossibilities();
     379           0 :     if (bResizeProtect) return false;
     380           0 :     if (bProp) return bResizePropAllowed;
     381           0 :     return bResizeFreeAllowed;
     382             : }
     383             : 
     384           0 : bool SdrEditView::IsRotateAllowed(bool b90Deg) const
     385             : {
     386           0 :     ForcePossibilities();
     387           0 :     if (bMoveProtect) return false;
     388           0 :     if (b90Deg) return bRotate90Allowed;
     389           0 :     return bRotateFreeAllowed;
     390             : }
     391             : 
     392           0 : bool SdrEditView::IsMirrorAllowed(bool b45Deg, bool b90Deg) const
     393             : {
     394           0 :     ForcePossibilities();
     395           0 :     if (bMoveProtect) return false;
     396           0 :     if (b90Deg) return bMirror90Allowed;
     397           0 :     if (b45Deg) return bMirror45Allowed;
     398           0 :     return bMirrorFreeAllowed && !bMoveProtect;
     399             : }
     400             : 
     401           0 : bool SdrEditView::IsTransparenceAllowed() const
     402             : {
     403           0 :     ForcePossibilities();
     404           0 :     return bTransparenceAllowed;
     405             : }
     406             : 
     407           0 : bool SdrEditView::IsGradientAllowed() const
     408             : {
     409           0 :     ForcePossibilities();
     410           0 :     return bGradientAllowed;
     411             : }
     412             : 
     413           0 : bool SdrEditView::IsShearAllowed() const
     414             : {
     415           0 :     ForcePossibilities();
     416           0 :     if (bResizeProtect) return false;
     417           0 :     return bShearAllowed;
     418             : }
     419             : 
     420           0 : bool SdrEditView::IsEdgeRadiusAllowed() const
     421             : {
     422           0 :     ForcePossibilities();
     423           0 :     return bEdgeRadiusAllowed;
     424             : }
     425             : 
     426           0 : bool SdrEditView::IsCrookAllowed(bool bNoContortion) const
     427             : {
     428             :     // CrookMode missing here (no rotations allowed when shearing ...)
     429           0 :     ForcePossibilities();
     430           0 :     if (bNoContortion) {
     431           0 :         if (!bRotateFreeAllowed) return false;
     432           0 :         return !bMoveProtect && bMoveAllowed;
     433             :     } else {
     434           0 :         return !bResizeProtect && bContortionPossible;
     435             :     }
     436             : }
     437             : 
     438           0 : bool SdrEditView::IsDistortAllowed(bool bNoContortion) const
     439             : {
     440           0 :     ForcePossibilities();
     441           0 :     if (bNoContortion) {
     442           0 :         return false;
     443             :     } else {
     444           0 :         return !bResizeProtect && bContortionPossible;
     445             :     }
     446             : }
     447             : 
     448           0 : bool SdrEditView::IsCombinePossible(bool bNoPolyPoly) const
     449             : {
     450           0 :     ForcePossibilities();
     451           0 :     if (bNoPolyPoly) return bCombineNoPolyPolyPossible;
     452           0 :     else return bCombinePossible;
     453             : }
     454             : 
     455           0 : bool SdrEditView::IsDismantlePossible(bool bMakeLines) const
     456             : {
     457           0 :     ForcePossibilities();
     458           0 :     if (bMakeLines) return bDismantleMakeLinesPossible;
     459           0 :     else return bDismantlePossible;
     460             : }
     461             : 
     462           0 : void SdrEditView::CheckPossibilities()
     463             : {
     464           0 :     if (bSomeObjChgdFlag) bPossibilitiesDirty=true;
     465             : 
     466           0 :     if(bSomeObjChgdFlag)
     467             :     {
     468             :         // This call IS necessary to correct the MarkList, in which
     469             :         // no longer to the model belonging objects still can reside.
     470             :         // These ones need to be removed.
     471           0 :         CheckMarked();
     472             :     }
     473             : 
     474           0 :     if (bPossibilitiesDirty) {
     475           0 :         ImpResetPossibilityFlags();
     476           0 :         SortMarkedObjects();
     477           0 :         sal_uIntPtr nMarkAnz=GetMarkedObjectCount();
     478           0 :         if (nMarkAnz!=0) {
     479           0 :             bReverseOrderPossible=nMarkAnz>=2;
     480             : 
     481           0 :             sal_uIntPtr nMovableCount=0;
     482           0 :             bGroupPossible=nMarkAnz>=2;
     483           0 :             bCombinePossible=nMarkAnz>=2;
     484           0 :             if (nMarkAnz==1) {
     485             :                 // check bCombinePossible more thoroughly
     486             :                 // still missing ...
     487           0 :                 const SdrObject* pObj=GetMarkedObjectByIndex(0);
     488             :                 //const SdrPathObj* pPath=PTR_CAST(SdrPathObj,pObj);
     489           0 :                 bool bGroup=pObj->GetSubList()!=NULL;
     490           0 :                 bool bHasText=pObj->GetOutlinerParaObject()!=NULL;
     491           0 :                 if (bGroup || bHasText) {
     492           0 :                     bCombinePossible=true;
     493             :                 }
     494             :             }
     495           0 :             bCombineNoPolyPolyPossible=bCombinePossible;
     496           0 :             bDeletePossible=true;
     497             :             // accept transformations for now
     498           0 :             bMoveAllowed      =true;
     499           0 :             bResizeFreeAllowed=true;
     500           0 :             bResizePropAllowed=true;
     501           0 :             bRotateFreeAllowed=true;
     502           0 :             bRotate90Allowed  =true;
     503           0 :             bMirrorFreeAllowed=true;
     504           0 :             bMirror45Allowed  =true;
     505           0 :             bMirror90Allowed  =true;
     506           0 :             bShearAllowed     =true;
     507           0 :             bEdgeRadiusAllowed=false;
     508           0 :             bContortionPossible=true;
     509           0 :             bCanConvToContour = true;
     510             : 
     511             :             // these ones are only allowed when single object is selected
     512           0 :             bTransparenceAllowed = (nMarkAnz == 1);
     513           0 :             bGradientAllowed = (nMarkAnz == 1);
     514           0 :             if(bGradientAllowed)
     515             :             {
     516             :                 // gradient depends on fill style
     517           0 :                 const SdrMark* pM = GetSdrMarkByIndex(0);
     518           0 :                 const SdrObject* pObj = pM->GetMarkedSdrObj();
     519             : 
     520             :                 // may be group object, so get merged ItemSet
     521           0 :                 const SfxItemSet& rSet = pObj->GetMergedItemSet();
     522           0 :                 SfxItemState eState = rSet.GetItemState(XATTR_FILLSTYLE, false);
     523             : 
     524           0 :                 if(SFX_ITEM_DONTCARE != eState)
     525             :                 {
     526             :                     // If state is not DONTCARE, test the item
     527           0 :                     XFillStyle eFillStyle = ((XFillStyleItem&)(rSet.Get(XATTR_FILLSTYLE))).GetValue();
     528             : 
     529           0 :                     if(eFillStyle != XFILL_GRADIENT)
     530             :                     {
     531           0 :                         bGradientAllowed = false;
     532             :                     }
     533             :                 }
     534             :             }
     535             : 
     536           0 :             sal_Bool bNoMovRotFound=sal_False;
     537           0 :             const SdrPageView* pPV0=NULL;
     538             : 
     539           0 :             for (sal_uIntPtr nm=0; nm<nMarkAnz; nm++) {
     540           0 :                 const SdrMark* pM=GetSdrMarkByIndex(nm);
     541           0 :                 const SdrObject* pObj=pM->GetMarkedSdrObj();
     542           0 :                 const SdrPageView* pPV=pM->GetPageView();
     543           0 :                 if (pPV!=pPV0) {
     544           0 :                     if (pPV->IsReadOnly()) bReadOnly=true;
     545           0 :                     pPV0=pPV;
     546             :                 }
     547             : 
     548           0 :                 SdrObjTransformInfoRec aInfo;
     549           0 :                 pObj->TakeObjInfo(aInfo);
     550           0 :                 sal_Bool bMovPrt=pObj->IsMoveProtect();
     551           0 :                 sal_Bool bSizPrt=pObj->IsResizeProtect();
     552           0 :                 if (!bMovPrt && aInfo.bMoveAllowed) nMovableCount++; // count MovableObjs
     553           0 :                 if (bMovPrt) bMoveProtect=true;
     554           0 :                 if (bSizPrt) bResizeProtect=true;
     555             : 
     556             :                 // not allowed when not allowed at one object
     557           0 :                 if(!aInfo.bTransparenceAllowed)
     558           0 :                     bTransparenceAllowed = false;
     559             : 
     560             :                 // If one of these can't do something, none can
     561           0 :                 if (!aInfo.bMoveAllowed      ) bMoveAllowed      =false;
     562           0 :                 if (!aInfo.bResizeFreeAllowed) bResizeFreeAllowed=false;
     563           0 :                 if (!aInfo.bResizePropAllowed) bResizePropAllowed=false;
     564           0 :                 if (!aInfo.bRotateFreeAllowed) bRotateFreeAllowed=false;
     565           0 :                 if (!aInfo.bRotate90Allowed  ) bRotate90Allowed  =false;
     566           0 :                 if (!aInfo.bMirrorFreeAllowed) bMirrorFreeAllowed=false;
     567           0 :                 if (!aInfo.bMirror45Allowed  ) bMirror45Allowed  =false;
     568           0 :                 if (!aInfo.bMirror90Allowed  ) bMirror90Allowed  =false;
     569           0 :                 if (!aInfo.bShearAllowed     ) bShearAllowed     =false;
     570           0 :                 if (aInfo.bEdgeRadiusAllowed) bEdgeRadiusAllowed=true;
     571           0 :                 if (aInfo.bNoContortion      ) bContortionPossible=false;
     572             :                 // For Crook with Contortion: all objects have to be
     573             :                 // Movable and Rotatable, except for a maximum of 1 of them
     574           0 :                 if (!bMoreThanOneNoMovRot) {
     575           0 :                     if (!aInfo.bMoveAllowed || !aInfo.bResizeFreeAllowed) {
     576           0 :                         bMoreThanOneNoMovRot=bNoMovRotFound;
     577           0 :                         bNoMovRotFound=sal_True;
     578             :                     }
     579             :                 }
     580             : 
     581             :                 // if one member cannot be converted, no conversion is possible
     582           0 :                 if(!aInfo.bCanConvToContour)
     583           0 :                     bCanConvToContour = false;
     584             : 
     585             :                 // Ungroup
     586           0 :                 if (!bUnGroupPossible) bUnGroupPossible=pObj->GetSubList()!=NULL;
     587             :                 // ConvertToCurve: If at least one can be converted, that is fine.
     588           0 :                 if (aInfo.bCanConvToPath          ) bCanConvToPath          =true;
     589           0 :                 if (aInfo.bCanConvToPoly          ) bCanConvToPoly          =true;
     590           0 :                 if (aInfo.bCanConvToPathLineToArea) bCanConvToPathLineToArea=true;
     591           0 :                 if (aInfo.bCanConvToPolyLineToArea) bCanConvToPolyLineToArea=true;
     592             : 
     593             :                 // Combine/Dismantle
     594           0 :                 if(bCombinePossible)
     595             :                 {
     596           0 :                     bCombinePossible = ImpCanConvertForCombine(pObj);
     597           0 :                     bCombineNoPolyPolyPossible = bCombinePossible;
     598             :                 }
     599             : 
     600           0 :                 if (!bDismantlePossible) bDismantlePossible = ImpCanDismantle(pObj, false);
     601           0 :                 if (!bDismantleMakeLinesPossible) bDismantleMakeLinesPossible = ImpCanDismantle(pObj, true);
     602             :                 // check OrthoDesiredOnMarked
     603           0 :                 if (!bOrthoDesiredOnMarked && !aInfo.bNoOrthoDesired) bOrthoDesiredOnMarked=true;
     604             :                 // check ImportMtf
     605             : 
     606           0 :                 if (!bImportMtfPossible)
     607             :                 {
     608           0 :                     const SdrGrafObj* pSdrGrafObj = dynamic_cast< const SdrGrafObj* >(pObj);
     609           0 :                     const SdrOle2Obj* pSdrOle2Obj = dynamic_cast< const SdrOle2Obj* >(pObj);
     610             : 
     611           0 :                     if(pSdrGrafObj && ((pSdrGrafObj->HasGDIMetaFile() && !pSdrGrafObj->IsEPS()) || pSdrGrafObj->isEmbeddedSvg()))
     612             :                     {
     613           0 :                         bImportMtfPossible = true;
     614             :                     }
     615             : 
     616           0 :                     if(pSdrOle2Obj)
     617             :                     {
     618           0 :                         bImportMtfPossible = pSdrOle2Obj->GetObjRef().is();
     619             :                     }
     620             :                 }
     621             :             }
     622             : 
     623           0 :             bMoreThanOneNotMovable=nMovableCount<nMarkAnz-1;
     624           0 :             bOneOrMoreMovable=nMovableCount!=0;
     625           0 :             bGrpEnterPossible=bUnGroupPossible;
     626             :         }
     627           0 :         ImpCheckToTopBtmPossible();
     628           0 :         ((SdrPolyEditView*)this)->ImpCheckPolyPossibilities();
     629           0 :         bPossibilitiesDirty=false;
     630             : 
     631           0 :         if (bReadOnly) {
     632           0 :             sal_Bool bMerker1=bGrpEnterPossible;
     633           0 :             ImpResetPossibilityFlags();
     634           0 :             bReadOnly=true;
     635           0 :             bGrpEnterPossible=bMerker1;
     636             :         }
     637           0 :         if (bMoveAllowed) {
     638             :             // Don't allow moving glued connectors.
     639             :             // Currently only implemented for single selection.
     640           0 :             if (nMarkAnz==1) {
     641           0 :                 SdrObject* pObj=GetMarkedObjectByIndex(0);
     642           0 :                 SdrEdgeObj* pEdge=PTR_CAST(SdrEdgeObj,pObj);
     643           0 :                 if (pEdge!=NULL) {
     644           0 :                     SdrObject* pNode1=pEdge->GetConnectedNode(true);
     645           0 :                     SdrObject* pNode2=pEdge->GetConnectedNode(false);
     646           0 :                     if (pNode1!=NULL || pNode2!=NULL) bMoveAllowed=false;
     647             :                 }
     648             :             }
     649             :         }
     650             :     }
     651           0 : }
     652             : 
     653             : 
     654             : 
     655           0 : void SdrEditView::ForceMarkedObjToAnotherPage()
     656             : {
     657           0 :     bool bFlg=false;
     658           0 :     for (sal_uIntPtr nm=0; nm<GetMarkedObjectCount(); nm++) {
     659           0 :         SdrMark* pM=GetSdrMarkByIndex(nm);
     660           0 :         SdrObject* pObj=pM->GetMarkedSdrObj();
     661           0 :         Rectangle aObjRect(pObj->GetCurrentBoundRect());
     662           0 :         Rectangle aPgRect(pM->GetPageView()->GetPageRect());
     663           0 :         if (!aObjRect.IsOver(aPgRect)) {
     664           0 :             sal_Bool bFnd=sal_False;
     665           0 :             SdrPageView* pPV = GetSdrPageView();
     666             : 
     667           0 :             if(pPV)
     668             :             {
     669           0 :                 bFnd = aObjRect.IsOver(pPV->GetPageRect());
     670             :             }
     671             : 
     672           0 :             if(bFnd)
     673             :             {
     674           0 :                 pM->GetPageView()->GetObjList()->RemoveObject(pObj->GetOrdNum());
     675           0 :                 SdrInsertReason aReason(SDRREASON_VIEWCALL);
     676           0 :                 pPV->GetObjList()->InsertObject(pObj,CONTAINER_APPEND,&aReason);
     677           0 :                 pM->SetPageView(pPV);
     678           0 :                 InvalidateAllWin(aObjRect);
     679           0 :                 bFlg=true;
     680             :             }
     681             :         }
     682             :     }
     683           0 :     if (bFlg) {
     684           0 :         MarkListHasChanged();
     685             :     }
     686           0 : }
     687             : 
     688           0 : void SdrEditView::DeleteMarkedList(const SdrMarkList& rMark)
     689             : {
     690           0 :     if (rMark.GetMarkCount()!=0)
     691             :     {
     692           0 :         rMark.ForceSort();
     693             : 
     694           0 :         const bool bUndo = IsUndoEnabled();
     695           0 :         if( bUndo )
     696           0 :             BegUndo();
     697           0 :         const sal_uInt32 nMarkAnz(rMark.GetMarkCount());
     698             : 
     699           0 :         if(nMarkAnz)
     700             :         {
     701           0 :             sal_uInt32 nm(0);
     702           0 :             std::vector< E3DModifySceneSnapRectUpdater* > aUpdaters;
     703             : 
     704           0 :             if( bUndo )
     705             :             {
     706           0 :                 for(nm = nMarkAnz; nm > 0;)
     707             :                 {
     708           0 :                     nm--;
     709           0 :                     SdrMark* pM = rMark.GetMark(nm);
     710           0 :                     SdrObject* pObj = pM->GetMarkedSdrObj();
     711             : 
     712             :                     // extra undo actions for changed connector which now may hold its layed out path (SJ)
     713           0 :                     std::vector< SdrUndoAction* > vConnectorUndoActions( CreateConnectorUndo( *pObj ) );
     714           0 :                     AddUndoActions( vConnectorUndoActions );
     715             : 
     716           0 :                     AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pObj));
     717           0 :                 }
     718             :             }
     719             : 
     720             :             // make sure, OrderNums are correct:
     721           0 :             rMark.GetMark(0)->GetMarkedSdrObj()->GetOrdNum();
     722             : 
     723           0 :             std::vector< SdrObject* > aRemoved3DObjects;
     724             : 
     725           0 :             for(nm = nMarkAnz; nm > 0;)
     726             :             {
     727           0 :                 nm--;
     728           0 :                 SdrMark* pM = rMark.GetMark(nm);
     729           0 :                 SdrObject* pObj = pM->GetMarkedSdrObj();
     730           0 :                 SdrObjList*  pOL = pObj->GetObjList();
     731           0 :                 const sal_uInt32 nOrdNum(pObj->GetOrdNumDirect());
     732             : 
     733           0 :                 bool bIs3D = dynamic_cast< E3dObject* >(pObj);
     734             :                 // set up a scene updater if object is a 3d object
     735           0 :                 if(bIs3D)
     736             :                 {
     737           0 :                     aUpdaters.push_back(new E3DModifySceneSnapRectUpdater(pObj));
     738             :                 }
     739             : 
     740           0 :                 pOL->RemoveObject(nOrdNum);
     741             : 
     742           0 :                 if( !bUndo )
     743             :                 {
     744           0 :                     if( bIs3D )
     745           0 :                         aRemoved3DObjects.push_back( pObj ); // may be needed later
     746             :                     else
     747           0 :                         SdrObject::Free(pObj);
     748             :                 }
     749             :             }
     750             : 
     751             :             // fire scene updaters
     752           0 :             while(!aUpdaters.empty())
     753             :             {
     754           0 :                 delete aUpdaters.back();
     755           0 :                 aUpdaters.pop_back();
     756             :             }
     757             : 
     758           0 :             if( !bUndo )
     759             :             {
     760             :                 // now delete removed scene objects
     761           0 :                 while(!aRemoved3DObjects.empty())
     762             :                 {
     763           0 :                     SdrObject::Free( aRemoved3DObjects.back() );
     764           0 :                     aRemoved3DObjects.pop_back();
     765             :                 }
     766           0 :             }
     767             :         }
     768             : 
     769           0 :         if( bUndo )
     770           0 :             EndUndo();
     771             :     }
     772           0 : }
     773             : 
     774           0 : void SdrEditView::DeleteMarkedObj()
     775             : {
     776             :     // #i110981# return when nothing is to be done at all
     777           0 :     if(!GetMarkedObjectCount())
     778             :     {
     779           0 :         return;
     780             :     }
     781             : 
     782             :     // moved breaking action and undo start outside loop
     783           0 :     BrkAction();
     784           0 :     BegUndo(ImpGetResStr(STR_EditDelete),GetDescriptionOfMarkedObjects(),SDRREPFUNC_OBJ_DELETE);
     785             : 
     786             :     // remove as long as something is selected. This allows to schedule objects for
     787             :     // removal for a next run as needed
     788           0 :     while(GetMarkedObjectCount())
     789             :     {
     790             :         // vector to remember the parents which may be empty after object removal
     791           0 :         std::vector< SdrObject* > aParents;
     792             : 
     793             :         {
     794           0 :             const SdrMarkList& rMarkList = GetMarkedObjectList();
     795           0 :             const sal_uInt32 nCount(rMarkList.GetMarkCount());
     796           0 :             sal_uInt32 a(0);
     797             : 
     798           0 :             for(a = 0; a < nCount; a++)
     799             :             {
     800             :                 // in the first run, add all found parents, but only once
     801           0 :                 SdrMark* pMark = rMarkList.GetMark(a);
     802           0 :                 SdrObject* pObject = pMark->GetMarkedSdrObj();
     803           0 :                 SdrObject* pParent = pObject->GetObjList()->GetOwnerObj();
     804             : 
     805           0 :                 if(pParent)
     806             :                 {
     807           0 :                     if(!aParents.empty())
     808             :                     {
     809             :                         std::vector< SdrObject* >::iterator aFindResult =
     810           0 :                             std::find(aParents.begin(), aParents.end(), pParent);
     811             : 
     812           0 :                         if(aFindResult == aParents.end())
     813             :                         {
     814           0 :                             aParents.push_back(pParent);
     815             :                         }
     816             :                     }
     817             :                     else
     818             :                     {
     819           0 :                         aParents.push_back(pParent);
     820             :                     }
     821             :                 }
     822             :             }
     823             : 
     824           0 :             if(!aParents.empty())
     825             :             {
     826             :                 // in a 2nd run, remove all objects which may already be scheduled for
     827             :                 // removal. I am not sure if this can happen, but theoretically
     828             :                 // a to-be-removed object may already be the group/3DScene itself
     829           0 :                 for(a = 0; a < nCount; a++)
     830             :                 {
     831           0 :                     SdrMark* pMark = rMarkList.GetMark(a);
     832           0 :                     SdrObject* pObject = pMark->GetMarkedSdrObj();
     833             : 
     834             :                     std::vector< SdrObject* >::iterator aFindResult =
     835           0 :                         std::find(aParents.begin(), aParents.end(), pObject);
     836             : 
     837           0 :                     if(aFindResult != aParents.end())
     838             :                     {
     839           0 :                         aParents.erase(aFindResult);
     840             :                     }
     841             :                 }
     842             :             }
     843             :         }
     844             : 
     845             :         // original stuff: remove selected objects. Handle clear will
     846             :         // do something only once
     847           0 :         DeleteMarkedList(GetMarkedObjectList());
     848           0 :         GetMarkedObjectListWriteAccess().Clear();
     849           0 :         aHdl.Clear();
     850             : 
     851           0 :         while(aParents.size() && !GetMarkedObjectCount())
     852             :         {
     853             :             // iterate over remembered parents
     854           0 :             SdrObject* pParent = aParents.back();
     855           0 :             aParents.pop_back();
     856             : 
     857           0 :             if(pParent->GetSubList() && 0 == pParent->GetSubList()->GetObjCount())
     858             :             {
     859             :                 // we detected an empty parent, a candidate to leave group/3DScene
     860             :                 // if entered
     861           0 :                 if(GetSdrPageView()->GetAktGroup()
     862           0 :                     && GetSdrPageView()->GetAktGroup() == pParent)
     863             :                 {
     864           0 :                     GetSdrPageView()->LeaveOneGroup();
     865             :                 }
     866             : 
     867             :                 // schedule empty parent for removal
     868           0 :                 GetMarkedObjectListWriteAccess().InsertEntry(
     869           0 :                     SdrMark(pParent, GetSdrPageView()));
     870             :             }
     871             :         }
     872           0 :     }
     873             : 
     874             :     // end undo and change messaging moved at the end
     875           0 :     EndUndo();
     876           0 :     MarkListHasChanged();
     877             : }
     878             : 
     879           0 : void SdrEditView::CopyMarkedObj()
     880             : {
     881           0 :     SortMarkedObjects();
     882             : 
     883           0 :     SdrMarkList aSourceObjectsForCopy(GetMarkedObjectList());
     884             :     // The following loop is used instead of MarkList::Merge(), to be
     885             :     // able to flag the MarkEntries.
     886           0 :     sal_uIntPtr nEdgeAnz = GetEdgesOfMarkedNodes().GetMarkCount();
     887           0 :     for (sal_uIntPtr nEdgeNum=0; nEdgeNum<nEdgeAnz; nEdgeNum++) {
     888           0 :         SdrMark aM(*GetEdgesOfMarkedNodes().GetMark(nEdgeNum));
     889           0 :         aM.SetUser(1);
     890           0 :         aSourceObjectsForCopy.InsertEntry(aM);
     891           0 :     }
     892           0 :     aSourceObjectsForCopy.ForceSort();
     893             : 
     894             :     // #i13033#
     895             :     // New mechanism to re-create the connections of cloned connectors
     896           0 :     CloneList aCloneList;
     897             : 
     898           0 :     const bool bUndo = IsUndoEnabled();
     899             : 
     900           0 :     GetMarkedObjectListWriteAccess().Clear();
     901           0 :     sal_uIntPtr nCloneErrCnt=0;
     902           0 :     sal_uIntPtr nMarkAnz=aSourceObjectsForCopy.GetMarkCount();
     903             :     sal_uIntPtr nm;
     904           0 :     for (nm=0; nm<nMarkAnz; nm++) {
     905           0 :         SdrMark* pM=aSourceObjectsForCopy.GetMark(nm);
     906           0 :         SdrObject* pO=pM->GetMarkedSdrObj()->Clone();
     907           0 :         if (pO!=NULL) {
     908           0 :             SdrInsertReason aReason(SDRREASON_VIEWCALL);
     909           0 :             pM->GetPageView()->GetObjList()->InsertObject(pO,CONTAINER_APPEND,&aReason);
     910             : 
     911           0 :             if( bUndo )
     912           0 :                 AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoCopyObject(*pO));
     913             : 
     914           0 :             SdrMark aME(*pM);
     915           0 :             aME.SetMarkedSdrObj(pO);
     916           0 :             aCloneList.AddPair(pM->GetMarkedSdrObj(), pO);
     917             : 
     918           0 :             if (pM->GetUser()==0)
     919             :             {
     920             :                 // otherwise it is only an Edge we have to copy as well
     921           0 :                 GetMarkedObjectListWriteAccess().InsertEntry(aME);
     922           0 :             }
     923             :         } else {
     924           0 :             nCloneErrCnt++;
     925             :         }
     926             :     }
     927             : 
     928             :     // #i13033#
     929             :     // New mechanism to re-create the connections of cloned connectors
     930           0 :     aCloneList.CopyConnections();
     931             : 
     932             :     if(0L != nCloneErrCnt)
     933             :     {
     934             : #ifdef DBG_UTIL
     935             :         OStringBuffer aStr("SdrEditView::CopyMarkedObj(): Error when cloning ");
     936             : 
     937             :         if(nCloneErrCnt == 1)
     938             :         {
     939             :             aStr.append("a drawing object.");
     940             :         }
     941             :         else
     942             :         {
     943             :             aStr.append(static_cast<sal_Int32>(nCloneErrCnt));
     944             :             aStr.append(" drawing objects.");
     945             :         }
     946             : 
     947             :         aStr.append(" This object's/These objects's connections will not be copied.");
     948             :         OSL_FAIL(aStr.getStr());
     949             : #endif
     950             :     }
     951           0 :     MarkListHasChanged();
     952           0 : }
     953             : 
     954             : 
     955             : 
     956           0 : bool SdrEditView::InsertObjectAtView(SdrObject* pObj, SdrPageView& rPV, sal_uIntPtr nOptions)
     957             : {
     958           0 :     if ((nOptions & SDRINSERT_SETDEFLAYER)!=0) {
     959           0 :         SdrLayerID nLayer=rPV.GetPage()->GetLayerAdmin().GetLayerID(aAktLayer,true);
     960           0 :         if (nLayer==SDRLAYER_NOTFOUND) nLayer=0;
     961           0 :         if (rPV.GetLockedLayers().IsSet(nLayer) || !rPV.GetVisibleLayers().IsSet(nLayer)) {
     962           0 :             SdrObject::Free( pObj ); // Layer locked or invisible
     963           0 :             return false;
     964             :         }
     965           0 :         pObj->NbcSetLayer(nLayer);
     966             :     }
     967           0 :     if ((nOptions & SDRINSERT_SETDEFATTR)!=0) {
     968           0 :         if (pDefaultStyleSheet!=NULL) pObj->NbcSetStyleSheet(pDefaultStyleSheet, false);
     969           0 :         pObj->SetMergedItemSet(aDefaultAttr);
     970             :     }
     971           0 :     if (!pObj->IsInserted()) {
     972           0 :         SdrInsertReason aReason(SDRREASON_VIEWCALL);
     973           0 :         if ((nOptions & SDRINSERT_NOBROADCAST)!=0) {
     974           0 :             rPV.GetObjList()->NbcInsertObject(pObj,CONTAINER_APPEND,&aReason);
     975             :         } else {
     976           0 :             rPV.GetObjList()->InsertObject(pObj,CONTAINER_APPEND,&aReason);
     977             :         }
     978             :     }
     979           0 :     if( IsUndoEnabled() )
     980           0 :         AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pObj));
     981             : 
     982           0 :     if ((nOptions & SDRINSERT_DONTMARK)==0) {
     983           0 :         if ((nOptions & SDRINSERT_ADDMARK)==0) UnmarkAllObj();
     984           0 :         MarkObj(pObj,&rPV);
     985             :     }
     986           0 :     return true;
     987             : }
     988             : 
     989           0 : void SdrEditView::ReplaceObjectAtView(SdrObject* pOldObj, SdrPageView& rPV, SdrObject* pNewObj, bool bMark)
     990             : {
     991           0 :     if(IsTextEdit())
     992             :     {
     993             : #ifdef DBG_UTIL
     994             :         if(pOldObj && dynamic_cast< SdrTextObj* >(pOldObj) && static_cast< SdrTextObj* >(pOldObj)->IsTextEditActive())
     995             :         {
     996             :             OSL_ENSURE(false, "OldObject is in TextEdit mode, this has to be ended before replacing it usnig SdrEndTextEdit (!)");
     997             :         }
     998             : 
     999             :         if(pNewObj && dynamic_cast< SdrTextObj* >(pNewObj) && static_cast< SdrTextObj* >(pNewObj)->IsTextEditActive())
    1000             :         {
    1001             :             OSL_ENSURE(false, "NewObject is in TextEdit mode, this has to be ended before replacing it usnig SdrEndTextEdit (!)");
    1002             :         }
    1003             : #endif
    1004             : 
    1005             :         // #i123468# emergency repair situation, needs to cast up to a class derived from
    1006             :         // this one; (aw080 has a mechanism for that and the view hierarchy is secured to
    1007             :         // always be a SdrView)
    1008           0 :         SdrView *pSdrView = dynamic_cast<SdrView*>(this);
    1009           0 :         if (pSdrView)
    1010           0 :             pSdrView->SdrEndTextEdit();
    1011             :     }
    1012             : 
    1013           0 :     SdrObjList* pOL=pOldObj->GetObjList();
    1014           0 :     const bool bUndo = IsUndoEnabled();
    1015           0 :     if( bUndo  )
    1016           0 :         AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoReplaceObject(*pOldObj,*pNewObj));
    1017             : 
    1018           0 :     if( IsObjMarked( pOldObj ) )
    1019           0 :         MarkObj( pOldObj, &rPV, true /*unmark!*/ );
    1020             : 
    1021           0 :     pOL->ReplaceObject(pNewObj,pOldObj->GetOrdNum());
    1022             : 
    1023           0 :     if( !bUndo )
    1024           0 :         SdrObject::Free( pOldObj );
    1025             : 
    1026           0 :     if (bMark) MarkObj(pNewObj,&rPV);
    1027           0 : }
    1028             : 
    1029             : 
    1030             : 
    1031           0 : bool SdrEditView::IsUndoEnabled() const
    1032             : {
    1033           0 :     return pMod->IsUndoEnabled();
    1034             : }
    1035             : 
    1036             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10