LibreOffice Module sw (master)  1
Classes | Namespaces | Functions | Variables
UndoCore.hxx File Reference
#include <undobj.hxx>
#include <calbck.hxx>
#include <o3tl/deleter.hxx>
#include <rtl/ustring.hxx>
#include <redline.hxx>
#include <memory>
#include <vector>
Include dependency graph for UndoCore.hxx:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


class  SwRedlineSaveData
class  SwRedlineSaveDatas
class  sw::UndoRedoContext
class  sw::RepeatContext
class  SwUndoFormatColl
class  SwUndoSetFlyFormat
class  SwUndoOutlineLeftRight


 Dialog to specify the properties of date form field.


OUString ShortenString (const OUString &rStr, sal_Int32 nLength, const OUString &rFillStr)
 Shortens a string to a maximum length. More...
OUString DenoteSpecialCharacters (const OUString &rStr)
 Denotes special characters in a string. More...


const int nUndoStringLength = 20

Function Documentation

OUString DenoteSpecialCharacters ( const OUString &  rStr)

Denotes special characters in a string.

The rStr is split into parts containing special characters and parts not containing special characters. In a part containing special characters all characters are equal. These parts are maximal.

rStrthe string to denote in

The resulting string is generated by concatenating the found parts. The parts without special characters are surrounded by "'". The parts containing special characters are denoted as "n x", where n is the length of the part and x is the representation of the special character (i. e. "tab(s)").

the denoted string

Definition at line 715 of file undel.cxx.

References SwRewriter::GetPlaceHolder(), i, lcl_DenotedPortion(), lcl_IsSpecialCharacter(), and UndoArg2.

Referenced by SwRangeRedline::GetDescr(), SwUndoRedlineDelete::GetRewriter(), SwUndoInsert::GetRewriter(), and SwUndoDelete::GetRewriter().

OUString ShortenString ( const OUString &  rStr,
sal_Int32  nLength,
const OUString &  rFillStr 

Shortens a string to a maximum length.

rStrthe string to be shortened
nLengththe maximum length for rStr
rFillStrstring to replace cut out characters with

If rStr has less than nLength characters it will be returned unaltered.

If rStr has more than nLength characters the following algorithm generates the shortened string:

frontLength = (nLength - length(rFillStr)) / 2
rearLength = nLength - length(rFillStr) - frontLength
shortenedString = concat(<first frontLength characters of rStr,
                         <last rearLength characters of rStr>)


  • nLength - length(rFillStr) >= 2
the shortened string

Definition at line 1523 of file undobj.cxx.

References assert().

Referenced by SwUndoInsertLabel::CreateRewriter(), SwRangeRedline::GetDescr(), SwDoc::GetPaMDescr(), SwUndoOverwrite::GetRewriter(), SwUndoRedlineDelete::GetRewriter(), SwUndoInsert::GetRewriter(), SwUndoDelete::GetRewriter(), and MakeUndoReplaceRewriter().

Variable Documentation

const int nUndoStringLength = 20