21#include <com/sun/star/beans/XPropertySet.hpp>
22#include <com/sun/star/uno/Reference.h>
24#include <rtl/ustring.hxx>
30using ::com::sun::star::uno::Reference;
31using ::com::sun::star::uno::Any;
32using ::com::sun::star::beans::XPropertySet;
38: sPropertyName(
std::move(sPropName))
51 const OUString& sName,
55 aIDMap[
sName] = aValue;
58 auto it = aBackpatchListMap.find(
sName);
59 if (it == aBackpatchListMap.end())
63 std::unique_ptr<BackpatchListType> pList = std::move(it->second);
66 aBackpatchListMap.erase(it);
72 for(
const auto& rBackpatch : *pList)
74 rBackpatch->setPropertyValue(sPropertyName, aAny);
81 const Reference<XPropertySet> & xPropSet,
82 const OUString& sName)
84 if (aIDMap.count(
sName))
87 xPropSet->setPropertyValue(sPropertyName, css::uno::Any(aIDMap[
sName]));
92 if (! aBackpatchListMap.count(
sName))
99 aBackpatchListMap[
sName]->push_back(xPropSet);
110 ::std::unique_ptr< XMLPropertyBackpatcher<sal_Int16> >
114 ::std::unique_ptr< XMLPropertyBackpatcher<sal_Int16> >
117 ::std::unique_ptr< XMLPropertyBackpatcher< OUString> >
121std::shared_ptr<XMLTextImportHelper::BackpatcherImpl>
125 return std::make_shared<BackpatcherImpl>();
130 return "SequenceNumber";
178 const OUString& sXMLId,
185 const OUString& sXMLId,
186 const Reference<XPropertySet> & xPropSet)
192 const OUString& sXMLId,
193 const OUString& sName,
201 const OUString& sXMLId,
202 const Reference<XPropertySet> & xPropSet)
static OUString GetSequenceNumber()
This class maintains an OUString->sal_Int16 mapping for cases in which an XPropertySet needs to be fi...
void SetProperty(const css::uno::Reference< css::beans::XPropertySet > &xPropSet, const OUString &sName)
Set property with the proper value for this name.
::std::vector< css::uno::Reference< css::beans::XPropertySet > > BackpatchListType
backpatch list type
XMLPropertyBackpatcher(OUString sPropertyName)
void ResolveId(const OUString &sName, A aValue)
resolve a known ID.
~XMLPropertyBackpatcher()
void InsertFootnoteID(const OUString &sXMLId, sal_Int16 nAPIId)
insert new footnote ID.
XMLPropertyBackpatcher< sal_Int16 > & GetFootnoteBP()
static std::shared_ptr< BackpatcherImpl > MakeBackpatcherImpl()
std::shared_ptr< BackpatcherImpl > m_xBackpatcherImpl
void ProcessFootnoteReference(const OUString &sXMLId, const css::uno::Reference< css::beans::XPropertySet > &xPropSet)
set the proper footnote reference ID, or put into backpatch list if ID is unknown
XMLPropertyBackpatcher< sal_Int16 > & GetSequenceIdBP()
void ProcessSequenceReference(const OUString &sXMLId, const css::uno::Reference< css::beans::XPropertySet > &xPropSet)
set sequence ID or insert into backpatch list
XMLPropertyBackpatcher< OUString > & GetSequenceNameBP()
void InsertSequenceID(const OUString &sXMLId, const OUString &sName, sal_Int16 nAPIId)
insert new sequence ID Also fixup open references from backpatch list to this ID.
::std::unique_ptr< XMLPropertyBackpatcher< OUString > > m_pSequenceNameBackpatcher
::std::unique_ptr< XMLPropertyBackpatcher< sal_Int16 > > m_pFootnoteBackpatcher
backpatcher for references to footnotes and endnotes
::std::unique_ptr< XMLPropertyBackpatcher< sal_Int16 > > m_pSequenceIdBackpatcher
backpatchers for references to sequences