summaryrefslogtreecommitdiff
path: root/sc/source/ui/namedlg/namedlg.cxx
diff options
context:
space:
mode:
authorEike Rathke <erack@erack.de>2011-08-25 01:59:46 +0200
committerEike Rathke <erack@erack.de>2011-08-25 02:03:53 +0200
commit792dee46f2b35a21167af182416803c0b80b517c (patch)
tree7bc758a0e9c09f26e117b859b7c632eb4753d135 /sc/source/ui/namedlg/namedlg.cxx
parent47994ad7f4a1ba2dc158f8bf3c158bc528fb81d1 (diff)
crash when modifying a defined name (and other places as well)
In ScRangeName::insert() the underlying ::boost::ptr_set_adapter::insert(p) takes ownerwhip of p and in the case it can't insert it deletes the object. So, if ScRangeName::insert() returns false the object where p pointed to is gone. Adapted various places.
Diffstat (limited to 'sc/source/ui/namedlg/namedlg.cxx')
-rw-r--r--sc/source/ui/namedlg/namedlg.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx
index 89fd95cc49ba..e42dee1d50f3 100644
--- a/sc/source/ui/namedlg/namedlg.cxx
+++ b/sc/source/ui/namedlg/namedlg.cxx
@@ -388,8 +388,7 @@ bool ScNameDlg::AddPushed()
// in ein Token-Array uebersetzt werden?)
if ( 0 == pNewEntry->GetErrCode() )
{
- rtl::OUString aUpper = aNewEntry;
- aUpper.toAsciiUpperCase();
+ rtl::OUString aUpper( ScGlobal::pCharClass->upper( aNewEntry));
ScRangeData* pData = mpCurRangeName->findByUpperName(aUpper);
if (pData)
{
@@ -400,7 +399,7 @@ bool ScNameDlg::AddPushed()
mpImpl->Clear();
if ( !mpCurRangeName->insert( pNewEntry ) )
- delete pNewEntry;
+ pNewEntry = NULL;
UpdateNames();
bSaved=false;