LibreOffice Module dbaccess (master) 1
xmlAutoStyle.cxx
Go to the documentation of this file.
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
20#include "xmlAutoStyle.hxx"
21#include "xmlHelper.hxx"
22#include "xmlExport.hxx"
23#include <xmloff/families.hxx>
24namespace dbaxml
25{
26 using namespace ::com::sun::star::uno;
27 using namespace ::com::sun::star::xml::sax;
28
31 XmlStyleFamily nFamily,
32 const std::vector< XMLPropertyState >& rProperties,
33 const SvXMLExportPropertyMapper& rPropExp
34 , const SvXMLUnitConverter& rUnitConverter,
35 const SvXMLNamespaceMap& rNamespaceMap
36 ) const
37{
38 SvXMLAutoStylePoolP::exportStyleAttributes( rAttrList, nFamily, rProperties, rPropExp, rUnitConverter, rNamespaceMap );
39 if ( nFamily != XmlStyleFamily::TABLE_COLUMN )
40 return;
41
43 for (auto const& property : rProperties)
44 {
45 sal_Int16 nContextID = aPropMapper->GetEntryContextId(property.mnIndex);
46 switch (nContextID)
47 {
49 {
50 sal_Int32 nNumberFormat = 0;
51 if ( property.maValue >>= nNumberFormat )
52 {
53 OUString sAttrValue = rODBExport.getDataStyleName(nNumberFormat);
54 if ( !sAttrValue.isEmpty() )
55 {
57 aPropMapper->GetEntryNameSpace(property.mnIndex),
58 aPropMapper->GetEntryXMLName(property.mnIndex),
59 sAttrValue );
60 }
61 }
62 break;
63 }
64 }
65 }
66}
67
69 SvXMLAutoStylePoolP(rTempODBExport),
70 rODBExport(rTempODBExport)
71{
72
73}
74
76{
77
78}
79
80} // namespace dbaxml
81
82/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvXMLExport & GetExport() const
virtual void exportStyleAttributes(comphelper::AttributeList &rAttrList, XmlStyleFamily nFamily, const ::std::vector< XMLPropertyState > &rProperties, const SvXMLExportPropertyMapper &rPropExp, const SvXMLUnitConverter &rUnitConverter, const SvXMLNamespaceMap &rNamespaceMap) const
void AddAttribute(sal_uInt16 nPrefix, const OUString &rName, const OUString &rValue)
virtual OUString getDataStyleName(const sal_Int32 nNumberFormat, bool bTimeFormat=false) const
rtl::Reference< XMLPropertySetMapper > const & GetColumnStylesPropertySetMapper() const
Definition: xmlExport.cxx:1300
virtual ~OXMLAutoStylePoolP() override
virtual void exportStyleAttributes(comphelper::AttributeList &rAttrList, XmlStyleFamily nFamily, const std::vector< XMLPropertyState > &rProperties, const SvXMLExportPropertyMapper &rPropExp, const SvXMLUnitConverter &rUnitConverter, const SvXMLNamespaceMap &rNamespaceMap) const override
OXMLAutoStylePoolP(ODBExport &rXMLExport)
XmlStyleFamily
#define CTF_DB_NUMBERFORMAT
Definition: xmlHelper.hxx:30