Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #include "xmlAutoStyle.hxx"
20 : #include "xmlHelper.hxx"
21 : #include "xmlExport.hxx"
22 : #include <xmloff/families.hxx>
23 : #include <tools/debug.hxx>
24 :
25 : namespace rptxml
26 : {
27 : using namespace ::com::sun::star::uno;
28 : using namespace ::com::sun::star::xml::sax;
29 :
30 0 : void OXMLAutoStylePoolP::exportStyleAttributes(
31 : SvXMLAttributeList& rAttrList,
32 : sal_Int32 nFamily,
33 : const ::std::vector< XMLPropertyState >& rProperties,
34 : const SvXMLExportPropertyMapper& rPropExp
35 : , const SvXMLUnitConverter& rUnitConverter,
36 : const SvXMLNamespaceMap& rNamespaceMap
37 : ) const
38 : {
39 0 : SvXMLAutoStylePoolP::exportStyleAttributes( rAttrList, nFamily, rProperties, rPropExp, rUnitConverter, rNamespaceMap );
40 0 : if ( nFamily == XML_STYLE_FAMILY_TABLE_CELL )
41 : {
42 0 : rtl::Reference< XMLPropertySetMapper > aPropMapper = rORptExport.GetCellStylePropertyMapper();
43 0 : ::std::vector< XMLPropertyState >::const_iterator i = rProperties.begin();
44 0 : ::std::vector< XMLPropertyState >::const_iterator aEnd = rProperties.end();
45 0 : for (; i != aEnd ; ++i)
46 : {
47 0 : sal_Int16 nContextID = aPropMapper->GetEntryContextId(i->mnIndex);
48 0 : switch (nContextID)
49 : {
50 : case CTF_RPT_NUMBERFORMAT :
51 : {
52 0 : OUString sAttrValue;
53 0 : if ( i->maValue >>= sAttrValue )
54 : {
55 0 : if ( !sAttrValue.isEmpty() )
56 : {
57 : rORptExport.AddAttribute(
58 0 : aPropMapper->GetEntryNameSpace(i->mnIndex),
59 0 : aPropMapper->GetEntryXMLName(i->mnIndex),
60 0 : sAttrValue );
61 : }
62 : }
63 0 : break;
64 : }
65 : default:
66 0 : break;
67 : }
68 0 : }
69 : }
70 0 : }
71 :
72 6 : OXMLAutoStylePoolP::OXMLAutoStylePoolP(ORptExport& rTempORptExport):
73 : SvXMLAutoStylePoolP(rTempORptExport),
74 6 : rORptExport(rTempORptExport)
75 : {
76 6 : }
77 :
78 12 : OXMLAutoStylePoolP::~OXMLAutoStylePoolP()
79 : {
80 12 : }
81 :
82 :
83 :
84 : } // namespace rptxml
85 :
86 :
87 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|