LibreOffice Module sw (master) 1
Classes | Namespaces | Functions | Variables
UndoCore.hxx File Reference
#include <undobj.hxx>
#include <calbck.hxx>
#include <rtl/ustring.hxx>
#include <redline.hxx>
#include <numrule.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
class  SwUndoOutlineEdit


namespace  sw
 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, bool bQuoted=true)
 Denotes special characters in a string. More...


const int nUndoStringLength = 20

Function Documentation

◆ DenoteSpecialCharacters()

OUString DenoteSpecialCharacters ( const OUString &  rStr,
bool  bQuoted = true 

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
bQuotedadd quotation marks to the text

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 719 of file undel.cxx.

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

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

◆ ShortenString()

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 1538 of file undobj.cxx.

References nLength.

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

Variable Documentation

◆ nUndoStringLength

const int nUndoStringLength = 20