LibreOffice Module sc (master) 1
undocell.cxx
Go to the documentation of this file.
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 <undocell.hxx>
21
22#include <scitems.hxx>
23#include <editeng/editobj.hxx>
24#include <sfx2/app.hxx>
25#include <svx/svdocapt.hxx>
26#include <comphelper/lok.hxx>
27#include <osl/diagnose.h>
28
29#include <document.hxx>
30#include <docpool.hxx>
31#include <patattr.hxx>
32#include <docsh.hxx>
33#include <tabvwsh.hxx>
34#include <globstr.hrc>
35#include <scresid.hxx>
36#include <global.hxx>
37#include <formulacell.hxx>
38#include <target.hxx>
39#include <undoolk.hxx>
40#include <detdata.hxx>
41#include <stlpool.hxx>
42#include <printfun.hxx>
43#include <rangenam.hxx>
44#include <chgtrack.hxx>
45#include <stringutil.hxx>
46#include <utility>
47
48namespace HelperNotifyChanges
49{
50 static void NotifyIfChangesListeners(const ScDocShell& rDocShell, const ScAddress &rPos,
51 const ScUndoEnterData::ValuesType &rOldValues)
52 {
53 if (ScModelObj* pModelObj = getMustPropagateChangesModel(rDocShell))
54 {
55 ScRangeList aChangeRanges;
56
57 for (const auto & rOldValue : rOldValues)
58 {
59 aChangeRanges.push_back( ScRange(rPos.Col(), rPos.Row(), rOldValue.mnTab));
60 }
61
62 Notify(*pModelObj, aChangeRanges, "cell-change");
63 }
64 }
65}
66
67
69 SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab,
70 const ScPatternAttr* pOldPat, const ScPatternAttr* pNewPat,
71 const ScPatternAttr* pApplyPat ) :
72 ScSimpleUndo( pNewDocShell ),
73 nCol( nNewCol ),
74 nRow( nNewRow ),
75 nTab( nNewTab ),
76 pOldEditData( static_cast<EditTextObject*>(nullptr) ),
77 pNewEditData( static_cast<EditTextObject*>(nullptr) )
78{
80 pNewPattern = const_cast<ScPatternAttr*>( &pPool->Put( *pNewPat ) );
81 pOldPattern = const_cast<ScPatternAttr*>( &pPool->Put( *pOldPat ) );
82 pApplyPattern = const_cast<ScPatternAttr*>( &pPool->Put( *pApplyPat ) );
83}
84
86{
88 pPool->Remove(*pNewPattern);
89 pPool->Remove(*pOldPattern);
90 pPool->Remove(*pApplyPattern);
91}
92
94{
96 return ScResId( STR_UNDO_CURSORATTR ); // "Attribute"
97}
98
99void ScUndoCursorAttr::SetEditData( std::unique_ptr<EditTextObject> pOld, std::unique_ptr<EditTextObject> pNew )
100{
101 pOldEditData = std::move(pOld);
102 pNewEditData = std::move(pNew);
103}
104
105void ScUndoCursorAttr::DoChange( const ScPatternAttr* pWhichPattern, const std::unique_ptr<EditTextObject>& pEditData ) const
106{
108 ScAddress aPos(nCol, nRow, nTab);
109 rDoc.SetPattern( nCol, nRow, nTab, *pWhichPattern );
110
111 if (rDoc.GetCellType(aPos) == CELLTYPE_EDIT && pEditData)
112 rDoc.SetEditText(aPos, *pEditData, nullptr);
113
115 if (pViewShell)
116 {
117 pViewShell->SetTabNo( nTab );
118 pViewShell->MoveCursorAbs( nCol, nRow, SC_FOLLOW_JUMP, false, false );
119 pViewShell->AdjustBlockHeight();
120 }
121
122 const SfxItemSet& rApplySet = pApplyPattern->GetItemSet();
123 bool bPaintExt = ( rApplySet.GetItemState( ATTR_SHADOW ) != SfxItemState::DEFAULT ||
124 rApplySet.GetItemState( ATTR_CONDITIONAL ) != SfxItemState::DEFAULT );
125 bool bPaintRows = ( rApplySet.GetItemState( ATTR_HOR_JUSTIFY ) != SfxItemState::DEFAULT );
126
127 sal_uInt16 nFlags = SC_PF_TESTMERGE;
128 if (bPaintExt)
129 nFlags |= SC_PF_LINES;
130 if (bPaintRows)
131 nFlags |= SC_PF_WHOLEROWS;
133}
134
136{
137 BeginUndo();
139 EndUndo();
140}
141
143{
144 BeginRedo();
146 EndRedo();
147}
148
150{
151 if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
152 pViewTarget->GetViewShell()->ApplySelectionPattern( *pApplyPattern );
153}
154
156{
157 return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
158}
159
160ScUndoEnterData::Value::Value() : mnTab(-1), mbHasFormat(false), mnFormat(0) {}
161
163 ScDocShell* pNewDocShell, const ScAddress& rPos, ValuesType& rOldValues,
164 OUString aNewStr, std::unique_ptr<EditTextObject> pObj ) :
165 ScSimpleUndo( pNewDocShell ),
166 maNewString(std::move(aNewStr)),
167 mpNewEditData(std::move(pObj)),
169 maPos(rPos)
170{
171 maOldValues.swap(rOldValues);
172
174}
175
177{
178 return ScResId( STR_UNDO_ENTERDATA ); // "Input"
179}
180
182{
183 // only when needed (old or new Edit cell, or Attribute)?
184 bool bHeightChanged = false;
185 for (const auto & i : maOldValues)
186 {
187 if (pDocShell->AdjustRowHeight(maPos.Row(), maPos.Row(), i.mnTab))
188 bHeightChanged = true;
189 }
190
192 if (pViewShell)
193 {
194 if (comphelper::LibreOfficeKit::isActive() && bHeightChanged)
195 {
198 pViewShell, false /* bColumns */, true /* bRows */, true /* bSizes*/,
199 false /* bHidden */, false /* bFiltered */, false /* bGroups */, maPos.Tab());
200 }
201 pViewShell->SetTabNo(maPos.Tab());
202 pViewShell->MoveCursorAbs(maPos.Col(), maPos.Row(), SC_FOLLOW_JUMP, false, false);
203 }
204
206}
207
209{
211 if ( pChangeTrack )
212 {
213 mnEndChangeAction = pChangeTrack->GetActionMax() + 1;
214 ScAddress aPos(maPos);
215 for (const Value & rOldValue : maOldValues)
216 {
217 aPos.SetTab(rOldValue.mnTab);
218 sal_uLong nFormat = 0;
219 if (rOldValue.mbHasFormat)
220 nFormat = rOldValue.mnFormat;
221 pChangeTrack->AppendContent(aPos, rOldValue.maCell, nFormat);
222 }
223 if ( mnEndChangeAction > pChangeTrack->GetActionMax() )
224 mnEndChangeAction = 0; // nothing is appended
225 }
226 else
228}
229
231{
232 BeginUndo();
233
235 for (const Value & rVal : maOldValues)
236 {
237 ScCellValue aNewCell;
238 aNewCell.assign(rVal.maCell, rDoc, ScCloneFlags::StartListening);
239 ScAddress aPos = maPos;
240 aPos.SetTab(rVal.mnTab);
241 aNewCell.release(rDoc, aPos);
242
243 if (rVal.mbHasFormat)
244 rDoc.ApplyAttr(maPos.Col(), maPos.Row(), rVal.mnTab,
245 SfxUInt32Item(ATTR_VALUE_FORMAT, rVal.mnFormat));
246 else
247 {
248 auto pPattern = std::make_unique<ScPatternAttr>(*rDoc.GetPattern(maPos.Col(), maPos.Row(), rVal.mnTab));
249 pPattern->GetItemSet().ClearItem( ATTR_VALUE_FORMAT );
250 rDoc.SetPattern(maPos.Col(), maPos.Row(), rVal.mnTab, std::move(pPattern));
251 }
252 pDocShell->PostPaintCell(maPos.Col(), maPos.Row(), rVal.mnTab);
253 }
254
255 ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
256 size_t nCount = maOldValues.size();
257 if ( pChangeTrack && mnEndChangeAction >= sal::static_int_cast<sal_uLong>(nCount) )
258 pChangeTrack->Undo( mnEndChangeAction - nCount + 1, mnEndChangeAction );
259
260 DoChange();
261 EndUndo();
262
264}
265
267{
268 BeginRedo();
269
271 for (const Value & rOldValue : maOldValues)
272 {
273 SCTAB nTab = rOldValue.mnTab;
274 if (mpNewEditData)
275 {
276 ScAddress aPos = maPos;
277 aPos.SetTab(nTab);
278 // edit text will be cloned.
279 rDoc.SetEditText(aPos, *mpNewEditData, nullptr);
280 }
281 else
282 rDoc.SetString(maPos.Col(), maPos.Row(), nTab, maNewString);
283
285 }
286
288
289 DoChange();
290 EndRedo();
291
293}
294
296{
297 if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
298 {
299 OUString aTemp = maNewString;
300 pViewTarget->GetViewShell()->EnterDataAtCursor( aTemp );
301 }
302}
303
305{
306 return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
307}
308
310 ScDocShell* pNewDocShell, const ScAddress& rNewPos,
311 ScCellValue aUndoCell, double nVal ) :
312 ScSimpleUndo( pNewDocShell ),
313 aPos ( rNewPos ),
314 maOldCell(std::move(aUndoCell)),
315 nValue ( nVal )
316{
318}
319
321{
322}
323
325{
326 return ScResId( STR_UNDO_ENTERDATA ); // "Input"
327}
328
330{
332 ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
333 if ( pChangeTrack )
334 {
335 nEndChangeAction = pChangeTrack->GetActionMax() + 1;
336 pChangeTrack->AppendContent(aPos, maOldCell);
337 if ( nEndChangeAction > pChangeTrack->GetActionMax() )
338 nEndChangeAction = 0; // nothing is appended
339 }
340 else
342}
343
345{
346 BeginUndo();
347
349 ScCellValue aNewCell;
351 aNewCell.release(rDoc, aPos);
352
354
355 ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
356 if ( pChangeTrack )
357 pChangeTrack->Undo( nEndChangeAction, nEndChangeAction );
358
359 EndUndo();
360}
361
363{
364 BeginRedo();
365
367 rDoc.SetValue( aPos.Col(), aPos.Row(), aPos.Tab(), nValue );
369
371
372 EndRedo();
373}
374
376{
377 // makes no sense
378}
379
381{
382 return false;
383}
384
386 ScSimpleUndo(pDocSh), maPos(rPos), maOldValue(std::move(aOldVal)), maNewValue(std::move(aNewVal)), mnEndChangeAction(0)
387{
389}
390
392
394{
395 BeginUndo();
399
401 ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
402 if (pChangeTrack)
404
405 EndUndo();
406}
407
409{
410 BeginRedo();
415 EndRedo();
416}
417
419{
420 // Makes no sense.
421}
422
424{
425 return false;
426}
427
429{
430 return ScResId(STR_UNDO_ENTERDATA); // "Input"
431}
432
434{
436 ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
437 if (pChangeTrack)
438 {
439 mnEndChangeAction = pChangeTrack->GetActionMax() + 1;
440
441 pChangeTrack->AppendContent(maPos, maOldValue);
442
443 if (mnEndChangeAction > pChangeTrack->GetActionMax())
444 mnEndChangeAction = 0; // Nothing is appended
445 }
446 else
448}
449
451{
453
454 switch (rVal.getType())
455 {
456 case CELLTYPE_NONE:
457 // empty cell
458 rDoc.SetEmptyCell(maPos);
459 break;
460 case CELLTYPE_VALUE:
461 rDoc.SetValue(maPos, rVal.getDouble());
462 break;
463 case CELLTYPE_STRING:
464 {
465 ScSetStringParam aParam;
466 aParam.setTextInput();
467 // Undo only cell content, without setting any number format.
469 rDoc.SetString(maPos, rVal.getSharedString()->getString(), &aParam);
470 }
471 break;
472 case CELLTYPE_EDIT:
473 rDoc.SetEditText(maPos, rVal.getEditText()->Clone());
474 break;
475 case CELLTYPE_FORMULA:
476 rDoc.SetFormulaCell(maPos, rVal.getFormula()->Clone());
477 break;
478 default:
479 ;
480 }
481}
482
484{
486 if ( pViewShell )
487 {
488 pViewShell->SetTabNo( maPos.Tab() );
489 pViewShell->MoveCursorAbs( maPos.Col(), maPos.Row(), SC_FOLLOW_JUMP, false, false );
490 }
491}
492
494 SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab,
495 bool bNewColumn, bool bNewInsert ) :
496 ScSimpleUndo( pNewDocShell ),
497 nCol( nNewCol ),
498 nRow( nNewRow ),
499 nTab( nNewTab ),
500 bColumn( bNewColumn ),
501 bInsert( bNewInsert )
502{
503}
504
506{
507}
508
510{
511 //"Column break" | "Row break" "insert" | "delete"
512 return bColumn ?
513 ( bInsert ?
514 ScResId( STR_UNDO_INSCOLBREAK ) :
515 ScResId( STR_UNDO_DELCOLBREAK )
516 ) :
517 ( bInsert ?
518 ScResId( STR_UNDO_INSROWBREAK ) :
519 ScResId( STR_UNDO_DELROWBREAK )
520 );
521}
522
523void ScUndoPageBreak::DoChange( bool bInsertP ) const
524{
526
527 if (pViewShell)
528 {
529 pViewShell->SetTabNo( nTab );
530 pViewShell->MoveCursorAbs( nCol, nRow, SC_FOLLOW_JUMP, false, false );
531
532 if (bInsertP)
533 pViewShell->InsertPageBreak(bColumn, false);
534 else
535 pViewShell->DeletePageBreak(bColumn, false);
536
538 }
539}
540
542{
543 BeginUndo();
545 EndUndo();
546}
547
549{
550 BeginRedo();
552 EndRedo();
553}
554
556{
557 if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
558 {
559 ScTabViewShell& rViewShell = *pViewTarget->GetViewShell();
560
561 if (bInsert)
562 rViewShell.InsertPageBreak(bColumn);
563 else
564 rViewShell.DeletePageBreak(bColumn);
565 }
566}
567
569{
570 return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
571}
572
574 SCTAB nT, sal_uInt16 nOS, sal_uInt16 nOP, sal_uInt16 nNS, sal_uInt16 nNP ) :
575 ScSimpleUndo( pNewDocShell ),
576 nTab( nT ),
577 nOldScale( nOS ),
578 nOldPages( nOP ),
579 nNewScale( nNS ),
580 nNewPages( nNP )
581{
582}
583
585{
586}
587
589{
590 return ScResId( STR_UNDO_PRINTSCALE );
591}
592
594{
595 sal_uInt16 nScale = bUndo ? nOldScale : nNewScale;
596 sal_uInt16 nPages = bUndo ? nOldPages : nNewPages;
597
599 OUString aStyleName = rDoc.GetPageStyle( nTab );
600 ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
601 SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aStyleName, SfxStyleFamily::Page );
602 OSL_ENSURE( pStyleSheet, "PageStyle not found" );
603 if ( pStyleSheet )
604 {
605 SfxItemSet& rSet = pStyleSheet->GetItemSet();
608
609 ScPrintFunc aPrintFunc( pDocShell, pDocShell->GetPrinter(), nTab );
610 aPrintFunc.UpdatePages();
611 }
612}
613
615{
616 BeginUndo();
617 DoChange(true);
618 EndUndo();
619}
620
622{
623 BeginRedo();
624 DoChange(false);
625 EndRedo();
626}
627
629{
630 if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
631 {
632 ScTabViewShell& rViewShell = *pViewTarget->GetViewShell();
633 ScViewData& rViewData = rViewShell.GetViewData();
634 rViewData.GetDocShell()->SetPrintZoom( rViewData.GetTabNo(), nNewScale, nNewPages );
635 }
636}
637
639{
640 return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
641}
642
644 ScDocShell* pNewDocShell, SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab,
645 ScCellValue aOldText, ScCellValue aNewText ) :
646 ScSimpleUndo( pNewDocShell ),
647 nCol( nNewCol ),
648 nRow( nNewRow ),
649 nTab( nNewTab ),
650 maOldText(std::move(aOldText)),
651 maNewText(std::move(aNewText))
652{
654}
655
657
659{
660 return ScResId( STR_UNDO_THESAURUS ); // "Thesaurus"
661}
662
664{
666 if ( pChangeTrack )
667 {
668 nEndChangeAction = pChangeTrack->GetActionMax() + 1;
669 pChangeTrack->AppendContent(ScAddress(nCol, nRow, nTab), rOldCell);
670 if ( nEndChangeAction > pChangeTrack->GetActionMax() )
671 nEndChangeAction = 0; // nothing is appended
672 }
673 else
675}
676
677void ScUndoThesaurus::DoChange( bool bUndo, const ScCellValue& rText )
678{
680
682 if (pViewShell)
683 {
684 pViewShell->SetTabNo( nTab );
685 pViewShell->MoveCursorAbs( nCol, nRow, SC_FOLLOW_JUMP, false, false );
686 }
687
688 ScAddress aPos(nCol, nRow, nTab);
689 rText.commit(rDoc, aPos);
690 if (!bUndo)
692
694}
695
697{
698 BeginUndo();
699 DoChange(true, maOldText);
701 if ( pChangeTrack )
702 pChangeTrack->Undo( nEndChangeAction, nEndChangeAction );
703 EndUndo();
704}
705
707{
708 BeginRedo();
709 DoChange(false, maNewText);
710 EndRedo();
711}
712
714{
715 if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
716 pViewTarget->GetViewShell()->DoThesaurus();
717}
718
720{
721 return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
722}
723
724
726 const ScNoteData& rNoteData, bool bInsert, std::unique_ptr<SdrUndoAction> pDrawUndo ) :
727 ScSimpleUndo( &rDocShell ),
728 maPos( rPos ),
729 mpDrawUndo( std::move(pDrawUndo) )
730{
731 OSL_ENSURE( rNoteData.mxCaption, "ScUndoReplaceNote::ScUndoReplaceNote - missing note caption" );
732 if (bInsert)
733 {
734 maNewData = rNoteData;
735 }
736 else
737 {
738 maOldData = rNoteData;
739 }
740}
741
743 ScNoteData aOldData, ScNoteData aNewData, std::unique_ptr<SdrUndoAction> pDrawUndo ) :
744 ScSimpleUndo( &rDocShell ),
745 maPos( rPos ),
746 maOldData(std::move( aOldData )),
747 maNewData(std::move( aNewData )),
748 mpDrawUndo( std::move(pDrawUndo) )
749{
750 OSL_ENSURE( maOldData.mxCaption || maNewData.mxCaption, "ScUndoReplaceNote::ScUndoReplaceNote - missing note captions" );
751 OSL_ENSURE( !maOldData.mxInitData && !maNewData.mxInitData, "ScUndoReplaceNote::ScUndoReplaceNote - unexpected uninitialized note" );
752}
753
755{
756 mpDrawUndo.reset();
757}
758
760{
761 BeginUndo();
763 /* Undo insert -> remove new note.
764 Undo remove -> insert old note.
765 Undo replace -> remove new note, insert old note. */
769 EndUndo();
770}
771
773{
774 BeginRedo();
776 /* Redo insert -> insert new note.
777 Redo remove -> remove old note.
778 Redo replace -> remove old note, insert new note. */
782 EndRedo();
783}
784
786{
787}
788
790{
791 return false;
792}
793
795{
796 return ScResId( maNewData.mxCaption ?
797 (maOldData.mxCaption ? STR_UNDO_EDITNOTE : STR_UNDO_INSERTNOTE) : STR_UNDO_DELETENOTE );
798}
799
801{
802 if( rNoteData.mxCaption )
803 {
805 OSL_ENSURE( !rDoc.GetNote(maPos), "ScUndoReplaceNote::DoInsertNote - unexpected cell note" );
806 ScPostIt* pNote = new ScPostIt( rDoc, maPos, rNoteData, false );
807 rDoc.SetNote( maPos, std::unique_ptr<ScPostIt>(pNote) );
809 }
810}
811
813{
814 if( !rNoteData.mxCaption )
815 return;
816
818 OSL_ENSURE( rDoc.GetNote(maPos), "ScUndoReplaceNote::DoRemoveNote - missing cell note" );
819 if( std::unique_ptr<ScPostIt> pNote = rDoc.ReleaseNote( maPos ) )
820 {
821 /* Forget pointer to caption object to suppress removing the
822 caption object from the drawing layer while deleting pNote
823 (removing the caption is done by a drawing undo action). */
824 pNote->ForgetCaption();
826 }
827}
828
829ScUndoShowHideNote::ScUndoShowHideNote( ScDocShell& rDocShell, const ScAddress& rPos, bool bShow ) :
830 ScSimpleUndo( &rDocShell ),
831 maPos( rPos ),
832 mbShown( bShow )
833{
834}
835
837{
838}
839
841{
842 BeginUndo();
843 if( ScPostIt* pNote = pDocShell->GetDocument().GetNote(maPos) )
844 pNote->ShowCaption( maPos, !mbShown );
845 EndUndo();
846}
847
849{
850 BeginRedo();
851 if( ScPostIt* pNote = pDocShell->GetDocument().GetNote(maPos) )
852 pNote->ShowCaption( maPos, mbShown );
853 EndRedo();
854}
855
857{
858}
859
861{
862 return false;
863}
864
866{
867 return ScResId( mbShown ? STR_UNDO_SHOWNOTE : STR_UNDO_HIDENOTE );
868}
869
871 std::unique_ptr<SdrUndoAction> pDraw, const ScDetOpData* pOperation,
872 std::unique_ptr<ScDetOpList> pUndoList ) :
873 ScSimpleUndo( pNewDocShell ),
874 pOldList ( std::move(pUndoList) ),
875 nAction ( 0 ),
876 pDrawUndo ( std::move(pDraw) )
877{
878 bIsDelete = ( pOperation == nullptr );
879 if (!bIsDelete)
880 {
881 nAction = static_cast<sal_uInt16>(pOperation->GetOperation());
882 aPos = pOperation->GetPos();
883 }
884}
885
887{
888 pDrawUndo.reset();
889 pOldList.reset();
890}
891
893{
894 TranslateId pId = STR_UNDO_DETDELALL;
895 if ( !bIsDelete )
896 switch ( static_cast<ScDetOpType>(nAction) )
897 {
898 case SCDETOP_ADDSUCC: pId = STR_UNDO_DETADDSUCC; break;
899 case SCDETOP_DELSUCC: pId = STR_UNDO_DETDELSUCC; break;
900 case SCDETOP_ADDPRED: pId = STR_UNDO_DETADDPRED; break;
901 case SCDETOP_DELPRED: pId = STR_UNDO_DETDELPRED; break;
902 case SCDETOP_ADDERROR: pId = STR_UNDO_DETADDERROR; break;
903 }
904
905 return ScResId(pId);
906}
907
909{
910 BeginUndo();
911
913 DoSdrUndoAction(pDrawUndo.get(), &rDoc);
914
915 if (bIsDelete)
916 {
917 if ( pOldList )
918 rDoc.SetDetOpList( std::unique_ptr<ScDetOpList>(new ScDetOpList(*pOldList)) );
919 }
920 else
921 {
922 // Remove entry from list
923
924 ScDetOpList* pList = rDoc.GetDetOpList();
925 if (pList && pList->Count())
926 {
927 ScDetOpDataVector& rVec = pList->GetDataVector();
928 ScDetOpDataVector::iterator it = rVec.begin() + rVec.size() - 1;
929 if ( it->GetOperation() == static_cast<ScDetOpType>(nAction) && it->GetPos() == aPos )
930 rVec.erase( it);
931 else
932 {
933 OSL_FAIL("Detective entry could not be found in list");
934 }
935 }
936 }
937
939 if (pViewShell)
940 pViewShell->RecalcPPT();
941
942 EndUndo();
943}
944
946{
947 BeginRedo();
948
950
952
953 if (bIsDelete)
955 else
956 rDoc.AddDetectiveOperation( ScDetOpData( aPos, static_cast<ScDetOpType>(nAction) ) );
957
959 if (pViewShell)
960 pViewShell->RecalcPPT();
961
962 EndRedo();
963}
964
966{
967 // makes no sense
968}
969
971{
972 return false;
973}
974
976 std::unique_ptr<ScRangeName> pOld, std::unique_ptr<ScRangeName> pNew, SCTAB nTab ) :
977 ScSimpleUndo( pNewDocShell ),
978 pOldRanges ( std::move(pOld) ),
979 pNewRanges ( std::move(pNew) ),
980 mnTab ( nTab )
981{
982}
983
985{
986 pOldRanges.reset();
987 pNewRanges.reset();
988}
989
991{
992 return ScResId( STR_UNDO_RANGENAMES );
993}
994
996{
999
1000 if ( bUndo )
1001 {
1002 auto p = std::make_unique<ScRangeName>(*pOldRanges);
1003 if (mnTab >= 0)
1004 rDoc.SetRangeName( mnTab, std::move(p) );
1005 else
1006 rDoc.SetRangeName( std::move(p) );
1007 }
1008 else
1009 {
1010 auto p = std::make_unique<ScRangeName>(*pNewRanges);
1011 if (mnTab >= 0)
1012 rDoc.SetRangeName( mnTab, std::move(p) );
1013 else
1014 rDoc.SetRangeName( std::move(p) );
1015 }
1016
1017 rDoc.CompileHybridFormula();
1018
1019 SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScAreasChanged ) );
1020}
1021
1023{
1024 BeginUndo();
1025 DoChange( true );
1026 EndUndo();
1027}
1028
1030{
1031 BeginRedo();
1032 DoChange( false );
1033 EndRedo();
1034}
1035
1037{
1038 // makes no sense
1039}
1040
1042{
1043 return false;
1044}
1045
1046/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxApplication * SfxGetpApp()
virtual std::unique_ptr< EditTextObject > Clone() const=0
SCTAB Tab() const
Definition: address.hxx:283
SCROW Row() const
Definition: address.hxx:274
void SetTab(SCTAB nTabP)
Definition: address.hxx:295
SCCOL Col() const
Definition: address.hxx:279
sal_uLong GetActionMax() const
Definition: chgtrack.hxx:955
SC_DLLPUBLIC void Undo(sal_uLong nStartAction, sal_uLong nEndAction, bool bMerge=false)
Definition: chgtrack.cxx:3034
void AppendContent(const ScAddress &rPos, const ScDocument *pRefDoc)
Definition: chgtrack.cxx:2572
ScDetOpType GetOperation() const
Definition: detdata.hxx:45
const ScAddress & GetPos() const
Definition: detdata.hxx:44
ScDetOpDataVector & GetDataVector()
Definition: detdata.hxx:74
size_t Count() const
Definition: detdata.hxx:78
void PostPaintCell(SCCOL nCol, SCROW nRow, SCTAB nTab)
Definition: docsh3.cxx:188
const ScDocument & GetDocument() const
Definition: docsh.hxx:220
void PostDataChanged()
Definition: docsh3.cxx:93
void PostPaint(SCCOL nStartCol, SCROW nStartRow, SCTAB nStartTab, SCCOL nEndCol, SCROW nEndRow, SCTAB nEndTab, PaintPartFlags nPart, sal_uInt16 nExtFlags=0)
Definition: docsh3.cxx:101
SfxPrinter * GetPrinter(bool bCreateIfNotExist=true)
Definition: docsh3.cxx:451
void SetPrintZoom(SCTAB nTab, sal_uInt16 nScale, sal_uInt16 nPages)
Definition: docsh4.cxx:1651
bool AdjustRowHeight(SCROW nStartRow, SCROW nEndRow, SCTAB nTab)
merge with docfunc
Definition: docsh5.cxx:404
static void LOKCommentNotify(LOKCommentNotificationType nType, const ScDocument *pDocument, const ScAddress &rPos, const ScPostIt *pNote)
Definition: docsh4.cxx:2524
void SetEmptyCell(const ScAddress &rPos)
Definition: document.cxx:3508
SC_DLLPUBLIC bool SetEditText(const ScAddress &rPos, std::unique_ptr< EditTextObject > pEditText)
This method manages the lifecycle of the passed edit text object.
Definition: document.cxx:3452
SC_DLLPUBLIC ScFormulaCell * SetFormulaCell(const ScAddress &rPos, ScFormulaCell *pCell)
Set formula cell, and transfer its ownership to the document.
Definition: documen2.cxx:1114
void SetRangeName(SCTAB nTab, std::unique_ptr< ScRangeName > pNew)
Definition: documen3.cxx:189
void SetNote(const ScAddress &rPos, std::unique_ptr< ScPostIt > pNote)
Definition: document.cxx:6743
SC_DLLPUBLIC void CompileHybridFormula()
Call this immediately after updating named ranges.
Definition: document10.cxx:317
void InvalidatePageBreaks(SCTAB nTab)
Definition: document.cxx:6330
SC_DLLPUBLIC ScDocumentPool * GetPool()
Definition: document.cxx:6169
ScDetOpList * GetDetOpList() const
Definition: document.hxx:1847
SC_DLLPUBLIC ScPostIt * GetNote(const ScAddress &rPos)
Definition: document.cxx:6729
void AddDetectiveOperation(const ScDetOpData &rData)
Definition: documen4.cxx:900
SC_DLLPUBLIC void PreprocessRangeNameUpdate()
Definition: document10.cxx:293
SC_DLLPUBLIC std::unique_ptr< ScPostIt > ReleaseNote(const ScAddress &rPos)
Definition: document.cxx:6828
SC_DLLPUBLIC bool SetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString &rString, const ScSetStringParam *pParam=nullptr)
Definition: document.cxx:3421
SC_DLLPUBLIC OUString GetPageStyle(SCTAB nTab) const
Definition: document.cxx:6301
void SetDetOpList(std::unique_ptr< ScDetOpList > pNew)
Definition: documen4.cxx:913
SC_DLLPUBLIC void SetValue(SCCOL nCol, SCROW nRow, SCTAB nTab, const double &rVal)
Definition: document.cxx:3516
SC_DLLPUBLIC void ApplyAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, const SfxPoolItem &rAttr)
Definition: document.cxx:4834
SC_DLLPUBLIC ScStyleSheetPool * GetStyleSheetPool() const
Definition: document.cxx:6174
SC_DLLPUBLIC void SetPattern(const ScAddress &, const ScPatternAttr &rAttr)
Definition: document.cxx:5124
void ClearDetectiveOperations()
Definition: documen4.cxx:908
ScChangeTrack * GetChangeTrack() const
Definition: document.hxx:2487
SC_DLLPUBLIC CellType GetCellType(SCCOL nCol, SCROW nRow, SCTAB nTab) const
Definition: document.cxx:3789
SC_DLLPUBLIC const ScPatternAttr * GetPattern(SCCOL nCol, SCROW nRow, SCTAB nTab) const
Definition: document.cxx:4812
ScFormulaCell * Clone() const
SfxItemSet & GetItemSet()
Definition: patattr.hxx:155
Additional class containing cell annotation data.
Definition: postit.hxx:58
bool UpdatePages()
Definition: printfun.cxx:2426
void push_back(const ScRange &rRange)
Definition: rangelst.cxx:1137
void BeginRedo()
Definition: undobase.cxx:145
void EndRedo()
Definition: undobase.cxx:154
void EndUndo()
Definition: undobase.cxx:125
ScDocShell * pDocShell
Definition: undobase.hxx:50
void BeginUndo()
Definition: undobase.cxx:90
static void notifyAllViewsSheetGeomInvalidation(const SfxViewShell *pForViewShell, bool bColumns, bool bRows, bool bSizes, bool bHidden, bool bFiltered, bool bGroups, SCTAB nCurrentTabIndex)
Emits a LOK_CALLBACK_INVALIDATE_SHEET_GEOMETRY for all views whose current tab is equal to nCurrentTa...
Definition: tabvwshc.cxx:568
static void notifyAllViewsHeaderInvalidation(const SfxViewShell *pForViewShell, HeaderType eHeaderType, SCTAB nCurrentTabIndex)
Emits a LOK_CALLBACK_INVALIDATE_HEADER for all views whose current tab is equal to nCurrentTabIndex.
Definition: tabvwshc.cxx:510
static ScTabViewShell * GetActiveViewShell()
Definition: tabvwsh4.cxx:1076
SC_DLLPUBLIC void MoveCursorAbs(SCCOL nCurX, SCROW nCurY, ScFollowMode eMode, bool bShift, bool bControl, bool bKeepOld=false, bool bKeepSel=false)
Definition: tabview3.cxx:1194
ScViewData & GetViewData()
Definition: tabview.hxx:335
void RecalcPPT()
Definition: tabview3.cxx:2802
SC_DLLPUBLIC void SetTabNo(SCTAB nTab, bool bNew=false, bool bExtendSelection=false, bool bSameTabButMoved=false)
Definition: tabview3.cxx:1822
std::unique_ptr< EditTextObject > pOldEditData
Definition: undocell.hxx:64
virtual void Undo() override
Definition: undocell.cxx:135
std::unique_ptr< EditTextObject > pNewEditData
Definition: undocell.hxx:65
void DoChange(const ScPatternAttr *pWhichPattern, const std::unique_ptr< EditTextObject > &pEditData) const
Definition: undocell.cxx:105
virtual void Redo() override
Definition: undocell.cxx:142
ScPatternAttr * pNewPattern
Definition: undocell.hxx:62
ScPatternAttr * pApplyPattern
Definition: undocell.hxx:63
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undocell.cxx:155
virtual OUString GetComment() const override
Definition: undocell.cxx:93
virtual ~ScUndoCursorAttr() override
Definition: undocell.cxx:85
ScUndoCursorAttr(ScDocShell *pNewDocShell, SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab, const ScPatternAttr *pOldPat, const ScPatternAttr *pNewPat, const ScPatternAttr *pApplyPat)
Definition: undocell.cxx:68
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undocell.cxx:149
ScPatternAttr * pOldPattern
Definition: undocell.hxx:61
void SetEditData(std::unique_ptr< EditTextObject > pOld, std::unique_ptr< EditTextObject > pNew)
once the objects are passed to this class, their life-cycle is managed by this class; the calling fun...
Definition: undocell.cxx:99
virtual void Redo() override
Definition: undocell.cxx:945
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undocell.cxx:970
virtual void Undo() override
Definition: undocell.cxx:908
std::unique_ptr< ScDetOpList > pOldList
Definition: undocell.hxx:323
virtual ~ScUndoDetective() override
Definition: undocell.cxx:886
ScAddress aPos
Definition: undocell.hxx:325
virtual OUString GetComment() const override
Definition: undocell.cxx:892
sal_uInt16 nAction
Definition: undocell.hxx:324
ScUndoDetective(ScDocShell *pNewDocShell, std::unique_ptr< SdrUndoAction > pDraw, const ScDetOpData *pOperation, std::unique_ptr< ScDetOpList > pUndoList=nullptr)
Definition: undocell.cxx:870
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undocell.cxx:965
std::unique_ptr< SdrUndoAction > pDrawUndo
Definition: undocell.hxx:326
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undocell.cxx:304
virtual OUString GetComment() const override
Definition: undocell.cxx:176
sal_uLong mnEndChangeAction
Definition: undocell.hxx:104
OUString maNewString
Definition: undocell.hxx:102
virtual void Undo() override
Definition: undocell.cxx:230
ScAddress maPos
Definition: undocell.hxx:105
ScUndoEnterData(ScDocShell *pNewDocShell, const ScAddress &rPos, ValuesType &rOldValues, OUString aNewStr, std::unique_ptr< EditTextObject > pObj)
Definition: undocell.cxx:162
void SetChangeTrack()
Definition: undocell.cxx:208
std::unique_ptr< EditTextObject > mpNewEditData
Definition: undocell.hxx:103
std::vector< Value > ValuesType
Definition: undocell.hxx:84
void DoChange() const
Definition: undocell.cxx:181
virtual void Redo() override
Definition: undocell.cxx:266
ValuesType maOldValues
Definition: undocell.hxx:100
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undocell.cxx:295
ScCellValue maOldCell
Definition: undocell.hxx:131
ScAddress aPos
Definition: undocell.hxx:130
virtual OUString GetComment() const override
Definition: undocell.cxx:324
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undocell.cxx:380
virtual void Redo() override
Definition: undocell.cxx:362
void SetChangeTrack()
Definition: undocell.cxx:329
sal_uLong nEndChangeAction
Definition: undocell.hxx:133
ScUndoEnterValue(ScDocShell *pNewDocShell, const ScAddress &rNewPos, ScCellValue aUndoCell, double nVal)
Definition: undocell.cxx:309
virtual ~ScUndoEnterValue() override
Definition: undocell.cxx:320
virtual void Undo() override
Definition: undocell.cxx:344
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undocell.cxx:375
virtual OUString GetComment() const override
Definition: undocell.cxx:509
virtual ~ScUndoPageBreak() override
Definition: undocell.cxx:505
ScUndoPageBreak(ScDocShell *pNewDocShell, SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab, bool bNewColumn, bool bNewInsert)
Definition: undocell.cxx:493
virtual void Undo() override
Definition: undocell.cxx:541
virtual void Redo() override
Definition: undocell.cxx:548
void DoChange(bool bInsert) const
Definition: undocell.cxx:523
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undocell.cxx:555
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undocell.cxx:568
sal_uInt16 nNewScale
Definition: undocell.hxx:208
virtual ~ScUndoPrintZoom() override
Definition: undocell.cxx:584
void DoChange(bool bUndo)
Definition: undocell.cxx:593
virtual void Undo() override
Definition: undocell.cxx:614
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undocell.cxx:628
ScUndoPrintZoom(ScDocShell *pNewDocShell, SCTAB nT, sal_uInt16 nOS, sal_uInt16 nOP, sal_uInt16 nNS, sal_uInt16 nNP)
Definition: undocell.cxx:573
virtual OUString GetComment() const override
Definition: undocell.cxx:588
virtual void Redo() override
Definition: undocell.cxx:621
sal_uInt16 nOldPages
Definition: undocell.hxx:207
sal_uInt16 nNewPages
Definition: undocell.hxx:209
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undocell.cxx:638
sal_uInt16 nOldScale
Definition: undocell.hxx:206
std::unique_ptr< ScRangeName > pOldRanges
Definition: undocell.hxx:345
std::unique_ptr< ScRangeName > pNewRanges
Definition: undocell.hxx:346
virtual void Undo() override
Definition: undocell.cxx:1022
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undocell.cxx:1036
void DoChange(bool bUndo)
Definition: undocell.cxx:995
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undocell.cxx:1041
virtual void Redo() override
Definition: undocell.cxx:1029
virtual ~ScUndoRangeNames() override
Definition: undocell.cxx:984
virtual OUString GetComment() const override
Definition: undocell.cxx:990
ScUndoRangeNames(ScDocShell *pNewDocShell, std::unique_ptr< ScRangeName > pOld, std::unique_ptr< ScRangeName > pNew, SCTAB nTab)
Definition: undocell.cxx:975
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undocell.cxx:789
virtual OUString GetComment() const override
Definition: undocell.cxx:794
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undocell.cxx:785
ScNoteData maNewData
Definition: undocell.hxx:281
virtual void Undo() override
Definition: undocell.cxx:759
ScAddress maPos
Definition: undocell.hxx:279
virtual void Redo() override
Definition: undocell.cxx:772
virtual ~ScUndoReplaceNote() override
Definition: undocell.cxx:754
ScUndoReplaceNote(ScDocShell &rDocShell, const ScAddress &rPos, const ScNoteData &rNoteData, bool bInsert, std::unique_ptr< SdrUndoAction > pDrawUndo)
Constructs an undo action for inserting or removing a cell note.
Definition: undocell.cxx:725
ScNoteData maOldData
Definition: undocell.hxx:280
void DoInsertNote(const ScNoteData &rNoteData)
Definition: undocell.cxx:800
void DoRemoveNote(const ScNoteData &rNoteData)
Definition: undocell.cxx:812
std::unique_ptr< SdrUndoAction > mpDrawUndo
Definition: undocell.hxx:282
ScCellValue maNewValue
Definition: undocell.hxx:161
virtual OUString GetComment() const override
Definition: undocell.cxx:428
sal_uLong mnEndChangeAction
Definition: undocell.hxx:162
void SetChangeTrack()
Definition: undocell.cxx:433
virtual void Redo() override
Definition: undocell.cxx:408
void MoveCursorToCell()
Definition: undocell.cxx:483
ScAddress maPos
Definition: undocell.hxx:159
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undocell.cxx:423
ScCellValue maOldValue
Definition: undocell.hxx:160
virtual void Undo() override
Definition: undocell.cxx:393
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undocell.cxx:418
virtual ~ScUndoSetCell() override
Definition: undocell.cxx:391
void SetValue(const ScCellValue &rVal)
Definition: undocell.cxx:450
ScUndoSetCell(ScDocShell *pDocSh, const ScAddress &rPos, ScCellValue aOldVal, ScCellValue aNewVal)
Definition: undocell.cxx:385
virtual OUString GetComment() const override
Definition: undocell.cxx:865
virtual ~ScUndoShowHideNote() override
Definition: undocell.cxx:836
virtual void Redo() override
Definition: undocell.cxx:848
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undocell.cxx:856
ScUndoShowHideNote(ScDocShell &rDocShell, const ScAddress &rPos, bool bShow)
Definition: undocell.cxx:829
virtual void Undo() override
Definition: undocell.cxx:840
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undocell.cxx:860
virtual OUString GetComment() const override
Definition: undocell.cxx:658
virtual void Redo() override
Definition: undocell.cxx:706
sal_uLong nEndChangeAction
Definition: undocell.hxx:233
void SetChangeTrack(const ScCellValue &rOldCell)
Definition: undocell.cxx:663
ScCellValue maNewText
Definition: undocell.hxx:236
ScUndoThesaurus(ScDocShell *pNewDocShell, SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab, ScCellValue aOldText, ScCellValue aNewText)
Definition: undocell.cxx:643
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undocell.cxx:713
virtual void Undo() override
Definition: undocell.cxx:696
ScCellValue maOldText
Definition: undocell.hxx:235
void DoChange(bool bUndo, const ScCellValue &rText)
Definition: undocell.cxx:677
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undocell.cxx:719
virtual ~ScUndoThesaurus() override
Definition: undocell.cxx:656
SCTAB GetTabNo() const
Definition: viewdata.hxx:395
ScDocShell * GetDocShell() const
Definition: viewdata.hxx:354
SC_DLLPUBLIC void DeletePageBreak(bool bColumn, bool bRecord=true, const ScAddress *pPos=nullptr, bool bSetModified=true)
Definition: viewfun2.cxx:989
SC_DLLPUBLIC void InsertPageBreak(bool bColumn, bool bRecord=true, const ScAddress *pPos=nullptr, bool bSetModified=true)
Definition: viewfun2.cxx:972
bool AdjustBlockHeight(bool bPaint=true, ScMarkData *pMarkData=nullptr)
Definition: viewfun2.cxx:115
const T & Put(std::unique_ptr< T > xItem, sal_uInt16 nWhich=0)
void Remove(const SfxPoolItem &)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SfxViewShell * GetViewShell() const
virtual SfxStyleSheetBase * Find(const OUString &, SfxStyleFamily eFam, SfxStyleSearchBits n=SfxStyleSearchBits::All) const
virtual SfxItemSet & GetItemSet()
const OUString & getString() const
int nCount
ScDetOpType
Definition: detdata.hxx:27
@ SCDETOP_DELPRED
Definition: detdata.hxx:31
@ SCDETOP_DELSUCC
Definition: detdata.hxx:29
@ SCDETOP_ADDPRED
Definition: detdata.hxx:30
@ SCDETOP_ADDSUCC
Definition: detdata.hxx:28
@ SCDETOP_ADDERROR
Definition: detdata.hxx:32
std::vector< ScDetOpData > ScDetOpDataVector
Definition: detdata.hxx:56
#define SC_PF_WHOLEROWS
Definition: docsh.hxx:78
#define SC_PF_TESTMERGE
Definition: docsh.hxx:77
#define SC_PF_LINES
Definition: docsh.hxx:76
FilterGroup & rTarget
sal_Int16 nValue
@ CELLTYPE_EDIT
Definition: global.hxx:276
@ CELLTYPE_STRING
Definition: global.hxx:274
@ CELLTYPE_FORMULA
Definition: global.hxx:275
@ CELLTYPE_NONE
Definition: global.hxx:272
@ CELLTYPE_VALUE
Definition: global.hxx:273
@ StartListening
If set, cloned formula cells will start to listen to the document.
void * p
ScModelObj * getMustPropagateChangesModel(const ScDocShell &rDocShell)
Definition: docsh.hxx:475
void NotifyIfChangesListeners(const ScDocShell &rDocShell, const ScRange &rRange, const OUString &rType=OUString("cell-change"))
Definition: docsh.hxx:491
void Notify(ScModelObj &rModelObj, const ScRangeList &rChangeRanges, const OUString &rType=OUString("cell-change"), const css::uno::Sequence< css::beans::PropertyValue > &rProperties=css::uno::Sequence< css::beans::PropertyValue >())
Definition: docsh.hxx:483
int i
OUString ScResId(TranslateId aId)
Definition: scdll.cxx:90
constexpr TypedWhichId< SfxUInt16Item > ATTR_PAGE_SCALE(175)
constexpr TypedWhichId< SvxShadowItem > ATTR_SHADOW(152)
constexpr TypedWhichId< SvxHorJustifyItem > ATTR_HOR_JUSTIFY(129)
constexpr TypedWhichId< SfxUInt32Item > ATTR_VALUE_FORMAT(146)
constexpr TypedWhichId< SfxUInt16Item > ATTR_PAGE_SCALETOPAGES(176)
constexpr TypedWhichId< ScCondFormatItem > ATTR_CONDITIONAL(154)
static SfxItemSet & rSet
sal_uIntPtr sal_uLong
Store arbitrary cell value of any kind.
Definition: cellvalue.hxx:32
void assign(const ScDocument &rDoc, const ScAddress &rPos)
Take cell value from specified position in specified document.
Definition: cellvalue.cxx:359
const svl::SharedString * getSharedString() const
Definition: cellvalue.hxx:60
CellType getType() const
Definition: cellvalue.cxx:296
ScFormulaCell * getFormula() const
Definition: cellvalue.hxx:59
EditTextObject * getEditText() const
Definition: cellvalue.hxx:61
double getDouble() const
Definition: cellvalue.hxx:58
void release(ScDocument &rDoc, const ScAddress &rPos)
Set cell value at specified position in specified document.
Definition: cellvalue.cxx:456
void commit(ScDocument &rDoc, const ScAddress &rPos) const
Set cell value at specified position in specified document.
Definition: cellvalue.cxx:426
Internal data for a cell annotation.
Definition: postit.hxx:42
rtl::Reference< SdrCaptionObj > mxCaption
Initial data for invisible notes without SdrObject.
Definition: postit.hxx:48
ScCaptionInitDataRef mxInitData
Author of the note.
Definition: postit.hxx:47
Store parameters used in the ScDocument::SetString() method.
Definition: stringutil.hxx:35
void setTextInput()
Call this whenever you need to unconditionally set input as text, no matter what the input is.
Definition: stringutil.cxx:38
@ Keep
Keep an existing number format, do not set Text number format and do not set another number format.
Definition: stringutil.hxx:57
TextFormatPolicy meSetTextNumFormat
Determine when to set the 'Text' number format to the cell where the input string is being set.
Definition: stringutil.hxx:83
@ ROW_HEADER
Definition: tabview.hxx:60
sal_Int16 SCTAB
Definition: types.hxx:22
sal_Int16 SCCOL
Definition: types.hxx:21
sal_Int32 SCROW
Definition: types.hxx:17
void DoSdrUndoAction(SdrUndoAction *pUndoAction, ScDocument *pDoc)
Definition: undoolk.cxx:35
void RedoSdrUndoAction(SdrUndoAction *pUndoAction)
Definition: undoolk.cxx:61
@ SC_FOLLOW_JUMP
Definition: viewdata.hxx:52