summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/filter/xml/celltextparacontext.cxx23
-rw-r--r--sc/source/filter/xml/celltextparacontext.hxx2
-rw-r--r--sc/source/filter/xml/xmlcelli.cxx9
-rw-r--r--sc/source/filter/xml/xmlcelli.hxx4
4 files changed, 22 insertions, 16 deletions
diff --git a/sc/source/filter/xml/celltextparacontext.cxx b/sc/source/filter/xml/celltextparacontext.cxx
index a70143e07a53..66c48e7d2447 100644
--- a/sc/source/filter/xml/celltextparacontext.cxx
+++ b/sc/source/filter/xml/celltextparacontext.cxx
@@ -28,24 +28,26 @@ void ScXMLCellTextParaContext::StartElement(const uno::Reference<xml::sax::XAttr
void ScXMLCellTextParaContext::EndElement()
{
- OUString aPara = maContent.makeStringAndClear();
- if (aPara.isEmpty())
- return;
+ if (!maContent.isEmpty())
+ mrParentCxt.PushParagraphSpan(maContent);
- mrParentCxt.PushParagraph(aPara);
+ mrParentCxt.PushParagraphEnd();
}
void ScXMLCellTextParaContext::Characters(const OUString& rChars)
{
- if (rChars.isEmpty())
- return;
-
- maContent.append(rChars);
+ maContent = rChars;
}
SvXMLImportContext* ScXMLCellTextParaContext::CreateChildContext(
sal_uInt16 nPrefix, const OUString& rLocalName, const uno::Reference<xml::sax::XAttributeList>& xAttrList)
{
+ if (!maContent.isEmpty())
+ {
+ mrParentCxt.PushParagraphSpan(maContent);
+ maContent = OUString();
+ }
+
const SvXMLTokenMap& rTokenMap = GetScImport().GetCellTextParaElemTokenMap();
switch (rTokenMap.Get(nPrefix, rLocalName))
{
@@ -61,10 +63,7 @@ SvXMLImportContext* ScXMLCellTextParaContext::CreateChildContext(
void ScXMLCellTextParaContext::PushSpan(const OUString& rSpan)
{
- if (rSpan.isEmpty())
- return;
-
- maContent.append(rSpan);
+ mrParentCxt.PushParagraphSpan(rSpan);
}
ScXMLCellTextSpanContext::ScXMLCellTextSpanContext(
diff --git a/sc/source/filter/xml/celltextparacontext.hxx b/sc/source/filter/xml/celltextparacontext.hxx
index ecc68808f571..75ce3f8c76db 100644
--- a/sc/source/filter/xml/celltextparacontext.hxx
+++ b/sc/source/filter/xml/celltextparacontext.hxx
@@ -21,7 +21,7 @@ class ScXMLTableRowCellContext;
class ScXMLCellTextParaContext : public ScXMLImportContext
{
ScXMLTableRowCellContext& mrParentCxt;
- OUStringBuffer maContent;
+ OUString maContent;
public:
ScXMLCellTextParaContext(ScXMLImport& rImport, sal_uInt16 nPrefix, const OUString& rLName, ScXMLTableRowCellContext& rParent);
diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index abe8353f8cfa..e13cb82dc7c5 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -300,9 +300,14 @@ bool cellExists( const ScAddress& rCellPos )
}
-void ScXMLTableRowCellContext::PushParagraph(const OUString& rPara)
+void ScXMLTableRowCellContext::PushParagraphSpan(const OUString& rSpan)
{
- maParagraphs.push_back(rPara);
+ maParagraph.append(rSpan);
+}
+
+void ScXMLTableRowCellContext::PushParagraphEnd()
+{
+ maParagraphs.push_back(maParagraph.makeStringAndClear());
}
SvXMLImportContext *ScXMLTableRowCellContext::CreateChildContext( sal_uInt16 nPrefix,
diff --git a/sc/source/filter/xml/xmlcelli.hxx b/sc/source/filter/xml/xmlcelli.hxx
index 58d0e4526562..cb61ce4a4956 100644
--- a/sc/source/filter/xml/xmlcelli.hxx
+++ b/sc/source/filter/xml/xmlcelli.hxx
@@ -41,6 +41,7 @@ class ScXMLTableRowCellContext : public SvXMLImportContext
boost::optional<OUString> maContentValidationName;
std::vector<OUString> maParagraphs;
+ OUStringBuffer maParagraph;
boost::scoped_ptr< ScXMLAnnotationData > mxAnnotationData;
ScMyImpDetectiveObjVec* pDetectiveObjVec;
@@ -106,7 +107,8 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::xml::sax::XAttributeList>& xAttrList );
- void PushParagraph(const OUString& rPara);
+ void PushParagraphSpan(const OUString& rSpan);
+ void PushParagraphEnd();
void SetAnnotation( const ScAddress& rPosition );
void SetDetectiveObj( const ScAddress& rPosition );