67
68
Value func_version(valVector args, ValueCalc *calc, FuncExtra *);
70
#ifndef KSPREAD_UNIT_TEST // Do not create/export the plugin in unit tests.
71
K_PLUGIN_FACTORY(InformationModulePluginFactory,
72
registerPlugin<InformationModule>();
74
K_EXPORT_PLUGIN(InformationModulePluginFactory("InformationModule"))
71
KSPREAD_EXPORT_FUNCTION_MODULE("information", InformationModule)
78
74
InformationModule::InformationModule(QObject* parent, const QVariantList&)
79
: FunctionModule(parent, "information", i18n("Information Functions"))
83
QString InformationModule::descriptionFileName() const
85
return QString("information.xml");
88
void InformationModule::registerFunctions()
90
FunctionRepository* repo = FunctionRepository::self();
75
: FunctionModule(parent)
93
79
f = new Function("ERRORTYPE", func_errortype);
95
81
f = new Function("FILENAME", func_filename);
96
82
f->setParamCount(0);
98
84
f = new Function("FORMULA", func_formula);
99
85
f->setParamCount(1);
100
86
f->setNeedsExtra(true);
102
88
f = new Function("INFO", func_info);
104
90
f = new Function("ISBLANK", func_isblank);
106
92
f = new Function("ISDATE", func_isdate);
108
94
f = new Function("ISERR", func_iserr);
110
96
f = new Function("ISERROR", func_iserror);
112
98
f = new Function("ISEVEN", func_iseven);
99
f->setAlternateName("COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETISEVEN");
114
101
f = new Function("ISLOGICAL", func_islogical);
116
103
f = new Function("ISNA", func_isna);
118
105
f = new Function("ISNONTEXT", func_isnottext);
120
107
f = new Function("ISNOTTEXT", func_isnottext);
122
109
f = new Function("ISNUM", func_isnum);
124
111
f = new Function("ISNUMBER", func_isnum);
126
113
f = new Function("ISODD", func_isodd);
114
f->setAlternateName("COM.SUN.STAR.SHEET.ADDIN.ANALYSIS.GETISODD");
128
116
f = new Function("ISREF", func_isref);
129
117
f->setNeedsExtra(true);
130
118
f->setAcceptArray();
132
120
f = new Function("ISTEXT", func_istext);
134
122
f = new Function("ISTIME", func_istime);
136
124
f = new Function("N", func_n);
138
126
f = new Function("NA", func_na);
139
127
f->setParamCount(0);
141
129
f = new Function("TYPE", func_type);
142
130
f->setAcceptArray();
146
void InformationModule::removeFunctions()
134
QString InformationModule::descriptionFileName() const
148
// NOTE: The group name has to match the one in the xml description.
149
FunctionRepository::self()->remove("Information");
136
return QString("information.xml");
199
186
return Value(QString(KOFFICE_VERSION_STRING));
201
188
if (type == "numfile")
202
return Value((int) Doc::documents().count());
189
return Value(KoDocument::documentList() ? KoDocument::documentList()->count() : 0);
204
191
if (type == "recalc") {
206
// if (calc->doc()) {
207
// if ( calc->doc()->displaySheet() && !calc->doc()->displaySheet()->isAutoCalculationEnabled() )
208
// result = i18n ("Manual");
210
result = i18n("Automatic");
193
if (!calc->settings()->isAutoCalculationEnabled())
194
result = i18n("Manual");
196
result = i18n("Automatic");
212
197
return Value(result);