From 180819d4feb2a2e889acad910d6d5241bea95d55 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Mon, 11 Feb 2013 13:25:53 -0500 Subject: Import document title field as well. Change-Id: Iea73d553927ce95afbb9b6e9062b398733228687 --- sc/source/filter/xml/celltextparacontext.cxx | 4 +++- sc/source/filter/xml/celltextparacontext.hxx | 2 +- sc/source/filter/xml/xmlcelli.cxx | 26 ++++++++++++++++++-------- sc/source/filter/xml/xmlcelli.hxx | 7 +++++-- 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/sc/source/filter/xml/celltextparacontext.cxx b/sc/source/filter/xml/celltextparacontext.cxx index 84249b422fcd..a4ce72dec9cd 100644 --- a/sc/source/filter/xml/celltextparacontext.cxx +++ b/sc/source/filter/xml/celltextparacontext.cxx @@ -82,8 +82,9 @@ void ScXMLCellTextParaContext::PushFieldDate(const OUString& rOutput) { } -void ScXMLCellTextParaContext::PushFieldTitle(const OUString& rTitle) +void ScXMLCellTextParaContext::PushFieldTitle() { + mrParentCxt.PushParagraphFieldDocTitle(); } ScXMLCellTextSpanContext::ScXMLCellTextSpanContext( @@ -205,6 +206,7 @@ void ScXMLCellFieldTitleContext::StartElement(const uno::ReferenceQuickInsertField(SvxFieldItem(*it->mpItem, EE_FEATURE_FIELD), it->maSelection); + mpEditEngine->QuickInsertField(SvxFieldItem(*it->mpData, EE_FEATURE_FIELD), it->maSelection); } pNewCell = new ScEditCell(mpEditEngine->CreateTextObject(), pDoc, pDoc->GetEditPool()); diff --git a/sc/source/filter/xml/xmlcelli.hxx b/sc/source/filter/xml/xmlcelli.hxx index 20f4465ae98c..022d5a2fab11 100644 --- a/sc/source/filter/xml/xmlcelli.hxx +++ b/sc/source/filter/xml/xmlcelli.hxx @@ -49,10 +49,10 @@ class ScXMLTableRowCellContext : public ScXMLImportContext struct Field : boost::noncopyable { - SvxFieldData* mpItem; + SvxFieldData* mpData; ESelection maSelection; - Field(); + Field(SvxFieldData* pData); ~Field(); }; @@ -118,6 +118,8 @@ class ScXMLTableRowCellContext : public ScXMLImportContext bool IsPossibleErrorString() const; + void PushParagraphField(SvxFieldData* pData); + public: ScXMLTableRowCellContext( ScXMLImport& rImport, sal_uInt16 nPrfx, @@ -135,6 +137,7 @@ public: void PushParagraphSpan(const OUString& rSpan, const OUString& rStyleName); void PushParagraphFieldSheetName(); + void PushParagraphFieldDocTitle(); void PushParagraphEnd(); void SetAnnotation( const ScAddress& rPosition ); -- cgit