Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Fix build error with KoCssPreset

Wolthera van Hövell tot Westerflier243ac2513390
diff --git a/libs/flake/resources/KoCssStylePreset.cpp b/libs/flake/resources/KoCssStylePreset.cpp
index 8fca5f9341..1f141b191d 100644
--- a/libs/flake/resources/KoCssStylePreset.cpp
+++ b/libs/flake/resources/KoCssStylePreset.cpp
@@ -158,7 +158,7 @@ bool KoCssStylePreset::saveToDevice(QIODevice *dev) const
{
if (!d->shape) return false;
SvgWriter writer({d->shape.data()});
- return writer.save(dev, d->shape->boundingRect().size());
+ return writer.save(*dev, d->shape->boundingRect().size());
}
QString KoCssStylePreset::defaultFileExtension() const
diff --git a/libs/flake/text/KoSvgTextShape.cpp b/libs/flake/text/KoSvgTextShape.cpp
index 0048b9a333..88599b28ea 100644
--- a/libs/flake/text/KoSvgTextShape.cpp
+++ b/libs/flake/text/KoSvgTextShape.cpp
@@ -1072,8 +1072,12 @@ QVector<int> KoSvgTextShape::findTreeIndexForPropertyId(KoSvgTextProperties::Pro
QVector<int> treeIndex;
for (auto it = d->textData.childBegin(); it != d->textData.childEnd(); it++) {
- treeIndex = findTreeIndexForPropertyIdImpl(it, propertyId);
- treeIndex.insert(0, 0);
+ if (it->properties.hasProperty(propertyId)) {
+ return QVector<int>({0});
+ } else {
+ treeIndex = findTreeIndexForPropertyIdImpl(it, propertyId);
+ treeIndex.insert(0, 0);
+ }
}
return treeIndex;