nss: upgrade to release 3.73
[LibreOffice.git] / dbaccess / source / filter / xml / xmlAutoStyle.cxx
blob99101567111a08318af3adaac0dcb4967dfd7b3a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "xmlAutoStyle.hxx"
21 #include "xmlHelper.hxx"
22 #include "xmlExport.hxx"
23 #include <xmloff/families.hxx>
24 namespace dbaxml
26 using namespace ::com::sun::star::uno;
27 using namespace ::com::sun::star::xml::sax;
29 void OXMLAutoStylePoolP::exportStyleAttributes(
30 SvXMLAttributeList& rAttrList,
31 XmlStyleFamily nFamily,
32 const std::vector< XMLPropertyState >& rProperties,
33 const SvXMLExportPropertyMapper& rPropExp
34 , const SvXMLUnitConverter& rUnitConverter,
35 const SvXMLNamespaceMap& rNamespaceMap
36 ) const
38 SvXMLAutoStylePoolP::exportStyleAttributes( rAttrList, nFamily, rProperties, rPropExp, rUnitConverter, rNamespaceMap );
39 if ( nFamily != XmlStyleFamily::TABLE_COLUMN )
40 return;
42 rtl::Reference< XMLPropertySetMapper > aPropMapper = rODBExport.GetColumnStylesPropertySetMapper();
43 for (auto const& property : rProperties)
45 sal_Int16 nContextID = aPropMapper->GetEntryContextId(property.mnIndex);
46 switch (nContextID)
48 case CTF_DB_NUMBERFORMAT :
50 sal_Int32 nNumberFormat = 0;
51 if ( property.maValue >>= nNumberFormat )
53 OUString sAttrValue = rODBExport.getDataStyleName(nNumberFormat);
54 if ( !sAttrValue.isEmpty() )
56 GetExport().AddAttribute(
57 aPropMapper->GetEntryNameSpace(property.mnIndex),
58 aPropMapper->GetEntryXMLName(property.mnIndex),
59 sAttrValue );
62 break;
68 OXMLAutoStylePoolP::OXMLAutoStylePoolP(ODBExport& rTempODBExport):
69 SvXMLAutoStylePoolP(rTempODBExport),
70 rODBExport(rTempODBExport)
75 OXMLAutoStylePoolP::~OXMLAutoStylePoolP()
80 } // namespace dbaxml
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */