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>
24 #include <tools/debug.hxx>
27 using namespace ::com::sun::star::uno
;
28 using namespace ::com::sun::star::xml::sax
;
30 void OXMLAutoStylePoolP::exportStyleAttributes(
31 SvXMLAttributeList
& rAttrList
,
33 const ::std::vector
< XMLPropertyState
>& rProperties
,
34 const SvXMLExportPropertyMapper
& rPropExp
35 , const SvXMLUnitConverter
& rUnitConverter
,
36 const SvXMLNamespaceMap
& rNamespaceMap
39 SvXMLAutoStylePoolP::exportStyleAttributes( rAttrList
, nFamily
, rProperties
, rPropExp
, rUnitConverter
, rNamespaceMap
);
40 if ( nFamily
== XML_STYLE_FAMILY_TABLE_COLUMN
)
42 rtl::Reference
< XMLPropertySetMapper
> aPropMapper
= rODBExport
.GetColumnStylesPropertySetMapper();
43 ::std::vector
< XMLPropertyState
>::const_iterator i
= rProperties
.begin();
44 ::std::vector
< XMLPropertyState
>::const_iterator aEnd
= rProperties
.end();
45 for ( ; i
!= aEnd
; ++i
)
47 sal_Int16 nContextID
= aPropMapper
->GetEntryContextId(i
->mnIndex
);
50 case CTF_DB_NUMBERFORMAT
:
52 sal_Int32 nNumberFormat
= 0;
53 if ( i
->maValue
>>= nNumberFormat
)
55 OUString sAttrValue
= rODBExport
.getDataStyleName(nNumberFormat
);
56 if ( !sAttrValue
.isEmpty() )
58 GetExport().AddAttribute(
59 aPropMapper
->GetEntryNameSpace(i
->mnIndex
),
60 aPropMapper
->GetEntryXMLName(i
->mnIndex
),
71 OXMLAutoStylePoolP::OXMLAutoStylePoolP(ODBExport
& rTempODBExport
):
72 SvXMLAutoStylePoolP(rTempODBExport
),
73 rODBExport(rTempODBExport
)
78 OXMLAutoStylePoolP::~OXMLAutoStylePoolP()
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */