Commits

Philipp Lohmann [pl]  committed 801bd52

vcl122: #117746# remove unused GDIMetaFile functionality (labels, CopyAction, SaveStatus)

  • Participants
  • Parent commits 34d9e18

Comments (0)

Files changed (2)

File vcl/inc/vcl/gdimtf.hxx

 #include <vcl/mapmod.hxx>
 
 class OutputDevice;
-class ImpLabelList;
 class MetaAction;
 class SvStream;
 class Color;
     GDIMetaFile*    pPrev;
     GDIMetaFile*    pNext;
     OutputDevice*   pOutDev;
-    ImpLabelList*   pLabelList;
     sal_Bool            bPause;
     sal_Bool            bRecord;
 
     void            AddAction( MetaAction* pAction );
     void            AddAction( MetaAction* pAction, sal_uLong nPos );
     void 			RemoveAction( sal_uLong nPos );
-    MetaAction*     CopyAction( sal_uLong nPos ) const;
     MetaAction*     GetCurAction() const { return (MetaAction*) GetCurObject(); }
     MetaAction*     GetAction( sal_uLong nAction ) const { return (MetaAction*) GetObject( nAction ); }
     MetaAction*     FirstAction() {	return (MetaAction*) First(); }
     MetaAction*     NextAction() { 	return (MetaAction*) Next(); }
     MetaAction*     ReplaceAction( MetaAction* pAction, sal_uLong nAction ) { return (MetaAction*) Replace( pAction, nAction ); }
 
-    sal_uLong           GetActionPos( const String& rLabel );
-    sal_Bool            InsertLabel( const String& rLabel, sal_uLong nActionPos );
-    void            RemoveLabel( const String& rLabel );
-    void            RenameLabel( const String& rLabel, const String& rNewLabel );
-    sal_uLong           GetLabelCount() const;
-    String          GetLabel( sal_uLong nLabel );
-
-    sal_Bool            SaveStatus();
-
     const Size&     GetPrefSize() const { return aPrefSize; }
     void            SetPrefSize( const Size& rSize ) { aPrefSize = rSize; }
 

File vcl/source/gdi/gdimtf.cxx

 };
 
 
-// ---------
-// - Label -
-// ---------
-
-struct ImpLabel
-{
-	String	aLabelName;
-	sal_uLong	nActionPos;
-
-			ImpLabel( const String& rLabelName, sal_uLong _nActionPos ) :
-				aLabelName( rLabelName ),
-				nActionPos( _nActionPos ) {}
-};
-
-// -------------
-// - LabelList -
-// -------------
-
-class ImpLabelList : private List
-{
-public:
-
-				ImpLabelList() : List( 8, 4, 4 ) {}
-				ImpLabelList( const ImpLabelList& rList );
-				~ImpLabelList();
-
-	void		ImplInsert( ImpLabel* p ) { Insert( p, LIST_APPEND ); }
-	ImpLabel*	ImplRemove( sal_uLong nPos ) { return (ImpLabel*) Remove( nPos ); }
-	void		ImplReplace( ImpLabel* p ) { Replace( (void*)p ); }
-	ImpLabel*	ImplFirst() { return (ImpLabel*) First(); }
-	ImpLabel*	ImplNext() { return (ImpLabel*) Next(); }
-	ImpLabel*	ImplGetLabel( sal_uLong nPos ) const { return (ImpLabel*) GetObject( nPos ); }
-	sal_uLong		ImplGetLabelPos( const String& rLabelName );
-	sal_uLong		ImplCount() const { return Count(); }
-};
-
-// ------------------------------------------------------------------------
-
-ImpLabelList::ImpLabelList( const ImpLabelList& rList ) :
-		List( rList )
-{
-	for( ImpLabel* pLabel = ImplFirst(); pLabel; pLabel = ImplNext() )
-		ImplReplace( new ImpLabel( *pLabel ) );
-}
-
-// ------------------------------------------------------------------------
-
-ImpLabelList::~ImpLabelList()
-{
-	for( ImpLabel* pLabel = ImplFirst(); pLabel; pLabel = ImplNext() )
-		delete pLabel;
-}
-
-// ------------------------------------------------------------------------
-
-sal_uLong ImpLabelList::ImplGetLabelPos( const String& rLabelName )
-{
-	sal_uLong nLabelPos = METAFILE_LABEL_NOTFOUND;
-
-	for( ImpLabel* pLabel = ImplFirst(); pLabel; pLabel = ImplNext() )
-	{
-		if ( rLabelName == pLabel->aLabelName )
-		{
-			nLabelPos = GetCurPos();
-			break;
-		}
-	}
-
-	return nLabelPos;
-}
-
 // ---------------
 // - GDIMetaFile -
 // ---------------
 	pPrev		( NULL ),
 	pNext		( NULL ),
 	pOutDev 	( NULL ),
-	pLabelList	( NULL ),
 	bPause		( sal_False ),
 	bRecord 	( sal_False )
 {
 	for( void* pAct = First(); pAct; pAct = Next() )
 		( (MetaAction*) pAct )->Duplicate();
 
-	if( rMtf.pLabelList )
-		pLabelList = new ImpLabelList( *rMtf.pLabelList );
-	else
-		pLabelList = NULL;
-
 	if( rMtf.bRecord )
 	{
 		Record( rMtf.pOutDev );
 		for( void* pAct = First(); pAct; pAct = Next() )
 			( (MetaAction*) pAct )->Duplicate();
 
-		if( rMtf.pLabelList )
-			pLabelList = new ImpLabelList( *rMtf.pLabelList );
-		else
-		   pLabelList = NULL;
-
 		aPrefMapMode = rMtf.aPrefMapMode;
 		aPrefSize = rMtf.aPrefSize;
 		aHookHdlLink = rMtf.aHookHdlLink;
 		( (MetaAction*) pAct )->Delete();
 
 	List::Clear();
-
-	delete pLabelList;
-	pLabelList = NULL;
 }
 
 // ------------------------------------------------------------------------
 
 // ------------------------------------------------------------------------
 
-MetaAction* GDIMetaFile::CopyAction( sal_uLong nPos ) const
-{
-	return ( (MetaAction*) GetObject( nPos ) )->Clone();
-}
-
-// ------------------------------------------------------------------------
-
-sal_uLong GDIMetaFile::GetActionPos( const String& rLabel )
-{
-	ImpLabel* pLabel = NULL;
-
-	if( pLabelList )
-		pLabel = pLabelList->ImplGetLabel( pLabelList->ImplGetLabelPos( rLabel ) );
-	else
-		pLabel = NULL;
-
-	return( pLabel ? pLabel->nActionPos : METAFILE_LABEL_NOTFOUND );
-}
-
-// ------------------------------------------------------------------------
-
-sal_Bool GDIMetaFile::InsertLabel( const String& rLabel, sal_uLong nActionPos )
-{
-	sal_Bool bRet = sal_False;
-
-	if( !pLabelList )
-		pLabelList = new ImpLabelList;
-
-	if( pLabelList->ImplGetLabelPos( rLabel ) == METAFILE_LABEL_NOTFOUND )
-	{
-		pLabelList->ImplInsert( new ImpLabel( rLabel, nActionPos ) );
-		bRet = sal_True;
-	}
-
-	return bRet;
-}
-
-// ------------------------------------------------------------------------
-
-void GDIMetaFile::RemoveLabel( const String& rLabel )
-{
-	if( pLabelList )
-	{
-		const sal_uLong nLabelPos = pLabelList->ImplGetLabelPos( rLabel );
-
-		if( nLabelPos != METAFILE_LABEL_NOTFOUND )
-			delete pLabelList->ImplRemove( nLabelPos );
-	}
-}
-
-// ------------------------------------------------------------------------
-
-void GDIMetaFile::RenameLabel( const String& rLabel, const String& rNewLabel )
-{
-	if( pLabelList )
-	{
-		const sal_uLong nLabelPos = pLabelList->ImplGetLabelPos( rLabel );
-
-		if ( nLabelPos != METAFILE_LABEL_NOTFOUND )
-			pLabelList->ImplGetLabel( nLabelPos )->aLabelName = rNewLabel;
-	}
-}
-
-// ------------------------------------------------------------------------
-
-sal_uLong GDIMetaFile::GetLabelCount() const
-{
-	return( pLabelList ? pLabelList->ImplCount() : 0UL );
-}
-
-// ------------------------------------------------------------------------
-
-String GDIMetaFile::GetLabel( sal_uLong nLabel )
-{
-	String aString;
-
-	if( pLabelList )
-	{
-		const ImpLabel* pLabel = pLabelList->ImplGetLabel( nLabel );
-
-		if( pLabel )
-			aString = pLabel->aLabelName;
-	}
-
-	return aString;
-}
-
-// ------------------------------------------------------------------------
-
-sal_Bool GDIMetaFile::SaveStatus()
-{
-	if ( bRecord )
-	{
-		if ( bPause )
-			Linker( pOutDev, sal_True );
-
-		AddAction( new MetaLineColorAction( pOutDev->GetLineColor(),
-											pOutDev->IsLineColor() ) );
-		AddAction( new MetaFillColorAction( pOutDev->GetFillColor(),
-											pOutDev->IsFillColor() ) );
-		AddAction( new MetaFontAction( pOutDev->GetFont() ) );
-		AddAction( new MetaTextColorAction( pOutDev->GetTextColor() ) );
-		AddAction( new MetaTextFillColorAction( pOutDev->GetTextFillColor(),
-												pOutDev->IsTextFillColor() ) );
-		AddAction( new MetaTextLineColorAction( pOutDev->GetTextLineColor(),
-												pOutDev->IsTextLineColor() ) );
-		AddAction( new MetaOverlineColorAction( pOutDev->GetOverlineColor(),
-												pOutDev->IsOverlineColor() ) );
-		AddAction( new MetaTextAlignAction( pOutDev->GetTextAlign() ) );
-		AddAction( new MetaRasterOpAction( pOutDev->GetRasterOp() ) );
-		AddAction( new MetaMapModeAction( pOutDev->GetMapMode() ) );
-		AddAction( new MetaClipRegionAction( pOutDev->GetClipRegion(),
-											 pOutDev->IsClipRegion() ) );
-
-		if ( bPause )
-			Linker( pOutDev, sal_False );
-
-		return sal_True;
-	}
-	else
-		return sal_False;
-}
-
-// ------------------------------------------------------------------------
-
 sal_Bool GDIMetaFile::Mirror( sal_uLong nMirrorFlags )
 {
 	const Size	aOldPrefSize( GetPrefSize() );