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

This class handles the export of redline portions. More...

#include <XMLRedlineExport.hxx>

Collaboration diagram for XMLRedlineExport:
[legend]

Public Member Functions

 XMLRedlineExport (SvXMLExport &rExp)
 
 ~XMLRedlineExport ()
 
void ExportChange (const css::uno::Reference< css::beans::XPropertySet > &rPropSet, bool bAutoStyle)
 export a change More...
 
void ExportChangesList (bool bAutoStyles)
 export the list of changes (complete list minus recorded changed) More...
 
void ExportChangesList (const css::uno::Reference< css::text::XText > &rText, bool bAutoStyles)
 export the list of changes (recorded changes for this XText only) More...
 
void SetCurrentXText (const css::uno::Reference< css::text::XText > &rText)
 set the current XText for which changes should be recorded. More...
 
void SetCurrentXText ()
 Do not record changes. More...
 
void ExportStartOrEndRedline (const css::uno::Reference< css::beans::XPropertySet > &rPropSet, bool bStart)
 export redline marks which start or end at start nodes, i.e. More...
 
void ExportStartOrEndRedline (const css::uno::Reference< css::text::XTextContent > &rContent, bool bStart)
 start or end of text entity (e.g. paragraph)? More...
 
void ExportStartOrEndRedline (const css::uno::Reference< css::text::XTextSection > &rSection, bool bStart)
 convenience method, calls XPropertySet-version of this method More...
 

Private Member Functions

void ExportChangeInline (const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
 export the change mark contained in the text body More...
 
void ExportChangeAutoStyle (const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
 export the auto styles used in this change More...
 
void ExportChangesListElements ()
 export the changes list (<text:tracked-changes>) More...
 
void ExportChangesListAutoStyles ()
 export the auto styles needed by the changes list More...
 
void ExportChangedRegion (const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
 export the changed-region element More...
 
void ExportChangeInfo (const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
 export a change-info element (from a PropertySet) More...
 
void ExportChangeInfo (const css::uno::Sequence< css::beans::PropertyValue > &rValues)
 export a change-info element (from PropertyValues) More...
 
OUString const & ConvertTypeName (std::u16string_view sApiName)
 convert the change type from API to XML names More...
 
void WriteComment (std::u16string_view rComment)
 write a comment string as sequence of <text:p> elements More...
 

Static Private Member Functions

static OUString GetRedlineID (const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
 Get ID string! More...
 

Private Attributes

const OUString sDeletion
 
const OUString sFormatChange
 
const OUString sInsertion
 
SvXMLExportrExport
 
ChangesMapType aChangeMap
 
ChangesVectorTypepCurrentChangesList
 map of recorded changes More...
 

Detailed Description

This class handles the export of redline portions.

It is to be called from XMLTextParagraphExport.

Definition at line 52 of file XMLRedlineExport.hxx.

Constructor & Destructor Documentation

◆ XMLRedlineExport()

XMLRedlineExport::XMLRedlineExport ( SvXMLExport rExp)
explicit

Definition at line 67 of file XMLRedlineExport.cxx.

◆ ~XMLRedlineExport()

XMLRedlineExport::~XMLRedlineExport ( )

Definition at line 77 of file XMLRedlineExport.cxx.

Member Function Documentation

◆ ConvertTypeName()

OUString const & XMLRedlineExport::ConvertTypeName ( std::u16string_view  sApiName)
private

convert the change type from API to XML names

Definition at line 399 of file XMLRedlineExport.cxx.

References sDeletion, sFormatChange, sInsertion, and u.

Referenced by ExportChangedRegion().

◆ ExportChange()

void XMLRedlineExport::ExportChange ( const css::uno::Reference< css::beans::XPropertySet > &  rPropSet,
bool  bAutoStyle 
)

export a change

Parameters
rPropSetPropertySet of RedlinePortion

Definition at line 82 of file XMLRedlineExport.cxx.

References ExportChangeAutoStyle(), ExportChangeInline(), and pCurrentChangesList.

◆ ExportChangeAutoStyle()

void XMLRedlineExport::ExportChangeAutoStyle ( const css::uno::Reference< css::beans::XPropertySet > &  rPropSet)
private

export the auto styles used in this change

Parameters
rPropSetPropertySet of RedlinePortion

Definition at line 241 of file XMLRedlineExport.cxx.

References Any, SvXMLExport::GetTextParagraphExport(), pCurrentChangesList, and rExport.

Referenced by ExportChange(), and ExportChangesListAutoStyles().

◆ ExportChangedRegion()

void XMLRedlineExport::ExportChangedRegion ( const css::uno::Reference< css::beans::XPropertySet > &  rPropSet)
private

◆ ExportChangeInfo() [1/2]

void XMLRedlineExport::ExportChangeInfo ( const css::uno::Reference< css::beans::XPropertySet > &  rPropSet)
private

export a change-info element (from a PropertySet)

Referenced by ExportChangedRegion().

◆ ExportChangeInfo() [2/2]

void XMLRedlineExport::ExportChangeInfo ( const css::uno::Sequence< css::beans::PropertyValue > &  rValues)
private

export a change-info element (from PropertyValues)

◆ ExportChangeInline()

void XMLRedlineExport::ExportChangeInline ( const css::uno::Reference< css::beans::XPropertySet > &  rPropSet)
private

export the change mark contained in the text body

Parameters
rPropSetPropertySet of RedlinePortion

Definition at line 304 of file XMLRedlineExport.cxx.

References SvXMLExport::AddAttribute(), Any, GetRedlineID(), rExport, xmloff::token::XML_CHANGE, xmloff::token::XML_CHANGE_END, xmloff::token::XML_CHANGE_ID, xmloff::token::XML_CHANGE_START, XML_NAMESPACE_TEXT, and xmloff::token::XML_TOKEN_INVALID.

Referenced by ExportChange().

◆ ExportChangesList() [1/2]

void XMLRedlineExport::ExportChangesList ( bool  bAutoStyles)

export the list of changes (complete list minus recorded changed)

Definition at line 105 of file XMLRedlineExport.cxx.

References ExportChangesListAutoStyles(), and ExportChangesListElements().

◆ ExportChangesList() [2/2]

void XMLRedlineExport::ExportChangesList ( const css::uno::Reference< css::text::XText > &  rText,
bool  bAutoStyles 
)

export the list of changes (recorded changes for this XText only)

◆ ExportChangesListAutoStyles()

void XMLRedlineExport::ExportChangesListAutoStyles ( )
private

export the auto styles needed by the changes list

Definition at line 267 of file XMLRedlineExport.cxx.

References Any, DBG_ASSERT, ExportChangeAutoStyle(), SvXMLExport::GetModel(), and rExport.

Referenced by ExportChangesList().

◆ ExportChangesListElements()

void XMLRedlineExport::ExportChangesListElements ( )
private

◆ ExportStartOrEndRedline() [1/3]

void XMLRedlineExport::ExportStartOrEndRedline ( const css::uno::Reference< css::beans::XPropertySet > &  rPropSet,
bool  bStart 
)

export redline marks which start or end at start nodes, i.e.

that include the complete paragraph/table/section

◆ ExportStartOrEndRedline() [2/3]

void XMLRedlineExport::ExportStartOrEndRedline ( const css::uno::Reference< css::text::XTextContent > &  rContent,
bool  bStart 
)

start or end of text entity (e.g. paragraph)?

convenience method, calls XPropertySet-version of this method

Parameters
rContentXTextContent; must also be an XPropertySet

◆ ExportStartOrEndRedline() [3/3]

void XMLRedlineExport::ExportStartOrEndRedline ( const css::uno::Reference< css::text::XTextSection > &  rSection,
bool  bStart 
)

convenience method, calls XPropertySet-version of this method

Parameters
rSectionXTextSection; must also be an XPropertySet

◆ GetRedlineID()

OUString XMLRedlineExport::GetRedlineID ( const css::uno::Reference< css::beans::XPropertySet > &  rPropSet)
staticprivate

Get ID string!

Create a Redline-ID.

Definition at line 424 of file XMLRedlineExport.cxx.

References Any.

Referenced by ExportChangedRegion(), and ExportChangeInline().

◆ SetCurrentXText() [1/2]

void XMLRedlineExport::SetCurrentXText ( )

Do not record changes.

Same as SetCurrentXText(Reference<XText>) with empty argument.

Definition at line 174 of file XMLRedlineExport.cxx.

References pCurrentChangesList.

◆ SetCurrentXText() [2/2]

void XMLRedlineExport::SetCurrentXText ( const css::uno::Reference< css::text::XText > &  rText)

set the current XText for which changes should be recorded.

An empty XText means: don't record changes

◆ WriteComment()

void XMLRedlineExport::WriteComment ( std::u16string_view  rComment)
private

write a comment string as sequence of <text:p> elements

Definition at line 628 of file XMLRedlineExport.cxx.

References SvXMLExport::Characters(), SvXMLTokenEnumerator::getNextToken(), rExport, XML_NAMESPACE_TEXT, and xmloff::token::XML_P.

Member Data Documentation

◆ aChangeMap

ChangesMapType XMLRedlineExport::aChangeMap
private

Definition at line 69 of file XMLRedlineExport.hxx.

◆ pCurrentChangesList

ChangesVectorType* XMLRedlineExport::pCurrentChangesList
private

map of recorded changes

list of current changes; is NULL or points to member of aChangeMap

Definition at line 72 of file XMLRedlineExport.hxx.

Referenced by ExportChange(), ExportChangeAutoStyle(), and SetCurrentXText().

◆ rExport

SvXMLExport& XMLRedlineExport::rExport
private

◆ sDeletion

const OUString XMLRedlineExport::sDeletion
private

Definition at line 54 of file XMLRedlineExport.hxx.

Referenced by ConvertTypeName().

◆ sFormatChange

const OUString XMLRedlineExport::sFormatChange
private

Definition at line 55 of file XMLRedlineExport.hxx.

Referenced by ConvertTypeName().

◆ sInsertion

const OUString XMLRedlineExport::sInsertion
private

Definition at line 56 of file XMLRedlineExport.hxx.

Referenced by ConvertTypeName().


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