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 "FFDataHandler.hxx"
20 #include "TagLogger.hxx"
22 #include <ooxml/resourceids.hxx>
24 namespace writerfilter::dmapper
{
26 /************************
27 * class: FFDataHandler *
28 ************************/
30 FFDataHandler::FFDataHandler() :
31 LoggedProperties("FFDataHandler"),
33 m_bCheckboxAutoHeight(false),
34 m_nCheckboxChecked(-1),
35 m_nCheckboxDefault(-1),
41 FFDataHandler::~FFDataHandler()
46 bool FFDataHandler::getCheckboxChecked() const
48 if (m_nCheckboxChecked
!= -1)
49 return m_nCheckboxChecked
;
50 else if (m_nCheckboxDefault
!= -1)
51 return m_nCheckboxDefault
;
57 void FFDataHandler::lcl_sprm(Sprm
& r_Sprm
)
59 switch(r_Sprm
.getId())
61 case NS_ooxml::LN_CT_FFData_name
:
63 m_sName
= r_Sprm
.getValue()->getString();
66 case NS_ooxml::LN_CT_FFData_helpText
:
71 case NS_ooxml::LN_CT_FFData_statusText
:
76 case NS_ooxml::LN_CT_FFData_entryMacro
:
78 m_sEntryMacro
= r_Sprm
.getValue()->getString();
81 case NS_ooxml::LN_CT_FFData_exitMacro
:
83 m_sExitMacro
= r_Sprm
.getValue()->getString();
86 case NS_ooxml::LN_CT_FFCheckBox_size
:
88 m_nCheckboxHeight
= r_Sprm
.getValue()->getInt();
91 case NS_ooxml::LN_CT_FFCheckBox_sizeAuto
:
93 m_bCheckboxAutoHeight
= r_Sprm
.getValue()->getInt();
96 case NS_ooxml::LN_CT_FFCheckBox_checked
:
98 m_nCheckboxChecked
= r_Sprm
.getValue()->getInt();
101 case NS_ooxml::LN_CT_FFCheckBox_default
:
103 m_nCheckboxDefault
= r_Sprm
.getValue()->getInt();
106 case NS_ooxml::LN_CT_FFData_checkBox
:
111 case NS_ooxml::LN_CT_FFDDList_result
:
113 m_sDropDownResult
= r_Sprm
.getValue()->getString();
116 case NS_ooxml::LN_CT_FFDDList_listEntry
:
118 m_DropDownEntries
.push_back(r_Sprm
.getValue()->getString());
121 case NS_ooxml::LN_CT_FFData_ddList
:
126 case NS_ooxml::LN_CT_FFTextInput_type
:
128 m_sTextType
= r_Sprm
.getValue()->getString();
131 case NS_ooxml::LN_CT_FFTextInput_default
:
133 m_sTextDefault
= r_Sprm
.getValue()->getString();
136 case NS_ooxml::LN_CT_FFTextInput_maxLength
:
138 m_nTextMaxLength
= r_Sprm
.getValue()->getInt();
141 case NS_ooxml::LN_CT_FFTextInput_format
:
143 m_sTextFormat
= r_Sprm
.getValue()->getString();
146 case NS_ooxml::LN_CT_FFData_textInput
:
153 TagLogger::getInstance().element("unhandled");
159 void FFDataHandler::resolveSprm(Sprm
& r_Sprm
)
161 writerfilter::Reference
<Properties
>::Pointer_t pProperties
= r_Sprm
.getProps();
163 pProperties
->resolve(*this);
166 void FFDataHandler::lcl_attribute(Id name
, Value
& val
)
170 case NS_ooxml::LN_CT_FFHelpText_val
:
172 m_sHelpText
= val
.getString();
175 case NS_ooxml::LN_CT_FFStatusText_val
:
177 m_sStatusText
= val
.getString();
182 TagLogger::getInstance().element("unhandled");
190 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */