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 "XMLIndexSpanEntryContext.hxx"
27 #include <rtl/ustring.hxx>
28 #include "XMLIndexTemplateContext.hxx"
29 #include <xmloff/xmlictxt.hxx>
30 
31 
32 using ::rtl::OUString;
33 using ::com::sun::star::uno::Sequence;
34 using ::com::sun::star::uno::Any;
35 using ::com::sun::star::beans::PropertyValue;
36 
37 
38 TYPEINIT1( XMLIndexSpanEntryContext, XMLIndexSimpleEntryContext);
39 
XMLIndexSpanEntryContext(SvXMLImport & rImport,XMLIndexTemplateContext & rTemplate,sal_uInt16 nPrfx,const OUString & rLocalName)40 XMLIndexSpanEntryContext::XMLIndexSpanEntryContext(
41 	SvXMLImport& rImport,
42 	XMLIndexTemplateContext& rTemplate,
43 	sal_uInt16 nPrfx,
44 	const OUString& rLocalName ) :
45 		XMLIndexSimpleEntryContext(rImport, rTemplate.sTokenText,
46 								   rTemplate, nPrfx, rLocalName)
47 {
48 	nValues++;	// one more for the text string
49 }
50 
~XMLIndexSpanEntryContext()51 XMLIndexSpanEntryContext::~XMLIndexSpanEntryContext()
52 {
53 }
54 
Characters(const OUString & sString)55 void XMLIndexSpanEntryContext::Characters(const OUString& sString)
56 {
57 	sContent.append(sString);
58 }
59 
FillPropertyValues(Sequence<PropertyValue> & rValues)60 void XMLIndexSpanEntryContext::FillPropertyValues(
61 	Sequence<PropertyValue> & rValues)
62 {
63 	// call superclass for token type, stylename,
64 	XMLIndexSimpleEntryContext::FillPropertyValues(rValues);
65 
66 	// content
67 	Any aAny;
68 	aAny <<= sContent.makeStringAndClear();
69 	rValues[nValues-1].Name = rTemplateContext.sText;
70 	rValues[nValues-1].Value = aAny;
71 }
72 
73