37void Shorten (OUString& rString)
39 auto const nLen = rString.getLength();
45 auto iFirst = rString.lastIndexOf(
' ', 32);
46 if (iFirst == -1 || iFirst < 16)
49 auto iLast = rString.indexOf(
' ', nLen - 16);
50 if (iLast == -1 || iLast > nLen - 4)
54 OUString::Concat(rString.subView(0, iFirst + 1)) +
56 rString.subView(iLast);
174 auto it = ::std::find_if( rDocNodes.begin(), rDocNodes.end(),
175 [&] (std::unique_ptr<TextNode>
const &
p) { return p.get() == mpNode; } );
176 assert(it != rDocNodes.end());
185 const sal_uInt32 nParas =
static_cast<sal_uInt32
>(
GetDoc()->
GetNodes().size());
194 return VclResId(STR_TEXTUNDO_DELPARA);
222 return VclResId(STR_TEXTUNDO_CONNECTPARAS);
250 return VclResId(STR_TEXTUNDO_SPLITPARA);
298 return VclResId(STR_TEXTUNDO_INSERTCHARS).replaceAll(
"$1", sText);
328 return VclResId(STR_TEXTUNDO_REMOVECHARS).replaceAll(
"$1", sText);
virtual size_t GetRedoActionCount(bool const i_currentLevel=CurrentLevel) const
virtual size_t GetUndoActionCount(bool const i_currentLevel=CurrentLevel) const
void Remove(sal_uInt32 nPos)
std::vector< std::unique_ptr< TextNode > > & GetNodes()
TextPaM SplitContent(sal_uInt32 nNode, sal_Int32 nSepPos)
void SetIsInUndo(bool bInUndo)
void ImpParagraphRemoved(sal_uInt32 nPara)
TextPaM ConnectContents(sal_uInt32 nLeftNode)
void InsertContent(std::unique_ptr< TextNode > pNode, sal_uInt32 nPara)
TextPaM ImpInsertText(const TextSelection &rSel, sal_Unicode c, bool bOverwrite=false)
void FormatAndUpdate(TextView *pCurView=nullptr)
TextPaM ImpDeleteText(const TextSelection &rSel)
const OUString & GetText() const
sal_uInt32 GetPara() const
sal_Int32 GetIndex() const
const TextPaM & GetStart() const
const TextPaM & GetEnd() const
virtual void Undo() override
TextUndoConnectParas(TextEngine *pTextEngine, sal_uInt32 nPara, sal_Int32 nSepPos)
virtual ~TextUndoConnectParas() override
virtual OUString GetComment() const override
virtual void Redo() override
virtual void Undo() override
virtual OUString GetComment() const override
virtual void Redo() override
virtual ~TextUndoDelPara() override
TextUndoDelPara(TextEngine *pTextEngine, TextNode *pNode, sal_uInt32 nPara)
TextUndoInsertChars(TextEngine *pTextEngine, const TextPaM &rTextPaM, OUString aStr)
virtual OUString GetComment() const override
virtual void Undo() override
virtual bool Merge(SfxUndoAction *pNextAction) override
virtual void Redo() override
virtual bool Undo() override
TextView * GetView() const
TextUndoManager(TextEngine *pTextEngine)
virtual bool Redo() override
TextEngine * mpTextEngine
virtual ~TextUndoManager() override
virtual OUString GetComment() const override
virtual void Undo() override
TextUndoRemoveChars(TextEngine *pTextEngine, const TextPaM &rTextPaM, OUString aStr)
virtual void Redo() override
virtual void Undo() override
virtual OUString GetComment() const override
virtual void Redo() override
virtual ~TextUndoSplitPara() override
TextUndoSplitPara(TextEngine *pTextEngine, sal_uInt32 nPara, sal_Int32 nSepPos)
TextEngine * mpTextEngine
virtual ~TextUndo() override
TextView * GetView() const
TextEngine * GetTextEngine() const
TEParaPortions * GetTEParaPortions() const
virtual OUString GetComment() const override
void SetSelection(const TextSelection &rSel)
TextUndo(TextEngine *pTextEngine)
void ImpSetSelection(const TextSelection &rSelection)
#define SAL_WARN_IF(condition, area, stream)
OUString VclResId(TranslateId aId)
void GetSelection(struct ESelection &rSel, SvxTextForwarder const *pForwarder) noexcept