<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://git.reviewboard.kde.org/r/105463/">http://git.reviewboard.kde.org/r/105463/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<p style="margin-top: 0;">On July 7th, 2012, 4:06 a.m., <b>Thorsten Zachmann</b> wrote:</p>
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="http://git.reviewboard.kde.org/r/105463/diff/2/?file=71682#file71682line113" style="color: black; font-weight: bold; text-decoration: underline;">plugins/variables/DateVariable.cpp</a>
<span style="font-weight: normal;">
(Diff revision 2)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">bool DateVariable::loadOdf(const KoXmlElement & element, KoShapeLoadingContext & context)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">101</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="k">if</span> <span class="p">(</span><span class="n">value</span><span class="p">.</span><span class="n">startsWith</span><span class="p">(</span><span class="s">"0-00-00T"</span><span class="p">))</span> <span class="p">{</span></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">113</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="c1">// hopfully this simple detection works in all cases</span></pre></td>
</tr>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">102</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="n">value</span><span class="p">.</span><span class="n">prepend</span><span class="p">(</span><span class="s">"000"</span><span class="p">);</span></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">114</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="k">const</span> <span class="kt">bool</span> <span class="n">isCombined</span> <span class="o">=</span> <span class="p">(</span><span class="n">value</span><span class="p">.</span><span class="n">indexOf</span><span class="p">(</span><span class="n">QLatin1Char</span><span class="p">(</span><span class="sc">'T'</span><span class="p">))</span> <span class="o">!=</span> <span class="o">-</span><span class="mi">1</span><span class="p">);</span></pre></td>
</tr>
</tbody>
</table>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I think we should keep this workaround as calligra saved out this wrong value. Maybe put it into KoOdfWorkaround when calligra was the creator.</pre>
</blockquote>
</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Not sure what you exactly meant with "when calligra was the creator." In the updated patch I just check in any case.
Because checking for the creator would be the same cost as the check for the bad value, so no need for the extra code for the creator check. Or?</pre>
<br />
<p>- Friedrich W. H.</p>
<br />
<p>On July 7th, 2012, 10:16 a.m., Friedrich W. H. Kossebau wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Calligra and Thorsten Zachmann.</div>
<div>By Friedrich W. H. Kossebau.</div>
<p style="color: grey;"><i>Updated July 7, 2012, 10:16 a.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The file interoperability/wordprocessing/oowriter/oow_insert_fields.odt from calligratests currently fails on this bad value:
text:time-value="0-00-00T07:37:38"
Reason is that ODF 19.881 text:time-value specifies
"The text:time-value attribute has the data type timeOrDateTime."
and ODF 18.3.36 timeOrDateTime says
"A timeOrDateTime value is either an [xmlschema-2] time or an [xmlschema-2] dateTime value."
Now, [xmlschema-2] demands for the year part a "four-or-more digit optionally negative-signed numeral that represents the year". Also, "There is no year 0, and '0000' is not a valid lexical representation.", see http://www.w3.org/TR/xmlschema-2/#year-zero
Thus the validator fails on this (good boy).
Looking more at the code (also after sending a premature patch here) I see the DateVariable supports both time and date variables (or a combination).
Just, the storage format for both date or time can be simple (just date or time) or combined (datetime). As this info makes a difference (e.g. having just a time without date (so relative) is different from a given datetime (which is absolute)), it should be at least supported in the save and load code, even if the UI does not yet expose all that.
Attached patch fixes the code to do that, both the loading/saving of the complete data (without adding/removing info) as well as the broken "0-00-00T" stuff.
I am not satisfied with the names of the new enum ValueType, proposals welcome.
Okay to backport to 2.5?</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>libs/flake/KoOdfWorkaround.h <span style="color: grey">(8672f22)</span></li>
<li>libs/flake/KoOdfWorkaround.cpp <span style="color: grey">(8d3d523)</span></li>
<li>plugins/variables/DateVariable.h <span style="color: grey">(9d06879)</span></li>
<li>plugins/variables/DateVariable.cpp <span style="color: grey">(cf5ef8b)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/105463/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>