[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [calligra/calligra-qt5-rempt] filters/sheets/xlsx: Don't fail loading a file when the comments fail
From:       Boudewijn Rempt <boud () valdyas ! org>
Date:       2013-11-12 10:01:26
Message-ID: E1VgAmk-0002op-Re () scm ! kde ! org
[Download RAW message or body]

Git commit 186a0a028cdfb1ccfefa0eaccfd045ce1a14f122 by Boudewijn Rempt.
Committed on 12/11/2013 at 09:58.
Pushed by rempt into branch 'calligra-qt5-rempt'.

Don't fail loading a file when the comments fail to load

The xlsx import code has trouble with a comments file like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<comments xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
  <authors>
    <author/>
  </authors>
  <commentList>
    <comment ref="A1" authorId="0">
      <text>
        <r>
          <rPr>
            <sz val="8"/>
            <color indexed="81"/>
            <rFont val="Tahoma"/>
            <family val="2"/>
          </rPr>
          <t>ResultsSheet=0:XMLDataSheet=1:descriptionOffset=2:setDescriptionOffset=1: \
testDateCoordinates=1,5:testReleaseCoordinates=1,7:testRollingReleaseCoordinates=0,7:testStartCoordinates=4,9</t>
  </r>
      </text>
    </comment>
  </commentList>
</comments>

Because the author value is empty.

It also doesn't handle a situation where there's more than one comments
file -- in fact, this part of the code seems a bit unfinished altogether.

M  +5    -3    filters/sheets/xlsx/XlsxXmlCommentsReader.cpp

http://commits.kde.org/calligra/186a0a028cdfb1ccfefa0eaccfd045ce1a14f122

diff --git a/filters/sheets/xlsx/XlsxXmlCommentsReader.cpp \
b/filters/sheets/xlsx/XlsxXmlCommentsReader.cpp index 95b1062..fee094f 100644
--- a/filters/sheets/xlsx/XlsxXmlCommentsReader.cpp
+++ b/filters/sheets/xlsx/XlsxXmlCommentsReader.cpp
@@ -75,9 +75,11 @@ KoFilter::ConversionStatus \
XlsxXmlCommentsReader::read(MSOOXML::MsooXmlReaderCon  m_themes = m_context->themes;
     const KoFilter::ConversionStatus result = readInternal();
     m_context = 0;
-    if (result == KoFilter::OK)
-        return KoFilter::OK;
-    return result;
+    if (result != KoFilter::OK) {
+        kWarning() << "Failure reading the comments";
+    }
+    // We're not going to fail reading the whole file because the comments cannot be \
read +    return KoFilter::OK;
 }
 
 KoFilter::ConversionStatus XlsxXmlCommentsReader::readInternal()


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic