LibreOffice Module sw (master) 1
|
#include <undobj.hxx>
#include <calbck.hxx>
#include <rtl/ustring.hxx>
#include <redline.hxx>
#include <numrule.hxx>
#include <memory>
#include <vector>
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 |
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.
aStr | the string to denote in |
bQuoted | add 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)").
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().
OUString ShortenString | ( | const OUString & | rStr, |
sal_Int32 | nLength, | ||
std::u16string_view | aFillStr | ||
) |
Shortens a string to a maximum length.
rStr | the string to be shortened |
nLength | the maximum length for rStr |
aFillStr | string 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:
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().
const int nUndoStringLength = 20 |
Definition at line 243 of file UndoCore.hxx.
Referenced by SwUndoInsertLabel::CreateRewriter(), SwRangeRedline::GetDescr(), SwDoc::GetPaMDescr(), SwUndoDelete::GetRewriter(), SwUndoInsert::GetRewriter(), SwUndoOverwrite::GetRewriter(), SwUndoRedlineDelete::GetRewriter(), and MakeUndoReplaceRewriter().