2000-09-18 16:07:07 +00:00
|
|
|
|
/*************************************************************************
|
|
|
|
|
*
|
2005-09-09 03:21:10 +00:00
|
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 16:07:07 +00:00
|
|
|
|
*
|
2005-09-09 03:21:10 +00:00
|
|
|
|
* $RCSfile: sdtreelb.cxx,v $
|
2000-09-18 16:07:07 +00:00
|
|
|
|
*
|
2005-09-09 03:21:10 +00:00
|
|
|
|
* $Revision: 1.23 $
|
2000-09-18 16:07:07 +00:00
|
|
|
|
*
|
2005-09-09 03:21:10 +00:00
|
|
|
|
* last change: $Author: rt $ $Date: 2005-09-09 04:21:10 $
|
2000-09-18 16:07:07 +00:00
|
|
|
|
*
|
2005-09-09 03:21:10 +00:00
|
|
|
|
* The Contents of this file are made available subject to
|
|
|
|
|
* the terms of GNU Lesser General Public License Version 2.1.
|
2000-09-18 16:07:07 +00:00
|
|
|
|
*
|
|
|
|
|
*
|
2005-09-09 03:21:10 +00:00
|
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
|
* =============================================
|
|
|
|
|
* Copyright 2005 by Sun Microsystems, Inc.
|
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
2000-09-18 16:07:07 +00:00
|
|
|
|
*
|
2005-09-09 03:21:10 +00:00
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
|
* License version 2.1, as published by the Free Software Foundation.
|
2000-09-18 16:07:07 +00:00
|
|
|
|
*
|
2005-09-09 03:21:10 +00:00
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
* Lesser General Public License for more details.
|
2000-09-18 16:07:07 +00:00
|
|
|
|
*
|
2005-09-09 03:21:10 +00:00
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
|
* MA 02111-1307 USA
|
2000-09-18 16:07:07 +00:00
|
|
|
|
*
|
|
|
|
|
************************************************************************/
|
|
|
|
|
|
2004-01-20 09:49:39 +00:00
|
|
|
|
#ifndef _SOT_FORMATS_HXX
|
2002-12-11 13:54:59 +00:00
|
|
|
|
#include <sot/formats.hxx>
|
|
|
|
|
#endif
|
2004-10-04 17:23:10 +00:00
|
|
|
|
#include <sot/storage.hxx>
|
2004-01-20 09:49:39 +00:00
|
|
|
|
#ifndef _SV_MSGBOX_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
|
#include <vcl/msgbox.hxx>
|
|
|
|
|
#endif
|
2002-12-11 13:54:59 +00:00
|
|
|
|
#ifndef SVTOOLS_URIHELPER_HXX
|
|
|
|
|
#include <svtools/urihelper.hxx>
|
|
|
|
|
#endif
|
2004-01-20 09:49:39 +00:00
|
|
|
|
#ifndef _SVDITER_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
|
#include <svx/svditer.hxx>
|
|
|
|
|
#endif
|
2004-01-20 09:49:39 +00:00
|
|
|
|
#ifndef _SFXDOCFILE_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
|
#include <sfx2/docfile.hxx>
|
|
|
|
|
#endif
|
2004-01-20 09:49:39 +00:00
|
|
|
|
#ifndef _SVDOOLE2_HXX
|
2001-10-22 12:23:46 +00:00
|
|
|
|
#include <svx/svdoole2.hxx>
|
|
|
|
|
#endif
|
2004-01-20 09:49:39 +00:00
|
|
|
|
#ifndef _SV_SVAPP_HXX
|
|
|
|
|
#include <vcl/svapp.hxx>
|
|
|
|
|
#endif
|
2002-11-14 14:01:00 +00:00
|
|
|
|
#ifndef _SD_CUSSHOW_HXX
|
|
|
|
|
#include "cusshow.hxx"
|
|
|
|
|
#endif
|
2004-01-20 09:49:39 +00:00
|
|
|
|
#ifndef _SFX_CHILDWIN_HXX
|
|
|
|
|
#include <sfx2/childwin.hxx>
|
|
|
|
|
#endif
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2004-10-04 17:23:10 +00:00
|
|
|
|
#include <sfx2/viewfrm.hxx>
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
#include "strmname.h"
|
2004-01-20 09:49:39 +00:00
|
|
|
|
#ifndef _SDTREELB_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
|
#include "sdtreelb.hxx"
|
2004-01-20 09:49:39 +00:00
|
|
|
|
#endif
|
|
|
|
|
#ifndef SD_DRAW_DOC_SHELL_HXX
|
|
|
|
|
#include "DrawDocShell.hxx"
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _DRAWDOC_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
|
#include "drawdoc.hxx"
|
2004-01-20 09:49:39 +00:00
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SDPAGE_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
|
#include "sdpage.hxx"
|
2004-01-20 09:49:39 +00:00
|
|
|
|
#endif
|
|
|
|
|
#ifndef SD_RESID_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
|
#include "sdresid.hxx"
|
2004-01-20 09:49:39 +00:00
|
|
|
|
#endif
|
|
|
|
|
#ifndef SD_NAVIGATOR_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
|
#include "navigatr.hxx"
|
2004-01-20 09:49:39 +00:00
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SD_CFGID_HXX
|
2000-09-18 16:07:07 +00:00
|
|
|
|
#include "strings.hrc"
|
2004-01-20 09:49:39 +00:00
|
|
|
|
#endif
|
2000-09-18 16:07:07 +00:00
|
|
|
|
#include "res_bmp.hrc"
|
|
|
|
|
|
2004-10-04 17:23:10 +00:00
|
|
|
|
using namespace com::sun::star;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
BOOL SdPageObjsTLB::bIsInDrag = FALSE;
|
|
|
|
|
|
2001-04-04 15:41:39 +00:00
|
|
|
|
// -----------------------------------------
|
|
|
|
|
// - SdPageObjsTLB::SdPageObjsTransferable -
|
|
|
|
|
// -----------------------------------------
|
|
|
|
|
|
|
|
|
|
SdPageObjsTLB::SdPageObjsTransferable::~SdPageObjsTransferable()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
void SdPageObjsTLB::SdPageObjsTransferable::AddSupportedFormats()
|
|
|
|
|
{
|
|
|
|
|
AddFormat( SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
sal_Bool SdPageObjsTLB::SdPageObjsTransferable::GetData( const ::com::sun::star::datatransfer::DataFlavor& rFlavor )
|
|
|
|
|
{
|
|
|
|
|
SetINetBookmark( maBookmark, rFlavor );
|
|
|
|
|
return sal_True;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
void SdPageObjsTLB::SdPageObjsTransferable::DragFinished( sal_Int8 nDropAction )
|
|
|
|
|
{
|
|
|
|
|
mrParent.DragFinished( nDropAction );
|
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2002-12-11 13:54:59 +00:00
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
2004-01-20 09:49:39 +00:00
|
|
|
|
::sd::DrawDocShell& SdPageObjsTLB::SdPageObjsTransferable::GetDocShell() const
|
2002-12-11 13:54:59 +00:00
|
|
|
|
{
|
|
|
|
|
return mrDocShell;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
NavigatorDragType SdPageObjsTLB::SdPageObjsTransferable::GetDragType() const
|
|
|
|
|
{
|
|
|
|
|
return meDragType;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
sal_Int64 SAL_CALL SdPageObjsTLB::SdPageObjsTransferable::getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rId ) throw( ::com::sun::star::uno::RuntimeException )
|
|
|
|
|
{
|
|
|
|
|
sal_Int64 nRet;
|
|
|
|
|
|
|
|
|
|
if( ( rId.getLength() == 16 ) &&
|
|
|
|
|
( 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) )
|
|
|
|
|
{
|
|
|
|
|
nRet = (sal_Int64) this;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
nRet = 0;
|
|
|
|
|
|
|
|
|
|
return nRet;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
const ::com::sun::star::uno::Sequence< sal_Int8 >& SdPageObjsTLB::SdPageObjsTransferable::getUnoTunnelId()
|
|
|
|
|
{
|
|
|
|
|
static ::com::sun::star::uno::Sequence< sal_Int8 > aSeq;
|
|
|
|
|
|
|
|
|
|
if( !aSeq.getLength() )
|
|
|
|
|
{
|
|
|
|
|
static osl::Mutex aCreateMutex;
|
|
|
|
|
osl::MutexGuard aGuard( aCreateMutex );
|
|
|
|
|
|
|
|
|
|
aSeq.realloc( 16 );
|
|
|
|
|
rtl_createUuid( reinterpret_cast< sal_uInt8* >( aSeq.getArray() ), 0, sal_True );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return aSeq;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
SdPageObjsTLB::SdPageObjsTransferable* SdPageObjsTLB::SdPageObjsTransferable::getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxData )
|
|
|
|
|
throw()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
::com::sun::star::uno::Reference< ::com::sun::star::lang::XUnoTunnel > xUnoTunnel( rxData, ::com::sun::star::uno::UNO_QUERY );
|
|
|
|
|
|
|
|
|
|
return( xUnoTunnel.is() ?
|
|
|
|
|
( (SdPageObjsTLB::SdPageObjsTransferable*)(void*) xUnoTunnel->getSomething( SdPageObjsTLB::SdPageObjsTransferable::getUnoTunnelId() ) ) :
|
|
|
|
|
NULL );
|
|
|
|
|
}
|
|
|
|
|
catch( const ::com::sun::star::uno::Exception& )
|
|
|
|
|
{
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Ctor1 SdPageObjsTLB
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
SdPageObjsTLB::SdPageObjsTLB( Window* pParentWin, const SdResId& rSdResId,
|
|
|
|
|
BOOL bEnableDrop ) :
|
2002-12-06 15:51:18 +00:00
|
|
|
|
SvTreeListBox ( pParentWin, rSdResId ),
|
|
|
|
|
pParent ( pParentWin ),
|
|
|
|
|
pDoc ( NULL ),
|
|
|
|
|
pBookmarkDoc ( NULL ),
|
|
|
|
|
pMedium ( NULL ),
|
|
|
|
|
pOwnMedium ( NULL ),
|
2003-06-04 10:02:54 +00:00
|
|
|
|
aTransparencyColor ( RGB_COLORDATA (0xff,0,0xff) ),
|
|
|
|
|
aImgOle ( Bitmap( SdResId( BMP_OLE ) ), aTransparencyColor ),
|
|
|
|
|
aImgGraphic ( Bitmap( SdResId( BMP_GRAPHIC ) ), aTransparencyColor ),
|
|
|
|
|
aImgOleH ( Bitmap( SdResId( BMP_OLE_H ) ), aTransparencyColor),
|
|
|
|
|
aImgGraphicH ( Bitmap( SdResId( BMP_GRAPHIC_H ) ), aTransparencyColor),
|
2002-12-06 15:51:18 +00:00
|
|
|
|
pDropNavWin ( NULL ),
|
|
|
|
|
bLinkableSelected ( FALSE )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
{
|
|
|
|
|
// Tree-ListBox mit Linien versehen
|
|
|
|
|
SetWindowBits( WinBits( WB_TABSTOP | WB_BORDER | WB_HASLINES |
|
|
|
|
|
WB_HASBUTTONS | // WB_HASLINESATROOT |
|
|
|
|
|
WB_HSCROLL | // #31562#
|
|
|
|
|
WB_HASBUTTONSATROOT ) );
|
|
|
|
|
SetNodeBitmaps( Bitmap( SdResId( BMP_EXPAND ) ),
|
|
|
|
|
Bitmap( SdResId( BMP_COLLAPSE ) ) );
|
2002-05-28 11:57:26 +00:00
|
|
|
|
|
|
|
|
|
SetNodeBitmaps( Bitmap( SdResId( BMP_EXPAND_H ) ),
|
|
|
|
|
Bitmap( SdResId( BMP_COLLAPSE_H ) ),
|
|
|
|
|
BMP_COLOR_HIGHCONTRAST );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Dtor SdPageObjsTLB
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
SdPageObjsTLB::~SdPageObjsTLB()
|
|
|
|
|
{
|
2005-01-18 14:16:04 +00:00
|
|
|
|
if ( pBookmarkDoc )
|
|
|
|
|
CloseBookmarkDoc();
|
|
|
|
|
else
|
|
|
|
|
// no document was created from pMedium, so this object is still the owner of it
|
|
|
|
|
delete pMedium;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-10-22 12:23:46 +00:00
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* 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;
|
|
|
|
|
}
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* In TreeLB Eintrag selektieren
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
BOOL SdPageObjsTLB::SelectEntry( const String& rName )
|
|
|
|
|
{
|
|
|
|
|
BOOL bFound = FALSE;
|
|
|
|
|
|
|
|
|
|
if( rName.Len() )
|
|
|
|
|
{
|
|
|
|
|
SvLBoxEntry* pEntry = NULL;
|
|
|
|
|
String aTmp;
|
|
|
|
|
|
|
|
|
|
for( pEntry = First(); pEntry && !bFound; pEntry = Next( pEntry ) )
|
|
|
|
|
{
|
|
|
|
|
aTmp = GetEntryText( pEntry );
|
|
|
|
|
if( aTmp == rName )
|
|
|
|
|
{
|
|
|
|
|
bFound = TRUE;
|
|
|
|
|
SetCurEntry( pEntry );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return( bFound );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Gibt zurueck, ob Childs des uebergebenen Strings selektiert sind
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
BOOL SdPageObjsTLB::HasSelectedChilds( const String& rName )
|
|
|
|
|
{
|
|
|
|
|
BOOL bFound = FALSE;
|
|
|
|
|
BOOL bChilds = FALSE;
|
|
|
|
|
|
|
|
|
|
if( rName.Len() )
|
|
|
|
|
{
|
|
|
|
|
SvLBoxEntry* pEntry = NULL;
|
|
|
|
|
String aTmp;
|
|
|
|
|
|
|
|
|
|
for( pEntry = First(); pEntry && !bFound; pEntry = Next( pEntry ) )
|
|
|
|
|
{
|
|
|
|
|
aTmp = GetEntryText( pEntry );
|
|
|
|
|
if( aTmp == rName )
|
|
|
|
|
{
|
|
|
|
|
bFound = TRUE;
|
|
|
|
|
BOOL bExpanded = IsExpanded( pEntry );
|
|
|
|
|
long nCount = GetChildSelectionCount( pEntry );
|
|
|
|
|
#if SUPD < 335
|
|
|
|
|
nCount++;
|
|
|
|
|
#endif
|
|
|
|
|
if( bExpanded && nCount > 0 )
|
|
|
|
|
bChilds = TRUE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return( bChilds );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* TreeLB mit Seiten und Objekten fuellen
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, BOOL bAllPages,
|
|
|
|
|
const String& rDocName)
|
|
|
|
|
{
|
|
|
|
|
String aSelection;
|
|
|
|
|
if( GetSelectionCount() > 0 )
|
|
|
|
|
{
|
|
|
|
|
aSelection = GetSelectEntry();
|
|
|
|
|
Clear();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pDoc = pInDoc;
|
|
|
|
|
aDocName = rDocName;
|
|
|
|
|
|
|
|
|
|
SdrObject* pObj = NULL;
|
|
|
|
|
SdPage* pPage = NULL;
|
|
|
|
|
SvLBoxEntry* pEntry = NULL;
|
|
|
|
|
|
2002-05-31 13:20:03 +00:00
|
|
|
|
Bitmap aBmpPage( SdResId( BMP_PAGE ) );
|
2003-06-04 10:02:54 +00:00
|
|
|
|
Image aImgPage( aBmpPage, aTransparencyColor );
|
2002-05-31 13:20:03 +00:00
|
|
|
|
Bitmap aBmpPageExcl( SdResId( BMP_PAGE_EXCLUDED ) );
|
2003-06-04 10:02:54 +00:00
|
|
|
|
Image aImgPageExcl( aBmpPageExcl, aTransparencyColor );
|
2002-05-31 13:20:03 +00:00
|
|
|
|
Bitmap aBmpPageObjsExcl( SdResId( BMP_PAGEOBJS_EXCLUDED ) );
|
2003-06-04 10:02:54 +00:00
|
|
|
|
Image aImgPageObjsExcl( aBmpPageObjsExcl, aTransparencyColor );
|
2002-05-31 13:20:03 +00:00
|
|
|
|
Bitmap aBmpPageObjs( SdResId( BMP_PAGEOBJS ) );
|
2003-06-04 10:02:54 +00:00
|
|
|
|
Image aImgPageObjs( aBmpPageObjs, aTransparencyColor );
|
2002-05-31 13:20:03 +00:00
|
|
|
|
Bitmap aBmpObjects( SdResId( BMP_OBJECTS ) );
|
2003-06-04 10:02:54 +00:00
|
|
|
|
Image aImgObjects( aBmpObjects, aTransparencyColor );
|
2002-05-31 13:20:03 +00:00
|
|
|
|
|
|
|
|
|
Bitmap aBmpPageH( SdResId( BMP_PAGE_H ) );
|
2003-06-04 10:02:54 +00:00
|
|
|
|
Image aImgPageH( aBmpPageH , aTransparencyColor );
|
2002-05-31 13:20:03 +00:00
|
|
|
|
Bitmap aBmpPageExclH( SdResId( BMP_PAGE_EXCLUDED_H ) );
|
2003-06-04 10:02:54 +00:00
|
|
|
|
Image aImgPageExclH( aBmpPageExclH, aTransparencyColor );
|
2002-05-31 13:20:03 +00:00
|
|
|
|
Bitmap aBmpPageObjExclH( SdResId( BMP_PAGEOBJS_EXCLUDED_H ) );
|
2003-06-04 10:02:54 +00:00
|
|
|
|
Image aImgPageObjsExclH( aBmpPageObjExclH, aTransparencyColor );
|
2002-05-31 13:20:03 +00:00
|
|
|
|
Bitmap aBmpPageObjsH( SdResId( BMP_PAGEOBJS_H ) );
|
2003-06-04 10:02:54 +00:00
|
|
|
|
Image aImgPageObjsH( aBmpPageObjsH, aTransparencyColor );
|
2002-05-31 13:20:03 +00:00
|
|
|
|
Bitmap aBmpObjectsH( SdResId( BMP_OBJECTS_H ) );
|
2003-06-04 10:02:54 +00:00
|
|
|
|
Image aImgObjectsH( aBmpObjectsH, aTransparencyColor );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
// Zuerst alle Pages incl. Objekte einfuegen
|
|
|
|
|
USHORT nPage = 0;
|
|
|
|
|
const USHORT nMaxPages = pDoc->GetPageCount();
|
|
|
|
|
|
|
|
|
|
while( nPage < nMaxPages )
|
|
|
|
|
{
|
|
|
|
|
pPage = (SdPage*) pDoc->GetPage( nPage );
|
2002-09-26 09:01:42 +00:00
|
|
|
|
if( (bAllPages || pPage->GetPageKind() == PK_STANDARD)
|
|
|
|
|
&& !(pPage->GetPageKind()==PK_HANDOUT) ) //#94954# never list the normal handout page ( handout-masterpage is used instead )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
{
|
|
|
|
|
BOOL bPageExluded = pPage->IsExcluded();
|
|
|
|
|
|
2002-11-14 14:01:00 +00:00
|
|
|
|
bool bPageBelongsToShow = PageBelongsToCurrentShow (pPage);
|
|
|
|
|
bPageExluded |= !bPageBelongsToShow;
|
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
pEntry = InsertEntry( pPage->GetName(),
|
2002-12-06 15:51:18 +00:00
|
|
|
|
bPageExluded ? aImgPageExcl : aImgPage,
|
|
|
|
|
bPageExluded ? aImgPageExcl : aImgPage,
|
|
|
|
|
0,
|
|
|
|
|
FALSE,
|
|
|
|
|
LIST_APPEND,
|
|
|
|
|
reinterpret_cast< void* >( 1 ) );
|
|
|
|
|
|
2002-05-28 11:57:26 +00:00
|
|
|
|
SetExpandedEntryBmp( pEntry, bPageExluded ? aImgPageExclH : aImgPageH, BMP_COLOR_HIGHCONTRAST );
|
|
|
|
|
SetCollapsedEntryBmp( pEntry, bPageExluded ? aImgPageExclH : aImgPageH, BMP_COLOR_HIGHCONTRAST );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
SdrObjListIter aIter( *pPage, IM_DEEPWITHGROUPS );
|
|
|
|
|
|
|
|
|
|
while( aIter.IsMore() )
|
|
|
|
|
{
|
|
|
|
|
pObj = aIter.Next();
|
2001-10-22 12:23:46 +00:00
|
|
|
|
String aStr( GetObjectName( pObj ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
if( aStr.Len() )
|
|
|
|
|
{
|
2002-05-28 11:57:26 +00:00
|
|
|
|
if( pObj->GetObjInventor() == SdrInventor && pObj->GetObjIdentifier() == OBJ_OLE2 )
|
|
|
|
|
{
|
2002-12-06 15:51:18 +00:00
|
|
|
|
SvLBoxEntry* pNewEntry = InsertEntry( aStr, aImgOle, aImgOle, pEntry );
|
|
|
|
|
|
2002-05-28 11:57:26 +00:00
|
|
|
|
SetExpandedEntryBmp( pNewEntry, aImgOleH, BMP_COLOR_HIGHCONTRAST );
|
|
|
|
|
SetCollapsedEntryBmp( pNewEntry, aImgOleH, BMP_COLOR_HIGHCONTRAST );
|
|
|
|
|
}
|
|
|
|
|
else if( pObj->GetObjInventor() == SdrInventor && pObj->GetObjIdentifier() == OBJ_GRAF )
|
|
|
|
|
{
|
2002-12-06 15:51:18 +00:00
|
|
|
|
SvLBoxEntry* pNewEntry = InsertEntry( aStr, aImgGraphic, aImgGraphic, pEntry );
|
|
|
|
|
|
2002-05-28 11:57:26 +00:00
|
|
|
|
SetExpandedEntryBmp( pNewEntry, aImgGraphicH, BMP_COLOR_HIGHCONTRAST );
|
|
|
|
|
SetCollapsedEntryBmp( pNewEntry, aImgGraphicH, BMP_COLOR_HIGHCONTRAST );
|
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
else
|
2002-05-28 11:57:26 +00:00
|
|
|
|
{
|
|
|
|
|
SvLBoxEntry* pNewEntry = InsertEntry( aStr, aImgObjects, aImgObjects, pEntry );
|
2002-12-06 15:51:18 +00:00
|
|
|
|
|
2002-05-28 11:57:26 +00:00
|
|
|
|
SetExpandedEntryBmp( pNewEntry, aImgObjectsH, BMP_COLOR_HIGHCONTRAST );
|
|
|
|
|
SetCollapsedEntryBmp( pNewEntry, aImgObjectsH, BMP_COLOR_HIGHCONTRAST );
|
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if( pEntry->HasChilds() )
|
|
|
|
|
{
|
|
|
|
|
SetExpandedEntryBmp( pEntry, bPageExluded ? aImgPageObjsExcl : aImgPageObjs );
|
|
|
|
|
SetCollapsedEntryBmp( pEntry, bPageExluded ? aImgPageObjsExcl : aImgPageObjs );
|
2002-05-28 11:57:26 +00:00
|
|
|
|
SetExpandedEntryBmp( pEntry, bPageExluded ? aImgPageObjsExclH : aImgPageObjsH, BMP_COLOR_HIGHCONTRAST );
|
|
|
|
|
SetCollapsedEntryBmp( pEntry, bPageExluded ? aImgPageObjsExclH : aImgPageObjsH, BMP_COLOR_HIGHCONTRAST );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
nPage++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// dann alle MasterPages incl. Objekte einfuegen
|
|
|
|
|
if( bAllPages )
|
|
|
|
|
{
|
|
|
|
|
nPage = 0;
|
|
|
|
|
const USHORT nMaxMasterPages = pDoc->GetMasterPageCount();
|
|
|
|
|
|
|
|
|
|
while( nPage < nMaxMasterPages )
|
|
|
|
|
{
|
|
|
|
|
pPage = (SdPage*) pDoc->GetMasterPage( nPage );
|
2002-12-06 15:51:18 +00:00
|
|
|
|
pEntry = InsertEntry( pPage->GetName(),
|
|
|
|
|
aImgPage,
|
|
|
|
|
aImgPage,
|
|
|
|
|
0,
|
|
|
|
|
FALSE,
|
|
|
|
|
LIST_APPEND,
|
|
|
|
|
reinterpret_cast< void* >( 1 ) );
|
|
|
|
|
|
2002-05-28 11:57:26 +00:00
|
|
|
|
SetExpandedEntryBmp( pEntry, aImgPageH, BMP_COLOR_HIGHCONTRAST );
|
|
|
|
|
SetCollapsedEntryBmp( pEntry, aImgPageH, BMP_COLOR_HIGHCONTRAST );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
SdrObjListIter aIter( *pPage, IM_DEEPWITHGROUPS );
|
|
|
|
|
|
|
|
|
|
while( aIter.IsMore() )
|
|
|
|
|
{
|
|
|
|
|
pObj = aIter.Next();
|
2001-10-22 12:23:46 +00:00
|
|
|
|
String aStr( GetObjectName( pObj ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
if( aStr.Len() )
|
|
|
|
|
{
|
2002-05-28 11:57:26 +00:00
|
|
|
|
if( pObj->GetObjInventor() == SdrInventor && pObj->GetObjIdentifier() == OBJ_OLE2 )
|
|
|
|
|
{
|
|
|
|
|
SvLBoxEntry* pNewEntry = InsertEntry( aStr, aImgOle, aImgOle, pEntry ); // pEntry entspr. Parent
|
2002-12-06 15:51:18 +00:00
|
|
|
|
|
2002-05-28 11:57:26 +00:00
|
|
|
|
SetExpandedEntryBmp( pNewEntry, aImgOleH, BMP_COLOR_HIGHCONTRAST );
|
|
|
|
|
SetCollapsedEntryBmp( pNewEntry, aImgOleH, BMP_COLOR_HIGHCONTRAST );
|
|
|
|
|
}
|
|
|
|
|
else if( pObj->GetObjInventor() == SdrInventor && pObj->GetObjIdentifier() == OBJ_GRAF )
|
|
|
|
|
{
|
|
|
|
|
SvLBoxEntry* pNewEntry = InsertEntry( aStr, aImgGraphic, aImgGraphic, pEntry ); // pEntry entspr. Parent
|
2002-12-06 15:51:18 +00:00
|
|
|
|
|
2002-05-28 11:57:26 +00:00
|
|
|
|
SetExpandedEntryBmp( pNewEntry, aImgGraphicH, BMP_COLOR_HIGHCONTRAST );
|
|
|
|
|
SetCollapsedEntryBmp( pNewEntry, aImgGraphicH, BMP_COLOR_HIGHCONTRAST );
|
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
else
|
2002-05-28 11:57:26 +00:00
|
|
|
|
{
|
|
|
|
|
SvLBoxEntry* pNewEntry = InsertEntry( aStr, aImgObjects, aImgObjects, pEntry );
|
2002-12-06 15:51:18 +00:00
|
|
|
|
|
2002-05-28 11:57:26 +00:00
|
|
|
|
SetExpandedEntryBmp( pNewEntry, aImgObjectsH, BMP_COLOR_HIGHCONTRAST );
|
|
|
|
|
SetCollapsedEntryBmp( pNewEntry, aImgObjectsH, BMP_COLOR_HIGHCONTRAST );
|
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if( pEntry->HasChilds() )
|
|
|
|
|
{
|
|
|
|
|
SetExpandedEntryBmp( pEntry, aImgPageObjs );
|
|
|
|
|
SetCollapsedEntryBmp( pEntry, aImgPageObjs );
|
2002-05-28 11:57:26 +00:00
|
|
|
|
SetExpandedEntryBmp( pEntry, aImgPageObjsH, BMP_COLOR_HIGHCONTRAST );
|
|
|
|
|
SetCollapsedEntryBmp( pEntry, aImgPageObjsH, BMP_COLOR_HIGHCONTRAST );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
}
|
|
|
|
|
nPage++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if( aSelection.Len() )
|
|
|
|
|
SelectEntry( aSelection );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Es wird nur der erste Eintrag eingefuegt. Childs werden OnDemand erzeugt
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SdPageObjsTLB::Fill( const SdDrawDocument* pInDoc, SfxMedium* pInMedium,
|
|
|
|
|
const String& rDocName )
|
|
|
|
|
{
|
|
|
|
|
pDoc = pInDoc;
|
2005-01-18 14:16:04 +00:00
|
|
|
|
|
|
|
|
|
// this object now owns the Medium
|
2000-09-18 16:07:07 +00:00
|
|
|
|
pMedium = pInMedium;
|
|
|
|
|
aDocName = rDocName;
|
|
|
|
|
|
|
|
|
|
SdrObject* pObj = NULL;
|
|
|
|
|
SdPage* pPage = NULL;
|
|
|
|
|
SvLBoxEntry* pFileEntry = NULL;
|
|
|
|
|
SvLBoxEntry* pPageEntry = NULL;
|
|
|
|
|
|
2002-05-31 13:20:03 +00:00
|
|
|
|
Bitmap aBmpDocOpen( SdResId( BMP_DOC_OPEN ) );
|
2003-06-04 10:02:54 +00:00
|
|
|
|
Image aImgDocOpen( aBmpDocOpen, aTransparencyColor );
|
2002-05-31 13:20:03 +00:00
|
|
|
|
Bitmap aBmpDocClosed( SdResId( BMP_DOC_CLOSED ) );
|
2003-06-04 10:02:54 +00:00
|
|
|
|
Image aImgDocClosed( aBmpDocClosed, aTransparencyColor );
|
2002-05-31 13:20:03 +00:00
|
|
|
|
Bitmap aBmpDocOpenH( SdResId( BMP_DOC_OPEN_H ) );
|
2003-06-04 10:02:54 +00:00
|
|
|
|
Image aImgDocOpenH( aBmpDocOpenH, aTransparencyColor );
|
2002-05-31 13:20:03 +00:00
|
|
|
|
Bitmap aBmpDocClosedH( SdResId( BMP_DOC_CLOSED_H ) );
|
2003-06-04 10:02:54 +00:00
|
|
|
|
Image aImgDocClosedH( aBmpDocClosedH, aTransparencyColor );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
// Dokumentnamen einfuegen
|
2002-12-06 15:51:18 +00:00
|
|
|
|
pFileEntry = InsertEntry( aDocName,
|
|
|
|
|
aImgDocOpen,
|
|
|
|
|
aImgDocClosed,
|
|
|
|
|
NULL,
|
|
|
|
|
TRUE,
|
|
|
|
|
LIST_APPEND,
|
|
|
|
|
reinterpret_cast< void* >( 1 ) );
|
|
|
|
|
|
2002-05-28 11:57:26 +00:00
|
|
|
|
SetExpandedEntryBmp( pFileEntry, aImgDocOpenH, BMP_COLOR_HIGHCONTRAST );
|
|
|
|
|
SetCollapsedEntryBmp( pFileEntry, aImgDocClosedH, BMP_COLOR_HIGHCONTRAST );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Prueft, ob die Seiten (PK_STANDARD) und die darauf befindlichen Objekte
|
|
|
|
|
|* des Docs und der TreeLB identisch sind.
|
|
|
|
|
|* Wird ein Doc uebergeben, wird dieses zum aktuellem Doc (Wichtig bei
|
|
|
|
|
|* mehreren Documenten).
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
BOOL SdPageObjsTLB::IsEqualToDoc( const SdDrawDocument* pInDoc )
|
|
|
|
|
{
|
|
|
|
|
if( pInDoc )
|
|
|
|
|
pDoc = pInDoc;
|
|
|
|
|
|
|
|
|
|
if( !pDoc )
|
|
|
|
|
return( FALSE );
|
|
|
|
|
|
|
|
|
|
SdrObject* pObj = NULL;
|
|
|
|
|
SdPage* pPage = NULL;
|
|
|
|
|
SvLBoxEntry* pEntry = First();
|
|
|
|
|
String aName;
|
|
|
|
|
|
|
|
|
|
// Alle Pages incl. Objekte vergleichen
|
|
|
|
|
USHORT nPage = 0;
|
|
|
|
|
const USHORT nMaxPages = pDoc->GetPageCount();
|
|
|
|
|
|
|
|
|
|
while( nPage < nMaxPages )
|
|
|
|
|
{
|
|
|
|
|
pPage = (SdPage*) pDoc->GetPage( nPage );
|
|
|
|
|
if( pPage->GetPageKind() == PK_STANDARD )
|
|
|
|
|
{
|
|
|
|
|
if( !pEntry )
|
|
|
|
|
return( FALSE );
|
|
|
|
|
aName = GetEntryText( pEntry );
|
|
|
|
|
|
|
|
|
|
if( pPage->GetName() != aName )
|
|
|
|
|
return( FALSE );
|
|
|
|
|
|
|
|
|
|
pEntry = Next( pEntry );
|
|
|
|
|
|
|
|
|
|
SdrObjListIter aIter( *pPage, IM_DEEPWITHGROUPS );
|
|
|
|
|
|
|
|
|
|
while( aIter.IsMore() )
|
|
|
|
|
{
|
|
|
|
|
pObj = aIter.Next();
|
2001-10-22 12:23:46 +00:00
|
|
|
|
|
|
|
|
|
const String aObjectName( GetObjectName( pObj ) );
|
|
|
|
|
|
|
|
|
|
if( aObjectName.Len() )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
{
|
|
|
|
|
if( !pEntry )
|
|
|
|
|
return( FALSE );
|
2001-10-22 12:23:46 +00:00
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
aName = GetEntryText( pEntry );
|
|
|
|
|
|
2001-10-22 12:23:46 +00:00
|
|
|
|
if( aObjectName != aName )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
return( FALSE );
|
|
|
|
|
|
|
|
|
|
pEntry = Next( pEntry );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
nPage++;
|
|
|
|
|
}
|
|
|
|
|
// Wenn noch Eintraege in der Listbox vorhanden sind, wurden
|
|
|
|
|
// Objekte (mit Namen) oder Seiten geloescht
|
|
|
|
|
return( !pEntry );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Selectierten String zurueckgeben
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
String SdPageObjsTLB::GetSelectEntry()
|
|
|
|
|
{
|
|
|
|
|
return( GetEntryText( GetCurEntry() ) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Selektierte Eintrage zurueckgeben
|
|
|
|
|
|* nDepth == 0 -> Seiten
|
|
|
|
|
|* nDepth == 1 -> Objekte
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
List* SdPageObjsTLB::GetSelectEntryList( USHORT nDepth )
|
|
|
|
|
{
|
|
|
|
|
List* pList = NULL;
|
|
|
|
|
SvLBoxEntry* pEntry = FirstSelected();
|
|
|
|
|
|
|
|
|
|
while( pEntry )
|
|
|
|
|
{
|
|
|
|
|
USHORT nListDepth = GetModel()->GetDepth( pEntry );
|
|
|
|
|
if( nListDepth == nDepth )
|
|
|
|
|
{
|
|
|
|
|
if( !pList )
|
|
|
|
|
pList = new List();
|
|
|
|
|
|
2002-12-11 13:54:59 +00:00
|
|
|
|
const String aEntryText( GetEntryText( pEntry ) );
|
|
|
|
|
pList->Insert( new String( aEntryText ), LIST_APPEND );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
}
|
|
|
|
|
pEntry = NextSelected( pEntry );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return( pList );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Alle Pages (und Objekte) des Docs zurueckgeben
|
|
|
|
|
|* nType == 0 -> Seiten
|
|
|
|
|
|* nType == 1 -> Objekte
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
List* SdPageObjsTLB::GetBookmarkList( USHORT nType )
|
|
|
|
|
{
|
|
|
|
|
List* pList = NULL;
|
|
|
|
|
|
|
|
|
|
if( GetBookmarkDoc() )
|
|
|
|
|
{
|
|
|
|
|
SdPage* pPage = NULL;
|
|
|
|
|
String* pName = NULL;
|
|
|
|
|
USHORT nPage = 0;
|
|
|
|
|
const USHORT nMaxPages = pBookmarkDoc->GetSdPageCount( PK_STANDARD );
|
|
|
|
|
|
|
|
|
|
while( nPage < nMaxPages )
|
|
|
|
|
{
|
|
|
|
|
pPage = pBookmarkDoc->GetSdPage( nPage, PK_STANDARD );
|
|
|
|
|
|
|
|
|
|
if( nType == 0 ) // Seitennamen einfuegen
|
|
|
|
|
{
|
|
|
|
|
if( !pList )
|
|
|
|
|
pList = new List();
|
|
|
|
|
|
|
|
|
|
pName = new String( pPage->GetRealName() );
|
|
|
|
|
pList->Insert( pName, LIST_APPEND );
|
|
|
|
|
}
|
|
|
|
|
else // Objektnamen einfuegen
|
|
|
|
|
{
|
|
|
|
|
// Ueber Objekte der Seite iterieren
|
|
|
|
|
SdrObjListIter aIter( *pPage, IM_DEEPWITHGROUPS );
|
|
|
|
|
while( aIter.IsMore() )
|
|
|
|
|
{
|
|
|
|
|
SdrObject* pObj = aIter.Next();
|
2001-10-22 12:23:46 +00:00
|
|
|
|
String aStr( GetObjectName( pObj ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
if( aStr.Len() )
|
|
|
|
|
{
|
|
|
|
|
if( !pList )
|
|
|
|
|
pList = new List();
|
|
|
|
|
|
|
|
|
|
pName = new String( aStr );
|
|
|
|
|
pList->Insert( pName, LIST_APPEND );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
nPage++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return( pList );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Eintraege werden erst auf Anforderung (Doppelklick) eingefuegt
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
2001-10-22 12:23:46 +00:00
|
|
|
|
void SdPageObjsTLB::RequestingChilds( SvLBoxEntry* pFileEntry )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
{
|
|
|
|
|
if( !pFileEntry->HasChilds() )
|
|
|
|
|
{
|
|
|
|
|
if( GetBookmarkDoc() )
|
|
|
|
|
{
|
|
|
|
|
SdrObject* pObj = NULL;
|
|
|
|
|
SdPage* pPage = NULL;
|
|
|
|
|
SvLBoxEntry* pPageEntry = NULL;
|
|
|
|
|
|
2002-05-31 13:20:03 +00:00
|
|
|
|
Bitmap aBmpPage( SdResId( BMP_PAGE ) );
|
2003-06-04 10:02:54 +00:00
|
|
|
|
Image aImgPage( aBmpPage, aTransparencyColor );
|
2002-05-31 13:20:03 +00:00
|
|
|
|
Bitmap aBmpPageObjs( SdResId( BMP_PAGEOBJS ) );
|
2003-06-04 10:02:54 +00:00
|
|
|
|
Image aImgPageObjs( aBmpPageObjs, aTransparencyColor );
|
2002-05-31 13:20:03 +00:00
|
|
|
|
Bitmap aBmpObjects( SdResId( BMP_OBJECTS ) );
|
2003-06-04 10:02:54 +00:00
|
|
|
|
Image aImgObjects( aBmpObjects, aTransparencyColor );
|
2002-05-31 13:20:03 +00:00
|
|
|
|
Bitmap aBmpPageH( SdResId( BMP_PAGE_H ) );
|
2003-06-04 10:02:54 +00:00
|
|
|
|
Image aImgPageH( aBmpPageH, aTransparencyColor );
|
2002-05-31 13:20:03 +00:00
|
|
|
|
Bitmap aBmpPageObjsH( SdResId( BMP_PAGEOBJS_H ) );
|
2003-06-04 10:02:54 +00:00
|
|
|
|
Image aImgPageObjsH( aBmpPageObjsH, aTransparencyColor );
|
2002-05-31 13:20:03 +00:00
|
|
|
|
Bitmap aBmpImgObjectsH( SdResId( BMP_OBJECTS_H ) );
|
2003-06-04 10:02:54 +00:00
|
|
|
|
Image aImgObjectsH( aBmpImgObjectsH, aTransparencyColor );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
// Dokumentname ist schon eingefuegt
|
|
|
|
|
|
|
|
|
|
// Nur alle "normalen" Pages mit Objekten einfuegen
|
|
|
|
|
USHORT nPage = 0;
|
|
|
|
|
const USHORT nMaxPages = pBookmarkDoc->GetPageCount();
|
|
|
|
|
|
|
|
|
|
while( nPage < nMaxPages )
|
|
|
|
|
{
|
|
|
|
|
pPage = (SdPage*) pBookmarkDoc->GetPage( nPage );
|
|
|
|
|
if( pPage->GetPageKind() == PK_STANDARD )
|
|
|
|
|
{
|
2002-12-06 15:51:18 +00:00
|
|
|
|
pPageEntry = InsertEntry( pPage->GetName(),
|
|
|
|
|
aImgPage,
|
|
|
|
|
aImgPage,
|
|
|
|
|
pFileEntry,
|
|
|
|
|
FALSE,
|
|
|
|
|
LIST_APPEND,
|
|
|
|
|
reinterpret_cast< void* >( 1 ) );
|
|
|
|
|
|
2002-05-28 11:57:26 +00:00
|
|
|
|
SetExpandedEntryBmp( pPageEntry, aImgPageH, BMP_COLOR_HIGHCONTRAST );
|
|
|
|
|
SetCollapsedEntryBmp( pPageEntry, aImgPageH, BMP_COLOR_HIGHCONTRAST );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
SdrObjListIter aIter( *pPage, IM_DEEPWITHGROUPS );
|
|
|
|
|
|
|
|
|
|
while( aIter.IsMore() )
|
|
|
|
|
{
|
|
|
|
|
pObj = aIter.Next();
|
2001-10-22 12:23:46 +00:00
|
|
|
|
String aStr( GetObjectName( pObj ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
if( aStr.Len() )
|
|
|
|
|
{
|
2002-05-28 11:57:26 +00:00
|
|
|
|
if( pObj->GetObjInventor() == SdrInventor && pObj->GetObjIdentifier() == OBJ_OLE2 )
|
|
|
|
|
{
|
|
|
|
|
SvLBoxEntry* pNewEntry = InsertEntry( aStr, aImgOle, aImgOle, pPageEntry );
|
2002-12-06 15:51:18 +00:00
|
|
|
|
|
2002-05-28 11:57:26 +00:00
|
|
|
|
SetExpandedEntryBmp( pNewEntry, aImgOleH, BMP_COLOR_HIGHCONTRAST );
|
|
|
|
|
SetCollapsedEntryBmp( pNewEntry, aImgOleH, BMP_COLOR_HIGHCONTRAST );
|
|
|
|
|
}
|
|
|
|
|
else if( pObj->GetObjInventor() == SdrInventor && pObj->GetObjIdentifier() == OBJ_GRAF )
|
|
|
|
|
{
|
|
|
|
|
SvLBoxEntry* pNewEntry = InsertEntry( aStr, aImgGraphic, aImgGraphic, pPageEntry ); // pEntry entspr. Parent
|
2002-12-06 15:51:18 +00:00
|
|
|
|
|
2002-05-28 11:57:26 +00:00
|
|
|
|
SetExpandedEntryBmp( pNewEntry, aImgGraphicH, BMP_COLOR_HIGHCONTRAST );
|
|
|
|
|
SetCollapsedEntryBmp( pNewEntry, aImgGraphicH, BMP_COLOR_HIGHCONTRAST );
|
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
else
|
2002-05-28 11:57:26 +00:00
|
|
|
|
{
|
|
|
|
|
SvLBoxEntry* pNewEntry = InsertEntry( aStr, aImgObjects, aImgObjects, pPageEntry );
|
2002-12-06 15:51:18 +00:00
|
|
|
|
|
2002-05-28 11:57:26 +00:00
|
|
|
|
SetExpandedEntryBmp( pNewEntry, aImgObjectsH, BMP_COLOR_HIGHCONTRAST );
|
|
|
|
|
SetCollapsedEntryBmp( pNewEntry, aImgObjectsH, BMP_COLOR_HIGHCONTRAST );
|
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if( pPageEntry->HasChilds() )
|
|
|
|
|
{
|
|
|
|
|
SetExpandedEntryBmp( pPageEntry, aImgPageObjs );
|
|
|
|
|
SetCollapsedEntryBmp( pPageEntry, aImgPageObjs );
|
2002-05-28 11:57:26 +00:00
|
|
|
|
SetExpandedEntryBmp( pPageEntry, aImgPageObjsH, BMP_COLOR_HIGHCONTRAST );
|
|
|
|
|
SetCollapsedEntryBmp( pPageEntry, aImgPageObjsH, BMP_COLOR_HIGHCONTRAST );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
nPage++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
SvTreeListBox::RequestingChilds( pFileEntry );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Prueft, ob es sich um eine Draw-Datei handelt und oeffnet anhand des
|
|
|
|
|
|* uebergebenen Docs das BookmarkDoc
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
SdDrawDocument* SdPageObjsTLB::GetBookmarkDoc(SfxMedium* pMed)
|
|
|
|
|
{
|
|
|
|
|
if (!pBookmarkDoc ||
|
|
|
|
|
pMed && (!pOwnMedium || pOwnMedium->GetName() != pMed->GetName()))
|
|
|
|
|
{
|
2005-01-18 14:16:04 +00:00
|
|
|
|
// create a new BookmarkDoc if now one exists or if a new Medium is provided
|
2000-09-18 16:07:07 +00:00
|
|
|
|
if (pOwnMedium != pMed)
|
|
|
|
|
{
|
|
|
|
|
CloseBookmarkDoc();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (pMed)
|
|
|
|
|
{
|
2005-01-18 14:16:04 +00:00
|
|
|
|
// it looks that it is undefined if a Medium was set by Fill() allready
|
|
|
|
|
DBG_ASSERT( !pMedium, "SfxMedium confusion!" );
|
|
|
|
|
delete pMedium;
|
|
|
|
|
pMedium = NULL;
|
|
|
|
|
|
|
|
|
|
// take over this Medium (currently used only be Navigator)
|
2000-09-18 16:07:07 +00:00
|
|
|
|
pOwnMedium = pMed;
|
|
|
|
|
}
|
|
|
|
|
|
2005-01-18 14:16:04 +00:00
|
|
|
|
DBG_ASSERT( pMedium || pMed, "No SfxMedium provided!" );
|
2004-10-04 17:23:10 +00:00
|
|
|
|
|
2005-01-18 14:16:04 +00:00
|
|
|
|
if( pMed )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
{
|
2005-01-18 14:16:04 +00:00
|
|
|
|
// in this mode the document is also owned and controlled by this instance
|
|
|
|
|
xBookmarkDocShRef = new ::sd::DrawDocShell(SFX_CREATE_MODE_STANDARD, TRUE);
|
|
|
|
|
if (xBookmarkDocShRef->DoLoad(pMed))
|
|
|
|
|
pBookmarkDoc = xBookmarkDocShRef->GetDoc();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
else
|
2005-01-18 14:16:04 +00:00
|
|
|
|
pBookmarkDoc = NULL;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
}
|
2005-01-18 14:16:04 +00:00
|
|
|
|
else if ( pMedium )
|
|
|
|
|
// in this mode the document is owned and controlled by the SdDrawDocument
|
|
|
|
|
// it can be released by calling the corresponding CloseBookmarkDoc method
|
|
|
|
|
// successfull creation of a document makes this the owner of the medium
|
|
|
|
|
pBookmarkDoc = ((SdDrawDocument*) pDoc)->OpenBookmarkDoc(*pMedium);
|
|
|
|
|
|
|
|
|
|
if ( !pBookmarkDoc )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
{
|
2001-02-21 11:58:27 +00:00
|
|
|
|
ErrorBox aErrorBox( this, WB_OK, String( SdResId( STR_READ_DATA_ERROR ) ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
aErrorBox.Execute();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return( pBookmarkDoc );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Bookmark-Dokument schlie<EFBFBD>en und loeschen
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SdPageObjsTLB::CloseBookmarkDoc()
|
|
|
|
|
{
|
|
|
|
|
if (xBookmarkDocShRef.Is())
|
|
|
|
|
{
|
|
|
|
|
xBookmarkDocShRef->DoClose();
|
2005-01-18 14:16:04 +00:00
|
|
|
|
xBookmarkDocShRef.Clear();
|
|
|
|
|
|
|
|
|
|
// Medium is owned by document, so it's destroyed already
|
|
|
|
|
pOwnMedium = 0;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
}
|
2005-01-18 14:16:04 +00:00
|
|
|
|
else if ( pBookmarkDoc )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
{
|
2005-01-18 14:16:04 +00:00
|
|
|
|
DBG_ASSERT( !pOwnMedium, "SfxMedium confusion!" );
|
|
|
|
|
if ( pDoc )
|
|
|
|
|
{
|
|
|
|
|
// The document owns the Medium, so the Medium will be invalid after closing the document
|
2000-09-18 16:07:07 +00:00
|
|
|
|
((SdDrawDocument*) pDoc)->CloseBookmarkDoc();
|
2005-01-18 14:16:04 +00:00
|
|
|
|
pMedium = 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// perhaps pOwnMedium provided, but no successfull creation of BookmarkDoc
|
|
|
|
|
delete pOwnMedium;
|
|
|
|
|
pOwnMedium = NULL;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pBookmarkDoc = NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
2002-12-06 15:51:18 +00:00
|
|
|
|
|*
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SdPageObjsTLB::SelectHdl()
|
|
|
|
|
{
|
2002-12-06 15:51:18 +00:00
|
|
|
|
SvLBoxEntry* pEntry = FirstSelected();
|
|
|
|
|
|
|
|
|
|
bLinkableSelected = TRUE;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2002-12-06 15:51:18 +00:00
|
|
|
|
while( pEntry && bLinkableSelected )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
{
|
2002-12-06 15:51:18 +00:00
|
|
|
|
if( NULL == pEntry->GetUserData() )
|
|
|
|
|
bLinkableSelected = FALSE;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
pEntry = NextSelected( pEntry );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SvTreeListBox::SelectHdl();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Ueberlaedt RETURN mit der Funktionsweise von DoubleClick
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
void SdPageObjsTLB::KeyInput( const KeyEvent& rKEvt )
|
|
|
|
|
{
|
|
|
|
|
if( rKEvt.GetKeyCode().GetCode() == KEY_RETURN )
|
|
|
|
|
{
|
|
|
|
|
// Auskommentierter Code aus svtools/source/contnr/svimpbox.cxx
|
|
|
|
|
SvLBoxEntry* pCursor = GetCurEntry();
|
|
|
|
|
if( pCursor->HasChilds() || pCursor->HasChildsOnDemand() )
|
|
|
|
|
{
|
|
|
|
|
if( IsExpanded( pCursor ) )
|
|
|
|
|
Collapse( pCursor );
|
|
|
|
|
else
|
|
|
|
|
Expand( pCursor );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DoubleClickHdl();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
SvTreeListBox::KeyInput( rKEvt );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
2001-04-04 15:41:39 +00:00
|
|
|
|
|* StartDrag-Request
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
2001-04-04 15:41:39 +00:00
|
|
|
|
void SdPageObjsTLB::StartDrag( sal_Int8 nAction, const Point& rPosPixel )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
{
|
2001-04-04 15:41:39 +00:00
|
|
|
|
SdNavigatorWin* pNavWin = NULL;
|
|
|
|
|
|
|
|
|
|
if( pFrame->HasChildWindow( SID_NAVIGATOR ) )
|
|
|
|
|
pNavWin = (SdNavigatorWin*) ( pFrame->GetChildWindow( SID_NAVIGATOR )->GetContextWindow( SD_MOD() ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2001-04-04 15:41:39 +00:00
|
|
|
|
if( pNavWin && pNavWin == pParent && pNavWin->GetNavigatorDragType() != NAVIGATOR_DRAGTYPE_NONE )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
{
|
2001-04-04 15:41:39 +00:00
|
|
|
|
// Aus dem ExecuteDrag heraus kann der Navigator geloescht werden
|
|
|
|
|
// (beim Umschalten auf einen anderen Dokument-Typ), das wuerde aber
|
|
|
|
|
// den StarView MouseMove-Handler, der Command() aufruft, umbringen.
|
|
|
|
|
// Deshalb Drag&Drop asynchron:
|
|
|
|
|
Application::PostUserEvent( STATIC_LINK( this, SdPageObjsTLB, ExecDragHdl ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
2001-04-04 15:41:39 +00:00
|
|
|
|
|* Begin drag
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
2001-04-04 15:41:39 +00:00
|
|
|
|
void SdPageObjsTLB::DoDrag()
|
2000-09-18 16:07:07 +00:00
|
|
|
|
{
|
2001-04-04 15:41:39 +00:00
|
|
|
|
pDropNavWin = ( pFrame->HasChildWindow( SID_NAVIGATOR ) ) ?
|
|
|
|
|
(SdNavigatorWin*)( pFrame->GetChildWindow( SID_NAVIGATOR )->GetContextWindow( SD_MOD() ) ) :
|
|
|
|
|
NULL;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2001-04-04 15:41:39 +00:00
|
|
|
|
if( pDropNavWin )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
{
|
2004-01-20 09:49:39 +00:00
|
|
|
|
::sd::DrawDocShell* pDocShell = pDoc->GetDocSh();
|
2005-01-11 11:10:59 +00:00
|
|
|
|
String aURL = INetURLObject( pDocShell->GetMedium()->GetPhysicalName(), INET_PROT_FILE ).GetMainURL( INetURLObject::NO_DECODE );
|
2001-04-04 15:41:39 +00:00
|
|
|
|
NavigatorDragType eDragType = pDropNavWin->GetNavigatorDragType();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2001-04-04 15:41:39 +00:00
|
|
|
|
aURL.Append( '#' );
|
|
|
|
|
aURL.Append( GetSelectEntry() );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2001-04-04 15:41:39 +00:00
|
|
|
|
INetBookmark aBookmark( aURL, GetSelectEntry() );
|
|
|
|
|
sal_Int8 nDNDActions = DND_ACTION_COPY;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2001-04-04 15:41:39 +00:00
|
|
|
|
if( eDragType == NAVIGATOR_DRAGTYPE_LINK )
|
2001-10-18 13:42:07 +00:00
|
|
|
|
nDNDActions = DND_ACTION_LINK; // #93240# Either COPY *or* LINK, never both!
|
2001-04-04 15:41:39 +00:00
|
|
|
|
|
|
|
|
|
SvTreeListBox::ReleaseMouse();
|
|
|
|
|
|
|
|
|
|
bIsInDrag = TRUE;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2001-04-04 15:41:39 +00:00
|
|
|
|
// object is destroyed by internal reference mechanism
|
2002-12-11 13:54:59 +00:00
|
|
|
|
( new SdPageObjsTLB::SdPageObjsTransferable( *this, aBookmark, *pDocShell, eDragType ) )->StartDrag( this, nDNDActions );
|
2001-04-04 15:41:39 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
2001-04-04 15:41:39 +00:00
|
|
|
|
|* Drag finished
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
2001-04-04 15:41:39 +00:00
|
|
|
|
void SdPageObjsTLB::DragFinished( sal_uInt8 nDropAction )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
{
|
2001-04-04 15:41:39 +00:00
|
|
|
|
if( pFrame->HasChildWindow( SID_NAVIGATOR ) )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
{
|
2001-04-04 15:41:39 +00:00
|
|
|
|
SdNavigatorWin* pNewNavWin = (SdNavigatorWin*) ( pFrame->GetChildWindow( SID_NAVIGATOR )->GetContextWindow( SD_MOD() ) );
|
|
|
|
|
|
|
|
|
|
if( pDropNavWin == pNewNavWin)
|
|
|
|
|
{
|
|
|
|
|
MouseEvent aMEvt( pDropNavWin->GetPointerPosPixel() );
|
|
|
|
|
SvTreeListBox::MouseButtonUp( aMEvt );
|
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
2001-04-04 15:41:39 +00:00
|
|
|
|
pDropNavWin = NULL;
|
|
|
|
|
bIsInDrag = FALSE;
|
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
2001-04-04 15:41:39 +00:00
|
|
|
|
|* AcceptDrop-Event
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
2001-04-04 15:41:39 +00:00
|
|
|
|
sal_Int8 SdPageObjsTLB::AcceptDrop( const AcceptDropEvent& rEvt )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
{
|
2001-04-04 15:41:39 +00:00
|
|
|
|
return( ( !bIsInDrag && IsDropFormatSupported( FORMAT_FILE ) ) ? rEvt.mnAction : DND_ACTION_NONE );
|
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2001-04-04 15:41:39 +00:00
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* ExecuteDrop-Event
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2001-04-04 15:41:39 +00:00
|
|
|
|
sal_Int8 SdPageObjsTLB::ExecuteDrop( const ExecuteDropEvent& rEvt )
|
|
|
|
|
{
|
|
|
|
|
sal_Int8 nRet = DND_ACTION_NONE;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2001-04-04 15:41:39 +00:00
|
|
|
|
if( !bIsInDrag )
|
|
|
|
|
{
|
|
|
|
|
SdNavigatorWin* pNavWin = NULL;
|
|
|
|
|
USHORT nId = SID_NAVIGATOR;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2001-04-04 15:41:39 +00:00
|
|
|
|
if( pFrame->HasChildWindow( nId ) )
|
|
|
|
|
pNavWin = (SdNavigatorWin*)( pFrame->GetChildWindow( nId )->GetContextWindow( SD_MOD() ) );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2001-04-04 15:41:39 +00:00
|
|
|
|
if( pNavWin && ( pNavWin == pParent ) )
|
2000-09-18 16:07:07 +00:00
|
|
|
|
{
|
2001-04-04 15:41:39 +00:00
|
|
|
|
TransferableDataHelper aDataHelper( rEvt.maDropEvent.Transferable );
|
|
|
|
|
String aFile;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
2001-04-04 15:41:39 +00:00
|
|
|
|
if( aDataHelper.GetString( FORMAT_FILE, aFile ) &&
|
|
|
|
|
( (SdNavigatorWin*) pParent)->InsertFile( aFile ) )
|
|
|
|
|
{
|
|
|
|
|
nRet = rEvt.mnAction;
|
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2001-04-04 15:41:39 +00:00
|
|
|
|
return nRet;
|
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|
|*
|
|
|
|
|
|* Handler fuers Dragging
|
|
|
|
|
|*
|
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
|
|
IMPL_STATIC_LINK(SdPageObjsTLB, ExecDragHdl, void*, EMPTYARG)
|
|
|
|
|
{
|
|
|
|
|
// als Link, damit asynchron ohne ImpMouseMoveMsg auf dem Stack auch der
|
|
|
|
|
// Navigator geloescht werden darf
|
|
|
|
|
pThis->DoDrag();
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2002-11-14 14:01:00 +00:00
|
|
|
|
bool SdPageObjsTLB::PageBelongsToCurrentShow (const SdPage* pPage) const
|
|
|
|
|
{
|
|
|
|
|
// Return <TRUE/> as default when there is no custom show or when none
|
|
|
|
|
// is used. The page does then belong to the standard show.
|
|
|
|
|
bool bBelongsToShow = true;
|
|
|
|
|
|
2004-11-26 19:04:15 +00:00
|
|
|
|
if (pDoc->getPresentationSettings().mbCustomShow)
|
2002-11-14 14:01:00 +00:00
|
|
|
|
{
|
|
|
|
|
// Get the current custom show.
|
|
|
|
|
SdCustomShow* pCustomShow = NULL;
|
|
|
|
|
List* pShowList = const_cast<SdDrawDocument*>(pDoc)->GetCustomShowList();
|
|
|
|
|
if (pShowList != NULL)
|
|
|
|
|
{
|
|
|
|
|
ULONG nCurrentShowIndex = pShowList->GetCurPos();
|
|
|
|
|
void* pObject = pShowList->GetObject(nCurrentShowIndex);
|
|
|
|
|
pCustomShow = static_cast<SdCustomShow*>(pObject);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Check whether the given page is part of that custom show.
|
|
|
|
|
if (pCustomShow != NULL)
|
|
|
|
|
{
|
|
|
|
|
bBelongsToShow = false;
|
|
|
|
|
ULONG nPageCount = pCustomShow->Count();
|
|
|
|
|
for (USHORT i=0; i<nPageCount && !bBelongsToShow; i++)
|
|
|
|
|
if (pPage == static_cast<SdPage*>(pCustomShow->GetObject (i)))
|
|
|
|
|
bBelongsToShow = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return bBelongsToShow;
|
|
|
|
|
}
|