Calligra: fix build for Qt 5.14

This commit is contained in:
Gerasim Troeglazov
2020-01-07 21:54:12 +10:00
parent 6cb3db9614
commit efc4a4f9ec
2 changed files with 337 additions and 9 deletions

View File

@@ -6,7 +6,7 @@ HOMEPAGE="https://www.calligra.org/"
COPYRIGHT="2010-2018 KDE Organisation"
LICENSE="GNU LGPL v2
GNU GPL v2"
REVISION="5"
REVISION="6"
SOURCE_URI="https://github.com/KDE/calligra/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="33054f2309a3e3d274100d1485a46f50ca227cfafa66c34a3483c550ccc84ef4"
SOURCE_FILENAME="calligra-$portVersion.tar.gz"
@@ -166,7 +166,7 @@ REQUIRES_okular_plugins="
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
extra_cmake_modules$secondaryArchSuffix >= 5.55
extra_cmake_modules$secondaryArchSuffix >= 5.65
devel:eigen$secondaryArchSuffix
devel:libboost_system$secondaryArchSuffix
devel:libetonyek_0.1$secondaryArchSuffix
@@ -235,7 +235,7 @@ BUILD_REQUIRES="
devel:libpoppler$secondaryArchSuffix >= 87
devel:libpoppler_qt5$secondaryArchSuffix >= 1.19
devel:libqca$secondaryArchSuffix >= 2
devel:libQt5Core$secondaryArchSuffix >= 5.13
devel:libQt5Core$secondaryArchSuffix >= 5.14
devel:libQt5WebKitWidgets$secondaryArchSuffix
devel:librevenge_0.0$secondaryArchSuffix
devel:libvisio_0.1$secondaryArchSuffix

View File

@@ -1,4 +1,4 @@
From 46cfb03d019146e003736c0d280053164299fa51 Mon Sep 17 00:00:00 2001
From c5e122d8241ea369f43b5de9356ac7d38893efb0 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Fri, 25 Oct 2019 22:52:53 +1000
Subject: Disable DBUS for Haiku
@@ -152,10 +152,10 @@ index b678457..3a069dd 100644
${calligrastageprivate_LIB_SRCS}
KPrViewAdaptor.cpp
--
2.23.0
2.24.1
From b6ea306dad2ba6bd20d9c6be1adf951ebcf9e254 Mon Sep 17 00:00:00 2001
From 29cc7e3f189aa7bfbd4d5479a648e42a3bca1e02 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Fri, 25 Oct 2019 22:53:43 +1000
Subject: Add missing includes
@@ -357,10 +357,10 @@ index e38599a..7e8b2d5 100644
: m_state(state)
{
--
2.23.0
2.24.1
From 3c2b5ce916c7fb74a20f1ee72576f27ddbcdf701 Mon Sep 17 00:00:00 2001
From f8e6895705b012be6a14095556c16339cc73d56b Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Fri, 25 Oct 2019 23:43:09 +1000
Subject: Don't use kdirnotify include without DBUS
@@ -395,5 +395,333 @@ index fedeb4e..ac5791f 100644
#include <QMimeDatabase>
--
2.23.0
2.24.1
From 5c04250dcf4785391b4c2f014751b53968adad53 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Fri, 25 Oct 2019 22:55:18 +1000
Subject: Fix for poppler-076
diff --git a/filters/karbon/pdf/PdfImport.cpp b/filters/karbon/pdf/PdfImport.cpp
index c3e96b0..e910dae 100644
--- a/filters/karbon/pdf/PdfImport.cpp
+++ b/filters/karbon/pdf/PdfImport.cpp
@@ -88,9 +88,9 @@ KoFilter::ConversionStatus PdfImport::convert(const QByteArray& from, const QByt
SvgOutputDev * dev = new SvgOutputDev(m_chain->outputFile());
if (dev->isOk()) {
int rotate = 0;
- GBool useMediaBox = gTrue;
- GBool crop = gFalse;
- GBool printing = gFalse;
+ bool useMediaBox = true;
+ bool crop = false;
+ bool printing = false;
pdfDoc->displayPages(dev, firstPage, lastPage, hDPI, vDPI, rotate, useMediaBox, crop, printing);
dev->dumpContent();
}
@@ -102,9 +102,6 @@ KoFilter::ConversionStatus PdfImport::convert(const QByteArray& from, const QByt
delete globalParams;
globalParams = 0;
- // check for memory leaks
- Object::memCheck(stderr);
-
return KoFilter::OK;
}
diff --git a/filters/karbon/pdf/SvgOutputDev.cpp b/filters/karbon/pdf/SvgOutputDev.cpp
index 931917a..52bb37d 100644
--- a/filters/karbon/pdf/SvgOutputDev.cpp
+++ b/filters/karbon/pdf/SvgOutputDev.cpp
@@ -39,7 +39,7 @@ class SvgOutputDev::Private
{
public:
Private(const QString &fname)
- : svgFile(fname), defs(0), body(0), state(gTrue)
+ : svgFile(fname), defs(0), body(0), state(true)
, brush(Qt::SolidPattern) {}
~Private() {
@@ -52,7 +52,7 @@ public:
QString defsData;
QTextStream * defs;
QTextStream * body;
- GBool state;
+ bool state;
QSizeF pageSize;
QPen pen;
QBrush brush;
@@ -62,7 +62,7 @@ SvgOutputDev::SvgOutputDev(const QString &fileName)
: d(new Private(fileName))
{
if (! d->svgFile.open(QIODevice::WriteOnly)) {
- d->state = gFalse;
+ d->state = false;
return;
}
@@ -75,24 +75,24 @@ SvgOutputDev::~SvgOutputDev()
delete d;
}
-GBool SvgOutputDev::isOk()
+bool SvgOutputDev::isOk()
{
return d->state;
}
-GBool SvgOutputDev::upsideDown()
+bool SvgOutputDev::upsideDown()
{
- return gTrue;
+ return true;
}
-GBool SvgOutputDev::useDrawChar()
+bool SvgOutputDev::useDrawChar()
{
- return gFalse;
+ return false;
}
-GBool SvgOutputDev::interpretType3Chars()
+bool SvgOutputDev::interpretType3Chars()
{
- return gFalse;
+ return false;
}
void SvgOutputDev::startPage(int pageNum, GfxState *state, XRef */*xref*/)
@@ -212,7 +212,7 @@ QString SvgOutputDev::convertMatrix(const QMatrix &matrix)
.arg(matrix.dx()) .arg(matrix.dy());
}
-QString SvgOutputDev::convertMatrix(double * matrix)
+QString SvgOutputDev::convertMatrix(const double * matrix)
{
return QString("matrix(%1 %2 %3 %4 %5 %6)")
.arg(matrix[0]).arg(matrix[1])
@@ -387,7 +387,7 @@ QString SvgOutputDev::printStroke()
return stroke;
}
-void SvgOutputDev::drawString(GfxState * state, GooString * s)
+void SvgOutputDev::drawString(GfxState * state, const GooString * s)
{
int render = state->getRender();
// check for invisible text -- this is used by Acrobat Capture
@@ -402,7 +402,7 @@ void SvgOutputDev::drawString(GfxState * state, GooString * s)
QString str;
- char * p = s->getCString();
+ const char * p = s->c_str();
int len = s->getLength();
CharCode code;
Unicode *u = nullptr;
@@ -429,7 +429,7 @@ void SvgOutputDev::drawString(GfxState * state, GooString * s)
double x = state->getCurX();
double y = state->getCurY();
- double * ctm = state->getCTM();
+ const double * ctm = state->getCTM();
QMatrix transform(ctm[0], ctm[1], ctm[2], ctm[3], ctm[4], ctm[5]);
QMatrix mirror;
@@ -451,11 +451,11 @@ void SvgOutputDev::drawString(GfxState * state, GooString * s)
*d->body << " y=\"" << y << "px\"";
if (font && font->getFamily()) {
- *d->body << " font-family=\"" << QString::fromLatin1(font->getFamily()->getCString()) << "\"";
- //debugPdf << "font family:" << QString::fromLatin1( font->getFamily()->getCString() );
+ *d->body << " font-family=\"" << QString::fromLatin1(font->getFamily()->c_str()) << "\"";
+ //debugPdf << "font family:" << QString::fromLatin1( font->getFamily()->c_str() );
} else if (font && font->getName()) {
- *d->body << " font-family=\"" << QString::fromLatin1(font->getName()->getCString()) << "\"";
- //debugPdf << "font name:" << QString::fromLatin1( font->getName()->getCString() );
+ *d->body << " font-family=\"" << QString::fromLatin1(font->getName()->c_str()) << "\"";
+ //debugPdf << "font name:" << QString::fromLatin1( font->getName()->c_str() );
}
*d->body << " font-size=\"" << qMax(state->getFontSize(), state->getTransformedFontSize()) << "px\"";
@@ -474,9 +474,9 @@ void SvgOutputDev::drawString(GfxState * state, GooString * s)
*d->body << "</text>" << endl;
}
-void SvgOutputDev::drawImage(GfxState *state, Object */*ref*/, Stream *str,
+void SvgOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
int width, int height, GfxImageColorMap *colorMap,
- int *maskColors, GBool /*inlineImg*/)
+ bool /*interpolate*/, int *maskColors, bool inlineImg)
{
ImageStream * imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(), colorMap->getBits());
imgStr->reset();
@@ -488,7 +488,7 @@ void SvgOutputDev::drawImage(GfxState *state, Object */*ref*/, Stream *str,
if (maskColors) {
for (int y = 0; y < height; y++) {
dest = (unsigned int *)(buffer + y * 4 * width);
- Guchar * pix = imgStr->getLine();
+ unsigned char * pix = imgStr->getLine();
colorMap->getRGBLine(pix, dest, width);
for (int x = 0; x < width; x++) {
@@ -507,7 +507,7 @@ void SvgOutputDev::drawImage(GfxState *state, Object */*ref*/, Stream *str,
} else {
for (int y = 0; y < height; y++) {
dest = (unsigned int *)(buffer + y * 4 * width);
- Guchar * pix = imgStr->getLine();
+ unsigned char * pix = imgStr->getLine();
colorMap->getRGBLine(pix, dest, width);
}
@@ -522,7 +522,7 @@ void SvgOutputDev::drawImage(GfxState *state, Object */*ref*/, Stream *str,
return;
}
- double * ctm = state->getCTM();
+ const double * ctm = state->getCTM();
QMatrix m;
m.setMatrix(ctm[0] / width, ctm[1] / width, -ctm[2] / height, -ctm[3] / height, ctm[2] + ctm[4], ctm[3] + ctm[5]);
@@ -543,10 +543,3 @@ void SvgOutputDev::drawImage(GfxState *state, Object */*ref*/, Stream *str,
delete imgStr;
}
-void SvgOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
- int width, int height, GfxImageColorMap *colorMap,
- GBool /*interpolate*/, int *maskColors, GBool inlineImg)
-{
- drawImage(state, ref, str, width, height, colorMap, maskColors, inlineImg);
-}
-
diff --git a/filters/karbon/pdf/SvgOutputDev.h b/filters/karbon/pdf/SvgOutputDev.h
index 85fe55d..df2805c 100644
--- a/filters/karbon/pdf/SvgOutputDev.h
+++ b/filters/karbon/pdf/SvgOutputDev.h
@@ -44,47 +44,44 @@ public:
explicit SvgOutputDev(const QString &fileName);
virtual ~SvgOutputDev();
- GBool isOk();
+ bool isOk();
- virtual GBool upsideDown();
- virtual GBool useDrawChar();
- virtual GBool interpretType3Chars();
- virtual void startPage(int pageNum, GfxState *state, XRef *xref);
- virtual void endPage();
+ bool upsideDown() override;
+ bool useDrawChar() override;
+ bool interpretType3Chars() override;
+ void startPage(int pageNum, GfxState *state, XRef *xref) override;
+ void endPage() override;
// path painting
- virtual void stroke(GfxState * state);
- virtual void fill(GfxState * state);
- virtual void eoFill(GfxState *state);
+ void stroke(GfxState * state) override;
+ void fill(GfxState * state) override;
+ void eoFill(GfxState *state) override;
// text
- virtual void drawString(GfxState * state, GooString * s);
+ void drawString(GfxState * state, const GooString * s) override;
// images
- virtual void drawImage(GfxState *state, Object *ref, Stream *str,
+ void drawImage(GfxState *state, Object *ref, Stream *str,
int width, int height, GfxImageColorMap *colorMap,
- int *maskColors, GBool inlineImg);
- virtual void drawImage(GfxState *state, Object *ref, Stream *str,
- int width, int height, GfxImageColorMap *colorMap,
- GBool interpolate, int *maskColors, GBool inlineImg);
+ bool interpolate, int *maskColors, bool inlineImg) override;
// styles
- virtual void updateAll(GfxState *state);
- virtual void updateFillColor(GfxState *state);
- virtual void updateStrokeColor(GfxState *state);
- virtual void updateFillOpacity(GfxState *state);
- virtual void updateStrokeOpacity(GfxState *state);
- virtual void updateLineJoin(GfxState *state);
- virtual void updateLineCap(GfxState *state);
- virtual void updateMiterLimit(GfxState *state);
- virtual void updateLineWidth(GfxState *state);
+ void updateAll(GfxState *state) override;
+ void updateFillColor(GfxState *state) override;
+ void updateStrokeColor(GfxState *state) override;
+ void updateFillOpacity(GfxState *state) override;
+ void updateStrokeOpacity(GfxState *state) override;
+ void updateLineJoin(GfxState *state) override;
+ void updateLineCap(GfxState *state) override;
+ void updateMiterLimit(GfxState *state) override;
+ void updateLineWidth(GfxState *state) override;
/// Dumps content to svg file
void dumpContent();
private:
QString convertPath(GfxPath *path);
QString convertMatrix(const QMatrix &matrix);
- QString convertMatrix(double * matrix);
+ QString convertMatrix(const double * matrix);
QString printFill();
QString printStroke();
--
2.24.1
From 61b6090fe3f6d5bde7894479c9c377944e13a274 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Tue, 7 Jan 2020 21:02:55 +1000
Subject: Fix build for Qt 5.14
diff --git a/plan/src/workpackage/view.cpp b/plan/src/workpackage/view.cpp
index 3ce4769..583558f 100644
--- a/plan/src/workpackage/view.cpp
+++ b/plan/src/workpackage/view.cpp
@@ -44,6 +44,7 @@
#include <QPointer>
#include <QMenu>
#include <QAction>
+#include <QMap>
#include <KLocalizedString>
#include <ktoolbar.h>
diff --git a/plan/src/workpackage/view.h b/plan/src/workpackage/view.h
index b10547e..1942d3b 100644
--- a/plan/src/workpackage/view.h
+++ b/plan/src/workpackage/view.h
@@ -24,11 +24,13 @@
#include <KoView.h>
#include <QStackedWidget>
+#include <QMap>
class QPrinter;
class QPrintDialog;
class QMenu;
class QActionGroup;
+class QAction;
class KActionCollection;
diff --git a/sheets/plugins/calendar/CalendarToolWidget.cpp b/sheets/plugins/calendar/CalendarToolWidget.cpp
index b10b230..f9a4684 100644
--- a/sheets/plugins/calendar/CalendarToolWidget.cpp
+++ b/sheets/plugins/calendar/CalendarToolWidget.cpp
@@ -29,6 +29,7 @@
#include <kdatepicker.h>
+#include <QDate>
#include <QPushButton>
namespace Calligra
--
2.24.1