From 0c5c971d36e444b0d50eb385c6c5105edcfe045c Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 9 Dec 2015 09:17:14 +0100 Subject: sw: initial SwFltRDFMark So that SwWW8ImplReader::Read_FactoidBook() can put this as an attribute on the import stack instead of CntUInt16Item. Change-Id: I1753bc4a94f49332a945a4c6de7f58768d35ff16 --- sw/source/filter/basflt/fltshell.cxx | 48 ++++++++++++++++++++++++++++++++++++ sw/source/filter/inc/fltshell.hxx | 19 ++++++++++++++ 2 files changed, 67 insertions(+) diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx index 97ebd672793e..37aad9fd5bde 100644 --- a/sw/source/filter/basflt/fltshell.cxx +++ b/sw/source/filter/basflt/fltshell.cxx @@ -969,6 +969,54 @@ SfxPoolItem* SwFltBookmark::Clone(SfxItemPool*) const return new SwFltBookmark(*this); } +SwFltRDFMark::SwFltRDFMark() + : SfxPoolItem(RES_FLTR_RDFMARK), + m_nHandle(0) +{ +} + +SwFltRDFMark::SwFltRDFMark(const SwFltRDFMark& rMark) + : SfxPoolItem(RES_FLTR_RDFMARK), + m_nHandle(rMark.m_nHandle), + m_aAttributes(rMark.m_aAttributes) +{ +} + +bool SwFltRDFMark::operator==(const SfxPoolItem& rItem) const +{ + if (!SfxPoolItem::operator==(rItem)) + return false; + + const SwFltRDFMark& rMark = static_cast(rItem); + + return m_nHandle == rMark.m_nHandle && m_aAttributes == rMark.m_aAttributes; +} + +SfxPoolItem* SwFltRDFMark::Clone(SfxItemPool*) const +{ + return new SwFltRDFMark(*this); +} + +void SwFltRDFMark::SetHandle(long nHandle) +{ + m_nHandle = nHandle; +} + +long SwFltRDFMark::GetHandle() const +{ + return m_nHandle; +} + +void SwFltRDFMark::SetAttributes(const std::vector< std::pair >& rAttributes) +{ + m_aAttributes = rAttributes; +} + +const std::vector< std::pair >& SwFltRDFMark::GetAttributes() const +{ + return m_aAttributes; +} + // methods of SwFltTOX follow SwFltTOX::SwFltTOX(SwTOXBase* pBase, sal_uInt16 _nCols) : SfxPoolItem(RES_FLTR_TOX), pTOXBase(pBase), nCols( _nCols ), diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx index e0e2df0d9b1f..7dce67125a4a 100644 --- a/sw/source/filter/inc/fltshell.hxx +++ b/sw/source/filter/inc/fltshell.hxx @@ -286,6 +286,25 @@ public: } }; +/// Stores RDF statements on a paragraph (key-value pairs where the subject is the paragraph). +class SW_DLLPUBLIC SwFltRDFMark : public SfxPoolItem +{ + long m_nHandle; + std::vector< std::pair > m_aAttributes; + +public: + SwFltRDFMark(); + SwFltRDFMark(const SwFltRDFMark&); + + virtual bool operator==(const SfxPoolItem&) const override; + virtual SfxPoolItem* Clone(SfxItemPool* = nullptr) const override; + + void SetHandle(long nHandle); + long GetHandle() const; + void SetAttributes(const std::vector< std::pair >& rAttributes); + const std::vector< std::pair >& GetAttributes() const; +}; + class SW_DLLPUBLIC SwFltTOX : public SfxPoolItem { SwTOXBase* pTOXBase; -- cgit v1.2.3