LibreOffice Module sw (master) 1
|
Knows which writer style a given word style should be imported as. More...
#include <msfilter.hxx>
Public Types | |
typedef std::pair< SwTextFormatColl *, 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 | |
ParaStyleMapper (SwDoc &rDoc) | |
~ParaStyleMapper () | |
StyleResult | GetStyle (const OUString &rName, ww::sti eSti, std::map< OUString, sal_Int32 > &rCollisions) |
Get the writer style which the word style should map to. More... | |
Private Attributes | |
std::unique_ptr<::myImplHelpers::StyleMapperImpl< SwTextFormatColl > > | mpImpl |
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 does not belong to us to change.
Definition at line 140 of file msfilter.hxx.
typedef std::pair<SwTextFormatColl*, bool> sw::util::ParaStyleMapper::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.
Definition at line 153 of file msfilter.hxx.
|
explicit |
Definition at line 468 of file writerwordglue.cxx.
sw::util::ParaStyleMapper::~ParaStyleMapper | ( | ) |
Definition at line 473 of file writerwordglue.cxx.
ParaStyleMapper::StyleResult sw::util::ParaStyleMapper::GetStyle | ( | const OUString & | rName, |
ww::sti | eSti, | ||
std::map< OUString, sal_Int32 > & | rCollisions | ||
) |
Get the writer style which the word style should map to.
rName | The name of the word style |
eSti | The 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. |
rCollisions | Cache of previous name collisions to speed up resolution of later duplicates. |
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().
|
private |
Definition at line 144 of file msfilter.hxx.
Referenced by GetStyle().