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.

Classes

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

Namespaces

namespace  sw
 Dialog to specify the properties of date form field.
 

Functions

OUString ShortenString (const OUString &rStr, sal_Int32 nLength, std::u16string_view aFillStr)
 Shortens a string to a maximum length. More...
 
OUString DenoteSpecialCharacters (std::u16string_view aStr, bool bQuoted=true)
 Denotes special characters in a string. More...
 

Variables

const int nUndoStringLength = 20
 

Function Documentation

◆ DenoteSpecialCharacters()

OUString DenoteSpecialCharacters ( std::u16string_view  aStr,
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.

Parameters
aStrthe 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)").

Returns
the denoted string

Definition at line 715 of file undel.cxx.

References aStr, 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,
std::u16string_view  aFillStr 
)

Shortens a string to a maximum length.

Parameters
rStrthe string to be shortened
nLengththe maximum length for rStr
aFillStrstring 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(aFillStr)) / 2
rearLength = nLength - length(aFillStr) - frontLength
shortenedString = concat(<first frontLength characters of rStr,
                         aFillStr,
                         <last rearLength characters of rStr>)

Preconditions:

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

Definition at line 1579 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