LibreOffice Module sw (master) 1
Classes | Typedefs
SwStyleNameMapper.hxx File Reference
#include <sal/types.h>
#include <rtl/ustring.hxx>
#include "SwGetPoolIdFromName.hxx"
#include "swdllapi.h"
#include <unordered_map>
#include <vector>
Include dependency graph for SwStyleNameMapper.hxx:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  SwStyleNameMapper
 

Typedefs

typedef std::unordered_map< OUString, sal_uInt16 > NameToIdHash
 This class holds all data about the names of styles used in the user interface (UI names...these are localised into different languages). More...
 

Typedef Documentation

◆ NameToIdHash

typedef std::unordered_map<OUString, sal_uInt16> NameToIdHash

This class holds all data about the names of styles used in the user interface (UI names...these are localised into different languages).

These UI names are loaded from the resource files on demand.

It also holds all information about the 'Programmatic' names of styles which remain static (and are hardcoded in the corresponding cxx file) for all languages.

This class also provides static functions which can be used for the following conversions:

  1. Programmatic Name -> UI Name
  2. Programmatic Name -> Pool ID
  3. UI Name -> Programmatic Name
  4. UI Name -> Pool ID
  5. Pool ID -> UI Name
  6. Pool ID -> Programmatic Name

The relationship of these tables to the style families is as follows:

  1. Paragraph contains the Text, Lists, Extra, Register, Doc and HTML name arrays.
  2. Character contains the ChrFormat and HTMLChrFormat name arrays.
  3. Page contains the PageDesc name array.
  4. Frame contains the FrameFormat name array.
  5. Numbering Rule contains the NumRule name array. There is a further complication that came to light later. If someone enters a user-defined style name which is the same as a programmatic name, this name clash must be handled.

Therefore, when there is a danger of a nameclash, the boolean bDisambiguate must be set to true in the SwStyleNameMapper call (it defaults to false). This will cause the following to happen:

If the UI style name either equals a programmatic name or already ends with " (user)", then it must append " (user)" to the end.

When a programmatic name is being converted to a UI name, if it ends in " (user)", we simply remove it.

Definition at line 74 of file SwStyleNameMapper.hxx.