LibreOffice Module writerfilter (master) 1
FFDataHandler.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 */
19#include "FFDataHandler.hxx"
20#include "TagLogger.hxx"
21
22#include <ooxml/resourceids.hxx>
23
24namespace writerfilter::dmapper {
25
26/************************
27 * class: FFDataHandler *
28 ************************/
29
31LoggedProperties("FFDataHandler"),
32m_nCheckboxHeight(0),
33m_bCheckboxAutoHeight(false),
34m_nCheckboxChecked(-1),
35m_nCheckboxDefault(-1),
36m_nTextMaxLength(0)
37{
38}
39
40
42{
43}
44
45
47{
48 if (m_nCheckboxChecked != -1)
49 return m_nCheckboxChecked;
50 else if (m_nCheckboxDefault != -1)
51 return m_nCheckboxDefault;
52 else
53 return false;
54}
55
56
58{
59 switch(r_Sprm.getId())
60 {
61 case NS_ooxml::LN_CT_FFData_name:
62 {
63 m_sName = r_Sprm.getValue()->getString();
64 }
65 break;
66 case NS_ooxml::LN_CT_FFData_helpText:
67 {
68 resolveSprm(r_Sprm);
69 }
70 break;
71 case NS_ooxml::LN_CT_FFData_statusText:
72 {
73 resolveSprm(r_Sprm);
74 }
75 break;
76 case NS_ooxml::LN_CT_FFData_entryMacro:
77 {
78 m_sEntryMacro = r_Sprm.getValue()->getString();
79 }
80 break;
81 case NS_ooxml::LN_CT_FFData_exitMacro:
82 {
83 m_sExitMacro = r_Sprm.getValue()->getString();
84 }
85 break;
86 case NS_ooxml::LN_CT_FFCheckBox_size:
87 {
88 m_nCheckboxHeight = r_Sprm.getValue()->getInt();
89 }
90 break;
91 case NS_ooxml::LN_CT_FFCheckBox_sizeAuto:
92 {
93 m_bCheckboxAutoHeight = r_Sprm.getValue()->getInt();
94 }
95 break;
96 case NS_ooxml::LN_CT_FFCheckBox_checked:
97 {
98 m_nCheckboxChecked = r_Sprm.getValue()->getInt();
99 }
100 break;
101 case NS_ooxml::LN_CT_FFCheckBox_default:
102 {
103 m_nCheckboxDefault = r_Sprm.getValue()->getInt();
104 }
105 break;
106 case NS_ooxml::LN_CT_FFData_checkBox:
107 {
108 resolveSprm(r_Sprm);
109 }
110 break;
111 case NS_ooxml::LN_CT_FFDDList_result:
112 {
113 m_sDropDownResult = r_Sprm.getValue()->getString();
114 }
115 break;
116 case NS_ooxml::LN_CT_FFDDList_listEntry:
117 {
118 m_DropDownEntries.push_back(r_Sprm.getValue()->getString());
119 }
120 break;
121 case NS_ooxml::LN_CT_FFData_ddList:
122 {
123 resolveSprm(r_Sprm);
124 }
125 break;
126 case NS_ooxml::LN_CT_FFTextInput_type:
127 {
128 m_sTextType = r_Sprm.getValue()->getString();
129 }
130 break;
131 case NS_ooxml::LN_CT_FFTextInput_default:
132 {
133 m_sTextDefault = r_Sprm.getValue()->getString();
134 }
135 break;
136 case NS_ooxml::LN_CT_FFTextInput_maxLength:
137 {
138 m_nTextMaxLength = r_Sprm.getValue()->getInt();
139 }
140 break;
141 case NS_ooxml::LN_CT_FFTextInput_format:
142 {
143 m_sTextFormat = r_Sprm.getValue()->getString();
144 }
145 break;
146 case NS_ooxml::LN_CT_FFData_textInput:
147 {
148 resolveSprm(r_Sprm);
149 }
150 break;
151 default:
152#ifdef DBG_UTIL
153 TagLogger::getInstance().element("unhandled");
154#endif
155 break;
156 }
157}
158
160{
162 if( pProperties)
163 pProperties->resolve(*this);
164}
165
167{
168 switch (name)
169 {
170 case NS_ooxml::LN_CT_FFHelpText_val:
171 {
172 m_sHelpText = val.getString();
173 }
174 break;
175 case NS_ooxml::LN_CT_FFStatusText_val:
176 {
177 m_sStatusText = val.getString();
178 }
179 break;
180 default:
181#ifdef DBG_UTIL
182 TagLogger::getInstance().element("unhandled");
183#endif
184 break;
185 }
186}
187
188}
189
190/* 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 Value::Pointer_t getValue()=0
Returns value of the SPRM.
static TagLogger & getInstance()
Definition: TagLogger.cxx:95
void element(const std::string &name)
Definition: TagLogger.cxx:102
virtual OUString getString() const =0
Returns string representation of the value.
void lcl_attribute(Id name, Value &val) override
void lcl_sprm(Sprm &r_sprm) override
const char * name
sal_uInt32 Id