Kaydet (Commit) 06467e24 authored tarafından Rüdiger Timm's avatar Rüdiger Timm

INTEGRATION: CWS impresstables2 (1.31.72); FILE MERGED

2008/01/01 18:37:13 cl 1.31.72.2: #i68103# working on tables
2007/12/16 17:59:09 cl 1.31.72.1: #i72702# working on table clipboard
üst 9bfb709d
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: svdxcgv.cxx,v $ * $RCSfile: svdxcgv.cxx,v $
* *
* $Revision: 1.31 $ * $Revision: 1.32 $
* *
* last change: $Author: hr $ $Date: 2007-06-27 19:13:35 $ * last change: $Author: rt $ $Date: 2008-03-12 09:57:56 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -332,6 +332,15 @@ BOOL SdrExchangeView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* ...@@ -332,6 +332,15 @@ BOOL SdrExchangeView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList*
{ {
const SdrModel* pSrcMod=&rMod; const SdrModel* pSrcMod=&rMod;
if (pSrcMod==pMod) return FALSE; // na so geht's ja nun nicht if (pSrcMod==pMod) return FALSE; // na so geht's ja nun nicht
BegUndo(ImpGetResStr(STR_ExchangePaste));
if( mxSelectionController.is() && mxSelectionController->PasteObjModel( rMod ) )
{
EndUndo();
return TRUE;
}
Point aPos(rPos); Point aPos(rPos);
ImpGetPasteObjList(aPos,pLst); ImpGetPasteObjList(aPos,pLst);
SdrPageView* pMarkPV=NULL; SdrPageView* pMarkPV=NULL;
...@@ -362,7 +371,6 @@ BOOL SdrExchangeView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList* ...@@ -362,7 +371,6 @@ BOOL SdrExchangeView::Paste(const SdrModel& rMod, const Point& rPos, SdrObjList*
} }
SdrObjList* pDstLst=pLst; SdrObjList* pDstLst=pLst;
USHORT nPg,nPgAnz=pSrcMod->GetPageCount(); USHORT nPg,nPgAnz=pSrcMod->GetPageCount();
BegUndo(ImpGetResStr(STR_ExchangePaste));
for (nPg=0; nPg<nPgAnz; nPg++) { for (nPg=0; nPg<nPgAnz; nPg++) {
const SdrPage* pSrcPg=pSrcMod->GetPage(nPg); const SdrPage* pSrcPg=pSrcMod->GetPage(nPg);
...@@ -755,92 +763,95 @@ SdrModel* SdrExchangeView::GetMarkedObjModel() const ...@@ -755,92 +763,95 @@ SdrModel* SdrExchangeView::GetMarkedObjModel() const
SdrPage* pNeuPag=pNeuMod->AllocPage(FALSE); SdrPage* pNeuPag=pNeuMod->AllocPage(FALSE);
pNeuMod->InsertPage(pNeuPag); pNeuMod->InsertPage(pNeuPag);
::std::vector< ::std::vector< SdrMark* > > aObjVectors( 2 ); if( !mxSelectionController.is() || !mxSelectionController->GetMarkedObjModel( pNeuPag ) )
::std::vector< SdrMark* >& rObjVector1 = aObjVectors[ 0 ];
::std::vector< SdrMark* >& rObjVector2 = aObjVectors[ 1 ];
const SdrLayerAdmin& rLayerAdmin = pMod->GetLayerAdmin();
const sal_uInt32 nControlLayerId = rLayerAdmin.GetLayerID( rLayerAdmin.GetControlLayerName(), FALSE );
sal_uInt32 n, nCount, nCloneErrCnt = 0;
for( n = 0, nCount = GetMarkedObjectCount(); n < nCount; n++ )
{ {
SdrMark* pMark = GetSdrMarkByIndex( n ); ::std::vector< ::std::vector< SdrMark* > > aObjVectors( 2 );
::std::vector< SdrMark* >& rObjVector1 = aObjVectors[ 0 ];
// paint objects on control layer on top of all otherobjects ::std::vector< SdrMark* >& rObjVector2 = aObjVectors[ 1 ];
if( nControlLayerId == pMark->GetMarkedSdrObj()->GetLayer() ) const SdrLayerAdmin& rLayerAdmin = pMod->GetLayerAdmin();
rObjVector2.push_back( pMark ); const sal_uInt32 nControlLayerId = rLayerAdmin.GetLayerID( rLayerAdmin.GetControlLayerName(), FALSE );
else sal_uInt32 n, nCount, nCloneErrCnt = 0;
rObjVector1.push_back( pMark );
} for( n = 0, nCount = GetMarkedObjectCount(); n < nCount; n++ )
{
SdrMark* pMark = GetSdrMarkByIndex( n );
// #i13033# // paint objects on control layer on top of all otherobjects
// New mechanism to re-create the connections of cloned connectors if( nControlLayerId == pMark->GetMarkedSdrObj()->GetLayer() )
CloneList aCloneList; rObjVector2.push_back( pMark );
else
rObjVector1.push_back( pMark );
}
for( n = 0, nCount = aObjVectors.size(); n < nCount; n++ ) // #i13033#
{ // New mechanism to re-create the connections of cloned connectors
::std::vector< SdrMark* >& rObjVector = aObjVectors[ n ]; CloneList aCloneList;
for( sal_uInt32 i = 0; i < rObjVector.size(); i++ ) for( n = 0, nCount = aObjVectors.size(); n < nCount; n++ )
{ {
const SdrMark* pMark = rObjVector[ i ]; ::std::vector< SdrMark* >& rObjVector = aObjVectors[ n ];
const SdrObject* pObj = pMark->GetMarkedSdrObj();
SdrObject* pNeuObj;
if( pObj->ISA( SdrPageObj ) ) for( sal_uInt32 i = 0; i < rObjVector.size(); i++ )
{ {
// convert SdrPageObj's to a graphic representation, because const SdrMark* pMark = rObjVector[ i ];
// virtual connection to referenced page gets lost in new model const SdrObject* pObj = pMark->GetMarkedSdrObj();
pNeuObj = new SdrGrafObj( GetObjGraphic( pMod, const_cast< SdrObject* >( pObj ) ), pObj->GetLogicRect() ); SdrObject* pNeuObj;
pNeuObj->SetPage( pNeuPag );
pNeuObj->SetModel( pNeuMod );
}
else
{
// #116235#
// pNeuObj = pObj->Clone( pNeuPag, pNeuMod );
pNeuObj = pObj->Clone();
pNeuObj->SetPage( pNeuPag );
pNeuObj->SetModel( pNeuMod );
}
if( pNeuObj ) if( pObj->ISA( SdrPageObj ) )
{ {
SdrInsertReason aReason(SDRREASON_VIEWCALL); // convert SdrPageObj's to a graphic representation, because
pNeuPag->InsertObject(pNeuObj,CONTAINER_APPEND,&aReason); // virtual connection to referenced page gets lost in new model
pNeuObj = new SdrGrafObj( GetObjGraphic( pMod, const_cast< SdrObject* >( pObj ) ), pObj->GetLogicRect() );
pNeuObj->SetPage( pNeuPag );
pNeuObj->SetModel( pNeuMod );
}
else
{
// #116235#
// pNeuObj = pObj->Clone( pNeuPag, pNeuMod );
pNeuObj = pObj->Clone();
pNeuObj->SetPage( pNeuPag );
pNeuObj->SetModel( pNeuMod );
}
// #i13033# if( pNeuObj )
aCloneList.AddPair(pObj, pNeuObj); {
SdrInsertReason aReason(SDRREASON_VIEWCALL);
pNeuPag->InsertObject(pNeuObj,CONTAINER_APPEND,&aReason);
// #i13033#
aCloneList.AddPair(pObj, pNeuObj);
}
else
nCloneErrCnt++;
} }
else
nCloneErrCnt++;
} }
}
// #i13033# // #i13033#
// New mechanism to re-create the connections of cloned connectors // New mechanism to re-create the connections of cloned connectors
aCloneList.CopyConnections(); aCloneList.CopyConnections();
if(0L != nCloneErrCnt) if(0L != nCloneErrCnt)
{ {
#ifdef DBG_UTIL #ifdef DBG_UTIL
ByteString aStr("SdrExchangeView::GetMarkedObjModel(): Fehler beim Clonen "); ByteString aStr("SdrExchangeView::GetMarkedObjModel(): Fehler beim Clonen ");
if(nCloneErrCnt == 1) if(nCloneErrCnt == 1)
{ {
aStr += "eines Zeichenobjekts."; aStr += "eines Zeichenobjekts.";
} }
else else
{ {
aStr += "von "; aStr += "von ";
aStr += ByteString::CreateFromInt32( nCloneErrCnt ); aStr += ByteString::CreateFromInt32( nCloneErrCnt );
aStr += " Zeichenobjekten."; aStr += " Zeichenobjekten.";
} }
aStr += " Objektverbindungen werden nicht mitkopiert."; aStr += " Objektverbindungen werden nicht mitkopiert.";
DBG_ERROR(aStr.GetBuffer()); DBG_ERROR(aStr.GetBuffer());
#endif #endif
}
} }
return pNeuMod; return pNeuMod;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment