Issue 62797 - wrong handling of date from Calc when copy&paste to Base as HTML
Summary: wrong handling of date from Calc when copy&paste to Base as HTML
Status: CLOSED FIXED
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: OOo 2.0.2
Hardware: PC Windows XP
: P3 Trivial (vote)
Target Milestone: OOo 2.0.3
Assignee: marc.neumann
QA Contact: issues@dba
URL:
Keywords:
: 61949 (view as issue list)
Depends on:
Blocks:
 
Reported: 2006-03-05 21:06 UTC by Regina Henschel
Modified: 2006-08-01 12:57 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
import table from Calc into Base (225.34 KB, application/vnd.oasis.opendocument.text)
2006-03-27 17:04 UTC, Regina Henschel
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Regina Henschel 2006-03-05 21:06:31 UTC
I use German OOo202rc3 on Win XP.

Take new Calc document
Set date foundation to 30.12.1899 in Tools-Option
Write the date 30. Jun 1954 in Calc and some text in next cell.
Copy the cells
Take a new Writer/Web document
Insert special as HTML. You get correct day.
Insert special as RTF. You get correct day.
Take a database-document with embedded hsqldb.
Insert special as HTML, fieldtyp DATE. You get a date +2 days.
Insert special as RTF, fieldtyp DATE. You get a date +2 days.
Close all.

Take new Calc document.
Set date foundation to 1.1.1900 in Tools-Option.
Write the date 30. Jun 1954 in Calc and some text in next cell.
Copy the cells.
Take a new Writer/Web document.
Insert special as HTML. You get a date -2 days.
Insert special as RTF. You get correct day.
Take a database-document with embedded hsqldb.
Insert special as HTML, fieldtyp DATE. You get correct day.
Insert special as RTF, fieldtyp DATE. You get a date +2 days.

In all cases I expect to get the date which I see in the spreadsheet also in the
other modules, independent of settings in tools-options and independent of HTML
or RTF.
Comment 1 Olaf Felka 2006-03-06 09:29:10 UTC
Something for 'spreadsheet'?
Comment 2 frank 2006-03-06 09:55:27 UTC
IMHO not for spreadsheet but for base.
Comment 3 christoph.lukasiak 2006-03-08 14:18:16 UTC
clu->fst: why base? this seems to be a calc specific setting and also fails in
writer, like described in second paragraph.

(i would guess: anything with the numberformatter?)
Comment 4 niklas.nebel 2006-03-21 17:55:13 UTC
When pasting HTML into Writer, the raw number is transferred and interpreted
differently. But what do you mean by pasting into the database document anyway?
Into a table view, or a form, or what?
Comment 5 Regina Henschel 2006-03-21 20:41:52 UTC
After you have copied it in Calc, goto the open Base-document, choose category
"Tables", open menu "Edit", choose "Paste Special". You get the import dialog
starting with "Copy Table". In step "Type formatting" select field type "Date"
for that column.
Comment 6 Frank Schönheit 2006-03-27 12:30:14 UTC
regina, do you copy the two cells in question only, or do you also have "header
cells"? When copying the mere cells only, then they're used as column names, so
no data is copied. When also copying "header cells", then I can't really
reproduce your issue, since I get some "wrong data type" message. Hmm.
I'd like to reproduce this issue, to form an opinion myself ....
Comment 7 Regina Henschel 2006-03-27 17:02:42 UTC
I'll attach a step-by-step instruction in pictures.
Comment 8 Regina Henschel 2006-03-27 17:04:36 UTC
Created attachment 35290 [details]
import table from Calc into Base
Comment 9 Frank Schönheit 2006-03-28 08:51:49 UTC
fs->oj: at least for the HTML part, this can probably be fixed:
OHTMLReader::NextToken evaluates the "sdval" attribute of a table cell. Now this
contains the (number-formatter-dependent) numeric value only, which cannot
intepreted without having the number formatter - and its NullDate, in
particular. Since we do not have this formatter, I suggest that
OHTMLReader::NextToken uses another approach:

the "sdnum" attribute of the table cell describes the number format of the
string. We should use to to translate the cell content into a numeric value. If
we then not only remember the textual representation (m_sNextToken), but the
already-converted numeric representation, together with the number format, we
should be on the safe side (and also spare
ODatabaseExport::insertValueIntoColumn some work).

Since I consider this data corruption (the pasted data is different from the
original data) during collaboration of OOo applications, I target it for the
next maintainance release.


fs->regina: I'm adjusting the summary to reflect that this is about HTML and
Base only. Sorry, but there are reasons [1] why multiple problems per issue are
difficult to handle. At least the Writer/Web part is completely different from
this one here (and much less severe, IMO). The Base/RTF part is probably (after
I examined the source) also different, and also less severe IMO since the
default format for pasting is HTML. So, if you want those other incarnations to
be fixed, too, I encourage you to submit new issues. Sorry and thanks :)

[1] http://qa.openoffice.org/issue_handling/basic_rules.html#one_per_issue
Comment 10 ocke.janssen 2006-04-20 09:24:09 UTC
Fixed in cws dba203c
Comment 11 ocke.janssen 2006-04-27 13:50:27 UTC
Please verify. Thanks.
Comment 12 ocke.janssen 2006-04-27 14:10:01 UTC
.
Comment 13 ocke.janssen 2006-04-27 14:10:32 UTC
.
Comment 14 marc.neumann 2006-05-02 11:27:12 UTC
verified in cws dba203c

find more information about this CWS, like when it is available in the master
builds, in EIS, the Environment Information System:
http://eis.services.openoffice.org/EIS2/cws.ShowCWS?Path=SRC680%2Fdba203c
Comment 15 marc.neumann 2006-06-02 08:46:19 UTC
Hi,

this is fixed in the current master. The current master is available at
http://download.openoffice.org/680/index.html

I close this issue now.

Bye Marc
Comment 16 ocke.janssen 2006-08-01 09:17:15 UTC
*** Issue 61949 has been marked as a duplicate of this issue. ***
Comment 17 ocke.janssen 2006-08-01 09:19:03 UTC
*** Issue 61949 has been marked as a duplicate of this issue. ***
Comment 18 ocke.janssen 2006-08-01 12:57:07 UTC
*** Issue 61949 has been marked as a duplicate of this issue. ***