diff options
author | Daniel Vogelheim <dvo@openoffice.org> | 2001-01-25 13:05:36 +0000 |
---|---|---|
committer | Daniel Vogelheim <dvo@openoffice.org> | 2001-01-25 13:05:36 +0000 |
commit | ad212e334992bd97026191412ff3148ac808a47b (patch) | |
tree | b2b28216839eb630948ce9355c2ce9c69989a576 /xmloff | |
parent | c6a02b31725444778951946e4e0aa4980c70613b (diff) |
- fixed: #83150# annotation field: author property now optional
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/dtd/office.mod | 4 | ||||
-rw-r--r-- | xmloff/inc/txtfldi.hxx | 5 | ||||
-rw-r--r-- | xmloff/source/text/txtfldi.cxx | 20 |
3 files changed, 14 insertions, 15 deletions
diff --git a/xmloff/dtd/office.mod b/xmloff/dtd/office.mod index d5a1a8ba6a34..8c1f174bcc92 100644 --- a/xmloff/dtd/office.mod +++ b/xmloff/dtd/office.mod @@ -1,5 +1,5 @@ <!-- - $Id: office.mod,v 1.25 2001-01-24 16:47:57 dvo Exp $ + $Id: office.mod,v 1.26 2001-01-25 14:05:35 dvo Exp $ The Contents of this file are made available subject to the terms of either of the following licenses @@ -165,7 +165,7 @@ <!-- limitation: in the current implementation, only plain text inside of paragraphs is supported --> <!ELEMENT office:annotation (text:p)*> -<!ATTLIST office:annotation office:author %string; #REQUIRED> +<!ATTLIST office:annotation office:author %string; #IMPLIED> <!ATTLIST office:annotation office:create-date %date; #IMPLIED> <!ATTLIST office:annotation office:create-date-string %string; #IMPLIED> <!ATTLIST office:annotation office:display %boolean; "false"> diff --git a/xmloff/inc/txtfldi.hxx b/xmloff/inc/txtfldi.hxx index c62565a26c40..240e94b1f4ac 100644 --- a/xmloff/inc/txtfldi.hxx +++ b/xmloff/inc/txtfldi.hxx @@ -2,9 +2,9 @@ * * $RCSfile: txtfldi.hxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: dvo $ $Date: 2001-01-24 16:49:47 $ + * last change: $Author: dvo $ $Date: 2001-01-25 14:05:34 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1346,7 +1346,6 @@ class XMLAnnotationImportContext : public XMLTextFieldImportContext ::rtl::OUStringBuffer aTextBuffer; ::com::sun::star::util::Date aDate; - sal_Bool bAuthorOK; sal_Bool bDateOK; public: diff --git a/xmloff/source/text/txtfldi.cxx b/xmloff/source/text/txtfldi.cxx index d46698f0afd6..7c2634cfc47e 100644 --- a/xmloff/source/text/txtfldi.cxx +++ b/xmloff/source/text/txtfldi.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtfldi.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * - * last change: $Author: dvo $ $Date: 2001-01-24 16:49:52 $ + * last change: $Author: dvo $ $Date: 2001-01-25 14:05:36 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -3410,9 +3410,9 @@ XMLAnnotationImportContext::XMLAnnotationImportContext( sPropertyAuthor(RTL_CONSTASCII_USTRINGPARAM(sAPI_author)), sPropertyContent(RTL_CONSTASCII_USTRINGPARAM(sAPI_content)), sPropertyDate(RTL_CONSTASCII_USTRINGPARAM(sAPI_date)), - bDateOK(sal_False), - bAuthorOK(sal_False) + bDateOK(sal_False) { + bValid = sal_True; } void XMLAnnotationImportContext::ProcessAttribute( @@ -3436,15 +3436,12 @@ void XMLAnnotationImportContext::ProcessAttribute( case XML_TOK_TEXTFIELD_OFFICE_AUTHOR: sAuthor = sAttrValue; - bAuthorOK = sal_True; break; default: // ignore break; } - - bValid = bDateOK && bAuthorOK; } SvXMLImportContext* XMLAnnotationImportContext::CreateChildContext( @@ -3461,11 +3458,15 @@ void XMLAnnotationImportContext::PrepareField( { Any aAny; + // import (possibly empty) author aAny <<= sAuthor; xPropertySet->setPropertyValue(sPropertyAuthor, aAny); - aAny <<= aDate; - xPropertySet->setPropertyValue(sPropertyDate, aAny); + if (bDateOK) + { + aAny <<= aDate; + xPropertySet->setPropertyValue(sPropertyDate, aAny); + } // delete last paragraph mark (if necessary) OUString sBuffer = aTextBuffer.makeStringAndClear(); @@ -3473,7 +3474,6 @@ void XMLAnnotationImportContext::PrepareField( { sBuffer = sBuffer.copy(0, sBuffer.getLength()-1); } - aAny <<= sBuffer; xPropertySet->setPropertyValue(sPropertyContent, aAny); } |