diff options
author | Björn Milcke <bm@openoffice.org> | 2001-06-21 10:58:21 +0000 |
---|---|---|
committer | Björn Milcke <bm@openoffice.org> | 2001-06-21 10:58:21 +0000 |
commit | 295da6271c3c8bf8a4184b2287f4af453b20fd07 (patch) | |
tree | ed943561fcd5e7a9d02f869c4ee6f6673610de31 /xmloff/source/chart/SchXMLParagraphContext.cxx | |
parent | 3bd77e956e4b751471541e3cbe3f8c788b7b1a50 (diff) |
#88404# support line-break and tab-stop on import of titles
Diffstat (limited to 'xmloff/source/chart/SchXMLParagraphContext.cxx')
-rw-r--r-- | xmloff/source/chart/SchXMLParagraphContext.cxx | 42 |
1 files changed, 36 insertions, 6 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 ); +} |