--- calligra-3.1.0/filters/karbon/pdf/PdfImport.cpp
+++ calligra-3.1.0/filters/karbon/pdf/PdfImport.cpp
@@ -88,9 +88,9 @@ KoFilter::ConversionStatus PdfImport::co
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::co
delete globalParams;
globalParams = 0;
- // check for memory leaks
- Object::memCheck(stderr);
-
return KoFilter::OK;
}
--- calligra-3.1.0/filters/karbon/pdf/SvgOutputDev.cpp
+++ calligra-3.1.0/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
: 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(cons
.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])
@@ -402,7 +402,7 @@ void SvgOutputDev::drawString(GfxState *
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 *
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 *
*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\"";
@@ -476,7 +476,7 @@ void SvgOutputDev::drawString(GfxState *
void SvgOutputDev::drawImage(GfxState *state, Object */*ref*/, Stream *str,
int width, int height, GfxImageColorMap *colorMap,
- int *maskColors, GBool /*inlineImg*/)
+ int *maskColors, bool /*inlineImg*/)
{
ImageStream * imgStr = new ImageStream(str, width, colorMap->getNumPixelComps(), colorMap->getBits());
imgStr->reset();
@@ -488,7 +488,7 @@ void SvgOutputDev::drawImage(GfxState *s
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 *s
} 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 *s
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]);
@@ -545,7 +545,7 @@ void SvgOutputDev::drawImage(GfxState *s
void SvgOutputDev::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)
{
drawImage(state, ref, str, width, height, colorMap, maskColors, inlineImg);
}
--- calligra-3.1.0/filters/karbon/pdf/SvgOutputDev.h
+++ calligra-3.1.0/filters/karbon/pdf/SvgOutputDev.h
@@ -44,11 +44,11 @@ public:
explicit SvgOutputDev(const QString &fileName);
virtual ~SvgOutputDev();
- GBool isOk();
+ bool isOk();
- virtual GBool upsideDown();
- virtual GBool useDrawChar();
- virtual GBool interpretType3Chars();
+ virtual bool upsideDown();
+ virtual bool useDrawChar();
+ virtual bool interpretType3Chars();
virtual void startPage(int pageNum, GfxState *state, XRef *xref);
virtual void endPage();
@@ -63,10 +63,10 @@ public:
// images
virtual void drawImage(GfxState *state, Object *ref, Stream *str,
int width, int height, GfxImageColorMap *colorMap,
- int *maskColors, GBool inlineImg);
+ int *maskColors, bool 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);
// styles
virtual void updateAll(GfxState *state);
@@ -84,7 +84,7 @@ public:
private:
QString convertPath(GfxPath *path);
QString convertMatrix(const QMatrix &matrix);
- QString convertMatrix(double * matrix);
+ QString convertMatrix(const double * matrix);
QString printFill();
QString printStroke();