Kaydet (Commit) 19f64ccc authored tarafından Michael Stahl's avatar Michael Stahl

chart2: replace boost::ptr_map with std::map

Change-Id: I07a8b2eaa11ca29e3303d323060c3a4c52823967
üst f46327e6
......@@ -38,7 +38,6 @@
#include <vector>
#include <boost/checked_delete.hpp>
#include <boost/intrusive_ptr.hpp>
#include <boost/ptr_container/ptr_map.hpp>
#include <osl/conditn.hxx>
#include <osl/diagnose.h>
#include <osl/doublecheckedlocking.h>
......
......@@ -17,9 +17,10 @@
#include <vcl/opengl/OpenGLContext.hxx>
#include "GL3DRenderer.hxx"
#include <boost/ptr_container/ptr_map.hpp>
#include <boost/shared_array.hpp>
#include <map>
namespace chart {
namespace opengl3D {
......@@ -39,9 +40,9 @@ class TextCache
public:
const TextCacheItem &getText(OUString const & rText, bool bIs3dText = false);
private:
typedef boost::ptr_map<OUString const, TextCacheItem> TextCacheType;
typedef std::map<OUString const, TextCacheItem> TextCacheType;
TextCacheType maTextCache;
TextCacheType m_TextCache;
};
class Renderable3DObject
......
......@@ -72,9 +72,9 @@ void Line::setLineColor(const Color& rColor)
const TextCacheItem& TextCache::getText(OUString const & rText, bool bIs3dText)
{
TextCacheType::const_iterator itr = maTextCache.find(rText);
if(itr != maTextCache.end())
return *itr->second;
TextCacheType::const_iterator const itr = m_TextCache.find(rText);
if (itr != m_TextCache.end())
return itr->second;
ScopedVclPtrInstance< VirtualDevice > pDevice(*Application::GetDefaultDevice(),
DeviceFormat::DEFAULT, DeviceFormat::DEFAULT);
......@@ -105,10 +105,9 @@ const TextCacheItem& TextCache::getText(OUString const & rText, bool bIs3dText)
long nBmpHeight = aText.GetSizePixel().Height();
sal_uInt8* pBitmapBuf(new sal_uInt8[3* nBmpWidth * nBmpHeight]);
memcpy(pBitmapBuf, buf, 3* nBmpWidth * nBmpHeight);
TextCacheItem *pItem = new TextCacheItem(pBitmapBuf, aText.GetSizePixel());
maTextCache.insert(rText, pItem);
m_TextCache.insert(std::make_pair(rText, TextCacheItem(pBitmapBuf, aText.GetSizePixel())));
Bitmap::ReleaseAccess(pAcc);
return *maTextCache.find(rText)->second;
return m_TextCache.find(rText)->second;
}
Text::Text(OpenGL3DRenderer* pRenderer, TextCache& rTextCache, const OUString& rStr, sal_uInt32 nId):
......
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