[Libreoffice-bugs] [Bug 120574] TXT file encoding is lost when saving

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Fri Jan 22 08:17:59 UTC 2021


https://bugs.documentfoundation.org/show_bug.cgi?id=120574

Mike Kaganski <mikekaganski at hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |difficultyMedium, easyHack,
                   |                            |skillCpp

--- Comment #4 from Mike Kaganski <mikekaganski at hotmail.com> ---
The filter should store the settings in medium attached to the document. The
proper place to store this is likely AsciiReader::Read
(sw/source/filter/ascii/parasc.cxx), which has m_pMedium set in SwReader::Read,
and allows to call its GetItemSet()->Put() to modify the data based on parser
data.

Using this data likely should happen in SwASCWriter::SetupFilterOptions (which
should be implemented, and which is called from Writer::Write, where the medium
is available).

The easy hack implies that a unit test is also implemented, that tests that the
detected non-default settings (e.g., UTF-16BE with BOM with CR line endings,
etc.) are retained on save-and-reload. The unit test should be in
sw/qa/extras/txtexport/txtexport.cxx, and should include reading the exported
file (similar to what TxtExportTest::readExportedFile does), testing BOM and
data bytes.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20210122/a1f1193b/attachment.htm>


More information about the Libreoffice-bugs mailing list