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

Also put the SvgTextPropertyCursor privates into a d-pointer.

Wolthera van Hövell tot Westerflier79ad4e63618b
diff --git a/plugins/tools/svgtexttool/SvgTextCursor.cpp b/plugins/tools/svgtexttool/SvgTextCursor.cpp
index cb1427a672..fba53450f4 100644
--- a/plugins/tools/svgtexttool/SvgTextCursor.cpp
+++ b/plugins/tools/svgtexttool/SvgTextCursor.cpp
@@ -1414,26 +1414,36 @@ void SvgTextCursor::updateCanvasResources()
}
}
+struct SvgTextPropertyCursor::Private {
+ Private(SvgTextCursor *parent): parent(parent) {}
+ SvgTextCursor *parent{nullptr};
+};
+
SvgTextPropertyCursor::SvgTextPropertyCursor(SvgTextCursor *parent)
- : KoSvgTextPropertiesInterface(parent), m_parent(parent)
+ : KoSvgTextPropertiesInterface(parent), d(new Private(parent))
+{
+
+}
+
+SvgTextPropertyCursor::~SvgTextPropertyCursor()
{
}
QList<KoSvgTextProperties> SvgTextPropertyCursor::getSelectedProperties()
{
- return m_parent->propertiesForRange();
+ return d->parent->propertiesForRange();
}
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 m_parent->shape()? m_parent->shape()->textProperties(): KoSvgTextProperties::defaultProperties();
+ return d->parent->shape()? d->parent->shape()->textProperties(): KoSvgTextProperties::defaultProperties();
}
void SvgTextPropertyCursor::setPropertiesOnSelected(KoSvgTextProperties properties, QSet<KoSvgTextProperties::PropertyId> removeProperties)
{
- m_parent->mergePropertiesIntoSelection(properties, removeProperties);
+ d->parent->mergePropertiesIntoSelection(properties, removeProperties);
}
void SvgTextPropertyCursor::emitSelectionChange()
diff --git a/plugins/tools/svgtexttool/SvgTextCursor.h b/plugins/tools/svgtexttool/SvgTextCursor.h
index 4d8b044eff..f63f7bb7b7 100644
--- a/plugins/tools/svgtexttool/SvgTextCursor.h
+++ b/plugins/tools/svgtexttool/SvgTextCursor.h
@@ -231,13 +231,15 @@ class KRITATOOLSVGTEXT_EXPORT SvgTextPropertyCursor : public KoSvgTextProperties
{
public:
SvgTextPropertyCursor(SvgTextCursor *parent);
+ ~SvgTextPropertyCursor();
virtual QList<KoSvgTextProperties> getSelectedProperties() override;
virtual KoSvgTextProperties getInheritedProperties() override;
virtual void setPropertiesOnSelected(KoSvgTextProperties properties, QSet<KoSvgTextProperties::PropertyId> removeProperties = QSet<KoSvgTextProperties::PropertyId>()) override;
void emitSelectionChange();
private:
- SvgTextCursor *m_parent{nullptr};
+ struct Private;
+ const QScopedPointer<Private> d;
};
Q_DECLARE_METATYPE(SvgTextCursor::MoveMode)