summaryrefslogtreecommitdiff
path: root/sc/source/filter/xml/xmlcelli.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-02-11 13:25:53 -0500
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-02-11 22:33:35 -0500
commit180819d4feb2a2e889acad910d6d5241bea95d55 (patch)
treee089014012e2a02bb3cd688034e3b0b6db2e6487 /sc/source/filter/xml/xmlcelli.cxx
parentec3e84c89e6abcd12cc79ed38c5148e89a7a4f35 (diff)
Import document title field as well.
Change-Id: Iea73d553927ce95afbb9b6e9062b398733228687
Diffstat (limited to 'sc/source/filter/xml/xmlcelli.cxx')
-rw-r--r--sc/source/filter/xml/xmlcelli.cxx26
1 files changed, 18 insertions, 8 deletions
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index aff762ff36a7..255d5ae77b27 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -116,11 +116,11 @@ using namespace xmloff::token;
ScXMLTableRowCellContext::ParaFormat::ParaFormat(ScEditEngineDefaulter& rEditEngine) :
maItemSet(rEditEngine.GetEmptyItemSet()) {}
-ScXMLTableRowCellContext::Field::Field() : mpItem(NULL) {}
+ScXMLTableRowCellContext::Field::Field(SvxFieldData* pData) : mpData(pData) {}
ScXMLTableRowCellContext::Field::~Field()
{
- delete mpItem;
+ delete mpData;
}
ScXMLTableRowCellContext::ScXMLTableRowCellContext( ScXMLImport& rImport,
@@ -557,20 +557,30 @@ void ScXMLTableRowCellContext::PushParagraphSpan(const OUString& rSpan, const OU
rFmt.maItemSet.Put(*pPoolItem);
}
-void ScXMLTableRowCellContext::PushParagraphFieldSheetName()
+void ScXMLTableRowCellContext::PushParagraphField(SvxFieldData* pData)
{
- SCTAB nTab = GetScImport().GetTables().GetCurrentCellPos().Tab();
- maFields.push_back(new Field);
+ maFields.push_back(new Field(pData));
Field& rField = maFields.back();
- rField.mpItem = new SvxTableField(nTab);
+
sal_Int32 nPos = maParagraph.getLength();
- maParagraph.append(sal_Unicode('\1'));
+ maParagraph.append(sal_Unicode('\1')); // Placeholder text for inserted field item.
rField.maSelection.nStartPara = mnCurParagraph;
rField.maSelection.nEndPara = mnCurParagraph;
rField.maSelection.nStartPos = nPos;
rField.maSelection.nEndPos = nPos+1;
}
+void ScXMLTableRowCellContext::PushParagraphFieldSheetName()
+{
+ SCTAB nTab = GetScImport().GetTables().GetCurrentCellPos().Tab();
+ PushParagraphField(new SvxTableField(nTab));
+}
+
+void ScXMLTableRowCellContext::PushParagraphFieldDocTitle()
+{
+ PushParagraphField(new SvxFileField);
+}
+
void ScXMLTableRowCellContext::PushParagraphEnd()
{
// EditEngine always has at least one paragraph even when its content is empty.
@@ -1027,7 +1037,7 @@ void ScXMLTableRowCellContext::PutTextCell( const ScAddress& rCurrentPos,
{
FieldsType::const_iterator it = maFields.begin(), itEnd = maFields.end();
for (; it != itEnd; ++it)
- mpEditEngine->QuickInsertField(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());