2000-09-18 11:07:07 -05:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2008-04-10 13:45:39 -05:00
|
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2010-02-12 08:01:35 -06:00
|
|
|
* Copyright 2000, 2010 Oracle and/or its affiliates.
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2008-04-10 13:45:39 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2008-04-10 13:45:39 -05:00
|
|
|
* This file is part of OpenOffice.org.
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2008-04-10 13:45:39 -05:00
|
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
|
|
* only, as published by the Free Software Foundation.
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2008-04-10 13:45:39 -05:00
|
|
|
* OpenOffice.org 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 version 3 for more details
|
|
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2008-04-10 13:45:39 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
|
|
* <http://www.openoffice.org/license.html>
|
|
|
|
* for a copy of the LGPLv3 License.
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2006-09-16 12:40:08 -05:00
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
|
|
#include "precompiled_sd.hxx"
|
|
|
|
|
2004-08-23 02:16:45 -05:00
|
|
|
#ifdef SD_DLLIMPLEMENTATION
|
|
|
|
#undef SD_DLLIMPLEMENTATION
|
|
|
|
#endif
|
|
|
|
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
#include "inspagob.hxx"
|
|
|
|
|
|
|
|
#include "strings.hrc"
|
|
|
|
#include "res_bmp.hrc"
|
|
|
|
#include "sdresid.hxx"
|
|
|
|
#include "drawdoc.hxx"
|
2004-01-20 03:45:47 -06:00
|
|
|
#include "DrawDocShell.hxx"
|
|
|
|
#include "ViewShell.hxx"
|
2000-09-18 11:07:07 -05:00
|
|
|
#include "inspagob.hrc"
|
|
|
|
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Ctor
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2004-01-20 03:45:47 -06:00
|
|
|
SdInsertPagesObjsDlg::SdInsertPagesObjsDlg(
|
|
|
|
::Window* pWindow,
|
|
|
|
const SdDrawDocument* pInDoc,
|
|
|
|
SfxMedium* pSfxMedium,
|
|
|
|
const String& rFileName )
|
|
|
|
: ModalDialog ( pWindow, SdResId( DLG_INSERT_PAGES_OBJS ) ),
|
|
|
|
aLbTree ( this, SdResId( LB_TREE ) ),
|
2006-12-12 10:07:46 -06:00
|
|
|
aCbxLink ( this, SdResId( CBX_LINK ) ),
|
|
|
|
aCbxMasters ( this, SdResId( CBX_CHECK_MASTERS ) ),
|
2004-01-20 03:45:47 -06:00
|
|
|
aBtnOk ( this, SdResId( BTN_OK ) ),
|
|
|
|
aBtnCancel ( this, SdResId( BTN_CANCEL ) ),
|
|
|
|
aBtnHelp ( this, SdResId( BTN_HELP ) ),
|
|
|
|
pMedium ( pSfxMedium ),
|
2006-12-12 10:07:46 -06:00
|
|
|
mpDoc ( pInDoc ),
|
2004-01-20 03:45:47 -06:00
|
|
|
rName ( rFileName )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
|
|
|
FreeResource();
|
|
|
|
|
|
|
|
aLbTree.SetViewFrame( ( (SdDrawDocument*) pInDoc )->GetDocSh()->GetViewShell()->GetViewFrame() );
|
|
|
|
|
|
|
|
aLbTree.SetSelectHdl( LINK( this, SdInsertPagesObjsDlg, SelectObjectHdl ) );
|
|
|
|
|
|
|
|
// Text wird eingefuegt
|
|
|
|
if( !pMedium )
|
|
|
|
SetText( String( SdResId( STR_INSERT_TEXT ) ) );
|
|
|
|
|
|
|
|
Reset();
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Dtor
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
SdInsertPagesObjsDlg::~SdInsertPagesObjsDlg()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Fuellt die TreeLB in Abhaengigkeit des Mediums. Ist kein Medium
|
|
|
|
|* vorhanden, handelt es sich um ein Text- und kein Drawdokument
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
void SdInsertPagesObjsDlg::Reset()
|
|
|
|
{
|
|
|
|
if( pMedium )
|
|
|
|
{
|
|
|
|
aLbTree.SetSelectionMode( MULTIPLE_SELECTION );
|
2005-01-18 08:15:47 -06:00
|
|
|
|
|
|
|
// transfer ownership of Medium
|
2006-12-12 10:07:46 -06:00
|
|
|
aLbTree.Fill( mpDoc, pMedium, rName );
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Color aColor( COL_WHITE );
|
2002-05-31 08:20:03 -05:00
|
|
|
Bitmap aBmpText( SdResId( BMP_DOC_TEXT ) );
|
|
|
|
Image aImgText( aBmpText, aColor );
|
|
|
|
Bitmap aBmpTextH( SdResId( BMP_DOC_TEXT_H ) );
|
|
|
|
Image aImgTextH( aBmpTextH, Color( COL_BLACK ) );
|
2002-05-28 06:57:26 -05:00
|
|
|
SvLBoxEntry* pEntry = aLbTree.InsertEntry( rName, aImgText, aImgText );
|
|
|
|
aLbTree.SetExpandedEntryBmp( pEntry, aImgTextH, BMP_COLOR_HIGHCONTRAST );
|
|
|
|
aLbTree.SetCollapsedEntryBmp( pEntry, aImgTextH, BMP_COLOR_HIGHCONTRAST );
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
aCbxMasters.Check( TRUE );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Liefert die Liste zurueck
|
|
|
|
|* nType == 0 -> Seiten
|
|
|
|
|* nType == 1 -> Objekte
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
List* SdInsertPagesObjsDlg::GetList( USHORT nType )
|
|
|
|
{
|
|
|
|
// Bei Draw-Dokumenten muss bei der Selektion des Dokumentes NULL
|
|
|
|
// zurueckgegeben werden
|
|
|
|
if( pMedium )
|
|
|
|
{
|
|
|
|
// Um zu gewaehrleisten, dass die Bookmarks geoeffnet sind
|
|
|
|
// (Wenn gesamtes Dokument ausgewaehlt wurde)
|
|
|
|
aLbTree.GetBookmarkDoc();
|
|
|
|
|
|
|
|
// Wenn das Dokument (mit-)selektiert oder nichst selektiert ist,
|
|
|
|
// wird das gesamte Dokument (und nicht mehr!) eingefuegt.
|
|
|
|
if( aLbTree.GetSelectionCount() == 0 ||
|
|
|
|
( aLbTree.IsSelected( aLbTree.First() ) ) )
|
|
|
|
//return( aLbTree.GetBookmarkList( nType ) );
|
|
|
|
return( NULL ); // #37350#
|
|
|
|
}
|
|
|
|
return( aLbTree.GetSelectEntryList( nType ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Ist Verknuepfung gechecked
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
BOOL SdInsertPagesObjsDlg::IsLink()
|
|
|
|
{
|
|
|
|
return( aCbxLink.IsChecked() );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Ist Verknuepfung gechecked
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
BOOL SdInsertPagesObjsDlg::IsRemoveUnnessesaryMasterPages() const
|
|
|
|
{
|
|
|
|
return( aCbxMasters.IsChecked() );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* Enabled und selektiert Endfarben-LB
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
2006-12-12 10:07:46 -06:00
|
|
|
IMPL_LINK( SdInsertPagesObjsDlg, SelectObjectHdl, void *, EMPTYARG )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2002-12-06 09:51:18 -06:00
|
|
|
if( aLbTree.IsLinkableSelected() )
|
2000-09-18 11:07:07 -05:00
|
|
|
aCbxLink.Enable();
|
2002-12-06 09:51:18 -06:00
|
|
|
else
|
|
|
|
aCbxLink.Disable();
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
return( 0 );
|
|
|
|
}
|
|
|
|
|
|
|
|
|