2001-01-10 19:51:01 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 21:57:54 +00:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2001-01-10 19:51:01 +00:00
|
|
|
*
|
2010-02-12 15:01:35 +01:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2001-01-10 19:51:01 +00:00
|
|
|
*
|
2008-04-10 21:57:54 +00:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2001-01-10 19:51:01 +00:00
|
|
|
*
|
2008-04-10 21:57:54 +00:00
|
|
|
* This file is part of OpenOffice.org.
|
2001-01-10 19:51:01 +00:00
|
|
|
*
|
2008-04-10 21:57:54 +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-10 19:51:01 +00:00
|
|
|
*
|
2008-04-10 21:57:54 +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-10 19:51:01 +00:00
|
|
|
*
|
2008-04-10 21:57:54 +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-10 19:51:01 +00:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-17 10:03:28 +00:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_xmloff.hxx"
|
2001-01-10 19:51:01 +00:00
|
|
|
#include "XMLChangeInfoContext.hxx"
|
|
|
|
#include "XMLChangedRegionImportContext.hxx"
|
2001-01-24 15:49:52 +00:00
|
|
|
#include "XMLStringBufferImportContext.hxx"
|
2001-01-10 19:51:01 +00:00
|
|
|
#include <com/sun/star/uno/Reference.h>
|
|
|
|
#include "xmlnmspe.hxx"
|
2007-06-27 14:54:47 +00:00
|
|
|
#include <xmloff/nmspmap.hxx>
|
|
|
|
#include <xmloff/xmltoken.hxx>
|
|
|
|
#include <xmloff/xmlimp.hxx>
|
2001-01-10 19:51:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2001-06-29 20:07:26 +00:00
|
|
|
using namespace ::xmloff::token;
|
|
|
|
|
2001-01-10 19:51:01 +00:00
|
|
|
using ::rtl::OUString;
|
|
|
|
using ::com::sun::star::uno::Reference;
|
|
|
|
using ::com::sun::star::xml::sax::XAttributeList;
|
|
|
|
|
|
|
|
|
|
|
|
TYPEINIT1(XMLChangeInfoContext, SvXMLImportContext);
|
|
|
|
|
|
|
|
XMLChangeInfoContext::XMLChangeInfoContext(
|
|
|
|
SvXMLImport& rImport,
|
|
|
|
sal_uInt16 nPrefix,
|
|
|
|
const OUString& rLocalName,
|
|
|
|
XMLChangedRegionImportContext& rPParent,
|
2006-06-19 17:38:50 +00:00
|
|
|
const OUString& rChangeType)
|
|
|
|
: SvXMLImportContext(rImport, nPrefix, rLocalName)
|
|
|
|
, rType(rChangeType)
|
|
|
|
, rChangedRegion(rPParent)
|
2001-01-10 19:51:01 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
XMLChangeInfoContext::~XMLChangeInfoContext()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2006-06-19 17:38:50 +00:00
|
|
|
void XMLChangeInfoContext::StartElement(const Reference<XAttributeList> &)
|
2001-01-10 19:51:01 +00:00
|
|
|
{
|
2004-07-13 07:30:52 +00:00
|
|
|
// no attributes
|
2001-01-24 15:49:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
SvXMLImportContext* XMLChangeInfoContext::CreateChildContext(
|
|
|
|
USHORT nPrefix,
|
|
|
|
const OUString& rLocalName,
|
|
|
|
const Reference<XAttributeList >& xAttrList )
|
|
|
|
{
|
|
|
|
SvXMLImportContext* pContext = NULL;
|
|
|
|
|
2004-07-13 07:30:52 +00:00
|
|
|
if( XML_NAMESPACE_DC == nPrefix )
|
|
|
|
{
|
|
|
|
if( IsXMLToken( rLocalName, XML_CREATOR ) )
|
|
|
|
pContext = new XMLStringBufferImportContext(GetImport(), nPrefix,
|
|
|
|
rLocalName, sAuthorBuffer);
|
|
|
|
else if( IsXMLToken( rLocalName, XML_DATE ) )
|
|
|
|
pContext = new XMLStringBufferImportContext(GetImport(), nPrefix,
|
|
|
|
rLocalName, sDateTimeBuffer);
|
|
|
|
}
|
|
|
|
else if ( ( XML_NAMESPACE_TEXT == nPrefix ) &&
|
2001-06-29 20:07:26 +00:00
|
|
|
IsXMLToken( rLocalName, XML_P ) )
|
2001-01-24 15:49:52 +00:00
|
|
|
{
|
|
|
|
pContext = new XMLStringBufferImportContext(GetImport(), nPrefix,
|
|
|
|
rLocalName, sCommentBuffer);
|
|
|
|
}
|
2004-07-13 07:30:52 +00:00
|
|
|
|
|
|
|
if( !pContext )
|
2001-01-24 15:49:52 +00:00
|
|
|
{
|
|
|
|
pContext = SvXMLImportContext::CreateChildContext(nPrefix, rLocalName,
|
|
|
|
xAttrList);
|
|
|
|
}
|
|
|
|
|
|
|
|
return pContext;
|
|
|
|
}
|
|
|
|
|
|
|
|
void XMLChangeInfoContext::EndElement()
|
|
|
|
{
|
2001-01-10 19:51:01 +00:00
|
|
|
// set values at changed region context
|
2004-07-13 07:30:52 +00:00
|
|
|
rChangedRegion.SetChangeInfo(rType, sAuthorBuffer.makeStringAndClear(),
|
2001-01-24 15:49:52 +00:00
|
|
|
sCommentBuffer.makeStringAndClear(),
|
2004-07-13 07:30:52 +00:00
|
|
|
sDateTimeBuffer.makeStringAndClear());
|
2001-01-10 19:51:01 +00:00
|
|
|
}
|