LibreOffice Module xmloff (master) 1
Public Member Functions | Static Public Member Functions | Private Types | Private Attributes | List of all members
XMLTextListsHelper Class Reference

#include <txtlists.hxx>

Public Member Functions

 XMLTextListsHelper ()
 
 XMLTextListsHelper (const XMLTextListsHelper &)=delete
 
XMLTextListsHelperoperator= (const XMLTextListsHelper &)=delete
 
void PushListContext (XMLTextListBlockContext *i_pListBlock)
 list stack for importing: More...
 
void PushListContext (XMLNumberedParaContext *i_pNumberedParagraph)
 
void PopListContext ()
 pop the list context stack More...
 
void ListContextTop (XMLTextListBlockContext *&o_pListBlockContext, XMLTextListItemContext *&o_pListItemContext, XMLNumberedParaContext *&o_pNumberedParagraphContext)
 peek at the top of the list context stack More...
 
void SetListItem (XMLTextListItemContext *pListItem)
 set list item on top of the list context stack More...
 
void KeepListAsProcessed (const OUString &sListId, const OUString &sListStyleName, const OUString &sContinueListId, const OUString &sListStyleDefaultListId=OUString())
 
bool IsListProcessed (const OUString &sListId) const
 
OUString GetListStyleOfProcessedList (const OUString &sListId) const
 
OUString GetContinueListIdOfProcessedList (const OUString &sListId) const
 
const OUString & GetLastProcessedListId () const
 
const OUString & GetListStyleOfLastProcessedList () const
 
OUString GenerateNewListId () const
 
OUString GetListIdForListBlock (XMLTextListBlockContext const &rListBlock)
 
void StoreLastContinuingList (const OUString &sListId, const OUString &sContinuingListId)
 
OUString GetLastContinuingListId (const OUString &sListId) const
 
void PushListOnStack (const OUString &sListId, const OUString &sListStyleName)
 
void PopListFromStack ()
 
bool EqualsToTopListStyleOnStack (std::u16string_view sListId) const
 
css::uno::Reference< css::container::XIndexReplace > EnsureNumberedParagraph (SvXMLImport &i_rImport, const OUString &i_ListId, sal_Int16 &io_rLevel, const OUString &i_StyleName)
 for importing numbered-paragraph note that the ID namespace for numbered-paragraph and regular list is distinct; we never combine a list and a n-p More...
 
OUString GetNumberedParagraphListId (const sal_uInt16 i_Level, std::u16string_view i_StyleName)
 get ID of the last numbered-paragraph iff it has given style-name More...
 
OUString GetLastIdOfStyleName (const OUString &sListStyleName) const
 Looks up the last list id of a given list style, by name. More...
 

Static Public Member Functions

static css::uno::Reference< css::container::XIndexReplace > MakeNumRule (SvXMLImport &i_rImport, const css::uno::Reference< css::container::XIndexReplace > &i_xNumRule, std::u16string_view i_ParentStyleName, const OUString &i_StyleName, sal_Int16 &io_rLevel, bool *o_pRestartNumbering=nullptr, bool *io_pSetDefaults=nullptr)
 Creates a NumRule from given style-name. More...
 

Private Types

typedef std::tuple< SvXMLImportContextRef, SvXMLImportContextRef, SvXMLImportContextRefListStackFrame_t
 list context: list, list-item, numbered-paragraph XMLTextListBlockContext, XMLTextListItemContext, XMLNumberedParaContext More...
 
typedef ::std::map< OUString, ::std::pair< OUString, OUString > > tMapForLists
 
typedef ::std::map< OUString, OUString > tMapForContinuingLists
 
typedef ::std::vector< ::std::pair< OUString, OUString > > tStackForLists
 
typedef ::std::vector< ::std::pair< OUString, OUString > > LastNumberedParagraphs_t
 to connect numbered-paragraphs that have no list-id attribute: vector of pair of style-name and list-id (indexed by level) More...
 
typedef ::std::vector< ::std::pair< OUString, css::uno::Reference< css::container::XIndexReplace > > > NumParaList_t
 numbered-paragraphs More...
 

Private Attributes

std::stack< ListStackFrame_tmListStack
 
std::unique_ptr< tMapForListsmpProcessedLists
 
OUString msLastProcessedListId
 
OUString msListStyleOfLastProcessedList
 
std::unique_ptr< tMapForListsmpMapListIdToListStyleDefaultListId
 
std::unique_ptr< tMapForContinuingListsmpContinuingLists
 
std::unique_ptr< std::map< OUString, OUString > > mpStyleNameLastListIds
 
std::unique_ptr< tStackForListsmpListStack
 
LastNumberedParagraphs_t mLastNumberedParagraphs
 
::std::map< OUString, NumParaList_tmNPLists
 

Detailed Description

Definition at line 37 of file txtlists.hxx.

Member Typedef Documentation

◆ LastNumberedParagraphs_t

typedef ::std::vector< ::std::pair< OUString, OUString > > XMLTextListsHelper::LastNumberedParagraphs_t
private

to connect numbered-paragraphs that have no list-id attribute: vector of pair of style-name and list-id (indexed by level)

Definition at line 169 of file txtlists.hxx.

◆ ListStackFrame_t

list context: list, list-item, numbered-paragraph XMLTextListBlockContext, XMLTextListItemContext, XMLNumberedParaContext

Definition at line 134 of file txtlists.hxx.

◆ NumParaList_t

typedef ::std::vector< ::std::pair< OUString, css::uno::Reference< css::container::XIndexReplace > > > XMLTextListsHelper::NumParaList_t
private

numbered-paragraphs

Definition at line 177 of file txtlists.hxx.

◆ tMapForContinuingLists

typedef ::std::map< OUString, OUString > XMLTextListsHelper::tMapForContinuingLists
private

Definition at line 155 of file txtlists.hxx.

◆ tMapForLists

typedef ::std::map< OUString, ::std::pair< OUString, OUString > > XMLTextListsHelper::tMapForLists
private

Definition at line 141 of file txtlists.hxx.

◆ tStackForLists

typedef ::std::vector< ::std::pair< OUString, OUString > > XMLTextListsHelper::tStackForLists
private

Definition at line 163 of file txtlists.hxx.

Constructor & Destructor Documentation

◆ XMLTextListsHelper() [1/2]

XMLTextListsHelper::XMLTextListsHelper ( )

Definition at line 44 of file txtlists.cxx.

◆ XMLTextListsHelper() [2/2]

XMLTextListsHelper::XMLTextListsHelper ( const XMLTextListsHelper )
delete

Member Function Documentation

◆ EnsureNumberedParagraph()

uno::Reference< container::XIndexReplace > XMLTextListsHelper::EnsureNumberedParagraph ( SvXMLImport &  i_rImport,
const OUString &  i_ListId,
sal_Int16 &  io_rLevel,
const OUString &  i_StyleName 
)

for importing numbered-paragraph note that the ID namespace for numbered-paragraph and regular list is distinct; we never combine a list and a n-p

Definition at line 346 of file txtlists.cxx.

References ClampLevel(), first, i, o3tl::make_unsigned(), MakeNumRule(), mLastNumberedParagraphs, mNPLists, and none.

Referenced by XMLNumberedParaContext::XMLNumberedParaContext().

◆ EqualsToTopListStyleOnStack()

bool XMLTextListsHelper::EqualsToTopListStyleOnStack ( std::u16string_view  sListId) const

Definition at line 307 of file txtlists.cxx.

References mpListStack.

◆ GenerateNewListId()

OUString XMLTextListsHelper::GenerateNewListId ( ) const

◆ GetContinueListIdOfProcessedList()

OUString XMLTextListsHelper::GetContinueListIdOfProcessedList ( const OUString &  sListId) const

Definition at line 178 of file txtlists.cxx.

References mpProcessedLists.

Referenced by XMLTextListBlockContext::XMLTextListBlockContext().

◆ GetLastContinuingListId()

OUString XMLTextListsHelper::GetLastContinuingListId ( const OUString &  sListId) const

Definition at line 271 of file txtlists.cxx.

References mpContinuingLists.

◆ GetLastIdOfStyleName()

OUString XMLTextListsHelper::GetLastIdOfStyleName ( const OUString &  sListStyleName) const

Looks up the last list id of a given list style, by name.

Definition at line 483 of file txtlists.cxx.

References mpStyleNameLastListIds.

Referenced by XMLTextListBlockContext::XMLTextListBlockContext().

◆ GetLastProcessedListId()

const OUString & XMLTextListsHelper::GetLastProcessedListId ( ) const
inline

Definition at line 71 of file txtlists.hxx.

References msLastProcessedListId.

Referenced by XMLTextListBlockContext::XMLTextListBlockContext().

◆ GetListIdForListBlock()

OUString XMLTextListsHelper::GetListIdForListBlock ( XMLTextListBlockContext const &  rListBlock)

◆ GetListStyleOfLastProcessedList()

const OUString & XMLTextListsHelper::GetListStyleOfLastProcessedList ( ) const
inline

◆ GetListStyleOfProcessedList()

OUString XMLTextListsHelper::GetListStyleOfProcessedList ( const OUString &  sListId) const

Definition at line 163 of file txtlists.cxx.

References mpProcessedLists.

Referenced by GetListIdForListBlock().

◆ GetNumberedParagraphListId()

OUString XMLTextListsHelper::GetNumberedParagraphListId ( const sal_uInt16  i_Level,
std::u16string_view  i_StyleName 
)

get ID of the last numbered-paragraph iff it has given style-name

Definition at line 313 of file txtlists.cxx.

References GenerateNewListId(), mLastNumberedParagraphs, and SAL_INFO.

Referenced by XMLNumberedParaContext::XMLNumberedParaContext().

◆ IsListProcessed()

bool XMLTextListsHelper::IsListProcessed ( const OUString &  sListId) const

◆ KeepListAsProcessed()

void XMLTextListsHelper::KeepListAsProcessed ( const OUString &  sListId,
const OUString &  sListStyleName,
const OUString &  sContinueListId,
const OUString &  sListStyleDefaultListId = OUString() 
)

◆ ListContextTop()

void XMLTextListsHelper::ListContextTop ( XMLTextListBlockContext *&  o_pListBlockContext,
XMLTextListItemContext *&  o_pListItemContext,
XMLNumberedParaContext *&  o_pNumberedParagraphContext 
)

peek at the top of the list context stack

Definition at line 72 of file txtlists.cxx.

References mListStack.

Referenced by XMLTextImportHelper::SetStyleAndAttrs(), and XMLTextListBlockContext::XMLTextListBlockContext().

◆ MakeNumRule()

uno::Reference< container::XIndexReplace > XMLTextListsHelper::MakeNumRule ( SvXMLImport &  i_rImport,
const css::uno::Reference< css::container::XIndexReplace > &  i_xNumRule,
std::u16string_view  i_ParentStyleName,
const OUString &  i_StyleName,
sal_Int16 &  io_rLevel,
bool *  o_pRestartNumbering = nullptr,
bool *  io_pSetDefaults = nullptr 
)
static

Creates a NumRule from given style-name.

extracted from the XMLTextListBlockContext constructor

Parameters
i_rImportthe SvXMLImport
i_xNumRuleparent num rule
i_ParentStyleNameparent list style name
i_StyleNamethe list style name
io_rLevelthe list level (may be reset if too large)
o_rRestartNumberingset to true if no style (defaulting)
io_rSetDefaultsset to true if no style (defaulting)

Definition at line 407 of file txtlists.cxx.

References any, ClampLevel(), SvxXMLListStyleContext::CreateAndInsertAuto(), SvxXMLListStyleContext::CreateNumRule(), SvxXMLListStyleContext::GetNumRules(), SAL_INFO_IF, SvxXMLListStyleContext::SetDefaultStyle(), and TEXT_LIST.

Referenced by EnsureNumberedParagraph(), and XMLTextListBlockContext::XMLTextListBlockContext().

◆ operator=()

XMLTextListsHelper & XMLTextListsHelper::operator= ( const XMLTextListsHelper )
delete

◆ PopListContext()

void XMLTextListsHelper::PopListContext ( )

◆ PopListFromStack()

void XMLTextListsHelper::PopListFromStack ( )

Definition at line 298 of file txtlists.cxx.

References mpListStack.

◆ PushListContext() [1/2]

void XMLTextListsHelper::PushListContext ( XMLNumberedParaContext i_pNumberedParagraph)

Definition at line 57 of file txtlists.cxx.

References mListStack.

◆ PushListContext() [2/2]

void XMLTextListsHelper::PushListContext ( XMLTextListBlockContext i_pListBlock)

list stack for importing:

push a list context on the list context stack

Definition at line 49 of file txtlists.cxx.

References mListStack.

Referenced by XMLTextImportHelper::PushListContext(), and XMLTextListBlockContext::XMLTextListBlockContext().

◆ PushListOnStack()

void XMLTextListsHelper::PushListOnStack ( const OUString &  sListId,
const OUString &  sListStyleName 
)

Definition at line 287 of file txtlists.cxx.

References mpListStack.

◆ SetListItem()

void XMLTextListsHelper::SetListItem ( XMLTextListItemContext pListItem)

set list item on top of the list context stack

Definition at line 87 of file txtlists.cxx.

References mListStack.

Referenced by XMLTextListBlockContext::endFastElement(), XMLTextListItemContext::endFastElement(), and XMLTextImportHelper::SetStyleAndAttrs().

◆ StoreLastContinuingList()

void XMLTextListsHelper::StoreLastContinuingList ( const OUString &  sListId,
const OUString &  sContinuingListId 
)

Definition at line 260 of file txtlists.cxx.

References mpContinuingLists.

Member Data Documentation

◆ mLastNumberedParagraphs

LastNumberedParagraphs_t XMLTextListsHelper::mLastNumberedParagraphs
private

Definition at line 171 of file txtlists.hxx.

Referenced by EnsureNumberedParagraph(), and GetNumberedParagraphListId().

◆ mListStack

std::stack< ListStackFrame_t > XMLTextListsHelper::mListStack
private

Definition at line 135 of file txtlists.hxx.

Referenced by ListContextTop(), PopListContext(), PushListContext(), and SetListItem().

◆ mNPLists

::std::map< OUString, NumParaList_t > XMLTextListsHelper::mNPLists
private

Definition at line 178 of file txtlists.hxx.

Referenced by EnsureNumberedParagraph().

◆ mpContinuingLists

std::unique_ptr<tMapForContinuingLists> XMLTextListsHelper::mpContinuingLists
private

Definition at line 156 of file txtlists.hxx.

Referenced by GetLastContinuingListId(), and StoreLastContinuingList().

◆ mpListStack

std::unique_ptr<tStackForLists> XMLTextListsHelper::mpListStack
private

Definition at line 164 of file txtlists.hxx.

Referenced by EqualsToTopListStyleOnStack(), PopListFromStack(), and PushListOnStack().

◆ mpMapListIdToListStyleDefaultListId

std::unique_ptr<tMapForLists> XMLTextListsHelper::mpMapListIdToListStyleDefaultListId
private

Definition at line 150 of file txtlists.hxx.

Referenced by GetListIdForListBlock(), and KeepListAsProcessed().

◆ mpProcessedLists

std::unique_ptr<tMapForLists> XMLTextListsHelper::mpProcessedLists
private

◆ mpStyleNameLastListIds

std::unique_ptr<std::map<OUString, OUString> > XMLTextListsHelper::mpStyleNameLastListIds
private

Definition at line 158 of file txtlists.hxx.

Referenced by GetLastIdOfStyleName(), and KeepListAsProcessed().

◆ msLastProcessedListId

OUString XMLTextListsHelper::msLastProcessedListId
private

Definition at line 143 of file txtlists.hxx.

Referenced by GetLastProcessedListId(), and KeepListAsProcessed().

◆ msListStyleOfLastProcessedList

OUString XMLTextListsHelper::msListStyleOfLastProcessedList
private

Definition at line 144 of file txtlists.hxx.

Referenced by GetListStyleOfLastProcessedList(), and KeepListAsProcessed().


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