Kaydet (Commit) c2a73a47 authored tarafından Miklos Vajna's avatar Miklos Vajna

xmloff: implement import/export of SwPostItField::aInitials

Change-Id: Ie28e8e4c2e80d9234cf1ec2ca43dd200cf1d56cb
üst 6b919e03
...@@ -479,6 +479,7 @@ private: ...@@ -479,6 +479,7 @@ private:
const ::rtl::OUString sPropertyFileFormat; const ::rtl::OUString sPropertyFileFormat;
const ::rtl::OUString sPropertyFullName; const ::rtl::OUString sPropertyFullName;
const ::rtl::OUString sPropertyHint; const ::rtl::OUString sPropertyHint;
const ::rtl::OUString sPropertyInitials;
const ::rtl::OUString sPropertyInstanceName; const ::rtl::OUString sPropertyInstanceName;
const ::rtl::OUString sPropertyIsAutomaticUpdate; const ::rtl::OUString sPropertyIsAutomaticUpdate;
const ::rtl::OUString sPropertyIsConditionTrue; const ::rtl::OUString sPropertyIsConditionTrue;
......
...@@ -1341,11 +1341,13 @@ protected: ...@@ -1341,11 +1341,13 @@ protected:
class XMLAnnotationImportContext : public XMLTextFieldImportContext class XMLAnnotationImportContext : public XMLTextFieldImportContext
{ {
const ::rtl::OUString sPropertyAuthor; const ::rtl::OUString sPropertyAuthor;
const ::rtl::OUString sPropertyInitials;
const ::rtl::OUString sPropertyContent; const ::rtl::OUString sPropertyContent;
const ::rtl::OUString sPropertyDate; const ::rtl::OUString sPropertyDate;
const ::rtl::OUString sPropertyTextRange; const ::rtl::OUString sPropertyTextRange;
::rtl::OUStringBuffer aAuthorBuffer; ::rtl::OUStringBuffer aAuthorBuffer;
::rtl::OUStringBuffer aInitialsBuffer;
::rtl::OUStringBuffer aTextBuffer; ::rtl::OUStringBuffer aTextBuffer;
::rtl::OUStringBuffer aDateBuffer; ::rtl::OUStringBuffer aDateBuffer;
......
...@@ -316,6 +316,7 @@ XMLTextFieldExport::XMLTextFieldExport( SvXMLExport& rExp, ...@@ -316,6 +316,7 @@ XMLTextFieldExport::XMLTextFieldExport( SvXMLExport& rExp,
sPropertyFileFormat(RTL_CONSTASCII_USTRINGPARAM("FileFormat")), sPropertyFileFormat(RTL_CONSTASCII_USTRINGPARAM("FileFormat")),
sPropertyFullName(RTL_CONSTASCII_USTRINGPARAM("FullName")), sPropertyFullName(RTL_CONSTASCII_USTRINGPARAM("FullName")),
sPropertyHint(RTL_CONSTASCII_USTRINGPARAM("Hint")), sPropertyHint(RTL_CONSTASCII_USTRINGPARAM("Hint")),
sPropertyInitials("Initials"),
sPropertyInstanceName(RTL_CONSTASCII_USTRINGPARAM("InstanceName")), sPropertyInstanceName(RTL_CONSTASCII_USTRINGPARAM("InstanceName")),
sPropertyIsAutomaticUpdate(RTL_CONSTASCII_USTRINGPARAM("IsAutomaticUpdate")), sPropertyIsAutomaticUpdate(RTL_CONSTASCII_USTRINGPARAM("IsAutomaticUpdate")),
sPropertyIsConditionTrue(RTL_CONSTASCII_USTRINGPARAM("IsConditionTrue")), sPropertyIsConditionTrue(RTL_CONSTASCII_USTRINGPARAM("IsConditionTrue")),
...@@ -1760,6 +1761,16 @@ void XMLTextFieldExport::ExportFieldHelper( ...@@ -1760,6 +1761,16 @@ void XMLTextFieldExport::ExportFieldHelper(
GetExport().Characters(aBuffer.makeStringAndClear()); GetExport().Characters(aBuffer.makeStringAndClear());
} }
// initials
OUString aInitials( GetStringProperty(sPropertyInitials, rPropSet) );
if( !aInitials.isEmpty() )
{
SvXMLElementExport aCreatorElem( GetExport(), XML_NAMESPACE_TEXT,
XML_SENDER_INITIALS, sal_True,
sal_False );
GetExport().Characters(aInitials);
}
com::sun::star::uno::Reference < com::sun::star::text::XText > xText; com::sun::star::uno::Reference < com::sun::star::text::XText > xText;
try try
{ {
......
...@@ -158,6 +158,7 @@ const sal_Char sAPI_is_fixed[] = "IsFixed"; ...@@ -158,6 +158,7 @@ const sal_Char sAPI_is_fixed[] = "IsFixed";
const sal_Char sAPI_content[] = "Content"; const sal_Char sAPI_content[] = "Content";
const sal_Char sAPI_value[] = "Value"; const sal_Char sAPI_value[] = "Value";
const sal_Char sAPI_author[] = "Author"; const sal_Char sAPI_author[] = "Author";
const sal_Char sAPI_initials[] = "Initials";
const sal_Char sAPI_full_name[] = "FullName"; const sal_Char sAPI_full_name[] = "FullName";
const sal_Char sAPI_place_holder_type[] = "PlaceHolderType"; const sal_Char sAPI_place_holder_type[] = "PlaceHolderType";
const sal_Char sAPI_place_holder[] = "PlaceHolder"; const sal_Char sAPI_place_holder[] = "PlaceHolder";
...@@ -3633,6 +3634,7 @@ XMLAnnotationImportContext::XMLAnnotationImportContext( ...@@ -3633,6 +3634,7 @@ XMLAnnotationImportContext::XMLAnnotationImportContext(
XMLTextFieldImportContext(rImport, rHlp, sAPI_annotation, XMLTextFieldImportContext(rImport, rHlp, sAPI_annotation,
nPrfx, sLocalName), nPrfx, sLocalName),
sPropertyAuthor(sAPI_author), sPropertyAuthor(sAPI_author),
sPropertyInitials(sAPI_initials),
sPropertyContent(sAPI_content), sPropertyContent(sAPI_content),
// why is there no UNO_NAME_DATE_TIME, but only UNO_NAME_DATE_TIME_VALUE? // why is there no UNO_NAME_DATE_TIME, but only UNO_NAME_DATE_TIME_VALUE?
sPropertyDate(sAPI_date_time_value), sPropertyDate(sAPI_date_time_value),
...@@ -3668,6 +3670,12 @@ SvXMLImportContext* XMLAnnotationImportContext::CreateChildContext( ...@@ -3668,6 +3670,12 @@ SvXMLImportContext* XMLAnnotationImportContext::CreateChildContext(
pContext = new XMLStringBufferImportContext(GetImport(), nPrefix, pContext = new XMLStringBufferImportContext(GetImport(), nPrefix,
rLocalName, aDateBuffer); rLocalName, aDateBuffer);
} }
else if( XML_NAMESPACE_TEXT == nPrefix )
{
if( IsXMLToken( rLocalName, XML_SENDER_INITIALS ) )
pContext = new XMLStringBufferImportContext(GetImport(), nPrefix,
rLocalName, aInitialsBuffer);
}
if( !pContext ) if( !pContext )
{ {
...@@ -3758,6 +3766,10 @@ void XMLAnnotationImportContext::PrepareField( ...@@ -3758,6 +3766,10 @@ void XMLAnnotationImportContext::PrepareField(
OUString sAuthor( aAuthorBuffer.makeStringAndClear() ); OUString sAuthor( aAuthorBuffer.makeStringAndClear() );
xPropertySet->setPropertyValue(sPropertyAuthor, makeAny(sAuthor)); xPropertySet->setPropertyValue(sPropertyAuthor, makeAny(sAuthor));
// import (possibly empty) initials
OUString sInitials( aInitialsBuffer.makeStringAndClear() );
xPropertySet->setPropertyValue(sPropertyInitials, makeAny(sInitials));
DateTime aDateTime; DateTime aDateTime;
if (::sax::Converter::convertDateTime(aDateTime, if (::sax::Converter::convertDateTime(aDateTime,
aDateBuffer.makeStringAndClear())) aDateBuffer.makeStringAndClear()))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment