[Libreoffice-commits] .: Branch 'libreoffice-3-4' - svx/source
Petr Mladek
pmladek at kemper.freedesktop.org
Mon Jun 6 09:41:35 PDT 2011
svx/source/svdraw/clonelist.cxx | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
New commits:
commit 48c400e4fb0778bde199ca771f1ee2586c55a0ff
Author: Rafael Dominguez <venccsralph at gmail.com>
Date: Thu May 26 22:37:28 2011 -0700
Fix bug in CloneList
Signed-off-by: Petr Mladek <pmladek at suse.cz>
diff --git a/svx/source/svdraw/clonelist.cxx b/svx/source/svdraw/clonelist.cxx
index a39bb2f..a14d469 100644
--- a/svx/source/svdraw/clonelist.cxx
+++ b/svx/source/svdraw/clonelist.cxx
@@ -85,6 +85,8 @@ SdrObject* CloneList::GetClone(sal_uInt32 nIndex) const
void CloneList::CopyConnections() const
{
+ sal_uInt32 cloneCount = maCloneList.size();
+
for(sal_uInt32 a = 0; a < maOriginalList.size(); a++)
{
const SdrEdgeObj* pOriginalEdge = PTR_CAST(SdrEdgeObj, GetOriginal(a));
@@ -101,10 +103,17 @@ void CloneList::CopyConnections() const
maOriginalList.end(),
pOriginalNode1);
+ sal_uInt32 nPos = it - maOriginalList.begin();
+
if(it != maOriginalList.end())
{
- if(pOriginalEdge->GetConnectedNode(sal_True) != *it)
- pCloneEdge->ConnectToNode(sal_True, const_cast<SdrObject*>(*it));
+ SdrObject *cObj = NULL;
+
+ if (nPos < cloneCount)
+ cObj = GetClone(nPos);
+
+ if(pOriginalEdge->GetConnectedNode(sal_True) != cObj)
+ pCloneEdge->ConnectToNode(sal_True, cObj);
}
}
@@ -114,10 +123,17 @@ void CloneList::CopyConnections() const
maOriginalList.end(),
pOriginalNode2);
+ sal_uInt32 nPos = it - maOriginalList.begin();
+
if(it != maOriginalList.end())
{
- if(pOriginalEdge->GetConnectedNode(sal_True) != *it)
- pCloneEdge->ConnectToNode(sal_True, const_cast<SdrObject*>(*it));
+ SdrObject *cObj = NULL;
+
+ if (nPos < cloneCount)
+ cObj = GetClone(nPos);
+
+ if(pOriginalEdge->GetConnectedNode(sal_False) != cObj)
+ pCloneEdge->ConnectToNode(sal_False, cObj);
}
}
}
More information about the Libreoffice-commits
mailing list