Skip to content

Commit

Permalink
Merge branch 'xls' into 'master'
Browse files Browse the repository at this point in the history
Work around QLocale().timeFormat().simplified() seg faulting

See merge request mer-core/calligra!11
  • Loading branch information
pvuorela committed Sep 2, 2019
2 parents 96bbe74 + 6bcbba0 commit 0571e59
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
29 changes: 29 additions & 0 deletions rpm/calligra-sheets-read-time.patch
@@ -0,0 +1,29 @@
From a6e6a4bcc448d8448e3d7bb969b7e5e27086a754 Mon Sep 17 00:00:00 2001
From: Damien Caliste <dcaliste@free.fr>
Date: Wed, 22 Feb 2017 12:26:04 +0100
Subject: [PATCH] Work around QLocale().timeFormat().simplified() seg faulting
in Qt5.6 with GCC4.8.

---
sheets/ValueParser.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sheets/ValueParser.cpp b/sheets/ValueParser.cpp
index 136c97f5..0af1ba7a 100644
--- a/sheets/ValueParser.cpp
+++ b/sheets/ValueParser.cpp
@@ -390,7 +390,10 @@ Value ValueParser::tryParseTime(const QString& str, bool *ok) const
QDateTime ValueParser::readTime(const QString& intstr, bool withSeconds, bool* ok) const
{
QString str = intstr.simplified().toLower();
- QString format = m_settings->locale()->timeFormat().simplified();
+ // Workaround segfault with gcc 4.8 and Qt5.6 when calling
+ // m_settings->locale()->timeFormat().simplified() all in one line.
+ QString timeFormat = m_settings->locale()->timeFormat();
+ QString format = timeFormat.simplified();
if (!withSeconds) {
int n = format.indexOf("%S");
format = format.left(n - 1);
--
2.17.1

2 changes: 2 additions & 0 deletions rpm/calligra.spec
Expand Up @@ -32,6 +32,7 @@ Patch13: calligra-plugins.patch
Patch14: calligra-error-reporting.patch
Patch15: calligra-sheets.patch
# to be removed after Qt upgrade
Patch16: calligra-sheets-read-time.patch
Patch18: calligra-cache.patch
Patch19: calligra-qtdbus.patch
Patch20: calligra-background.patch
Expand Down Expand Up @@ -185,6 +186,7 @@ BuildRequires: extra-cmake-modules >= 5.34.0
%patch13 -d upstream -p1
%patch14 -d upstream -p1
%patch15 -d upstream -p1
%patch16 -d upstream -p1
%patch18 -d upstream -p1
%patch19 -d upstream -p1
%patch20 -d upstream -p1
Expand Down

0 comments on commit 0571e59

Please sign in to comment.