21 #include <com/sun/star/beans/XPropertySet.hpp>
22 #include <com/sun/star/uno/Reference.h>
24 #include <rtl/ustring.hxx>
29 using ::com::sun::star::uno::Reference;
30 using ::com::sun::star::uno::Any;
31 using ::com::sun::star::beans::XPropertySet;
36 const OUString& sPropName)
37 : sPropertyName(sPropName)
50 const OUString& sName,
54 aIDMap[sName] = aValue;
57 auto it = aBackpatchListMap.find(sName);
58 if (it == aBackpatchListMap.end())
62 std::unique_ptr<BackpatchListType> pList = std::move(it->second);
65 aBackpatchListMap.erase(it);
71 for(
const auto& rBackpatch : *pList)
73 rBackpatch->setPropertyValue(sPropertyName, aAny);
81 const OUString& sName)
83 if (aIDMap.count(sName))
86 xPropSet->setPropertyValue(sPropertyName, css::uno::Any(aIDMap[sName]));
91 if (! aBackpatchListMap.count(sName))
98 aBackpatchListMap[sName]->push_back(xPropSet);
109 ::std::unique_ptr< XMLPropertyBackpatcher<sal_Int16> >
113 ::std::unique_ptr< XMLPropertyBackpatcher<sal_Int16> >
116 ::std::unique_ptr< XMLPropertyBackpatcher< OUString> >
120 std::shared_ptr<XMLTextImportHelper::BackpatcherImpl>
124 return std::make_shared<BackpatcherImpl>();
129 return "SequenceNumber";
177 const OUString& sXMLId,
184 const OUString& sXMLId,
191 const OUString& sXMLId,
192 const OUString& sName,
200 const OUString& sXMLId,
XMLPropertyBackpatcher< OUString > & GetSequenceNameBP()
This class maintains an OUString->sal_Int16 mapping for cases in which an XPropertySet needs to be fi...
::std::vector< css::uno::Reference< css::beans::XPropertySet > > BackpatchListType
backpatch list type
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()
static std::shared_ptr< BackpatcherImpl > MakeBackpatcherImpl()
std::shared_ptr< BackpatcherImpl > m_xBackpatcherImpl
XMLPropertyBackpatcher(const OUString &sPropertyName)
XMLPropertyBackpatcher< sal_Int16 > & GetFootnoteBP()
void ResolveId(const OUString &sName, A aValue)
resolve a known ID.
::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
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 ...
static OUString GetSequenceNumber()
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. ...
void SetProperty(const css::uno::Reference< css::beans::XPropertySet > &xPropSet, const OUString &sName)
Set property with the proper value for this name.
::std::unique_ptr< XMLPropertyBackpatcher< OUString > > m_pSequenceNameBackpatcher
void InsertFootnoteID(const OUString &sXMLId, sal_Int16 nAPIId)
insert new footnote ID.