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 | |
sw | |
Dialog to specify the properties of date form field. | |
Functions | |
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... | |
Variables | |
const int | nUndoStringLength = 20 |
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.
rStr | 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 717 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.
rStr | the string to be shortened |
nLength | the maximum length for rStr |
rFillStr | 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(rFillStr)) / 2 rearLength = nLength - length(rFillStr) - frontLength shortenedString = concat(<first frontLength characters of rStr, rFillStr, <last rearLength characters of rStr>)
Preconditions:
Definition at line 1534 of file undobj.cxx.
Referenced by SwUndoInsertLabel::CreateRewriter(), SwRangeRedline::GetDescr(), SwDoc::GetPaMDescr(), SwUndoOverwrite::GetRewriter(), SwUndoRedlineDelete::GetRewriter(), SwUndoInsert::GetRewriter(), SwUndoDelete::GetRewriter(), and MakeUndoReplaceRewriter().
const int nUndoStringLength = 20 |
Definition at line 243 of file UndoCore.hxx.
Referenced by SwUndoInsertLabel::CreateRewriter(), SwRangeRedline::GetDescr(), SwDoc::GetPaMDescr(), SwUndoOverwrite::GetRewriter(), SwUndoRedlineDelete::GetRewriter(), SwUndoInsert::GetRewriter(), SwUndoDelete::GetRewriter(), and MakeUndoReplaceRewriter().