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 .
19 #include <SectionColumnHandler.hxx>
20 #include <PropertyMap.hxx>
21 #include <doctok/resourceids.hxx>
22 #include <ConversionHelper.hxx>
23 #include <ooxml/resourceids.hxx>
25 #include "dmapperLoggers.hxx"
27 namespace writerfilter
{
30 using namespace ::com::sun::star
;
33 SectionColumnHandler::SectionColumnHandler() :
34 LoggedProperties(dmapper_logger
, "SectionColumnHandler"),
42 SectionColumnHandler::~SectionColumnHandler()
46 void SectionColumnHandler::lcl_attribute(Id rName
, Value
& rVal
)
48 sal_Int32 nIntValue
= rVal
.getInt();
51 case NS_ooxml::LN_CT_Columns_equalWidth
:
52 bEqualWidth
= (nIntValue
!= 0);
54 case NS_ooxml::LN_CT_Columns_space
:
55 nSpace
= ConversionHelper::convertTwipToMM100( nIntValue
);
57 case NS_ooxml::LN_CT_Columns_num
:
60 case NS_ooxml::LN_CT_Columns_sep
:
61 bSep
= (nIntValue
!= 0);
64 case NS_ooxml::LN_CT_Column_w
:
65 aTempColumn
.nWidth
= ConversionHelper::convertTwipToMM100( nIntValue
);
67 case NS_ooxml::LN_CT_Column_space
:
68 aTempColumn
.nSpace
= ConversionHelper::convertTwipToMM100( nIntValue
);
71 OSL_FAIL( "SectionColumnHandler: unknown attribute");
75 void SectionColumnHandler::lcl_sprm(Sprm
& rSprm
)
77 switch( rSprm
.getId())
79 case NS_ooxml::LN_CT_Columns_col
:
81 aTempColumn
.nWidth
= aTempColumn
.nSpace
= 0;
82 writerfilter::Reference
<Properties
>::Pointer_t pProperties
= rSprm
.getProps();
83 if( pProperties
.get())
85 pProperties
->resolve(*this);
86 aCols
.push_back(aTempColumn
);
91 OSL_FAIL( "SectionColumnHandler: unknown sprm");
95 } //namespace writerfilter
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */