Kaydet (Commit) e4f55865 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

This cache data member is never used. Remove it.

Change-Id: I03d55ce8cfe175a75ed22639a06ac22c8783ccd7
üst ef60854f
......@@ -28,9 +28,9 @@ XMLFamilyData_Impl::XMLFamilyData_Impl(
const OUString& rStrName,
const UniReference < SvXMLExportPropertyMapper > &rMapper,
const OUString& rStrPrefix,
sal_Bool bAsFam )
: pCache( 0 ), mnFamily( nFamily ), maStrFamilyName( rStrName), mxMapper( rMapper ),
mnCount( 0 ), mnName( 0 ), maStrPrefix( rStrPrefix ), bAsFamily( bAsFam )
sal_Bool bAsFam ) :
mnFamily( nFamily ), maStrFamilyName( rStrName), mxMapper( rMapper ),
mnCount( 0 ), mnName( 0 ), maStrPrefix( rStrPrefix ), bAsFamily( bAsFam )
{
mpParentList = new SvXMLAutoStylePoolParentsP_Impl;
......@@ -41,27 +41,12 @@ XMLFamilyData_Impl::~XMLFamilyData_Impl()
{
delete mpParentList;
delete mpNameList;
DBG_ASSERT( !pCache || !pCache->size(), "auto style pool cache is not empty!" );
if( pCache )
{
for ( size_t i = 0, n = pCache->size(); i < n; ++i )
delete (*pCache)[ i ];
pCache->clear();
delete pCache;
}
}
void XMLFamilyData_Impl::ClearEntries()
{
delete mpParentList;
mpParentList = new SvXMLAutoStylePoolParentsP_Impl;
DBG_ASSERT( !pCache || !pCache->size(), "auto style pool cache is not empty!" );
if( pCache )
{
for ( size_t i = 0, n = pCache->size(); i < n; ++i )
delete (*pCache)[ i ];
pCache->clear();
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -148,13 +148,11 @@ void SvXMLAutoStylePoolP_Impl::GetRegisteredNames(
// Adds a array of XMLPropertyState ( vector< XMLPropertyState > ) to list
// if not added, yet.
sal_Bool SvXMLAutoStylePoolP_Impl::Add(OUString& rName, sal_Int32 nFamily,
const OUString& rParent,
const ::std::vector< XMLPropertyState >& rProperties,
sal_Bool bCache,
bool bDontSeek )
bool SvXMLAutoStylePoolP_Impl::Add(
OUString& rName, sal_Int32 nFamily, const OUString& rParent,
const ::std::vector< XMLPropertyState >& rProperties, bool bDontSeek )
{
sal_Bool bRet(sal_False);
bool bRet = false;
XMLFamilyData_Impl aTemporary( nFamily );
FamilyListType::iterator aFind = maFamilyList.find(aTemporary);
......@@ -183,15 +181,7 @@ sal_Bool SvXMLAutoStylePoolP_Impl::Add(OUString& rName, sal_Int32 nFamily,
if( pParent->Add( rFamily, rProperties, rName, bDontSeek ) )
{
rFamily.mnCount++;
bRet = sal_True;
}
if( bCache )
{
if( !rFamily.pCache )
rFamily.pCache = new SvXMLAutoStylePoolCache_Impl();
if( rFamily.pCache->size() < MAX_CACHE_SIZE )
rFamily.pCache->push_back( new OUString( rName ) );
bRet = true;
}
}
......
......@@ -42,13 +42,9 @@ class SvXMLExport;
// Implementationclass for stylefamily-information
typedef OUString* OUStringPtr;
typedef ::std::vector< OUStringPtr > SvXMLAutoStylePoolCache_Impl;
class XMLFamilyData_Impl
{
public:
SvXMLAutoStylePoolCache_Impl *pCache;
sal_uInt32 mnFamily;
OUString maStrFamilyName;
UniReference < SvXMLExportPropertyMapper > mxMapper;
......@@ -66,7 +62,6 @@ public:
const OUString& rStrPrefix, sal_Bool bAsFamily = sal_True );
XMLFamilyData_Impl( sal_Int32 nFamily ) :
pCache( 0 ),
mnFamily( nFamily ), mpParentList( NULL ),
mpNameList( NULL ), mnCount( 0 ), mnName( 0 ),
bAsFamily( false )
......@@ -174,11 +169,12 @@ public:
com::sun::star::uno::Sequence<sal_Int32>& aFamilies,
com::sun::star::uno::Sequence<OUString>& aNames );
sal_Bool Add( OUString& rName, sal_Int32 nFamily,
const OUString& rParent,
const ::std::vector< XMLPropertyState >& rProperties,
sal_Bool bCache = sal_False,
bool bDontSeek = false );
bool Add(
OUString& rName, sal_Int32 nFamily,
const OUString& rParent,
const ::std::vector< XMLPropertyState >& rProperties,
bool bDontSeek = false );
sal_Bool AddNamed( const OUString& rName, sal_Int32 nFamily,
const OUString& rParent,
const ::std::vector< XMLPropertyState >& rProperties );
......
......@@ -346,7 +346,7 @@ OUString SvXMLAutoStylePoolP::Add( sal_Int32 nFamily,
const vector< XMLPropertyState >& rProperties, bool bDontSeek )
{
OUString sName;
pImpl->Add(sName, nFamily, rParent, rProperties, sal_False, bDontSeek );
pImpl->Add(sName, nFamily, rParent, rProperties, bDontSeek);
return sName;
}
......
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