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: SectionColumnHandler.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 ************************************************************************/
30 #include <SectionColumnHandler.hxx>
31 #include <PropertyMap.hxx>
32 #include <doctok/resourceids.hxx>
33 #include <ConversionHelper.hxx>
34 #include <ooxml/resourceids.hxx>
36 namespace writerfilter
{
39 using namespace ::com::sun::star
;
40 //using namespace ::std;
42 /*-- 02.06.2008 13:36:24---------------------------------------------------
44 -----------------------------------------------------------------------*/
45 SectionColumnHandler::SectionColumnHandler() :
52 /*-- 02.06.2008 13:36:24---------------------------------------------------
54 -----------------------------------------------------------------------*/
55 SectionColumnHandler::~SectionColumnHandler()
58 /*-- 02.06.2008 13:36:24---------------------------------------------------
60 -----------------------------------------------------------------------*/
61 void SectionColumnHandler::attribute(Id rName
, Value
& rVal
)
63 sal_Int32 nIntValue
= rVal
.getInt();
64 /* WRITERFILTERSTATUS: table: SectionColumnHandler_attributedata */
67 case NS_ooxml::LN_CT_Columns_equalWidth
:
68 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
69 bEqualWidth
= (nIntValue
!= 0);
71 case NS_ooxml::LN_CT_Columns_space
:
72 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
73 nSpace
= ConversionHelper::convertTwipToMM100( nIntValue
);
75 case NS_ooxml::LN_CT_Columns_num
:
76 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
79 case NS_ooxml::LN_CT_Columns_sep
:
80 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
81 bSep
= (nIntValue
!= 0);
84 case NS_ooxml::LN_CT_Column_w
:
85 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
86 aTempColumn
.nWidth
= ConversionHelper::convertTwipToMM100( nIntValue
);
88 case NS_ooxml::LN_CT_Column_space
:
89 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
90 aTempColumn
.nSpace
= ConversionHelper::convertTwipToMM100( nIntValue
);
93 OSL_ENSURE( false, "SectionColumnHandler: unknown attribute");
96 /*-- 02.06.2008 13:36:24---------------------------------------------------
98 -----------------------------------------------------------------------*/
99 void SectionColumnHandler::sprm(Sprm
& rSprm
)
101 /* WRITERFILTERSTATUS: table: SectionColumnHandler_sprm */
102 switch( rSprm
.getId())
104 case NS_ooxml::LN_CT_Columns_col
:
105 /* WRITERFILTERSTATUS: done: 100, planned: 0.5, spent: 0 */
107 aTempColumn
.nWidth
= aTempColumn
.nSpace
= 0;
108 writerfilter::Reference
<Properties
>::Pointer_t pProperties
= rSprm
.getProps();
109 if( pProperties
.get())
111 pProperties
->resolve(*this);
112 aCols
.push_back(aTempColumn
);
117 OSL_ENSURE( false, "SectionColumnHandler: unknown sprm");
120 } //namespace dmapper
121 } //namespace writerfilter