diff options
author | Jim MacArthur <jim.macarthur@codethink.co.uk> | 2019-05-07 14:08:52 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2019-05-10 15:17:59 +0100 |
commit | 5593df2a158d52c07fd83f9fe877b3d6ec128d19 (patch) | |
tree | 23fe875f570b53164e4af5dd3a7549473e1908d8 | |
parent | 83e6a2cf6916aa8ee7dd3e4d58ccc0fc5b049712 (diff) |
Add resolved flag to SwPostItField with serialisation
Change-Id: Ic44ea022dcbe902595e5a32b464f5fd86af1d4a4
-rw-r--r-- | include/xmloff/xmltoken.hxx | 2 | ||||
-rw-r--r-- | sw/inc/docufld.hxx | 2 | ||||
-rw-r--r-- | sw/inc/unoprnms.hxx | 2 | ||||
-rw-r--r-- | sw/source/core/fields/docufld.cxx | 13 | ||||
-rw-r--r-- | sw/source/core/unocore/unofield.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/unocore/unomap.cxx | 1 | ||||
-rw-r--r-- | xmloff/inc/txtfldi.hxx | 1 | ||||
-rw-r--r-- | xmloff/source/core/xmltoken.cxx | 2 | ||||
-rw-r--r-- | xmloff/source/text/txtflde.cxx | 12 | ||||
-rw-r--r-- | xmloff/source/text/txtfldi.cxx | 12 |
10 files changed, 48 insertions, 3 deletions
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx index 7880f2df7ece..ec14339ebf33 100644 --- a/include/xmloff/xmltoken.hxx +++ b/include/xmloff/xmltoken.hxx @@ -3303,6 +3303,8 @@ namespace xmloff { namespace token { XML_CREATOR_INITIALS, + XML_RESOLVED, + XML_TOKEN_END }; diff --git a/sw/inc/docufld.hxx b/sw/inc/docufld.hxx index 19535cfa395f..31530ef182f8 100644 --- a/sw/inc/docufld.hxx +++ b/sw/inc/docufld.hxx @@ -439,6 +439,7 @@ class SW_DLLPUBLIC SwPostItField : public SwField OUString sInitials; ///< Initials of the author. OUString sName; ///< Name of the comment. DateTime aDateTime; + bool m_bResolved; OutlinerParaObject* mpText; rtl::Reference<SwTextAPIObject> m_xTextObject; sal_uInt32 m_nPostItId; @@ -452,6 +453,7 @@ public: const OUString& rInitials, const OUString& rName, const DateTime& rDate, + const bool bResolved = false, const sal_uInt32 nPostItId = 0); SwPostItField(const SwPostItField&) = delete; diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx index 708046de4f20..4554c610e447 100644 --- a/sw/inc/unoprnms.hxx +++ b/sw/inc/unoprnms.hxx @@ -857,6 +857,8 @@ #define UNO_NAME_TABLE_FIRST_ROW_START_COLUMN "FirstRowStartColumn" #define UNO_NAME_TABLE_LAST_ROW_END_COLUMN "LastRowEndColumn" #define UNO_NAME_TABLE_LAST_ROW_START_COLUMN "LastRowStartColumn" + +#define UNO_NAME_RESOLVED "Resolved" #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/fields/docufld.cxx b/sw/source/core/fields/docufld.cxx index a53c16882c34..473e10168d9e 100644 --- a/sw/source/core/fields/docufld.cxx +++ b/sw/source/core/fields/docufld.cxx @@ -1642,7 +1642,9 @@ SwPostItField::SwPostItField( SwPostItFieldType* pT, const OUString& rInitials, const OUString& rName, const DateTime& rDateTime, - const sal_uInt32 nPostItId) + const bool bResolved, + const sal_uInt32 nPostItId +) : SwField( pT ) , sText( rText ) , sAuthor( rAuthor ) @@ -1650,6 +1652,7 @@ SwPostItField::SwPostItField( SwPostItFieldType* pT, , sName( rName ) , aDateTime( rDateTime ) , mpText( nullptr ) + , m_bResolved( bResolved ) { m_nPostItId = nPostItId == 0 ? m_nLastPostItId++ : nPostItId; } @@ -1677,7 +1680,7 @@ OUString SwPostItField::GetDescription() const SwField* SwPostItField::Copy() const { SwPostItField* pRet = new SwPostItField( static_cast<SwPostItFieldType*>(GetTyp()), sAuthor, sText, sInitials, sName, - aDateTime, m_nPostItId); + aDateTime, m_bResolved, m_nPostItId); if (mpText) pRet->SetTextObject( new OutlinerParaObject(*mpText) ); @@ -1746,6 +1749,9 @@ bool SwPostItField::QueryValue( uno::Any& rAny, sal_uInt16 nWhichId ) const case FIELD_PROP_PAR4: rAny <<= sName; break; + case FIELD_PROP_BOOL1: + rAny <<= m_bResolved; + break; case FIELD_PROP_TEXT: { if ( !m_xTextObject.is() ) @@ -1803,6 +1809,9 @@ bool SwPostItField::PutValue( const uno::Any& rAny, sal_uInt16 nWhichId ) case FIELD_PROP_PAR4: rAny >>= sName; break; + case FIELD_PROP_BOOL1: + rAny >>= m_bResolved; + break; case FIELD_PROP_TEXT: OSL_FAIL("Not implemented!"); break; diff --git a/sw/source/core/unocore/unofield.cxx b/sw/source/core/unocore/unofield.cxx index 7f5b6e96242e..d4aed90536a1 100644 --- a/sw/source/core/unocore/unofield.cxx +++ b/sw/source/core/unocore/unofield.cxx @@ -1342,7 +1342,9 @@ void SAL_CALL SwXTextField::attach( m_pImpl->m_pProps->sPar2, // content m_pImpl->m_pProps->sPar3, // author's initials m_pImpl->m_pProps->sPar4, // name - aDateTime ); + aDateTime, + m_pImpl->m_pProps->bBool1 // resolvedflag +); if ( m_pImpl->m_xTextObject.is() ) { pPostItField->SetTextObject( m_pImpl->m_xTextObject->CreateText() ); diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx index 61b6dcd9feb2..979134326cad 100644 --- a/sw/source/core/unocore/unomap.cxx +++ b/sw/source/core/unocore/unomap.cxx @@ -917,6 +917,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s {OUString(UNO_NAME_CONTENT), FIELD_PROP_PAR2, cppu::UnoType<OUString>::get(), PROPERTY_NONE, 0}, {OUString(UNO_NAME_INITIALS), FIELD_PROP_PAR3, cppu::UnoType<OUString>::get(), PROPERTY_NONE, 0}, {OUString(UNO_NAME_NAME), FIELD_PROP_PAR4, cppu::UnoType<OUString>::get(), PROPERTY_NONE, 0}, + {OUString(UNO_NAME_RESOLVED), FIELD_PROP_BOOL1, cppu::UnoType<bool>::get(), PROPERTY_NONE, 0}, {OUString(UNO_NAME_DATE_TIME_VALUE), FIELD_PROP_DATE_TIME, cppu::UnoType<css::util::DateTime>::get(), PROPERTY_NONE, 0}, {OUString(UNO_NAME_DATE), FIELD_PROP_DATE, cppu::UnoType<css::util::Date>::get(), PROPERTY_NONE, 0}, {OUString(UNO_NAME_TEXT_RANGE), FIELD_PROP_TEXT, cppu::UnoType<css::uno::XInterface>::get(), PropertyAttribute::READONLY, 0}, diff --git a/xmloff/inc/txtfldi.hxx b/xmloff/inc/txtfldi.hxx index 5e66297a53d7..7d5668bcc659 100644 --- a/xmloff/inc/txtfldi.hxx +++ b/xmloff/inc/txtfldi.hxx @@ -1121,6 +1121,7 @@ class XMLAnnotationImportContext : public XMLTextFieldImportContext OUString aName; OUStringBuffer aTextBuffer; OUStringBuffer aDateBuffer; + OUStringBuffer aResolvedBuffer; css::uno::Reference < css::beans::XPropertySet > mxField; css::uno::Reference < css::text::XTextCursor > mxCursor; diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 9b019e880219..8974377cb484 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -3297,6 +3297,8 @@ namespace xmloff { namespace token { TOKEN( "creator-initials", XML_CREATOR_INITIALS ), + TOKEN( "resolved", XML_RESOLVED ), + #if OSL_DEBUG_LEVEL > 0 { 0, nullptr, nullptr, XML_TOKEN_END } #else diff --git a/xmloff/source/text/txtflde.cxx b/xmloff/source/text/txtflde.cxx index 710e30e66890..b26e96790591 100644 --- a/xmloff/source/text/txtflde.cxx +++ b/xmloff/source/text/txtflde.cxx @@ -1734,6 +1734,18 @@ void XMLTextFieldExport::ExportFieldHelper( GetExport().Characters(aAuthor); } + // resolved flag + { + bool b = GetBoolProperty("Resolved", rPropSet); + OUString aResolvedText("Resolved"); + OUString aUnresolvedText("Unresolved"); + + SvXMLElementExport aCreatorElem( GetExport(), XML_NAMESPACE_DC, + XML_RESOLVED, true, + false ); + GetExport().Characters(b?aResolvedText:aUnresolvedText); + } + // date time util::DateTime aDate( GetDateTimeProperty(sPropertyDateTimeValue, rPropSet) ); { diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx index d50d4442e0de..bf3f614ac833 100644 --- a/xmloff/source/text/txtfldi.cxx +++ b/xmloff/source/text/txtfldi.cxx @@ -3313,6 +3313,10 @@ SvXMLImportContextRef XMLAnnotationImportContext::CreateChildContext( else if( IsXMLToken( rLocalName, XML_DATE ) ) pContext = new XMLStringBufferImportContext(GetImport(), nPrefix, rLocalName, aDateBuffer); + else if( IsXMLToken( rLocalName, XML_RESOLVED ) ) + pContext = new XMLStringBufferImportContext(GetImport(), nPrefix, + rLocalName, aResolvedBuffer); + } else if (((XML_NAMESPACE_TEXT == nPrefix || XML_NAMESPACE_LO_EXT == nPrefix) && IsXMLToken(rLocalName, XML_SENDER_INITIALS)) @@ -3460,6 +3464,14 @@ void XMLAnnotationImportContext::PrepareField( OUString sInitials( aInitialsBuffer.makeStringAndClear() ); xPropertySet->setPropertyValue("Initials", makeAny(sInitials)); + // import resolved flag + OUString sResolved( aResolvedBuffer.makeStringAndClear() ); + if(sResolved.equals("Resolved")) { + xPropertySet->setPropertyValue("Resolved", makeAny(true)); + } else { + xPropertySet->setPropertyValue("Resolved", makeAny(false)); + } + util::DateTime aDateTime; if (::sax::Converter::parseDateTime(aDateTime, aDateBuffer.makeStringAndClear())) |