2010-10-12 15:53:47 +02:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2001-01-24 15:49:52 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 22:19:13 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2001-01-24 15:49:52 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2001-01-24 15:49:52 +00:00
|
|
|
*
|
2008-04-10 22:19:13 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2001-01-24 15:49:52 +00:00
|
|
|
*
|
2008-04-10 22:19:13 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2001-01-24 15:49:52 +00:00
|
|
|
*
|
2008-04-10 22:19:13 +00:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2001-01-24 15:49:52 +00:00
|
|
|
*
|
2008-04-10 22:19:13 +00:00
|
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU Lesser General Public License version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2001-01-24 15:49:52 +00:00
|
|
|
*
|
2008-04-10 22:19:13 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2001-01-24 15:49:52 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#include "XMLStringBufferImportContext.hxx"
|
2007-06-27 15:07:01 +00:00
|
|
|
#include <xmloff/xmltoken.hxx>
|
2010-04-16 23:04:00 +02:00
|
|
|
#include "xmloff/xmlnmspe.hxx"
|
2001-01-24 15:49:52 +00:00
|
|
|
|
2001-06-29 20:07:26 +00:00
|
|
|
|
2001-01-24 15:49:52 +00:00
|
|
|
using ::rtl::OUString;
|
|
|
|
using ::rtl::OUStringBuffer;
|
|
|
|
using ::com::sun::star::uno::Reference;
|
|
|
|
using ::com::sun::star::xml::sax::XAttributeList;
|
2001-06-29 20:07:26 +00:00
|
|
|
using ::xmloff::token::IsXMLToken;
|
|
|
|
using ::xmloff::token::XML_P;
|
|
|
|
|
2001-01-24 15:49:52 +00:00
|
|
|
|
|
|
|
TYPEINIT1(XMLStringBufferImportContext, SvXMLImportContext);
|
|
|
|
|
|
|
|
XMLStringBufferImportContext::XMLStringBufferImportContext(
|
|
|
|
SvXMLImport& rImport,
|
|
|
|
sal_uInt16 nPrefix,
|
|
|
|
const OUString& sLocalName,
|
|
|
|
OUStringBuffer& rBuffer) :
|
|
|
|
SvXMLImportContext(rImport, nPrefix, sLocalName),
|
|
|
|
rTextBuffer(rBuffer)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
XMLStringBufferImportContext::~XMLStringBufferImportContext()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
SvXMLImportContext *XMLStringBufferImportContext::CreateChildContext(
|
2010-11-10 13:50:33 +08:00
|
|
|
sal_uInt16 nPrefix,
|
2001-01-24 15:49:52 +00:00
|
|
|
const OUString& rLocalName,
|
2006-06-19 17:45:01 +00:00
|
|
|
const Reference<XAttributeList> &)
|
2001-01-24 15:49:52 +00:00
|
|
|
{
|
|
|
|
return new XMLStringBufferImportContext(GetImport(), nPrefix,
|
|
|
|
rLocalName, rTextBuffer);
|
|
|
|
}
|
|
|
|
|
|
|
|
void XMLStringBufferImportContext::Characters(
|
|
|
|
const OUString& rChars )
|
|
|
|
{
|
|
|
|
rTextBuffer.append(rChars);
|
|
|
|
}
|
|
|
|
|
|
|
|
void XMLStringBufferImportContext::EndElement()
|
|
|
|
{
|
|
|
|
// add return for paragraph elements
|
|
|
|
if ( (XML_NAMESPACE_TEXT == GetPrefix()) &&
|
2001-06-29 20:07:26 +00:00
|
|
|
(IsXMLToken(GetLocalName(), XML_P)) )
|
2001-01-24 15:49:52 +00:00
|
|
|
{
|
|
|
|
rTextBuffer.append(sal_Unicode(0x0a));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-10-12 15:53:47 +02:00
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|