Issue 35464

Summary: pasting strings longer 64K into memo fields does not work
Product: Base Reporter: Frank Schönheit <frank.schoenheit>
Component: codeAssignee: AOO issues mailing list <issues>
Status: ACCEPTED --- QA Contact:
Severity: Trivial    
Priority: P3 CC: issues
Version: 680m56   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
database file
none
dBase file
none
all files in one (IZ did not allow me to attach the last manually ..)
none
sample document to copy'n'paste into the memo field
none
sample form none

Description Frank Schönheit 2004-10-13 15:45:55 UTC
- save the attached database and dBase file to an arbitrary location
- open the database file, adjust it's settings (Edit|Database|Properties) so
that it points to
  the proper location of the .dbf file
- The dBase table contains a text and a memo field
- create a simple form bound to the table, with one single line and one multi
line text field,
  both to both the two table columns
- open the form document for data entry
- open the attached text.txt, copy it's whole content to the clipboard
- place the cursor in the multi line text control of the form, and chose "Paste"
from the
  context menu
=> assertion: Overflowing rtl::OUString -> UniString cut to zero
=> the text is not pasted
Comment 1 Frank Schönheit 2004-10-13 15:48:09 UTC
Created attachment 18365 [details]
database file
Comment 2 Frank Schönheit 2004-10-13 15:48:40 UTC
Created attachment 18366 [details]
dBase file
Comment 3 Frank Schönheit 2004-10-13 15:50:32 UTC
Created attachment 18367 [details]
all files in one (IZ did not allow me to attach the last manually ..)
Comment 4 Frank Schönheit 2004-10-13 15:53:47 UTC
Created attachment 18368 [details]
sample document to copy'n'paste into the memo field
Comment 5 Frank Schönheit 2004-10-13 15:54:05 UTC
Created attachment 18369 [details]
sample form
Comment 6 Frank Schönheit 2004-10-13 15:57:15 UTC
- memo.odb is the database file
- memo.dbf is the dBase file
- memo.zip contains memo.odb, memo.dbf, and memo.dbt (the memo file belonging
  to memo.dbf)
- text.txt contains a sample text to copy'n'paste to the memo control (I suppose
nearly
  every other  text does it, too)
- memo.oot contains a sample form. You may need to adjust it's settings to point
  to the database file
Comment 7 Frank Schönheit 2004-10-19 13:35:57 UTC
update: all the hassle with binding the control to a memo field is not
necessary: simply create a multi line text field, and paste the attached
text.txt's content into it.
Comment 8 Frank Schönheit 2004-10-19 15:30:32 UTC
adjusting summary: The problem is that the underlying TextView implementation
uses the tools/String class, which itself can not work with strings longer than
64K. A Paste operation into the TextView requires (for an intermediate step) a
single string which contains the whole text, so pasting fails when the string is
longer than 64K.

Solutions:
- some more sophisticated code in pasting, which breaks up the pasted string
(which originally is a ::rtl::OUString, which can be longer than 64K) into pieces.
OR
- replace all occurences of String in the TextView/TextEngine class with
::rtl::OUString

The latter is the better solution, but also much more expensive. Given that this
issue is in the product for quite a while, and we're close to a 2.0 Beta, I
re-target this to "OOo Later"
Comment 9 Marcus 2017-05-20 10:47:29 UTC
Reset assigne to the default "issues@openoffice.apache.org".