diff options
author | Kai Ahrens <ka@openoffice.org> | 2001-10-22 12:23:46 +0000 |
---|---|---|
committer | Kai Ahrens <ka@openoffice.org> | 2001-10-22 12:23:46 +0000 |
commit | 60b90a3701c4d6d1f8e1e6e49d1a75d9bb918127 (patch) | |
tree | 2fdb964d982c1ee4a463d92e971aae94cccd4966 | |
parent | 6b12e6885635cb6345e454282ae31674f3a2aae4 (diff) |
#93567#: use persist name of OLE objects as object name if no object name is set
-rw-r--r-- | sd/source/ui/dlg/sdtreelb.cxx | 46 | ||||
-rw-r--r-- | sd/source/ui/inc/sdtreelb.hxx | 8 |
2 files changed, 43 insertions, 11 deletions
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx index 89365d3c744b..bdd283f84c58 100644 --- a/sd/source/ui/dlg/sdtreelb.cxx +++ b/sd/source/ui/dlg/sdtreelb.cxx @@ -2,9 +2,9 @@ * * $RCSfile: sdtreelb.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: thb $ $Date: 2001-10-18 14:42:07 $ + * last change: $Author: ka $ $Date: 2001-10-22 13:23:46 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -81,6 +81,9 @@ #ifndef _SOT_FORMATS_HXX //autogen #include <sot/formats.hxx> #endif +#ifndef _SVDOOLE2_HXX //autogen +#include <svx/svdoole2.hxx> +#endif #include "strmname.h" #include "sdtreelb.hxx" @@ -172,6 +175,27 @@ SdPageObjsTLB::~SdPageObjsTLB() /************************************************************************* |* +|* return name of object +|* +\************************************************************************/ + +String SdPageObjsTLB::GetObjectName( const SdrObject* pObj ) const +{ + String aRet; + + if( pObj ) + { + aRet = pObj->GetName(); + + if( !aRet.Len() && pObj->ISA( SdrOle2Obj ) ) + aRet = static_cast< const SdrOle2Obj* >( pObj )->GetPersistName(); + } + + return aRet; +} + +/************************************************************************* +|* |* In TreeLB Eintrag selektieren |* \************************************************************************/ @@ -287,7 +311,7 @@ void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, BOOL bAllPages, while( aIter.IsMore() ) { pObj = aIter.Next(); - String aStr( pObj->GetName() ); + String aStr( GetObjectName( pObj ) ); if( aStr.Len() ) { if( pObj->GetObjInventor() == SdrInventor && @@ -325,7 +349,7 @@ void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, BOOL bAllPages, while( aIter.IsMore() ) { pObj = aIter.Next(); - String aStr( pObj->GetName() ); + String aStr( GetObjectName( pObj ) ); if( aStr.Len() ) { if( pObj->GetObjInventor() == SdrInventor && @@ -423,13 +447,17 @@ BOOL SdPageObjsTLB::IsEqualToDoc( const SdDrawDocument* pInDoc ) while( aIter.IsMore() ) { pObj = aIter.Next(); - if( pObj->GetName().Len() ) + + const String aObjectName( GetObjectName( pObj ) ); + + if( aObjectName.Len() ) { if( !pEntry ) return( FALSE ); + aName = GetEntryText( pEntry ); - if( pObj->GetName() != aName ) + if( aObjectName != aName ) return( FALSE ); pEntry = Next( pEntry ); @@ -521,7 +549,7 @@ List* SdPageObjsTLB::GetBookmarkList( USHORT nType ) while( aIter.IsMore() ) { SdrObject* pObj = aIter.Next(); - String aStr( pObj->GetName() ); + String aStr( GetObjectName( pObj ) ); if( aStr.Len() ) { if( !pList ) @@ -544,7 +572,7 @@ List* SdPageObjsTLB::GetBookmarkList( USHORT nType ) |* \************************************************************************/ -void __EXPORT SdPageObjsTLB::RequestingChilds( SvLBoxEntry* pFileEntry ) +void SdPageObjsTLB::RequestingChilds( SvLBoxEntry* pFileEntry ) { if( !pFileEntry->HasChilds() ) { @@ -579,7 +607,7 @@ void __EXPORT SdPageObjsTLB::RequestingChilds( SvLBoxEntry* pFileEntry ) while( aIter.IsMore() ) { pObj = aIter.Next(); - String aStr( pObj->GetName() ); + String aStr( GetObjectName( pObj ) ); if( aStr.Len() ) { if( pObj->GetObjInventor() == SdrInventor && diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx index 9dd9e2e9e6b5..6c08b06725af 100644 --- a/sd/source/ui/inc/sdtreelb.hxx +++ b/sd/source/ui/inc/sdtreelb.hxx @@ -2,9 +2,9 @@ * * $RCSfile: sdtreelb.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: ka $ $Date: 2001-04-04 16:37:40 $ + * last change: $Author: ka $ $Date: 2001-10-22 13:22:56 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -92,6 +92,7 @@ class SdDrawDocument; class SfxMedium; class SfxViewFrame; class SdNavigatorWin; +class SdrObject; /************************************************************************* |* @@ -156,9 +157,12 @@ protected: virtual sal_Int8 ExecuteDrop( const ExecuteDropEvent& rEvt ); virtual void RequestingChilds( SvLBoxEntry* pParent ); + void DoDrag(); void DragFinished( sal_uInt8 nDropAction ); + String GetObjectName( const SdrObject* pObj ) const; + DECL_STATIC_LINK(SdPageObjsTLB, ExecDragHdl, void*); public: |