Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit b4d3490c authored by Boudewijn Rempt's avatar Boudewijn Rempt
parent b06b473e
......@@ -78,6 +78,7 @@ void KoPathShapeLoaderPrivate::parseSvg(const QString &s, bool process)
switch (command) {
case 'm':
relative = true;
/* Falls through. */
case 'M': {
ptr = getCoord(ptr, tox);
ptr = getCoord(ptr, toy);
......@@ -93,6 +94,7 @@ void KoPathShapeLoaderPrivate::parseSvg(const QString &s, bool process)
}
case 'l':
relative = true;
/* Falls through. */
case 'L': {
ptr = getCoord(ptr, tox);
ptr = getCoord(ptr, toy);
......@@ -143,6 +145,7 @@ void KoPathShapeLoaderPrivate::parseSvg(const QString &s, bool process)
break;
}
case 'z':
/* Falls through. */
case 'Z': {
// reset curx, cury for next path
if (process) {
......@@ -154,6 +157,7 @@ void KoPathShapeLoaderPrivate::parseSvg(const QString &s, bool process)
}
case 'c':
relative = true;
/* Falls through. */
case 'C': {
ptr = getCoord(ptr, x1);
ptr = getCoord(ptr, y1);
......@@ -183,6 +187,7 @@ void KoPathShapeLoaderPrivate::parseSvg(const QString &s, bool process)
}
case 's':
relative = true;
/* Falls through. */
case 'S': {
ptr = getCoord(ptr, x2);
ptr = getCoord(ptr, y2);
......@@ -214,6 +219,7 @@ void KoPathShapeLoaderPrivate::parseSvg(const QString &s, bool process)
}
case 'q':
relative = true;
/* Falls through. */
case 'Q': {
ptr = getCoord(ptr, x1);
ptr = getCoord(ptr, y1);
......@@ -240,6 +246,7 @@ void KoPathShapeLoaderPrivate::parseSvg(const QString &s, bool process)
}
case 't':
relative = true;
/* Falls through. */
case 'T': {
ptr = getCoord(ptr, tox);
ptr = getCoord(ptr, toy);
......@@ -272,6 +279,7 @@ void KoPathShapeLoaderPrivate::parseSvg(const QString &s, bool process)
}
case 'a':
relative = true;
/* Falls through. */
case 'A': {
bool largeArc, sweep;
qreal angle, rx, ry;
......
This diff is collapsed.
......@@ -119,7 +119,7 @@ void KoShapeManager::Private::paintGroup(KoShapeGroup *group, QPainter &painter,
}
KoShapeManager::KoShapeManager(KoCanvasBase *canvas, const QList<KoShape *> &shapes)
: d(new Private(this, canvas))
: d(new Private(this, canvas))
{
Q_ASSERT(d->canvas); // not optional.
connect(d->selection, SIGNAL(selectionChanged()), this, SIGNAL(selectionChanged()));
......@@ -127,7 +127,7 @@ KoShapeManager::KoShapeManager(KoCanvasBase *canvas, const QList<KoShape *> &sha
}
KoShapeManager::KoShapeManager(KoCanvasBase *canvas)
: d(new Private(this, canvas))
: d(new Private(this, canvas))
{
Q_ASSERT(d->canvas); // not optional.
connect(d->selection, SIGNAL(selectionChanged()), this, SIGNAL(selectionChanged()));
......@@ -497,6 +497,7 @@ KoShape *KoShapeManager::shapeAt(const QPointF &position, KoFlake::ShapeSelectio
case KoFlake::ShapeOnTop:
if (shape->isSelectable())
return shape;
break;
case KoFlake::Selected:
if (d->selection->isSelected(shape))
return shape;
......@@ -530,14 +531,14 @@ KoShape *KoShapeManager::shapeAt(const QPointF &position, KoFlake::ShapeSelectio
}
QList<KoShape *> KoShapeManager::shapesAt(const QRectF &rect, bool omitHiddenShapes, bool containedMode)
{
{
d->updateTree();
QList<KoShape*> shapes(containedMode ? d->tree.contained(rect) : d->tree.intersects(rect));
for (int count = shapes.count() - 1; count >= 0; count--) {
KoShape *shape = shapes.at(count);
if (omitHiddenShapes && !shape->isVisible()) {
shapes.removeAt(count);
} else {
......
......@@ -549,6 +549,7 @@ bool KoSvgTextShapeMarkupConverter::convertDocumentToSvg(const QTextDocument *do
//Okay, now the actual writing.
QTextBlock block = doc->begin();
Q_UNUSED(block);
svgWriter.writeStartElement("text");
......@@ -640,22 +641,22 @@ bool KoSvgTextShapeMarkupConverter::convertDocumentToSvg(const QTextDocument *do
if (block.blockNumber() > 0) {
const qreal lineHeightPt =
line.ascent() - prevBlockAscent +
(prevBlockAscent + prevBlockDescent) * qreal(prevBlockRelativeLineSpacing) / 100.0;
line.ascent() - prevBlockAscent +
(prevBlockAscent + prevBlockDescent) * qreal(prevBlockRelativeLineSpacing) / 100.0;
const qreal currentLineSpacing = (info.numSkippedLines + 1) * lineHeightPt;
svgWriter.writeAttribute("dy", KisDomUtils::toString(currentLineSpacing) + "pt");
}
prevBlockRelativeLineSpacing =
blockFormatDiff.hasProperty(QTextFormat::LineHeight) ?
blockFormatDiff.lineHeight() :
mostCommonBlockFormat.lineHeight();
blockFormatDiff.hasProperty(QTextFormat::LineHeight) ?
blockFormatDiff.lineHeight() :
mostCommonBlockFormat.lineHeight();
prevBlockLineType =
blockFormatDiff.hasProperty(QTextFormat::LineHeightType) ?
blockFormatDiff.lineHeightType() :
mostCommonBlockFormat.lineHeightType();
blockFormatDiff.hasProperty(QTextFormat::LineHeightType) ?
blockFormatDiff.lineHeightType() :
mostCommonBlockFormat.lineHeightType();
if (prevBlockLineType == QTextBlockFormat::SingleHeight) {
//single line will set lineHeight to 100%
......@@ -796,8 +797,8 @@ bool KoSvgTextShapeMarkupConverter::convertSvgToDocument(const QString &svgText,
// mnemonic for a newline is (dy != 0 && x == 0)
if (svgReader.name() != "text" &&
elementAttributes.hasAttribute("dy") &&
elementAttributes.hasAttribute("x")) {
elementAttributes.hasAttribute("dy") &&
elementAttributes.hasAttribute("x")) {
QString xString = elementAttributes.value("x").toString();
if (xString.contains("pt")) {
......@@ -998,12 +999,13 @@ QString KoSvgTextShapeMarkupConverter::style(QTextCharFormat format, QTextBlockF
if (propertyId == QTextCharFormat::TextVerticalAlignment) {
QString val = "baseline";
if (format.verticalAlignment() == QTextCharFormat::AlignSubScript)
if (format.verticalAlignment() == QTextCharFormat::AlignSubScript) {
val = QLatin1String("sub");
else if (format.verticalAlignment() == QTextCharFormat::AlignSuperScript)
}
else if (format.verticalAlignment() == QTextCharFormat::AlignSuperScript) {
val = QLatin1String("super");
c.append("baseline-shift").append(":")
.append(val);
}
c.append("baseline-shift").append(":").append(val);
}
if (!c.isEmpty()) {
......@@ -1020,27 +1022,27 @@ QString KoSvgTextShapeMarkupConverter::style(QTextCharFormat format, QTextBlockF
}
}
if (format.underlineStyle()!=QTextCharFormat::NoUnderline ||
format.underlineStyle() != QTextCharFormat::SpellCheckUnderline) {
QStringList values;
QString c;
if (format.underlineStyle()!=QTextCharFormat::NoUnderline ||
format.underlineStyle() != QTextCharFormat::SpellCheckUnderline) {
QStringList values;
QString c;
if (format.fontUnderline()) {
values.append("underline");
}
if(format.fontOverline()) {
values.append("overline");
}
if(format.fontStrikeOut()) {
values.append("line-through");
}
c.append("text-decoration").append(":")
.append(values.join(" "));
if (format.fontUnderline()) {
values.append("underline");
}
if(format.fontOverline()) {
values.append("overline");
}
if(format.fontStrikeOut()) {
values.append("line-through");
}
c.append("text-decoration").append(":")
.append(values.join(" "));
if (!values.isEmpty()) {
style.append(c);
}
if (!values.isEmpty()) {
style.append(c);
}
}
if (blockFormat.hasProperty(QTextBlockFormat::BlockAlignment)) {
// TODO: Alignment works incorrectly! The offsets should be calculated
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment