[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: koffice/krita/ui
From: Dmitry Kazakov <dimula73 () gmail ! com>
Date: 2010-10-23 20:53:26
Message-ID: 20101023205326.90A0EAC899 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1189048 by dkazakov:
Removed all the addChild workarounds
M +0 -10 flake/kis_node_shape.cpp
M +0 -2 flake/kis_node_shape.h
M +1 -1 flake/kis_shape_controller.cpp
M +1 -1 flake/kis_shape_layer_paste.h
M +1 -14 flake/kis_shape_selection.cpp
M +0 -3 flake/kis_shape_selection.h
M +3 -0 flake/kis_shape_selection_model.cpp
M +1 -1 tests/kis_shape_selection_test.cpp
M +1 -1 tests/util.h
--- trunk/koffice/krita/ui/flake/kis_node_shape.cpp #1189047:1189048
@@ -123,16 +123,6 @@
}
-void KisNodeShape::addChild(KoShape * shape)
-{
- KisNodeShape* nodeShape = dynamic_cast<KisNodeShape*>(shape);
- if (!nodeShape) return;
-
- if (!m_d->node->allowAsChild(nodeShape->node())) return;
-
- KoShapeContainer::addShape(shape);
-}
-
void KisNodeShape::saveOdf(KoShapeSavingContext & /*context*/) const
{
--- trunk/koffice/krita/ui/flake/kis_node_shape.h #1189047:1189048
@@ -60,8 +60,6 @@
// KoShapeContainer implementation
void paintComponent(QPainter &painter, const KoViewConverter &converter);
- void addChild(KoShape * shape);
-
/// reimplemented
virtual void saveOdf(KoShapeSavingContext & context) const;
--- trunk/koffice/krita/ui/flake/kis_shape_controller.cpp #1189047:1189048
@@ -215,7 +215,7 @@
selection->setShapeSelection(new KisShapeSelection(m_d->image, \
selection)); }
KisShapeSelection * shapeSelection = \
static_cast<KisShapeSelection*>(selection->shapeSelection());
- shapeSelection->addChild(shape);
+ shapeSelection->addShape(shape);
}
} else {
--- trunk/koffice/krita/ui/flake/kis_shape_layer_paste.h #1189047:1189048
@@ -50,7 +50,7 @@
shapeLayer->addShape(shape);
} else {
KisShapeSelection* shapeSelection = \
dynamic_cast<KisShapeSelection*>(m_container);
- shapeSelection->addChild(shape);
+ shapeSelection->addShape(shape);
}
}
}
--- trunk/koffice/krita/ui/flake/kis_shape_selection.cpp #1189047:1189048
@@ -269,7 +269,7 @@
forEachElement(child, page) {
KoShape * shape = KoShapeRegistry::instance()->createShapeFromOdf(child, \
shapeContext); if (shape) {
- addChild(shape);
+ addShape(shape);
}
}
@@ -277,19 +277,6 @@
}
-
-void KisShapeSelection::addChild(KoShape *object)
-{
- KoShapeLayer::addShape(object);
- m_canvas->shapeManager()->addShape(object);
-}
-
-void KisShapeSelection::removeChild(KoShape *object)
-{
- m_canvas->shapeManager()->remove(object);
- KoShapeLayer::removeShape(object);
-}
-
QPainterPath KisShapeSelection::selectionOutline()
{
if (m_dirty) {
--- trunk/koffice/krita/ui/flake/kis_shape_selection.h #1189047:1189048
@@ -68,9 +68,6 @@
virtual void setDirty();
- void addChild(KoShape *object);
- void removeChild(KoShape *object);
-
virtual QPainterPath selectionOutline();
KoShapeManager *shapeManager() const;
--- trunk/koffice/krita/ui/flake/kis_shape_selection_model.cpp #1189047:1189048
@@ -20,6 +20,7 @@
#include "kis_debug.h"
#include "KoShapeContainer.h"
+#include "KoShapeManager.h"
#include "kis_paint_device.h"
#include "kis_shape_selection.h"
@@ -48,6 +49,7 @@
child->setBorder(0);
child->setBackground(0);
m_shapeMap.insert(child, child->boundingRect());
+ m_shapeSelection->shapeManager()->addShape(child);
m_shapeSelection->setDirty();
QRect updateRect = child->boundingRect().toAlignedRect();
@@ -73,6 +75,7 @@
m_shapeMap.remove(child);
if (m_shapeSelection) {
+ m_shapeSelection->shapeManager()->remove(child);
m_shapeSelection->setDirty();
}
--- trunk/koffice/krita/ui/tests/kis_shape_selection_test.cpp #1189047:1189048
@@ -64,7 +64,7 @@
KisShapeSelection * shapeSelection = new KisShapeSelection(image, selection);
selection->setShapeSelection(shapeSelection);
- shapeSelection->addChild(shape);
+ shapeSelection->addShape(shape);
QCOMPARE(pixelSelection->selected(25, 25), MAX_SELECTED);
QCOMPARE(selection->selectedExactRect(), QRect(0, 0, 150, 150));
--- trunk/koffice/krita/ui/tests/util.h #1189047:1189048
@@ -74,7 +74,7 @@
path->close();
path->normalize();
KisShapeSelection* shapeSelection = new KisShapeSelection(image, \
vectorSelection);
- shapeSelection->addChild(path);
+ shapeSelection->addShape(path);
vectorSelection->setShapeSelection(shapeSelection);
return vectorSelection;
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic