summaryrefslogtreecommitdiff
path: root/xmloff/source
diff options
context:
space:
mode:
authorBjörn Milcke <bm@openoffice.org>2001-06-21 10:58:21 +0000
committerBjörn Milcke <bm@openoffice.org>2001-06-21 10:58:21 +0000
commit295da6271c3c8bf8a4184b2287f4af453b20fd07 (patch)
treeed943561fcd5e7a9d02f869c4ee6f6673610de31 /xmloff/source
parent3bd77e956e4b751471541e3cbe3f8c788b7b1a50 (diff)
#88404# support line-break and tab-stop on import of titles
Diffstat (limited to 'xmloff/source')
-rw-r--r--xmloff/source/chart/SchXMLParagraphContext.cxx42
-rw-r--r--xmloff/source/chart/SchXMLParagraphContext.hxx24
2 files changed, 55 insertions, 11 deletions
diff --git a/xmloff/source/chart/SchXMLParagraphContext.cxx b/xmloff/source/chart/SchXMLParagraphContext.cxx
index e3aefd8d668f..4708db82a844 100644
--- a/xmloff/source/chart/SchXMLParagraphContext.cxx
+++ b/xmloff/source/chart/SchXMLParagraphContext.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: SchXMLParagraphContext.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 17:07:02 $
+ * last change: $Author: bm $ $Date: 2001-06-21 11:58:04 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -65,10 +65,16 @@
#ifndef _XMLOFF_XMLNMSPE_HXX
#include "xmlnmspe.hxx"
#endif
+#ifndef _XMLOFF_XMLTOKEN_HXX
+#include "xmltoken.hxx"
+#endif
+
+using namespace rtl;
+using namespace com::sun::star;
SchXMLParagraphContext::SchXMLParagraphContext( SvXMLImport& rImport,
- const rtl::OUString& rLocalName,
- rtl::OUString& rText ) :
+ const OUString& rLocalName,
+ OUString& rText ) :
SvXMLImportContext( rImport, XML_NAMESPACE_TEXT, rLocalName ),
mrText( rText )
{
@@ -77,8 +83,32 @@ SchXMLParagraphContext::SchXMLParagraphContext( SvXMLImport& rImport,
SchXMLParagraphContext::~SchXMLParagraphContext()
{}
-void SchXMLParagraphContext::Characters( const rtl::OUString& rChars )
+void SchXMLParagraphContext::EndElement()
+{
+ mrText = maBuffer.makeStringAndClear();
+}
+
+SvXMLImportContext* SchXMLParagraphContext::CreateChildContext(
+ USHORT nPrefix,
+ const OUString& rLocalName,
+ const uno::Reference< xml::sax::XAttributeList >& xAttrList )
{
- mrText = rChars;
+ if( nPrefix == XML_NAMESPACE_TEXT )
+ {
+ if( rLocalName.equals( ::xmloff::token::GetXMLToken( ::xmloff::token::XML_TAB_STOP )))
+ {
+ maBuffer.append( sal_Unicode( 0x0009 )); // tabulator
+ }
+ else if( rLocalName.equals( ::xmloff::token::GetXMLToken( ::xmloff::token::XML_LINE_BREAK )))
+ {
+ maBuffer.append( sal_Unicode( 0x000A )); // linefeed
+ }
+ }
+
+ return new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
}
+void SchXMLParagraphContext::Characters( const OUString& rChars )
+{
+ maBuffer.append( rChars );
+}
diff --git a/xmloff/source/chart/SchXMLParagraphContext.hxx b/xmloff/source/chart/SchXMLParagraphContext.hxx
index 9e736dc1a67c..b1d51aa23bcd 100644
--- a/xmloff/source/chart/SchXMLParagraphContext.hxx
+++ b/xmloff/source/chart/SchXMLParagraphContext.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: SchXMLParagraphContext.hxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 17:07:03 $
+ * last change: $Author: bm $ $Date: 2001-06-21 11:58:21 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -65,6 +65,13 @@
#include "xmlictxt.hxx"
#endif
+#ifndef _RTL_USTRING_HXX_
+#include "rtl/ustring.hxx"
+#endif
+#ifndef _RTL_USTRBUF_HXX_
+#include "rtl/ustrbuf.hxx"
+#endif
+
class SchXMLImport;
namespace com { namespace sun { namespace star { namespace xml { namespace sax {
@@ -74,13 +81,20 @@ namespace com { namespace sun { namespace star { namespace xml { namespace sax {
class SchXMLParagraphContext : public SvXMLImportContext
{
private:
- rtl::OUString& mrText;
+ ::rtl::OUString& mrText;
+ ::rtl::OUStringBuffer maBuffer;
public:
SchXMLParagraphContext( SvXMLImport& rImport,
- const rtl::OUString& rLocalName,
- rtl::OUString& rText );
+ const ::rtl::OUString& rLocalName,
+ ::rtl::OUString& rText );
virtual ~SchXMLParagraphContext();
+ virtual void EndElement();
+
+ virtual SvXMLImportContext* CreateChildContext(
+ USHORT nPrefix,
+ const ::rtl::OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList );
virtual void Characters( const rtl::OUString& rChars );
};