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, const OUString& rType = OUString("cell-change"))
52 {
53 ScModelObj* pModelObj = rDocShell.GetModel();
54 if (pModelObj)
55 {
56 ScRangeList aChangeRanges;
57
58 for (const auto & rOldValue : rOldValues)
59 {
60 aChangeRanges.push_back( ScRange(rPos.Col(), rPos.Row(), rOldValue.mnTab));
61 }
62
63 if (getMustPropagateChangesModel(pModelObj))
64 Notify(*pModelObj, aChangeRanges, rType);
65 if (pModelObj) // possibly need to invalidate getCellArea results
66 {
67 Notify(*pModelObj, aChangeRanges, isDataAreaInvalidateType(rType)
68 ? OUString("data-area-invalidate") : OUString("data-area-extend"));
69 }
70 }
71 }
72}
73
74
76 SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab,
77 const ScPatternAttr* pOldPat, const ScPatternAttr* pNewPat,
78 const ScPatternAttr* pApplyPat ) :
79 ScSimpleUndo( pNewDocShell ),
80 nCol( nNewCol ),
81 nRow( nNewRow ),
82 nTab( nNewTab ),
83 pOldEditData( static_cast<EditTextObject*>(nullptr) ),
84 pNewEditData( static_cast<EditTextObject*>(nullptr) )
85{
87 pNewPattern = const_cast<ScPatternAttr*>( &pPool->Put( *pNewPat ) );
88 pOldPattern = const_cast<ScPatternAttr*>( &pPool->Put( *pOldPat ) );
89 pApplyPattern = const_cast<ScPatternAttr*>( &pPool->Put( *pApplyPat ) );
90}
91
93{
95 pPool->Remove(*pNewPattern);
96 pPool->Remove(*pOldPattern);
97 pPool->Remove(*pApplyPattern);
98}
99
101{
103 return ScResId( STR_UNDO_CURSORATTR ); // "Attribute"
104}
105
106void ScUndoCursorAttr::SetEditData( std::unique_ptr<EditTextObject> pOld, std::unique_ptr<EditTextObject> pNew )
107{
108 pOldEditData = std::move(pOld);
109 pNewEditData = std::move(pNew);
110}
111
112void ScUndoCursorAttr::DoChange( const ScPatternAttr* pWhichPattern, const std::unique_ptr<EditTextObject>& pEditData ) const
113{
115 ScAddress aPos(nCol, nRow, nTab);
116 rDoc.SetPattern( nCol, nRow, nTab, *pWhichPattern );
117
118 if (rDoc.GetCellType(aPos) == CELLTYPE_EDIT && pEditData)
119 rDoc.SetEditText(aPos, *pEditData, nullptr);
120
122 if (pViewShell)
123 {
124 pViewShell->SetTabNo( nTab );
125 pViewShell->MoveCursorAbs( nCol, nRow, SC_FOLLOW_JUMP, false, false );
126 pViewShell->AdjustBlockHeight();
127 }
128
129 const SfxItemSet& rApplySet = pApplyPattern->GetItemSet();
130 bool bPaintExt = ( rApplySet.GetItemState( ATTR_SHADOW ) != SfxItemState::DEFAULT ||
131 rApplySet.GetItemState( ATTR_CONDITIONAL ) != SfxItemState::DEFAULT );
132 bool bPaintRows = ( rApplySet.GetItemState( ATTR_HOR_JUSTIFY ) != SfxItemState::DEFAULT );
133
134 sal_uInt16 nFlags = SC_PF_TESTMERGE;
135 if (bPaintExt)
136 nFlags |= SC_PF_LINES;
137 if (bPaintRows)
138 nFlags |= SC_PF_WHOLEROWS;
140}
141
143{
144 BeginUndo();
146 EndUndo();
147}
148
150{
151 BeginRedo();
153 EndRedo();
154}
155
156void ScUndoCursorAttr::Repeat(SfxRepeatTarget& rTarget)
157{
158 if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
159 pViewTarget->GetViewShell()->ApplySelectionPattern( *pApplyPattern );
160}
161
162bool ScUndoCursorAttr::CanRepeat(SfxRepeatTarget& rTarget) const
163{
164 return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
165}
166
167ScUndoEnterData::Value::Value() : mnTab(-1), mbHasFormat(false), mnFormat(0) {}
168
170 ScDocShell* pNewDocShell, const ScAddress& rPos, ValuesType& rOldValues,
171 OUString aNewStr, std::unique_ptr<EditTextObject> pObj ) :
172 ScSimpleUndo( pNewDocShell ),
173 maNewString(std::move(aNewStr)),
174 mpNewEditData(std::move(pObj)),
176 maPos(rPos)
177{
178 maOldValues.swap(rOldValues);
179
181}
182
184{
185 return ScResId( STR_UNDO_ENTERDATA ); // "Input"
186}
187
189{
190 // only when needed (old or new Edit cell, or Attribute)?
191 bool bHeightChanged = false;
192 for (const auto & i : maOldValues)
193 {
194 if (pDocShell->AdjustRowHeight(maPos.Row(), maPos.Row(), i.mnTab))
195 bHeightChanged = true;
196 }
197
199 if (pViewShell)
200 {
201 if (comphelper::LibreOfficeKit::isActive() && bHeightChanged)
202 {
205 pViewShell, false /* bColumns */, true /* bRows */, true /* bSizes*/,
206 false /* bHidden */, false /* bFiltered */, false /* bGroups */, maPos.Tab());
207 }
208 pViewShell->SetTabNo(maPos.Tab());
209 pViewShell->MoveCursorAbs(maPos.Col(), maPos.Row(), SC_FOLLOW_JUMP, false, false);
210 }
211
213}
214
216{
218 if ( pChangeTrack )
219 {
220 mnEndChangeAction = pChangeTrack->GetActionMax() + 1;
221 ScAddress aPos(maPos);
222 for (const Value & rOldValue : maOldValues)
223 {
224 aPos.SetTab(rOldValue.mnTab);
225 sal_uLong nFormat = 0;
226 if (rOldValue.mbHasFormat)
227 nFormat = rOldValue.mnFormat;
228 pChangeTrack->AppendContent(aPos, rOldValue.maCell, nFormat);
229 }
230 if ( mnEndChangeAction > pChangeTrack->GetActionMax() )
231 mnEndChangeAction = 0; // nothing is appended
232 }
233 else
235}
236
238{
239 BeginUndo();
240
242 for (const Value & rVal : maOldValues)
243 {
244 ScCellValue aNewCell;
245 aNewCell.assign(rVal.maCell, rDoc, ScCloneFlags::StartListening);
246 ScAddress aPos = maPos;
247 aPos.SetTab(rVal.mnTab);
248 aNewCell.release(rDoc, aPos);
249
250 if (rVal.mbHasFormat)
251 rDoc.ApplyAttr(maPos.Col(), maPos.Row(), rVal.mnTab,
252 SfxUInt32Item(ATTR_VALUE_FORMAT, rVal.mnFormat));
253 else
254 {
255 auto pPattern = std::make_unique<ScPatternAttr>(*rDoc.GetPattern(maPos.Col(), maPos.Row(), rVal.mnTab));
256 pPattern->GetItemSet().ClearItem( ATTR_VALUE_FORMAT );
257 rDoc.SetPattern(maPos.Col(), maPos.Row(), rVal.mnTab, std::move(pPattern));
258 }
259 pDocShell->PostPaintCell(maPos.Col(), maPos.Row(), rVal.mnTab);
260 }
261
262 ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
263 size_t nCount = maOldValues.size();
264 if ( pChangeTrack && mnEndChangeAction >= sal::static_int_cast<sal_uLong>(nCount) )
265 pChangeTrack->Undo( mnEndChangeAction - nCount + 1, mnEndChangeAction );
266
267 DoChange();
268 EndUndo();
269
271}
272
274{
275 BeginRedo();
276
278 for (const Value & rOldValue : maOldValues)
279 {
280 SCTAB nTab = rOldValue.mnTab;
281 if (mpNewEditData)
282 {
283 ScAddress aPos = maPos;
284 aPos.SetTab(nTab);
285 // edit text will be cloned.
286 rDoc.SetEditText(aPos, *mpNewEditData, nullptr);
287 }
288 else
289 rDoc.SetString(maPos.Col(), maPos.Row(), nTab, maNewString);
290
292 }
293
295
296 DoChange();
297 EndRedo();
298
300}
301
302void ScUndoEnterData::Repeat(SfxRepeatTarget& rTarget)
303{
304 if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
305 {
306 OUString aTemp = maNewString;
307 pViewTarget->GetViewShell()->EnterDataAtCursor( aTemp );
308 }
309}
310
311bool ScUndoEnterData::CanRepeat(SfxRepeatTarget& rTarget) const
312{
313 return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
314}
315
317 ScDocShell* pNewDocShell, const ScAddress& rNewPos,
318 ScCellValue aUndoCell, double nVal ) :
319 ScSimpleUndo( pNewDocShell ),
320 aPos ( rNewPos ),
321 maOldCell(std::move(aUndoCell)),
322 nValue ( nVal )
323{
325}
326
328{
329}
330
332{
333 return ScResId( STR_UNDO_ENTERDATA ); // "Input"
334}
335
337{
339 ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
340 if ( pChangeTrack )
341 {
342 nEndChangeAction = pChangeTrack->GetActionMax() + 1;
343 pChangeTrack->AppendContent(aPos, maOldCell);
344 if ( nEndChangeAction > pChangeTrack->GetActionMax() )
345 nEndChangeAction = 0; // nothing is appended
346 }
347 else
349}
350
352{
353 BeginUndo();
354
356 ScCellValue aNewCell;
358 aNewCell.release(rDoc, aPos);
359
361
362 ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
363 if ( pChangeTrack )
364 pChangeTrack->Undo( nEndChangeAction, nEndChangeAction );
365
366 EndUndo();
367}
368
370{
371 BeginRedo();
372
374 rDoc.SetValue( aPos.Col(), aPos.Row(), aPos.Tab(), nValue );
376
378
379 EndRedo();
380}
381
382void ScUndoEnterValue::Repeat(SfxRepeatTarget& /* rTarget */)
383{
384 // makes no sense
385}
386
387bool ScUndoEnterValue::CanRepeat(SfxRepeatTarget& /* rTarget */) const
388{
389 return false;
390}
391
393 ScSimpleUndo(pDocSh), maPos(rPos), maOldValue(std::move(aOldVal)), maNewValue(std::move(aNewVal)), mnEndChangeAction(0)
394{
396}
397
399
401{
402 BeginUndo();
406
408 ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
409 if (pChangeTrack)
411
412 EndUndo();
413}
414
416{
417 BeginRedo();
422 EndRedo();
423}
424
425void ScUndoSetCell::Repeat( SfxRepeatTarget& /*rTarget*/ )
426{
427 // Makes no sense.
428}
429
430bool ScUndoSetCell::CanRepeat( SfxRepeatTarget& /*rTarget*/ ) const
431{
432 return false;
433}
434
436{
437 return ScResId(STR_UNDO_ENTERDATA); // "Input"
438}
439
441{
443 ScChangeTrack* pChangeTrack = rDoc.GetChangeTrack();
444 if (pChangeTrack)
445 {
446 mnEndChangeAction = pChangeTrack->GetActionMax() + 1;
447
448 pChangeTrack->AppendContent(maPos, maOldValue);
449
450 if (mnEndChangeAction > pChangeTrack->GetActionMax())
451 mnEndChangeAction = 0; // Nothing is appended
452 }
453 else
455}
456
458{
460
461 switch (rVal.getType())
462 {
463 case CELLTYPE_NONE:
464 // empty cell
465 rDoc.SetEmptyCell(maPos);
466 break;
467 case CELLTYPE_VALUE:
468 rDoc.SetValue(maPos, rVal.getDouble());
469 break;
470 case CELLTYPE_STRING:
471 {
472 ScSetStringParam aParam;
473 aParam.setTextInput();
474 // Undo only cell content, without setting any number format.
476 rDoc.SetString(maPos, rVal.getSharedString()->getString(), &aParam);
477 }
478 break;
479 case CELLTYPE_EDIT:
480 rDoc.SetEditText(maPos, rVal.getEditText()->Clone());
481 break;
482 case CELLTYPE_FORMULA:
483 rDoc.SetFormulaCell(maPos, rVal.getFormula()->Clone());
484 break;
485 default:
486 ;
487 }
488}
489
491{
493 if ( pViewShell )
494 {
495 pViewShell->SetTabNo( maPos.Tab() );
496 pViewShell->MoveCursorAbs( maPos.Col(), maPos.Row(), SC_FOLLOW_JUMP, false, false );
497 }
498}
499
501 SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab,
502 bool bNewColumn, bool bNewInsert ) :
503 ScSimpleUndo( pNewDocShell ),
504 nCol( nNewCol ),
505 nRow( nNewRow ),
506 nTab( nNewTab ),
507 bColumn( bNewColumn ),
508 bInsert( bNewInsert )
509{
510}
511
513{
514}
515
517{
518 //"Column break" | "Row break" "insert" | "delete"
519 return bColumn ?
520 ( bInsert ?
521 ScResId( STR_UNDO_INSCOLBREAK ) :
522 ScResId( STR_UNDO_DELCOLBREAK )
523 ) :
524 ( bInsert ?
525 ScResId( STR_UNDO_INSROWBREAK ) :
526 ScResId( STR_UNDO_DELROWBREAK )
527 );
528}
529
530void ScUndoPageBreak::DoChange( bool bInsertP ) const
531{
533
534 if (pViewShell)
535 {
536 pViewShell->SetTabNo( nTab );
537 pViewShell->MoveCursorAbs( nCol, nRow, SC_FOLLOW_JUMP, false, false );
538
539 if (bInsertP)
540 pViewShell->InsertPageBreak(bColumn, false);
541 else
542 pViewShell->DeletePageBreak(bColumn, false);
543
545 }
546}
547
549{
550 BeginUndo();
552 EndUndo();
553}
554
556{
557 BeginRedo();
559 EndRedo();
560}
561
562void ScUndoPageBreak::Repeat(SfxRepeatTarget& rTarget)
563{
564 if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
565 {
566 ScTabViewShell& rViewShell = *pViewTarget->GetViewShell();
567
568 if (bInsert)
569 rViewShell.InsertPageBreak(bColumn);
570 else
571 rViewShell.DeletePageBreak(bColumn);
572 }
573}
574
575bool ScUndoPageBreak::CanRepeat(SfxRepeatTarget& rTarget) const
576{
577 return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
578}
579
581 SCTAB nT, sal_uInt16 nOS, sal_uInt16 nOP, sal_uInt16 nNS, sal_uInt16 nNP ) :
582 ScSimpleUndo( pNewDocShell ),
583 nTab( nT ),
584 nOldScale( nOS ),
585 nOldPages( nOP ),
586 nNewScale( nNS ),
587 nNewPages( nNP )
588{
589}
590
592{
593}
594
596{
597 return ScResId( STR_UNDO_PRINTSCALE );
598}
599
601{
602 sal_uInt16 nScale = bUndo ? nOldScale : nNewScale;
603 sal_uInt16 nPages = bUndo ? nOldPages : nNewPages;
604
606 OUString aStyleName = rDoc.GetPageStyle( nTab );
607 ScStyleSheetPool* pStylePool = rDoc.GetStyleSheetPool();
608 SfxStyleSheetBase* pStyleSheet = pStylePool->Find( aStyleName, SfxStyleFamily::Page );
609 OSL_ENSURE( pStyleSheet, "PageStyle not found" );
610 if ( pStyleSheet )
611 {
612 SfxItemSet& rSet = pStyleSheet->GetItemSet();
615
616 ScPrintFunc aPrintFunc( pDocShell, pDocShell->GetPrinter(), nTab );
617 aPrintFunc.UpdatePages();
618 }
619}
620
622{
623 BeginUndo();
624 DoChange(true);
625 EndUndo();
626}
627
629{
630 BeginRedo();
631 DoChange(false);
632 EndRedo();
633}
634
635void ScUndoPrintZoom::Repeat(SfxRepeatTarget& rTarget)
636{
637 if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
638 {
639 ScTabViewShell& rViewShell = *pViewTarget->GetViewShell();
640 ScViewData& rViewData = rViewShell.GetViewData();
641 rViewData.GetDocShell()->SetPrintZoom( rViewData.GetTabNo(), nNewScale, nNewPages );
642 }
643}
644
645bool ScUndoPrintZoom::CanRepeat(SfxRepeatTarget& rTarget) const
646{
647 return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
648}
649
651 ScDocShell* pNewDocShell, SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab,
652 ScCellValue aOldText, ScCellValue aNewText ) :
653 ScSimpleUndo( pNewDocShell ),
654 nCol( nNewCol ),
655 nRow( nNewRow ),
656 nTab( nNewTab ),
657 maOldText(std::move(aOldText)),
658 maNewText(std::move(aNewText))
659{
661}
662
664
666{
667 return ScResId( STR_UNDO_THESAURUS ); // "Thesaurus"
668}
669
671{
673 if ( pChangeTrack )
674 {
675 nEndChangeAction = pChangeTrack->GetActionMax() + 1;
676 pChangeTrack->AppendContent(ScAddress(nCol, nRow, nTab), rOldCell);
677 if ( nEndChangeAction > pChangeTrack->GetActionMax() )
678 nEndChangeAction = 0; // nothing is appended
679 }
680 else
682}
683
684void ScUndoThesaurus::DoChange( bool bUndo, const ScCellValue& rText )
685{
687
689 if (pViewShell)
690 {
691 pViewShell->SetTabNo( nTab );
692 pViewShell->MoveCursorAbs( nCol, nRow, SC_FOLLOW_JUMP, false, false );
693 }
694
695 ScAddress aPos(nCol, nRow, nTab);
696 rText.commit(rDoc, aPos);
697 if (!bUndo)
699
701}
702
704{
705 BeginUndo();
706 DoChange(true, maOldText);
708 if ( pChangeTrack )
709 pChangeTrack->Undo( nEndChangeAction, nEndChangeAction );
710 EndUndo();
711}
712
714{
715 BeginRedo();
716 DoChange(false, maNewText);
717 EndRedo();
718}
719
720void ScUndoThesaurus::Repeat(SfxRepeatTarget& rTarget)
721{
722 if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
723 pViewTarget->GetViewShell()->DoThesaurus();
724}
725
726bool ScUndoThesaurus::CanRepeat(SfxRepeatTarget& rTarget) const
727{
728 return dynamic_cast<const ScTabViewTarget*>( &rTarget) != nullptr;
729}
730
731
733 const ScNoteData& rNoteData, bool bInsert, std::unique_ptr<SdrUndoAction> pDrawUndo ) :
734 ScSimpleUndo( &rDocShell ),
735 maPos( rPos ),
736 mpDrawUndo( std::move(pDrawUndo) )
737{
738 OSL_ENSURE( rNoteData.mxCaption, "ScUndoReplaceNote::ScUndoReplaceNote - missing note caption" );
739 if (bInsert)
740 {
741 maNewData = rNoteData;
742 }
743 else
744 {
745 maOldData = rNoteData;
746 }
747}
748
750 ScNoteData aOldData, ScNoteData aNewData, std::unique_ptr<SdrUndoAction> pDrawUndo ) :
751 ScSimpleUndo( &rDocShell ),
752 maPos( rPos ),
753 maOldData(std::move( aOldData )),
754 maNewData(std::move( aNewData )),
755 mpDrawUndo( std::move(pDrawUndo) )
756{
757 OSL_ENSURE( maOldData.mxCaption || maNewData.mxCaption, "ScUndoReplaceNote::ScUndoReplaceNote - missing note captions" );
758 OSL_ENSURE( !maOldData.mxInitData && !maNewData.mxInitData, "ScUndoReplaceNote::ScUndoReplaceNote - unexpected uninitialized note" );
759}
760
762{
763 mpDrawUndo.reset();
764}
765
767{
768 BeginUndo();
770 /* Undo insert -> remove new note.
771 Undo remove -> insert old note.
772 Undo replace -> remove new note, insert old note. */
776 EndUndo();
777}
778
780{
781 BeginRedo();
783 /* Redo insert -> insert new note.
784 Redo remove -> remove old note.
785 Redo replace -> remove old note, insert new note. */
789 EndRedo();
790}
791
792void ScUndoReplaceNote::Repeat( SfxRepeatTarget& /*rTarget*/ )
793{
794}
795
796bool ScUndoReplaceNote::CanRepeat( SfxRepeatTarget& /*rTarget*/ ) const
797{
798 return false;
799}
800
802{
803 return ScResId( maNewData.mxCaption ?
804 (maOldData.mxCaption ? STR_UNDO_EDITNOTE : STR_UNDO_INSERTNOTE) : STR_UNDO_DELETENOTE );
805}
806
808{
809 if( rNoteData.mxCaption )
810 {
812 OSL_ENSURE( !rDoc.GetNote(maPos), "ScUndoReplaceNote::DoInsertNote - unexpected cell note" );
813 ScPostIt* pNote = new ScPostIt( rDoc, maPos, rNoteData, false );
814 rDoc.SetNote( maPos, std::unique_ptr<ScPostIt>(pNote) );
816 }
817}
818
820{
821 if( !rNoteData.mxCaption )
822 return;
823
825 OSL_ENSURE( rDoc.GetNote(maPos), "ScUndoReplaceNote::DoRemoveNote - missing cell note" );
826 if( std::unique_ptr<ScPostIt> pNote = rDoc.ReleaseNote( maPos ) )
827 {
828 /* Forget pointer to caption object to suppress removing the
829 caption object from the drawing layer while deleting pNote
830 (removing the caption is done by a drawing undo action). */
831 pNote->ForgetCaption();
833 }
834}
835
836ScUndoShowHideNote::ScUndoShowHideNote( ScDocShell& rDocShell, const ScAddress& rPos, bool bShow ) :
837 ScSimpleUndo( &rDocShell ),
838 maPos( rPos ),
839 mbShown( bShow )
840{
841}
842
844{
845}
846
848{
849 BeginUndo();
850 if( ScPostIt* pNote = pDocShell->GetDocument().GetNote(maPos) )
851 pNote->ShowCaption( maPos, !mbShown );
852 EndUndo();
853}
854
856{
857 BeginRedo();
858 if( ScPostIt* pNote = pDocShell->GetDocument().GetNote(maPos) )
859 pNote->ShowCaption( maPos, mbShown );
860 EndRedo();
861}
862
863void ScUndoShowHideNote::Repeat( SfxRepeatTarget& /*rTarget*/ )
864{
865}
866
867bool ScUndoShowHideNote::CanRepeat( SfxRepeatTarget& /*rTarget*/ ) const
868{
869 return false;
870}
871
873{
874 return ScResId( mbShown ? STR_UNDO_SHOWNOTE : STR_UNDO_HIDENOTE );
875}
876
878 std::unique_ptr<SdrUndoAction> pDraw, const ScDetOpData* pOperation,
879 std::unique_ptr<ScDetOpList> pUndoList ) :
880 ScSimpleUndo( pNewDocShell ),
881 pOldList ( std::move(pUndoList) ),
882 nAction ( 0 ),
883 pDrawUndo ( std::move(pDraw) )
884{
885 bIsDelete = ( pOperation == nullptr );
886 if (!bIsDelete)
887 {
888 nAction = static_cast<sal_uInt16>(pOperation->GetOperation());
889 aPos = pOperation->GetPos();
890 }
891}
892
894{
895 pDrawUndo.reset();
896 pOldList.reset();
897}
898
900{
901 TranslateId pId = STR_UNDO_DETDELALL;
902 if ( !bIsDelete )
903 switch ( static_cast<ScDetOpType>(nAction) )
904 {
905 case SCDETOP_ADDSUCC: pId = STR_UNDO_DETADDSUCC; break;
906 case SCDETOP_DELSUCC: pId = STR_UNDO_DETDELSUCC; break;
907 case SCDETOP_ADDPRED: pId = STR_UNDO_DETADDPRED; break;
908 case SCDETOP_DELPRED: pId = STR_UNDO_DETDELPRED; break;
909 case SCDETOP_ADDERROR: pId = STR_UNDO_DETADDERROR; break;
910 }
911
912 return ScResId(pId);
913}
914
916{
917 BeginUndo();
918
920 DoSdrUndoAction(pDrawUndo.get(), &rDoc);
921
922 if (bIsDelete)
923 {
924 if ( pOldList )
925 rDoc.SetDetOpList( std::unique_ptr<ScDetOpList>(new ScDetOpList(*pOldList)) );
926 }
927 else
928 {
929 // Remove entry from list
930
931 ScDetOpList* pList = rDoc.GetDetOpList();
932 if (pList && pList->Count())
933 {
934 ScDetOpDataVector& rVec = pList->GetDataVector();
935 ScDetOpDataVector::iterator it = rVec.begin() + rVec.size() - 1;
936 if ( it->GetOperation() == static_cast<ScDetOpType>(nAction) && it->GetPos() == aPos )
937 rVec.erase( it);
938 else
939 {
940 OSL_FAIL("Detective entry could not be found in list");
941 }
942 }
943 }
944
946 if (pViewShell)
947 pViewShell->RecalcPPT();
948
949 EndUndo();
950}
951
953{
954 BeginRedo();
955
957
959
960 if (bIsDelete)
962 else
963 rDoc.AddDetectiveOperation( ScDetOpData( aPos, static_cast<ScDetOpType>(nAction) ) );
964
966 if (pViewShell)
967 pViewShell->RecalcPPT();
968
969 EndRedo();
970}
971
972void ScUndoDetective::Repeat(SfxRepeatTarget& /* rTarget */)
973{
974 // makes no sense
975}
976
977bool ScUndoDetective::CanRepeat(SfxRepeatTarget& /* rTarget */) const
978{
979 return false;
980}
981
983 std::unique_ptr<ScRangeName> pOld, std::unique_ptr<ScRangeName> pNew, SCTAB nTab ) :
984 ScSimpleUndo( pNewDocShell ),
985 pOldRanges ( std::move(pOld) ),
986 pNewRanges ( std::move(pNew) ),
987 mnTab ( nTab )
988{
989}
990
992{
993 pOldRanges.reset();
994 pNewRanges.reset();
995}
996
998{
999 return ScResId( STR_UNDO_RANGENAMES );
1000}
1001
1003{
1004 ScDocument& rDoc = pDocShell->GetDocument();
1006
1007 if ( bUndo )
1008 {
1009 auto p = std::make_unique<ScRangeName>(*pOldRanges);
1010 if (mnTab >= 0)
1011 rDoc.SetRangeName( mnTab, std::move(p) );
1012 else
1013 rDoc.SetRangeName( std::move(p) );
1014 }
1015 else
1016 {
1017 auto p = std::make_unique<ScRangeName>(*pNewRanges);
1018 if (mnTab >= 0)
1019 rDoc.SetRangeName( mnTab, std::move(p) );
1020 else
1021 rDoc.SetRangeName( std::move(p) );
1022 }
1023
1024 rDoc.CompileHybridFormula();
1025
1026 SfxGetpApp()->Broadcast( SfxHint( SfxHintId::ScAreasChanged ) );
1027}
1028
1030{
1031 BeginUndo();
1032 DoChange( true );
1033 EndUndo();
1034}
1035
1037{
1038 BeginRedo();
1039 DoChange( false );
1040 EndRedo();
1041}
1042
1043void ScUndoRangeNames::Repeat(SfxRepeatTarget& /* rTarget */)
1044{
1045 // makes no sense
1046}
1047
1048bool ScUndoRangeNames::CanRepeat(SfxRepeatTarget& /* rTarget */) const
1049{
1050 return false;
1051}
1052
1053/* 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:953
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:1656
ScModelObj * GetModel() const
Definition: docsh.hxx:434
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:2529
void SetEmptyCell(const ScAddress &rPos)
Definition: document.cxx:3509
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:3453
SC_DLLPUBLIC ScFormulaCell * SetFormulaCell(const ScAddress &rPos, ScFormulaCell *pCell)
Set formula cell, and transfer its ownership to the document.
Definition: documen2.cxx:1125
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:6744
SC_DLLPUBLIC void CompileHybridFormula()
Call this immediately after updating named ranges.
Definition: document10.cxx:317
void InvalidatePageBreaks(SCTAB nTab)
Definition: document.cxx:6331
SC_DLLPUBLIC ScDocumentPool * GetPool()
Definition: document.cxx:6170
ScDetOpList * GetDetOpList() const
Definition: document.hxx:1847
SC_DLLPUBLIC ScPostIt * GetNote(const ScAddress &rPos)
Definition: document.cxx:6730
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:6837
SC_DLLPUBLIC bool SetString(SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString &rString, const ScSetStringParam *pParam=nullptr)
Definition: document.cxx:3422
SC_DLLPUBLIC OUString GetPageStyle(SCTAB nTab) const
Definition: document.cxx:6302
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:3517
SC_DLLPUBLIC void ApplyAttr(SCCOL nCol, SCROW nRow, SCTAB nTab, const SfxPoolItem &rAttr)
Definition: document.cxx:4835
SC_DLLPUBLIC ScStyleSheetPool * GetStyleSheetPool() const
Definition: document.cxx:6175
SC_DLLPUBLIC void SetPattern(const ScAddress &, const ScPatternAttr &rAttr)
Definition: document.cxx:5125
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:3790
SC_DLLPUBLIC const ScPatternAttr * GetPattern(SCCOL nCol, SCROW nRow, SCTAB nTab) const
Definition: document.cxx:4813
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:341
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:142
std::unique_ptr< EditTextObject > pNewEditData
Definition: undocell.hxx:65
void DoChange(const ScPatternAttr *pWhichPattern, const std::unique_ptr< EditTextObject > &pEditData) const
Definition: undocell.cxx:112
virtual void Redo() override
Definition: undocell.cxx:149
ScPatternAttr * pNewPattern
Definition: undocell.hxx:62
ScPatternAttr * pApplyPattern
Definition: undocell.hxx:63
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undocell.cxx:162
virtual OUString GetComment() const override
Definition: undocell.cxx:100
virtual ~ScUndoCursorAttr() override
Definition: undocell.cxx:92
ScUndoCursorAttr(ScDocShell *pNewDocShell, SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab, const ScPatternAttr *pOldPat, const ScPatternAttr *pNewPat, const ScPatternAttr *pApplyPat)
Definition: undocell.cxx:75
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undocell.cxx:156
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:106
virtual void Redo() override
Definition: undocell.cxx:952
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undocell.cxx:977
virtual void Undo() override
Definition: undocell.cxx:915
std::unique_ptr< ScDetOpList > pOldList
Definition: undocell.hxx:323
virtual ~ScUndoDetective() override
Definition: undocell.cxx:893
ScAddress aPos
Definition: undocell.hxx:325
virtual OUString GetComment() const override
Definition: undocell.cxx:899
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:877
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undocell.cxx:972
std::unique_ptr< SdrUndoAction > pDrawUndo
Definition: undocell.hxx:326
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undocell.cxx:311
virtual OUString GetComment() const override
Definition: undocell.cxx:183
sal_uLong mnEndChangeAction
Definition: undocell.hxx:104
OUString maNewString
Definition: undocell.hxx:102
virtual void Undo() override
Definition: undocell.cxx:237
ScAddress maPos
Definition: undocell.hxx:105
ScUndoEnterData(ScDocShell *pNewDocShell, const ScAddress &rPos, ValuesType &rOldValues, OUString aNewStr, std::unique_ptr< EditTextObject > pObj)
Definition: undocell.cxx:169
void SetChangeTrack()
Definition: undocell.cxx:215
std::unique_ptr< EditTextObject > mpNewEditData
Definition: undocell.hxx:103
std::vector< Value > ValuesType
Definition: undocell.hxx:84
void DoChange() const
Definition: undocell.cxx:188
virtual void Redo() override
Definition: undocell.cxx:273
ValuesType maOldValues
Definition: undocell.hxx:100
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undocell.cxx:302
ScCellValue maOldCell
Definition: undocell.hxx:131
ScAddress aPos
Definition: undocell.hxx:130
virtual OUString GetComment() const override
Definition: undocell.cxx:331
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undocell.cxx:387
virtual void Redo() override
Definition: undocell.cxx:369
void SetChangeTrack()
Definition: undocell.cxx:336
sal_uLong nEndChangeAction
Definition: undocell.hxx:133
ScUndoEnterValue(ScDocShell *pNewDocShell, const ScAddress &rNewPos, ScCellValue aUndoCell, double nVal)
Definition: undocell.cxx:316
virtual ~ScUndoEnterValue() override
Definition: undocell.cxx:327
virtual void Undo() override
Definition: undocell.cxx:351
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undocell.cxx:382
virtual OUString GetComment() const override
Definition: undocell.cxx:516
virtual ~ScUndoPageBreak() override
Definition: undocell.cxx:512
ScUndoPageBreak(ScDocShell *pNewDocShell, SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab, bool bNewColumn, bool bNewInsert)
Definition: undocell.cxx:500
virtual void Undo() override
Definition: undocell.cxx:548
virtual void Redo() override
Definition: undocell.cxx:555
void DoChange(bool bInsert) const
Definition: undocell.cxx:530
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undocell.cxx:562
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undocell.cxx:575
sal_uInt16 nNewScale
Definition: undocell.hxx:208
virtual ~ScUndoPrintZoom() override
Definition: undocell.cxx:591
void DoChange(bool bUndo)
Definition: undocell.cxx:600
virtual void Undo() override
Definition: undocell.cxx:621
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undocell.cxx:635
ScUndoPrintZoom(ScDocShell *pNewDocShell, SCTAB nT, sal_uInt16 nOS, sal_uInt16 nOP, sal_uInt16 nNS, sal_uInt16 nNP)
Definition: undocell.cxx:580
virtual OUString GetComment() const override
Definition: undocell.cxx:595
virtual void Redo() override
Definition: undocell.cxx:628
sal_uInt16 nOldPages
Definition: undocell.hxx:207
sal_uInt16 nNewPages
Definition: undocell.hxx:209
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undocell.cxx:645
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:1029
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undocell.cxx:1043
void DoChange(bool bUndo)
Definition: undocell.cxx:1002
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undocell.cxx:1048
virtual void Redo() override
Definition: undocell.cxx:1036
virtual ~ScUndoRangeNames() override
Definition: undocell.cxx:991
virtual OUString GetComment() const override
Definition: undocell.cxx:997
ScUndoRangeNames(ScDocShell *pNewDocShell, std::unique_ptr< ScRangeName > pOld, std::unique_ptr< ScRangeName > pNew, SCTAB nTab)
Definition: undocell.cxx:982
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undocell.cxx:796
virtual OUString GetComment() const override
Definition: undocell.cxx:801
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undocell.cxx:792
ScNoteData maNewData
Definition: undocell.hxx:281
virtual void Undo() override
Definition: undocell.cxx:766
ScAddress maPos
Definition: undocell.hxx:279
virtual void Redo() override
Definition: undocell.cxx:779
virtual ~ScUndoReplaceNote() override
Definition: undocell.cxx:761
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:732
ScNoteData maOldData
Definition: undocell.hxx:280
void DoInsertNote(const ScNoteData &rNoteData)
Definition: undocell.cxx:807
void DoRemoveNote(const ScNoteData &rNoteData)
Definition: undocell.cxx:819
std::unique_ptr< SdrUndoAction > mpDrawUndo
Definition: undocell.hxx:282
ScCellValue maNewValue
Definition: undocell.hxx:161
virtual OUString GetComment() const override
Definition: undocell.cxx:435
sal_uLong mnEndChangeAction
Definition: undocell.hxx:162
void SetChangeTrack()
Definition: undocell.cxx:440
virtual void Redo() override
Definition: undocell.cxx:415
void MoveCursorToCell()
Definition: undocell.cxx:490
ScAddress maPos
Definition: undocell.hxx:159
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undocell.cxx:430
ScCellValue maOldValue
Definition: undocell.hxx:160
virtual void Undo() override
Definition: undocell.cxx:400
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undocell.cxx:425
virtual ~ScUndoSetCell() override
Definition: undocell.cxx:398
void SetValue(const ScCellValue &rVal)
Definition: undocell.cxx:457
ScUndoSetCell(ScDocShell *pDocSh, const ScAddress &rPos, ScCellValue aOldVal, ScCellValue aNewVal)
Definition: undocell.cxx:392
virtual OUString GetComment() const override
Definition: undocell.cxx:872
virtual ~ScUndoShowHideNote() override
Definition: undocell.cxx:843
virtual void Redo() override
Definition: undocell.cxx:855
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undocell.cxx:863
ScUndoShowHideNote(ScDocShell &rDocShell, const ScAddress &rPos, bool bShow)
Definition: undocell.cxx:836
virtual void Undo() override
Definition: undocell.cxx:847
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undocell.cxx:867
virtual OUString GetComment() const override
Definition: undocell.cxx:665
virtual void Redo() override
Definition: undocell.cxx:713
sal_uLong nEndChangeAction
Definition: undocell.hxx:233
void SetChangeTrack(const ScCellValue &rOldCell)
Definition: undocell.cxx:670
ScCellValue maNewText
Definition: undocell.hxx:236
ScUndoThesaurus(ScDocShell *pNewDocShell, SCCOL nNewCol, SCROW nNewRow, SCTAB nNewTab, ScCellValue aOldText, ScCellValue aNewText)
Definition: undocell.cxx:650
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undocell.cxx:720
virtual void Undo() override
Definition: undocell.cxx:703
ScCellValue maOldText
Definition: undocell.hxx:235
void DoChange(bool bUndo, const ScCellValue &rText)
Definition: undocell.cxx:684
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undocell.cxx:726
virtual ~ScUndoThesaurus() override
Definition: undocell.cxx:663
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:79
#define SC_PF_TESTMERGE
Definition: docsh.hxx:78
#define SC_PF_LINES
Definition: docsh.hxx:77
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
bool isDataAreaInvalidateType(std::u16string_view rType)
Definition: docsh.hxx:475
void NotifyIfChangesListeners(const ScDocShell &rDocShell, const ScRange &rRange, const OUString &rType=OUString("cell-change"))
Definition: docsh.hxx:508
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:500
bool getMustPropagateChangesModel(ScModelObj *pModelObj)
Definition: docsh.hxx:495
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