summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorScott Clarke <scott.clarke@codethink.co.uk>2019-06-07 15:28:42 +0100
committerMichael Stahl <Michael.Stahl@cib.de>2019-07-25 10:38:36 +0200
commitd2025bdc33cc8d9e2f6c9f90da4574275ed6b0e4 (patch)
tree7200817278ff1902071ba1e8d52147d240cfc02e /xmloff
parent38583daef69bc39de15ff41d2f149b34116d825c (diff)
tdf#119228 Add storage and serialisation for the Resolved flag
Change-Id: I0278588dc533378104e544d05b60583c85271f6a Co-authored-by: Jim MacArthur <jim.macarthur@codethink.co.uk> Reviewed-on: https://gerrit.libreoffice.org/75858 Tested-by: Jenkins Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/inc/txtfldi.hxx1
-rw-r--r--xmloff/source/core/xmltoken.cxx3
-rw-r--r--xmloff/source/text/txtflde.cxx12
-rw-r--r--xmloff/source/text/txtfldi.cxx7
-rw-r--r--xmloff/source/text/txtimp.cxx1
-rw-r--r--xmloff/source/token/tokens.txt1
6 files changed, 25 insertions, 0 deletions
diff --git a/xmloff/inc/txtfldi.hxx b/xmloff/inc/txtfldi.hxx
index 794ddef20ea5..c2537521b37e 100644
--- a/xmloff/inc/txtfldi.hxx
+++ b/xmloff/inc/txtfldi.hxx
@@ -1101,6 +1101,7 @@ class XMLAnnotationImportContext : public XMLTextFieldImportContext
OUString aName;
OUStringBuffer aTextBuffer;
OUStringBuffer aDateBuffer;
+ OUString aResolved;
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 1daa8897649d..a8fea52ebbfc 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -3342,6 +3342,9 @@ namespace xmloff { namespace token {
// tdf#115007 spell out numbers, dates, money amounts and cross references
TOKEN( "transliteration-spellout", XML_TRANSLITERATION_SPELLOUT ),
+ // For recording whether comments/annotations are resolved
+ 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 dd71ec72d3ba..ee5d935576bc 100644
--- a/xmloff/source/text/txtflde.cxx
+++ b/xmloff/source/text/txtflde.cxx
@@ -1760,6 +1760,18 @@ void XMLTextFieldExport::ExportFieldHelper(
rPropSet->getPropertyValue(gsPropertyName) >>= aName;
if (!aName.isEmpty())
GetExport().AddAttribute(XML_NAMESPACE_OFFICE, XML_NAME, aName);
+ SvtSaveOptions::ODFSaneDefaultVersion eVersion = rExport.getSaneDefaultVersion();
+ if(eVersion > SvtSaveOptions::ODFSVER_012)
+ {
+ bool b = GetBoolProperty("Resolved", rPropSet);
+ OUString aResolvedText;
+ OUStringBuffer aResolvedTextBuffer;
+ ::sax::Converter::convertBool(aResolvedTextBuffer, b);
+ aResolvedText = aResolvedTextBuffer.makeStringAndClear();
+
+ GetExport().AddAttribute(XML_NAMESPACE_LO_EXT, XML_RESOLVED,
+ aResolvedText);
+ }
SvXMLElementExport aElem(GetExport(), XML_NAMESPACE_OFFICE,
XML_ANNOTATION, false, true);
diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx
index 7bba48a20444..80be0124235d 100644
--- a/xmloff/source/text/txtfldi.cxx
+++ b/xmloff/source/text/txtfldi.cxx
@@ -3306,6 +3306,8 @@ void XMLAnnotationImportContext::ProcessAttribute(
{
if (nToken == XML_TOK_TEXT_NAME)
aName = rValue;
+ if (nToken == XML_TOK_TEXT_RESOLVED)
+ aResolved = rValue;
}
SvXMLImportContextRef XMLAnnotationImportContext::CreateChildContext(
@@ -3468,6 +3470,11 @@ void XMLAnnotationImportContext::PrepareField(
OUString sInitials( aInitialsBuffer.makeStringAndClear() );
xPropertySet->setPropertyValue("Initials", makeAny(sInitials));
+ //import resolved flag
+ bool bTmp(false);
+ ::sax::Converter::convertBool(bTmp, aResolved);
+ xPropertySet->setPropertyValue("Resolved", makeAny(bTmp));
+
util::DateTime aDateTime;
if (::sax::Converter::parseDateTime(aDateTime,
aDateBuffer.makeStringAndClear()))
diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx
index 9f57ac3ac08a..3fbe2eaab4ff 100644
--- a/xmloff/source/text/txtimp.cxx
+++ b/xmloff/source/text/txtimp.cxx
@@ -491,6 +491,7 @@ static const SvXMLTokenMapEntry aTextFieldAttrTokenMap[] =
XML_TOK_TEXTFIELD_REFERENCE_LANGUAGE },
{ XML_NAMESPACE_TEXT, XML_REFERENCE_LANGUAGE,
XML_TOK_TEXTFIELD_REFERENCE_LANGUAGE },
+ { XML_NAMESPACE_LO_EXT, XML_RESOLVED, XML_TOK_TEXT_RESOLVED },
XML_TOKEN_MAP_END
};
diff --git a/xmloff/source/token/tokens.txt b/xmloff/source/token/tokens.txt
index ce472bc62c7a..82b64bc85642 100644
--- a/xmloff/source/token/tokens.txt
+++ b/xmloff/source/token/tokens.txt
@@ -3111,4 +3111,5 @@ reference-language
newline
creator-initials
transliteration-spellout
+resolved
TOKEN_END_DUMMY