summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-08-08 00:13:18 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-08-08 13:04:49 +0100
commitcb64bcb4ae4918b4f132c44fa30449bf671f23b1 (patch)
tree953fc87d3dccddb05553093f36a0d6b014d23482 /svl
parent8a3cdcdc5d705b55173b611305e2e088cab75a7d (diff)
callcatcher: ditch some more methods
Diffstat (limited to 'svl')
-rw-r--r--svl/inc/svl/style.hxx3
-rw-r--r--svl/source/items/style.cxx250
2 files changed, 0 insertions, 253 deletions
diff --git a/svl/inc/svl/style.hxx b/svl/inc/svl/style.hxx
index a6f0ca59cb2d..d21897fe3400 100644
--- a/svl/inc/svl/style.hxx
+++ b/svl/inc/svl/style.hxx
@@ -276,9 +276,6 @@ public:
void SetSearchMask(SfxStyleFamily eFam, sal_uInt16 n=0xFFFF );
sal_uInt16 GetSearchMask() const;
SfxStyleFamily GetSearchFamily() const { return nSearchFamily; }
-
- sal_Bool Load( SvStream& );
- sal_Bool Store( SvStream&, sal_Bool bUsed = sal_True );
};
//=========================================================================
diff --git a/svl/source/items/style.cxx b/svl/source/items/style.cxx
index 2bfbfc40b269..d5c04cfa93ee 100644
--- a/svl/source/items/style.cxx
+++ b/svl/source/items/style.cxx
@@ -894,112 +894,6 @@ void SfxStyleSheetBase::Store( SvStream& )
{
}
-
-sal_Bool SfxStyleSheetBasePool::Load( SvStream& rStream )
-{
- // alte Version?
- if ( !rPool.IsVer2_Impl() )
- return Load1_Impl( rStream );
-
- // gesamten StyleSheetPool in neuer Version aus einem MiniRecord lesen
- SfxMiniRecordReader aPoolRec( &rStream, SFX_STYLES_REC );
-
- // Header-Record lesen
- short nCharSet = 0;
- if ( !rStream.GetError() )
- {
- SfxSingleRecordReader aHeaderRec( &rStream, SFX_STYLES_REC_HEADER );
- if ( !aHeaderRec.IsValid() )
- return sal_False;
-
- aAppName = rPool.GetName();
- rStream >> nCharSet;
- }
-
- // Styles-Record lesen
- if ( !rStream.GetError() )
- {
- SfxMultiRecordReader aStylesRec( &rStream, SFX_STYLES_REC_STYLES );
- if ( !aStylesRec.IsValid() )
- return sal_False;
-
- rtl_TextEncoding eEnc = GetSOLoadTextEncoding(
- (rtl_TextEncoding)nCharSet,
- sal::static_int_cast< sal_uInt16 >(rStream.GetVersion()) );
- rtl_TextEncoding eOldEnc = rStream.GetStreamCharSet();
- rStream.SetStreamCharSet( eEnc );
-
- sal_uInt16 nStyles;
- for ( nStyles = 0; aStylesRec.GetContent(); nStyles++ )
- {
- // kann nicht mehr weiterlesen?
- if ( rStream.GetError() )
- break;
-
- // Globale Teile
- XubString aName, aParent, aFollow;
- String aHelpFile;
- sal_uInt16 nFamily, nStyleMask,nCount;
- sal_uInt32 nHelpId;
- rStream.ReadByteString(aName, eEnc );
- rStream.ReadByteString(aParent, eEnc );
- rStream.ReadByteString(aFollow, eEnc );
- rStream >> nFamily >> nStyleMask;
- SfxPoolItem::readByteString(rStream, aHelpFile);
- rStream >> nHelpId;
-
- SfxStyleSheetBase& rSheet = Make( aName, (SfxStyleFamily)nFamily , nStyleMask);
- rSheet.SetHelpId( aHelpFile, nHelpId );
- // Hier erst einmal Parent und Follow zwischenspeichern
- rSheet.aParent = aParent;
- rSheet.aFollow = aFollow;
- sal_uInt32 nPos = rStream.Tell();
- rStream >> nCount;
- if(nCount)
- {
- rStream.Seek( nPos );
- // Das Laden des ItemSets bedient sich der Methode GetItemSet(),
- // damit eigene ItemSets untergeschoben werden koennen
- SfxItemSet& rSet = rSheet.GetItemSet();
- rSet.ClearItem();
- //! SfxItemSet aTmpSet( *pTmpPool );
- /*!aTmpSet*/ rSet.Load( rStream );
- //! rSet.Put( aTmpSet );
- }
- // Lokale Teile
- sal_uInt32 nSize;
- sal_uInt16 nVer;
- rStream >> nVer >> nSize;
- nPos = rStream.Tell() + nSize;
- rSheet.Load( rStream, nVer );
- rStream.Seek( nPos );
- }
-
- // #72939# only loop through the styles that were really inserted
- sal_uLong n = aStyles.size();
-
- //! delete pTmpPool;
- // Jetzt Parent und Follow setzen. Alle Sheets sind geladen.
- // Mit Setxxx() noch einmal den String eintragen, da diese
- // virtuellen Methoden evtl. ueberlagert sind.
- for ( sal_uLong i = 0; i < n; i++ )
- {
- SfxStyleSheetBase* p = aStyles[ i ].get();
- XubString aText = p->aParent;
- p->aParent.Erase();
- p->SetParent( aText );
- aText = p->aFollow;
- p->aFollow.Erase();
- p->SetFollow( aText );
- }
-
- rStream.SetStreamCharSet( eOldEnc );
- }
-
- // alles klar?
- return sal_Bool( rStream.GetError() == SVSTREAM_OK );
-}
-
sal_Bool SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream )
{
aAppName = rPool.GetName();
@@ -1095,150 +989,6 @@ sal_Bool SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream )
return sal_Bool( rStream.GetError() == SVSTREAM_OK );
}
-sal_Bool SfxStyleSheetBasePool::Store( SvStream& rStream, sal_Bool bUsed )
-{
- // den ganzen StyleSheet-Pool in einen Mini-Record
- SfxMiniRecordWriter aPoolRec( &rStream, SFX_STYLES_REC );
-
- // Erst einmal die Dummies rauszaehlen; die werden nicht gespeichert
- sal_uInt16 nCount = 0;
- for( SfxStyleSheetBase* p = First(); p; p = Next() )
- {
- if(!bUsed || p->IsUsed())
- nCount++;
- }
-
- // einen Header-Record vorweg
- rtl_TextEncoding eEnc
- = ::GetSOStoreTextEncoding(
- rStream.GetStreamCharSet(),
- sal::static_int_cast< sal_uInt16 >(rStream.GetVersion()) );
- rtl_TextEncoding eOldEnc = rStream.GetStreamCharSet();
- rStream.SetStreamCharSet( eEnc );
-
- {
- SfxSingleRecordWriter aHeaderRec( &rStream,
- SFX_STYLES_REC_HEADER,
- STYLESTREAM_VERSION );
- rStream << (short) eEnc;
- }
-
- // die StyleSheets in einen MultiVarRecord
- {
- // Bug 79478:
- // make a check loop, to be shure, that the converted names are also
- // unique like the originals! In other cases we get a loop.
- SvStringsSortDtor aSortOrigNames( 0, 128 );
- SvStrings aOrigNames( 0, 128 );
- SvByteStringsSortDtor aSortConvNames( 0, 128 );
- SvByteStrings aConvNames( 0, 128 );
-
- {
-
- for( SfxStyleSheetBase* p = First(); p; p = Next() )
- {
- if(!bUsed || p->IsUsed())
- {
- sal_uInt16 nFamily = (sal_uInt16)p->GetFamily();
- String* pName = new String( p->GetName() );
- ByteString* pConvName = new ByteString( *pName, eEnc );
-
- pName->Insert( (sal_Unicode)nFamily, 0 );
- pConvName->Insert( " ", 0 );
- pConvName->SetChar(
- 0,
- sal::static_int_cast< char >(0xff & (nFamily >> 8)) );
- pConvName->SetChar(
- 1, sal::static_int_cast< char >(0xff & nFamily) );
-
- sal_uInt16 nInsPos, nAdd = aSortConvNames.Count();
- while( !aSortConvNames.Insert( pConvName, nInsPos ) )
- (pConvName->Append( '_' )).Append(ByteString(
- rtl::OString::valueOf(static_cast<sal_Int32>(nAdd++))));
- aOrigNames.Insert( pName, nInsPos );
- }
- }
-
- // now we have the list of the names, sorted by convertede names
- // But now we need the sorted list of orignames.
- {
- sal_uInt16 nInsPos, nEnd = aOrigNames.Count();
- const ByteStringPtr* ppB = aSortConvNames.GetData();
- for( sal_uInt16 n = 0; n < nEnd; ++n, ++ppB )
- {
- String* p = aOrigNames.GetObject( n );
- aSortOrigNames.Insert( p, nInsPos );
- aConvNames.Insert( *ppB, nInsPos );
- }
-
- }
- }
-
-
- ByteString sEmpty;
- sal_uInt16 nFndPos;
- String sNm;
- SfxMultiVarRecordWriter aStylesRec( &rStream, SFX_STYLES_REC_STYLES, 0 );
- for( SfxStyleSheetBase* p = First(); p; p = Next() )
- {
- if(!bUsed || p->IsUsed())
- {
- aStylesRec.NewContent();
-
- // Globale Teile speichern
- String aHelpFile;
- sal_uInt32 nHelpId = p->GetHelpId( aHelpFile );
- sal_uInt16 nFamily = sal::static_int_cast< sal_uInt16 >(p->GetFamily());
- String sFamily( (sal_Unicode)nFamily );
-
- (sNm = sFamily) += p->GetName();
- if( aSortOrigNames.Seek_Entry( &sNm, &nFndPos ))
- rStream.WriteByteString( aConvNames.GetObject( nFndPos )->Copy( 2 ));
- else
- rStream.WriteByteString( sEmpty );
-
- (sNm = sFamily) += p->GetParent();
- if( aSortOrigNames.Seek_Entry( &sNm, &nFndPos ))
- rStream.WriteByteString( aConvNames.GetObject( nFndPos )->Copy( 2 ));
- else
- rStream.WriteByteString( sEmpty );
-
- (sNm = sFamily) += p->GetFollow();
- if( aSortOrigNames.Seek_Entry( &sNm, &nFndPos ))
- rStream.WriteByteString( aConvNames.GetObject( nFndPos )->Copy( 2 ));
- else
- rStream.WriteByteString( sEmpty );
-
- rStream << nFamily << p->GetMask();
- SfxPoolItem::writeByteString(rStream, aHelpFile);
- rStream << nHelpId;
- if(p->pSet)
- p->pSet->Store( rStream );
- else
- rStream << (sal_uInt16)0;
-
- // Lokale Teile speichern
- // Vor dem lokalen Teil wird die Laenge der lokalen Daten
- // als sal_uInt32 sowie die Versionsnummer gespeichert.
- rStream << (sal_uInt16) p->GetVersion();
- sal_uLong nPos1 = rStream.Tell();
- rStream << (sal_uInt32) 0;
- p->Store( rStream );
- sal_uLong nPos2 = rStream.Tell();
- rStream.Seek( nPos1 );
- rStream << (sal_uInt32) ( nPos2 - nPos1 - sizeof( sal_uInt32 ) );
- rStream.Seek( nPos2 );
- if( rStream.GetError() != SVSTREAM_OK )
- break;
- }
- }
- }
-
- rStream.SetStreamCharSet( eOldEnc );
-
- return sal_Bool( rStream.GetError() == SVSTREAM_OK );
-}
-
SfxItemPool& SfxStyleSheetBasePool::GetPool()
{
return rPool;