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

Knows which writer style a given word style should be imported as. More...

#include <msfilter.hxx>

Public Types

typedef std::pair< SwCharFormat *, bool > StyleResult
 StyleResult StyleResult is a std::pair of a pointer to a style and a flag which is true if the style existed previously in the document. More...
 

Public Member Functions

 CharStyleMapper (SwDoc &rDoc)
 
 ~CharStyleMapper ()
 
StyleResult GetStyle (const OUString &rName, ww::sti eSti)
 Get the writer style which the word style should map to. More...
 

Private Attributes

std::unique_ptr<::myImplHelpers::StyleMapperImpl< SwCharFormat > > mpImpl
 

Detailed Description

Knows which writer style a given word style should be imported as.

Mapping a word style to a writer style has to consider mapping the word builtin styles like "Normal" as the default root style to our default root style which is called "Default" in english, and "Normal" in german.

Additionally it then has to avoid name collisions such as

a) styles "Normal" and "Default" in a single document, where we can use the original distinct names "Normal" and "Default" and... b) styles "Normal" and "Default" in a single document, where we can not use the original names, and must come up with an alternative name for one of them...

And it needs to report to the importer if the style being mapped to was already in existence, for the cut and paste/insert file mode we should not modify the returned style if it is already in use as it is does not belong to us to change.

Definition at line 202 of file msfilter.hxx.

Member Typedef Documentation

StyleResult StyleResult is a std::pair of a pointer to a style and a flag which is true if the style existed previously in the document.

Definition at line 215 of file msfilter.hxx.

Constructor & Destructor Documentation

sw::util::CharStyleMapper::CharStyleMapper ( SwDoc rDoc)
explicit

Definition at line 468 of file writerwordglue.cxx.

sw::util::CharStyleMapper::~CharStyleMapper ( )

Definition at line 473 of file writerwordglue.cxx.

Member Function Documentation

CharStyleMapper::StyleResult sw::util::CharStyleMapper::GetStyle ( const OUString &  rName,
ww::sti  eSti 
)

Get the writer style which the word style should map to.

Parameters
rNameThe name of the word style
eStiThe style id of the word style, we are really only interested in knowing if the style has either a builtin standard id, or is a user defined style.
Returns
The equivalent writer style packaged as a StyleResult to use for this word style.

It will only return a failure in the pathological case of catastrophic failure elsewhere of there exist already styles rName and WW-rName[0..SAL_MAX_INT32], which is both unlikely and impossible.

Definition at line 477 of file writerwordglue.cxx.

References mpImpl.

Referenced by WW8RStyle::PrepareStyle().

Member Data Documentation

std::unique_ptr<::myImplHelpers::StyleMapperImpl<SwCharFormat> > sw::util::CharStyleMapper::mpImpl
private

Definition at line 206 of file msfilter.hxx.

Referenced by GetStyle().


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