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 (const OUString &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, const OUString &i_StyleName)
 get ID of the last numbered-paragraph iff it has given style-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, const OUString &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< tStackForListsmpListStack
 
LastNumberedParagraphs_t mLastNumberedParagraphs
 
::std::map< OUString, NumParaList_tmNPLists
 

Detailed Description

Definition at line 37 of file txtlists.hxx.

Member Typedef Documentation

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 164 of file txtlists.hxx.

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

Definition at line 131 of file txtlists.hxx.

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

numbered-paragraphs

Definition at line 172 of file txtlists.hxx.

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

Definition at line 152 of file txtlists.hxx.

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

Definition at line 138 of file txtlists.hxx.

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

Definition at line 158 of file txtlists.hxx.

Constructor & Destructor Documentation

XMLTextListsHelper::XMLTextListsHelper ( )

Definition at line 43 of file txtlists.cxx.

XMLTextListsHelper::XMLTextListsHelper ( const XMLTextListsHelper )
delete

Member Function Documentation

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 340 of file txtlists.cxx.

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

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

Definition at line 301 of file txtlists.cxx.

References mpListStack.

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

Definition at line 172 of file txtlists.cxx.

References mpProcessedLists.

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

Definition at line 265 of file txtlists.cxx.

References mpContinuingLists.

const OUString& XMLTextListsHelper::GetLastProcessedListId ( ) const
inline

Definition at line 71 of file txtlists.hxx.

References msLastProcessedListId.

OUString XMLTextListsHelper::GetListIdForListBlock ( XMLTextListBlockContext const &  rListBlock)
const OUString& XMLTextListsHelper::GetListStyleOfLastProcessedList ( ) const
inline

Definition at line 72 of file txtlists.hxx.

References msListStyleOfLastProcessedList.

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

Definition at line 157 of file txtlists.cxx.

References mpProcessedLists.

Referenced by GetListIdForListBlock().

OUString XMLTextListsHelper::GetNumberedParagraphListId ( const sal_uInt16  i_Level,
const OUString &  i_StyleName 
)

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

Definition at line 307 of file txtlists.cxx.

References assert(), first, GenerateNewListId(), mLastNumberedParagraphs, and SAL_INFO.

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

Definition at line 147 of file txtlists.cxx.

References mpProcessedLists.

Referenced by KeepListAsProcessed().

void XMLTextListsHelper::KeepListAsProcessed ( const OUString &  sListId,
const OUString &  sListStyleName,
const OUString &  sContinueListId,
const OUString &  sListStyleDefaultListId = OUString() 
)
void XMLTextListsHelper::ListContextTop ( XMLTextListBlockContext *&  o_pListBlockContext,
XMLTextListItemContext *&  o_pListItemContext,
XMLNumberedParaContext *&  o_pNumberedParagraphContext 
)

peek at the top of the list context stack

Definition at line 73 of file txtlists.cxx.

References mListStack.

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

uno::Reference< container::XIndexReplace > XMLTextListsHelper::MakeNumRule ( SvXMLImport i_rImport,
const css::uno::Reference< css::container::XIndexReplace > &  i_xNumRule,
const OUString &  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 401 of file txtlists.cxx.

References any, ClampLevel(), SvxXMLListStyleContext::CreateNumRule(), SvXMLImport::GetModel(), SvxXMLListStyleContext::GetNumRules(), SvXMLImport::GetStyleDisplayName(), SvXMLImport::GetTextImport(), SAL_INFO_IF, SvxXMLListStyleContext::SetDefaultStyle(), and TEXT_LIST.

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

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

pop the list context stack

Definition at line 66 of file txtlists.cxx.

References assert(), and mListStack.

Referenced by XMLTextListBlockContext::EndElement(), and XMLTextImportHelper::PopListContext().

void XMLTextListsHelper::PopListFromStack ( )

Definition at line 292 of file txtlists.cxx.

References mpListStack.

void XMLTextListsHelper::PushListContext ( XMLTextListBlockContext i_pListBlock)

list stack for importing:

push a list context on the list context stack

Definition at line 50 of file txtlists.cxx.

References mListStack.

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

void XMLTextListsHelper::PushListContext ( XMLNumberedParaContext i_pNumberedParagraph)

Definition at line 58 of file txtlists.cxx.

References mListStack.

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

Definition at line 281 of file txtlists.cxx.

References mpListStack.

void XMLTextListsHelper::SetListItem ( XMLTextListItemContext pListItem)

set list item on top of the list context stack

Definition at line 88 of file txtlists.cxx.

References assert(), and mListStack.

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

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

Definition at line 254 of file txtlists.cxx.

References mpContinuingLists.

Member Data Documentation

LastNumberedParagraphs_t XMLTextListsHelper::mLastNumberedParagraphs
private

Definition at line 166 of file txtlists.hxx.

Referenced by EnsureNumberedParagraph(), and GetNumberedParagraphListId().

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

Definition at line 132 of file txtlists.hxx.

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

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

Definition at line 173 of file txtlists.hxx.

Referenced by EnsureNumberedParagraph().

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

Definition at line 153 of file txtlists.hxx.

Referenced by GetLastContinuingListId(), and StoreLastContinuingList().

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

Definition at line 159 of file txtlists.hxx.

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

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

Definition at line 147 of file txtlists.hxx.

Referenced by GetListIdForListBlock(), and KeepListAsProcessed().

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

Definition at line 140 of file txtlists.hxx.

Referenced by GetLastProcessedListId(), and KeepListAsProcessed().

OUString XMLTextListsHelper::msListStyleOfLastProcessedList
private

Definition at line 141 of file txtlists.hxx.

Referenced by GetListStyleOfLastProcessedList(), and KeepListAsProcessed().


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