Kaydet (Commit) 9a46b626 authored tarafından Caolán McNamara's avatar Caolán McNamara

fix SvxShowCharSetItem leak

üst 4be58b0b
......@@ -33,6 +33,7 @@
#include <vcl/ctrl.hxx>
#include <vcl/metric.hxx>
#include <vcl/scrbar.hxx>
#include <boost/shared_ptr.hpp>
#include <map>
#include <tools/shl.hxx>
#include "svx/svxdllapi.h"
......@@ -106,7 +107,7 @@ protected:
private:
typedef ::std::map<sal_Int32, ::svx::SvxShowCharSetItem*> ItemsMap;
typedef ::std::map<sal_Int32, boost::shared_ptr<svx::SvxShowCharSetItem> > ItemsMap;
ItemsMap m_aItems;
Link aDoubleClkHdl;
Link aSelectHdl;
......
......@@ -677,7 +677,9 @@ void SvxShowCharSet::ReleaseAccessible()
if ( aFind == m_aItems.end() )
{
OSL_ENSURE(m_pAccessible,"Who wants to create a child of my table without a parent?");
aFind = m_aItems.insert(ItemsMap::value_type(_nPos,new ::svx::SvxShowCharSetItem(*this,m_pAccessible->getTable(),sal::static_int_cast< sal_uInt16 >(_nPos)))).first;
boost::shared_ptr<svx::SvxShowCharSetItem> xItem(new svx::SvxShowCharSetItem(*this,
m_pAccessible->getTable(), sal::static_int_cast< sal_uInt16 >(_nPos)));
aFind = m_aItems.insert(ItemsMap::value_type(_nPos, xItem)).first;
rtl::OUStringBuffer buf;
buf.appendUtf32( maFontCharMap.GetCharFromIndex( _nPos ) );
aFind->second->maText = buf.makeStringAndClear();
......@@ -685,7 +687,7 @@ void SvxShowCharSet::ReleaseAccessible()
aFind->second->maRect = Rectangle( Point( pix.X() + 1, pix.Y() + 1 ), Size(nX-1,nY-1) );
}
return aFind->second;
return aFind->second.get();
}
// -----------------------------------------------------------------------------
......
......@@ -1023,7 +1023,6 @@ std::__cxx1998::vector<OrderedEntry*, std::allocator<OrderedEntry*> >::~vector()
std::__cxx1998::vector<ServiceInfo*, std::allocator<ServiceInfo*> >::~vector()
std::__cxx1998::vector<SfxFilter*, std::allocator<SfxFilter*> >::~vector()
svt::FrameStatusListener::removeStatusListener(rtl::OUString const&)
svx::SvxShowCharSetItem::~SvxShowCharSetItem()
svxform::DataNavigatorManager::GetChildWindowId()
svxform::FmFilterNavigatorWinMgr::GetChildWindowId()
svxform::NavigatorFrameManager::GetChildWindowId()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment