| 
									
										
										
										
											2000-09-18 16:07:07 +00:00
										 |  |  | /*************************************************************************
 | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2005-09-09 12:59:17 +00:00
										 |  |  |  *  OpenOffice.org - a multi-platform office productivity suite | 
					
						
							| 
									
										
										
										
											2000-09-18 16:07:07 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2005-09-09 12:59:17 +00:00
										 |  |  |  *  $RCSfile: ximpnote.cxx,v $ | 
					
						
							| 
									
										
										
										
											2000-09-18 16:07:07 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2005-09-09 12:59:17 +00:00
										 |  |  |  *  $Revision: 1.9 $ | 
					
						
							| 
									
										
										
										
											2000-09-18 16:07:07 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2005-09-09 12:59:17 +00:00
										 |  |  |  *  last change: $Author: rt $ $Date: 2005-09-09 13:59:17 $ | 
					
						
							| 
									
										
										
										
											2000-09-18 16:07:07 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2005-09-09 12:59:17 +00:00
										 |  |  |  *  The Contents of this file are made available subject to | 
					
						
							|  |  |  |  *  the terms of GNU Lesser General Public License Version 2.1. | 
					
						
							| 
									
										
										
										
											2000-09-18 16:07:07 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2005-09-09 12:59:17 +00:00
										 |  |  |  *    GNU Lesser General Public License Version 2.1 | 
					
						
							|  |  |  |  *    ============================================= | 
					
						
							|  |  |  |  *    Copyright 2005 by Sun Microsystems, Inc. | 
					
						
							|  |  |  |  *    901 San Antonio Road, Palo Alto, CA 94303, USA | 
					
						
							| 
									
										
										
										
											2000-09-18 16:07:07 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2005-09-09 12:59:17 +00:00
										 |  |  |  *    This library is free software; you can redistribute it and/or | 
					
						
							|  |  |  |  *    modify it under the terms of the GNU Lesser General Public | 
					
						
							|  |  |  |  *    License version 2.1, as published by the Free Software Foundation. | 
					
						
							| 
									
										
										
										
											2000-09-18 16:07:07 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2005-09-09 12:59:17 +00:00
										 |  |  |  *    This library 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 for more details. | 
					
						
							| 
									
										
										
										
											2000-09-18 16:07:07 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2005-09-09 12:59:17 +00:00
										 |  |  |  *    You should have received a copy of the GNU Lesser General Public | 
					
						
							|  |  |  |  *    License along with this library; if not, write to the Free Software | 
					
						
							|  |  |  |  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, | 
					
						
							|  |  |  |  *    MA  02111-1307  USA | 
					
						
							| 
									
										
										
										
											2000-09-18 16:07:07 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  ************************************************************************/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma hdrstop
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef _XIMPNOTES_HXX
 | 
					
						
							|  |  |  | #include "ximpnote.hxx"
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #ifndef _COM_SUN_STAR_PRESENTATION_XPRESENTATIONPAGE_HPP_
 | 
					
						
							|  |  |  | #include <com/sun/star/presentation/XPresentationPage.hpp>
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | using namespace ::rtl; | 
					
						
							|  |  |  | using namespace ::com::sun::star; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | //////////////////////////////////////////////////////////////////////////////
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | SdXMLNotesContext::SdXMLNotesContext( SdXMLImport& rImport, | 
					
						
							|  |  |  |     USHORT nPrfx, const OUString& rLocalName, | 
					
						
							| 
									
										
										
										
											2000-11-23 17:30:39 +00:00
										 |  |  |     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) | 
					
						
							| 
									
										
										
										
											2001-04-18 06:48:51 +00:00
										 |  |  | :   SdXMLGenericPageContext( rImport, nPrfx, rLocalName, xAttrList, rShapes ) | 
					
						
							| 
									
										
										
										
											2000-09-18 16:07:07 +00:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2004-03-30 15:16:09 +00:00
										 |  |  |     OUString sStyleName; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2002-09-04 13:02:51 +00:00
										 |  |  |     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; | 
					
						
							|  |  |  |             } | 
					
						
							| 
									
										
										
										
											2004-03-30 15:16:09 +00:00
										 |  |  |             case XML_TOK_MASTERPAGE_STYLE_NAME: | 
					
						
							|  |  |  |             { | 
					
						
							|  |  |  |                 sStyleName = sValue; | 
					
						
							|  |  |  |                 break; | 
					
						
							|  |  |  |             } | 
					
						
							| 
									
										
										
										
											2004-11-03 15:40:49 +00:00
										 |  |  |             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; | 
					
						
							|  |  |  |             } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2002-09-04 13:02:51 +00:00
										 |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-03-30 15:16:09 +00:00
										 |  |  |     SetStyle( sStyleName ); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-04-18 06:48:51 +00:00
										 |  |  |     // 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
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2001-04-18 06:48:51 +00:00
										 |  |  |         rShapes->getByIndex(0L) >>= xShape; | 
					
						
							|  |  |  |         if(xShape.is()) | 
					
						
							|  |  |  |             rShapes->remove(xShape); | 
					
						
							| 
									
										
										
										
											2000-09-18 16:07:07 +00:00
										 |  |  |     } | 
					
						
							| 
									
										
										
										
											2002-09-04 13:02:51 +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 ) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2001-04-18 06:48:51 +00:00
										 |  |  |     // 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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-04-18 06:48:51 +00:00
										 |  |  |     // some special objects inside presentation:notes context
 | 
					
						
							|  |  |  |     // ...
 | 
					
						
							| 
									
										
										
										
											2000-09-18 16:07:07 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-04-18 06:48:51 +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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-04-18 06:48:51 +00:00
										 |  |  |     return pContext; | 
					
						
							| 
									
										
										
										
											2000-09-18 16:07:07 +00:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | //////////////////////////////////////////////////////////////////////////////
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void SdXMLNotesContext::EndElement() | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2000-12-13 18:16:42 +00:00
										 |  |  |     SdXMLGenericPageContext::EndElement(); | 
					
						
							| 
									
										
										
										
											2000-09-18 16:07:07 +00:00
										 |  |  | } |