1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_xmloff.hxx"
26 #include <tools/debug.hxx>
27 
28 
29 #include <xmloff/xmlimp.hxx>
30 #include "xmloff/xmlnmspe.hxx"
31 #include <xmloff/xmltoken.hxx>
32 #include <xmloff/nmspmap.hxx>
33 
34 #ifndef _XMLTEXTMASTERPAGECONTEXT_HXX
35 #include <xmloff/XMLTextMasterPageContext.hxx>
36 #endif
37 #ifndef _XMLTEXTMASTERSTYLESCONTEXT_HXX
38 #include <xmloff/XMLTextMasterStylesContext.hxx>
39 #endif
40 
41 using ::rtl::OUString;
42 using ::rtl::OUStringBuffer;
43 
44 using namespace ::com::sun::star::uno;
45 using namespace ::com::sun::star::xml::sax;
46 
47 using ::xmloff::token::IsXMLToken;
48 using ::xmloff::token::XML_MASTER_PAGE;
49 
50 // ------------------------------------------------------------------------
51 
52 TYPEINIT1( XMLTextMasterStylesContext, SvXMLStylesContext );
53 
InsertStyleFamily(sal_uInt16) const54 sal_Bool XMLTextMasterStylesContext::InsertStyleFamily( sal_uInt16 ) const
55 {
56 	return sal_True;
57 }
58 
XMLTextMasterStylesContext(SvXMLImport & rImport,sal_uInt16 nPrfx,const OUString & rLName,const Reference<XAttributeList> & xAttrList)59 XMLTextMasterStylesContext::XMLTextMasterStylesContext(
60 		SvXMLImport& rImport,
61 		sal_uInt16 nPrfx, const OUString& rLName,
62 		const Reference< XAttributeList > & xAttrList ) :
63 	SvXMLStylesContext( rImport, nPrfx, rLName, xAttrList )
64 {
65 }
66 
~XMLTextMasterStylesContext()67 XMLTextMasterStylesContext::~XMLTextMasterStylesContext()
68 {
69 }
70 
CreateStyleChildContext(sal_uInt16 nPrefix,const OUString & rLocalName,const Reference<XAttributeList> & xAttrList)71 SvXMLStyleContext *XMLTextMasterStylesContext::CreateStyleChildContext(
72 		sal_uInt16 nPrefix,
73 		const OUString& rLocalName,
74 		const Reference< XAttributeList > & xAttrList )
75 {
76 	SvXMLStyleContext *pContext = 0;
77 
78 	if( XML_NAMESPACE_STYLE == nPrefix &&
79 		IsXMLToken( rLocalName, XML_MASTER_PAGE ) &&
80 	 	InsertStyleFamily( XML_STYLE_FAMILY_MASTER_PAGE ) )
81 		pContext = new XMLTextMasterPageContext(
82 						GetImport(), nPrefix, rLocalName,
83 					  	xAttrList,
84 						!GetImport().GetTextImport()->IsInsertMode() );
85 
86 	// any other style will be ignored here!
87 
88 	return pContext;
89 }
90 
CreateStyleStyleChildContext(sal_uInt16,sal_uInt16,const OUString &,const Reference<XAttributeList> &)91 SvXMLStyleContext *XMLTextMasterStylesContext::CreateStyleStyleChildContext(
92 		sal_uInt16 /*nFamily*/,
93 		sal_uInt16 /*nPrefix*/,
94 		const OUString& /*rLocalName*/,
95 		const Reference< XAttributeList > & /*xAttrList*/ )
96 {
97 	return 0;
98 }
99