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 24002ed5 authored by Cyrille Berger's avatar Cyrille Berger

backport: Fix: attaching an artistic shape to a connector which is connected...

backport: Fix: attaching an artistic shape to a connector which is connected to the text trigger endless loop.

svn path=/branches/koffice/2.0/koffice/; revision=960700
parent 427ff8e4
......@@ -2,7 +2,7 @@
Copyright (C) 2006 Casper Boemann Rasmussen <cbr@boemann.dk>
Copyright (C) 2006-2009 Thomas Zander <zander@kde.org>
Copyright (C) 2006-2008 Thorsten Zachmann <zachmann@kde.org>
Copyright (C) 2007 Jan Hambrecht <jaham@gmx.net>
Copyright (C) 2007-2009 Jan Hambrecht <jaham@gmx.net>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
......@@ -1239,11 +1239,19 @@ QRectF KoShape::documentToShape(const QRectF &rect) const
return absoluteTransformation(0).inverted().mapRect(rect);
}
void KoShape::addDependee(KoShape * shape)
bool KoShape::addDependee(KoShape * shape)
{
if (! shape)
return false;
// refuse to establish a circular dependency
if (shape->hasDependee(this))
return false;
if (! d->dependees.contains(shape))
d->dependees.append(shape);
return true;
}
void KoShape::removeDependee(KoShape * shape)
......
......@@ -2,7 +2,7 @@
Copyright (C) 2006-2008 Thorsten Zachmann <zachmann@kde.org>
Copyright (C) 2006, 2008 Casper Boemann <cbr@boemann.dk>
Copyright (C) 2006-2009 Thomas Zander <zander@kde.org>
Copyright (C) 2007 Jan Hambrecht <jaham@gmx.net>
Copyright (C) 2007-2009 Jan Hambrecht <jaham@gmx.net>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
......@@ -721,8 +721,16 @@ public:
/// Removes connection point with given index
void removeConnectionPoint(int index);
/// Adds a shape which depends on this shape
void addDependee(KoShape * shape);
/**
* Adds a shape which depends on this shape.
*
* If this shape already depends on the given shape, establishing the
* dependency is refused to prevent circular dependencies.
*
* @param shape the shape which depends on this shape
* @return true if dependency could be established, else false
*/
bool addDependee(KoShape * shape);
/// Removes as shape depending on this shape
void removeDependee(KoShape * shape);
......
/* This file is part of the KDE project
* Copyright (C) 2007-2008 Jan Hambrecht <jaham@gmx.net>
* Copyright (C) 2007-2009 Jan Hambrecht <jaham@gmx.net>
* Copyright (C) 2008 Rob Buis <buis@kde.org>
*
* This library is free software; you can redistribute it and/or
......@@ -419,10 +419,13 @@ bool ArtisticTextShape::putOnPath( KoPathShape * path )
if( path->outline().isEmpty() )
return false;
if( ! path->addDependee( this ) )
return false;
update();
m_path = path;
m_path->addDependee( this );
// use the paths outline converted to document coordinates as the baseline
m_baseline = m_path->absoluteTransformation(0).map( m_path->outline() );
......
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