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++

Avoid setting unnecessary default properties and showing them in the UI.

Wolthera van Hövell tot Westerflier6fd08c991f2e
diff --git a/libs/flake/svg/SvgLoadingContext.cpp b/libs/flake/svg/SvgLoadingContext.cpp
index b3b7e29c41..235f3bfc2e 100644
--- a/libs/flake/svg/SvgLoadingContext.cpp
+++ b/libs/flake/svg/SvgLoadingContext.cpp
@@ -283,7 +283,7 @@ QHash<QString, const KoColorProfile *> SvgLoadingContext::profiles()
KoSvgTextProperties SvgLoadingContext::resolvedProperties() const
{
- KoSvgTextProperties props = KoSvgTextProperties::defaultProperties();
+ KoSvgTextProperties props;
for (auto it = d->gcStack.begin(); it != d->gcStack.end(); it++) {
SvgGraphicsContext *gc = *it;
KoSvgTextProperties props2 = gc->textProperties;
diff --git a/plugins/tools/defaulttool/defaulttool/DefaultTool.cpp b/plugins/tools/defaulttool/defaulttool/DefaultTool.cpp
index d1b5753c1e..7329bdae78 100644
--- a/plugins/tools/defaulttool/defaulttool/DefaultTool.cpp
+++ b/plugins/tools/defaulttool/defaulttool/DefaultTool.cpp
@@ -1967,7 +1967,7 @@ QList<KoSvgTextProperties> DefaultToolTextPropertiesInterface::getSelectedProper
KoSvgTextProperties DefaultToolTextPropertiesInterface::getInheritedProperties()
{
- return KoSvgTextProperties::defaultProperties();
+ return KoSvgTextProperties();
}
void DefaultToolTextPropertiesInterface::setPropertiesOnSelected(KoSvgTextProperties properties, QSet<KoSvgTextProperties::PropertyId> removeProperties)
diff --git a/plugins/tools/svgtexttool/SvgTextCursor.cpp b/plugins/tools/svgtexttool/SvgTextCursor.cpp
index 0d636fa222..c9bca772d9 100644
--- a/plugins/tools/svgtexttool/SvgTextCursor.cpp
+++ b/plugins/tools/svgtexttool/SvgTextCursor.cpp
@@ -1456,7 +1456,7 @@ KoSvgTextProperties SvgTextPropertyCursor::getInheritedProperties()
{
// 9 times out of 10 this is correct, though we could do better by actually
// getting inherited properties for the range and not just defaulting to the paragraph.
- return (d->parent->shape() && spanSelection())? d->parent->shape()->textProperties(): KoSvgTextProperties::defaultProperties();
+ return (d->parent->shape() && spanSelection())? d->parent->shape()->textProperties(): KoSvgTextProperties();
}
void SvgTextPropertyCursor::setPropertiesOnSelected(KoSvgTextProperties properties, QSet<KoSvgTextProperties::PropertyId> removeProperties)