Issue 119960 - [From Symphony]Text outside quotation cannot be paste in cell
Summary: [From Symphony]Text outside quotation cannot be paste in cell
Alias: None
Product: Calc
Classification: Application
Component: editing (show other issues)
Version: 3.4.0
Hardware: PC All
: P3 Major (vote)
Target Milestone: 4.0.0
Assignee: Andre
QA Contact:
Depends on:
Blocks: 120823
  Show dependency tree
Reported: 2012-06-12 08:19 UTC by Yan Ji
Modified: 2012-11-07 08:52 UTC (History)
5 users (show)

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

sample (300 bytes, text/plain)
2012-06-12 08:19 UTC, Yan Ji
no flags Details
patch for paste issue (774 bytes, patch)
2012-06-12 12:30 UTC, zhaoshzh
awf.aoo: review+
Details | Diff
record of my operation (437.05 KB, application/octet-stream)
2012-06-13 06:00 UTC, zhaoshzh
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Yan Ji 2012-06-12 08:19:39 UTC
Created attachment 78254 [details]

Build: AOO3.4
1. Open attached sampl file
2. Select one line to copy
3. New Spreadsheet document
4. Pate text into cell

Defect: Text outside of quotation cannot be pasted
Comment 1 zhaoshzh 2012-06-12 10:58:31 UTC
I am investigating this issue. Code patch will be uploaded immediately.
Comment 2 zhaoshzh 2012-06-12 12:30:01 UTC
Created attachment 78266 [details]
patch for paste issue
Comment 3 zhaoshzh 2012-06-12 12:31:19 UTC
when paste the pure text content to a spreadsheet cell, it only inserts the string in the "",but other string is removed.
for example, if the content is like
"Shape Properties of Dimension Line" context menu is missing in SW.
paste it to a cell, only "Shape Properties of Dimension Line" was pasted.

in the file of \main\sc\source\ui\docshell\impex.cxx
in the function of sal_Bool ScImportExport::Text2Doc( SvStream& rStrm )
only the string between "" is inserted in a cell,
so just append the left string in the cell.
Comment 4 Andre 2012-06-12 13:45:40 UTC
I can not reproduce this bug with a current developer version: I load the bug doc. From the resulting text document I select the while fourth line (the first that starts with "Shape Properties), press Ctrl-C, open a new Calc document and press Ctrl-V.  The whole line is pasted into the first cell.
Comment 5 zhaoshzh 2012-06-13 06:00:06 UTC
Created attachment 78281 [details]
record of my operation
Comment 6 zhaoshzh 2012-06-13 06:00:22 UTC
It can be reproduced at the revision of 1303653.
I recorded my operation in a file named "",you can find it in the attachment.
Comment 7 Andre 2012-06-19 09:43:27 UTC
@zhaoshzh: Sorry for the delay.
Your video did help.  I learned from it that the text file has to be loaded into a text editor, not OpenOffice Writer.  When I copy one line of text from my Emacs and paste it into a new Calc document then the text outside the quotes is not copied.

I have on question regarding your patch (please take into account that I do not know much about the implementation of Calc).  The original code looks like doing a special handling of quotes so that fields separators (, or ;) are correctly located and that this seems to fail.  Can you verify this hypothesis?
Comment 8 Andre 2012-06-19 09:44:05 UTC
Assigning this issue to me, so that it does not get lost.
Comment 9 Andre 2012-06-19 14:53:13 UTC
Looked some more into this.  First, the default field separator is TAB.  I still think that the code should handle quoted separators (ie separators inside a quoted text range) by ignoring them.  Unquoted separators start a new cell.  It just does not work.  Without the patch, text inside quotes is ignored completely.  With the patch the separators always start a new cell, even when quoted.

But maybe I am wrong.

@zhaoshzh: Do you know what the intended behavior is?
Comment 10 zhaoshzh 2012-06-21 02:21:58 UTC
I do other tests for this issue. If the separator char of TAB in the string,
copy the string,and paste it in a cell,AOO will start new cells by the TAB char.
This is correct behavior.

If only quotes chars exists, copy the string and paste it in a cell,
the quotes char should be removed,the the all string should be pasted in
the cell.
Comment 11 Andre 2012-06-21 09:39:13 UTC
Comment on attachment 78266 [details]
patch for paste issue

Reviewed and commited in SVN revision 1352479.

I took the liberty to remove the commented out code.  For reference it is still available in SVN.
Comment 12 Andre 2012-06-21 09:41:48 UTC
Setting status to fixed.
Comment 13 binguo 2012-08-20 09:45:42 UTC
Verified on latest AOO Trunk 0817 build on Window OS/Linux OS/Linux 64bit OS, this bug is fixed.Text outside quotation can be pasted in cell in AOO.
Comment 14 Shenfeng Liu 2012-10-09 07:28:21 UTC
set Target Milestone to AOO 3.5.0 for PM purpose.