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