https://bugs.freedesktop.org/show_bug.cgi?id=67873

          Priority: medium
            Bug ID: 67873
          Assignee: [email protected]
           Summary: libcdr missing empty lines
          Severity: minor
    Classification: Unclassified
                OS: All
          Reporter: [email protected]
          Hardware: Other
            Status: UNCONFIRMED
           Version: unspecified
         Component: filters and storage
           Product: LibreOffice

Created attachment 83794
  --> https://bugs.freedesktop.org/attachment.cgi?id=83794&action=edit
demo of bug

Hi there, I just git cloned the latest master of libcdr and used cdr2text (&
the various other tools) to reproduce. If I have a text box with text
containing any blank lines, the code strips these blank lines out. Attached is
a sample file demonstrating the issue. Below is a hack patch to libcdr which
produces the correct output by inserting a line with a single space.

diff --git a/src/lib/CDRParser.cpp b/src/lib/CDRParser.cpp
index ec76a21..08f5e44 100644
--- a/src/lib/CDRParser.cpp
+++ b/src/lib/CDRParser.cpp
@@ -3032,6 +3032,10 @@ void libcdr::CDRParser::readTxsm(WPXInputStream *input,
unsigned length)
         memcpy(&textData[0], buffer, numBytesRead);
       input->seek(1, WPX_SEEK_CUR); //skip the 0 ending character

+  if (textData.empty()) {
+    textData.push_back(' ');
+    charDescriptions.push_back(0);
+  }
       if (!textData.empty())
         m_collector->collectText(textId, stlId, textData, charDescriptions,
charStyles);
     }

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to