LibreOffice Module writerfilter (master) 1
SectionColumnHandler.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
20#include "ConversionHelper.hxx"
21#include <ooxml/resourceids.hxx>
22#include <osl/diagnose.h>
23
25{
26using namespace ::com::sun::star;
27
29 : LoggedProperties("SectionColumnHandler")
30 , m_bEqualWidth(false)
31 , m_nSpace(1270) // 720 twips
32 , m_nNum(0)
33 , m_bSep(false)
34{
36}
37
39
41{
42 sal_Int32 nIntValue = rVal.getInt();
43 switch (rName)
44 {
45 case NS_ooxml::LN_CT_Columns_equalWidth:
46 m_bEqualWidth = (nIntValue != 0);
47 break;
48 case NS_ooxml::LN_CT_Columns_space:
50 break;
51 case NS_ooxml::LN_CT_Columns_num:
52 m_nNum = nIntValue;
53 break;
54 case NS_ooxml::LN_CT_Columns_sep:
55 m_bSep = (nIntValue != 0);
56 break;
57
58 case NS_ooxml::LN_CT_Column_w:
60 break;
61 case NS_ooxml::LN_CT_Column_space:
63 break;
64 default:
65 OSL_FAIL("SectionColumnHandler: unknown attribute");
66 }
67}
68
70{
71 switch (rSprm.getId())
72 {
73 case NS_ooxml::LN_CT_Columns_col:
74 {
77 if (pProperties)
78 {
79 pProperties->resolve(*this);
80 m_aCols.push_back(m_aTempColumn);
81 }
82 }
83 break;
84 default:
85 OSL_FAIL("SectionColumnHandler: unknown sprm");
86 }
87}
88} //namespace writerfilter::dmapper
89
90/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
An SPRM: Section, Paragraph and Run Modifier.
virtual sal_uInt32 getId() const =0
Returns id of the SPRM.
virtual writerfilter::Reference< Properties >::Pointer_t getProps()=0
Returns reference to properties contained in the SPRM.
virtual int getInt() const =0
Returns integer representation of the value.
virtual void lcl_sprm(Sprm &sprm) override
virtual void lcl_attribute(Id Name, Value &val) override
sal_uInt32 Id