1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xmlAutoStyle.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_dbaccess.hxx"
33 #ifndef DBA_XMLAUTOSTYLE_HXX
34 #include "xmlAutoStyle.hxx"
36 #ifndef DBA_XMLHELPER_HXX
37 #include "xmlHelper.hxx"
39 #ifndef DBA_XMLEXPORT_HXX
40 #include "xmlExport.hxx"
42 #ifndef _XMLOFF_FAMILIES_HXX_
43 #include <xmloff/families.hxx>
45 #ifndef _TOOLS_DEBUG_HXX
46 #include <tools/debug.hxx>
50 using namespace ::com::sun::star::uno
;
51 using namespace ::com::sun::star::xml::sax
;
53 void OXMLAutoStylePoolP::exportStyleAttributes(
54 SvXMLAttributeList
& rAttrList
,
56 const ::std::vector
< XMLPropertyState
>& rProperties
,
57 const SvXMLExportPropertyMapper
& rPropExp
58 , const SvXMLUnitConverter
& rUnitConverter
,
59 const SvXMLNamespaceMap
& rNamespaceMap
62 SvXMLAutoStylePoolP::exportStyleAttributes( rAttrList
, nFamily
, rProperties
, rPropExp
, rUnitConverter
, rNamespaceMap
);
63 if ( nFamily
== XML_STYLE_FAMILY_TABLE_COLUMN
)
65 UniReference
< XMLPropertySetMapper
> aPropMapper
= rODBExport
.GetColumnStylesPropertySetMapper();
66 ::std::vector
< XMLPropertyState
>::const_iterator i
= rProperties
.begin();
67 ::std::vector
< XMLPropertyState
>::const_iterator aEnd
= rProperties
.end();
68 for ( ; i
!= aEnd
; ++i
)
70 sal_Int16 nContextID
= aPropMapper
->GetEntryContextId(i
->mnIndex
);
73 case CTF_DB_NUMBERFORMAT
:
75 sal_Int32 nNumberFormat
= 0;
76 if ( i
->maValue
>>= nNumberFormat
)
78 rtl::OUString sAttrValue
= rODBExport
.getDataStyleName(nNumberFormat
);
79 if ( sAttrValue
.getLength() )
81 GetExport().AddAttribute(
82 aPropMapper
->GetEntryNameSpace(i
->mnIndex
),
83 aPropMapper
->GetEntryXMLName(i
->mnIndex
),
93 DBG_NAME(OXMLAutoStylePoolP
)
94 // -----------------------------------------------------------------------------
95 OXMLAutoStylePoolP::OXMLAutoStylePoolP(ODBExport
& rTempODBExport
):
96 SvXMLAutoStylePoolP(rTempODBExport
),
97 rODBExport(rTempODBExport
)
99 DBG_CTOR(OXMLAutoStylePoolP
,NULL
);
102 // -----------------------------------------------------------------------------
103 OXMLAutoStylePoolP::~OXMLAutoStylePoolP()
106 DBG_DTOR(OXMLAutoStylePoolP
,NULL
);
108 // -----------------------------------------------------------------------------
110 //----------------------------------------------------------------------------
111 } // namespace dbaxml
112 // -----------------------------------------------------------------------------