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

implement docx import/export of SwPostItField::aInitials

Change-Id: I919f5f0c4f6a1f6b1ea6261d9703da7a6c1046d3
üst 36270776
...@@ -545,6 +545,7 @@ public: ...@@ -545,6 +545,7 @@ public:
virtual rtl::OUString GetPar2() const; virtual rtl::OUString GetPar2() const;
virtual void SetPar2(const rtl::OUString& rStr); virtual void SetPar2(const rtl::OUString& rStr);
const rtl::OUString& GetTxt() const { return sTxt; } const rtl::OUString& GetTxt() const { return sTxt; }
const rtl::OUString& GetInitials() const;
const OutlinerParaObject* GetTextObject() const; const OutlinerParaObject* GetTextObject() const;
void SetTextObject( OutlinerParaObject* pText ); void SetTextObject( OutlinerParaObject* pText );
......
...@@ -1799,6 +1799,11 @@ rtl::OUString SwPostItField::GetPar2() const ...@@ -1799,6 +1799,11 @@ rtl::OUString SwPostItField::GetPar2() const
return sTxt; return sTxt;
} }
const rtl::OUString& SwPostItField::GetInitials() const
{
return sInitials;
}
const OutlinerParaObject* SwPostItField::GetTextObject() const const OutlinerParaObject* SwPostItField::GetTextObject() const
{ {
return mpText; return mpText;
......
...@@ -3360,7 +3360,8 @@ void DocxAttributeOutput::WritePostitFields() ...@@ -3360,7 +3360,8 @@ void DocxAttributeOutput::WritePostitFields()
const SwPostItField* f = m_postitFields[ i ]; const SwPostItField* f = m_postitFields[ i ];
m_pSerializer->startElementNS( XML_w, XML_comment, FSNS( XML_w, XML_id ), idstr.getStr(), m_pSerializer->startElementNS( XML_w, XML_comment, FSNS( XML_w, XML_id ), idstr.getStr(),
FSNS( XML_w, XML_author ), rtl::OUStringToOString( f->GetPar1(), RTL_TEXTENCODING_UTF8 ).getStr(), FSNS( XML_w, XML_author ), rtl::OUStringToOString( f->GetPar1(), RTL_TEXTENCODING_UTF8 ).getStr(),
FSNS( XML_w, XML_date ), msfilter::util::DateTimeToOString(f->GetDateTime()).getStr(), FSEND ); FSNS( XML_w, XML_date ), msfilter::util::DateTimeToOString(f->GetDateTime()).getStr(),
FSNS( XML_w, XML_initials ), rtl::OUStringToOString( f->GetInitials(), RTL_TEXTENCODING_UTF8 ).getStr(), FSEND );
// Check for the text object existing, it seems that it can be NULL when saving a newly created // Check for the text object existing, it seems that it can be NULL when saving a newly created
// comment without giving focus back to the main document. As GetTxt() is empty in that case as well, // comment without giving focus back to the main document. As GetTxt() is empty in that case as well,
// that is probably a bug in the Writer core. // that is probably a bug in the Writer core.
......
...@@ -1361,6 +1361,9 @@ void DomainMapper::lcl_attribute(Id nName, Value & val) ...@@ -1361,6 +1361,9 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
case NS_ooxml::LN_EG_RangeMarkupElements_commentRangeEnd: case NS_ooxml::LN_EG_RangeMarkupElements_commentRangeEnd:
m_pImpl->AddAnnotationPosition(false); m_pImpl->AddAnnotationPosition(false);
break; break;
case NS_ooxml::LN_CT_Comment_initials:
m_pImpl->SetCurrentRedlineInitials(sStringValue);
break;
case NS_ooxml::LN_token: case NS_ooxml::LN_token:
m_pImpl->SetCurrentRedlineToken( nIntValue ); m_pImpl->SetCurrentRedlineToken( nIntValue );
break; break;
......
...@@ -3538,6 +3538,12 @@ void DomainMapper_Impl::SetCurrentRedlineAuthor( rtl::OUString sAuthor ) ...@@ -3538,6 +3538,12 @@ void DomainMapper_Impl::SetCurrentRedlineAuthor( rtl::OUString sAuthor )
m_xAnnotationField->setPropertyValue("Author", uno::makeAny(sAuthor)); m_xAnnotationField->setPropertyValue("Author", uno::makeAny(sAuthor));
} }
void DomainMapper_Impl::SetCurrentRedlineInitials( rtl::OUString sInitials )
{
if (m_xAnnotationField.is())
m_xAnnotationField->setPropertyValue("Initials", uno::makeAny(sInitials));
}
void DomainMapper_Impl::SetCurrentRedlineDate( rtl::OUString sDate ) void DomainMapper_Impl::SetCurrentRedlineDate( rtl::OUString sDate )
{ {
if (!m_xAnnotationField.is()) if (!m_xAnnotationField.is())
......
...@@ -621,6 +621,7 @@ public: ...@@ -621,6 +621,7 @@ public:
void SetCurrentRedlineToken( sal_Int32 nToken ); void SetCurrentRedlineToken( sal_Int32 nToken );
void RemoveCurrentRedline( ); void RemoveCurrentRedline( );
void ResetParaRedline( ); void ResetParaRedline( );
void SetCurrentRedlineInitials( rtl::OUString sInitials );
void ApplySettingsTable(); void ApplySettingsTable();
SectionPropertyMap * GetSectionContext(); SectionPropertyMap * GetSectionContext();
......
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