Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


This patch fix a code i ommited in a previous commit
674c10b068d27d5ebdb25458d31dd8a61b343eb6, also should be included in 3.4.1
From 0db0ac817dd9bcc30d6a60fec93ac58aafdee416 Mon Sep 17 00:00:00 2001
From: Rafael Dominguez <venccsralph@gmail.com>
Date: Wed, 18 May 2011 12:26:13 -0430
Subject: [PATCH 1/6] Fix wrong refactoring of CloneList.

Amending commit 674c10b068d27d5ebdb25458d31dd8a61b343eb6.
---
 svx/source/svdraw/clonelist.cxx |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)

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);
                 }
             }
         }
-- 
1.7.3.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.