fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / writerfilter / source / dmapper / SectionColumnHandler.cxx
blob28eca82211c9135b2d37aac72cfb4abb9fa88e8b
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 {
28 namespace dmapper {
30 using namespace ::com::sun::star;
33 SectionColumnHandler::SectionColumnHandler() :
34 LoggedProperties(dmapper_logger, "SectionColumnHandler"),
35 bEqualWidth( false ),
36 nSpace( 0 ),
37 nNum( 0 ),
38 bSep( false )
42 SectionColumnHandler::~SectionColumnHandler()
46 void SectionColumnHandler::lcl_attribute(Id rName, Value & rVal)
48 sal_Int32 nIntValue = rVal.getInt();
49 switch( rName )
51 case NS_ooxml::LN_CT_Columns_equalWidth:
52 bEqualWidth = (nIntValue != 0);
53 break;
54 case NS_ooxml::LN_CT_Columns_space:
55 nSpace = ConversionHelper::convertTwipToMM100( nIntValue );
56 break;
57 case NS_ooxml::LN_CT_Columns_num:
58 nNum = nIntValue;
59 break;
60 case NS_ooxml::LN_CT_Columns_sep:
61 bSep = (nIntValue != 0);
62 break;
64 case NS_ooxml::LN_CT_Column_w:
65 aTempColumn.nWidth = ConversionHelper::convertTwipToMM100( nIntValue );
66 break;
67 case NS_ooxml::LN_CT_Column_space:
68 aTempColumn.nSpace = ConversionHelper::convertTwipToMM100( nIntValue );
69 break;
70 default:
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);
89 break;
90 default:
91 OSL_FAIL( "SectionColumnHandler: unknown sprm");
94 } //namespace dmapper
95 } //namespace writerfilter
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */