2000-09-18 16:15:01 +00:00
|
|
|
|
/*************************************************************************
|
|
|
|
|
*
|
|
|
|
|
* $RCSfile: regionsw.cxx,v $
|
|
|
|
|
*
|
2003-03-27 14:45:43 +00:00
|
|
|
|
* $Revision: 1.26 $
|
2000-09-18 16:15:01 +00:00
|
|
|
|
*
|
2003-03-27 14:45:43 +00:00
|
|
|
|
* last change: $Author: hr $ $Date: 2003-03-27 15:42:55 $
|
2000-09-18 16:15:01 +00:00
|
|
|
|
*
|
|
|
|
|
* The Contents of this file are made available subject to the terms of
|
|
|
|
|
* either of the following licenses
|
|
|
|
|
*
|
|
|
|
|
* - GNU Lesser General Public License Version 2.1
|
|
|
|
|
* - Sun Industry Standards Source License Version 1.1
|
|
|
|
|
*
|
|
|
|
|
* Sun Microsystems Inc., October, 2000
|
|
|
|
|
*
|
|
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
|
* =============================================
|
|
|
|
|
* Copyright 2000 by Sun Microsystems, Inc.
|
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
|
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*
|
|
|
|
|
* 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
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* Sun Industry Standards Source License Version 1.1
|
|
|
|
|
* =================================================
|
|
|
|
|
* The contents of this file are subject to the Sun Industry Standards
|
|
|
|
|
* Source License Version 1.1 (the "License"); You may not use this file
|
|
|
|
|
* except in compliance with the License. You may obtain a copy of the
|
|
|
|
|
* License at http://www.openoffice.org/license.html.
|
|
|
|
|
*
|
|
|
|
|
* Software provided under this License is provided on an "AS IS" basis,
|
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
|
|
|
|
|
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
|
|
|
|
|
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
|
|
|
|
|
* See the License for the specific provisions governing your rights and
|
|
|
|
|
* obligations concerning the Software.
|
|
|
|
|
*
|
|
|
|
|
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
|
|
|
|
|
*
|
|
|
|
|
* Copyright: 2000 by Sun Microsystems, Inc.
|
|
|
|
|
*
|
|
|
|
|
* All Rights Reserved.
|
|
|
|
|
*
|
|
|
|
|
* Contributor(s): _______________________________________
|
|
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifdef PRECOMPILED
|
|
|
|
|
#include "ui_pch.hxx"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#pragma hdrstop
|
|
|
|
|
|
|
|
|
|
#ifndef _HINTIDS_HXX
|
|
|
|
|
#include <hintids.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _UITOOL_HXX
|
|
|
|
|
#include <uitool.hxx>
|
|
|
|
|
#endif
|
2001-11-14 15:30:21 +00:00
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
|
#ifndef SVTOOLS_URIHELPER_HXX
|
|
|
|
|
#include <svtools/urihelper.hxx>
|
|
|
|
|
#endif
|
2001-03-02 13:39:49 +00:00
|
|
|
|
#ifndef _SVTOOLS_PASSWORDHELPER_HXX
|
|
|
|
|
#include <svtools/PasswordHelper.hxx>
|
|
|
|
|
#endif
|
2000-09-18 16:15:01 +00:00
|
|
|
|
#ifndef _MSGBOX_HXX //autogen
|
|
|
|
|
#include <vcl/msgbox.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SFXSTRITEM_HXX //autogen
|
|
|
|
|
#include <svtools/stritem.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SFXENUMITEM_HXX //autogen
|
|
|
|
|
#include <svtools/eitem.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SOT_FORMATS_HXX //autogen
|
|
|
|
|
#include <sot/formats.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _PASSWD_HXX //autogen
|
|
|
|
|
#include <sfx2/passwd.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SFX_DOCFILT_HACK_HXX //autogen
|
|
|
|
|
#include <sfx2/docfilt.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SFXREQUEST_HXX //autogen
|
|
|
|
|
#include <sfx2/request.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SFXDOCFILE_HXX //autogen
|
|
|
|
|
#include <sfx2/docfile.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _OFF_APP_HXX //autogen
|
|
|
|
|
#include <offmgr/app.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _LINKMGR_HXX
|
|
|
|
|
#include <so3/linkmgr.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SVX_SIZEITEM_HXX //autogen
|
|
|
|
|
#define ITEMID_SIZE 0
|
|
|
|
|
#include <svx/sizeitem.hxx>
|
|
|
|
|
#endif
|
2001-11-14 15:30:21 +00:00
|
|
|
|
#ifndef _SVX_BACKGRND_HXX //autogen
|
|
|
|
|
#include <svx/backgrnd.hxx>
|
|
|
|
|
#endif
|
2000-09-18 16:15:01 +00:00
|
|
|
|
#ifndef _OFA_HTMLCFG_HXX
|
|
|
|
|
#include <offmgr/htmlcfg.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef _BOOKMRK_HXX //autogen
|
|
|
|
|
#include <bookmrk.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SECTION_HXX
|
|
|
|
|
#include <section.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _DOCARY_HXX
|
|
|
|
|
#include <docary.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _DOC_HXX
|
|
|
|
|
#include <doc.hxx> // fuers SwSectionFmt-Array
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _REGIONSW_HXX
|
|
|
|
|
#include <regionsw.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _BASESH_HXX
|
|
|
|
|
#include <basesh.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _WDOCSH_HXX
|
|
|
|
|
#include <wdocsh.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _VIEW_HXX
|
|
|
|
|
#include <view.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SWMODULE_HXX
|
|
|
|
|
#include <swmodule.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _WRTSH_HXX
|
|
|
|
|
#include <wrtsh.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SWUNDO_HXX
|
|
|
|
|
#include <swundo.hxx> // fuer Undo-Ids
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _COLUMN_HXX
|
|
|
|
|
#include <column.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _FMTFSIZE_HXX //autogen
|
|
|
|
|
#include <fmtfsize.hxx>
|
|
|
|
|
#endif
|
2001-11-14 15:30:21 +00:00
|
|
|
|
#ifndef _SWUNODEF_HXX
|
|
|
|
|
#include <swunodef.hxx>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _SHELLIO_HXX
|
|
|
|
|
#include <shellio.hxx>
|
2000-09-18 16:15:01 +00:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifndef _HELPID_H
|
|
|
|
|
#include <helpid.h>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _CMDID_H
|
|
|
|
|
#include <cmdid.h>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _REGIONSW_HRC
|
|
|
|
|
#include <regionsw.hrc>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _COMCORE_HRC
|
|
|
|
|
#include <comcore.hrc>
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef _GLOBALS_HRC
|
|
|
|
|
#include <globals.hrc>
|
|
|
|
|
#endif
|
2002-08-07 12:20:38 +00:00
|
|
|
|
#ifndef _SFX_BINDINGS_HXX
|
|
|
|
|
#include <sfx2/bindings.hxx>
|
|
|
|
|
#endif
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
2001-02-16 08:31:07 +00:00
|
|
|
|
#define FILE_NAME_LENGTH 17
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
SV_IMPL_OP_PTRARR_SORT( SectReprArr, SectReprPtr )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
USHORT lcl_GetRegion( const String& rRegionName, SwWrtShell& rWrtShell );
|
|
|
|
|
void lcl_ReadSections( SwWrtShell& rSh, SfxMedium& rMedium, ComboBox& rBox );
|
|
|
|
|
|
|
|
|
|
/* -----------------25.06.99 15:38-------------------
|
|
|
|
|
|
|
|
|
|
--------------------------------------------------*/
|
|
|
|
|
class SwTestPasswdDlg : public SfxPasswordDialog
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
SwTestPasswdDlg(Window* pParent) :
|
|
|
|
|
SfxPasswordDialog(pParent)
|
|
|
|
|
{
|
|
|
|
|
SetHelpId(HID_DLG_PASSWD_SECTION);
|
|
|
|
|
}
|
|
|
|
|
};
|
2001-03-02 13:39:49 +00:00
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
|
/*----------------------------------------------------------------------------
|
|
|
|
|
Beschreibung: User Data Klasse fuer Bereichsinformationen
|
|
|
|
|
----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
SectRepr::SectRepr( USHORT nPos, SwSection& rSect ) :
|
|
|
|
|
aSection( CONTENT_SECTION, aEmptyStr ),
|
2001-04-27 11:10:09 +00:00
|
|
|
|
bSelected(FALSE)
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
|
|
|
|
aSection = rSect;
|
|
|
|
|
bContent = aSection.GetLinkFileName().Len() == 0;
|
|
|
|
|
nArrPos=nPos;
|
|
|
|
|
SwSectionFmt *pFmt = rSect.GetFmt();
|
|
|
|
|
if( pFmt )
|
|
|
|
|
{
|
|
|
|
|
aCol = pFmt->GetCol();
|
|
|
|
|
aBrush = pFmt->GetBackground();
|
|
|
|
|
aFtnNtAtEnd = pFmt->GetFtnAtTxtEnd();
|
|
|
|
|
aEndNtAtEnd = pFmt->GetEndAtTxtEnd();
|
|
|
|
|
aBalance.SetValue(pFmt->GetBalancedColumns().GetValue());
|
2002-06-19 13:04:16 +00:00
|
|
|
|
aFrmDirItem = pFmt->GetFrmDir();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SectRepr::SetFile( const String& rFile )
|
|
|
|
|
{
|
|
|
|
|
String sNewFile( INetURLObject::decode( rFile, INET_HEX_ESCAPE,
|
2000-10-20 12:46:39 +00:00
|
|
|
|
INetURLObject::DECODE_UNAMBIGUOUS,
|
2000-09-18 16:15:01 +00:00
|
|
|
|
RTL_TEXTENCODING_UTF8 ));
|
|
|
|
|
String sOldFileName( aSection.GetLinkFileName() );
|
2001-07-05 12:26:33 +00:00
|
|
|
|
String sSub( sOldFileName.GetToken( 2, so3::cTokenSeperator ) );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
if( rFile.Len() || sSub.Len() )
|
|
|
|
|
{
|
2001-07-05 12:26:33 +00:00
|
|
|
|
sNewFile += so3::cTokenSeperator;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
if( rFile.Len() ) // Filter nur mit FileName
|
2001-07-05 12:26:33 +00:00
|
|
|
|
sNewFile += sOldFileName.GetToken( 1, so3::cTokenSeperator );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
2001-07-05 12:26:33 +00:00
|
|
|
|
sNewFile += so3::cTokenSeperator;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
sNewFile += sSub;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
aSection.SetLinkFileName( sNewFile );
|
|
|
|
|
|
|
|
|
|
if( rFile.Len() || sSub.Len() )
|
|
|
|
|
aSection.SetType( FILE_LINK_SECTION );
|
|
|
|
|
else
|
|
|
|
|
aSection.SetType( CONTENT_SECTION );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SectRepr::SetFilter( const String& rFilter )
|
|
|
|
|
{
|
|
|
|
|
String sNewFile;
|
|
|
|
|
String sOldFileName( aSection.GetLinkFileName() );
|
2001-07-05 12:26:33 +00:00
|
|
|
|
String sFile( sOldFileName.GetToken( 0, so3::cTokenSeperator ) );
|
|
|
|
|
String sSub( sOldFileName.GetToken( 2, so3::cTokenSeperator ) );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
if( sFile.Len() )
|
2001-07-05 12:26:33 +00:00
|
|
|
|
(((( sNewFile = sFile ) += so3::cTokenSeperator ) += rFilter )
|
|
|
|
|
+= so3::cTokenSeperator ) += sSub;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
else if( sSub.Len() )
|
2001-07-05 12:26:33 +00:00
|
|
|
|
(( sNewFile = so3::cTokenSeperator ) += so3::cTokenSeperator ) += sSub;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
aSection.SetLinkFileName( sNewFile );
|
|
|
|
|
|
|
|
|
|
if( sNewFile.Len() )
|
|
|
|
|
aSection.SetType( FILE_LINK_SECTION );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SectRepr::SetSubRegion(const String& rSubRegion)
|
|
|
|
|
{
|
|
|
|
|
String sNewFile;
|
|
|
|
|
String sOldFileName( aSection.GetLinkFileName() );
|
2001-07-05 12:26:33 +00:00
|
|
|
|
String sFilter( sOldFileName.GetToken( 1, so3::cTokenSeperator ) );
|
|
|
|
|
sOldFileName = sOldFileName.GetToken( 0, so3::cTokenSeperator );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
if( rSubRegion.Len() || sOldFileName.Len() )
|
2001-07-05 12:26:33 +00:00
|
|
|
|
(((( sNewFile = sOldFileName ) += so3::cTokenSeperator ) += sFilter )
|
|
|
|
|
+= so3::cTokenSeperator ) += rSubRegion;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
aSection.SetLinkFileName( sNewFile );
|
|
|
|
|
|
|
|
|
|
if( rSubRegion.Len() || sOldFileName.Len() )
|
|
|
|
|
aSection.SetType( FILE_LINK_SECTION );
|
|
|
|
|
else
|
|
|
|
|
aSection.SetType( CONTENT_SECTION );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String SectRepr::GetFile() const
|
|
|
|
|
{
|
|
|
|
|
String sLinkFile( aSection.GetLinkFileName() );
|
|
|
|
|
if( sLinkFile.Len() )
|
|
|
|
|
{
|
|
|
|
|
#ifdef DDE_AVAILABLE
|
|
|
|
|
if( DDE_LINK_SECTION == aSection.GetType() )
|
|
|
|
|
{
|
2001-07-05 12:26:33 +00:00
|
|
|
|
USHORT n = sLinkFile.SearchAndReplace( so3::cTokenSeperator, ' ' );
|
|
|
|
|
sLinkFile.SearchAndReplace( so3::cTokenSeperator, ' ', n );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
#endif
|
2001-07-05 12:26:33 +00:00
|
|
|
|
sLinkFile = INetURLObject::decode( sLinkFile.GetToken( 0,
|
|
|
|
|
so3::cTokenSeperator ),
|
2001-02-23 14:05:32 +00:00
|
|
|
|
INET_HEX_ESCAPE,
|
|
|
|
|
INetURLObject::DECODE_UNAMBIGUOUS,
|
|
|
|
|
RTL_TEXTENCODING_UTF8 );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
return sLinkFile;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String SectRepr::GetSubRegion() const
|
|
|
|
|
{
|
|
|
|
|
String sLinkFile( aSection.GetLinkFileName() );
|
|
|
|
|
if( sLinkFile.Len() )
|
2001-07-05 12:26:33 +00:00
|
|
|
|
sLinkFile = sLinkFile.GetToken( 2, so3::cTokenSeperator );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
return sLinkFile;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------
|
|
|
|
|
Beschreibung: Dialog Bearbeiten Bereiche
|
|
|
|
|
----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
//---------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
SwEditRegionDlg::SwEditRegionDlg( Window* pParent, SwWrtShell& rWrtSh )
|
|
|
|
|
: SfxModalDialog( pParent, SW_RES(MD_EDIT_REGION) ),
|
|
|
|
|
pAktEntry( 0 ),
|
|
|
|
|
rSh( rWrtSh ),
|
2001-04-27 11:10:09 +00:00
|
|
|
|
aNameFL ( this, SW_RES( FL_NAME ) ),
|
|
|
|
|
aCurName ( this, SW_RES( ED_RANAME ) ),
|
|
|
|
|
aTree ( this, SW_RES( TLB_SECTION )),
|
|
|
|
|
aLinkFL ( this, SW_RES( FL_LINK ) ),
|
|
|
|
|
aFileCB ( this, SW_RES( CB_FILE ) ),
|
2000-09-18 16:15:01 +00:00
|
|
|
|
#ifdef DDE_AVAILABLE
|
|
|
|
|
aDDECB ( this, SW_RES( CB_DDE ) ) ,
|
|
|
|
|
aDDECommandFT ( this, SW_RES( FT_DDE ) ) ,
|
|
|
|
|
#endif
|
2001-04-27 11:10:09 +00:00
|
|
|
|
aFileNameFT ( this, SW_RES( FT_FILE ) ) ,
|
|
|
|
|
aFileNameED ( this, SW_RES( ED_FILE ) ),
|
|
|
|
|
aFilePB ( this, SW_RES( PB_FILE ) ),
|
|
|
|
|
aSubRegionFT ( this, SW_RES( FT_SUBREG ) ) ,
|
|
|
|
|
aSubRegionED ( this, SW_RES( LB_SUBREG ) ) ,
|
|
|
|
|
|
|
|
|
|
aProtectFL ( this, SW_RES( FL_PROTECT ) ),
|
|
|
|
|
aProtectCB ( this, SW_RES( CB_PROTECT ) ),
|
|
|
|
|
aPasswdCB ( this, SW_RES( CB_PASSWD ) ),
|
|
|
|
|
aPasswdPB ( this, SW_RES( PB_PASSWD ) ),
|
|
|
|
|
|
|
|
|
|
aHideFL ( this, SW_RES( FL_HIDE ) ),
|
|
|
|
|
aHideCB ( this, SW_RES( CB_HIDE ) ),
|
|
|
|
|
aConditionFT ( this, SW_RES( FT_CONDITION ) ),
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aConditionED ( this, SW_RES( ED_CONDITION ) ),
|
2001-04-27 11:10:09 +00:00
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aOK ( this, SW_RES( PB_OK ) ),
|
|
|
|
|
aOptionsPB ( this, SW_RES( PB_OPTIONS ) ),
|
|
|
|
|
aDismiss ( this, SW_RES( CB_DISMISS ) ),
|
|
|
|
|
aHelp ( this, SW_RES( PB_HELP ) ),
|
|
|
|
|
aCancel ( this, SW_RES( PB_CANCEL ) ),
|
2002-05-08 13:10:51 +00:00
|
|
|
|
aImageIL( ResId(IL_BITMAPS)),
|
|
|
|
|
aImageILH( ResId(ILH_BITMAPS)),
|
2001-04-27 11:10:09 +00:00
|
|
|
|
bDontCheckPasswd(sal_True)
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
|
|
|
|
FreeResource();
|
2001-04-27 11:10:09 +00:00
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
|
bWeb = 0 != PTR_CAST( SwWebDocShell, rSh.GetView().GetDocShell() );
|
|
|
|
|
|
|
|
|
|
aTree.SetSelectHdl ( LINK( this, SwEditRegionDlg, GetFirstEntryHdl));
|
|
|
|
|
aTree.SetDeselectHdl ( LINK( this, SwEditRegionDlg, DeselectHdl));
|
|
|
|
|
aCurName.SetModifyHdl ( LINK( this, SwEditRegionDlg, NameEditHdl));
|
|
|
|
|
aConditionED.SetModifyHdl( LINK( this, SwEditRegionDlg, ConditionEditHdl));
|
|
|
|
|
aOK.SetClickHdl ( LINK( this, SwEditRegionDlg, OkHdl));
|
|
|
|
|
aPasswdCB.SetClickHdl ( LINK( this, SwEditRegionDlg, ChangePasswdHdl));
|
2001-04-27 11:10:09 +00:00
|
|
|
|
aPasswdPB.SetClickHdl ( LINK( this, SwEditRegionDlg, ChangePasswdHdl));
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aHideCB.SetClickHdl ( LINK( this, SwEditRegionDlg, ChangeHideHdl));
|
|
|
|
|
aOptionsPB.Show();
|
|
|
|
|
aOptionsPB.SetClickHdl ( LINK( this, SwEditRegionDlg, OptionsHdl));
|
|
|
|
|
aProtectCB.SetClickHdl ( LINK( this, SwEditRegionDlg, ChangeProtectHdl));
|
|
|
|
|
aDismiss.SetClickHdl ( LINK( this, SwEditRegionDlg, ChangeDismissHdl));
|
|
|
|
|
aFileCB.SetClickHdl ( LINK( this, SwEditRegionDlg, UseFileHdl ));
|
|
|
|
|
aFilePB.SetClickHdl ( LINK( this, SwEditRegionDlg, FileSearchHdl ));
|
|
|
|
|
aFileNameED.SetModifyHdl( LINK( this, SwEditRegionDlg, FileNameHdl ));
|
|
|
|
|
aSubRegionED.SetModifyHdl( LINK( this, SwEditRegionDlg, FileNameHdl ));
|
|
|
|
|
|
|
|
|
|
aTree.SetHelpId(HID_REGION_TREE);
|
|
|
|
|
aTree.SetSelectionMode( MULTIPLE_SELECTION );
|
|
|
|
|
aTree.SetWindowBits(WB_HASBUTTONSATROOT|WB_CLIPCHILDREN|WB_HSCROLL);
|
|
|
|
|
aTree.SetSpaceBetweenEntries(0);
|
|
|
|
|
|
|
|
|
|
if(bWeb)
|
|
|
|
|
{
|
2001-04-27 11:10:09 +00:00
|
|
|
|
aConditionFT .Hide();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aConditionED .Hide();
|
|
|
|
|
aPasswdCB .Hide();
|
|
|
|
|
aHideCB .Hide();
|
|
|
|
|
#ifdef DDE_AVAILABLE
|
|
|
|
|
aDDECB .Hide();
|
|
|
|
|
aDDECommandFT .Hide();
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef DDE_AVAILABLE
|
|
|
|
|
aDDECB.SetClickHdl ( LINK( this, SwEditRegionDlg, DDEHdl ));
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
//Ermitteln der vorhandenen Bereiche
|
|
|
|
|
pCurrSect = rSh.GetCurrSection();
|
|
|
|
|
RecurseList( 0, 0 );
|
|
|
|
|
//falls der Cursor nicht in einem Bereich steht,
|
|
|
|
|
//wird immer der erste selektiert
|
|
|
|
|
if( !aTree.FirstSelected() && aTree.First() )
|
|
|
|
|
aTree.Select( aTree.First() );
|
|
|
|
|
aTree.Show();
|
2001-04-27 11:10:09 +00:00
|
|
|
|
bDontCheckPasswd = sal_False;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
2001-04-27 11:10:09 +00:00
|
|
|
|
/* -----------------------------26.04.01 14:56--------------------------------
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
2001-04-27 11:10:09 +00:00
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
|
BOOL SwEditRegionDlg::CheckPasswd(CheckBox* pBox)
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
2001-04-27 11:10:09 +00:00
|
|
|
|
if(bDontCheckPasswd)
|
|
|
|
|
return TRUE;
|
|
|
|
|
sal_Bool bRet = TRUE;
|
|
|
|
|
SvLBoxEntry* pEntry = aTree.FirstSelected();
|
|
|
|
|
while( pEntry )
|
|
|
|
|
{
|
|
|
|
|
SectReprPtr pRepr = (SectReprPtr)pEntry->GetUserData();
|
|
|
|
|
if(!pRepr->GetTempPasswd().getLength() && pRepr->GetPasswd().getLength())
|
|
|
|
|
{
|
|
|
|
|
SwTestPasswdDlg aPasswdDlg(this);
|
|
|
|
|
bRet = FALSE;
|
|
|
|
|
if (aPasswdDlg.Execute())
|
|
|
|
|
{
|
|
|
|
|
String sNewPasswd( aPasswdDlg.GetPassword() );
|
2001-11-14 15:30:21 +00:00
|
|
|
|
UNO_NMSPC::Sequence <sal_Int8 > aNewPasswd;
|
2001-04-27 11:10:09 +00:00
|
|
|
|
SvPasswordHelper::GetHashPassword( aNewPasswd, sNewPasswd );
|
2002-08-05 07:40:26 +00:00
|
|
|
|
if(SvPasswordHelper::CompareHashPassword(pRepr->GetPasswd(), sNewPasswd))
|
2001-04-27 11:10:09 +00:00
|
|
|
|
{
|
|
|
|
|
pRepr->SetTempPasswd(aNewPasswd);
|
|
|
|
|
bRet = TRUE;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
InfoBox(this, SW_RES(REG_WRONG_PASSWORD)).Execute();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
pEntry = aTree.NextSelected(pEntry);
|
|
|
|
|
}
|
|
|
|
|
if(!bRet && pBox)
|
|
|
|
|
{
|
|
|
|
|
//reset old button state
|
|
|
|
|
if(pBox->IsTriStateEnabled())
|
|
|
|
|
pBox->SetState(pBox->IsChecked() ? STATE_NOCHECK : STATE_DONTKNOW);
|
|
|
|
|
else
|
|
|
|
|
pBox->Check(!pBox->IsChecked());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return bRet;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
/*---------------------------------------------------------------------
|
|
|
|
|
Beschreibung: Durchsuchen nach Child-Sections, rekursiv
|
|
|
|
|
---------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
void SwEditRegionDlg::RecurseList( const SwSectionFmt* pFmt, SvLBoxEntry* pEntry )
|
|
|
|
|
{
|
|
|
|
|
SwSection* pSect;
|
|
|
|
|
SvLBoxEntry* pSelEntry = 0;
|
|
|
|
|
|
|
|
|
|
if (!pFmt)
|
|
|
|
|
{
|
|
|
|
|
SvLBoxEntry* pEntry;
|
|
|
|
|
const SwSectionFmt* pFmt;
|
|
|
|
|
USHORT nCount=rSh.GetSectionFmtCount();
|
|
|
|
|
for ( USHORT n=0; n < nCount; n++ )
|
|
|
|
|
{
|
|
|
|
|
SectionType eTmpType;
|
|
|
|
|
if( !( pFmt = &rSh.GetSectionFmt(n))->GetParent() &&
|
|
|
|
|
pFmt->IsInNodesArr() &&
|
|
|
|
|
(eTmpType = pFmt->GetSection()->GetType()) != TOX_CONTENT_SECTION
|
|
|
|
|
&& TOX_HEADER_SECTION != eTmpType )
|
|
|
|
|
{
|
|
|
|
|
SectRepr* pSectRepr = new SectRepr( n,
|
|
|
|
|
*(pSect=pFmt->GetSection()) );
|
2002-06-06 12:36:24 +00:00
|
|
|
|
Image aImg = BuildBitmap( pSect->IsProtect(),pSect->IsHidden(), FALSE);
|
2002-05-08 13:10:51 +00:00
|
|
|
|
pEntry = aTree.InsertEntry( pSect->GetName(), aImg, aImg );
|
2002-06-06 12:36:24 +00:00
|
|
|
|
Image aHCImg = BuildBitmap( pSect->IsProtect(),pSect->IsHidden(), TRUE);
|
|
|
|
|
aTree.SetExpandedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
|
|
|
|
|
aTree.SetCollapsedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
pEntry->SetUserData(pSectRepr);
|
|
|
|
|
RecurseList( pFmt, pEntry );
|
|
|
|
|
if (pEntry->HasChilds())
|
|
|
|
|
aTree.Expand(pEntry);
|
|
|
|
|
if (pCurrSect==pSect)
|
|
|
|
|
aTree.Select(pEntry);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
SwSections aTmpArr;
|
|
|
|
|
SvLBoxEntry* pNEntry;
|
|
|
|
|
USHORT nCnt = pFmt->GetChildSections(aTmpArr,SORTSECT_POS);
|
|
|
|
|
if( nCnt )
|
|
|
|
|
{
|
|
|
|
|
for( USHORT n = 0; n < nCnt; ++n )
|
|
|
|
|
{
|
|
|
|
|
SectionType eTmpType;
|
|
|
|
|
const SwSectionFmt* pFmt = aTmpArr[n]->GetFmt();
|
|
|
|
|
if( pFmt->IsInNodesArr() &&
|
|
|
|
|
(eTmpType = pFmt->GetSection()->GetType()) != TOX_CONTENT_SECTION
|
|
|
|
|
&& TOX_HEADER_SECTION != eTmpType )
|
|
|
|
|
{
|
|
|
|
|
pSect=aTmpArr[n];
|
|
|
|
|
SectRepr* pSectRepr=new SectRepr(
|
|
|
|
|
FindArrPos( pSect->GetFmt() ), *pSect );
|
2002-05-08 13:10:51 +00:00
|
|
|
|
Image aImage = BuildBitmap( pSect->IsProtect(),
|
2002-06-06 12:36:24 +00:00
|
|
|
|
pSect->IsHidden(), FALSE);
|
2002-05-08 13:10:51 +00:00
|
|
|
|
pNEntry=aTree.InsertEntry( pSect->GetName(), aImage, aImage, pEntry);
|
2002-06-06 12:36:24 +00:00
|
|
|
|
Image aHCImg = BuildBitmap( pSect->IsProtect(),pSect->IsHidden(), TRUE);
|
|
|
|
|
aTree.SetExpandedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
|
|
|
|
|
aTree.SetCollapsedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
pNEntry->SetUserData(pSectRepr);
|
|
|
|
|
RecurseList( aTmpArr[n]->GetFmt(), pNEntry );
|
|
|
|
|
if( pNEntry->HasChilds())
|
|
|
|
|
aTree.Expand(pNEntry);
|
|
|
|
|
if (pCurrSect==pSect)
|
|
|
|
|
pSelEntry = pNEntry;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(0 != pSelEntry)
|
|
|
|
|
{
|
|
|
|
|
aTree.MakeVisible(pSelEntry);
|
|
|
|
|
aTree.Select(pSelEntry);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/*---------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
USHORT SwEditRegionDlg::FindArrPos(const SwSectionFmt* pFmt )
|
|
|
|
|
{
|
|
|
|
|
USHORT nCount=rSh.GetSectionFmtCount();
|
|
|
|
|
for (USHORT i=0;i<nCount;i++)
|
|
|
|
|
if (pFmt==&rSh.GetSectionFmt(i))
|
|
|
|
|
return i;
|
|
|
|
|
|
|
|
|
|
DBG_ERROR( "SectionFormat nicht in der Liste" );
|
|
|
|
|
return USHRT_MAX;
|
|
|
|
|
}
|
|
|
|
|
/*---------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
---------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
SwEditRegionDlg::~SwEditRegionDlg( )
|
|
|
|
|
{
|
|
|
|
|
SvLBoxEntry* pEntry = aTree.First();
|
|
|
|
|
while( pEntry )
|
|
|
|
|
{
|
|
|
|
|
delete (SectRepr*)pEntry->GetUserData();
|
|
|
|
|
pEntry = aTree.Next( pEntry );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
aSectReprArr.DeleteAndDestroy( 0, aSectReprArr.Count() );
|
|
|
|
|
}
|
2001-10-09 13:41:07 +00:00
|
|
|
|
/* -----------------------------09.10.2001 15:41------------------------------
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
2001-10-09 13:41:07 +00:00
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
|
void SwEditRegionDlg::SelectSection(const String& rSectionName)
|
|
|
|
|
{
|
|
|
|
|
SvLBoxEntry* pEntry = aTree.First();
|
|
|
|
|
while(pEntry)
|
|
|
|
|
{
|
|
|
|
|
SectReprPtr pRepr = (SectReprPtr)pEntry->GetUserData();
|
|
|
|
|
if(pRepr->GetSection().GetName() == rSectionName)
|
|
|
|
|
break;
|
|
|
|
|
pEntry = aTree.Next(pEntry);
|
|
|
|
|
}
|
|
|
|
|
if(pEntry)
|
|
|
|
|
{
|
|
|
|
|
aTree.SelectAll( FALSE);
|
|
|
|
|
aTree.Select(pEntry);
|
|
|
|
|
aTree.MakeVisible(pEntry);
|
|
|
|
|
}
|
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
/*---------------------------------------------------------------------
|
|
|
|
|
Beschreibung: Selektierte Eintrag in der TreeListBox wird im
|
|
|
|
|
Edit-Fenster angezeigt
|
|
|
|
|
Bei Multiselektion werden einige Controls disabled
|
|
|
|
|
---------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
IMPL_LINK( SwEditRegionDlg, GetFirstEntryHdl, SvTreeListBox *, pBox )
|
|
|
|
|
{
|
2001-04-27 11:10:09 +00:00
|
|
|
|
bDontCheckPasswd = sal_True;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
SvLBoxEntry* pEntry=pBox->FirstSelected();
|
|
|
|
|
aHideCB .Enable(TRUE);
|
|
|
|
|
aProtectCB .Enable(TRUE);
|
|
|
|
|
aFileCB .Enable(TRUE);
|
2001-11-14 15:30:21 +00:00
|
|
|
|
UNO_NMSPC::Sequence <sal_Int8> aCurPasswd;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
if( 1 < pBox->GetSelectionCount() )
|
|
|
|
|
{
|
|
|
|
|
aHideCB.EnableTriState( TRUE );
|
|
|
|
|
aProtectCB.EnableTriState( TRUE );
|
|
|
|
|
aFileCB.EnableTriState( TRUE );
|
|
|
|
|
|
|
|
|
|
BOOL bHiddenValid = TRUE;
|
|
|
|
|
BOOL bProtectValid = TRUE;
|
|
|
|
|
BOOL bConditionValid = TRUE;
|
|
|
|
|
BOOL bHidden = TRUE;
|
|
|
|
|
BOOL bProtect = TRUE;
|
|
|
|
|
String sCondition;
|
|
|
|
|
BOOL bFirst = TRUE;
|
|
|
|
|
BOOL bFileValid = TRUE;
|
|
|
|
|
BOOL bFile = TRUE;
|
2001-04-27 11:10:09 +00:00
|
|
|
|
BOOL bPasswdValid = TRUE;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
SvLBoxEntry* pEntry = pBox->FirstSelected();
|
|
|
|
|
while( pEntry )
|
|
|
|
|
{
|
|
|
|
|
SectRepr* pRepr=(SectRepr*) pEntry->GetUserData();
|
|
|
|
|
if(bFirst)
|
|
|
|
|
{
|
|
|
|
|
sCondition = pRepr->GetCondition();
|
|
|
|
|
bHidden = pRepr->IsHidden();
|
|
|
|
|
bProtect = pRepr->IsProtect();
|
|
|
|
|
bFile = pRepr->GetSectionType() != CONTENT_SECTION;
|
2001-04-27 11:10:09 +00:00
|
|
|
|
aCurPasswd = pRepr->GetPasswd();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
String sTemp(pRepr->GetCondition());
|
|
|
|
|
if(sCondition != sTemp)
|
|
|
|
|
bConditionValid = FALSE;
|
|
|
|
|
bHiddenValid = bHidden == pRepr->IsHidden();
|
|
|
|
|
bProtectValid = bProtect == pRepr->IsProtect();
|
|
|
|
|
bFileValid = (pRepr->GetSectionType() != CONTENT_SECTION) == bFile;
|
2001-04-27 11:10:09 +00:00
|
|
|
|
bPasswdValid = aCurPasswd == pRepr->GetPasswd();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
pEntry = pBox->NextSelected(pEntry);
|
|
|
|
|
bFirst = FALSE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
aHideCB.SetState( !bHiddenValid ? STATE_DONTKNOW :
|
|
|
|
|
bHidden ? STATE_CHECK : STATE_NOCHECK);
|
|
|
|
|
aProtectCB.SetState( !bProtectValid ? STATE_DONTKNOW :
|
|
|
|
|
bProtect ? STATE_CHECK : STATE_NOCHECK);
|
|
|
|
|
aFileCB.SetState(!bFileValid ? STATE_DONTKNOW :
|
|
|
|
|
bFile ? STATE_CHECK : STATE_NOCHECK);
|
|
|
|
|
|
|
|
|
|
if(bConditionValid)
|
|
|
|
|
aConditionED.SetText(sCondition);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// aConditionED.SetText(aEmptyStr);
|
2001-04-27 11:10:09 +00:00
|
|
|
|
aConditionFT.Enable(FALSE);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aConditionED.Enable(FALSE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
aFilePB.Enable(FALSE);
|
|
|
|
|
aFileNameFT .Enable(FALSE);
|
|
|
|
|
aFileNameED .Enable(FALSE);
|
|
|
|
|
aSubRegionFT.Enable(FALSE);
|
|
|
|
|
aSubRegionED.Enable(FALSE);
|
2001-04-27 11:10:09 +00:00
|
|
|
|
// aNameFT .Enable(FALSE);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aCurName .Enable(FALSE);
|
|
|
|
|
aOptionsPB .Enable(FALSE);
|
|
|
|
|
#ifdef DDE_AVAILABLE
|
|
|
|
|
aDDECB .Enable(FALSE);
|
|
|
|
|
aDDECommandFT .Enable(FALSE);
|
|
|
|
|
#endif
|
2001-05-30 06:35:37 +00:00
|
|
|
|
BOOL bPasswdEnabled = aProtectCB.GetState() == STATE_CHECK;
|
|
|
|
|
aPasswdCB.Enable(bPasswdEnabled);
|
|
|
|
|
aPasswdPB.Enable(bPasswdEnabled);
|
2001-04-27 11:10:09 +00:00
|
|
|
|
if(!bPasswdValid)
|
|
|
|
|
{
|
|
|
|
|
pEntry = pBox->FirstSelected();
|
|
|
|
|
pBox->SelectAll( FALSE );
|
|
|
|
|
pBox->Select( pEntry );
|
|
|
|
|
GetFirstEntryHdl(pBox);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
aPasswdCB.Check(aCurPasswd.getLength() > 0);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
else if (pEntry )
|
|
|
|
|
{
|
2001-04-27 11:10:09 +00:00
|
|
|
|
// aNameFT .Enable(TRUE);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aCurName .Enable(TRUE);
|
|
|
|
|
aOptionsPB .Enable(TRUE);
|
|
|
|
|
SectRepr* pRepr=(SectRepr*) pEntry->GetUserData();
|
|
|
|
|
aConditionED.SetText(pRepr->GetCondition());
|
|
|
|
|
aHideCB.Enable();
|
|
|
|
|
aHideCB.SetState(pRepr->IsHidden() ? STATE_CHECK : STATE_NOCHECK);
|
|
|
|
|
BOOL bHide = STATE_CHECK == aHideCB.GetState();
|
2001-04-27 11:10:09 +00:00
|
|
|
|
aConditionED.Enable(bHide);
|
|
|
|
|
aConditionFT.Enable(bHide);
|
|
|
|
|
aPasswdCB.Check(pRepr->GetPasswd().getLength() > 0);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
aOK.Enable();
|
|
|
|
|
aPasswdCB.Enable();
|
|
|
|
|
aCurName.SetText(pBox->GetEntryText(pEntry));
|
|
|
|
|
aCurName.Enable();
|
|
|
|
|
aDismiss.Enable();
|
|
|
|
|
String aFile = pRepr->GetFile();
|
|
|
|
|
String sSub = pRepr->GetSubRegion();
|
|
|
|
|
if(aFile.Len()||sSub.Len())
|
|
|
|
|
{
|
|
|
|
|
aFileCB.Check(TRUE);
|
|
|
|
|
aFileNameED.SetText(aFile);
|
|
|
|
|
aSubRegionED.SetText(sSub);
|
|
|
|
|
#ifdef DDE_AVAILABLE
|
|
|
|
|
aDDECB.Check(pRepr->GetSectionType() == DDE_LINK_SECTION );
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
aFileCB.Check(FALSE);
|
|
|
|
|
aFileNameED.SetText(aFile);
|
|
|
|
|
#ifdef DDE_AVAILABLE
|
|
|
|
|
aDDECB.Enable(FALSE);
|
|
|
|
|
aDDECB.Check(FALSE);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
UseFileHdl(&aFileCB);
|
|
|
|
|
#ifdef DDE_AVAILABLE
|
|
|
|
|
DDEHdl( &aDDECB );
|
|
|
|
|
#endif
|
|
|
|
|
aProtectCB.SetState(pRepr->IsProtect() ? STATE_CHECK : STATE_NOCHECK);
|
|
|
|
|
aProtectCB.Enable();
|
2001-05-30 06:35:37 +00:00
|
|
|
|
BOOL bPasswdEnabled = aProtectCB.IsChecked();
|
|
|
|
|
aPasswdCB.Enable(bPasswdEnabled);
|
|
|
|
|
aPasswdPB.Enable(bPasswdEnabled);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
2001-04-27 11:10:09 +00:00
|
|
|
|
bDontCheckPasswd = sal_False;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
/*-----------------28.06.97 09:19-------------------
|
|
|
|
|
|
|
|
|
|
--------------------------------------------------*/
|
|
|
|
|
IMPL_LINK( SwEditRegionDlg, DeselectHdl, SvTreeListBox *, pBox )
|
|
|
|
|
{
|
|
|
|
|
if( !pBox->GetSelectionCount() )
|
|
|
|
|
{
|
|
|
|
|
aHideCB .Enable(FALSE);
|
|
|
|
|
aProtectCB .Enable(FALSE);
|
2001-04-27 11:10:09 +00:00
|
|
|
|
aPasswdCB .Enable(FALSE);
|
|
|
|
|
aPasswdCB .Enable(FALSE);
|
|
|
|
|
aConditionFT .Enable(FALSE);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aConditionED.Enable(FALSE);
|
|
|
|
|
aFileCB .Enable(FALSE);
|
|
|
|
|
aFilePB .Enable(FALSE);
|
|
|
|
|
aFileNameFT .Enable(FALSE);
|
|
|
|
|
aFileNameED .Enable(FALSE);
|
|
|
|
|
aSubRegionFT .Enable(FALSE);
|
|
|
|
|
aSubRegionED .Enable(FALSE);
|
2001-04-27 11:10:09 +00:00
|
|
|
|
// aNameFT .Enable(FALSE);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aCurName .Enable(FALSE);
|
|
|
|
|
#ifdef DDE_AVAILABLE
|
|
|
|
|
aDDECB .Enable(FALSE);
|
|
|
|
|
aDDECommandFT .Enable(FALSE);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
UseFileHdl(&aFileCB);
|
|
|
|
|
#ifdef DDE_AVAILABLE
|
|
|
|
|
DDEHdl( &aDDECB );
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*---------------------------------------------------------------------
|
|
|
|
|
Beschreibung: Im OkHdl werden die veraenderten Einstellungen
|
|
|
|
|
uebernommen und aufgehobene Bereiche geloescht
|
|
|
|
|
---------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
IMPL_LINK( SwEditRegionDlg, OkHdl, CheckBox *, EMPTYARG )
|
|
|
|
|
{
|
|
|
|
|
// JP 13.03.96:
|
|
|
|
|
// temp. Array weil sich waehrend des aendern eines Bereiches die
|
|
|
|
|
// Position innerhalb des "Core-Arrays" verschieben kann:
|
|
|
|
|
// - bei gelinkten Bereichen, wenn sie weitere SubBereiche haben oder
|
|
|
|
|
// neu erhalten.
|
|
|
|
|
// JP 30.05.97: StartUndo darf natuerlich auch erst nach dem Kopieren
|
|
|
|
|
// der Formate erfolgen (ClearRedo!)
|
|
|
|
|
|
|
|
|
|
const SwSectionFmts& rDocFmts = rSh.GetDoc()->GetSections();
|
|
|
|
|
SwSectionFmts aOrigArray( 0, 5 );
|
|
|
|
|
aOrigArray.Insert( &rDocFmts, 0 );
|
|
|
|
|
|
|
|
|
|
rSh.StartAllAction();
|
|
|
|
|
rSh.StartUndo( UNDO_CHGSECTION );
|
|
|
|
|
rSh.ResetSelect( 0,FALSE );
|
|
|
|
|
SvLBoxEntry* pEntry = aTree.First();
|
|
|
|
|
|
|
|
|
|
while( pEntry )
|
|
|
|
|
{
|
|
|
|
|
SectReprPtr pRepr = (SectReprPtr) pEntry->GetUserData();
|
|
|
|
|
SwSectionFmt* pFmt = aOrigArray[ pRepr->GetArrPos() ];
|
2001-05-30 06:35:37 +00:00
|
|
|
|
if( !pRepr->GetSection().IsProtectFlag())
|
2001-11-14 15:30:21 +00:00
|
|
|
|
pRepr->GetSection().SetPasswd(UNO_NMSPC::Sequence <sal_Int8 >());
|
2000-09-18 16:15:01 +00:00
|
|
|
|
USHORT nNewPos = rDocFmts.GetPos( pFmt );
|
|
|
|
|
if( USHRT_MAX != nNewPos )
|
|
|
|
|
{
|
|
|
|
|
SfxItemSet* pSet = pFmt->GetAttrSet().Clone( FALSE );
|
|
|
|
|
if( pFmt->GetCol() != pRepr->GetCol() )
|
|
|
|
|
pSet->Put( pRepr->GetCol() );
|
|
|
|
|
|
|
|
|
|
if( pFmt->GetBackground(FALSE) != pRepr->GetBackground() )
|
|
|
|
|
pSet->Put( pRepr->GetBackground() );
|
|
|
|
|
|
|
|
|
|
if( pFmt->GetFtnAtTxtEnd(FALSE) != pRepr->GetFtnNtAtEnd() )
|
|
|
|
|
pSet->Put( pRepr->GetFtnNtAtEnd() );
|
|
|
|
|
|
|
|
|
|
if( pFmt->GetEndAtTxtEnd(FALSE) != pRepr->GetEndNtAtEnd() )
|
|
|
|
|
pSet->Put( pRepr->GetEndNtAtEnd() );
|
|
|
|
|
|
|
|
|
|
if( pFmt->GetBalancedColumns() != pRepr->GetBalance() )
|
|
|
|
|
pSet->Put( pRepr->GetBalance() );
|
|
|
|
|
|
2002-06-19 13:04:16 +00:00
|
|
|
|
if( pFmt->GetFrmDir() != pRepr->GetFrmDir() )
|
|
|
|
|
pSet->Put( pRepr->GetFrmDir() );
|
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
|
rSh.ChgSection( nNewPos, pRepr->GetSection(),
|
|
|
|
|
pSet->Count() ? pSet : 0 );
|
|
|
|
|
delete pSet;
|
|
|
|
|
}
|
|
|
|
|
pEntry = aTree.Next( pEntry );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for(USHORT i = aSectReprArr.Count(); i; )
|
|
|
|
|
{
|
|
|
|
|
SwSectionFmt* pFmt = aOrigArray[ aSectReprArr[ --i ]->GetArrPos() ];
|
|
|
|
|
USHORT nNewPos = rDocFmts.GetPos( pFmt );
|
|
|
|
|
if( USHRT_MAX != nNewPos )
|
|
|
|
|
rSh.DelSectionFmt( nNewPos );
|
|
|
|
|
}
|
2001-04-27 11:10:09 +00:00
|
|
|
|
// rSh.ChgSectionPasswd(aNewPasswd);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
aOrigArray.Remove( 0, aOrigArray.Count() );
|
|
|
|
|
|
|
|
|
|
//JP 21.05.97: EndDialog muss vor Ende der EndAction gerufen werden,
|
|
|
|
|
// sonst kann es ScrollFehler geben.
|
|
|
|
|
EndDialog(RET_OK);
|
|
|
|
|
|
|
|
|
|
rSh.EndUndo( UNDO_CHGSECTION );
|
|
|
|
|
rSh.EndAllAction();
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
/*---------------------------------------------------------------------
|
|
|
|
|
Beschreibung: Toggle protect
|
|
|
|
|
---------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
IMPL_LINK( SwEditRegionDlg, ChangeProtectHdl, TriStateBox *, pBox )
|
|
|
|
|
{
|
2001-04-27 11:10:09 +00:00
|
|
|
|
if(!CheckPasswd(pBox))
|
|
|
|
|
return 0;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
pBox->EnableTriState( FALSE );
|
|
|
|
|
SvLBoxEntry* pEntry=aTree.FirstSelected();
|
|
|
|
|
DBG_ASSERT(pEntry,"kein Entry gefunden");
|
2001-05-30 06:35:37 +00:00
|
|
|
|
BOOL bCheck = STATE_CHECK == pBox->GetState();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
while( pEntry )
|
|
|
|
|
{
|
|
|
|
|
SectReprPtr pRepr = (SectReprPtr) pEntry->GetUserData();
|
2001-05-30 06:35:37 +00:00
|
|
|
|
pRepr->SetProtect(bCheck);
|
2002-05-08 13:10:51 +00:00
|
|
|
|
Image aImage = BuildBitmap( bCheck,
|
2002-06-06 12:36:24 +00:00
|
|
|
|
STATE_CHECK == aHideCB.GetState(), FALSE);
|
|
|
|
|
aTree.SetExpandedEntryBmp(pEntry, aImage, BMP_COLOR_NORMAL);
|
|
|
|
|
aTree.SetCollapsedEntryBmp(pEntry, aImage, BMP_COLOR_NORMAL);
|
|
|
|
|
Image aHCImg = BuildBitmap( bCheck, STATE_CHECK == aHideCB.GetState(), TRUE);
|
|
|
|
|
aTree.SetExpandedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
|
|
|
|
|
aTree.SetCollapsedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
pEntry = aTree.NextSelected(pEntry);
|
|
|
|
|
}
|
2001-05-30 06:35:37 +00:00
|
|
|
|
aPasswdCB.Enable(bCheck);
|
|
|
|
|
aPasswdPB.Enable(bCheck);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
/*---------------------------------------------------------------------
|
|
|
|
|
Beschreibung: Toggle hide
|
|
|
|
|
---------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
IMPL_LINK( SwEditRegionDlg, ChangeHideHdl, TriStateBox *, pBox )
|
|
|
|
|
{
|
2001-04-27 11:10:09 +00:00
|
|
|
|
if(!CheckPasswd(pBox))
|
|
|
|
|
return 0;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
pBox->EnableTriState( FALSE );
|
|
|
|
|
SvLBoxEntry* pEntry=aTree.FirstSelected();
|
|
|
|
|
DBG_ASSERT(pEntry,"kein Entry gefunden");
|
|
|
|
|
while( pEntry )
|
|
|
|
|
{
|
|
|
|
|
SectReprPtr pRepr = (SectReprPtr) pEntry->GetUserData();
|
|
|
|
|
pRepr->SetHidden(STATE_CHECK == pBox->GetState());
|
2002-05-08 13:10:51 +00:00
|
|
|
|
Image aImage = BuildBitmap(STATE_CHECK == aProtectCB.GetState(),
|
2002-06-06 12:36:24 +00:00
|
|
|
|
STATE_CHECK == pBox->GetState(), FALSE);
|
|
|
|
|
aTree.SetExpandedEntryBmp(pEntry, aImage, BMP_COLOR_NORMAL);
|
|
|
|
|
aTree.SetCollapsedEntryBmp(pEntry, aImage, BMP_COLOR_NORMAL);
|
|
|
|
|
Image aHCImg = BuildBitmap( STATE_CHECK == aProtectCB.GetState(),
|
|
|
|
|
STATE_CHECK == pBox->GetState(), TRUE);
|
|
|
|
|
aTree.SetExpandedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
|
|
|
|
|
aTree.SetCollapsedEntryBmp(pEntry, aHCImg, BMP_COLOR_HIGHCONTRAST);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
pEntry = aTree.NextSelected(pEntry);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOL bHide = STATE_CHECK == pBox->GetState();
|
2001-04-27 11:10:09 +00:00
|
|
|
|
aConditionED.Enable(bHide);
|
|
|
|
|
aConditionFT.Enable(bHide);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
/*---------------------------------------------------------------------
|
|
|
|
|
Beschreibung: selektierten Bereich aufheben
|
|
|
|
|
---------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
IMPL_LINK( SwEditRegionDlg, ChangeDismissHdl, CheckBox *, EMPTYARG )
|
|
|
|
|
{
|
2001-04-27 11:10:09 +00:00
|
|
|
|
if(!CheckPasswd())
|
|
|
|
|
return 0;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
SvLBoxEntry* pEntry = aTree.FirstSelected();
|
|
|
|
|
SvLBoxEntry* pChild;
|
|
|
|
|
SvLBoxEntry* pParent;
|
|
|
|
|
//zuerst alle selektierten markieren
|
|
|
|
|
while(pEntry)
|
|
|
|
|
{
|
|
|
|
|
const SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData();
|
|
|
|
|
pSectRepr->SetSelected();
|
|
|
|
|
pEntry = aTree.NextSelected(pEntry);
|
|
|
|
|
}
|
|
|
|
|
pEntry = aTree.FirstSelected();
|
|
|
|
|
// dann loeschen
|
|
|
|
|
while(pEntry)
|
|
|
|
|
{
|
|
|
|
|
const SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData();
|
|
|
|
|
SvLBoxEntry* pRemove = 0;
|
|
|
|
|
BOOL bRestart = FALSE;
|
|
|
|
|
if(pSectRepr->IsSelected())
|
|
|
|
|
{
|
|
|
|
|
aSectReprArr.Insert( pSectRepr );
|
|
|
|
|
while( (pChild = aTree.FirstChild(pEntry) )!= 0 )
|
|
|
|
|
{
|
|
|
|
|
//durch das Umhaengen muss wieder am Anfang aufgesetzt werden
|
|
|
|
|
bRestart = TRUE;
|
|
|
|
|
pParent=aTree.GetParent(pEntry);
|
|
|
|
|
aTree.GetModel()->Move(pChild, pParent, aTree.GetModel()->GetRelPos(pEntry));
|
|
|
|
|
}
|
|
|
|
|
pRemove = pEntry;
|
|
|
|
|
}
|
|
|
|
|
if(bRestart)
|
|
|
|
|
pEntry = aTree.First();
|
|
|
|
|
else
|
|
|
|
|
pEntry = aTree.Next(pEntry);
|
|
|
|
|
if(pRemove)
|
|
|
|
|
aTree.GetModel()->Remove( pRemove );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( (pEntry=aTree.FirstSelected()) == 0 )
|
|
|
|
|
{
|
2001-04-27 11:10:09 +00:00
|
|
|
|
aConditionFT. Enable(FALSE);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aConditionED. Enable(FALSE);
|
|
|
|
|
aDismiss. Enable(FALSE);
|
|
|
|
|
aCurName. Enable(FALSE);
|
|
|
|
|
aProtectCB. Enable(FALSE);
|
|
|
|
|
aPasswdCB. Enable(FALSE);
|
|
|
|
|
aHideCB. Enable(FALSE);
|
|
|
|
|
aProtectCB. SetState(STATE_NOCHECK);
|
|
|
|
|
aPasswdCB. Check(FALSE);
|
|
|
|
|
aHideCB. SetState(STATE_NOCHECK);
|
|
|
|
|
aFileCB. Check(FALSE);
|
|
|
|
|
//sonst liegt der Focus auf dem HelpButton
|
|
|
|
|
aOK.GrabFocus();
|
|
|
|
|
UseFileHdl(&aFileCB);
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
/*---------------------------------------------------------------------
|
|
|
|
|
Beschreibung: CheckBox mit Datei verknuepfen<EFBFBD>
|
|
|
|
|
---------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
IMPL_LINK( SwEditRegionDlg, UseFileHdl, CheckBox *, pBox )
|
|
|
|
|
{
|
2001-04-27 11:10:09 +00:00
|
|
|
|
if(!CheckPasswd(pBox))
|
|
|
|
|
return 0;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
SvLBoxEntry* pEntry = aTree.FirstSelected();
|
|
|
|
|
pBox->EnableTriState(FALSE);
|
|
|
|
|
BOOL bMulti = 1 < aTree.GetSelectionCount();
|
|
|
|
|
BOOL bFile = pBox->IsChecked();
|
|
|
|
|
if(pEntry)
|
|
|
|
|
{
|
|
|
|
|
while(pEntry)
|
|
|
|
|
{
|
|
|
|
|
const SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData();
|
|
|
|
|
BOOL bContent = pSectRepr->IsContent();
|
|
|
|
|
if( pBox->IsChecked() && bContent && rSh.HasSelection() )
|
|
|
|
|
{
|
|
|
|
|
if( RET_NO == QueryBox( this, SW_RES(QB_CONNECT) ).Execute() )
|
|
|
|
|
pBox->Check( FALSE );
|
|
|
|
|
}
|
|
|
|
|
if( bFile )
|
|
|
|
|
pSectRepr->SetContent(FALSE);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pSectRepr->SetFile(aEmptyStr);
|
|
|
|
|
pSectRepr->SetSubRegion(aEmptyStr);
|
|
|
|
|
pSectRepr->SetFilePasswd(aEmptyStr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pEntry = aTree.NextSelected(pEntry);
|
|
|
|
|
}
|
|
|
|
|
aFileNameFT.Enable(bFile && ! bMulti);
|
|
|
|
|
aFileNameED.Enable(bFile && ! bMulti);
|
|
|
|
|
aFilePB.Enable(bFile && ! bMulti);
|
|
|
|
|
aSubRegionED.Enable(bFile && ! bMulti);
|
|
|
|
|
aSubRegionFT.Enable(bFile && ! bMulti);
|
|
|
|
|
#ifdef DDE_AVAILABLE
|
|
|
|
|
aDDECommandFT.Enable(bFile && ! bMulti);
|
|
|
|
|
aDDECB.Enable(bFile && ! bMulti);
|
|
|
|
|
#endif
|
|
|
|
|
if( bFile )
|
|
|
|
|
{
|
|
|
|
|
aProtectCB.SetState(STATE_CHECK);
|
|
|
|
|
aFileNameED.GrabFocus();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
#ifdef DDE_AVAILABLE
|
|
|
|
|
aDDECB.Check(FALSE);
|
|
|
|
|
DDEHdl(&aDDECB);
|
|
|
|
|
#endif
|
|
|
|
|
// aFileNameED.SetText(aEmptyStr);
|
|
|
|
|
aSubRegionED.SetText(aEmptyStr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pBox->Check(FALSE);
|
|
|
|
|
pBox->Enable(FALSE);
|
|
|
|
|
aFilePB.Enable(FALSE);
|
|
|
|
|
aFileNameED.Enable(FALSE);
|
|
|
|
|
aFileNameFT.Enable(FALSE);
|
|
|
|
|
aSubRegionED.Enable(FALSE);
|
|
|
|
|
aSubRegionFT.Enable(FALSE);
|
|
|
|
|
#ifdef DDE_AVAILABLE
|
|
|
|
|
aDDECB.Check(FALSE);
|
|
|
|
|
aDDECB.Enable(FALSE);
|
|
|
|
|
aDDECommandFT.Enable(FALSE);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*---------------------------------------------------------------------
|
|
|
|
|
Beschreibung: Dialog Datei einfuegen rufen
|
|
|
|
|
---------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
IMPL_LINK( SwEditRegionDlg, FileSearchHdl, PushButton *, EMPTYARG )
|
|
|
|
|
{
|
2001-04-27 11:10:09 +00:00
|
|
|
|
if(!CheckPasswd(0))
|
|
|
|
|
return 0;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
SfxMedium* pMed;
|
|
|
|
|
String sFileName, sFilterName, sFilePasswd;
|
|
|
|
|
if( GetFileFilterNameDlg( *this, sFileName, &sFilePasswd,
|
|
|
|
|
&sFilterName, &pMed ))
|
|
|
|
|
{
|
|
|
|
|
::lcl_ReadSections( rSh, *pMed, aSubRegionED );
|
|
|
|
|
delete pMed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SvLBoxEntry* pEntry = aTree.FirstSelected();
|
|
|
|
|
DBG_ASSERT(pEntry,"kein Entry gefunden");
|
|
|
|
|
if(pEntry)
|
|
|
|
|
{
|
|
|
|
|
SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData();
|
|
|
|
|
pSectRepr->SetFile( sFileName );
|
|
|
|
|
pSectRepr->SetFilter( sFilterName );
|
|
|
|
|
pSectRepr->SetFilePasswd( sFilePasswd );
|
2001-02-23 14:05:32 +00:00
|
|
|
|
aFileNameED.SetText( pSectRepr->GetFile());
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*---------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
---------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
IMPL_LINK( SwEditRegionDlg, OptionsHdl, PushButton *, EMPTYARG )
|
|
|
|
|
{
|
2001-04-27 11:10:09 +00:00
|
|
|
|
if(!CheckPasswd())
|
|
|
|
|
return 0;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
SvLBoxEntry* pEntry = aTree.FirstSelected();
|
|
|
|
|
|
|
|
|
|
if(pEntry)
|
|
|
|
|
{
|
|
|
|
|
SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData();
|
|
|
|
|
SfxItemSet aSet(rSh.GetView().GetPool(),
|
|
|
|
|
RES_COL, RES_COL,
|
2002-06-19 13:04:16 +00:00
|
|
|
|
RES_COLUMNBALANCE, RES_FRAMEDIR,
|
2000-09-18 16:15:01 +00:00
|
|
|
|
RES_BACKGROUND, RES_BACKGROUND,
|
|
|
|
|
RES_FRM_SIZE, RES_FRM_SIZE,
|
|
|
|
|
SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE,
|
|
|
|
|
RES_LR_SPACE, RES_LR_SPACE,
|
|
|
|
|
RES_FTN_AT_TXTEND, RES_END_AT_TXTEND,
|
|
|
|
|
0);
|
|
|
|
|
|
|
|
|
|
aSet.Put( pSectRepr->GetCol() );
|
|
|
|
|
aSet.Put( pSectRepr->GetBackground() );
|
|
|
|
|
aSet.Put( pSectRepr->GetFtnNtAtEnd() );
|
|
|
|
|
aSet.Put( pSectRepr->GetEndNtAtEnd() );
|
|
|
|
|
aSet.Put( pSectRepr->GetBalance() );
|
2002-06-19 13:04:16 +00:00
|
|
|
|
aSet.Put( pSectRepr->GetFrmDir() );
|
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
const SwSectionFmts& rDocFmts = rSh.GetDoc()->GetSections();
|
|
|
|
|
SwSectionFmts aOrigArray( 0, 5 );
|
|
|
|
|
aOrigArray.Insert( &rDocFmts, 0 );
|
|
|
|
|
|
|
|
|
|
SwSectionFmt* pFmt = aOrigArray[pSectRepr->GetArrPos()];
|
|
|
|
|
long nWidth = rSh.GetSectionWidth(*pFmt);
|
|
|
|
|
aOrigArray.Remove( 0, aOrigArray.Count() );
|
|
|
|
|
if (!nWidth)
|
|
|
|
|
nWidth = USHRT_MAX;
|
|
|
|
|
|
|
|
|
|
aSet.Put(SwFmtFrmSize(ATT_VAR_SIZE, nWidth));
|
|
|
|
|
aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth)));
|
|
|
|
|
|
|
|
|
|
SwSectionPropertyTabDialog aTabDlg(this, aSet, rSh);
|
|
|
|
|
if(RET_OK == aTabDlg.Execute())
|
|
|
|
|
{
|
|
|
|
|
const SfxItemSet* pOutSet = aTabDlg.GetOutputItemSet();
|
|
|
|
|
if( pOutSet && pOutSet->Count() )
|
|
|
|
|
{
|
|
|
|
|
const SfxPoolItem *pColItem, *pBrushItem,
|
2002-06-19 13:04:16 +00:00
|
|
|
|
*pFtnItem, *pEndItem, *pBalanceItem,
|
|
|
|
|
*pFrmDirItem;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
SfxItemState eColState = pOutSet->GetItemState(
|
|
|
|
|
RES_COL, FALSE, &pColItem );
|
|
|
|
|
SfxItemState eBrushState = pOutSet->GetItemState(
|
|
|
|
|
RES_BACKGROUND, FALSE, &pBrushItem );
|
|
|
|
|
SfxItemState eFtnState = pOutSet->GetItemState(
|
|
|
|
|
RES_FTN_AT_TXTEND, FALSE, &pFtnItem );
|
|
|
|
|
SfxItemState eEndState = pOutSet->GetItemState(
|
|
|
|
|
RES_END_AT_TXTEND, FALSE, &pEndItem );
|
|
|
|
|
SfxItemState eBalanceState = pOutSet->GetItemState(
|
|
|
|
|
RES_COLUMNBALANCE, FALSE, &pBalanceItem );
|
2002-06-19 13:04:16 +00:00
|
|
|
|
SfxItemState eFrmDirState = pOutSet->GetItemState(
|
|
|
|
|
RES_FRAMEDIR, FALSE, &pFrmDirItem );
|
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
|
if( SFX_ITEM_SET == eColState ||
|
|
|
|
|
SFX_ITEM_SET == eBrushState ||
|
|
|
|
|
SFX_ITEM_SET == eFtnState ||
|
|
|
|
|
SFX_ITEM_SET == eEndState ||
|
2002-06-19 13:04:16 +00:00
|
|
|
|
SFX_ITEM_SET == eBalanceState||
|
|
|
|
|
SFX_ITEM_SET == eFrmDirState)
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
|
|
|
|
SvLBoxEntry* pEntry = aTree.FirstSelected();
|
|
|
|
|
while( pEntry )
|
|
|
|
|
{
|
|
|
|
|
SectReprPtr pRepr = (SectReprPtr)pEntry->GetUserData();
|
|
|
|
|
if( SFX_ITEM_SET == eColState )
|
|
|
|
|
pRepr->GetCol() = *(SwFmtCol*)pColItem;
|
|
|
|
|
if( SFX_ITEM_SET == eBrushState )
|
|
|
|
|
pRepr->GetBackground() = *(SvxBrushItem*)pBrushItem;
|
|
|
|
|
if( SFX_ITEM_SET == eFtnState )
|
|
|
|
|
pRepr->GetFtnNtAtEnd() = *(SwFmtFtnAtTxtEnd*)pFtnItem;
|
|
|
|
|
if( SFX_ITEM_SET == eEndState )
|
|
|
|
|
pRepr->GetEndNtAtEnd() = *(SwFmtEndAtTxtEnd*)pEndItem;
|
|
|
|
|
if( SFX_ITEM_SET == eBalanceState )
|
|
|
|
|
pRepr->GetBalance().SetValue(((SwFmtNoBalancedColumns*)pBalanceItem)->GetValue());
|
2002-06-19 13:04:16 +00:00
|
|
|
|
if( SFX_ITEM_SET == eFrmDirState )
|
|
|
|
|
pRepr->GetFrmDir().SetValue(((SvxFrameDirectionItem*)pFrmDirItem)->GetValue());
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
pEntry = aTree.NextSelected(pEntry);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*---------------------------------------------------------------------
|
|
|
|
|
Beschreibung: Uebernahme des Dateinamen oder
|
|
|
|
|
des verknuepften Bereichs
|
|
|
|
|
---------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
IMPL_LINK( SwEditRegionDlg, FileNameHdl, Edit *, pEdit )
|
|
|
|
|
{
|
2001-04-27 11:10:09 +00:00
|
|
|
|
Selection aSelect = pEdit->GetSelection();
|
|
|
|
|
if(!CheckPasswd())
|
|
|
|
|
return 0;
|
|
|
|
|
pEdit->SetSelection(aSelect);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
SvLBoxEntry* pEntry=aTree.FirstSelected();
|
|
|
|
|
DBG_ASSERT(pEntry,"kein Entry gefunden");
|
|
|
|
|
SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData();
|
|
|
|
|
if(pEdit == &aFileNameED)
|
|
|
|
|
{
|
|
|
|
|
BOOL bDDe = FALSE;
|
|
|
|
|
#ifdef DDE_AVAILABLE
|
|
|
|
|
bDDe = aDDECB.IsChecked();
|
|
|
|
|
#endif
|
|
|
|
|
if( bDDe )
|
|
|
|
|
{
|
|
|
|
|
String sLink( pEdit->GetText() );
|
|
|
|
|
USHORT nPos = 0;
|
|
|
|
|
while( STRING_NOTFOUND != (nPos = sLink.SearchAscii( " ", nPos )) )
|
|
|
|
|
sLink.Erase( nPos--, 1 );
|
|
|
|
|
|
2001-07-05 12:26:33 +00:00
|
|
|
|
nPos = sLink.SearchAndReplace( ' ', so3::cTokenSeperator );
|
|
|
|
|
sLink.SearchAndReplace( ' ', so3::cTokenSeperator, nPos );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
pSectRepr->GetSection().SetLinkFileName( sLink );
|
|
|
|
|
pSectRepr->GetSection().SetType( DDE_LINK_SECTION );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
String sTmp(pEdit->GetText());
|
|
|
|
|
if(sTmp.Len())
|
|
|
|
|
sTmp = URIHelper::SmartRelToAbs( sTmp );
|
|
|
|
|
pSectRepr->SetFile( sTmp );
|
|
|
|
|
pSectRepr->SetFilePasswd( aEmptyStr );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pSectRepr->SetSubRegion( pEdit->GetText() );
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
/*---------------------------------------------------------------------
|
|
|
|
|
Beschreibung:
|
|
|
|
|
---------------------------------------------------------------------*/
|
|
|
|
|
#ifdef DDE_AVAILABLE
|
|
|
|
|
|
|
|
|
|
IMPL_LINK( SwEditRegionDlg, DDEHdl, CheckBox*, pBox )
|
|
|
|
|
{
|
2001-04-27 11:10:09 +00:00
|
|
|
|
if(!CheckPasswd(pBox))
|
|
|
|
|
return 0;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
SvLBoxEntry* pEntry=aTree.FirstSelected();
|
|
|
|
|
if(pEntry)
|
|
|
|
|
{
|
|
|
|
|
BOOL bFile = aFileCB.IsChecked();
|
|
|
|
|
SectReprPtr pSectRepr = (SectRepr*)pEntry->GetUserData();
|
|
|
|
|
BOOL bDDE = pBox->IsChecked();
|
|
|
|
|
if(bDDE)
|
|
|
|
|
{
|
|
|
|
|
aFileNameFT.Hide();
|
|
|
|
|
aDDECommandFT.Enable();
|
|
|
|
|
aDDECommandFT.Show();
|
|
|
|
|
aSubRegionFT.Hide();
|
|
|
|
|
aSubRegionED.Hide();
|
|
|
|
|
if(FILE_LINK_SECTION == pSectRepr->GetSectionType() )
|
|
|
|
|
{
|
|
|
|
|
pSectRepr->SetFile(aEmptyStr);
|
|
|
|
|
aFileNameED.SetText(aEmptyStr);
|
|
|
|
|
pSectRepr->SetFilePasswd( aEmptyStr );
|
|
|
|
|
}
|
|
|
|
|
pSectRepr->SetSectionType( DDE_LINK_SECTION );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
aDDECommandFT.Hide();
|
|
|
|
|
aFileNameFT.Enable(bFile);
|
|
|
|
|
aFileNameFT.Show();
|
|
|
|
|
aSubRegionED.Show();
|
|
|
|
|
aSubRegionFT.Show();
|
|
|
|
|
aSubRegionED.Enable(bFile);
|
|
|
|
|
aSubRegionFT.Enable(bFile);
|
|
|
|
|
aSubRegionED.Enable(bFile);
|
|
|
|
|
if(DDE_LINK_SECTION == pSectRepr->GetSectionType() )
|
|
|
|
|
{
|
|
|
|
|
pSectRepr->SetSectionType( FILE_LINK_SECTION );
|
|
|
|
|
pSectRepr->SetFile(aEmptyStr);
|
|
|
|
|
pSectRepr->SetFilePasswd( aEmptyStr );
|
|
|
|
|
aFileNameED.SetText(aEmptyStr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
aFilePB.Enable(bFile && !bDDE);
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
/*---------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------*/
|
|
|
|
|
|
2001-04-27 11:10:09 +00:00
|
|
|
|
IMPL_LINK( SwEditRegionDlg, ChangePasswdHdl, Button *, pBox )
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
2001-04-27 11:10:09 +00:00
|
|
|
|
sal_Bool bChange = pBox == &aPasswdPB;
|
|
|
|
|
if(!CheckPasswd(0))
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
2001-04-27 11:10:09 +00:00
|
|
|
|
if(!bChange)
|
|
|
|
|
aPasswdCB.Check(!aPasswdCB.IsChecked());
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
SvLBoxEntry* pEntry=aTree.FirstSelected();
|
|
|
|
|
sal_Bool bSet = bChange ? bChange : aPasswdCB.IsChecked();
|
|
|
|
|
DBG_ASSERT(pEntry,"kein Entry gefunden");
|
|
|
|
|
while( pEntry )
|
|
|
|
|
{
|
|
|
|
|
SectReprPtr pRepr = (SectReprPtr)pEntry->GetUserData();
|
|
|
|
|
if(bSet)
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
2001-04-27 11:10:09 +00:00
|
|
|
|
if(!pRepr->GetTempPasswd().getLength() || bChange)
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
2001-04-27 11:10:09 +00:00
|
|
|
|
SwTestPasswdDlg aPasswdDlg(this);
|
|
|
|
|
aPasswdDlg.ShowExtras(SHOWEXTRAS_CONFIRM);
|
2001-08-07 08:27:19 +00:00
|
|
|
|
if(RET_OK == aPasswdDlg.Execute())
|
2001-03-02 13:39:49 +00:00
|
|
|
|
{
|
2001-04-27 11:10:09 +00:00
|
|
|
|
String sNewPasswd( aPasswdDlg.GetPassword() );
|
|
|
|
|
if( aPasswdDlg.GetConfirm() == sNewPasswd )
|
|
|
|
|
{
|
|
|
|
|
SvPasswordHelper::GetHashPassword( pRepr->GetTempPasswd(), sNewPasswd );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
InfoBox(pBox, SW_RES(REG_WRONG_PASSWD_REPEAT)).Execute();
|
|
|
|
|
ChangePasswdHdl(pBox);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2001-03-02 13:39:49 +00:00
|
|
|
|
}
|
2001-08-07 08:27:19 +00:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if(!bChange)
|
|
|
|
|
aPasswdCB.Check(FALSE);
|
|
|
|
|
break;
|
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
2001-04-27 11:10:09 +00:00
|
|
|
|
pRepr->GetSection().SetPasswd(pRepr->GetTempPasswd());
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
2001-04-27 11:10:09 +00:00
|
|
|
|
else
|
2001-11-14 15:30:21 +00:00
|
|
|
|
pRepr->GetSection().SetPasswd(UNO_NMSPC::Sequence <sal_Int8 >());
|
2001-04-27 11:10:09 +00:00
|
|
|
|
pEntry = aTree.NextSelected(pEntry);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
/*---------------------------------------------------------------------
|
|
|
|
|
Beschreibung: Aktueller Bereichsname wird sofort beim editieren
|
|
|
|
|
in die TreeListBox eingetragen, mit leerem String
|
|
|
|
|
kein Ok()
|
|
|
|
|
---------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
IMPL_LINK( SwEditRegionDlg, NameEditHdl, Edit *, EMPTYARG )
|
|
|
|
|
{
|
2001-04-27 11:10:09 +00:00
|
|
|
|
if(!CheckPasswd(0))
|
|
|
|
|
return 0;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
SvLBoxEntry* pEntry=aTree.FirstSelected();
|
|
|
|
|
DBG_ASSERT(pEntry,"kein Entry gefunden");
|
|
|
|
|
if (pEntry)
|
|
|
|
|
{
|
|
|
|
|
String aName = aCurName.GetText();
|
|
|
|
|
aTree.SetEntryText(pEntry,aName);
|
|
|
|
|
SectReprPtr pRepr = (SectReprPtr) pEntry->GetUserData();
|
|
|
|
|
pRepr->GetSection().SetName(aName);
|
|
|
|
|
|
|
|
|
|
aOK.Enable(aName.Len() != 0);
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
/*---------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
IMPL_LINK( SwEditRegionDlg, ConditionEditHdl, Edit *, pEdit )
|
|
|
|
|
{
|
2001-04-27 11:10:09 +00:00
|
|
|
|
Selection aSelect = pEdit->GetSelection();
|
|
|
|
|
if(!CheckPasswd(0))
|
|
|
|
|
return 0;
|
|
|
|
|
pEdit->SetSelection(aSelect);
|
|
|
|
|
SvLBoxEntry* pEntry = aTree.FirstSelected();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
DBG_ASSERT(pEntry,"kein Entry gefunden");
|
|
|
|
|
while( pEntry )
|
|
|
|
|
{
|
|
|
|
|
SectReprPtr pRepr = (SectReprPtr)pEntry->GetUserData();
|
|
|
|
|
pRepr->SetCondition (pEdit->GetText());
|
|
|
|
|
pEntry = aTree.NextSelected(pEntry);
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2002-05-08 13:10:51 +00:00
|
|
|
|
/* -----------------------------08.05.2002 15:00------------------------------
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
2002-05-08 13:10:51 +00:00
|
|
|
|
---------------------------------------------------------------------------*/
|
2002-06-06 12:36:24 +00:00
|
|
|
|
Image SwEditRegionDlg::BuildBitmap(BOOL bProtect,BOOL bHidden, BOOL bHighContrast)
|
2002-05-08 13:10:51 +00:00
|
|
|
|
{
|
2002-06-06 12:36:24 +00:00
|
|
|
|
ImageList& rImgLst = bHighContrast ? aImageILH : aImageIL;
|
2002-05-08 13:10:51 +00:00
|
|
|
|
return rImgLst.GetImage((!bHidden+(bProtect<<1)) + 1);
|
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung: Bereiche einfuegen
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SwBaseShell::InsertRegionDialog(SfxRequest& rReq)
|
|
|
|
|
{
|
|
|
|
|
SwWrtShell& rSh = GetShell();
|
|
|
|
|
const SfxItemSet *pSet = rReq.GetArgs();
|
|
|
|
|
|
|
|
|
|
SfxItemSet aSet(GetPool(),
|
|
|
|
|
RES_COL, RES_COL,
|
2002-06-19 13:04:16 +00:00
|
|
|
|
RES_COLUMNBALANCE, RES_FRAMEDIR,
|
2000-09-18 16:15:01 +00:00
|
|
|
|
RES_BACKGROUND, RES_BACKGROUND,
|
|
|
|
|
RES_FRM_SIZE, RES_FRM_SIZE,
|
|
|
|
|
RES_FTN_AT_TXTEND, RES_END_AT_TXTEND,
|
|
|
|
|
SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE,
|
|
|
|
|
0);
|
|
|
|
|
|
|
|
|
|
if (!pSet || pSet->Count()==0)
|
|
|
|
|
{
|
|
|
|
|
SwRect aRect;
|
|
|
|
|
rSh.CalcBoundRect(aRect, FLY_IN_CNTNT);
|
|
|
|
|
|
|
|
|
|
long nWidth = aRect.Width();
|
|
|
|
|
aSet.Put(SwFmtFrmSize(ATT_VAR_SIZE, nWidth));
|
|
|
|
|
|
|
|
|
|
// Hoehe=Breite fuer konsistentere Vorschau (analog zu Bereich bearbeiten)
|
|
|
|
|
aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth)));
|
|
|
|
|
SwInsertSectionTabDialog aTabDlg(&GetView().GetViewFrame()->GetWindow(),aSet , rSh);
|
|
|
|
|
aTabDlg.Execute();
|
2002-08-07 12:20:38 +00:00
|
|
|
|
rReq.Ignore();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
const SfxPoolItem *pItem = 0;
|
2002-08-07 12:20:38 +00:00
|
|
|
|
String aTmpStr;
|
|
|
|
|
if ( SFX_ITEM_SET ==
|
|
|
|
|
pSet->GetItemState(FN_PARAM_REGION_NAME, TRUE, &pItem) )
|
|
|
|
|
aTmpStr = rSh.GetUniqueSectionName(
|
|
|
|
|
&((const SfxStringItem *)pItem)->GetValue() );
|
|
|
|
|
else
|
|
|
|
|
aTmpStr = rSh.GetUniqueSectionName();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
|
|
|
|
SwSection aSection(CONTENT_SECTION,aTmpStr);
|
|
|
|
|
rReq.SetReturnValue(SfxStringItem(FN_INSERT_REGION, aTmpStr));
|
|
|
|
|
|
|
|
|
|
aSet.Put( *pSet );
|
2002-08-07 12:20:38 +00:00
|
|
|
|
if(SFX_ITEM_SET == pSet->GetItemState(SID_ATTR_COLUMNS, FALSE, &pItem)||
|
|
|
|
|
SFX_ITEM_SET == pSet->GetItemState(FN_INSERT_COLUMN_SECTION, FALSE, &pItem))
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
|
|
|
|
SwFmtCol aCol;
|
|
|
|
|
SwRect aRect;
|
|
|
|
|
rSh.CalcBoundRect(aRect, FLY_IN_CNTNT);
|
|
|
|
|
long nWidth = aRect.Width();
|
|
|
|
|
|
|
|
|
|
USHORT nCol = ((SfxUInt16Item *)pItem)->GetValue();
|
|
|
|
|
if(nCol)
|
|
|
|
|
{
|
|
|
|
|
aCol.Init( nCol, 0, nWidth );
|
|
|
|
|
aSet.Put(aCol);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if(SFX_ITEM_SET == pSet->GetItemState(RES_COL, FALSE, &pItem))
|
|
|
|
|
{
|
|
|
|
|
aSet.Put(*pItem);
|
|
|
|
|
}
|
2002-08-07 12:20:38 +00:00
|
|
|
|
|
|
|
|
|
const BOOL bHidden = SFX_ITEM_SET ==
|
|
|
|
|
pSet->GetItemState(FN_PARAM_REGION_HIDDEN, TRUE, &pItem)?
|
|
|
|
|
(BOOL)((const SfxBoolItem *)pItem)->GetValue():FALSE;
|
|
|
|
|
const BOOL bProtect = SFX_ITEM_SET ==
|
|
|
|
|
pSet->GetItemState(FN_PARAM_REGION_PROTECT, TRUE, &pItem)?
|
|
|
|
|
(BOOL)((const SfxBoolItem *)pItem)->GetValue():FALSE;
|
|
|
|
|
aSection.SetProtect(bProtect);
|
|
|
|
|
aSection.SetHidden(bHidden);
|
|
|
|
|
if(SFX_ITEM_SET ==
|
|
|
|
|
pSet->GetItemState(FN_PARAM_REGION_CONDITION, TRUE, &pItem))
|
|
|
|
|
aSection.SetCondition(((const SfxStringItem *)pItem)->GetValue());
|
|
|
|
|
|
|
|
|
|
String aFile, aSub;
|
|
|
|
|
if(SFX_ITEM_SET ==
|
|
|
|
|
pSet->GetItemState(FN_PARAM_1, TRUE, &pItem))
|
|
|
|
|
aFile = ((const SfxStringItem *)pItem)->GetValue();
|
|
|
|
|
|
|
|
|
|
if(SFX_ITEM_SET ==
|
|
|
|
|
pSet->GetItemState(FN_PARAM_3, TRUE, &pItem))
|
|
|
|
|
aSub = ((const SfxStringItem *)pItem)->GetValue();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(aFile.Len() || aSub.Len())
|
|
|
|
|
{
|
|
|
|
|
String sLinkFileName(so3::cTokenSeperator);
|
|
|
|
|
sLinkFileName += so3::cTokenSeperator;
|
|
|
|
|
sLinkFileName.SetToken(0, so3::cTokenSeperator,aFile);
|
|
|
|
|
|
|
|
|
|
if(SFX_ITEM_SET ==
|
|
|
|
|
pSet->GetItemState(FN_PARAM_2, TRUE, &pItem))
|
|
|
|
|
sLinkFileName.SetToken(1, so3::cTokenSeperator,
|
|
|
|
|
((const SfxStringItem *)pItem)->GetValue());
|
|
|
|
|
|
|
|
|
|
sLinkFileName += aSub;
|
|
|
|
|
aSection.SetType( FILE_LINK_SECTION );
|
|
|
|
|
aSection.SetLinkFileName(sLinkFileName);
|
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
rSh.InsertSection(aSection, aSet.Count() ? &aSet : 0);
|
2002-08-07 12:20:38 +00:00
|
|
|
|
rReq.Done();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IMPL_STATIC_LINK( SwWrtShell, InsertRegionDialog, SwSection*, pSect )
|
|
|
|
|
{
|
|
|
|
|
if( pSect )
|
|
|
|
|
{
|
|
|
|
|
SfxItemSet aSet(pThis->GetView().GetPool(),
|
|
|
|
|
RES_COL, RES_COL,
|
|
|
|
|
RES_BACKGROUND, RES_BACKGROUND,
|
|
|
|
|
RES_FRM_SIZE, RES_FRM_SIZE,
|
|
|
|
|
SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE,
|
|
|
|
|
0);
|
|
|
|
|
SwRect aRect;
|
|
|
|
|
pThis->CalcBoundRect(aRect, FLY_IN_CNTNT);
|
|
|
|
|
long nWidth = aRect.Width();
|
|
|
|
|
aSet.Put(SwFmtFrmSize(ATT_VAR_SIZE, nWidth));
|
|
|
|
|
// Hoehe=Breite fuer konsistentere Vorschau (analog zu Bereich bearbeiten)
|
|
|
|
|
aSet.Put(SvxSizeItem(SID_ATTR_PAGE_SIZE, Size(nWidth, nWidth)));
|
|
|
|
|
SwInsertSectionTabDialog aTabDlg(&pThis->GetView().GetViewFrame()->GetWindow(),aSet , *pThis);
|
|
|
|
|
aTabDlg.SetSection(*pSect);
|
|
|
|
|
aTabDlg.Execute();
|
|
|
|
|
|
|
|
|
|
delete pSect;
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung: Bereich bearbeiten
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
void SwBaseShell::EditRegionDialog(SfxRequest& rReq)
|
|
|
|
|
{
|
|
|
|
|
const SfxItemSet* pArgs = rReq.GetArgs();
|
|
|
|
|
int nSlot = rReq.GetSlot();
|
|
|
|
|
const SfxPoolItem* pItem = 0;
|
|
|
|
|
if(pArgs)
|
|
|
|
|
pArgs->GetItemState(nSlot, FALSE, &pItem);
|
|
|
|
|
SwWrtShell& rWrtShell = GetShell();
|
|
|
|
|
|
|
|
|
|
switch ( nSlot )
|
|
|
|
|
{
|
|
|
|
|
case FN_EDIT_REGION:
|
|
|
|
|
{
|
|
|
|
|
Window* pParentWin = &GetView().GetViewFrame()->GetWindow();
|
|
|
|
|
BOOL bStart = TRUE;
|
|
|
|
|
if(bStart)
|
|
|
|
|
{
|
|
|
|
|
SwEditRegionDlg* pEditRegionDlg = new SwEditRegionDlg(
|
|
|
|
|
pParentWin, rWrtShell );
|
2001-10-09 13:41:07 +00:00
|
|
|
|
if(pItem && pItem->ISA(SfxStringItem))
|
|
|
|
|
{
|
|
|
|
|
pEditRegionDlg->SelectSection(((const SfxStringItem*)pItem)->GetValue());
|
|
|
|
|
}
|
2001-03-02 13:39:49 +00:00
|
|
|
|
pEditRegionDlg->Execute();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
delete pEditRegionDlg;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
InfoBox(pParentWin, SW_RES(REG_WRONG_PASSWORD)).Execute();
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung: Hilfsfunktion - Bereichsindex ermitteln
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
USHORT lcl_GetRegion( const String& rRegionName, SwWrtShell& rWrtShell )
|
|
|
|
|
{
|
|
|
|
|
USHORT nCount = rWrtShell.GetSectionFmtCount();
|
|
|
|
|
for(USHORT i=0; i< nCount; i++)
|
|
|
|
|
{
|
|
|
|
|
const SwSectionFmt& rFmt = rWrtShell.GetSectionFmt(i);
|
|
|
|
|
if(rFmt.IsInNodesArr() && rFmt.GetSection()->GetName()
|
|
|
|
|
== rRegionName)
|
|
|
|
|
return i;
|
|
|
|
|
}
|
|
|
|
|
return USHRT_MAX;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung: Hilfsfunktion - Bereichsnamen aus dem Medium lesen
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
void lcl_ReadSections( SwWrtShell& rSh, SfxMedium& rMedium, ComboBox& rBox )
|
|
|
|
|
{
|
|
|
|
|
rBox.Clear();
|
2001-11-14 15:30:21 +00:00
|
|
|
|
SvStorage* pStg;
|
|
|
|
|
if( rMedium.IsStorage() && 0 != (pStg = rMedium.GetStorage() ) )
|
|
|
|
|
{
|
|
|
|
|
SvStringsDtor aArr( 10, 10 );
|
|
|
|
|
switch( pStg->GetFormat() )
|
2001-02-16 08:31:07 +00:00
|
|
|
|
{
|
2001-11-14 15:30:21 +00:00
|
|
|
|
case SOT_FORMATSTR_ID_STARWRITER_50:
|
|
|
|
|
case SOT_FORMATSTR_ID_STARWRITER_40:
|
|
|
|
|
case SOT_FORMATSTR_ID_STARWRITER_30:
|
|
|
|
|
case SOT_FORMATSTR_ID_STARWRITERGLOB_50:
|
|
|
|
|
case SOT_FORMATSTR_ID_STARWRITERGLOB_40:
|
2003-03-27 14:45:43 +00:00
|
|
|
|
{
|
|
|
|
|
Sw3Reader* pRdr = (Sw3Reader*)ReadSw3;
|
|
|
|
|
Sw3Io* pOldIo = pRdr->GetSw3Io();
|
|
|
|
|
pRdr->SetSw3Io( rSh.GetView().GetDocShell()->GetIoSystem() );
|
|
|
|
|
pRdr->GetSectionList( rMedium, (SvStrings&) aArr );
|
|
|
|
|
pRdr->SetSw3Io( pOldIo );
|
|
|
|
|
}
|
2001-11-14 15:30:21 +00:00
|
|
|
|
break;
|
|
|
|
|
case SOT_FORMATSTR_ID_STARWRITER_60:
|
|
|
|
|
case SOT_FORMATSTR_ID_STARWRITERGLOB_60:
|
|
|
|
|
ReadXML->GetSectionList( rMedium, (SvStrings&) aArr );
|
|
|
|
|
break;
|
2001-02-16 08:31:07 +00:00
|
|
|
|
}
|
2001-11-14 15:30:21 +00:00
|
|
|
|
for( USHORT n = 0; n < aArr.Count(); ++n )
|
|
|
|
|
rBox.InsertEntry( *aArr[ n ] );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* -----------------21.05.99 10:16-------------------
|
|
|
|
|
*
|
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
|
SwInsertSectionTabDialog::SwInsertSectionTabDialog(
|
|
|
|
|
Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh) :
|
|
|
|
|
SfxTabDialog( pParent, SW_RES(DLG_INSERT_SECTION), &rSet ),
|
|
|
|
|
rWrtSh(rSh),
|
|
|
|
|
pToInsertSection(0)
|
|
|
|
|
{
|
|
|
|
|
String sInsert(ResId(ST_INSERT));
|
|
|
|
|
GetOKButton().SetText(sInsert);
|
|
|
|
|
FreeResource();
|
|
|
|
|
AddTabPage(TP_INSERT_SECTION, SwInsertSectionTabPage::Create, 0);
|
|
|
|
|
AddTabPage(TP_COLUMN, SwColumnPage::Create, 0);
|
|
|
|
|
AddTabPage(TP_BACKGROUND,SvxBackgroundTabPage::Create, 0);
|
|
|
|
|
AddTabPage(TP_SECTION_FTNENDNOTES, SwSectionFtnEndTabPage::Create, 0);
|
|
|
|
|
|
|
|
|
|
OfaHtmlOptions* pHtmlOpt = OFF_APP()->GetHtmlOptions();
|
|
|
|
|
long nHtmlMode = pHtmlOpt->GetExportMode();
|
|
|
|
|
|
|
|
|
|
BOOL bWeb = 0 != PTR_CAST( SwWebDocShell, rSh.GetView().GetDocShell() );
|
|
|
|
|
if(bWeb)
|
|
|
|
|
{
|
|
|
|
|
RemoveTabPage(TP_SECTION_FTNENDNOTES);
|
2002-07-04 06:55:41 +00:00
|
|
|
|
if( HTML_CFG_NS40 != nHtmlMode && HTML_CFG_WRITER != nHtmlMode)
|
2000-09-18 16:15:01 +00:00
|
|
|
|
RemoveTabPage(TP_COLUMN);
|
|
|
|
|
}
|
|
|
|
|
SetCurPageId(TP_INSERT_SECTION);
|
|
|
|
|
}
|
|
|
|
|
/* -----------------21.05.99 10:17-------------------
|
|
|
|
|
*
|
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
|
SwInsertSectionTabDialog::~SwInsertSectionTabDialog()
|
|
|
|
|
{
|
|
|
|
|
delete pToInsertSection;
|
|
|
|
|
}
|
|
|
|
|
/* -----------------21.05.99 10:23-------------------
|
|
|
|
|
*
|
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
|
void SwInsertSectionTabDialog::PageCreated( USHORT nId, SfxTabPage &rPage )
|
|
|
|
|
{
|
|
|
|
|
if(TP_INSERT_SECTION == nId)
|
|
|
|
|
((SwInsertSectionTabPage&)rPage).SetWrtShell(rWrtSh);
|
|
|
|
|
else if( TP_BACKGROUND == nId )
|
|
|
|
|
((SvxBackgroundTabPage&)rPage).ShowSelector();
|
|
|
|
|
else if( TP_COLUMN == nId )
|
|
|
|
|
{
|
|
|
|
|
const SwFmtFrmSize& rSize = (const SwFmtFrmSize&)GetInputSetImpl()->Get(RES_FRM_SIZE);
|
|
|
|
|
((SwColumnPage&)rPage).SetPageWidth(rSize.GetWidth());
|
|
|
|
|
((SwColumnPage&)rPage).ShowBalance(TRUE);
|
2002-06-19 13:04:16 +00:00
|
|
|
|
((SwColumnPage&)rPage).SetInSection(TRUE);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* -----------------21.05.99 13:08-------------------
|
|
|
|
|
*
|
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
void SwInsertSectionTabDialog::SetSection(const SwSection& rSect)
|
|
|
|
|
{
|
|
|
|
|
pToInsertSection = new SwSection(CONTENT_SECTION, aEmptyStr);
|
|
|
|
|
*pToInsertSection = rSect;
|
|
|
|
|
}
|
|
|
|
|
/* -----------------21.05.99 13:10-------------------
|
|
|
|
|
*
|
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
|
short SwInsertSectionTabDialog::Ok()
|
|
|
|
|
{
|
|
|
|
|
short nRet = SfxTabDialog::Ok();
|
|
|
|
|
DBG_ASSERT(pToInsertSection, "keiner Section?")
|
2002-08-07 12:20:38 +00:00
|
|
|
|
const SfxItemSet* pOutSet = GetOutputItemSet();
|
|
|
|
|
rWrtSh.InsertSection(*pToInsertSection, pOutSet);
|
|
|
|
|
SfxViewFrame* pViewFrm = rWrtSh.GetView().GetViewFrame();
|
|
|
|
|
com::sun::star::uno::Reference< com::sun::star::frame::XDispatchRecorder > xRecorder =
|
|
|
|
|
pViewFrm->GetBindings().GetRecorder();
|
|
|
|
|
if ( xRecorder.is() )
|
|
|
|
|
{
|
|
|
|
|
SfxRequest aRequest( pViewFrm, FN_INSERT_REGION);
|
|
|
|
|
const SfxPoolItem* pCol;
|
|
|
|
|
if(SFX_ITEM_SET == pOutSet->GetItemState(RES_COL, FALSE, &pCol))
|
|
|
|
|
{
|
|
|
|
|
aRequest.AppendItem(SfxUInt16Item(SID_ATTR_COLUMNS,
|
|
|
|
|
((const SwFmtCol*)pCol)->GetColumns().Count()));
|
|
|
|
|
}
|
|
|
|
|
aRequest.AppendItem(SfxStringItem( FN_PARAM_REGION_NAME, pToInsertSection->GetName()));
|
|
|
|
|
aRequest.AppendItem(SfxStringItem( FN_PARAM_REGION_CONDITION, pToInsertSection->GetCondition()));
|
|
|
|
|
aRequest.AppendItem(SfxBoolItem( FN_PARAM_REGION_HIDDEN, pToInsertSection->IsHidden()));
|
|
|
|
|
aRequest.AppendItem(SfxBoolItem(FN_PARAM_REGION_PROTECT, pToInsertSection->IsProtect()));
|
|
|
|
|
|
|
|
|
|
String sLinkFileName( pToInsertSection->GetLinkFileName() );
|
|
|
|
|
aRequest.AppendItem(SfxStringItem( FN_PARAM_1, sLinkFileName.GetToken( 0, so3::cTokenSeperator )));
|
|
|
|
|
aRequest.AppendItem(SfxStringItem( FN_PARAM_2, sLinkFileName.GetToken( 1, so3::cTokenSeperator )));
|
|
|
|
|
aRequest.AppendItem(SfxStringItem( FN_PARAM_3, sLinkFileName.GetToken( 2, so3::cTokenSeperator )));
|
|
|
|
|
aRequest.Done();
|
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
return nRet;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* -----------------21.05.99 10:31-------------------
|
|
|
|
|
*
|
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
|
SwInsertSectionTabPage::SwInsertSectionTabPage(
|
|
|
|
|
Window *pParent, const SfxItemSet &rAttrSet) :
|
|
|
|
|
SfxTabPage( pParent, SW_RES(TP_INSERT_SECTION), rAttrSet ),
|
2001-04-27 11:10:09 +00:00
|
|
|
|
aNameFL ( this, SW_RES( FL_NAME ) ),
|
|
|
|
|
aCurName ( this, SW_RES( ED_RNAME ) ),
|
|
|
|
|
aLinkFL ( this, SW_RES( FL_LINK ) ),
|
|
|
|
|
aFileCB ( this, SW_RES( CB_FILE ) ),
|
2000-09-18 16:15:01 +00:00
|
|
|
|
#ifdef DDE_AVAILABLE
|
|
|
|
|
aDDECB ( this, SW_RES( CB_DDE ) ) ,
|
|
|
|
|
aDDECommandFT ( this, SW_RES( FT_DDE ) ) ,
|
|
|
|
|
#endif
|
|
|
|
|
aFileNameFT ( this, SW_RES( FT_FILE ) ) ,
|
|
|
|
|
aFileNameED ( this, SW_RES( ED_FILE ) ),
|
2001-04-27 11:10:09 +00:00
|
|
|
|
aFilePB ( this, SW_RES( PB_FILE ) ),
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aSubRegionFT ( this, SW_RES( FT_SUBREG ) ) ,
|
|
|
|
|
aSubRegionED ( this, SW_RES( LB_SUBREG ) ) ,
|
2001-04-27 11:10:09 +00:00
|
|
|
|
|
|
|
|
|
aProtectFL ( this, SW_RES( FL_PROTECT ) ),
|
|
|
|
|
aProtectCB ( this, SW_RES( CB_PROTECT ) ),
|
|
|
|
|
aPasswdCB ( this, SW_RES( CB_PASSWD ) ),
|
|
|
|
|
aPasswdPB ( this, SW_RES( PB_PASSWD ) ),
|
|
|
|
|
|
|
|
|
|
aHideFL ( this, SW_RES( FL_HIDE ) ),
|
|
|
|
|
aHideCB ( this, SW_RES( CB_HIDE ) ),
|
|
|
|
|
aConditionFT ( this, SW_RES( FT_CONDITION ) ),
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aConditionED ( this, SW_RES( ED_CONDITION ) ),
|
2001-04-27 11:10:09 +00:00
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
|
sSection (SW_RES( STR_REGION_DEFNAME )),
|
|
|
|
|
pWrtSh(0)
|
|
|
|
|
{
|
|
|
|
|
FreeResource();
|
|
|
|
|
|
|
|
|
|
aProtectCB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, ChangeProtectHdl));
|
2001-04-27 11:10:09 +00:00
|
|
|
|
aPasswdCB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, ChangePasswdHdl));
|
|
|
|
|
aPasswdPB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, ChangePasswdHdl));
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aHideCB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, ChangeHideHdl));
|
|
|
|
|
aFileCB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, UseFileHdl ));
|
|
|
|
|
aFilePB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, FileSearchHdl ));
|
|
|
|
|
aCurName.SetModifyHdl ( LINK( this, SwInsertSectionTabPage, NameEditHdl));
|
|
|
|
|
#ifdef DDE_AVAILABLE
|
|
|
|
|
aDDECB.SetClickHdl ( LINK( this, SwInsertSectionTabPage, DDEHdl ));
|
|
|
|
|
#endif
|
2001-05-30 06:35:37 +00:00
|
|
|
|
ChangeProtectHdl(&aProtectCB);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
/* -----------------21.05.99 10:31-------------------
|
|
|
|
|
*
|
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
|
SwInsertSectionTabPage::~SwInsertSectionTabPage()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
/* -----------------21.05.99 12:58-------------------
|
|
|
|
|
*
|
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
|
void SwInsertSectionTabPage::SetWrtShell(SwWrtShell& rSh)
|
|
|
|
|
{
|
|
|
|
|
pWrtSh = &rSh;
|
|
|
|
|
|
|
|
|
|
BOOL bWeb = 0 != PTR_CAST(SwWebDocShell, pWrtSh->GetView().GetDocShell());
|
|
|
|
|
if(bWeb)
|
|
|
|
|
{
|
|
|
|
|
aHideCB .Hide();
|
|
|
|
|
aConditionED .Hide();
|
2001-04-27 11:10:09 +00:00
|
|
|
|
aConditionFT .Hide();
|
2000-09-18 16:15:01 +00:00
|
|
|
|
#ifdef DDE_AVAILABLE
|
|
|
|
|
aDDECB .Hide();
|
|
|
|
|
aDDECommandFT .Hide();
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
USHORT nCount = pWrtSh->GetSectionFmtCount();
|
|
|
|
|
FillList();
|
|
|
|
|
USHORT nCnt = pWrtSh->GetBookmarkCnt();
|
|
|
|
|
for( USHORT i = 0; i < nCnt; ++i )
|
|
|
|
|
{
|
|
|
|
|
SwBookmark& rBm = pWrtSh->GetBookmark( i );
|
|
|
|
|
if( rBm.GetOtherPos() )
|
|
|
|
|
aSubRegionED.InsertEntry( rBm.GetName() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SwSection* pSect = ((SwInsertSectionTabDialog*)GetTabDialog())->GetSection();
|
|
|
|
|
if( pSect ) // etwas vorgegeben ?
|
|
|
|
|
{
|
|
|
|
|
aCurName.SetText( rSh.GetUniqueSectionName( &pSect->GetName() ));
|
|
|
|
|
aProtectCB.Check( 0 != pSect->IsProtect() );
|
|
|
|
|
sFileName = pSect->GetLinkFileName();
|
|
|
|
|
sFilePasswd = pSect->GetLinkFilePassWd();
|
|
|
|
|
aFileCB.Check( 0 != sFileName.Len() );
|
|
|
|
|
aFileNameED.SetText( sFileName );
|
|
|
|
|
UseFileHdl( &aFileCB );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
aCurName.SetText( rSh.GetUniqueSectionName() );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* -----------------21.05.99 10:32-------------------
|
|
|
|
|
*
|
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
|
BOOL SwInsertSectionTabPage::FillItemSet( SfxItemSet& rSet)
|
|
|
|
|
{
|
|
|
|
|
SwSection aSection(CONTENT_SECTION, aCurName.GetText());
|
2001-04-27 11:10:09 +00:00
|
|
|
|
aSection.SetCondition(aConditionED.GetText());
|
2001-05-30 06:35:37 +00:00
|
|
|
|
BOOL bProtected = aProtectCB.IsChecked();
|
|
|
|
|
aSection.SetProtect(bProtected);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aSection.SetHidden(aHideCB.IsChecked());
|
2001-05-30 06:35:37 +00:00
|
|
|
|
if(bProtected)
|
|
|
|
|
aSection.SetPasswd(aNewPasswd);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
String sFileName = aFileNameED.GetText();
|
|
|
|
|
String sSubRegion = aSubRegionED.GetText();
|
|
|
|
|
BOOL bDDe = FALSE;
|
|
|
|
|
#ifdef DDE_AVAILABLE
|
|
|
|
|
bDDe = aDDECB.IsChecked();
|
|
|
|
|
#endif
|
|
|
|
|
if(aFileCB.IsChecked() && (sFileName.Len() || sSubRegion.Len() || bDDe))
|
|
|
|
|
{
|
|
|
|
|
String aLinkFile;
|
|
|
|
|
if( bDDe )
|
|
|
|
|
{
|
|
|
|
|
aLinkFile = sFileName;
|
|
|
|
|
|
|
|
|
|
USHORT nPos = 0;
|
|
|
|
|
while( STRING_NOTFOUND != (nPos = aLinkFile.SearchAscii( " ", nPos )) )
|
|
|
|
|
aLinkFile.Erase( nPos--, 1 );
|
|
|
|
|
|
2001-07-05 12:26:33 +00:00
|
|
|
|
nPos = aLinkFile.SearchAndReplace( ' ', so3::cTokenSeperator );
|
|
|
|
|
aLinkFile.SearchAndReplace( ' ', so3::cTokenSeperator, nPos );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if(sFileName.Len())
|
|
|
|
|
{
|
|
|
|
|
aLinkFile = URIHelper::SmartRelToAbs( sFileName );
|
|
|
|
|
aSection.SetLinkFilePassWd( sFilePasswd );
|
|
|
|
|
}
|
|
|
|
|
|
2001-07-05 12:26:33 +00:00
|
|
|
|
aLinkFile += so3::cTokenSeperator;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aLinkFile += sFilterName;
|
2001-07-05 12:26:33 +00:00
|
|
|
|
aLinkFile += so3::cTokenSeperator;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aLinkFile += sSubRegion;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
aSection.SetLinkFileName(aLinkFile);
|
|
|
|
|
if(aLinkFile.Len())
|
|
|
|
|
{
|
|
|
|
|
#ifdef DDE_AVAILABLE
|
|
|
|
|
aSection.SetType( aDDECB.IsChecked() ?
|
|
|
|
|
DDE_LINK_SECTION :
|
|
|
|
|
FILE_LINK_SECTION);
|
|
|
|
|
#else
|
|
|
|
|
aSection.SetType( FILE_LINK_SECTION);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
((SwInsertSectionTabDialog*)GetTabDialog())->SetSection(aSection);
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
/* -----------------21.05.99 10:32-------------------
|
|
|
|
|
*
|
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
|
void SwInsertSectionTabPage::Reset( const SfxItemSet& )
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
/* -----------------21.05.99 11:22-------------------
|
|
|
|
|
*
|
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
|
SfxTabPage* SwInsertSectionTabPage::Create( Window* pParent,
|
|
|
|
|
const SfxItemSet& rAttrSet)
|
|
|
|
|
{
|
|
|
|
|
return new SwInsertSectionTabPage(pParent, rAttrSet);
|
|
|
|
|
}
|
|
|
|
|
/*---------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
IMPL_LINK( SwInsertSectionTabPage, ChangeHideHdl, CheckBox *, pBox )
|
|
|
|
|
{
|
|
|
|
|
BOOL bHide = pBox->IsChecked();
|
2001-04-27 11:10:09 +00:00
|
|
|
|
aConditionED.Enable(bHide);
|
|
|
|
|
aConditionFT.Enable(bHide);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
/*---------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------*/
|
|
|
|
|
|
2001-04-27 11:10:09 +00:00
|
|
|
|
IMPL_LINK( SwInsertSectionTabPage, ChangeProtectHdl, CheckBox *, pBox )
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
2001-04-27 11:10:09 +00:00
|
|
|
|
sal_Bool bCheck = pBox->IsChecked();
|
|
|
|
|
aPasswdCB.Enable(bCheck);
|
|
|
|
|
aPasswdPB.Enable(bCheck);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
2001-04-27 11:10:09 +00:00
|
|
|
|
/* -----------------------------26.04.01 14:50--------------------------------
|
2000-09-18 16:15:01 +00:00
|
|
|
|
|
2001-04-27 11:10:09 +00:00
|
|
|
|
---------------------------------------------------------------------------*/
|
|
|
|
|
IMPL_LINK( SwInsertSectionTabPage, ChangePasswdHdl, Button *, pButton )
|
2000-09-18 16:15:01 +00:00
|
|
|
|
{
|
2001-04-27 11:10:09 +00:00
|
|
|
|
sal_Bool bChange = pButton == &aPasswdPB;
|
|
|
|
|
sal_Bool bSet = bChange ? bChange : aPasswdCB.IsChecked();
|
2001-08-07 08:27:19 +00:00
|
|
|
|
if(bSet)
|
|
|
|
|
{
|
|
|
|
|
if(!aNewPasswd.getLength() || bChange)
|
2001-04-27 11:10:09 +00:00
|
|
|
|
{
|
2001-08-07 08:27:19 +00:00
|
|
|
|
SwTestPasswdDlg aPasswdDlg(this);
|
|
|
|
|
aPasswdDlg.ShowExtras(SHOWEXTRAS_CONFIRM);
|
|
|
|
|
if(RET_OK == aPasswdDlg.Execute())
|
2001-04-27 11:10:09 +00:00
|
|
|
|
{
|
2001-08-07 08:27:19 +00:00
|
|
|
|
String sNewPasswd( aPasswdDlg.GetPassword() );
|
|
|
|
|
if( aPasswdDlg.GetConfirm() == sNewPasswd )
|
2001-04-27 11:10:09 +00:00
|
|
|
|
{
|
2001-08-07 08:27:19 +00:00
|
|
|
|
SvPasswordHelper::GetHashPassword( aNewPasswd, sNewPasswd );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
InfoBox(pButton, SW_RES(REG_WRONG_PASSWD_REPEAT)).Execute();
|
2001-04-27 11:10:09 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2001-08-07 08:27:19 +00:00
|
|
|
|
else if(!bChange)
|
|
|
|
|
aPasswdCB.Check(FALSE);
|
2001-04-27 11:10:09 +00:00
|
|
|
|
}
|
2001-08-07 08:27:19 +00:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
aNewPasswd.realloc(0);
|
2000-09-18 16:15:01 +00:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
/*---------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
IMPL_LINK_INLINE_START( SwInsertSectionTabPage, NameEditHdl, Edit *, EMPTYARG )
|
|
|
|
|
{
|
|
|
|
|
String aName=aCurName.GetText();
|
|
|
|
|
GetTabDialog()->GetOKButton().Enable(aName.Len() && aCurName.GetEntryPos( aName ) == USHRT_MAX);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
IMPL_LINK_INLINE_END( SwInsertSectionTabPage, NameEditHdl, Edit *, EMPTYARG )
|
|
|
|
|
|
|
|
|
|
/*---------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
IMPL_LINK( SwInsertSectionTabPage, UseFileHdl, CheckBox *, pBox )
|
|
|
|
|
{
|
|
|
|
|
if( pBox->IsChecked() )
|
|
|
|
|
{
|
|
|
|
|
if( pWrtSh->HasSelection() &&
|
|
|
|
|
RET_NO == QueryBox( this, SW_RES(QB_CONNECT) ).Execute() )
|
|
|
|
|
pBox->Check( FALSE );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOL bFile = pBox->IsChecked();
|
|
|
|
|
aFileNameFT.Enable(bFile);
|
|
|
|
|
aFileNameED.Enable(bFile);
|
|
|
|
|
aFilePB.Enable(bFile);
|
|
|
|
|
aSubRegionFT.Enable(bFile);
|
|
|
|
|
aSubRegionED.Enable(bFile);
|
|
|
|
|
#ifdef DDE_AVAILABLE
|
|
|
|
|
aDDECommandFT.Enable(bFile);
|
|
|
|
|
aDDECB.Enable(bFile);
|
|
|
|
|
#endif
|
|
|
|
|
if( bFile )
|
|
|
|
|
{
|
|
|
|
|
// aFileNameED.SetText( aFileName );
|
|
|
|
|
aFileNameED.GrabFocus();
|
|
|
|
|
aProtectCB.Check( TRUE );
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
#ifdef DDE_AVAILABLE
|
|
|
|
|
aDDECB.Check(FALSE);
|
|
|
|
|
DDEHdl(&aDDECB);
|
|
|
|
|
#endif
|
|
|
|
|
// aFileNameED.SetText(aEmptyStr);
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*---------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
IMPL_LINK( SwInsertSectionTabPage, FileSearchHdl, PushButton *, EMPTYARG )
|
|
|
|
|
{
|
|
|
|
|
SfxMedium* pMed;
|
|
|
|
|
if( GetFileFilterNameDlg( *this, sFileName, &sFilePasswd,
|
|
|
|
|
&sFilterName, &pMed ))
|
|
|
|
|
{
|
2001-02-23 14:05:32 +00:00
|
|
|
|
aFileNameED.SetText( INetURLObject::decode( sFileName, INET_HEX_ESCAPE,
|
|
|
|
|
INetURLObject::DECODE_UNAMBIGUOUS,
|
|
|
|
|
RTL_TEXTENCODING_UTF8 ));
|
|
|
|
|
|
2000-09-18 16:15:01 +00:00
|
|
|
|
::lcl_ReadSections( *pWrtSh, *pMed, aSubRegionED );
|
|
|
|
|
delete pMed; // das brauchen wir nicht mehr !
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
sFilterName = sFilePasswd = aEmptyStr;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*---------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
---------------------------------------------------------------------*/
|
|
|
|
|
#ifdef DDE_AVAILABLE
|
|
|
|
|
|
|
|
|
|
IMPL_LINK( SwInsertSectionTabPage, DDEHdl, CheckBox*, pBox )
|
|
|
|
|
{
|
|
|
|
|
BOOL bDDE = pBox->IsChecked();
|
|
|
|
|
BOOL bFile = aFileCB.IsChecked();
|
|
|
|
|
aFilePB.Enable(!bDDE && bFile);
|
|
|
|
|
if(bDDE)
|
|
|
|
|
{
|
|
|
|
|
aFileNameFT.Hide();
|
|
|
|
|
aDDECommandFT.Enable(bDDE);
|
|
|
|
|
aDDECommandFT.Show();
|
|
|
|
|
aSubRegionFT.Hide();
|
|
|
|
|
aSubRegionED.Hide();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
aDDECommandFT.Hide();
|
|
|
|
|
aFileNameFT.Enable(bFile);
|
|
|
|
|
aFileNameFT.Show();
|
|
|
|
|
aSubRegionFT.Show();
|
|
|
|
|
aSubRegionED.Show();
|
|
|
|
|
aSubRegionED.Enable(bFile);
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
Beschreibung: Liste der verwendeten Namen fuellen
|
|
|
|
|
--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
void SwInsertSectionTabPage::FillList( const SwSectionFmt* pNewFmt )
|
|
|
|
|
{
|
|
|
|
|
const SwSectionFmt* pFmt;
|
|
|
|
|
if( !pNewFmt )
|
|
|
|
|
{
|
|
|
|
|
USHORT nCount = pWrtSh->GetSectionFmtCount();
|
|
|
|
|
for(USHORT i=0;i<nCount;i++)
|
|
|
|
|
{
|
|
|
|
|
SectionType eTmpType;
|
|
|
|
|
if( !(pFmt = &pWrtSh->GetSectionFmt(i))->GetParent() &&
|
|
|
|
|
pFmt->IsInNodesArr() &&
|
|
|
|
|
(eTmpType = pFmt->GetSection()->GetType()) != TOX_CONTENT_SECTION
|
|
|
|
|
&& TOX_HEADER_SECTION != eTmpType )
|
|
|
|
|
{
|
|
|
|
|
String* pString = new String(pFmt->GetSection()->GetName());
|
|
|
|
|
aCurName.InsertEntry(*pString);
|
|
|
|
|
aSubRegionED.InsertEntry(*pString);
|
|
|
|
|
FillList( pFmt );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
SwSections aTmpArr;
|
|
|
|
|
USHORT nCnt = pNewFmt->GetChildSections(aTmpArr,SORTSECT_POS);
|
|
|
|
|
if( nCnt )
|
|
|
|
|
{
|
|
|
|
|
SectionType eTmpType;
|
|
|
|
|
for( USHORT n = 0; n < nCnt; ++n )
|
|
|
|
|
if( (pFmt = aTmpArr[n]->GetFmt())->IsInNodesArr()&&
|
|
|
|
|
(eTmpType = pFmt->GetSection()->GetType()) != TOX_CONTENT_SECTION
|
|
|
|
|
&& TOX_HEADER_SECTION != eTmpType )
|
|
|
|
|
{
|
|
|
|
|
String* pString = new String(pFmt->GetSection()->GetName());
|
|
|
|
|
aCurName.InsertEntry(*pString);
|
|
|
|
|
aSubRegionED.InsertEntry(*pString);
|
|
|
|
|
FillList( pFmt );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// --------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
// Numerierungsformat Umsetzung:
|
|
|
|
|
// ListBox - Format - Enum-Wert
|
|
|
|
|
// 0 - A, B, C, ... - 0
|
|
|
|
|
// 1 - a, b, c, ... - 1
|
|
|
|
|
// 2 - I, II, III, ... - 2
|
|
|
|
|
// 3 - i, ii, iii, ... - 3
|
|
|
|
|
// 4 - 1, 2, 3, ... - 4
|
|
|
|
|
// 5 - A, .., AA, .., - 9
|
|
|
|
|
// 6 - a, .., aa, .., - 10
|
|
|
|
|
|
|
|
|
|
inline USHORT GetNumPos( USHORT n )
|
|
|
|
|
{
|
|
|
|
|
return SVX_NUM_ARABIC < n ? n - 4 : n;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
inline SvxExtNumType GetNumType( USHORT n )
|
|
|
|
|
{
|
|
|
|
|
return (SvxExtNumType)(4 < n ? n + 4 : n );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SwSectionFtnEndTabPage::SwSectionFtnEndTabPage( Window *pParent,
|
|
|
|
|
const SfxItemSet &rAttrSet)
|
|
|
|
|
: SfxTabPage( pParent, SW_RES( TP_SECTION_FTNENDNOTES ), rAttrSet ),
|
2001-04-27 11:10:09 +00:00
|
|
|
|
aFtnFL ( this, SW_RES( FL_FTN ) ),
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aFtnNtAtTextEndCB ( this, SW_RES( CB_FTN_AT_TXTEND ) ),
|
|
|
|
|
aFtnNtNumCB ( this, SW_RES( CB_FTN_NUM ) ),
|
|
|
|
|
aFtnNtNumFmtCB ( this, SW_RES( CB_FTN_NUM_FMT ) ),
|
2001-03-02 13:10:47 +00:00
|
|
|
|
aFtnNumViewBox ( this, SW_RES( LB_FTN_NUMVIEW ), INSERT_NUM_EXTENDED_TYPES),
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aFtnOffsetLbl ( this, SW_RES( FT_FTN_OFFSET )),
|
|
|
|
|
aFtnOffsetFld ( this, SW_RES( FLD_FTN_OFFSET )),
|
|
|
|
|
aFtnPrefixFT ( this, SW_RES( FT_FTN_PREFIX )),
|
|
|
|
|
aFtnPrefixED ( this, SW_RES( ED_FTN_PREFIX )),
|
|
|
|
|
aFtnSuffixFT ( this, SW_RES( FT_FTN_SUFFIX )),
|
|
|
|
|
aFtnSuffixED ( this, SW_RES( ED_FTN_SUFFIX )),
|
2001-04-27 11:10:09 +00:00
|
|
|
|
aEndFL ( this, SW_RES( FL_END ) ),
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aEndNtAtTextEndCB ( this, SW_RES( CB_END_AT_TXTEND )),
|
|
|
|
|
aEndNtNumCB ( this, SW_RES( CB_END_NUM )),
|
|
|
|
|
aEndNtNumFmtCB ( this, SW_RES( CB_END_NUM_FMT ) ),
|
|
|
|
|
aEndNumViewBox ( this, SW_RES( LB_END_NUMVIEW )),
|
|
|
|
|
aEndOffsetLbl ( this, SW_RES( FT_END_OFFSET )),
|
|
|
|
|
aEndOffsetFld ( this, SW_RES( FLD_END_OFFSET )),
|
|
|
|
|
aEndPrefixFT ( this, SW_RES( FT_END_PREFIX )),
|
|
|
|
|
aEndPrefixED ( this, SW_RES( ED_END_PREFIX )),
|
|
|
|
|
aEndSuffixFT ( this, SW_RES( FT_END_SUFFIX )),
|
|
|
|
|
aEndSuffixED ( this, SW_RES( ED_END_SUFFIX ))
|
|
|
|
|
{
|
|
|
|
|
FreeResource();
|
|
|
|
|
|
|
|
|
|
Link aLk( LINK( this, SwSectionFtnEndTabPage, FootEndHdl));
|
|
|
|
|
aFtnNtAtTextEndCB.SetClickHdl( aLk );
|
|
|
|
|
aFtnNtNumCB.SetClickHdl( aLk );
|
|
|
|
|
aEndNtAtTextEndCB.SetClickHdl( aLk );
|
|
|
|
|
aEndNtNumCB.SetClickHdl( aLk );
|
|
|
|
|
aFtnNtNumFmtCB.SetClickHdl( aLk );
|
|
|
|
|
aEndNtNumFmtCB.SetClickHdl( aLk );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SwSectionFtnEndTabPage::~SwSectionFtnEndTabPage()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOL SwSectionFtnEndTabPage::FillItemSet( SfxItemSet& rSet )
|
|
|
|
|
{
|
|
|
|
|
BOOL bRecording = FALSE;//pRequest && 0 != SfxRequest::GetRecordingMacro();
|
|
|
|
|
|
|
|
|
|
SwFmtFtnAtTxtEnd aFtn( aFtnNtAtTextEndCB.IsChecked()
|
|
|
|
|
? ( aFtnNtNumCB.IsChecked()
|
|
|
|
|
? ( aFtnNtNumFmtCB.IsChecked()
|
|
|
|
|
? FTNEND_ATTXTEND_OWNNUMANDFMT
|
|
|
|
|
: FTNEND_ATTXTEND_OWNNUMSEQ )
|
|
|
|
|
: FTNEND_ATTXTEND )
|
|
|
|
|
: FTNEND_ATPGORDOCEND );
|
|
|
|
|
|
|
|
|
|
switch( aFtn.GetValue() )
|
|
|
|
|
{
|
|
|
|
|
case FTNEND_ATTXTEND_OWNNUMANDFMT:
|
2001-03-02 13:10:47 +00:00
|
|
|
|
aFtn.SetNumType( aFtnNumViewBox.GetSelectedNumberingType() );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
aFtn.SetPrefix( aFtnPrefixED.GetText() );
|
|
|
|
|
aFtn.SetSuffix( aFtnSuffixED.GetText() );
|
|
|
|
|
// no break;
|
|
|
|
|
|
|
|
|
|
case FTNEND_ATTXTEND_OWNNUMSEQ:
|
|
|
|
|
aFtn.SetOffset( aFtnOffsetFld.GetValue()-1 );
|
|
|
|
|
// no break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SwFmtEndAtTxtEnd aEnd( aEndNtAtTextEndCB.IsChecked()
|
|
|
|
|
? ( aEndNtNumCB.IsChecked()
|
|
|
|
|
? ( aEndNtNumFmtCB.IsChecked()
|
|
|
|
|
? FTNEND_ATTXTEND_OWNNUMANDFMT
|
|
|
|
|
: FTNEND_ATTXTEND_OWNNUMSEQ )
|
|
|
|
|
: FTNEND_ATTXTEND )
|
|
|
|
|
: FTNEND_ATPGORDOCEND );
|
|
|
|
|
|
|
|
|
|
switch( aEnd.GetValue() )
|
|
|
|
|
{
|
|
|
|
|
case FTNEND_ATTXTEND_OWNNUMANDFMT:
|
|
|
|
|
aEnd.SetNumType( GetNumType( aEndNumViewBox.GetSelectEntryPos() ));
|
|
|
|
|
aEnd.SetPrefix( aEndPrefixED.GetText() );
|
|
|
|
|
aEnd.SetSuffix( aEndSuffixED.GetText() );
|
|
|
|
|
// no break;
|
|
|
|
|
|
|
|
|
|
case FTNEND_ATTXTEND_OWNNUMSEQ:
|
|
|
|
|
aEnd.SetOffset( aEndOffsetFld.GetValue()-1 );
|
|
|
|
|
// no break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rSet.Put( aFtn );
|
|
|
|
|
rSet.Put( aEnd );
|
|
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SwSectionFtnEndTabPage::ResetState( BOOL bFtn,
|
|
|
|
|
const SwFmtFtnEndAtTxtEnd& rAttr )
|
|
|
|
|
{
|
|
|
|
|
CheckBox *pNtAtTextEndCB, *pNtNumCB, *pNtNumFmtCB;
|
|
|
|
|
FixedText*pPrefixFT, *pSuffixFT;
|
|
|
|
|
Edit *pPrefixED, *pSuffixED;
|
2001-03-02 13:10:47 +00:00
|
|
|
|
SwNumberingTypeListBox *pNumViewBox;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
FixedText* pOffsetTxt;
|
|
|
|
|
NumericField *pOffsetFld;
|
|
|
|
|
|
|
|
|
|
if( bFtn )
|
|
|
|
|
{
|
|
|
|
|
pNtAtTextEndCB = &aFtnNtAtTextEndCB;
|
|
|
|
|
pNtNumCB = &aFtnNtNumCB;
|
|
|
|
|
pNtNumFmtCB = &aFtnNtNumFmtCB;
|
|
|
|
|
pPrefixFT = &aFtnPrefixFT;
|
|
|
|
|
pPrefixED = &aFtnPrefixED;
|
|
|
|
|
pSuffixFT = &aFtnSuffixFT;
|
|
|
|
|
pSuffixED = &aFtnSuffixED;
|
|
|
|
|
pNumViewBox = &aFtnNumViewBox;
|
|
|
|
|
pOffsetTxt = &aFtnOffsetLbl;
|
|
|
|
|
pOffsetFld = &aFtnOffsetFld;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pNtAtTextEndCB = &aEndNtAtTextEndCB;
|
|
|
|
|
pNtNumCB = &aEndNtNumCB;
|
|
|
|
|
pNtNumFmtCB = &aEndNtNumFmtCB;
|
|
|
|
|
pPrefixFT = &aEndPrefixFT;
|
|
|
|
|
pPrefixED = &aEndPrefixED;
|
|
|
|
|
pSuffixFT = &aEndSuffixFT;
|
|
|
|
|
pSuffixED = &aEndSuffixED;
|
|
|
|
|
pNumViewBox = &aEndNumViewBox;
|
|
|
|
|
pOffsetTxt = &aEndOffsetLbl;
|
|
|
|
|
pOffsetFld = &aEndOffsetFld;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
USHORT eState = rAttr.GetValue();
|
|
|
|
|
switch( eState )
|
|
|
|
|
{
|
|
|
|
|
// case FTNEND_ATPGORDOCEND:
|
|
|
|
|
case FTNEND_ATTXTEND_OWNNUMANDFMT:
|
|
|
|
|
pNtNumFmtCB->SetState( STATE_CHECK );
|
|
|
|
|
// no break;
|
|
|
|
|
|
|
|
|
|
case FTNEND_ATTXTEND_OWNNUMSEQ:
|
|
|
|
|
pNtNumCB->SetState( STATE_CHECK );
|
|
|
|
|
// no break;
|
|
|
|
|
|
|
|
|
|
case FTNEND_ATTXTEND:
|
|
|
|
|
pNtAtTextEndCB->SetState( STATE_CHECK );
|
|
|
|
|
// no break;
|
|
|
|
|
}
|
|
|
|
|
|
2001-03-02 13:10:47 +00:00
|
|
|
|
pNumViewBox->SelectNumberingType( rAttr.GetNumType() );
|
2000-09-18 16:15:01 +00:00
|
|
|
|
pOffsetFld->SetValue( rAttr.GetOffset() + 1 );
|
|
|
|
|
pPrefixED->SetText( rAttr.GetPrefix() );
|
|
|
|
|
pSuffixED->SetText( rAttr.GetSuffix() );
|
|
|
|
|
|
|
|
|
|
switch( eState )
|
|
|
|
|
{
|
|
|
|
|
case FTNEND_ATPGORDOCEND:
|
|
|
|
|
pNtNumCB->Enable( FALSE );
|
|
|
|
|
// no break;
|
|
|
|
|
|
|
|
|
|
case FTNEND_ATTXTEND:
|
|
|
|
|
pNtNumFmtCB->Enable( FALSE );
|
|
|
|
|
pOffsetFld->Enable( FALSE );
|
|
|
|
|
pOffsetTxt->Enable( FALSE );
|
|
|
|
|
// no break;
|
|
|
|
|
|
|
|
|
|
case FTNEND_ATTXTEND_OWNNUMSEQ:
|
|
|
|
|
pNumViewBox->Enable( FALSE );
|
|
|
|
|
pPrefixFT->Enable( FALSE );
|
|
|
|
|
pPrefixED->Enable( FALSE );
|
|
|
|
|
pSuffixFT->Enable( FALSE );
|
|
|
|
|
pSuffixED->Enable( FALSE );
|
|
|
|
|
// no break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void SwSectionFtnEndTabPage::Reset( const SfxItemSet& rSet )
|
|
|
|
|
{
|
|
|
|
|
ResetState( TRUE, (const SwFmtFtnAtTxtEnd&)rSet.Get(
|
|
|
|
|
RES_FTN_AT_TXTEND, FALSE ));
|
|
|
|
|
ResetState( FALSE, (const SwFmtEndAtTxtEnd&)rSet.Get(
|
|
|
|
|
RES_END_AT_TXTEND, FALSE ));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SfxTabPage* SwSectionFtnEndTabPage::Create( Window* pParent,
|
|
|
|
|
const SfxItemSet& rAttrSet)
|
|
|
|
|
{
|
|
|
|
|
return new SwSectionFtnEndTabPage(pParent, rAttrSet);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IMPL_LINK( SwSectionFtnEndTabPage, FootEndHdl, CheckBox *, pBox )
|
|
|
|
|
{
|
|
|
|
|
// pBox->EnableTriState( FALSE );
|
|
|
|
|
BOOL bFoot = &aFtnNtAtTextEndCB == pBox || &aFtnNtNumCB == pBox ||
|
|
|
|
|
&aFtnNtNumFmtCB == pBox ;
|
|
|
|
|
|
|
|
|
|
CheckBox *pNumBox, *pNumFmtBox, *pEndBox;
|
2001-03-02 13:10:47 +00:00
|
|
|
|
SwNumberingTypeListBox* pNumViewBox;
|
2000-09-18 16:15:01 +00:00
|
|
|
|
FixedText* pOffsetTxt;
|
|
|
|
|
NumericField *pOffsetFld;
|
|
|
|
|
FixedText*pPrefixFT, *pSuffixFT;
|
|
|
|
|
Edit *pPrefixED, *pSuffixED;
|
|
|
|
|
|
|
|
|
|
if( bFoot )
|
|
|
|
|
{
|
|
|
|
|
pEndBox = &aFtnNtAtTextEndCB;
|
|
|
|
|
pNumBox = &aFtnNtNumCB;
|
|
|
|
|
pNumFmtBox = &aFtnNtNumFmtCB;
|
|
|
|
|
pNumViewBox = &aFtnNumViewBox;
|
|
|
|
|
pOffsetTxt = &aFtnOffsetLbl;
|
|
|
|
|
pOffsetFld = &aFtnOffsetFld;
|
|
|
|
|
pPrefixFT = &aFtnPrefixFT;
|
|
|
|
|
pSuffixFT = &aFtnSuffixFT;
|
|
|
|
|
pPrefixED = &aFtnPrefixED;
|
|
|
|
|
pSuffixED = &aFtnSuffixED;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
pEndBox = &aEndNtAtTextEndCB;
|
|
|
|
|
pNumBox = &aEndNtNumCB;
|
|
|
|
|
pNumFmtBox = &aEndNtNumFmtCB;
|
|
|
|
|
pNumViewBox = &aEndNumViewBox;
|
|
|
|
|
pOffsetTxt = &aEndOffsetLbl;
|
|
|
|
|
pOffsetFld = &aEndOffsetFld;
|
|
|
|
|
pPrefixFT = &aEndPrefixFT;
|
|
|
|
|
pSuffixFT = &aEndSuffixFT;
|
|
|
|
|
pPrefixED = &aEndPrefixED;
|
|
|
|
|
pSuffixED = &aEndSuffixED;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOL bEnableAtEnd = STATE_CHECK == pEndBox->GetState();
|
|
|
|
|
BOOL bEnableNum = bEnableAtEnd && STATE_CHECK == pNumBox->GetState();
|
|
|
|
|
BOOL bEnableNumFmt = bEnableNum && STATE_CHECK == pNumFmtBox->GetState();
|
|
|
|
|
|
|
|
|
|
pNumBox->Enable( bEnableAtEnd );
|
|
|
|
|
pOffsetTxt->Enable( bEnableNum );
|
|
|
|
|
pOffsetFld->Enable( bEnableNum );
|
|
|
|
|
pNumFmtBox->Enable( bEnableNum );
|
|
|
|
|
pNumViewBox->Enable( bEnableNumFmt );
|
|
|
|
|
pPrefixED->Enable( bEnableNumFmt );
|
|
|
|
|
pSuffixED->Enable( bEnableNumFmt );
|
|
|
|
|
pPrefixFT->Enable( bEnableNumFmt );
|
|
|
|
|
pSuffixFT->Enable( bEnableNumFmt );
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* -----------------21.05.99 13:59-------------------
|
|
|
|
|
*
|
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
|
SwSectionPropertyTabDialog::SwSectionPropertyTabDialog(
|
|
|
|
|
Window* pParent, const SfxItemSet& rSet, SwWrtShell& rSh) :
|
|
|
|
|
SfxTabDialog(pParent, SW_RES(DLG_SECTION_PROPERTIES), &rSet)
|
|
|
|
|
{
|
|
|
|
|
FreeResource();
|
|
|
|
|
|
|
|
|
|
AddTabPage(TP_COLUMN, SwColumnPage::Create, 0);
|
|
|
|
|
AddTabPage(TP_BACKGROUND,SvxBackgroundTabPage::Create, 0);
|
|
|
|
|
AddTabPage(TP_SECTION_FTNENDNOTES, SwSectionFtnEndTabPage::Create, 0);
|
|
|
|
|
|
|
|
|
|
OfaHtmlOptions* pHtmlOpt = OFF_APP()->GetHtmlOptions();
|
|
|
|
|
long nHtmlMode = pHtmlOpt->GetExportMode();
|
|
|
|
|
BOOL bWeb = 0 != PTR_CAST( SwWebDocShell, rSh.GetView().GetDocShell() );
|
|
|
|
|
if(bWeb)
|
|
|
|
|
{
|
|
|
|
|
RemoveTabPage(TP_SECTION_FTNENDNOTES);
|
2002-07-04 06:55:41 +00:00
|
|
|
|
if( HTML_CFG_NS40 != nHtmlMode && HTML_CFG_WRITER != nHtmlMode)
|
2000-09-18 16:15:01 +00:00
|
|
|
|
RemoveTabPage(TP_COLUMN);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* -----------------21.05.99 13:59-------------------
|
|
|
|
|
*
|
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
|
SwSectionPropertyTabDialog::~SwSectionPropertyTabDialog()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
/* -----------------21.05.99 13:59-------------------
|
|
|
|
|
*
|
|
|
|
|
* --------------------------------------------------*/
|
|
|
|
|
void SwSectionPropertyTabDialog::PageCreated( USHORT nId, SfxTabPage &rPage )
|
|
|
|
|
{
|
|
|
|
|
if( TP_BACKGROUND == nId )
|
|
|
|
|
((SvxBackgroundTabPage&)rPage).ShowSelector();
|
|
|
|
|
else if( TP_COLUMN == nId )
|
2002-06-19 13:04:16 +00:00
|
|
|
|
{
|
2000-09-18 16:15:01 +00:00
|
|
|
|
((SwColumnPage&)rPage).ShowBalance(TRUE);
|
2002-06-19 13:04:16 +00:00
|
|
|
|
((SwColumnPage&)rPage).SetInSection(TRUE);
|
|
|
|
|
}
|
2000-09-18 16:15:01 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|