1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
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
38 SvXMLAutoStylePoolP::exportStyleAttributes( rAttrList
, nFamily
, rProperties
, rPropExp
, rUnitConverter
, rNamespaceMap
);
39 if ( nFamily
!= XmlStyleFamily::TABLE_COLUMN
)
42 rtl::Reference
< XMLPropertySetMapper
> aPropMapper
= rODBExport
.GetColumnStylesPropertySetMapper();
43 for (auto const& property
: rProperties
)
45 sal_Int16 nContextID
= aPropMapper
->GetEntryContextId(property
.mnIndex
);
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
),
68 OXMLAutoStylePoolP::OXMLAutoStylePoolP(ODBExport
& rTempODBExport
):
69 SvXMLAutoStylePoolP(rTempODBExport
),
70 rODBExport(rTempODBExport
)
75 OXMLAutoStylePoolP::~OXMLAutoStylePoolP()
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */