Kaydet (Commit) 1ed9d506 authored tarafından Michael Stahl's avatar Michael Stahl

SfxStyleSheetBasePool::Make: remove nPos parameter

The only caller who could have used a non-default value was
SfxObjectShell::Insert().

Change-Id: I18174a54a9c0246850dc6347d0147e8640ad101d
üst e039978b
......@@ -61,7 +61,7 @@ SfxSimpleHint(SFX_HINT_DYING) from:
SfxStyleSheetHint( SFX_STYLESHEET_CREATED, *p ) from:
SfxStyleSheetBasePool::Make( const String& rName,
SfxStyleFamily eFam, sal_uInt16 mask, sal_uInt16 nPos)
SfxStyleFamily eFam, sal_uInt16 mask)
SfxStyleSheetHint( SFX_STYLESHEET_CHANGED, *pNew ) from:
SfxStyleSheetBasePool::Add( SfxStyleSheetBase& rSheet )
......@@ -234,8 +234,7 @@ public:
virtual SfxStyleSheetBase& Make(const OUString&,
SfxStyleFamily eFam,
sal_uInt16 nMask = SFXSTYLEBIT_ALL ,
sal_uInt16 nPos = 0xffff);
sal_uInt16 nMask = SFXSTYLEBIT_ALL);
virtual void Replace(
SfxStyleSheetBase& rSource, SfxStyleSheetBase& rTarget );
......
......@@ -54,7 +54,7 @@ public:
const OUString* GetForceStdName() const { return pForceStdName; }
virtual SfxStyleSheetBase& Make( const OUString&, SfxStyleFamily eFam,
sal_uInt16 nMask = SFXSTYLEBIT_ALL, sal_uInt16 nPos = 0xffff );
sal_uInt16 nMask = SFXSTYLEBIT_ALL) SAL_OVERRIDE;
protected:
virtual ~ScStyleSheetPool();
......
......@@ -81,7 +81,7 @@ void ScStyleSheetPool::SetDocument( ScDocument* pDocument )
//------------------------------------------------------------------------
SfxStyleSheetBase& ScStyleSheetPool::Make( const OUString& rName,
SfxStyleFamily eFam, sal_uInt16 mask, sal_uInt16 nPos )
SfxStyleFamily eFam, sal_uInt16 mask)
{
// When updating styles from a template, Office 5.1 sometimes created
// files with multiple default styles.
......@@ -98,11 +98,11 @@ SfxStyleSheetBase& ScStyleSheetPool::Make( const OUString& rName,
OUString aNewName = ScGlobal::GetRscString(STR_STYLENAME_STANDARD);
aNewName += OUString::number( nAdd );
if ( Find( aNewName, eFam ) == NULL )
return SfxStyleSheetPool::Make( aNewName, eFam, mask, nPos );
return SfxStyleSheetPool::Make(aNewName, eFam, mask);
}
}
return SfxStyleSheetPool::Make( rName, eFam, mask, nPos );
return SfxStyleSheetPool::Make(rName, eFam, mask);
}
//------------------------------------------------------------------------
......
......@@ -627,27 +627,18 @@ SfxStyleSheetBase* SfxStyleSheetBasePool::Create( const SfxStyleSheetBase& r )
return new SfxStyleSheetBase( r );
}
SfxStyleSheetBase& SfxStyleSheetBasePool::Make( const OUString& rName, SfxStyleFamily eFam, sal_uInt16 mask, sal_uInt16 nPos)
SfxStyleSheetBase& SfxStyleSheetBasePool::Make( const OUString& rName, SfxStyleFamily eFam, sal_uInt16 mask)
{
OSL_ENSURE( eFam != SFX_STYLE_FAMILY_ALL, "svl::SfxStyleSheetBasePool::Make(), FamilyAll is not a allowed Familie" );
SfxStyleSheetIterator aIter(this, eFam, mask);
rtl::Reference< SfxStyleSheetBase > xStyle( aIter.Find( rName ) );
OSL_ENSURE( !xStyle.is(), "svl::SfxStyleSheetBasePool::Make(), StyleSheet already exists" );
SfxStyleSheetIterator& rIter = GetIterator_Impl();
if( !xStyle.is() )
{
xStyle = Create( rName, eFam, mask );
if(0xffff == nPos || nPos == aStyles.size() || nPos == rIter.Count())
{
aStyles.push_back( xStyle );
}
else
{
rIter[nPos];
aStyles.insert( aStyles.begin() + rIter.GetPos(), xStyle );
}
aStyles.push_back(xStyle);
Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_CREATED, *xStyle.get() ) );
}
return *xStyle.get();
......
......@@ -197,7 +197,8 @@ public:
virtual void Replace( SfxStyleSheetBase& rSource,
SfxStyleSheetBase& rTarget );
virtual SfxStyleSheetBase& Make(const OUString&, SfxStyleFamily, sal_uInt16 nMask, sal_uInt16 nPos = 0xffff);
virtual SfxStyleSheetBase& Make(const OUString&, SfxStyleFamily,
sal_uInt16 nMask) SAL_OVERRIDE;
virtual SfxStyleSheetBase* Find( const OUString&, SfxStyleFamily eFam,
sal_uInt16 n=SFXSTYLEBIT_ALL );
......
......@@ -2053,8 +2053,7 @@ void SAL_CALL SwDocStyleSheetPool::release( ) throw ()
SfxStyleSheetBase& SwDocStyleSheetPool::Make( const OUString& rName,
SfxStyleFamily eFam,
sal_uInt16 _nMask,
sal_uInt16 /*nPos*/ )
sal_uInt16 _nMask)
{
mxStyleSheet->PresetName(rName);
mxStyleSheet->PresetParent(aEmptyStr);
......
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