diff options
author | Ivan Timofeev <timofeev.i.s@gmail.com> | 2013-07-29 21:43:59 +0400 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-07-29 19:54:44 +0000 |
commit | 2f527be5513159c0aebd93f356cbd2b1dc04b253 (patch) | |
tree | 499cda7b327d53c8985b3c99325cfad6097935ed /sw/source/ui/table | |
parent | 072fd39d7ab9837a2f9d93ad080077553d33f289 (diff) |
fdo#67467: fix crash when renaming table in AutoFormat dialog
this reverts 5031e17d4b11181be94448702b1026bd38e0b3c4 and uses
ptr_vector::release instead of ptr_vector::erase to prevent object deletion.
The use of "transfer" leads to "Assertion `(void*)&from != (void*)this' failed".
Change-Id: I77467ce9e1d9dd4b833032ebbe920cbb34d36675
Reviewed-on: https://gerrit.libreoffice.org/5172
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'sw/source/ui/table')
-rw-r--r-- | sw/source/ui/table/tautofmt.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx index 4300b0dafea4..2b4d1cfa1287 100644 --- a/sw/source/ui/table/tautofmt.cxx +++ b/sw/source/ui/table/tautofmt.cxx @@ -409,19 +409,18 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, RenameHdl) { // no format with this name exists, so rename it m_pLbFormat->RemoveEntry( nDfltStylePos + nIndex ); - SwTableAutoFmt* p = &(*pTableTbl)[ nIndex ]; + SwTableAutoFmt* p = pTableTbl->ReleaseAutoFmt( nIndex ); p->SetName( aFormatName ); // keep all arrays sorted! for( n = 1; n < pTableTbl->size(); ++n ) - if ((n != nIndex) && - ((*pTableTbl)[n].GetName() > aFormatName)) + if ((*pTableTbl)[n].GetName() > aFormatName) { break; } - pTableTbl->MoveAutoFmt(n, nIndex); + pTableTbl->InsertAutoFmt( n, p ); m_pLbFormat->InsertEntry( aFormatName, nDfltStylePos + n ); m_pLbFormat->SelectEntryPos( nDfltStylePos + n ); |