LibreOffice Module editeng (master) 1
editundo.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 <memory>
21#include "impedit.hxx"
22#include "editundo.hxx"
23#include <editeng/editview.hxx>
24#include <editeng/editeng.hxx>
25#include <utility>
26#include <osl/diagnose.h>
27
28
29static void lcl_DoSetSelection( EditView const * pView, sal_uInt16 nPara )
30{
31 EPaM aEPaM( nPara, 0 );
32 EditPaM aPaM( pView->GetImpEditEngine()->CreateEditPaM( aEPaM ) );
33 aPaM.SetIndex( aPaM.GetNode()->Len() );
34 EditSelection aSel( aPaM, aPaM );
35 pView->GetImpEditView()->SetEditSelection( aSel );
36}
37
38EditUndoManager::EditUndoManager(sal_uInt16 nMaxUndoActionCount )
39: SfxUndoManager(nMaxUndoActionCount),
40 mpEditEngine(nullptr)
41{
42}
43
45{
46 mpEditEngine = pNew;
47}
48
50{
51 if ( !mpEditEngine || GetUndoActionCount() == 0 )
52 return false;
53
54 DBG_ASSERT( mpEditEngine->GetActiveView(), "Active View?" );
55
57 {
58 if (!mpEditEngine->GetEditViews().empty())
60 else
61 {
62 OSL_FAIL("Undo in engine is not possible without a View! ");
63 return false;
64 }
65 }
66
67 mpEditEngine->GetActiveView()->GetImpEditView()->DrawSelectionXOR(); // Remove the old selection
68
70 bool bDone = SfxUndoManager::Undo();
71 mpEditEngine->SetUndoMode( false );
72
74 DBG_ASSERT( !aNewSel.IsInvalid(), "Invalid selection after Undo () ");
75 DBG_ASSERT( !aNewSel.DbgIsBuggy( mpEditEngine->GetEditDoc() ), "Broken selection afte Undo () ");
76
77 aNewSel.Min() = aNewSel.Max();
81
82 return bDone;
83}
84
86{
87 if ( !mpEditEngine || GetRedoActionCount() == 0 )
88 return false;
89
90 DBG_ASSERT( mpEditEngine->GetActiveView(), "Active View?" );
91
93 {
94 if (!mpEditEngine->GetEditViews().empty())
96 else
97 {
98 OSL_FAIL( "Redo in Engine without View not possible!" );
99 return false;
100 }
101 }
102
103 mpEditEngine->GetActiveView()->GetImpEditView()->DrawSelectionXOR(); // Remove the old selection
104
105 mpEditEngine->SetUndoMode( true );
106 bool bDone = SfxUndoManager::Redo();
107 mpEditEngine->SetUndoMode( false );
108
110 DBG_ASSERT( !aNewSel.IsInvalid(), "Invalid selection after Undo () ");
111 DBG_ASSERT( !aNewSel.DbgIsBuggy( mpEditEngine->GetEditDoc() ), "Broken selection afte Undo () ");
112
113 aNewSel.Min() = aNewSel.Max();
117
118 return bDone;
119}
120
121EditUndo::EditUndo(sal_uInt16 nI, EditEngine* pEE) :
122 nId(nI), mnViewShellId(-1), mpEditEngine(pEE)
123{
124 const EditView* pEditView = mpEditEngine ? mpEditEngine->GetActiveView() : nullptr;
125 const OutlinerViewShell* pViewShell = pEditView ? pEditView->GetImpEditView()->GetViewShell() : nullptr;
126 if (pViewShell)
127 mnViewShellId = pViewShell->GetViewShellId();
128}
129
131{
132}
133
134
135sal_uInt16 EditUndo::GetId() const
136{
137 return nId;
138}
139
140bool EditUndo::CanRepeat(SfxRepeatTarget&) const
141{
142 return false;
143}
144
145OUString EditUndo::GetComment() const
146{
147 OUString aComment;
148
149 if (mpEditEngine)
150 aComment = mpEditEngine->GetUndoComment( GetId() );
151
152 return aComment;
153}
154
156{
157 return mnViewShellId;
158}
159
161 EditEngine* pEE, ContentNode* pNode, sal_Int32 nPortion) :
163 bDelObject(true),
164 nNode(nPortion),
165 pContentNode(pNode) {}
166
168{
169 if ( bDelObject )
170 delete pContentNode;
171}
172
174{
175 DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" );
177 bDelObject = false; // belongs to the Engine again
180}
181
183{
184 DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" );
185
186 EditEngine* pEE = GetEditEngine();
187
188 // pNode is no longer correct, if the paragraphs where merged
189 // in between Undos
191 DBG_ASSERT( pContentNode, "EditUndoDelContent::Redo(): Node?!" );
192
194
195 // Do not delete node, depends on the undo!
196 pEE->GetEditDoc().Release( nNode );
198 pEE->ParagraphDeleted( nNode );
199
201 pEE->AppendDeletedNodeInfo(pInf);
202 pEE->UpdateSelections();
203
204 ContentNode* pN = ( nNode < pEE->GetEditDoc().Count() )
205 ? pEE->GetEditDoc().GetObject( nNode )
206 : pEE->GetEditDoc().GetObject( nNode-1 );
207 DBG_ASSERT( pN && ( pN != pContentNode ), "?! RemoveContent !? " );
208 EditPaM aPaM( pN, pN->Len() );
209
210 bDelObject = true; // belongs to the Engine again
211
213}
214
216 EditEngine* pEE, sal_Int32 nN, sal_uInt16 nSP,
217 SfxItemSet _aLeftParaAttribs, SfxItemSet _aRightParaAttribs,
218 const SfxStyleSheet* pLeftStyle, const SfxStyleSheet* pRightStyle, bool bBkwrd) :
220 nNode(nN),
221 nSepPos(nSP),
222 aLeftParaAttribs(std::move(_aLeftParaAttribs)),
223 aRightParaAttribs(std::move(_aRightParaAttribs)),
224 eLeftStyleFamily(SfxStyleFamily::All),
225 eRightStyleFamily(SfxStyleFamily::All),
226 bBackward(bBkwrd)
227{
228 if ( pLeftStyle )
229 {
230 aLeftStyleName = pLeftStyle->GetName();
231 eLeftStyleFamily = pLeftStyle->GetFamily();
232 }
233 if ( pRightStyle )
234 {
235 aRightStyleName = pRightStyle->GetName();
236 eRightStyleFamily = pRightStyle->GetFamily();
237 }
238}
239
241{
242}
243
245{
246 DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" );
247
248 // For SplitContent ParagraphInserted can not be called yet because the
249 // Outliner relies on the attributes to initialize the depth
250
253
255
257 if (GetEditEngine()->IsCallParaInsertedOrDeleted())
258 {
261 }
262
263 // Calling SetParaAttribs is effective only after ParagraphInserted
265
266 if (GetEditEngine()->GetStyleSheetPool())
267 {
268 if ( !aLeftStyleName.isEmpty() )
269 GetEditEngine()->SetStyleSheet( nNode, static_cast<SfxStyleSheet*>(GetEditEngine()->GetStyleSheetPool()->Find( aLeftStyleName, eLeftStyleFamily )) );
270 if ( !aRightStyleName.isEmpty() )
271 GetEditEngine()->SetStyleSheet( nNode+1, static_cast<SfxStyleSheet*>(GetEditEngine()->GetStyleSheetPool()->Find( aRightStyleName, eRightStyleFamily )) );
272 }
273
275}
276
278{
279 DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: Np Active View!" );
281
283}
284
286 EditEngine* pEE, sal_Int32 nN, sal_uInt16 nSP) :
288 nNode(nN), nSepPos(nSP) {}
289
291
293{
294 DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" );
295 EditPaM aPaM = GetEditEngine()->ConnectContents(nNode, false);
297}
298
300{
301 DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" );
304}
305
307 EditEngine* pEE, const EPaM& rEPaM, OUString aStr) :
309 aEPaM(rEPaM),
310 aText(std::move(aStr)) {}
311
313{
314 DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" );
316 EditSelection aSel( aPaM, aPaM );
317 aSel.Max().SetIndex( aSel.Max().GetIndex() + aText.getLength() );
318 EditPaM aNewPaM( GetEditEngine()->DeleteSelection(aSel) );
320}
321
323{
324 DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" );
327 EditPaM aNewPaM( aPaM );
328 aNewPaM.SetIndex( aNewPaM.GetIndex() + aText.getLength() );
330}
331
333{
334 EditUndoInsertChars* pNext = dynamic_cast<EditUndoInsertChars*>(pNextAction);
335 if (!pNext)
336 return false;
337
338 if ( aEPaM.nPara != pNext->aEPaM.nPara )
339 return false;
340
341 if ( ( aEPaM.nIndex + aText.getLength() ) == pNext->aEPaM.nIndex )
342 {
343 aText += pNext->aText;
344 return true;
345 }
346 return false;
347}
348
350 EditEngine* pEE, const EPaM& rEPaM, OUString aStr) :
352 aEPaM(rEPaM), aText(std::move(aStr)) {}
353
355{
356 DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" );
358 EditSelection aSel( aPaM, aPaM );
360 aSel.Max().SetIndex( aSel.Max().GetIndex() + aText.getLength() );
362}
363
365{
366 DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" );
368 EditSelection aSel( aPaM, aPaM );
369 aSel.Max().SetIndex( aSel.Max().GetIndex() + aText.getLength() );
370 EditPaM aNewPaM = GetEditEngine()->DeleteSelection(aSel);
372}
373
375 EditEngine* pEE, const EPaM& rEPaM, const SfxPoolItem& rFeature) :
377 aEPaM(rEPaM),
378 pFeature(rFeature.Clone())
379{
380 DBG_ASSERT( pFeature, "Feature could not be duplicated: EditUndoInsertFeature" );
381}
382
384{
385}
386
388{
389 DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" );
391 EditSelection aSel( aPaM, aPaM );
392 // Attributes are then corrected implicitly by the document ...
393 aSel.Max().SetIndex( aSel.Max().GetIndex()+1 );
395 aSel.Max().SetIndex( aSel.Max().GetIndex()-1 ); // For Selection
397}
398
400{
401 DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" );
403 EditSelection aSel( aPaM, aPaM );
405 if ( pFeature->Which() == EE_FEATURE_FIELD )
407 aSel.Max().SetIndex( aSel.Max().GetIndex()+1 );
409}
410
412 EditEngine* pEE, const Range& rParas, sal_Int32 n) :
413 EditUndo(EDITUNDO_MOVEPARAGRAPHS, pEE), nParagraphs(rParas), nDest(n) {}
414
416
418{
419 DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" );
420 Range aTmpRange( nParagraphs );
421 tools::Long nTmpDest = aTmpRange.Min();
422
423 tools::Long nDiff = nDest - aTmpRange.Min();
424 aTmpRange.Min() += nDiff;
425 aTmpRange.Max() += nDiff;
426
427 if ( nParagraphs.Min() < static_cast<tools::Long>(nDest) )
428 {
429 tools::Long nLen = aTmpRange.Len();
430 aTmpRange.Min() -= nLen;
431 aTmpRange.Max() -= nLen;
432 }
433 else
434 nTmpDest += aTmpRange.Len();
435
436 EditSelection aNewSel = GetEditEngine()->MoveParagraphs(aTmpRange, nTmpDest);
438}
439
441{
442 DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" );
445}
446
448 EditEngine* pEE, sal_Int32 nP, OUString _aPrevName, SfxStyleFamily ePrevFam,
449 OUString _aNewName, SfxStyleFamily eNewFam, SfxItemSet _aPrevParaAttribs) :
451 nPara(nP),
452 aPrevName(std::move(_aPrevName)),
453 aNewName(std::move(_aNewName)),
454 ePrevFamily(ePrevFam),
455 eNewFamily(eNewFam),
456 aPrevParaAttribs(std::move(_aPrevParaAttribs))
457{
458}
459
461{
462}
463
465{
466 DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" );
467 GetEditEngine()->SetStyleSheet( nPara, static_cast<SfxStyleSheet*>(GetEditEngine()->GetStyleSheetPool()->Find( aPrevName, ePrevFamily )) );
470}
471
473{
474 DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" );
475 GetEditEngine()->SetStyleSheet( nPara, static_cast<SfxStyleSheet*>(GetEditEngine()->GetStyleSheetPool()->Find( aNewName, eNewFamily )) );
477}
478
480 EditEngine* pEE, sal_Int32 nP, SfxItemSet _aPrevItems, SfxItemSet _aNewItems) :
482 nPara(nP),
483 aPrevItems(std::move(_aPrevItems)),
484 aNewItems(std::move(_aNewItems)) {}
485
487
489{
490 DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" );
493}
494
496{
497 DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" );
500}
501
504 aESel(rESel),
505 aNewAttribs(std::move(aNewItems)),
506 nSpecial(SetAttribsMode::NONE),
507 m_bSetSelection(true),
508 // When EditUndoSetAttribs actually is a RemoveAttribs this could be
509 // recognize by the empty itemset, but then it would have to be caught in
510 // its own place, which possible a setAttribs does with an empty itemset.
511 bSetIsRemove(false),
512 bRemoveParaAttribs(false),
513 nRemoveWhich(0)
514{
515}
516
517namespace {
518
519struct RemoveAttribsFromPool
520{
521 SfxItemPool& mrPool;
522public:
523 explicit RemoveAttribsFromPool(SfxItemPool& rPool) : mrPool(rPool) {}
524 void operator() (std::unique_ptr<ContentAttribsInfo> const & rInfo)
525 {
526 rInfo->RemoveAllCharAttribsFromPool(mrPool);
527 }
528};
529
530}
531
533{
534 // Get Items from Pool...
536 std::for_each(aPrevAttribs.begin(), aPrevAttribs.end(), RemoveAttribsFromPool(*pPool));
537}
538
540{
541 DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" );
542 EditEngine* pEE = GetEditEngine();
543 bool bFields = false;
544 for ( sal_Int32 nPara = aESel.nStartPara; nPara <= aESel.nEndPara; nPara++ )
545 {
546 const ContentAttribsInfo& rInf = *aPrevAttribs[nPara-aESel.nStartPara];
547
548 // first the paragraph attributes ...
549 pEE->SetParaAttribsOnly(nPara, rInf.GetPrevParaAttribs());
550
551 // Then the character attributes ...
552 // Remove all attributes including features, are later re-established.
553 pEE->RemoveCharAttribs(nPara, 0, true);
554 DBG_ASSERT( pEE->GetEditDoc().GetObject( nPara ), "Undo (SetAttribs): pNode = NULL!" );
555 ContentNode* pNode = pEE->GetEditDoc().GetObject( nPara );
556 for (const auto & nAttr : rInf.GetPrevCharAttribs())
557 {
558 const EditCharAttrib& rX = *nAttr;
559 // is automatically "poolsized"
560 pEE->GetEditDoc().InsertAttrib(pNode, rX.GetStart(), rX.GetEnd(), *rX.GetItem());
561 if (rX.Which() == EE_FEATURE_FIELD)
562 bFields = true;
563 }
564 }
565 if ( bFields )
566 pEE->UpdateFieldsOnly();
567 if (m_bSetSelection)
568 {
570 }
571}
572
574{
575 DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" );
576 EditEngine* pEE = GetEditEngine();
577
579 if ( !bSetIsRemove )
580 pEE->SetAttribs( aSel, aNewAttribs, nSpecial );
581 else
583
584 if (m_bSetSelection)
585 {
587 }
588}
589
591{
592 aPrevAttribs.push_back(std::unique_ptr<ContentAttribsInfo>(pNew));
593}
594
596{
597 EditEngine* pEE = GetEditEngine();
600}
601
604 aOldESel(rESel), nMode(nM) {}
605
607{
608}
609
611{
612 DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" );
613
614 EditEngine* pEE = GetEditEngine();
615
617
618 // Insert text, but don't expand Attribs at the current position:
619 aSel = pEE->DeleteSelected( aSel );
620 EditSelection aDelSel( aSel );
621 aSel = pEE->InsertParaBreak( aSel );
622 aDelSel.Max() = aSel.Min();
624 EditSelection aNewSel;
625 if ( pTxtObj )
626 {
627 aNewSel = pEE->InsertText( *pTxtObj, aSel );
628 }
629 else
630 {
631 aNewSel = pEE->InsertText( aSel, aText );
632 }
633 if ( aNewSel.Min().GetNode() == aDelSel.Max().GetNode() )
634 {
635 aNewSel.Min().SetNode( aDelSel.Min().GetNode() );
636 aNewSel.Min().SetIndex( aNewSel.Min().GetIndex() + aDelSel.Min().GetIndex() );
637 }
638 if ( aNewSel.Max().GetNode() == aDelSel.Max().GetNode() )
639 {
640 aNewSel.Max().SetNode( aDelSel.Min().GetNode() );
641 aNewSel.Max().SetIndex( aNewSel.Max().GetIndex() + aDelSel.Min().GetIndex() );
642 }
643 pEE->DeleteSelected( aDelSel );
644 pEE->GetActiveView()->GetImpEditView()->SetEditSelection( aNewSel );
645}
646
648{
649 DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" );
650 EditEngine* pEE = GetEditEngine();
651
653 EditSelection aNewSel = pEE->TransliterateText( aSel, nMode );
654 pEE->GetActiveView()->GetImpEditView()->SetEditSelection( aNewSel );
655}
656
658 EditUndo(EDITUNDO_MARKSELECTION, pEE), aSelection(rSel) {}
659
661
663{
664 DBG_ASSERT( GetEditEngine()->GetActiveView(), "Undo/Redo: No Active View!" );
665 if ( GetEditEngine()->GetActiveView() )
666 {
667 if ( GetEditEngine()->IsFormatted() )
669 else
671 }
672}
673
675{
676 // For redo unimportant, because at the beginning of the undo parentheses
677}
678
679/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void DeleteEmptyAttribs(SfxItemPool &rItemPool)
Definition: editdoc.cxx:3006
const SfxItemSet & GetPrevParaAttribs() const
Definition: editdoc.hxx:122
const CharAttribsType & GetPrevCharAttribs() const
Definition: editdoc.hxx:123
CharAttribList & GetCharAttribs()
Definition: editdoc.hxx:256
sal_Int32 Len() const
Definition: editdoc.cxx:1615
sal_Int32 & GetStart()
Definition: editattr.hxx:87
const SfxPoolItem * GetItem() const
Definition: editattr.hxx:85
sal_uInt16 Which() const
Definition: editattr.hxx:84
sal_Int32 & GetEnd()
Definition: editattr.hxx:88
void InsertAttrib(const SfxPoolItem &rItem, ContentNode *pNode, sal_Int32 nStart, sal_Int32 nEnd)
Definition: editdoc.cxx:2552
SfxItemPool & GetItemPool()
Definition: editdoc.hxx:812
const ContentNode * GetObject(sal_Int32 nPos) const
Definition: editdoc.cxx:2091
sal_Int32 Count() const
Definition: editdoc.cxx:2143
void Release(sal_Int32 nPos)
does not delete
Definition: editdoc.cxx:2131
ViewsType & GetEditViews()
Definition: editeng.cxx:784
void RemoveParaPortion(sal_Int32 nNode)
Definition: editeng.cxx:716
EditSelection MoveParagraphs(const Range &rParagraphs, sal_Int32 nNewPos)
Definition: editeng.cxx:761
virtual OUString GetUndoComment(sal_uInt16 nUndoId) const
Definition: editeng.cxx:2564
EditPaM DeleteSelection(const EditSelection &rSel)
Definition: editeng.cxx:935
void RemoveCharAttribs(sal_Int32 nPara, sal_uInt16 nWhich=0, bool bRemoveFeatures=false)
Definition: editeng.cxx:766
bool UpdateFieldsOnly()
Definition: editeng.cxx:2372
EditPaM DeleteSelected(const EditSelection &rSel)
Definition: editeng.cxx:970
virtual void ParagraphDeleted(sal_Int32 nDeletedParagraph)
Definition: editeng.cxx:2529
void SetParaAttribsOnly(sal_Int32 nPara, const SfxItemSet &rSet)
Definition: editeng.cxx:955
EditPaM ConnectContents(sal_Int32 nLeftNode, bool bBackward)
Definition: editeng.cxx:751
void AppendDeletedNodeInfo(DeletedNodeInfo *pInfo)
Definition: editeng.cxx:731
EditSelection CreateSelection(const ESelection &rSel)
Definition: editeng.cxx:945
EditView * GetActiveView() const
Definition: editeng.cxx:365
EditSelection InsertText(css::uno::Reference< css::datatransfer::XTransferable > const &rxDataObj, const OUString &rBaseURL, const EditPaM &rPaM, bool bUseSpecial)
void SetStyleSheet(const EditSelection &aSel, SfxStyleSheet *pStyle)
Definition: editeng.cxx:2138
void InsertContent(ContentNode *pNode, sal_Int32 nPos)
Definition: editeng.cxx:741
void SetUndoMode(bool b)
Definition: editeng.cxx:794
void InsertFeature(const EditSelection &rEditSelection, const SfxPoolItem &rItem)
Definition: editeng.cxx:756
EditPaM CreateEditPaM(const EPaM &rEPaM)
Definition: editeng.cxx:824
bool IsUpdateLayout() const
Definition: editeng.cxx:1482
virtual void ParagraphInserted(sal_Int32 nNewParagraph)
Definition: editeng.cxx:2518
bool IsCallParaInsertedOrDeleted() const
Definition: editeng.cxx:726
EditPaM SplitContent(sal_Int32 nNode, sal_Int32 nSepPos)
Definition: editeng.cxx:746
void FormatAndLayout(EditView *pCurView, bool bCalledFromUndo=false)
Definition: editeng.cxx:799
EditPaM InsertParaBreak(const EditSelection &rEditSelection)
Definition: editeng.cxx:2865
void SetCallParaInsertedOrDeleted(bool b)
Definition: editeng.cxx:721
void SetAttribs(const EditSelection &rSel, const SfxItemSet &rSet, SetAttribsMode nSpecial=SetAttribsMode::NONE)
Definition: editeng.cxx:960
void TransliterateText(const ESelection &rSelection, TransliterationFlags nTransliterationMode)
Definition: editeng.cxx:495
virtual void SetParaAttribs(sal_Int32 nPara, const SfxItemSet &rSet)
Definition: editeng.cxx:1747
void SetActiveView(EditView *pView)
Definition: editeng.cxx:370
void UpdateSelections()
Definition: editeng.cxx:736
EditDoc & GetEditDoc()
Definition: editeng.cxx:905
void SetIndex(sal_Int32 n)
Definition: editdoc.hxx:317
void SetNode(ContentNode *p)
Definition: editdoc.cxx:1122
const ContentNode * GetNode() const
Definition: editdoc.hxx:312
sal_Int32 GetIndex() const
Definition: editdoc.hxx:316
bool IsInvalid() const
Definition: editdoc.hxx:712
EditPaM & Min()
Definition: editdoc.hxx:705
bool DbgIsBuggy(EditDoc const &rDoc) const
Definition: editdoc.cxx:1134
EditPaM & Max()
Definition: editdoc.hxx:706
EditUndoConnectParas(EditEngine *pEE, sal_Int32 nNode, sal_uInt16 nSepPos, SfxItemSet aLeftParaAttribs, SfxItemSet aRightParaAttribs, const SfxStyleSheet *pLeftStyle, const SfxStyleSheet *pRightStyle, bool bBackward)
Definition: editundo.cxx:215
SfxStyleFamily eLeftStyleFamily
Definition: editundo.hxx:66
OUString aRightStyleName
Definition: editundo.hxx:65
SfxItemSet aRightParaAttribs
Definition: editundo.hxx:61
virtual void Redo() override
Definition: editundo.cxx:277
sal_uInt16 nSepPos
Definition: editundo.hxx:59
OUString aLeftStyleName
Definition: editundo.hxx:64
virtual ~EditUndoConnectParas() override
Definition: editundo.cxx:240
virtual void Undo() override
Definition: editundo.cxx:244
SfxStyleFamily eRightStyleFamily
Definition: editundo.hxx:67
SfxItemSet aLeftParaAttribs
Definition: editundo.hxx:60
EditUndoDelContent(EditEngine *pEE, ContentNode *pNode, sal_Int32 nPortion)
Definition: editundo.cxx:160
sal_Int32 nNode
Definition: editundo.hxx:40
ContentNode * pContentNode
Definition: editundo.hxx:41
virtual ~EditUndoDelContent() override
Definition: editundo.cxx:167
virtual void Redo() override
Definition: editundo.cxx:182
virtual void Undo() override
Definition: editundo.cxx:173
virtual void Redo() override
Definition: editundo.cxx:322
virtual void Undo() override
Definition: editundo.cxx:312
EditUndoInsertChars(EditEngine *pEE, const EPaM &rEPaM, OUString aStr)
Definition: editundo.cxx:306
virtual bool Merge(SfxUndoAction *pNextAction) override
Definition: editundo.cxx:332
std::unique_ptr< SfxPoolItem > pFeature
Definition: editundo.hxx:139
virtual ~EditUndoInsertFeature() override
Definition: editundo.cxx:383
EditUndoInsertFeature(EditEngine *pEE, const EPaM &rEPaM, const SfxPoolItem &rFeature)
Definition: editundo.cxx:374
virtual void Redo() override
Definition: editundo.cxx:399
virtual void Undo() override
Definition: editundo.cxx:387
EditEngine * mpEditEngine
Definition: editund2.hxx:34
EditUndoManager(sal_uInt16 nMaxUndoActionCount=20)
Definition: editundo.cxx:38
virtual bool Redo() override
Definition: editundo.cxx:85
void SetEditEngine(EditEngine *pNew)
Definition: editundo.cxx:44
virtual bool Undo() override
Definition: editundo.cxx:49
EditUndoMarkSelection(EditEngine *pEE, const ESelection &rSel)
Definition: editundo.cxx:657
virtual void Redo() override
Definition: editundo.cxx:674
ESelection aSelection
Definition: editundo.hxx:281
virtual ~EditUndoMarkSelection() override
Definition: editundo.cxx:660
virtual void Undo() override
Definition: editundo.cxx:662
virtual void Undo() override
Definition: editundo.cxx:417
EditUndoMoveParagraphs(EditEngine *pEE, const Range &rParas, sal_Int32 nDest)
Definition: editundo.cxx:411
virtual void Redo() override
Definition: editundo.cxx:440
virtual ~EditUndoMoveParagraphs() override
Definition: editundo.cxx:415
EditUndoRemoveChars(EditEngine *pEE, const EPaM &rEPaM, OUString aStr)
Definition: editundo.cxx:349
virtual void Redo() override
Definition: editundo.cxx:364
virtual void Undo() override
Definition: editundo.cxx:354
sal_uInt16 nRemoveWhich
Definition: editundo.hxx:225
void ImpSetSelection()
Definition: editundo.cxx:595
InfoArrayType aPrevAttribs
Definition: editundo.hxx:218
void AppendContentInfo(ContentAttribsInfo *pNew)
Definition: editundo.cxx:590
SetAttribsMode nSpecial
Definition: editundo.hxx:220
EditUndoSetAttribs(EditEngine *pEE, const ESelection &rESel, SfxItemSet aNewItems)
Definition: editundo.cxx:502
virtual void Undo() override
Definition: editundo.cxx:539
ESelection aESel
Definition: editundo.hxx:216
SfxItemSet aNewAttribs
Definition: editundo.hxx:217
bool m_bSetSelection
Once the attributes are set / unset, set the selection to the end of the formatted range?
Definition: editundo.hxx:222
virtual ~EditUndoSetAttribs() override
Definition: editundo.cxx:532
virtual void Redo() override
Definition: editundo.cxx:573
virtual void Redo() override
Definition: editundo.cxx:495
virtual ~EditUndoSetParaAttribs() override
Definition: editundo.cxx:486
EditUndoSetParaAttribs(EditEngine *pEE, sal_Int32 nPara, SfxItemSet aPrevItems, SfxItemSet aNewItems)
Definition: editundo.cxx:479
virtual void Undo() override
Definition: editundo.cxx:488
EditUndoSetStyleSheet(EditEngine *pEE, sal_Int32 nPara, OUString aPrevName, SfxStyleFamily ePrevFamily, OUString aNewName, SfxStyleFamily eNewFamily, SfxItemSet aPrevParaAttribs)
Definition: editundo.cxx:447
virtual void Undo() override
Definition: editundo.cxx:464
SfxStyleFamily ePrevFamily
Definition: editundo.hxx:175
SfxItemSet aPrevParaAttribs
Definition: editundo.hxx:177
virtual void Redo() override
Definition: editundo.cxx:472
virtual ~EditUndoSetStyleSheet() override
Definition: editundo.cxx:460
SfxStyleFamily eNewFamily
Definition: editundo.hxx:176
virtual void Redo() override
Definition: editundo.cxx:299
virtual ~EditUndoSplitPara() override
Definition: editundo.cxx:290
sal_Int32 nNode
Definition: editundo.hxx:87
virtual void Undo() override
Definition: editundo.cxx:292
EditUndoSplitPara(EditEngine *pEE, sal_Int32 nNode, sal_uInt16 nSepPos)
Definition: editundo.cxx:285
sal_uInt16 nSepPos
Definition: editundo.hxx:88
virtual void Undo() override
Definition: editundo.cxx:610
virtual void Redo() override
Definition: editundo.cxx:647
EditUndoTransliteration(EditEngine *pEE, const ESelection &rESel, TransliterationFlags nMode)
Definition: editundo.cxx:602
virtual ~EditUndoTransliteration() override
Definition: editundo.cxx:606
TransliterationFlags nMode
Definition: editundo.hxx:258
std::unique_ptr< EditTextObject > pTxtObj
Definition: editundo.hxx:260
virtual OUString GetComment() const override
Definition: editundo.cxx:145
virtual ~EditUndo() override
Definition: editundo.cxx:130
ViewShellId GetViewShellId() const override
See SfxUndoAction::GetViewShellId().
Definition: editundo.cxx:155
EditEngine * mpEditEngine
Definition: editund2.hxx:51
sal_uInt16 GetId() const
Definition: editundo.cxx:135
virtual bool CanRepeat(SfxRepeatTarget &) const override
Definition: editundo.cxx:140
sal_uInt16 nId
Definition: editund2.hxx:49
EditEngine * GetEditEngine()
Definition: editund2.hxx:57
ViewShellId mnViewShellId
Definition: editund2.hxx:50
EditUndo(sal_uInt16 nI, EditEngine *pEE)
Definition: editundo.cxx:121
ImpEditView * GetImpEditView() const
Definition: editview.hxx:162
void SetSelection(const ESelection &rNewSel)
Definition: editview.cxx:256
ImpEditEngine * GetImpEditEngine() const
Definition: editview.cxx:173
EditPaM CreateEditPaM(const EPaM &rEPaM)
Definition: impedit.hxx:1239
void DrawSelectionXOR()
Definition: impedit.hxx:395
const OutlinerViewShell * GetViewShell() const
Definition: impedit.cxx:240
const EditSelection & GetEditSelection() const
Definition: impedit.hxx:390
void SetEditSelection(const EditSelection &rEditSelection)
Definition: impedit.cxx:245
Interface class to not depend on SfxViewShell in editeng.
Definition: outliner.hxx:372
virtual ViewShellId GetViewShellId() const =0
tools::Long Max() const
tools::Long Len() const
tools::Long Min() const
SfxItemPool * GetPool() const
const OUString & GetName() const
SfxStyleFamily GetFamily() const
virtual bool Undo()
virtual bool Redo()
virtual size_t GetRedoActionCount(bool const i_currentLevel=CurrentLevel) const
virtual size_t GetUndoActionCount(bool const i_currentLevel=CurrentLevel) const
#define DBG_ASSERT(sCon, aError)
#define EDITUNDO_PARAATTRIBS
Definition: editdata.hxx:74
#define EDITUNDO_INSERTFEATURE
Definition: editdata.hxx:65
#define EDITUNDO_ATTRIBS
Definition: editdata.hxx:75
#define EDITUNDO_MOVEPARAGRAPHS
Definition: editdata.hxx:64
#define EDITUNDO_DELCONTENT
Definition: editdata.hxx:68
#define EDITUNDO_INSERTCHARS
Definition: editdata.hxx:67
#define EDITUNDO_MARKSELECTION
Definition: editdata.hxx:83
#define EDITUNDO_REMOVECHARS
Definition: editdata.hxx:62
#define EDITUNDO_SPLITPARA
Definition: editdata.hxx:66
#define EDITUNDO_STYLESHEET
Definition: editdata.hxx:78
#define EDITUNDO_TRANSLITERATE
Definition: editdata.hxx:84
#define EDITUNDO_CONNECTPARAS
Definition: editdata.hxx:63
static void lcl_DoSetSelection(EditView const *pView, sal_uInt16 nPara)
Definition: editundo.cxx:29
constexpr TypedWhichId< SvxFieldItem > EE_FEATURE_FIELD(EE_FEATURE_NOTCONV+1)
sal_Int64 n
aStr
NONE
css::uno::Reference< css::animations::XAnimationNode > Clone(const css::uno::Reference< css::animations::XAnimationNode > &xSourceNode, const SdPage *pSource=nullptr, const SdPage *pTarget=nullptr)
long Long
sal_Int16 nId
Definition: editdoc.hxx:56
sal_Int32 nIndex
Definition: editdoc.hxx:58
sal_Int32 nPara
Definition: editdoc.hxx:57
sal_Int32 nStartPara
Definition: editdata.hxx:113
sal_Int32 nEndPara
Definition: editdata.hxx:115
SfxStyleFamily
SW_DLLPUBLIC SwView * GetActiveView()
TransliterationFlags