LibreOffice Module sw (master)  1
Public Member Functions | Private Attributes | List of all members
sw::ToxWhitespaceStripper Class Reference

This class helps to remove unwanted whitespaces from a string to use in a Tox. More...

#include <ToxWhitespaceStripper.hxx>

Collaboration diagram for sw::ToxWhitespaceStripper:
[legend]

Public Member Functions

 ToxWhitespaceStripper (const OUString &)
 
sal_Int32 GetPositionInStrippedString (sal_Int32 pos) const
 
const OUString & GetStrippedString () const
 

Private Attributes

OUString mStripped
 
std::vector< sal_Int32 > mNewPositions
 

Detailed Description

This class helps to remove unwanted whitespaces from a string to use in a Tox.

The new string will have

It also allows to find the corresponding new positions of the input string in the stripped string. This is important for attributes which might have to be imported, e.g., it helps to answer the question: The 3rd character of the input string is subscript, which character in the output string is that?

Note
One leading whitespace is preserved.

Definition at line 32 of file ToxWhitespaceStripper.hxx.

Constructor & Destructor Documentation

sw::ToxWhitespaceStripper::ToxWhitespaceStripper ( const OUString &  inputString)

Definition at line 18 of file ToxWhitespaceStripper.cxx.

References mNewPositions, and mStripped.

Member Function Documentation

sal_Int32 sw::ToxWhitespaceStripper::GetPositionInStrippedString ( sal_Int32  pos) const

Definition at line 51 of file ToxWhitespaceStripper.cxx.

References mNewPositions, and SAL_WARN.

Referenced by sw::ToxTextGenerator::GetAttributesForNode().

const OUString& sw::ToxWhitespaceStripper::GetStrippedString ( ) const
inline

Definition at line 41 of file ToxWhitespaceStripper.hxx.

References mStripped.

Member Data Documentation

std::vector<sal_Int32> sw::ToxWhitespaceStripper::mNewPositions
private

Definition at line 45 of file ToxWhitespaceStripper.hxx.

Referenced by GetPositionInStrippedString(), and ToxWhitespaceStripper().

OUString sw::ToxWhitespaceStripper::mStripped
private

Definition at line 44 of file ToxWhitespaceStripper.hxx.

Referenced by GetStrippedString(), and ToxWhitespaceStripper().


The documentation for this class was generated from the following files: