I started out trying to fix fdo 42778 and noticed that my initial description of the problem was a bit to narrow. It wasn't just the pass count that wasn't stored correctly but the breakpoints all together. In worst case it makes the program crash. This fix, stores the values. I'm not that experienced with C++ so could someone have a second look at this there might very well be a "cleaner" way of writing it.

After building it with the fix, Manage Breakpoints works almost as expected on my machine. If you set the pass count to 1 it stops at the first 2 stops at the second. 1 should pass one and stop the second time. I'll try to fix this in another patch though.

--
Niklas Johansson

>From b8a0ad0320fb0e36276afae1e861b5da189153b6 Mon Sep 17 00:00:00 2001
From: Niklas Johansson <sleeping.pil...@gmail.com>
Date: Mon, 28 Nov 2011 11:40:30 +0100
Subject: [PATCH] Fixes BreakPointManager

Earlier when pressing ok in the breakpoint manager the breakpoints
wasn't getting stored. The pointer address was stored but the
breakpoint object was destroyed, leaving you with random values.
---
 basctl/source/basicide/bastypes.cxx |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/basctl/source/basicide/bastypes.cxx 
b/basctl/source/basicide/bastypes.cxx
index 10310ec..058e6ba 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -288,7 +288,7 @@ void BreakPointList::transfer(BreakPointList & rList)
 {
     reset();
     for (size_t i = 0; i < rList.size(); ++i)
-        maBreakPoints.push_back( rList.at( i ) );
+        maBreakPoints.push_back( new BreakPoint(*rList.at( i )) );
     rList.reset();
 }
 
-- 
1.7.5.4

_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to