2000-09-18 11:07:07 -05:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
2005-09-08 22:24:57 -05:00
|
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2005-09-08 22:24:57 -05:00
|
|
|
* $RCSfile: tpoption.cxx,v $
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2005-09-08 22:24:57 -05:00
|
|
|
* $Revision: 1.20 $
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2005-09-08 22:24:57 -05:00
|
|
|
* last change: $Author: rt $ $Date: 2005-09-09 04:24:56 $
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2005-09-08 22:24:57 -05:00
|
|
|
* The Contents of this file are made available subject to
|
|
|
|
* the terms of GNU Lesser General Public License Version 2.1.
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
|
|
|
*
|
2005-09-08 22:24:57 -05:00
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
* =============================================
|
|
|
|
* Copyright 2005 by Sun Microsystems, Inc.
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2005-09-08 22:24:57 -05:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License version 2.1, as published by the Free Software Foundation.
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2005-09-08 22:24:57 -05:00
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
2005-09-08 22:24:57 -05:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
2000-09-18 11:07:07 -05:00
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
2004-08-23 02:19:42 -05:00
|
|
|
#ifdef SD_DLLIMPLEMENTATION
|
|
|
|
#undef SD_DLLIMPLEMENTATION
|
|
|
|
#endif
|
|
|
|
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
#pragma hdrstop
|
|
|
|
|
2003-04-24 08:37:44 -05:00
|
|
|
#ifndef _COM_SUN_STAR_DOCUMENT_PRINTERINDEPENDENTLAYOUT_HPP_
|
|
|
|
#include <com/sun/star/document/PrinterIndependentLayout.hpp>
|
|
|
|
#endif
|
2003-05-13 06:20:01 -05:00
|
|
|
#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
|
|
|
|
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_FRAME_XDESKTOP_HPP_
|
|
|
|
#include <com/sun/star/frame/XDesktop.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HPP_
|
|
|
|
#include <com/sun/star/lang/XComponent.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_CONTAINER_XENUMERATIONACCESS_HPP_
|
|
|
|
#include <com/sun/star/container/XEnumerationAccess.hpp>
|
|
|
|
#endif
|
|
|
|
#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
|
|
|
|
#include <comphelper/processfactory.hxx>
|
|
|
|
#endif
|
|
|
|
#ifndef _COM_SUN_STAR_UNO_EXCEPTION_HPP_
|
|
|
|
#include <com/sun/star/uno/Exception.hpp>
|
|
|
|
#endif
|
2000-09-18 11:07:07 -05:00
|
|
|
#ifndef _SFXMODULE_HXX //autogen
|
|
|
|
#include <sfx2/module.hxx>
|
|
|
|
#endif
|
|
|
|
#include <sfx2/app.hxx>
|
|
|
|
#include <svx/svxids.hrc>
|
|
|
|
#include <svx/dialogs.hrc>
|
|
|
|
#include <svx/strarray.hxx>
|
|
|
|
#include <svx/dlgutil.hxx>
|
|
|
|
|
2001-04-04 01:00:36 -05:00
|
|
|
#ifndef _SV_MSGBOX_HXX
|
|
|
|
#include <vcl/msgbox.hxx>
|
|
|
|
#endif
|
|
|
|
|
2000-09-18 11:07:07 -05:00
|
|
|
#include "sdattr.hxx"
|
|
|
|
#include "sdresid.hxx"
|
|
|
|
#include "optsitem.hxx"
|
|
|
|
#include "tpoption.hrc"
|
|
|
|
#include "tpoption.hxx"
|
2001-04-04 01:00:36 -05:00
|
|
|
#include "strings.hrc"
|
2004-05-10 09:45:49 -05:00
|
|
|
#include "app.hrc" //CHINA001
|
|
|
|
#ifndef _SFXINTITEM_HXX //CHINA001
|
|
|
|
#include <svtools/intitem.hxx> //CHINA001
|
|
|
|
#endif //CHINA001
|
|
|
|
#include <sfx2/request.hxx> //CHINA001
|
2000-09-18 11:07:07 -05:00
|
|
|
#define DLGWIN this->GetParent()->GetParent()
|
|
|
|
|
2003-05-13 06:20:01 -05:00
|
|
|
using namespace ::com::sun::star;
|
|
|
|
using namespace ::com::sun::star::uno;
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* TabPage zum Einstellen der Fang-Optionen
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
SdTpOptionsSnap::SdTpOptionsSnap( Window* pParent, const SfxItemSet& rInAttrs ) :
|
2001-03-22 07:15:58 -06:00
|
|
|
SvxGridTabPage(pParent, rInAttrs)
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2001-03-22 07:15:58 -06:00
|
|
|
aGrpSnap.Show();
|
|
|
|
aCbxSnapHelplines.Show();
|
|
|
|
aCbxSnapBorder.Show();
|
|
|
|
aCbxSnapFrame.Show();
|
|
|
|
aCbxSnapPoints.Show();
|
|
|
|
aFtSnapArea.Show();
|
|
|
|
aMtrFldSnapArea.Show();
|
|
|
|
aGrpOrtho.Show();
|
|
|
|
aCbxOrtho.Show();
|
|
|
|
aCbxBigOrtho.Show();
|
|
|
|
aCbxRotate.Show();
|
|
|
|
aMtrFldAngle.Show();
|
|
|
|
aFtBezAngle.Show();
|
|
|
|
aMtrFldBezAngle.Show();
|
2001-05-04 01:22:02 -05:00
|
|
|
aSeparatorFL.Show();
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
SdTpOptionsSnap::~SdTpOptionsSnap()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
BOOL SdTpOptionsSnap::FillItemSet( SfxItemSet& rAttrs )
|
|
|
|
{
|
2001-03-22 07:15:58 -06:00
|
|
|
SvxGridTabPage::FillItemSet(rAttrs);
|
2000-09-18 11:07:07 -05:00
|
|
|
SdOptionsSnapItem* pOptsItem = NULL;
|
2001-03-22 07:15:58 -06:00
|
|
|
// if(SFX_ITEM_SET != rAttrs.GetItemState( ATTR_OPTIONS_SNAP, FALSE, (const SfxPoolItem**)&pOptsItem ))
|
|
|
|
// pExampleSet->GetItemState( ATTR_OPTIONS_SNAP, FALSE, (const SfxPoolItem**)&pOptsItem );
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
SdOptionsSnapItem aOptsItem( ATTR_OPTIONS_SNAP );
|
|
|
|
|
|
|
|
aOptsItem.SetSnapHelplines( aCbxSnapHelplines.IsChecked() );
|
|
|
|
aOptsItem.SetSnapBorder( aCbxSnapBorder.IsChecked() );
|
|
|
|
aOptsItem.SetSnapFrame( aCbxSnapFrame.IsChecked() );
|
|
|
|
aOptsItem.SetSnapPoints( aCbxSnapPoints.IsChecked() );
|
|
|
|
aOptsItem.SetOrtho( aCbxOrtho.IsChecked() );
|
|
|
|
aOptsItem.SetBigOrtho( aCbxBigOrtho.IsChecked() );
|
|
|
|
aOptsItem.SetRotate( aCbxRotate.IsChecked() );
|
|
|
|
aOptsItem.SetSnapArea( (INT16) aMtrFldSnapArea.GetValue() );
|
|
|
|
aOptsItem.SetAngle( (INT16) aMtrFldAngle.GetValue() );
|
|
|
|
aOptsItem.SetEliminatePolyPointLimitAngle( (INT16) aMtrFldBezAngle.GetValue() );
|
|
|
|
|
|
|
|
if( pOptsItem == NULL || !(aOptsItem == *pOptsItem) )
|
|
|
|
rAttrs.Put( aOptsItem );
|
|
|
|
|
|
|
|
// Evtl. vorhandenes GridItem wird geholt, um nicht versehentlich
|
|
|
|
// irgendwelche Standardwerte einzustellen
|
|
|
|
const SfxPoolItem* pAttr = NULL;
|
|
|
|
return( TRUE );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2001-10-22 07:36:57 -05:00
|
|
|
void SdTpOptionsSnap::Reset( const SfxItemSet& rAttrs )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
2001-03-22 07:15:58 -06:00
|
|
|
SvxGridTabPage::Reset(rAttrs);
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
SdOptionsSnapItem aOptsItem( (const SdOptionsSnapItem&) rAttrs.
|
|
|
|
Get( ATTR_OPTIONS_SNAP ) );
|
|
|
|
|
|
|
|
aCbxSnapHelplines.Check( aOptsItem.IsSnapHelplines() );
|
|
|
|
aCbxSnapBorder.Check( aOptsItem.IsSnapBorder() );
|
|
|
|
aCbxSnapFrame.Check( aOptsItem.IsSnapFrame() );
|
|
|
|
aCbxSnapPoints.Check( aOptsItem.IsSnapPoints() );
|
|
|
|
aCbxOrtho.Check( aOptsItem.IsOrtho() );
|
|
|
|
aCbxBigOrtho.Check( aOptsItem.IsBigOrtho() );
|
|
|
|
aCbxRotate.Check( aOptsItem.IsRotate() );
|
|
|
|
aMtrFldSnapArea.SetValue( aOptsItem.GetSnapArea() );
|
|
|
|
aMtrFldAngle.SetValue( aOptsItem.GetAngle() );
|
|
|
|
aMtrFldBezAngle.SetValue( aOptsItem.GetEliminatePolyPointLimitAngle() );
|
|
|
|
|
2001-03-22 07:15:58 -06:00
|
|
|
aCbxRotate.GetClickHdl().Call(0);
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2001-10-22 07:36:57 -05:00
|
|
|
SfxTabPage* SdTpOptionsSnap::Create( Window* pWindow,
|
2000-09-18 11:07:07 -05:00
|
|
|
const SfxItemSet& rAttrs )
|
|
|
|
{
|
|
|
|
return( new SdTpOptionsSnap( pWindow, rAttrs ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* TabPage zum Einstellen der Inhalte-Optionen
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
|
|
|
|
|
|
|
SdTpOptionsContents::SdTpOptionsContents( Window* pParent, const SfxItemSet& rInAttrs ) :
|
|
|
|
SfxTabPage ( pParent, SdResId( TP_OPTIONS_CONTENTS ), rInAttrs ),
|
|
|
|
aCbxExternGraphic ( this, SdResId( CBX_EXTERN_GRAPHIC ) ),
|
|
|
|
aCbxOutlineMode ( this, SdResId( CBX_OUTLINEMODE ) ),
|
|
|
|
aCbxNoText ( this, SdResId( CBX_NOTEXT ) ),
|
|
|
|
aCbxHairlineMode ( this, SdResId( CBX_HAIRLINEMODE ) ),
|
|
|
|
aGrpViewSubstitute ( this, SdResId( GRP_VIEW_SUBSTITUTE ) ),
|
2001-03-22 07:15:58 -06:00
|
|
|
aCbxRuler ( this, SdResId( CBX_RULER ) ),
|
|
|
|
aCbxMoveOutline ( this, SdResId( CBX_MOVE_OUTLINE ) ),
|
|
|
|
aCbxDragStripes ( this, SdResId( CBX_HELPLINES ) ),
|
|
|
|
aCbxHandlesBezier ( this, SdResId( CBX_HANDLES_BEZIER ) ),
|
|
|
|
aGrpDisplay ( this, SdResId( GRP_DISPLAY ) )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
|
|
|
FreeResource();
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
SdTpOptionsContents::~SdTpOptionsContents()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
BOOL SdTpOptionsContents::FillItemSet( SfxItemSet& rAttrs )
|
|
|
|
{
|
|
|
|
BOOL bModified = FALSE;
|
|
|
|
|
|
|
|
if( aCbxExternGraphic.GetSavedValue() != aCbxExternGraphic.IsChecked() ||
|
|
|
|
aCbxOutlineMode.GetSavedValue() != aCbxOutlineMode.IsChecked() ||
|
|
|
|
aCbxNoText.GetSavedValue() != aCbxNoText.IsChecked() ||
|
|
|
|
aCbxHairlineMode.GetSavedValue() != aCbxHairlineMode.IsChecked() )
|
|
|
|
{
|
|
|
|
SdOptionsContentsItem aOptsItem( ATTR_OPTIONS_CONTENTS );
|
|
|
|
|
|
|
|
aOptsItem.SetExternGraphic( aCbxExternGraphic.IsChecked() );
|
|
|
|
aOptsItem.SetOutlineMode( aCbxOutlineMode.IsChecked() );
|
|
|
|
aOptsItem.SetNoText( aCbxNoText.IsChecked() );
|
|
|
|
aOptsItem.SetHairlineMode( aCbxHairlineMode.IsChecked() );
|
|
|
|
|
|
|
|
rAttrs.Put( aOptsItem );
|
|
|
|
|
|
|
|
bModified = TRUE;
|
|
|
|
}
|
2001-03-22 07:15:58 -06:00
|
|
|
|
|
|
|
if( aCbxRuler.GetSavedValue() != aCbxRuler.IsChecked() ||
|
|
|
|
aCbxMoveOutline.GetSavedValue() != aCbxMoveOutline.IsChecked() ||
|
|
|
|
aCbxDragStripes.GetSavedValue() != aCbxDragStripes.IsChecked() ||
|
|
|
|
//aCbxHelplines.GetSavedValue() != aCbxHelplines.IsChecked() ||
|
|
|
|
aCbxHandlesBezier.GetSavedValue() != aCbxHandlesBezier.IsChecked() )
|
|
|
|
{
|
|
|
|
SdOptionsLayoutItem aOptsItem( ATTR_OPTIONS_LAYOUT );
|
|
|
|
|
|
|
|
aOptsItem.SetRulerVisible( aCbxRuler.IsChecked() );
|
|
|
|
aOptsItem.SetMoveOutline( aCbxMoveOutline.IsChecked() );
|
|
|
|
aOptsItem.SetDragStripes( aCbxDragStripes.IsChecked() );
|
|
|
|
aOptsItem.SetHandlesBezier( aCbxHandlesBezier.IsChecked() );
|
|
|
|
//aOptsItem.SetHelplines( aCbxHelplines.IsChecked() );
|
|
|
|
|
|
|
|
rAttrs.Put( aOptsItem );
|
|
|
|
bModified = TRUE;
|
|
|
|
}
|
2000-09-18 11:07:07 -05:00
|
|
|
return( bModified );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
void SdTpOptionsContents::Reset( const SfxItemSet& rAttrs )
|
|
|
|
{
|
|
|
|
SdOptionsContentsItem aOptsItem( (const SdOptionsContentsItem&) rAttrs.
|
|
|
|
Get( ATTR_OPTIONS_CONTENTS ) );
|
|
|
|
|
|
|
|
aCbxExternGraphic.Check( aOptsItem.IsExternGraphic() );
|
|
|
|
aCbxOutlineMode.Check(aOptsItem.IsOutlineMode() );
|
|
|
|
aCbxNoText.Check( aOptsItem.IsNoText() );
|
|
|
|
aCbxHairlineMode.Check( aOptsItem.IsHairlineMode() );
|
|
|
|
|
|
|
|
aCbxExternGraphic.SaveValue();
|
|
|
|
aCbxOutlineMode.SaveValue();
|
|
|
|
aCbxNoText.SaveValue();
|
|
|
|
aCbxHairlineMode.SaveValue();
|
2001-03-22 07:15:58 -06:00
|
|
|
|
|
|
|
SdOptionsLayoutItem aLayoutItem( (const SdOptionsLayoutItem&) rAttrs.
|
|
|
|
Get( ATTR_OPTIONS_LAYOUT ) );
|
|
|
|
|
|
|
|
aCbxRuler.Check( aLayoutItem.IsRulerVisible() );
|
|
|
|
aCbxMoveOutline.Check( aLayoutItem.IsMoveOutline() );
|
|
|
|
aCbxDragStripes.Check( aLayoutItem.IsDragStripes() );
|
|
|
|
aCbxHandlesBezier.Check( aLayoutItem.IsHandlesBezier() );
|
|
|
|
//aCbxHelplines.Check( aLayoutItem.IsHelplines() );
|
|
|
|
|
|
|
|
aCbxRuler.SaveValue();
|
|
|
|
aCbxMoveOutline.SaveValue();
|
|
|
|
aCbxDragStripes.SaveValue();
|
|
|
|
aCbxHandlesBezier.SaveValue();
|
|
|
|
//aCbxHelplines.SaveValue();
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2001-10-22 07:36:57 -05:00
|
|
|
SfxTabPage* SdTpOptionsContents::Create( Window* pWindow,
|
2000-09-18 11:07:07 -05:00
|
|
|
const SfxItemSet& rAttrs )
|
|
|
|
{
|
|
|
|
return( new SdTpOptionsContents( pWindow, rAttrs ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
/*************************************************************************
|
|
|
|
|*
|
|
|
|
|* TabPage zum Einstellen der Sonstige-Optionen
|
|
|
|
|*
|
|
|
|
\************************************************************************/
|
2001-04-04 01:00:36 -05:00
|
|
|
#define TABLE_COUNT 12
|
|
|
|
#define TOKEN (sal_Unicode(':'))
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
SdTpOptionsMisc::SdTpOptionsMisc( Window* pParent, const SfxItemSet& rInAttrs ) :
|
|
|
|
SfxTabPage ( pParent, SdResId( TP_OPTIONS_MISC ), rInAttrs ),
|
|
|
|
aCbxQuickEdit ( this, SdResId( CBX_QUICKEDIT ) ),
|
|
|
|
aCbxPickThrough ( this, SdResId( CBX_PICKTHROUGH ) ),
|
|
|
|
aGrpText ( this, SdResId( GRP_TEXT ) ),
|
|
|
|
|
|
|
|
// Template & Layout laufen z.Z. synchron!
|
|
|
|
aCbxStartWithTemplate ( this, SdResId( CBX_START_WITH_TEMPLATE ) ),
|
|
|
|
aGrpProgramStart ( this, SdResId( GRP_PROGRAMSTART ) ),
|
|
|
|
|
|
|
|
aCbxMasterPageCache ( this, SdResId( CBX_MASTERPAGE_CACHE ) ),
|
|
|
|
|
|
|
|
aCbxCopy ( this, SdResId( CBX_COPY ) ),
|
|
|
|
aCbxMarkedHitMovesAlways ( this, SdResId( CBX_MARKED_HIT_MOVES_ALWAYS ) ),
|
|
|
|
aCbxCrookNoContortion ( this, SdResId( CBX_CROOK_NO_CONTORTION ) ),
|
2001-03-22 07:15:58 -06:00
|
|
|
aGrpSettings ( this, SdResId( GRP_SETTINGS ) ),
|
2001-04-02 05:14:24 -05:00
|
|
|
|
2001-03-22 07:15:58 -06:00
|
|
|
aTxtMetric ( this, SdResId( FT_METRIC ) ),
|
|
|
|
aLbMetric ( this, SdResId( LB_METRIC ) ),
|
|
|
|
aTxtTabstop ( this, SdResId( FT_TABSTOP ) ),
|
2001-04-02 05:14:24 -05:00
|
|
|
aMtrFldTabstop ( this, SdResId( MTR_FLD_TABSTOP ) ),
|
|
|
|
|
|
|
|
aCbxStartWithActualPage ( this, SdResId( CBX_START_WITH_ACTUAL_PAGE ) ),
|
|
|
|
aGrpStartWithActualPage ( this, SdResId( GRP_START_WITH_ACTUAL_PAGE ) ),
|
|
|
|
aTxtCompatibility ( this, SdResId( FT_COMPATIBILITY ) ),
|
2003-04-24 08:37:44 -05:00
|
|
|
aCbxUsePrinterMetrics ( this, SdResId( CB_USE_PRINTER_METRICS ) ),
|
2001-04-04 01:00:36 -05:00
|
|
|
aCbxCompatibility ( this, SdResId( CB_MERGE_PARA_DIST ) ),
|
|
|
|
aGrpScale ( this, SdResId( GRP_SCALE ) ),
|
|
|
|
aFtScale ( this, SdResId( FT_SCALE ) ),
|
|
|
|
aCbScale ( this, SdResId( CB_SCALE ) ),
|
|
|
|
aFtOriginal ( this, SdResId( FT_ORIGINAL ) ),
|
|
|
|
aFtEquivalent ( this, SdResId( FT_EQUIVALENT ) ),
|
|
|
|
aFtPageWidth ( this, SdResId( FT_PAGEWIDTH ) ),
|
|
|
|
aFiInfo1 ( this, SdResId( FI_INFO_1 ) ),
|
|
|
|
aMtrFldOriginalWidth ( this, SdResId( MTR_FLD_ORIGINAL_WIDTH ) ),
|
|
|
|
aFtPageHeight ( this, SdResId( FT_PAGEHEIGHT ) ),
|
|
|
|
aFiInfo2 ( this, SdResId( FI_INFO_2 ) ),
|
|
|
|
aMtrFldOriginalHeight ( this, SdResId( MTR_FLD_ORIGINAL_HEIGHT ) ),
|
|
|
|
aMtrFldInfo1 ( this, WinBits( WB_HIDE ) ),
|
|
|
|
aMtrFldInfo2 ( this, WinBits( WB_HIDE ) )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
|
|
|
FreeResource();
|
2001-03-22 07:15:58 -06:00
|
|
|
SetExchangeSupport();
|
|
|
|
|
|
|
|
// Metrik einstellen
|
|
|
|
FieldUnit eFUnit;
|
|
|
|
|
|
|
|
USHORT nWhich = GetWhich( SID_ATTR_METRIC );
|
|
|
|
if ( rInAttrs.GetItemState( nWhich ) >= SFX_ITEM_AVAILABLE )
|
|
|
|
{
|
|
|
|
const SfxUInt16Item& rItem = (SfxUInt16Item&)rInAttrs.Get( nWhich );
|
|
|
|
eFUnit = (FieldUnit)rItem.GetValue();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
eFUnit = GetModuleFieldUnit();
|
|
|
|
|
|
|
|
SetFieldUnit( aMtrFldTabstop, eFUnit );
|
|
|
|
|
|
|
|
// ListBox mit Metriken f"ullen
|
|
|
|
SvxStringArray aMetricArr( RID_SVXSTR_FIELDUNIT_TABLE );
|
2003-12-01 10:45:24 -06:00
|
|
|
USHORT i;
|
2001-03-22 07:15:58 -06:00
|
|
|
|
2003-12-01 10:45:24 -06:00
|
|
|
for ( i = 0; i < aMetricArr.Count(); ++i )
|
2001-03-22 07:15:58 -06:00
|
|
|
{
|
|
|
|
String sMetric = aMetricArr.GetStringByPos( i );
|
|
|
|
long nFieldUnit = aMetricArr.GetValue( i );
|
|
|
|
USHORT nPos = aLbMetric.InsertEntry( sMetric );
|
|
|
|
aLbMetric.SetEntryData( nPos, (void*)nFieldUnit );
|
|
|
|
}
|
|
|
|
aLbMetric.SetSelectHdl( LINK( this, SdTpOptionsMisc, SelectMetricHdl_Impl ) );
|
2001-04-04 01:00:36 -05:00
|
|
|
|
|
|
|
SetFieldUnit( aMtrFldOriginalWidth, eFUnit );
|
|
|
|
SetFieldUnit( aMtrFldOriginalHeight, eFUnit );
|
|
|
|
aMtrFldOriginalWidth.SetLast( 999999999 );
|
|
|
|
aMtrFldOriginalWidth.SetMax( 999999999 );
|
|
|
|
aMtrFldOriginalHeight.SetLast( 999999999 );
|
|
|
|
aMtrFldOriginalHeight.SetMax( 999999999 );
|
|
|
|
|
|
|
|
// Temporaere Fields fuer Info-Texte (fuer Formatierung/Berechnung)
|
|
|
|
aMtrFldInfo1.SetUnit( eFUnit );
|
|
|
|
aMtrFldInfo1.SetMax( 999999999 );
|
|
|
|
aMtrFldInfo1.SetDecimalDigits( 2 );
|
|
|
|
aMtrFldInfo2.SetUnit( eFUnit );
|
|
|
|
aMtrFldInfo2.SetMax( 999999999 );
|
|
|
|
aMtrFldInfo2.SetDecimalDigits( 2 );
|
|
|
|
|
|
|
|
// PoolUnit ermitteln
|
|
|
|
SfxItemPool* pPool = rInAttrs.GetPool();
|
|
|
|
DBG_ASSERT( pPool, "Wo ist der Pool?" );
|
|
|
|
ePoolUnit = pPool->GetMetric( SID_ATTR_FILL_HATCH );
|
|
|
|
|
|
|
|
// Fuellen der CB
|
|
|
|
USHORT aTable[ TABLE_COUNT ] =
|
|
|
|
{ 1, 2, 4, 5, 8, 10, 16, 20, 30, 40, 50, 100 };
|
|
|
|
|
|
|
|
for( i = 0; i < TABLE_COUNT; i++ )
|
|
|
|
aCbScale.InsertEntry( GetScale( 1, aTable[i] ) );
|
|
|
|
for( i = 1; i < TABLE_COUNT; i++ )
|
|
|
|
aCbScale.InsertEntry( GetScale( aTable[i], 1 ) );
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
SdTpOptionsMisc::~SdTpOptionsMisc()
|
|
|
|
{
|
|
|
|
}
|
2001-03-22 07:15:58 -06:00
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
void SdTpOptionsMisc::ActivatePage( const SfxItemSet& rSet )
|
|
|
|
{
|
|
|
|
// Hier muss noch einmal SaveValue gerufen werden, da sonst u.U.
|
|
|
|
// der Wert in anderen TabPages keine Wirkung hat
|
|
|
|
aLbMetric.SaveValue();
|
2001-04-04 01:00:36 -05:00
|
|
|
// Metrik ggfs. aendern (da TabPage im Dialog liegt,
|
|
|
|
// wo die Metrik eingestellt werden kann
|
|
|
|
const SfxPoolItem* pAttr = NULL;
|
|
|
|
if( SFX_ITEM_SET == rSet.GetItemState( SID_ATTR_METRIC , FALSE,
|
|
|
|
(const SfxPoolItem**)&pAttr ))
|
|
|
|
{
|
|
|
|
const SfxUInt16Item* pItem = (SfxUInt16Item*) pAttr;
|
|
|
|
|
|
|
|
FieldUnit eFUnit = (FieldUnit)(long)pItem->GetValue();
|
|
|
|
|
|
|
|
if( eFUnit != aMtrFldOriginalWidth.GetUnit() )
|
|
|
|
{
|
|
|
|
// Metriken einstellen
|
|
|
|
long nVal = aMtrFldOriginalWidth.Denormalize( aMtrFldOriginalWidth.GetValue( FUNIT_TWIP ) );
|
|
|
|
SetFieldUnit( aMtrFldOriginalWidth, eFUnit, TRUE );
|
|
|
|
aMtrFldOriginalWidth.SetValue( aMtrFldOriginalWidth.Normalize( nVal ), FUNIT_TWIP );
|
|
|
|
|
|
|
|
nVal = aMtrFldOriginalHeight.Denormalize( aMtrFldOriginalHeight.GetValue( FUNIT_TWIP ) );
|
|
|
|
SetFieldUnit( aMtrFldOriginalHeight, eFUnit, TRUE );
|
|
|
|
aMtrFldOriginalHeight.SetValue( aMtrFldOriginalHeight.Normalize( nVal ), FUNIT_TWIP );
|
|
|
|
|
|
|
|
|
|
|
|
if( nWidth != 0 && nHeight != 0 )
|
|
|
|
{
|
|
|
|
aMtrFldInfo1.SetUnit( eFUnit );
|
|
|
|
aMtrFldInfo2.SetUnit( eFUnit );
|
|
|
|
|
|
|
|
SetMetricValue( aMtrFldInfo1, nWidth, ePoolUnit );
|
|
|
|
aInfo1 = aMtrFldInfo1.GetText();
|
|
|
|
aFiInfo1.SetText( aInfo1 );
|
|
|
|
|
|
|
|
SetMetricValue( aMtrFldInfo2, nHeight, ePoolUnit );
|
|
|
|
aInfo2 = aMtrFldInfo2.GetText();
|
|
|
|
aFiInfo2.SetText( aInfo2 );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2001-03-22 07:15:58 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
int SdTpOptionsMisc::DeactivatePage( SfxItemSet* pSet )
|
|
|
|
{
|
2001-04-04 01:00:36 -05:00
|
|
|
// Parsercheck
|
|
|
|
INT32 nX, nY;
|
|
|
|
if( SetScale( aCbScale.GetText(), nX, nY ) )
|
|
|
|
{
|
2002-07-23 02:34:47 -05:00
|
|
|
if( pSet )
|
|
|
|
FillItemSet( *pSet );
|
2001-04-04 01:00:36 -05:00
|
|
|
return( LEAVE_PAGE );
|
|
|
|
}
|
|
|
|
WarningBox aWarnBox( GetParent(), WB_YES_NO, String( SdResId( STR_WARN_SCALE_FAIL ) ) );
|
|
|
|
short nReturn = aWarnBox.Execute();
|
|
|
|
|
|
|
|
if( nReturn == RET_YES )
|
|
|
|
return( KEEP_PAGE );
|
|
|
|
|
2002-07-23 02:34:47 -05:00
|
|
|
if( pSet )
|
|
|
|
FillItemSet( *pSet );
|
2001-03-22 07:15:58 -06:00
|
|
|
|
2001-04-04 01:00:36 -05:00
|
|
|
return( LEAVE_PAGE );
|
2001-03-22 07:15:58 -06:00
|
|
|
}
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
BOOL SdTpOptionsMisc::FillItemSet( SfxItemSet& rAttrs )
|
|
|
|
{
|
|
|
|
BOOL bModified = FALSE;
|
|
|
|
|
|
|
|
if( aCbxStartWithTemplate.GetSavedValue() != aCbxStartWithTemplate.IsChecked() ||
|
|
|
|
aCbxMarkedHitMovesAlways.GetSavedValue()!= aCbxMarkedHitMovesAlways.IsChecked() ||
|
|
|
|
aCbxCrookNoContortion.GetSavedValue() != aCbxCrookNoContortion.IsChecked() ||
|
|
|
|
aCbxQuickEdit.GetSavedValue() != aCbxQuickEdit.IsChecked() ||
|
|
|
|
aCbxPickThrough.GetSavedValue() != aCbxPickThrough.IsChecked() ||
|
|
|
|
aCbxMasterPageCache.GetSavedValue() != aCbxMasterPageCache.IsChecked() ||
|
|
|
|
aCbxCopy.GetSavedValue() != aCbxCopy.IsChecked() ||
|
2001-04-02 05:14:24 -05:00
|
|
|
aCbxStartWithActualPage.GetSavedValue() != aCbxStartWithActualPage.IsChecked() ||
|
2003-04-24 08:37:44 -05:00
|
|
|
aCbxCompatibility.GetSavedValue() != aCbxCompatibility.IsChecked() ||
|
|
|
|
aCbxUsePrinterMetrics.GetSavedValue() != aCbxUsePrinterMetrics.IsChecked() )
|
2000-09-18 11:07:07 -05:00
|
|
|
{
|
|
|
|
SdOptionsMiscItem aOptsItem( ATTR_OPTIONS_MISC );
|
|
|
|
|
|
|
|
aOptsItem.SetStartWithTemplate( aCbxStartWithTemplate.IsChecked() );
|
|
|
|
aOptsItem.SetMarkedHitMovesAlways( aCbxMarkedHitMovesAlways.IsChecked() );
|
|
|
|
aOptsItem.SetCrookNoContortion( aCbxCrookNoContortion.IsChecked() );
|
|
|
|
aOptsItem.SetQuickEdit( aCbxQuickEdit.IsChecked() );
|
|
|
|
aOptsItem.SetPickThrough( aCbxPickThrough.IsChecked() );
|
|
|
|
aOptsItem.SetMasterPagePaintCaching( aCbxMasterPageCache.IsChecked() );
|
|
|
|
aOptsItem.SetDragWithCopy( aCbxCopy.IsChecked() );
|
|
|
|
aOptsItem.SetStartWithActualPage( aCbxStartWithActualPage.IsChecked() );
|
2001-04-02 05:14:24 -05:00
|
|
|
aOptsItem.SetSummationOfParagraphs( aCbxCompatibility.IsChecked() );
|
2003-04-24 08:37:44 -05:00
|
|
|
aOptsItem.SetPrinterIndependentLayout (
|
|
|
|
aCbxUsePrinterMetrics.IsChecked()
|
|
|
|
? ::com::sun::star::document::PrinterIndependentLayout::DISABLED
|
|
|
|
: ::com::sun::star::document::PrinterIndependentLayout::ENABLED);
|
2000-09-18 11:07:07 -05:00
|
|
|
rAttrs.Put( aOptsItem );
|
|
|
|
|
|
|
|
bModified = TRUE;
|
|
|
|
}
|
2001-03-22 07:15:58 -06:00
|
|
|
|
|
|
|
// Metrik
|
|
|
|
const USHORT nMPos = aLbMetric.GetSelectEntryPos();
|
|
|
|
if ( nMPos != aLbMetric.GetSavedValue() )
|
|
|
|
{
|
|
|
|
USHORT nFieldUnit = (USHORT)(long)aLbMetric.GetEntryData( nMPos );
|
|
|
|
rAttrs.Put( SfxUInt16Item( GetWhich( SID_ATTR_METRIC ),
|
|
|
|
(UINT16)nFieldUnit ) );
|
|
|
|
bModified |= TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Tabulatorabstand
|
|
|
|
if( aMtrFldTabstop.GetText() != aMtrFldTabstop.GetSavedValue() )
|
|
|
|
{
|
|
|
|
USHORT nWh = GetWhich( SID_ATTR_DEFTABSTOP );
|
|
|
|
SfxMapUnit eUnit = rAttrs.GetPool()->GetMetric( nWh );
|
|
|
|
SfxUInt16Item aDef( nWh,(USHORT)GetCoreValue( aMtrFldTabstop, eUnit ) );
|
|
|
|
rAttrs.Put( aDef );
|
|
|
|
bModified |= TRUE;
|
|
|
|
}
|
|
|
|
|
2001-04-04 01:00:36 -05:00
|
|
|
INT32 nX, nY;
|
|
|
|
if( SetScale( aCbScale.GetText(), nX, nY ) )
|
|
|
|
{
|
|
|
|
rAttrs.Put( SfxInt32Item( ATTR_OPTIONS_SCALE_X, nX ) );
|
|
|
|
rAttrs.Put( SfxInt32Item( ATTR_OPTIONS_SCALE_Y, nY ) );
|
|
|
|
|
|
|
|
bModified = TRUE;
|
|
|
|
}
|
|
|
|
|
2000-09-18 11:07:07 -05:00
|
|
|
return( bModified );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
void SdTpOptionsMisc::Reset( const SfxItemSet& rAttrs )
|
|
|
|
{
|
|
|
|
SdOptionsMiscItem aOptsItem( (const SdOptionsMiscItem&) rAttrs.
|
|
|
|
Get( ATTR_OPTIONS_MISC ) );
|
|
|
|
|
|
|
|
aCbxStartWithTemplate.Check( aOptsItem.IsStartWithTemplate() );
|
|
|
|
aCbxMarkedHitMovesAlways.Check( aOptsItem.IsMarkedHitMovesAlways() );
|
|
|
|
aCbxCrookNoContortion.Check( aOptsItem.IsCrookNoContortion() );
|
|
|
|
aCbxQuickEdit.Check( aOptsItem.IsQuickEdit() );
|
|
|
|
aCbxPickThrough.Check( aOptsItem.IsPickThrough() );
|
|
|
|
aCbxMasterPageCache.Check( aOptsItem.IsMasterPagePaintCaching() );
|
|
|
|
aCbxCopy.Check( aOptsItem.IsDragWithCopy() );
|
|
|
|
aCbxStartWithActualPage.Check( aOptsItem.IsStartWithActualPage() );
|
2001-04-04 05:09:50 -05:00
|
|
|
#if SUPD>627
|
2001-04-02 05:14:24 -05:00
|
|
|
aCbxCompatibility.Check( aOptsItem.IsSummationOfParagraphs() );
|
2003-04-24 08:37:44 -05:00
|
|
|
aCbxUsePrinterMetrics.Check( aOptsItem.GetPrinterIndependentLayout()==1 );
|
2001-04-04 05:09:50 -05:00
|
|
|
#endif
|
2000-09-18 11:07:07 -05:00
|
|
|
aCbxStartWithTemplate.SaveValue();
|
|
|
|
aCbxMarkedHitMovesAlways.SaveValue();
|
|
|
|
aCbxCrookNoContortion.SaveValue();
|
|
|
|
aCbxQuickEdit.SaveValue();
|
|
|
|
aCbxPickThrough.SaveValue();
|
2003-05-13 06:20:01 -05:00
|
|
|
|
2000-09-18 11:07:07 -05:00
|
|
|
aCbxMasterPageCache.SaveValue();
|
|
|
|
aCbxCopy.SaveValue();
|
|
|
|
aCbxStartWithActualPage.SaveValue();
|
2001-04-02 05:14:24 -05:00
|
|
|
aCbxCompatibility.SaveValue();
|
2003-04-24 08:37:44 -05:00
|
|
|
aCbxUsePrinterMetrics.SaveValue();
|
2001-03-22 07:15:58 -06:00
|
|
|
|
|
|
|
// Metrik
|
|
|
|
USHORT nWhich = GetWhich( SID_ATTR_METRIC );
|
|
|
|
aLbMetric.SetNoSelection();
|
|
|
|
|
|
|
|
if ( rAttrs.GetItemState( nWhich ) >= SFX_ITEM_AVAILABLE )
|
|
|
|
{
|
|
|
|
const SfxUInt16Item& rItem = (SfxUInt16Item&)rAttrs.Get( nWhich );
|
|
|
|
long nFieldUnit = (long)rItem.GetValue();
|
|
|
|
|
|
|
|
for ( USHORT i = 0; i < aLbMetric.GetEntryCount(); ++i )
|
|
|
|
{
|
|
|
|
if ( (long)aLbMetric.GetEntryData( i ) == nFieldUnit )
|
|
|
|
{
|
|
|
|
aLbMetric.SelectEntryPos( i );
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Tabulatorabstand
|
|
|
|
nWhich = GetWhich( SID_ATTR_DEFTABSTOP );
|
|
|
|
if( rAttrs.GetItemState( nWhich ) >= SFX_ITEM_AVAILABLE )
|
|
|
|
{
|
|
|
|
SfxMapUnit eUnit = rAttrs.GetPool()->GetMetric( nWhich );
|
|
|
|
const SfxUInt16Item& rItem = (SfxUInt16Item&)rAttrs.Get( nWhich );
|
|
|
|
SetMetricValue( aMtrFldTabstop, rItem.GetValue(), eUnit );
|
|
|
|
}
|
|
|
|
aLbMetric.SaveValue();
|
|
|
|
aMtrFldTabstop.SaveValue();
|
2001-04-04 01:00:36 -05:00
|
|
|
//Scale
|
|
|
|
INT32 nX = ( (const SfxInt32Item&) rAttrs.
|
|
|
|
Get( ATTR_OPTIONS_SCALE_X ) ).GetValue();
|
|
|
|
INT32 nY = ( (const SfxInt32Item&) rAttrs.
|
|
|
|
Get( ATTR_OPTIONS_SCALE_Y ) ).GetValue();
|
|
|
|
nWidth = ( (const SfxUInt32Item&) rAttrs.
|
|
|
|
Get( ATTR_OPTIONS_SCALE_WIDTH ) ).GetValue();
|
|
|
|
nHeight = ( (const SfxUInt32Item&) rAttrs.
|
|
|
|
Get( ATTR_OPTIONS_SCALE_HEIGHT ) ).GetValue();
|
|
|
|
|
|
|
|
aCbScale.SetText( GetScale( nX, nY ) );
|
|
|
|
|
2001-09-25 06:06:30 -05:00
|
|
|
// #92067# broken feature disabled for 6.0
|
|
|
|
aFtOriginal.Hide();
|
|
|
|
aFtEquivalent.Hide();
|
|
|
|
aMtrFldOriginalWidth.Hide();
|
|
|
|
aMtrFldOriginalWidth.SetText( aInfo1 ); // leer
|
|
|
|
aMtrFldOriginalHeight.Hide();
|
|
|
|
aMtrFldOriginalHeight.SetText( aInfo2 ); //leer
|
|
|
|
aFtPageWidth.Hide();
|
|
|
|
aFtPageHeight.Hide();
|
|
|
|
aFiInfo1.Hide();
|
|
|
|
aFiInfo2.Hide();
|
2003-05-13 06:20:01 -05:00
|
|
|
|
|
|
|
UpdateCompatibilityControls ();
|
2000-09-18 11:07:07 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
2001-10-22 07:36:57 -05:00
|
|
|
SfxTabPage* SdTpOptionsMisc::Create( Window* pWindow,
|
2000-09-18 11:07:07 -05:00
|
|
|
const SfxItemSet& rAttrs )
|
|
|
|
{
|
|
|
|
return( new SdTpOptionsMisc( pWindow, rAttrs ) );
|
|
|
|
}
|
2001-03-22 07:15:58 -06:00
|
|
|
//------------------------------------------------------------------------
|
|
|
|
|
|
|
|
IMPL_LINK( SdTpOptionsMisc, SelectMetricHdl_Impl, ListBox *, EMPTYARG )
|
|
|
|
{
|
|
|
|
USHORT nPos = aLbMetric.GetSelectEntryPos();
|
2000-09-18 11:07:07 -05:00
|
|
|
|
2001-03-22 07:15:58 -06:00
|
|
|
if( nPos != LISTBOX_ENTRY_NOTFOUND )
|
|
|
|
{
|
|
|
|
FieldUnit eUnit = (FieldUnit)(long)aLbMetric.GetEntryData( nPos );
|
|
|
|
long nVal =
|
|
|
|
aMtrFldTabstop.Denormalize( aMtrFldTabstop.GetValue( FUNIT_TWIP ) );
|
|
|
|
SetFieldUnit( aMtrFldTabstop, eUnit );
|
|
|
|
aMtrFldTabstop.SetValue( aMtrFldTabstop.Normalize( nVal ), FUNIT_TWIP );
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2003-04-24 08:37:44 -05:00
|
|
|
|
|
|
|
namespace {
|
|
|
|
void lcl_MoveWin( Window& rWin, long nYDiff)
|
|
|
|
{
|
|
|
|
Point aPos(rWin.GetPosPixel());
|
|
|
|
aPos.Y() += nYDiff;
|
|
|
|
rWin.SetPosPixel (aPos);
|
|
|
|
}
|
|
|
|
|
|
|
|
void lcl_MoveWin( Window& rWin, long nXdiff, long nYdiff)
|
2001-03-22 07:15:58 -06:00
|
|
|
{
|
|
|
|
Point aPos(rWin.GetPosPixel());
|
2003-04-24 08:37:44 -05:00
|
|
|
aPos.X() += nXdiff;
|
|
|
|
aPos.Y() += nYdiff;
|
2001-03-22 07:15:58 -06:00
|
|
|
rWin.SetPosPixel(aPos);
|
|
|
|
}
|
2003-04-24 08:37:44 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void SdTpOptionsMisc::SetImpressMode (void)
|
|
|
|
{
|
|
|
|
long nDialogWidth = GetSizePixel().Width();
|
|
|
|
long nLineHeight = aCbxPickThrough.GetPosPixel().Y()
|
|
|
|
- aCbxQuickEdit.GetPosPixel().Y();
|
|
|
|
|
|
|
|
// Put both "Text objects" check boxes side by side.
|
|
|
|
lcl_MoveWin (aCbxPickThrough,
|
|
|
|
nDialogWidth/2 - aCbxPickThrough.GetPosPixel().X(),
|
|
|
|
-nLineHeight);
|
|
|
|
|
|
|
|
// Move the other controls up one line.
|
|
|
|
lcl_MoveWin (aGrpProgramStart, -nLineHeight);
|
|
|
|
lcl_MoveWin (aCbxStartWithTemplate, -nLineHeight);
|
|
|
|
lcl_MoveWin (aGrpSettings, -nLineHeight);
|
|
|
|
lcl_MoveWin (aCbxMasterPageCache, -nLineHeight);
|
|
|
|
lcl_MoveWin (aCbxCopy, -nLineHeight);
|
|
|
|
lcl_MoveWin (aCbxMarkedHitMovesAlways, -nLineHeight);
|
|
|
|
lcl_MoveWin (aCbxCrookNoContortion, -nLineHeight);
|
|
|
|
lcl_MoveWin (aTxtMetric, -nLineHeight);
|
|
|
|
lcl_MoveWin (aLbMetric, -nLineHeight);
|
|
|
|
lcl_MoveWin (aTxtTabstop, -nLineHeight);
|
|
|
|
lcl_MoveWin (aMtrFldTabstop, -nLineHeight);
|
|
|
|
lcl_MoveWin (aGrpStartWithActualPage, -nLineHeight);
|
|
|
|
lcl_MoveWin (aCbxStartWithActualPage, -nLineHeight);
|
|
|
|
lcl_MoveWin (aTxtCompatibility, -nLineHeight);
|
|
|
|
|
|
|
|
// Move the printer-independent-metrics check box up two lines to change
|
|
|
|
// places with spacing-between-paragraphs check box.
|
|
|
|
lcl_MoveWin (aCbxUsePrinterMetrics, -2*nLineHeight);
|
|
|
|
}
|
2001-03-22 07:15:58 -06:00
|
|
|
|
|
|
|
void SdTpOptionsMisc::SetDrawMode()
|
|
|
|
{
|
|
|
|
aCbxStartWithTemplate.Hide();
|
|
|
|
aGrpProgramStart.Hide();
|
|
|
|
aCbxStartWithActualPage.Hide();
|
2001-04-02 05:14:24 -05:00
|
|
|
aCbxCompatibility.Hide();
|
2001-03-22 07:15:58 -06:00
|
|
|
aGrpStartWithActualPage.Hide();
|
|
|
|
aCbxCrookNoContortion.Show();
|
|
|
|
|
2001-04-04 01:00:36 -05:00
|
|
|
aGrpScale.Show();
|
|
|
|
aFtScale.Show();
|
|
|
|
aCbScale.Show();
|
|
|
|
|
|
|
|
aFtOriginal.Show();
|
|
|
|
aFtEquivalent.Show();
|
|
|
|
|
|
|
|
aFtPageWidth.Show();
|
|
|
|
aFiInfo1.Show();
|
|
|
|
aMtrFldOriginalWidth.Show();
|
|
|
|
|
|
|
|
aFtPageHeight.Show();
|
|
|
|
aFiInfo2.Show();
|
|
|
|
aMtrFldOriginalHeight.Show();
|
|
|
|
|
2001-04-02 05:14:24 -05:00
|
|
|
long nDiff = aGrpSettings.GetPosPixel().Y() - aGrpProgramStart.GetPosPixel().Y();
|
2003-04-24 08:37:44 -05:00
|
|
|
lcl_MoveWin( aGrpSettings, -nDiff );
|
|
|
|
lcl_MoveWin( aCbxMasterPageCache, -nDiff );
|
|
|
|
lcl_MoveWin( aCbxCopy, -nDiff );
|
|
|
|
lcl_MoveWin( aCbxMarkedHitMovesAlways, -nDiff );
|
|
|
|
lcl_MoveWin( aCbxCrookNoContortion, -nDiff );
|
2001-04-27 00:55:41 -05:00
|
|
|
nDiff -= aCbxCrookNoContortion.GetPosPixel().Y() - aCbxMarkedHitMovesAlways.GetPosPixel().Y();
|
2003-04-24 08:37:44 -05:00
|
|
|
lcl_MoveWin( aTxtMetric, -nDiff );
|
|
|
|
lcl_MoveWin( aLbMetric, -nDiff );
|
|
|
|
lcl_MoveWin( aTxtTabstop, -nDiff );
|
|
|
|
lcl_MoveWin( aMtrFldTabstop, -nDiff );
|
|
|
|
|
|
|
|
// Move the scale controls so that they are visually centered betwen the
|
|
|
|
// group controls above and below.
|
|
|
|
lcl_MoveWin (aFtScale, -17);
|
|
|
|
lcl_MoveWin (aCbScale, -17);
|
|
|
|
|
|
|
|
// Move the printer-independent-metrics check box in the place that the
|
|
|
|
// spacing-between-paragraphs check box normally is in.
|
|
|
|
aCbxUsePrinterMetrics.SetPosPixel (aCbxCompatibility.GetPosPixel());
|
2001-03-22 07:15:58 -06:00
|
|
|
}
|
2001-04-04 01:00:36 -05:00
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
IMPL_LINK( SdTpOptionsMisc, ModifyScaleHdl, void *, p )
|
|
|
|
{
|
|
|
|
// Originalgroesse berechnen
|
|
|
|
INT32 nX, nY;
|
|
|
|
if( SetScale( aCbScale.GetText(), nX, nY ) )
|
|
|
|
{
|
|
|
|
INT32 nW = nWidth * nY / nX;
|
|
|
|
INT32 nH = nHeight * nY / nX;
|
|
|
|
|
|
|
|
SetMetricValue( aMtrFldOriginalWidth, nW, ePoolUnit );
|
|
|
|
SetMetricValue( aMtrFldOriginalHeight, nH, ePoolUnit );
|
|
|
|
}
|
|
|
|
|
|
|
|
return( 0L );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
IMPL_LINK( SdTpOptionsMisc, ModifyOriginalScaleHdl, void *, p )
|
|
|
|
{
|
|
|
|
// Berechnen des Massstabs
|
|
|
|
long nOrgW = aMtrFldOriginalWidth.GetValue();
|
|
|
|
long nOrgH = aMtrFldOriginalHeight.GetValue();
|
|
|
|
|
|
|
|
if( nOrgW == 0 || nOrgH == 0 )
|
|
|
|
return( 0L );
|
|
|
|
|
|
|
|
Fraction aFract1( nOrgW, aMtrFldInfo1.GetValue() );
|
|
|
|
Fraction aFract2( nOrgH, aMtrFldInfo2.GetValue() );
|
|
|
|
Fraction aFract( aFract1 > aFract2 ? aFract1 : aFract2 );
|
|
|
|
|
|
|
|
long nValue;
|
|
|
|
if( aFract < Fraction( 1, 1 ) )
|
|
|
|
{
|
|
|
|
// Fraction umdrehen
|
|
|
|
aFract1 = aFract;
|
|
|
|
aFract = Fraction( aFract1.GetDenominator(), aFract1.GetNumerator() );
|
|
|
|
nValue = aFract;
|
2001-09-25 06:06:30 -05:00
|
|
|
|
|
|
|
// #92067# Swap nominator and denominator
|
|
|
|
aCbScale.SetText( GetScale( nValue, 1 ) );
|
2001-04-04 01:00:36 -05:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
double fValue = aFract;
|
|
|
|
nValue = aFract;
|
|
|
|
if( fValue > (double)nValue )
|
|
|
|
nValue++;
|
2001-09-25 06:06:30 -05:00
|
|
|
|
|
|
|
// #92067# Swap nominator and denominator
|
|
|
|
aCbScale.SetText( GetScale( 1, nValue ) );
|
2001-04-04 01:00:36 -05:00
|
|
|
}
|
|
|
|
return( 0L );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
String SdTpOptionsMisc::GetScale( INT32 nX, INT32 nY )
|
|
|
|
{
|
|
|
|
String aScale( UniString::CreateFromInt32( nX ) );
|
|
|
|
aScale.Append( TOKEN );
|
|
|
|
aScale.Append( UniString::CreateFromInt32( nY ) );
|
|
|
|
|
|
|
|
return( aScale );
|
|
|
|
}
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------
|
|
|
|
|
|
|
|
BOOL SdTpOptionsMisc::SetScale( const String& aScale, INT32& rX, INT32& rY )
|
|
|
|
{
|
|
|
|
if( aScale.GetTokenCount( TOKEN ) != 2 )
|
|
|
|
return( FALSE );
|
|
|
|
|
|
|
|
ByteString aTmp( aScale.GetToken( 0, TOKEN ), RTL_TEXTENCODING_ASCII_US );
|
|
|
|
if( !aTmp.IsNumericAscii() )
|
|
|
|
return( FALSE );
|
|
|
|
|
|
|
|
rX = (long) aTmp.ToInt32();
|
|
|
|
if( rX == 0 )
|
|
|
|
return( FALSE );
|
|
|
|
|
|
|
|
aTmp = ByteString( aScale.GetToken( 1, TOKEN ), RTL_TEXTENCODING_ASCII_US );
|
|
|
|
if( !aTmp.IsNumericAscii() )
|
|
|
|
return( FALSE );
|
|
|
|
|
|
|
|
rY = (long) aTmp.ToInt32();
|
|
|
|
if( rY == 0 )
|
|
|
|
return( FALSE );
|
|
|
|
|
|
|
|
return( TRUE );
|
|
|
|
}
|
2000-09-18 11:07:07 -05:00
|
|
|
|
|
|
|
|
2003-05-13 06:20:01 -05:00
|
|
|
|
|
|
|
|
|
|
|
void SdTpOptionsMisc::UpdateCompatibilityControls (void)
|
|
|
|
{
|
|
|
|
// Disable the compatibility controls by default. Enable them only when
|
|
|
|
// there is at least one open document.
|
|
|
|
sal_Bool bIsEnabled = sal_False;
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
// Get a component enumeration from the desktop and search it for documents.
|
|
|
|
Reference<lang::XMultiServiceFactory> xFactory (
|
|
|
|
::comphelper::getProcessServiceFactory ());
|
|
|
|
do
|
|
|
|
{
|
|
|
|
if ( ! xFactory.is())
|
|
|
|
break;
|
|
|
|
|
|
|
|
Reference<frame::XDesktop> xDesktop (xFactory->createInstance (
|
|
|
|
::rtl::OUString::createFromAscii("com.sun.star.frame.Desktop")), UNO_QUERY);
|
|
|
|
if ( ! xDesktop.is())
|
|
|
|
break;
|
|
|
|
|
|
|
|
Reference<container::XEnumerationAccess> xComponents (
|
|
|
|
xDesktop->getComponents(), UNO_QUERY);
|
|
|
|
if ( ! xComponents.is())
|
|
|
|
break;
|
|
|
|
|
|
|
|
Reference<container::XEnumeration> xEnumeration (
|
|
|
|
xComponents->createEnumeration());
|
|
|
|
if ( ! xEnumeration.is())
|
|
|
|
break;
|
|
|
|
|
|
|
|
while (xEnumeration->hasMoreElements())
|
|
|
|
{
|
|
|
|
Reference<frame::XModel> xModel (xEnumeration->nextElement(), UNO_QUERY);
|
|
|
|
if (xModel.is())
|
|
|
|
{
|
|
|
|
// There is at leas one model/document: Enable the compatibility controls.
|
|
|
|
bIsEnabled = sal_True;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
while (false); // One 'loop'.
|
|
|
|
}
|
|
|
|
catch (uno::Exception e)
|
|
|
|
{
|
|
|
|
// When there is an exception then simply use the default value of
|
|
|
|
// bIsEnabled and disable the controls.
|
|
|
|
}
|
|
|
|
|
|
|
|
aTxtCompatibility.Enable (bIsEnabled);
|
|
|
|
aCbxCompatibility.Enable(bIsEnabled);
|
|
|
|
aCbxUsePrinterMetrics.Enable (bIsEnabled);
|
|
|
|
}
|
|
|
|
|
2004-05-10 09:45:49 -05:00
|
|
|
void SdTpOptionsMisc::PageCreated (SfxAllItemSet aSet) //add CHINA001
|
|
|
|
{
|
|
|
|
SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt32Item,SID_SDMODE_FLAG,sal_False);
|
|
|
|
if (pFlagItem)
|
|
|
|
{
|
|
|
|
UINT32 nFlags=pFlagItem->GetValue();
|
|
|
|
if ( ( nFlags & SD_DRAW_MODE ) == SD_DRAW_MODE )
|
|
|
|
SetDrawMode();
|
|
|
|
if ( ( nFlags & SD_IMPRESS_MODE ) == SD_IMPRESS_MODE )
|
|
|
|
SetImpressMode();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|