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 #include "precompiled_reportdesign.hxx"
24 #include "xmlAutoStyle.hxx"
25 #include "xmlHelper.hxx"
26 #include "xmlExport.hxx"
27 #include <xmloff/families.hxx>
28 #include <tools/debug.hxx>
29 
30 namespace rptxml
31 {
32 	using namespace ::com::sun::star::uno;
33 	using namespace ::com::sun::star::xml::sax;
34 
exportStyleAttributes(SvXMLAttributeList & rAttrList,sal_Int32 nFamily,const::std::vector<XMLPropertyState> & rProperties,const SvXMLExportPropertyMapper & rPropExp,const SvXMLUnitConverter & rUnitConverter,const SvXMLNamespaceMap & rNamespaceMap) const35 void OXMLAutoStylePoolP::exportStyleAttributes(
36 			SvXMLAttributeList& rAttrList,
37 			sal_Int32 nFamily,
38 			const ::std::vector< XMLPropertyState >& rProperties,
39 			const SvXMLExportPropertyMapper& rPropExp
40 			, const SvXMLUnitConverter& rUnitConverter,
41 			const SvXMLNamespaceMap& rNamespaceMap
42             ) const
43 {
44 	SvXMLAutoStylePoolP::exportStyleAttributes( rAttrList, nFamily, rProperties, rPropExp, rUnitConverter, rNamespaceMap );
45 	if ( nFamily == XML_STYLE_FAMILY_TABLE_CELL )
46 	{
47 		UniReference< XMLPropertySetMapper > aPropMapper = rORptExport.GetCellStylePropertyMapper();
48 		::std::vector< XMLPropertyState >::const_iterator i = rProperties.begin();
49 		::std::vector< XMLPropertyState >::const_iterator aEnd = rProperties.end();
50 		for (; i != aEnd ; ++i)
51 		{
52 			sal_Int16 nContextID = aPropMapper->GetEntryContextId(i->mnIndex);
53 			switch (nContextID)
54 			{
55 				case CTF_RPT_NUMBERFORMAT :
56 				{
57 					rtl::OUString sAttrValue;
58 					if ( i->maValue >>= sAttrValue )
59 					{
60 						if ( sAttrValue.getLength() )
61 						{
62 							rORptExport.AddAttribute(
63                                 aPropMapper->GetEntryNameSpace(i->mnIndex),
64                                 aPropMapper->GetEntryXMLName(i->mnIndex),
65                                 sAttrValue );
66 						}
67 					}
68 					break;
69 				}
70                 default:
71                     break;
72 			}
73 		}
74 	}
75 }
DBG_NAME(rpt_OXMLAutoStylePoolP)76 DBG_NAME( rpt_OXMLAutoStylePoolP )
77 // -----------------------------------------------------------------------------
78 OXMLAutoStylePoolP::OXMLAutoStylePoolP(ORptExport& rTempORptExport):
79 	SvXMLAutoStylePoolP(rTempORptExport),
80 	rORptExport(rTempORptExport)
81 {
82     DBG_CTOR( rpt_OXMLAutoStylePoolP,NULL);
83 
84 }
85 // -----------------------------------------------------------------------------
~OXMLAutoStylePoolP()86 OXMLAutoStylePoolP::~OXMLAutoStylePoolP()
87 {
88 
89     DBG_DTOR( rpt_OXMLAutoStylePoolP,NULL);
90 }
91 // -----------------------------------------------------------------------------
92 
93 //----------------------------------------------------------------------------
94 } // namespace rptxml
95 // -----------------------------------------------------------------------------
96