Lines 213-219
Link Here
|
213 |
pUndoGroup( NULL ), |
213 |
pUndoGroup( NULL ), |
214 |
bRecording( sal_False ), |
214 |
bRecording( sal_False ), |
215 |
bAdjustEnabled( sal_True ), |
215 |
bAdjustEnabled( sal_True ), |
216 |
bHyphenatorSet( sal_False ) |
216 |
bHyphenatorSet( sal_False ), |
|
|
217 |
mbUndoAllowed( sal_True ) |
217 |
{ |
218 |
{ |
218 |
pGlobalDrawPersist = NULL; // nur einmal benutzen |
219 |
pGlobalDrawPersist = NULL; // nur einmal benutzen |
219 |
|
220 |
|
Lines 379-385
Link Here
|
379 |
ScDrawPage* pPage = (ScDrawPage*)AllocPage( sal_False ); |
380 |
ScDrawPage* pPage = (ScDrawPage*)AllocPage( sal_False ); |
380 |
InsertPage(pPage, static_cast<sal_uInt16>(nTab)); |
381 |
InsertPage(pPage, static_cast<sal_uInt16>(nTab)); |
381 |
if (bRecording) |
382 |
if (bRecording) |
382 |
AddCalcUndo(new SdrUndoNewPage(*pPage)); |
383 |
AddCalcUndo< SdrUndoNewPage >(*pPage); |
383 |
|
384 |
|
384 |
return sal_True; // inserted |
385 |
return sal_True; // inserted |
385 |
} |
386 |
} |
Lines 393-399
Link Here
|
393 |
if (bRecording) |
394 |
if (bRecording) |
394 |
{ |
395 |
{ |
395 |
SdrPage* pPage = GetPage(static_cast<sal_uInt16>(nTab)); |
396 |
SdrPage* pPage = GetPage(static_cast<sal_uInt16>(nTab)); |
396 |
AddCalcUndo(new SdrUndoDelPage(*pPage)); // Undo-Action wird Owner der Page |
397 |
AddCalcUndo< SdrUndoDelPage >(*pPage); // Undo-Action wird Owner der Page |
397 |
RemovePage( static_cast<sal_uInt16>(nTab) ); // nur austragen, nicht loeschen |
398 |
RemovePage( static_cast<sal_uInt16>(nTab) ); // nur austragen, nicht loeschen |
398 |
} |
399 |
} |
399 |
else |
400 |
else |
Lines 442-448
Link Here
|
442 |
pNewObject->NbcMove(Size(0,0)); |
443 |
pNewObject->NbcMove(Size(0,0)); |
443 |
pNewPage->InsertObject( pNewObject ); |
444 |
pNewPage->InsertObject( pNewObject ); |
444 |
if (bRecording) |
445 |
if (bRecording) |
445 |
AddCalcUndo( new SdrUndoInsertObj( *pNewObject ) ); |
446 |
AddCalcUndo< SdrUndoInsertObj >( *pNewObject ); |
446 |
} |
447 |
} |
447 |
|
448 |
|
448 |
pOldObject = aIter.Next(); |
449 |
pOldObject = aIter.Next(); |
Lines 495-501
Link Here
|
495 |
{ |
496 |
{ |
496 |
if ( pObj->ISA( SdrRectObj ) && pData->maStart.IsValid() && pData->maEnd.IsValid() ) |
497 |
if ( pObj->ISA( SdrRectObj ) && pData->maStart.IsValid() && pData->maEnd.IsValid() ) |
497 |
pData->maStart.PutInOrder( pData->maEnd ); |
498 |
pData->maStart.PutInOrder( pData->maEnd ); |
498 |
AddCalcUndo( new ScUndoObjData( pObj, aOldStt, aOldEnd, pData->maStart, pData->maEnd ) ); |
499 |
AddCalcUndo< ScUndoObjData >( pObj, aOldStt, aOldEnd, pData->maStart, pData->maEnd ); |
499 |
RecalcPos( pObj, *pData, bNegativePage, bUpdateNoteCaptionPos ); |
500 |
RecalcPos( pObj, *pData, bNegativePage, bUpdateNoteCaptionPos ); |
500 |
} |
501 |
} |
501 |
} |
502 |
} |
Lines 588-594
Link Here
|
588 |
if ( pObj->GetLogicRect() != aRect ) |
589 |
if ( pObj->GetLogicRect() != aRect ) |
589 |
{ |
590 |
{ |
590 |
if (bRecording) |
591 |
if (bRecording) |
591 |
AddCalcUndo( new SdrUndoGeoObj( *pObj ) ); |
592 |
AddCalcUndo<SdrUndoGeoObj>( *pObj ); |
592 |
pObj->SetLogicRect(aRect); |
593 |
pObj->SetLogicRect(aRect); |
593 |
} |
594 |
} |
594 |
} |
595 |
} |
Lines 613-619
Link Here
|
613 |
if ( pObj->GetPoint( 0 ) != aStartPos ) |
614 |
if ( pObj->GetPoint( 0 ) != aStartPos ) |
614 |
{ |
615 |
{ |
615 |
if (bRecording) |
616 |
if (bRecording) |
616 |
AddCalcUndo( new SdrUndoGeoObj( *pObj ) ); |
617 |
AddCalcUndo< SdrUndoGeoObj> ( *pObj ); |
617 |
pObj->SetPoint( aStartPos, 0 ); |
618 |
pObj->SetPoint( aStartPos, 0 ); |
618 |
} |
619 |
} |
619 |
|
620 |
|
Lines 627-633
Link Here
|
627 |
if ( pObj->GetPoint( 1 ) != aEndPos ) |
628 |
if ( pObj->GetPoint( 1 ) != aEndPos ) |
628 |
{ |
629 |
{ |
629 |
if (bRecording) |
630 |
if (bRecording) |
630 |
AddCalcUndo( new SdrUndoGeoObj( *pObj ) ); |
631 |
AddCalcUndo< SdrUndoGeoObj >( *pObj ); |
631 |
pObj->SetPoint( aEndPos, 1 ); |
632 |
pObj->SetPoint( aEndPos, 1 ); |
632 |
} |
633 |
} |
633 |
} |
634 |
} |
Lines 647-653
Link Here
|
647 |
if ( pObj->GetPoint( 1 ) != aEndPos ) |
648 |
if ( pObj->GetPoint( 1 ) != aEndPos ) |
648 |
{ |
649 |
{ |
649 |
if (bRecording) |
650 |
if (bRecording) |
650 |
AddCalcUndo( new SdrUndoGeoObj( *pObj ) ); |
651 |
AddCalcUndo< SdrUndoGeoObj> ( *pObj ); |
651 |
pObj->SetPoint( aEndPos, 1 ); |
652 |
pObj->SetPoint( aEndPos, 1 ); |
652 |
} |
653 |
} |
653 |
|
654 |
|
Lines 663-669
Link Here
|
663 |
if ( pObj->GetPoint( 0 ) != aStartPos ) |
664 |
if ( pObj->GetPoint( 0 ) != aStartPos ) |
664 |
{ |
665 |
{ |
665 |
if (bRecording) |
666 |
if (bRecording) |
666 |
AddCalcUndo( new SdrUndoGeoObj( *pObj ) ); |
667 |
AddCalcUndo< SdrUndoGeoObj >( *pObj ); |
667 |
pObj->SetPoint( aStartPos, 0 ); |
668 |
pObj->SetPoint( aStartPos, 0 ); |
668 |
} |
669 |
} |
669 |
} |
670 |
} |
Lines 688-694
Link Here
|
688 |
if ( pObj->GetLogicRect() != aNew ) |
689 |
if ( pObj->GetLogicRect() != aNew ) |
689 |
{ |
690 |
{ |
690 |
if (bRecording) |
691 |
if (bRecording) |
691 |
AddCalcUndo( new SdrUndoGeoObj( *pObj ) ); |
692 |
AddCalcUndo< SdrUndoGeoObj >( *pObj ); |
692 |
pObj->SetLogicRect(aNew); |
693 |
pObj->SetLogicRect(aNew); |
693 |
} |
694 |
} |
694 |
} |
695 |
} |
Lines 699-705
Link Here
|
699 |
if ( pObj->GetRelativePos() != aPos ) |
700 |
if ( pObj->GetRelativePos() != aPos ) |
700 |
{ |
701 |
{ |
701 |
if (bRecording) |
702 |
if (bRecording) |
702 |
AddCalcUndo( new SdrUndoGeoObj( *pObj ) ); |
703 |
AddCalcUndo< SdrUndoGeoObj >( *pObj ); |
703 |
pObj->SetRelativePos( aPos ); |
704 |
pObj->SetRelativePos( aPos ); |
704 |
} |
705 |
} |
705 |
} |
706 |
} |
Lines 948-954
Link Here
|
948 |
} |
949 |
} |
949 |
if( bMoved ) |
950 |
if( bMoved ) |
950 |
{ |
951 |
{ |
951 |
AddCalcUndo( new SdrUndoGeoObj( *pObject ) ); |
952 |
AddCalcUndo< SdrUndoGeoObj >( *pObject ); |
952 |
lcl_TwipsToMM( aPoint ); |
953 |
lcl_TwipsToMM( aPoint ); |
953 |
pObject->SetPoint( aPoint, i ); |
954 |
pObject->SetPoint( aPoint, i ); |
954 |
} |
955 |
} |
Lines 1002-1008
Link Here
|
1002 |
lcl_TwipsToMM( aNewPos ); |
1003 |
lcl_TwipsToMM( aNewPos ); |
1003 |
aMoveSize = Size( aNewPos.X() - aOldMMPos.X(), aNewPos.Y() - aOldMMPos.Y() ); // millimeters |
1004 |
aMoveSize = Size( aNewPos.X() - aOldMMPos.X(), aNewPos.Y() - aOldMMPos.Y() ); // millimeters |
1004 |
|
1005 |
|
1005 |
AddCalcUndo( new SdrUndoMoveObj( *pObject, aMoveSize ) ); |
1006 |
AddCalcUndo< SdrUndoMoveObj >( *pObject, aMoveSize ); |
1006 |
pObject->Move( aMoveSize ); |
1007 |
pObject->Move( aMoveSize ); |
1007 |
} |
1008 |
} |
1008 |
else if ( rArea.IsInside( bNegativePage ? aObjRect.BottomLeft() : aObjRect.BottomRight() ) && |
1009 |
else if ( rArea.IsInside( bNegativePage ? aObjRect.BottomLeft() : aObjRect.BottomRight() ) && |
Lines 1010-1016
Link Here
|
1010 |
{ |
1011 |
{ |
1011 |
// geschuetzte Groessen werden nicht veraendert |
1012 |
// geschuetzte Groessen werden nicht veraendert |
1012 |
// (Positionen schon, weil sie ja an der Zelle "verankert" sind) |
1013 |
// (Positionen schon, weil sie ja an der Zelle "verankert" sind) |
1013 |
AddCalcUndo( new SdrUndoGeoObj( *pObject ) ); |
1014 |
AddCalcUndo< SdrUndoGeoObj >( *pObject ); |
1014 |
long nOldSizeX = aObjRect.Right() - aObjRect.Left() + 1; |
1015 |
long nOldSizeX = aObjRect.Right() - aObjRect.Left() + 1; |
1015 |
long nOldSizeY = aObjRect.Bottom() - aObjRect.Top() + 1; |
1016 |
long nOldSizeY = aObjRect.Bottom() - aObjRect.Top() + 1; |
1016 |
long nLogMoveX = rMove.X() * ( bNegativePage ? -1 : 1 ); // logical direction |
1017 |
long nLogMoveX = rMove.X() * ( bNegativePage ? -1 : 1 ); // logical direction |
Lines 1235-1241
Link Here
|
1235 |
long i; |
1236 |
long i; |
1236 |
if (bRecording) |
1237 |
if (bRecording) |
1237 |
for (i=1; i<=nDelCount; i++) |
1238 |
for (i=1; i<=nDelCount; i++) |
1238 |
AddCalcUndo( new SdrUndoRemoveObj( *ppObj[nDelCount-i] ) ); |
1239 |
AddCalcUndo< SdrUndoRemoveObj >( *ppObj[nDelCount-i] ); |
1239 |
|
1240 |
|
1240 |
for (i=1; i<=nDelCount; i++) |
1241 |
for (i=1; i<=nDelCount; i++) |
1241 |
pPage->RemoveObject( ppObj[nDelCount-i]->GetOrdNum() ); |
1242 |
pPage->RemoveObject( ppObj[nDelCount-i]->GetOrdNum() ); |
Lines 1286-1292
Link Here
|
1286 |
long i; |
1287 |
long i; |
1287 |
if (bRecording) |
1288 |
if (bRecording) |
1288 |
for (i=1; i<=nDelCount; i++) |
1289 |
for (i=1; i<=nDelCount; i++) |
1289 |
AddCalcUndo( new SdrUndoRemoveObj( *ppObj[nDelCount-i] ) ); |
1290 |
AddCalcUndo< SdrUndoRemoveObj >( *ppObj[nDelCount-i] ); |
1290 |
|
1291 |
|
1291 |
for (i=1; i<=nDelCount; i++) |
1292 |
for (i=1; i<=nDelCount; i++) |
1292 |
pPage->RemoveObject( ppObj[nDelCount-i]->GetOrdNum() ); |
1293 |
pPage->RemoveObject( ppObj[nDelCount-i]->GetOrdNum() ); |
Lines 1351-1357
Link Here
|
1351 |
long i; |
1352 |
long i; |
1352 |
if (bRecording) |
1353 |
if (bRecording) |
1353 |
for (i=1; i<=nDelCount; i++) |
1354 |
for (i=1; i<=nDelCount; i++) |
1354 |
AddCalcUndo( new SdrUndoRemoveObj( *ppObj[nDelCount-i] ) ); |
1355 |
AddCalcUndo< SdrUndoRemoveObj >( *ppObj[nDelCount-i] ); |
1355 |
|
1356 |
|
1356 |
for (i=1; i<=nDelCount; i++) |
1357 |
for (i=1; i<=nDelCount; i++) |
1357 |
pPage->RemoveObject( ppObj[nDelCount-i]->GetOrdNum() ); |
1358 |
pPage->RemoveObject( ppObj[nDelCount-i]->GetOrdNum() ); |
Lines 1582-1588
Link Here
|
1582 |
|
1583 |
|
1583 |
pDestPage->InsertObject( pNewObject ); |
1584 |
pDestPage->InsertObject( pNewObject ); |
1584 |
if (bRecording) |
1585 |
if (bRecording) |
1585 |
AddCalcUndo( new SdrUndoInsertObj( *pNewObject ) ); |
1586 |
AddCalcUndo< SdrUndoInsertObj >( *pNewObject ); |
1586 |
|
1587 |
|
1587 |
//#i110034# handle chart data references (after InsertObject) |
1588 |
//#i110034# handle chart data references (after InsertObject) |
1588 |
|
1589 |
|
Lines 1692-1698
Link Here
|
1692 |
Point aRef1( 0, 0 ); |
1693 |
Point aRef1( 0, 0 ); |
1693 |
Point aRef2( 0, 1 ); |
1694 |
Point aRef2( 0, 1 ); |
1694 |
if (bRecording) |
1695 |
if (bRecording) |
1695 |
AddCalcUndo( new SdrUndoGeoObj( *pObj ) ); |
1696 |
AddCalcUndo< SdrUndoGeoObj >( *pObj ); |
1696 |
pObj->Mirror( aRef1, aRef2 ); |
1697 |
pObj->Mirror( aRef1, aRef2 ); |
1697 |
} |
1698 |
} |
1698 |
else |
1699 |
else |
Lines 1703-1709
Link Here
|
1703 |
Rectangle aObjRect = pObj->GetLogicRect(); |
1704 |
Rectangle aObjRect = pObj->GetLogicRect(); |
1704 |
Size aMoveSize( -(aObjRect.Left() + aObjRect.Right()), 0 ); |
1705 |
Size aMoveSize( -(aObjRect.Left() + aObjRect.Right()), 0 ); |
1705 |
if (bRecording) |
1706 |
if (bRecording) |
1706 |
AddCalcUndo( new SdrUndoMoveObj( *pObj, aMoveSize ) ); |
1707 |
AddCalcUndo< SdrUndoMoveObj >( *pObj, aMoveSize ); |
1707 |
pObj->Move( aMoveSize ); |
1708 |
pObj->Move( aMoveSize ); |
1708 |
} |
1709 |
} |
1709 |
} |
1710 |
} |