<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:50 p.m., <b>Pierre Stirnweiss</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/3/?file=71690#file71690line126" style="color: black; font-weight: bold; text-decoration: underline;">plugins/variables/DateVariable.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 3)

    </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="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">126</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                <span class="n">m_datetime</span> <span class="o">=</span> <span class="n">QDateTime</span><span class="p">(</span><span class="n">QDate</span><span class="o">::</span><span class="n">currentDate</span><span class="p">(),</span> <span class="n">time</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;">Won't this create a round-trip problem?
The loaded file haven't got a date. On saving it will have currentDate, or have I missed something?</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;">It will, but it should not save the date, only the time. That is the idea of that m_valueType (which really needs a better name obviously, because you missed that one :) ).
If m_valueType is Single, it should hint to write just the date or just the time, if Combined, a datetime should be saved.
Do you still see a problem with that?

And thanks for reviewing :)
</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>