[prev in list] [next in list] [prev in thread] [next in thread]
List: calligra-devel
Subject: Fixing display of user defined variables of type date (and time) , need help
From: "Friedrich W. H. Kossebau" <kossebau () kde ! org>
Date: 2012-09-27 16:49:49
Message-ID: 2406054.j7seYRYsfi () klux ! site
[Download RAW message or body]
Hi,
I looked into why date variables are always only displayed with the default
format and found that the error lies in that KoOdfNumberStyles::format(...)
expects the value for date (and seems also time) to be a number in string
form:
--- 8< ---
QString format(...)
{
[...]
case Date: {
bool ok;
int v = value.toInt(&ok);
return ok ? formatDate(v, format.formatStr) : value;
[...]
}
--- 8< ---
Problem now is that DateVariable keeps the value as date string around and not
in that single number string version (from what I understood, no yet the
complete picture).
There is also this TODO (from you, Sebastian):
--- 8< ---
void UserVariable::valueChanged()
{
//TODO apply following also to plugins/variables/DateVariable.cpp:96
//TODO handle formula
QString value = variableManager()->value(m_name);
value = KoOdfNumberStyles::format(value, m_numberstyle);
kDebug() << m_name<<variableManager()->value(m_name) <<
m_numberstyle.formatStr << value;
setValue(value);
}
--- 8< ---
Are you working on this any time soon, Sebastian? Or could you point me into
the direction how this TODO is planned to be solved, so I can give it a try?
Cheers
Friedrich
_______________________________________________
calligra-devel mailing list
calligra-devel@kde.org
https://mail.kde.org/mailman/listinfo/calligra-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic