Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_sc / chgtrack.hxx
blob609973f56b6f813c46e21f6394a7794dbed09715
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: chgtrack.hxx,v $
10 * $Revision: 1.12 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SC_CHGTRACK_HXX
32 #define SC_CHGTRACK_HXX
35 #ifndef _DATETIME_HXX //autogen
36 #include <tools/datetime.hxx>
37 #endif
38 #ifndef _TOOLS_TABLE_HXX //autogen
39 #include <tools/table.hxx>
40 #endif
41 #ifndef _STACK_HXX //autogen
42 #include <tools/stack.hxx>
43 #endif
44 #ifndef _QUEUE_HXX //autogen
45 #include <tools/queue.hxx>
46 #endif
47 #ifndef _SVMEMPOOL_HXX //autogen
48 #include <tools/mempool.hxx>
49 #endif
50 #ifndef _SFXLSTNER_HXX //autogen
51 #include <bf_svtools/lstner.hxx>
52 #endif
54 #ifndef SC_BIGRANGE_HXX
55 #include "bigrange.hxx"
56 #endif
57 #ifndef SC_COLLECT_HXX
58 #include "collect.hxx"
59 #endif
61 #ifdef SC_CHGTRACK_CXX
62 // core/inc
63 #endif
64 /*N*/#include <tools/debug.hxx>
65 /*N*/
66 class SvStream;
67 /*N*/class Stack;
68 /*N*/
69 namespace binfilter {
71 class ScBaseCell;
72 class ScDocument;
75 enum ScChangeActionType
77 SC_CAT_NONE,
78 SC_CAT_INSERT_COLS,
79 SC_CAT_INSERT_ROWS,
80 SC_CAT_INSERT_TABS,
81 SC_CAT_DELETE_COLS,
82 SC_CAT_DELETE_ROWS,
83 SC_CAT_DELETE_TABS,
84 SC_CAT_MOVE,
85 SC_CAT_CONTENT,
86 SC_CAT_REJECT
90 enum ScChangeActionState
92 SC_CAS_VIRGIN,
93 SC_CAS_ACCEPTED,
94 SC_CAS_REJECTED
98 enum ScChangeActionClipMode
100 SC_CACM_NONE,
101 SC_CACM_CUT,
102 SC_CACM_COPY,
103 SC_CACM_PASTE
106 class ScMultipleReadHeader;
107 class ScMultipleWriteHeader;
109 // --- ScChangeActionLinkEntry ---------------------------------------------
111 // Fuegt sich selbst am Beginn einer Kette ein, bzw. vor einem anderen
112 // LinkEntry, on delete selbstaendiges ausklinken auch des gelinkten.
113 // ppPrev == &previous->pNext oder Adresse des Pointers auf Beginn der Kette,
114 // *ppPrev == this
116 class ScChangeAction;
118 class ScChangeActionLinkEntry
120 // not implemented, prevent usage
121 ScChangeActionLinkEntry(
122 const ScChangeActionLinkEntry& );
123 /*N*/ ScChangeActionLinkEntry& operator=( const ScChangeActionLinkEntry& );
125 protected:
127 ScChangeActionLinkEntry* pNext;
128 ScChangeActionLinkEntry** ppPrev;
129 ScChangeAction* pAction;
130 ScChangeActionLinkEntry* pLink;
132 public:
134 DECL_FIXEDMEMPOOL_NEWDEL( ScChangeActionLinkEntry )
136 ScChangeActionLinkEntry(
137 ScChangeActionLinkEntry** ppPrevP,
138 ScChangeAction* pActionP )
139 : ppPrev( ppPrevP ),
140 pNext( *ppPrevP ),
141 pAction( pActionP ),
142 pLink( NULL )
144 if ( pNext )
145 pNext->ppPrev = &pNext;
146 *ppPrevP = this;
149 virtual ~ScChangeActionLinkEntry()
151 ScChangeActionLinkEntry* p = pLink;
152 UnLink();
153 Remove();
154 if ( p )
155 delete p;
158 void SetLink( ScChangeActionLinkEntry* pLinkP )
160 UnLink();
161 if ( pLinkP )
163 pLink = pLinkP;
164 pLinkP->pLink = this;
168 void UnLink()
170 if ( pLink )
172 pLink->pLink = NULL;
173 pLink = NULL;
177 void Remove()
179 if ( ppPrev )
181 if ( *ppPrev = pNext )
182 pNext->ppPrev = ppPrev;
183 ppPrev = NULL; // not inserted
187 void Insert( ScChangeActionLinkEntry** ppPrevP )
189 if ( !ppPrev )
191 ppPrev = ppPrevP;
192 if ( pNext = *ppPrevP )
193 pNext->ppPrev = &pNext;
194 *ppPrevP = this;
198 const ScChangeActionLinkEntry* GetLink() const { return pLink; }
199 ScChangeActionLinkEntry* GetLink() { return pLink; }
200 const ScChangeActionLinkEntry* GetNext() const { return pNext; }
201 ScChangeActionLinkEntry* GetNext() { return pNext; }
202 const ScChangeAction* GetAction() const { return pAction; }
203 ScChangeAction* GetAction() { return pAction; }
206 // --- ScChangeActionCellListEntry -----------------------------------------
207 // this is only for the XML Export in the hxx
208 class ScChangeActionContent;
210 class ScChangeActionCellListEntry
212 friend class ScChangeAction;
213 friend class ScChangeActionDel;
214 friend class ScChangeActionMove;
215 friend class ScChangeTrack;
217 ScChangeActionCellListEntry* pNext;
218 ScChangeActionContent* pContent;
220 ScChangeActionCellListEntry(
221 ScChangeActionContent* pContentP,
222 ScChangeActionCellListEntry* pNextP )
223 : pContent( pContentP ),
224 pNext( pNextP )
227 public:
228 const ScChangeActionCellListEntry* GetNext() const { return pNext; } // this is only for the XML Export public
229 const ScChangeActionContent* GetContent() const { return pContent; } // this is only for the XML Export public
231 DECL_FIXEDMEMPOOL_NEWDEL( ScChangeActionCellListEntry )
234 // --- ScChangeAction -------------------------------------------------------
236 class ScChangeTrack;
237 class ScChangeActionIns;
238 class ScChangeActionDel;
239 class ScChangeActionContent;
241 class ScChangeAction
243 friend class ScChangeTrack;
244 friend class ScChangeActionIns;
245 friend class ScChangeActionDel;
246 friend class ScChangeActionMove;
247 friend class ScChangeActionContent;
248 /*N*/
249 /*N*/ // not implemented, prevent usage
250 /*N*/ ScChangeAction( const ScChangeAction& );
251 ScChangeAction& operator=( const ScChangeAction& );
252 /*N*/
253 protected:
255 ScBigRange aBigRange; // Ins/Del/MoveTo/ContentPos
256 DateTime aDateTime; //! UTC
257 String aUser; // wer war's
258 String aComment; // Benutzerkommentar
259 ScChangeAction* pNext; // naechster in Kette
260 ScChangeAction* pPrev; // vorheriger in Kette
261 ScChangeActionLinkEntry* pLinkAny; // irgendwelche Links
262 ScChangeActionLinkEntry* pLinkDeletedIn; // Zuordnung zu
263 // geloeschten oder
264 // druebergemoveten oder
265 // rejecteten Insert
266 // Bereichen
267 ScChangeActionLinkEntry* pLinkDeleted; // Links zu geloeschten
268 ScChangeActionLinkEntry* pLinkDependent; // Links zu abhaengigen
269 ULONG nAction;
270 ULONG nRejectAction;
271 ScChangeActionType eType;
272 ScChangeActionState eState;
275 ScChangeAction( ScChangeActionType,
276 const ScRange& );
278 // only to be used in the XML import
279 ScChangeAction( ScChangeActionType,
280 const ScBigRange&,
281 const ULONG nAction,
282 const ULONG nRejectAction,
283 const ScChangeActionState eState,
284 const DateTime& aDateTime,
285 const String& aUser,
286 const String& aComment );
287 /*N*/ // only to be used in the XML import
288 ScChangeAction( ScChangeActionType,
289 const ScBigRange&,
290 const ULONG nAction);
292 ScChangeAction( SvStream&,
293 ScMultipleReadHeader&, ScChangeTrack* );
294 virtual ~ScChangeAction();
295 /*N*/
296 /*N*/ static void StoreCell( ScBaseCell*, SvStream&,
297 /*N*/ ScMultipleWriteHeader& );
298 /*N*/ static ScBaseCell* LoadCell( SvStream&, ScMultipleReadHeader&,
299 /*N*/ ScDocument*, USHORT nVer );
300 /*N*/
301 /*N*/ static BOOL StoreLinkChain( ScChangeActionLinkEntry*,
302 /*N*/ SvStream& );
303 /*N*/ static BOOL LoadLinkChain( ScChangeAction*,
304 /*N*/ ScChangeActionLinkEntry**,
305 /*N*/ SvStream&, ScChangeTrack*,
306 /*N*/ BOOL bLinkDeleted );
307 /*N*/
308 /*N*/ static BOOL StoreCellList( ScChangeActionCellListEntry*,
309 /*N*/ SvStream& );
310 /*N*/ static BOOL LoadCellList( ScChangeAction* pOfAction,
311 /*N*/ ScChangeActionCellListEntry*&, SvStream&,
312 /*N*/ ScChangeTrack* );
313 /*N*/
314 /*N*/ String GetRefString( const ScBigRange&,
315 /*N*/ ScDocument*, BOOL bFlag3D = FALSE ) const;
316 /*N*/
317 /*N*/ void SetActionNumber( ULONG n ) { nAction = n; }
318 /*N*/ void SetRejectAction( ULONG n ) { nRejectAction = n; }
319 /*N*/ void SetUser( const String& r ) { aUser = r; }
320 /*N*/ void SetType( ScChangeActionType e ) { eType = e; }
321 /*N*/ void SetState( ScChangeActionState e ) { eState = e; }
322 /*N*/ void SetRejected();
323 /*N*/
324 ScBigRange& GetBigRange() { return aBigRange; }
325 /*N*/
326 /*N*/ ScChangeActionLinkEntry* AddLink( ScChangeAction* p,
327 /*N*/ ScChangeActionLinkEntry* pL )
328 /*N*/ {
329 /*N*/ ScChangeActionLinkEntry* pLnk =
330 /*N*/ new ScChangeActionLinkEntry(
331 /*N*/ &pLinkAny, p );
332 /*N*/ pLnk->SetLink( pL );
333 /*N*/ return pLnk;
334 /*N*/ }
335 /*N*/ void RemoveAllAnyLinks();
336 /*N*/
337 virtual ScChangeActionLinkEntry* GetDeletedIn() const
338 { return pLinkDeletedIn; }
339 /*N*/ virtual ScChangeActionLinkEntry** GetDeletedInAddress()
340 /*N*/ { return &pLinkDeletedIn; }
341 /*N*/ ScChangeActionLinkEntry* AddDeletedIn( ScChangeAction* p )
342 /*N*/ {
343 /*N*/ return new ScChangeActionLinkEntry(
344 /*N*/ GetDeletedInAddress(), p );
345 /*N*/ }
346 /*N*/ BOOL RemoveDeletedIn( const ScChangeAction* );
347 /*N*/ void RemoveAllDeletedIn();
348 /*N*/ void SetDeletedIn( ScChangeAction* );
349 /*N*/
350 /*N*/ ScChangeActionLinkEntry* AddDeleted( ScChangeAction* p )
351 /*N*/ {
352 /*N*/ return new ScChangeActionLinkEntry(
353 /*N*/ &pLinkDeleted, p );
354 /*N*/ }
355 /*N*/ void RemoveAllDeleted();
356 /*N*/
357 ScChangeActionLinkEntry* AddDependent( ScChangeAction* p )
359 return new ScChangeActionLinkEntry(
360 &pLinkDependent, p );
362 /*N*/ void RemoveAllDependent();
363 /*N*/
364 void RemoveAllLinks();
365 /*N*/
366 /*N*/ virtual void AddContent( ScChangeActionContent* ) = 0;
367 /*N*/ virtual void DeleteCellEntries() = 0;
368 /*N*/
369 /*N*/ virtual void UpdateReference( const ScChangeTrack*,
370 /*N*/ UpdateRefMode, const ScBigRange&,
371 /*N*/ INT32 nDx, INT32 nDy, INT32 nDz );
372 /*N*/
373 /*N*/ void Accept();
374 /*N*/ virtual BOOL Reject( ScDocument* ) = 0;
375 /*N*/ void RejectRestoreContents( ScChangeTrack*,
376 /*N*/ short nDx, short nDy );
377 /*N*/
378 /*N*/ // used in Reject() instead of IsRejectable()
379 /*N*/ BOOL IsInternalRejectable() const;
380 /*N*/
381 /*N*/ virtual BOOL Store( SvStream&, ScMultipleWriteHeader& ) const;
382 /*N*/ virtual BOOL StoreLinks( SvStream& ) const;
383 /*N*/ virtual BOOL LoadLinks( SvStream&, ScChangeTrack* );
384 /*N*/
385 public:
386 /*N*/
387 BOOL IsInsertType() const
389 return eType == SC_CAT_INSERT_COLS ||
390 eType == SC_CAT_INSERT_ROWS ||
391 eType == SC_CAT_INSERT_TABS;
393 BOOL IsDeleteType() const
395 return eType == SC_CAT_DELETE_COLS ||
396 eType == SC_CAT_DELETE_ROWS ||
397 eType == SC_CAT_DELETE_TABS;
399 /*N*/ BOOL IsVirgin() const
400 /*N*/ { return eState == SC_CAS_VIRGIN; }
401 BOOL IsAccepted() const
402 { return eState == SC_CAS_ACCEPTED; }
403 BOOL IsRejected() const
404 { return eState == SC_CAS_REJECTED; }
405 /*N*/
406 /*N*/ // Action rejects another Action
407 BOOL IsRejecting() const
408 { return nRejectAction != 0; }
409 /*N*/
410 /*N*/ // ob Action anfassbar ist
411 /*N*/ BOOL IsTouchable() const;
412 /*N*/
414 const ScBigRange& GetBigRange() const { return aBigRange; }
415 const DateTime& GetDateTimeUTC() const // UTC time
416 { return aDateTime; }
417 const String& GetUser() const { return aUser; }
418 const String& GetComment() const { return aComment; }
419 ScChangeActionType GetType() const { return eType; }
420 /*N*/ ScChangeActionState GetState() const { return eState; }
421 ULONG GetActionNumber() const { return nAction; }
422 ULONG GetRejectAction() const { return nRejectAction; }
423 /*N*/
424 ScChangeAction* GetNext() const { return pNext; }
425 /*N*/ ScChangeAction* GetPrev() const { return pPrev; }
426 /*N*/
427 BOOL IsDeletedIn() const
428 { return GetDeletedIn() != NULL; }
429 /*N*/ BOOL IsDeleted() const
430 /*N*/ { return IsDeleteType() || IsDeletedIn(); }
431 /*N*/ BOOL IsDeletedIn( const ScChangeAction* ) const;
432 /*N*/ BOOL IsDeletedInDelType( ScChangeActionType ) const;
433 /*N*/
434 const ScChangeActionLinkEntry* GetFirstDeletedEntry() const
435 { return pLinkDeleted; }
436 const ScChangeActionLinkEntry* GetFirstDependentEntry() const
437 { return pLinkDependent; }
438 BOOL HasDependent() const
439 { return pLinkDependent != NULL; }
440 BOOL HasDeleted() const
441 { return pLinkDeleted != NULL; }
442 /*N*/
443 /*N*/ // Description wird an String angehaengt.
444 /*N*/ // Mit bSplitRange wird bei Delete nur
445 /*N*/ // eine Spalte/Zeile beruecksichtigt (fuer
446 /*N*/ // Auflistung der einzelnen Eintraege).
447 /*N*/ virtual void GetDescription( String&, ScDocument*,
448 /*N*/ BOOL bSplitRange = FALSE ) const {}
449 /*N*/
450 /*N*/ virtual void GetRefString( String&, ScDocument*,
451 /*N*/ BOOL bFlag3D = FALSE ) const;
452 /*N*/
453 /*N*/ // fuer DocumentMerge altes Datum einer anderen
454 /*N*/ // Action setzen, mit GetDateTimeUTC geholt
455 /*N*/ void SetDateTimeUTC( const DateTime& rDT )
456 /*N*/ { aDateTime = rDT; }
457 /*N*/
458 /*N*/ // Benutzerkommentar setzen
459 /*N*/ void SetComment( const String& rStr )
460 /*N*/ { aComment = rStr; }
461 /*N*/
462 /*N*/ // only to be used in the XML import
463 void SetDeletedInThis( ULONG nActionNumber,
464 const ScChangeTrack* pTrack );
465 /*N*/ // only to be used in the XML import
466 void AddDependent( ULONG nActionNumber,
467 const ScChangeTrack* pTrack );
471 // --- ScChangeActionIns ----------------------------------------------------
473 class ScChangeActionIns : public ScChangeAction
475 friend class ScChangeTrack;
477 ScChangeActionIns( const ScRange& rRange );
478 ScChangeActionIns( SvStream&,
479 ScMultipleReadHeader&, ScChangeTrack* );
480 virtual ~ScChangeActionIns();
481 /*N*/
482 /*N*/ virtual void AddContent( ScChangeActionContent* ) {}
483 /*N*/ virtual void DeleteCellEntries() {}
484 /*N*/
485 /*N*/ virtual BOOL Reject( ScDocument* );
486 /*N*/
487 /*N*/ virtual BOOL Store( SvStream&, ScMultipleWriteHeader& ) const;
488 /*N*/
489 public:
490 ScChangeActionIns(const ULONG nActionNumber,
491 const ScChangeActionState eState,
492 const ULONG nRejectingNumber,
493 const ScBigRange& aBigRange,
494 const String& aUser,
495 const DateTime& aDateTime,
496 const String &sComment,
497 const ScChangeActionType eType); // only to use in the XML import
499 /*N*/ virtual void GetDescription( String&, ScDocument*,
500 /*N*/ BOOL bSplitRange = FALSE ) const;
504 // --- ScChangeActionDel ----------------------------------------------------
506 class ScChangeActionMove;
508 class ScChangeActionDelMoveEntry : public ScChangeActionLinkEntry
510 friend class ScChangeActionDel;
511 friend class ScChangeTrack;
513 short nCutOffFrom;
514 short nCutOffTo;
517 ScChangeActionDelMoveEntry(
518 ScChangeActionDelMoveEntry** ppPrev,
519 ScChangeActionMove* pMove,
520 short nFrom, short nTo )
521 : ScChangeActionLinkEntry(
522 (ScChangeActionLinkEntry**)
523 ppPrev,
524 (ScChangeAction*) pMove ),
525 nCutOffFrom( nFrom ),
526 nCutOffTo( nTo )
527 /*N*/ {};
529 /*N*/ ScChangeActionDelMoveEntry* GetNext()
530 /*N*/ {
531 /*N*/ return (ScChangeActionDelMoveEntry*)
532 /*N*/ ScChangeActionLinkEntry::GetNext();
533 /*N*/ }
534 /*N*/ ScChangeActionMove* GetMove()
535 /*N*/ {
536 /*N*/ return (ScChangeActionMove*)
537 /*N*/ ScChangeActionLinkEntry::GetAction();
538 /*N*/ }
539 /*N*/
540 public:
541 const ScChangeActionDelMoveEntry* GetNext() const
543 return (const ScChangeActionDelMoveEntry*)
544 ScChangeActionLinkEntry::GetNext();
546 /*N*/ const ScChangeActionMove* GetMove() const
547 /*N*/ {
548 /*N*/ return (const ScChangeActionMove*)
549 /*N*/ ScChangeActionLinkEntry::GetAction();
550 /*N*/ }
551 short GetCutOffFrom() const { return nCutOffFrom; }
552 short GetCutOffTo() const { return nCutOffTo; }
556 class ScChangeActionDel : public ScChangeAction
558 friend class ScChangeTrack;
559 /*N*/ friend class ScChangeAction;
561 ScChangeTrack* pTrack;
562 ScChangeActionCellListEntry* pFirstCell;
563 ScChangeActionIns* pCutOff; // abgeschnittener Insert
564 short nCutOff; // +: Start -: End
565 ScChangeActionDelMoveEntry* pLinkMove;
566 short nDx;
567 short nDy;
569 ScChangeActionDel( const ScRange& rRange,
570 short nDx, short nDy, ScChangeTrack* );
571 ScChangeActionDel( SvStream&,
572 ScMultipleReadHeader&, ScDocument*,
573 USHORT nVer, ScChangeTrack* );
574 /*N*/ virtual ~ScChangeActionDel();
575 /*N*/
576 ScChangeActionIns* GetCutOffInsert() { return pCutOff; }
577 /*N*/
578 /*N*/ virtual void AddContent( ScChangeActionContent* );
579 /*N*/ virtual void DeleteCellEntries();
580 /*N*/
581 /*N*/ void UndoCutOffMoves();
582 /*N*/ void UndoCutOffInsert();
583 /*N*/
584 /*N*/ virtual void UpdateReference( const ScChangeTrack*,
585 /*N*/ UpdateRefMode, const ScBigRange&,
586 /*N*/ INT32 nDx, INT32 nDy, INT32 nDz );
587 /*N*/
588 /*N*/ virtual BOOL Reject( ScDocument* );
589 /*N*/
590 /*N*/ virtual BOOL Store( SvStream&, ScMultipleWriteHeader& ) const;
591 /*N*/ virtual BOOL StoreLinks( SvStream& ) const;
592 /*N*/ virtual BOOL LoadLinks( SvStream&, ScChangeTrack* );
593 /*N*/
594 public:
595 ScChangeActionDel(const ULONG nActionNumber,
596 const ScChangeActionState eState,
597 const ULONG nRejectingNumber,
598 const ScBigRange& aBigRange,
599 const String& aUser,
600 const DateTime& aDateTime,
601 const String &sComment,
602 const ScChangeActionType eType,
603 const short nD,
604 ScChangeTrack* pTrack); // only to use in the XML import
605 // wich of nDx and nDy is set is depend on the type
607 // ob dieses das unterste einer Reihe (oder
608 // auch einzeln) ist
609 /*N*/ BOOL IsBaseDelete() const;
611 // ob dieses das oberste einer Reihe (oder
612 // auch einzeln) ist
613 /*N*/ BOOL IsTopDelete() const;
615 // ob dieses ein Teil einer Reihe ist
616 /*N*/ BOOL IsMultiDelete() const;
619 short GetDx() const { return nDx; }
620 short GetDy() const { return nDy; }
621 /*N*/ ScBigRange GetOverAllRange() const; // BigRange + (nDx, nDy)
623 /*N*/ const ScChangeActionCellListEntry* GetFirstCellEntry() const
624 /*N*/ { return pFirstCell; }
625 const ScChangeActionDelMoveEntry* GetFirstMoveEntry() const
626 { return pLinkMove; }
627 const ScChangeActionIns* GetCutOffInsert() const { return pCutOff; }
628 short GetCutOffCount() const { return nCutOff; }
629 /*N*/
630 /*N*/ virtual void GetDescription( String&, ScDocument*,
631 /*N*/ BOOL bSplitRange = FALSE ) const;
632 void SetCutOffInsert( ScChangeActionIns* p, short n )
633 { pCutOff = p; nCutOff = n; } // only to use in the XML import
634 /*N*/ // this should be protected, but for the XML import it is public
635 /*N*/ // only to use in the XML import
636 /*N*/ // this should be protected, but for the XML import it is public
637 ScChangeActionDelMoveEntry* AddCutOffMove( ScChangeActionMove* pMove,
638 short nFrom, short nTo )
640 return new ScChangeActionDelMoveEntry(
641 &pLinkMove, pMove, nFrom, nTo );
646 // --- ScChangeActionMove ---------------------------------------------------
648 class ScChangeActionMove : public ScChangeAction
650 friend class ScChangeTrack;
651 /*N*/ friend class ScChangeActionDel;
653 ScBigRange aFromRange;
654 ScChangeTrack* pTrack;
655 ScChangeActionCellListEntry* pFirstCell;
656 ULONG nStartLastCut; // fuer PasteCut Undo
657 ULONG nEndLastCut;
659 ScChangeActionMove( const ScRange& rFromRange,
660 const ScRange& rToRange,
661 ScChangeTrack* pTrackP )
662 : ScChangeAction( SC_CAT_MOVE, rToRange ),
663 aFromRange( rFromRange ),
664 pTrack( pTrackP ),
665 pFirstCell( NULL ),
666 nStartLastCut(0),
667 nEndLastCut(0)
668 /*N*/ {};
669 ScChangeActionMove( SvStream&,
670 ScMultipleReadHeader&, ScChangeTrack* );
671 /*N*/ virtual ~ScChangeActionMove();
673 /*N*/ virtual void AddContent( ScChangeActionContent* );
674 /*N*/ virtual void DeleteCellEntries();
675 /*N*/
676 ScBigRange& GetFromRange() { return aFromRange; }
677 /*N*/
678 /*N*/ void SetStartLastCut( ULONG nVal ) { nStartLastCut = nVal; }
679 /*N*/ ULONG GetStartLastCut() const { return nStartLastCut; }
680 /*N*/ void SetEndLastCut( ULONG nVal ) { nEndLastCut = nVal; }
681 /*N*/ ULONG GetEndLastCut() const { return nEndLastCut; }
682 /*N*/
683 /*N*/ virtual void UpdateReference( const ScChangeTrack*,
684 /*N*/ UpdateRefMode, const ScBigRange&,
685 /*N*/ INT32 nDx, INT32 nDy, INT32 nDz );
686 /*N*/
687 /*N*/ virtual BOOL Reject( ScDocument* );
688 /*N*/
689 /*N*/ virtual BOOL Store( SvStream&, ScMultipleWriteHeader& ) const;
690 /*N*/ virtual BOOL StoreLinks( SvStream& ) const;
691 /*N*/ virtual BOOL LoadLinks( SvStream&, ScChangeTrack* );
692 /*N*/
693 public:
694 ScChangeActionMove(const ULONG nActionNumber,
695 const ScChangeActionState eState,
696 const ULONG nRejectingNumber,
697 const ScBigRange& aToBigRange,
698 const String& aUser,
699 const DateTime& aDateTime,
700 const String &sComment,
701 const ScBigRange& aFromBigRange,
702 ScChangeTrack* pTrack); // only to use in the XML import
703 /*N*/ const ScChangeActionCellListEntry* GetFirstCellEntry() const
704 /*N*/ { return pFirstCell; } // only to use in the XML export
705 /*N*/
706 const ScBigRange& GetFromRange() const { return aFromRange; }
707 /*N*/ void GetDelta( INT32& nDx, INT32& nDy, INT32& nDz ) const;
708 /*N*/
709 /*N*/ virtual void GetDescription( String&, ScDocument*,
710 /*N*/ BOOL bSplitRange = FALSE ) const;
711 /*N*/
712 /*N*/ virtual void GetRefString( String&, ScDocument*,
713 /*N*/ BOOL bFlag3D = FALSE ) const;
717 // --- ScChangeActionContent ------------------------------------------------
719 enum ScChangeActionContentCellType
721 SC_CACCT_NONE = 0,
722 SC_CACCT_NORMAL,
723 SC_CACCT_MATORG,
724 SC_CACCT_MATREF
727 class ScChangeActionContent : public ScChangeAction
729 friend class ScChangeTrack;
731 String aOldValue;
732 String aNewValue;
733 ScBaseCell* pOldCell;
734 ScBaseCell* pNewCell;
735 ScChangeActionContent* pNextContent; // an gleicher Position
736 ScChangeActionContent* pPrevContent;
737 ScChangeActionContent* pNextInSlot; // in gleichem Slot
738 ScChangeActionContent** ppPrevInSlot;
740 ScChangeActionContent( SvStream&,
741 ScMultipleReadHeader&, ScDocument*,
742 USHORT nVer, ScChangeTrack* );
744 /*N*/ void InsertInSlot( ScChangeActionContent** pp )
745 /*N*/ {
746 /*N*/ if ( !ppPrevInSlot )
747 /*N*/ {
748 /*N*/ ppPrevInSlot = pp;
749 /*N*/ if ( pNextInSlot = *pp )
750 /*N*/ pNextInSlot->ppPrevInSlot = &pNextInSlot;
751 /*N*/ *pp = this;
752 /*N*/ }
753 /*N*/ }
754 /*N*/ void RemoveFromSlot()
755 /*N*/ {
756 /*N*/ if ( ppPrevInSlot )
757 /*N*/ {
758 /*N*/ if ( *ppPrevInSlot = pNextInSlot )
759 /*N*/ pNextInSlot->ppPrevInSlot = ppPrevInSlot;
760 /*N*/ ppPrevInSlot = NULL; // not inserted
761 /*N*/ }
762 /*N*/ }
763 /*N*/ ScChangeActionContent* GetNextInSlot() { return pNextInSlot; }
764 /*N*/
765 /*N*/ void ClearTrack();
766 /*N*/
767 /*N*/ static void SetValue( String& rStr, ScBaseCell*& pCell,
768 /*N*/ const ScAddress& rPos,
769 /*N*/ const ScBaseCell* pOrgCell,
770 /*N*/ const ScDocument* pFromDoc,
771 /*N*/ ScDocument* pToDoc );
772 /*N*/
773 /*N*/ static void SetValue( String& rStr, ScBaseCell*& pCell,
774 /*N*/ ULONG nFormat,
775 /*N*/ const ScBaseCell* pOrgCell,
776 /*N*/ const ScDocument* pFromDoc,
777 /*N*/ ScDocument* pToDoc );
778 /*N*/
779 /*N*/ static void SetCell( String& rStr, ScBaseCell* pCell,
780 /*N*/ ULONG nFormat, const ScDocument* pDoc );
781 /*N*/
782 /*N*/ static BOOL NeedsNumberFormat( const ScBaseCell* );
783 /*N*/
784 /*N*/ void GetValueString( String& rStr,
785 /*N*/ const String& rValue,
786 /*N*/ const ScBaseCell* pCell ) const;
787 /*N*/
788 /*N*/ void GetFormulaString( String& rStr,
789 /*N*/ const ScFormulaCell* pCell ) const;
790 /*N*/
791 /*N*/ virtual void AddContent( ScChangeActionContent* ) {}
792 /*N*/ virtual void DeleteCellEntries() {}
793 /*N*/
794 /*N*/ virtual void UpdateReference( const ScChangeTrack*,
795 /*N*/ UpdateRefMode, const ScBigRange&,
796 /*N*/ INT32 nDx, INT32 nDy, INT32 nDz );
797 /*N*/
798 /*N*/ virtual BOOL Reject( ScDocument* );
799 /*N*/
800 /*N*/ void PutValueToDoc( ScBaseCell*, const String&,
801 /*N*/ ScDocument*, short nDx, short nDy ) const;
802 /*N*/
803 /*N*/ virtual BOOL Store( SvStream&, ScMultipleWriteHeader& ) const;
804 /*N*/ virtual BOOL StoreLinks( SvStream& ) const;
805 /*N*/ virtual BOOL LoadLinks( SvStream&, ScChangeTrack* );
806 /*N*/
807 public:
809 DECL_FIXEDMEMPOOL_NEWDEL( ScChangeActionContent )
811 ScChangeActionContent( const ScRange& rRange )
812 : ScChangeAction( SC_CAT_CONTENT, rRange ),
813 pOldCell( NULL ),
814 pNewCell( NULL ),
815 pNextContent( NULL ),
816 pPrevContent( NULL ),
817 pNextInSlot( NULL ),
818 ppPrevInSlot( NULL )
819 /*N*/ {};
820 ScChangeActionContent(const ULONG nActionNumber,
821 const ScChangeActionState eState,
822 const ULONG nRejectingNumber,
823 const ScBigRange& aBigRange,
824 const String& aUser,
825 const DateTime& aDateTime,
826 const String &sComment,
827 ScBaseCell* pOldCell,
828 ScDocument* pDoc,
829 const String& sResult); // to use for XML Import
830 ScChangeActionContent(const ULONG nActionNumber,
831 ScBaseCell* pNewCell,
832 const ScBigRange& aBigRange,
833 ScDocument* pDoc); // to use for XML Import of Generated Actions
834 /*N*/ virtual ~ScChangeActionContent();
835 /*N*/
836 /*N*/ ScChangeActionContent* GetNextContent() const { return pNextContent; }
837 ScChangeActionContent* GetPrevContent() const { return pPrevContent; }
838 /*N*/ ScChangeActionContent* GetTopContent() const;
839 BOOL IsTopContent() const
840 { return pNextContent == NULL; }
841 /*N*/
842 /*N*/ virtual ScChangeActionLinkEntry* GetDeletedIn() const;
843 /*N*/ virtual ScChangeActionLinkEntry** GetDeletedInAddress();
844 /*N*/
845 /*N*/ void PutOldValueToDoc( ScDocument*,
846 /*N*/ short nDx, short nDy ) const;
847 /*N*/ void PutNewValueToDoc( ScDocument*,
848 /*N*/ short nDx, short nDy ) const;
849 /*N*/
850 /*N*/ void SetOldValue( const ScBaseCell*,
851 /*N*/ const ScDocument* pFromDoc,
852 /*N*/ ScDocument* pToDoc );
853 /*N*/ void SetNewValue( const ScBaseCell*, ScDocument* );
854 /*N*/
855 /*N*/ // Use this only in the XML import,
856 /*N*/ // takes ownership of cell.
857 void SetNewCell( ScBaseCell* pNewCell, ScDocument* pDoc );
858 /*N*/
859 /*N*/ // These functions should be protected but for
860 /*N*/ // the XML import they are public.
861 void SetNextContent( ScChangeActionContent* p )
862 { pNextContent = p; }
863 void SetPrevContent( ScChangeActionContent* p )
864 { pPrevContent = p; }
865 /*N*/
866 /*N*/ void GetOldString( String& ) const;
867 /*N*/ void GetNewString( String& ) const;
868 const ScBaseCell* GetOldCell() const { return pOldCell; }
869 const ScBaseCell* GetNewCell() const { return pNewCell; }
870 /*N*/ virtual void GetDescription( String&, ScDocument*,
871 /*N*/ BOOL bSplitRange = FALSE ) const;
872 /*N*/ virtual void GetRefString( String&, ScDocument*,
873 /*N*/ BOOL bFlag3D = FALSE ) const;
874 /*N*/
875 /*N*/ static ScChangeActionContentCellType GetContentCellType( const ScBaseCell* );
876 /*N*/
877 /*N*/ // NewCell
878 /*N*/ BOOL IsMatrixOrigin() const
879 /*N*/ {
880 /*N*/ return GetContentCellType( GetNewCell() )
881 /*N*/ == SC_CACCT_MATORG;
882 /*N*/ }
883 /*N*/ BOOL IsMatrixReference() const
884 /*N*/ {
885 /*N*/ return GetContentCellType( GetNewCell() )
886 /*N*/ == SC_CACCT_MATREF;
887 /*N*/ }
888 /*N*/ // OldCell
889 /*N*/ BOOL IsOldMatrixOrigin() const
890 /*N*/ {
891 /*N*/ return GetContentCellType( GetOldCell() )
892 /*N*/ == SC_CACCT_MATORG;
893 /*N*/ }
894 /*N*/ BOOL IsOldMatrixReference() const
895 /*N*/ {
896 /*N*/ return GetContentCellType( GetOldCell() )
897 /*N*/ == SC_CACCT_MATREF;
898 /*N*/ }
899 /*N*/
903 // --- ScChangeActionReject -------------------------------------------------
905 class ScChangeActionReject : public ScChangeAction
907 friend class ScChangeTrack;
908 /*N*/ friend class ScChangeActionContent;
910 ScChangeActionReject( ULONG nReject )
911 : ScChangeAction( SC_CAT_REJECT, ScRange() )
913 /*N*/ SetRejectAction( nReject );
914 /*N*/ SetState( SC_CAS_ACCEPTED );
916 ScChangeActionReject( SvStream&,
917 ScMultipleReadHeader&, ScChangeTrack* );
919 /*N*/ virtual void AddContent( ScChangeActionContent* ) {}
920 /*N*/ virtual void DeleteCellEntries() {}
921 /*N*/
922 /*N*/ virtual BOOL Reject( ScDocument* p ) { return FALSE; }
923 /*N*/
924 /*N*/ virtual BOOL Store( SvStream&, ScMultipleWriteHeader& ) const;
925 /*N*/
926 public:
927 ScChangeActionReject(const ULONG nActionNumber,
928 const ScChangeActionState eState,
929 const ULONG nRejectingNumber,
930 const ScBigRange& aBigRange,
931 const String& aUser,
932 const DateTime& aDateTime,
933 const String &sComment); // only to use in the XML import
937 // --- ScChangeTrack --------------------------------------------------------
939 enum ScChangeTrackMsgType
941 SC_CTM_NONE,
942 SC_CTM_APPEND, // Actions angehaengt
943 SC_CTM_REMOVE, // Actions weggenommen
944 SC_CTM_CHANGE, // Actions geaendert
945 SC_CTM_PARENT // war kein Parent und ist jetzt einer
948 struct ScChangeTrackMsgInfo
950 DECL_FIXEDMEMPOOL_NEWDEL( ScChangeTrackMsgInfo )
952 ScChangeTrackMsgType eMsgType;
953 ULONG nStartAction;
954 ULONG nEndAction;
957 // MsgQueue fuer Benachrichtigung via ModifiedLink
958 /*N*/ DECLARE_QUEUE( ScChangeTrackMsgQueue, ScChangeTrackMsgInfo* )
959 /*N*/ DECLARE_STACK( ScChangeTrackMsgStack, ScChangeTrackMsgInfo* )
961 enum ScChangeTrackMergeState
963 SC_CTMS_NONE,
964 SC_CTMS_PREPARE,
965 SC_CTMS_OWN,
966 SC_CTMS_OTHER
969 // zusaetzlich zu pFirst/pNext/pLast/pPrev eine Table, um schnell sowohl
970 // per ActionNumber als auch ueber Liste zugreifen zu koennen
971 /*N*/DECLARE_TABLE( ScChangeActionTable, ScChangeAction* )
973 // Intern generierte Actions beginnen bei diesem Wert (fast alle Bits gesetzt)
974 // und werden runtergezaehlt, um sich in einer Table wertemaessig nicht mit den
975 // "normalen" Actions in die Quere zu kommen.
976 #define SC_CHGTRACK_GENERATED_START ((UINT32) 0xfffffff0)
978 // SfxListener an der Applikation, um Aenderungen des Usernamens mitzubekommen
980 class ScChangeTrack : public SfxListener
982 /*N*/ friend void ScChangeAction::RejectRestoreContents( ScChangeTrack*, short, short );
983 /*N*/ friend BOOL ScChangeActionDel::Reject( ScDocument* pDoc );
984 /*N*/ friend void ScChangeActionDel::DeleteCellEntries();
985 /*N*/ friend void ScChangeActionMove::DeleteCellEntries();
986 /*N*/ friend BOOL ScChangeActionMove::Reject( ScDocument* pDoc );
988 static const USHORT nContentRowsPerSlot;
989 static const USHORT nContentSlots;
991 ::com::sun::star::uno::Sequence< sal_Int8 > aProtectPass;
992 ScChangeActionTable aTable;
993 ScChangeActionTable aGeneratedTable;
994 ScChangeActionTable aPasteCutTable;
995 /*N*/ ScChangeTrackMsgQueue aMsgQueue;
996 /*N*/ ScChangeTrackMsgStack aMsgStackTmp;
997 /*N*/ ScChangeTrackMsgStack aMsgStackFinal;
998 StrCollection aUserCollection;
999 String aUser;
1000 Link aModifiedLink;
1001 ScRange aInDeleteRange;
1002 DateTime aFixDateTime;
1003 ScChangeAction* pFirst;
1004 ScChangeAction* pLast;
1005 ScChangeActionContent* pFirstGeneratedDelContent;
1006 ScChangeActionContent** ppContentSlots;
1007 ScChangeActionMove* pLastCutMove;
1008 ScChangeActionLinkEntry* pLinkInsertCol;
1009 ScChangeActionLinkEntry* pLinkInsertRow;
1010 ScChangeActionLinkEntry* pLinkInsertTab;
1011 ScChangeActionLinkEntry* pLinkMove;
1012 ScChangeTrackMsgInfo* pBlockModifyMsg;
1013 ScDocument* pDoc;
1014 ULONG nActionMax;
1015 ULONG nGeneratedMin;
1016 ULONG nMarkLastSaved;
1017 ULONG nStartLastCut;
1018 ULONG nEndLastCut;
1019 ULONG nLastMerge;
1020 ScChangeTrackMergeState eMergeState;
1021 USHORT nLoadedFileFormatVersion;
1022 BOOL bLoadSave;
1023 BOOL bInDelete;
1024 BOOL bInDeleteUndo;
1025 BOOL bInDeleteTop;
1026 BOOL bInPasteCut;
1027 BOOL bUseFixDateTime;
1028 BOOL bTime100thSeconds;
1030 // not implemented, prevent usage
1031 /*N*/ ScChangeTrack( const ScChangeTrack& );
1032 ScChangeTrack& operator=( const ScChangeTrack& );
1034 #ifdef SC_CHGTRACK_CXX
1035 static USHORT InitContentRowsPerSlot();
1036 /*N*/
1037 /*N*/ virtual void Notify( SfxBroadcaster&, const SfxHint& );
1038 /*N*/ void Init();
1039 /*N*/ void DtorClear();
1040 /*N*/ void SetLoadSave( BOOL bVal ) { bLoadSave = bVal; }
1041 /*N*/ void SetInDeleteRange( const ScRange& rRange )
1042 /*N*/ { aInDeleteRange = rRange; }
1043 /*N*/ void SetInDelete( BOOL bVal )
1044 /*N*/ { bInDelete = bVal; }
1045 /*N*/ void SetInDeleteTop( BOOL bVal )
1046 /*N*/ { bInDeleteTop = bVal; }
1047 /*N*/ void SetInDeleteUndo( BOOL bVal )
1048 /*N*/ { bInDeleteUndo = bVal; }
1049 /*N*/ void SetInPasteCut( BOOL bVal )
1050 /*N*/ { bInPasteCut = bVal; }
1051 /*N*/ void SetMergeState( ScChangeTrackMergeState eState )
1052 /*N*/ { eMergeState = eState; }
1053 /*N*/ ScChangeTrackMergeState GetMergeState() const { return eMergeState; }
1054 /*N*/ void SetLastMerge( ULONG nVal ) { nLastMerge = nVal; }
1055 /*N*/ ULONG GetLastMerge() const { return nLastMerge; }
1056 /*N*/
1057 /*N*/ // ModifyMsg blockweise und nicht einzeln erzeugen
1058 /*N*/ void StartBlockModify( ScChangeTrackMsgType,
1059 /*N*/ ULONG nStartAction );
1060 /*N*/ void EndBlockModify( ULONG nEndAction );
1061 /*N*/
1062 /*N*/ void AddDependentWithNotify( ScChangeAction* pParent,
1063 /*N*/ ScChangeAction* pDependent );
1064 /*N*/
1065 /*N*/ void Dependencies( ScChangeAction* );
1066 /*N*/ void UpdateReference( ScChangeAction*, BOOL bUndo );
1067 /*N*/ void UpdateReference( ScChangeAction** ppFirstAction,
1068 /*N*/ ScChangeAction* pAct, BOOL bUndo );
1069 /*N*/ void Append( ScChangeAction* pAppend, ULONG nAction );
1070 /*N*/ void AppendDeleteRange( const ScRange&,
1071 /*N*/ ScDocument* pRefDoc, short nDz,
1072 /*N*/ ULONG nRejectingInsert );
1073 /*N*/ void AppendOneDeleteRange( const ScRange& rOrgRange,
1074 /*N*/ ScDocument* pRefDoc,
1075 /*N*/ short nDx, short nDy, short nDz,
1076 /*N*/ ULONG nRejectingInsert );
1077 /*N*/ void LookUpContents( const ScRange& rOrgRange,
1078 /*N*/ ScDocument* pRefDoc,
1079 /*N*/ short nDx, short nDy, short nDz );
1080 /*N*/ void Remove( ScChangeAction* );
1081 /*N*/ void MasterLinks( ScChangeAction* );
1082 /*N*/ // Content on top an Position
1083 /*N*/ ScChangeActionContent* SearchContentAt( const ScBigAddress&,
1084 /*N*/ ScChangeAction* pButNotThis ) const;
1085 /*N*/
1086 /*N*/ // das gleiche fuer generierte Del-Eintraege,
1087 /*N*/ // wobei der Content nicht in der angegebenen
1088 /*N*/ // Richtung geloescht sein darf
1089 /*N*/ void DeleteGeneratedDelContent(
1090 /*N*/ ScChangeActionContent* );
1091 /*N*/ ScChangeActionContent* GenerateDelContent( const ScAddress&,
1092 /*N*/ const ScBaseCell*,
1093 /*N*/ const ScDocument* pFromDoc );
1094 /*N*/ void DeleteCellEntries(
1095 /*N*/ ScChangeActionCellListEntry*&,
1096 /*N*/ ScChangeAction* pDeletor );
1097 /*N*/
1098 /*N*/ // Action und alle abhaengigen rejecten,
1099 /*N*/ // Table stammt aus vorherigem GetDependents,
1100 /*N*/ // ist nur bei Insert und Move (MasterType)
1101 /*N*/ // noetig, kann ansonsten NULL sein.
1102 /*N*/ // bRecursion == Aufruf aus Reject mit Table
1103 /*N*/ BOOL Reject( ScChangeAction*,
1104 /*N*/ ScChangeActionTable*, BOOL bRecursion );
1105 /*N*/
1106 #endif // SC_CHGTRACK_CXX
1107 /*N*/
1108 /*N*/ void ClearMsgQueue();
1109 /*N*/
1110 public:
1112 /*N*/ static USHORT ComputeContentSlot( INT32 nRow )
1113 /*N*/ {
1114 /*N*/ if ( nRow < 0 || nRow > MAXROW )
1115 /*N*/ return nContentSlots - 1;
1116 /*N*/ return nRow / nContentRowsPerSlot;
1117 /*N*/ }
1119 /*N*/ ScChangeTrack( ScDocument* );
1120 ScChangeTrack( ScDocument*,
1121 /*N*/ const StrCollection& ); // only to use in the XML import
1122 /*N*/ virtual ~ScChangeTrack();
1123 /*N*/ void Clear();
1124 /*N*/
1125 ScChangeActionContent* GetFirstGenerated() const { return pFirstGeneratedDelContent; }
1126 ScChangeAction* GetFirst() const { return pFirst; }
1127 ScChangeAction* GetLast() const { return pLast; }
1128 ULONG GetActionMax() const { return nActionMax; }
1129 BOOL IsGenerated( ULONG nAction ) const
1130 /*N*/ { return nAction >= nGeneratedMin;}
1131 ScChangeAction* GetAction( ULONG nAction ) const
1132 { return aTable.Get( nAction ); }
1133 /*N*/ ScChangeAction* GetGenerated( ULONG nGenerated ) const
1134 /*N*/ { return aGeneratedTable.Get( nGenerated ); }
1135 /*N*/ ScChangeAction* GetActionOrGenerated( ULONG nAction ) const
1136 /*N*/ {
1137 /*N*/ return IsGenerated( nAction ) ?
1138 /*N*/ GetGenerated( nAction ) :
1139 /*N*/ GetAction( nAction );
1140 /*N*/ }
1141 /*N*/ ULONG GetLastSavedActionNumber() const
1142 /*N*/ { return nMarkLastSaved; }
1143 void SetLastSavedActionNumber(ULONG nNew)
1144 { nMarkLastSaved = nNew; }
1145 /*N*/ ScChangeAction* GetLastSaved() const
1146 /*N*/ { return aTable.Get( nMarkLastSaved ); }
1147 /*N*/ ScChangeActionContent** GetContentSlots() const { return ppContentSlots; }
1148 /*N*/
1149 /*N*/ BOOL IsLoadSave() const { return bLoadSave; }
1150 /*N*/ const ScRange& GetInDeleteRange() const
1151 /*N*/ { return aInDeleteRange; }
1152 /*N*/ BOOL IsInDelete() const { return bInDelete; }
1153 /*N*/ BOOL IsInDeleteTop() const { return bInDeleteTop; }
1154 BOOL IsInDeleteUndo() const { return bInDeleteUndo; }
1155 /*N*/ BOOL IsInPasteCut() const { return bInPasteCut; }
1156 /*N*/ void SetUser( const String& );
1157 /*N*/ const String& GetUser() const { return aUser; }
1158 const StrCollection& GetUserCollection() const
1159 { return aUserCollection; }
1160 /*N*/ ScDocument* GetDocument() const { return pDoc; }
1161 /*N*/ // for import filter
1162 /*N*/ const DateTime& GetFixDateTime() const { return aFixDateTime; }
1163 /*N*/
1164 /*N*/ // set this if the date/time set with
1165 /*N*/ // SetFixDateTime...() shall be applied to
1166 /*N*/ // appended actions
1167 /*N*/ void SetUseFixDateTime( BOOL bVal )
1168 /*N*/ { bUseFixDateTime = bVal; }
1169 /*N*/ // for MergeDocument, apply original date/time as UTC
1170 /*N*/ void SetFixDateTimeUTC( const DateTime& rDT )
1171 /*N*/ { aFixDateTime = rDT; }
1172 /*N*/ // for import filter, apply original date/time as local time
1173 /*N*/ void SetFixDateTimeLocal( const DateTime& rDT )
1174 /*N*/ { aFixDateTime = rDT; aFixDateTime.ConvertToUTC(); }
1175 /*N*/
1176 /*N*/ void Append( ScChangeAction* );
1177 /*N*/
1178 /*N*/ // Cut to Clipboard
1179 /*N*/ void ResetLastCut()
1180 /*N*/ {
1181 /*N*/ nStartLastCut = nEndLastCut = 0;
1182 /*N*/ if ( pLastCutMove )
1183 /*N*/ {
1184 /*N*/ delete pLastCutMove;
1185 /*N*/ pLastCutMove = NULL;
1186 /*N*/ }
1187 /*N*/ }
1188 /*N*/ BOOL HasLastCut() const
1189 /*N*/ {
1190 /*N*/ return nEndLastCut > 0 &&
1191 /*N*/ nStartLastCut <= nEndLastCut &&
1192 /*N*/ pLastCutMove;
1193 /*N*/ }
1194 /*N*/
1195 /*N*/
1196 /*N*/ // wenn ModifiedLink gesetzt, landen
1197 /*N*/ // Aenderungen in ScChangeTrackMsgQueue
1198 /*N*/ void SetModifiedLink( const Link& r )
1199 /*N*/ { aModifiedLink = r; ClearMsgQueue(); }
1200 /*N*/ const Link& GetModifiedLink() const { return aModifiedLink; }
1201 /*N*/ ScChangeTrackMsgQueue& GetMsgQueue() { return aMsgQueue; }
1202 /*N*/
1203 /*N*/ void NotifyModified( ScChangeTrackMsgType eMsgType,
1204 /*N*/ ULONG nStartAction, ULONG nEndAction );
1205 /*N*/
1206 /*N*/ BOOL Load( SvStream& rStrm, USHORT nVer );
1207 /*N*/ BOOL Store( SvStream& rStrm );
1208 /*N*/ USHORT GetLoadedFileFormatVersion() const
1209 /*N*/ { return nLoadedFileFormatVersion; }
1210 /*N*/
1211 ULONG AddLoadedGenerated(ScBaseCell* pOldCell,
1212 const ScBigRange& aBigRange ); // only to use in the XML import
1213 void AppendLoaded( ScChangeAction* pAppend ); // this is only for the XML import public, it should be protected
1214 void SetActionMax(ULONG nTempActionMax)
1215 { nActionMax = nTempActionMax; } // only to use in the XML import
1216 /*N*/
1217 void SetProtection( const ::com::sun::star::uno::Sequence< sal_Int8 >& rPass )
1218 { aProtectPass = rPass; }
1219 ::com::sun::star::uno::Sequence< sal_Int8 > GetProtection() const
1220 { return aProtectPass; }
1221 BOOL IsProtected() const
1222 { return aProtectPass.getLength() != 0; }
1223 /*N*/
1224 /*N*/ // If time stamps of actions of this
1225 /*N*/ // ChangeTrack and a second one are to be
1226 /*N*/ // compared including 100th seconds.
1227 void SetTime100thSeconds( BOOL bVal )
1228 { bTime100thSeconds = bVal; }
1229 /*N*/ BOOL IsTime100thSeconds() const
1230 /*N*/ { return bTime100thSeconds; }
1234 } //namespace binfilter
1235 #endif