Files
libreoffice/xmloff/source/draw/ximpnote.cxx

146 lines
4.4 KiB
C++
Raw Normal View History

2000-09-18 16:07:07 +00:00
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2000-09-18 16:07:07 +00:00
*
* Copyright 2008 by Sun Microsystems, Inc.
2000-09-18 16:07:07 +00:00
*
* OpenOffice.org - a multi-platform office productivity suite
2000-09-18 16:07:07 +00:00
*
* $RCSfile: ximpnote.cxx,v $
* $Revision: 1.13 $
2000-09-18 16:07:07 +00:00
*
* This file is part of OpenOffice.org.
2000-09-18 16:07:07 +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.
2000-09-18 16:07:07 +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).
2000-09-18 16:07:07 +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.
2000-09-18 16:07:07 +00:00
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_xmloff.hxx"
2000-09-18 16:07:07 +00:00
#include "ximpnote.hxx"
#include <com/sun/star/presentation/XPresentationPage.hpp>
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
2000-09-18 16:07:07 +00:00
using namespace ::com::sun::star;
//////////////////////////////////////////////////////////////////////////////
SdXMLNotesContext::SdXMLNotesContext( SdXMLImport& rImport,
USHORT nPrfx, const OUString& rLocalName,
const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList>& xAttrList,
2000-09-18 16:07:07 +00:00
uno::Reference< drawing::XShapes >& rShapes)
: SdXMLGenericPageContext( rImport, nPrfx, rLocalName, xAttrList, rShapes )
2000-09-18 16:07:07 +00:00
{
OUString sStyleName;
const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
for(sal_Int16 i=0; i < nAttrCount; i++)
{
OUString sAttrName = xAttrList->getNameByIndex( i );
OUString aLocalName;
sal_uInt16 nPrefix = GetSdImport().GetNamespaceMap().GetKeyByAttrName( sAttrName, &aLocalName );
OUString sValue = xAttrList->getValueByIndex( i );
const SvXMLTokenMap& rAttrTokenMap = GetSdImport().GetMasterPageAttrTokenMap();
switch(rAttrTokenMap.Get(nPrefix, aLocalName))
{
case XML_TOK_MASTERPAGE_PAGE_MASTER_NAME:
{
msPageMasterName = sValue;
break;
}
case XML_TOK_MASTERPAGE_STYLE_NAME:
{
sStyleName = sValue;
break;
}
case XML_TOK_MASTERPAGE_USE_HEADER_NAME:
{
maUseHeaderDeclName = sValue;
break;
}
case XML_TOK_MASTERPAGE_USE_FOOTER_NAME:
{
maUseFooterDeclName = sValue;
break;
}
case XML_TOK_MASTERPAGE_USE_DATE_TIME_NAME:
{
maUseDateTimeDeclName = sValue;
break;
}
}
}
SetStyle( sStyleName );
// now delete all up-to-now contained shapes from this notes page
uno::Reference< drawing::XShape > xShape;
while(rShapes->getCount())
2000-09-18 16:07:07 +00:00
{
rShapes->getByIndex(0L) >>= xShape;
if(xShape.is())
rShapes->remove(xShape);
2000-09-18 16:07:07 +00:00
}
// set page-master?
if(msPageMasterName.getLength())
{
SetPageMaster( msPageMasterName );
}
2000-09-18 16:07:07 +00:00
}
//////////////////////////////////////////////////////////////////////////////
SdXMLNotesContext::~SdXMLNotesContext()
{
}
//////////////////////////////////////////////////////////////////////////////
SvXMLImportContext *SdXMLNotesContext::CreateChildContext( USHORT nPrefix,
const OUString& rLocalName,
const uno::Reference< xml::sax::XAttributeList>& xAttrList )
{
// OK, notes page is set on base class, objects can be imported on notes page
SvXMLImportContext *pContext = 0L;
2000-09-18 16:07:07 +00:00
// some special objects inside presentation:notes context
// ...
2000-09-18 16:07:07 +00:00
// call parent when no own context was created
if(!pContext)
pContext = SdXMLGenericPageContext::CreateChildContext(nPrefix, rLocalName, xAttrList);
2000-09-18 16:07:07 +00:00
return pContext;
2000-09-18 16:07:07 +00:00
}
//////////////////////////////////////////////////////////////////////////////
void SdXMLNotesContext::EndElement()
{
SdXMLGenericPageContext::EndElement();
2000-09-18 16:07:07 +00:00
}