2009-05-05 18:23:27 +0200 mba r271547 : apply diffs from m45->m47 for all files moved from dialog to cui 2009-05-05 18:22:02 +0200 mba r271545 : apply diffs from m45->m47 for all files moved from dialog to cui 2009-05-05 18:16:42 +0200 mba r271544 : apply diffs from m45->m47 for all files moved from dialog to cui 2009-04-29 19:35:58 +0200 mba r271392 : #i73672#: unify commands for inserting special characters 2009-04-29 18:01:27 +0200 mba r271391 : #i101337#: missing string resources 2009-04-29 18:01:10 +0200 mba r271390 : #i101337#: missing string resources 2009-04-29 15:42:47 +0200 mba r271380 : concurrency problem in multithreaded dmake due to missing dependency 2009-04-28 17:36:03 +0200 tbo r271336 : #i99432# 2009-04-28 13:57:52 +0200 mba r271322 : #i101302#: ctor might be called with pSet=0 2009-04-22 19:32:39 +0200 tbo r271138 : #i99432# 2009-04-09 14:46:03 +0200 mba r270709 : make sendreportw32.cxx compile with pch 2009-04-06 16:05:07 +0200 mba r270568 : #i99432#: some tweaks for build order 2009-04-06 15:38:52 +0200 mba r270558 : typo 2009-04-06 13:36:19 +0200 mba r270542 : #i99432#: split of localization also 2009-04-06 13:19:06 +0200 mba r270539 : #i99432#: split up srs files also 2009-04-03 17:57:59 +0200 mba r270513 : #i99432#: split dialog folder into two 2009-04-03 17:56:46 +0200 mba r270512 : #i99432#: split dialog folder into two 2009-04-01 22:15:00 +0200 mba r270364 : warnings on Linux 2009-04-01 22:10:44 +0200 mba r270363 : warnings on Linux 2009-04-01 21:43:54 +0200 mba r270362 : warning fixed 2009-04-01 21:41:27 +0200 mba r270361 : warning on Linux fixed 2009-04-01 21:35:44 +0200 mba r270360 : warning fixed 2009-04-01 20:19:59 +0200 mba r270358 : warning found on Linux fixed 2009-04-01 19:23:38 +0200 mba r270354 : warning due to missing eof 2009-04-01 18:56:25 +0200 mba r270352 : linking problem fixed that appeared only on mac 2009-04-01 18:41:30 +0200 mba r270350 : warnings discovered on Linux fixed 2009-04-01 18:34:28 +0200 mba r270349 : some fixes for warnings and include problems discoverd after resync and build on mac 2009-04-01 14:08:22 +0200 mba r270328 : CWS-TOOLING: rebase CWS mba32issues01 to trunk@270033 (milestone: DEV300:m45) 2009-03-04 18:13:35 +0100 mba r268858 : #i99432#: more dialogs moved to cui 2009-03-04 17:47:41 +0100 mba r268854 : #i99432#: more dialogs moved to cui 2009-03-04 17:32:39 +0100 mba r268851 : warning fixed 2009-03-04 12:59:26 +0100 mba r268814 : #i99432#: more dialogs moved to cui 2009-03-04 11:49:03 +0100 mba r268802 : #i99432#: CharmapDialog moved to cui 2009-03-04 10:46:00 +0100 mba r268795 : #i99432#: CharmapDialog moved to cui 2009-03-04 10:43:50 +0100 mba r268794 : #i99432#: CharmapDialog moved to cui 2009-03-04 10:00:29 +0100 mba r268792 : #i99432#: CharmapDialog moved to cui 2009-03-04 10:00:03 +0100 mba r268791 : #i99432#: CharmapDialog moved to cui 2009-03-04 09:59:43 +0100 mba r268790 : #i99432#: CharmapDialog moved to cui 2009-03-04 09:58:51 +0100 mba r268789 : #i99432#: CharmapDialog moved to cui 2009-03-04 09:58:16 +0100 mba r268788 : #i99432#: CharmapDialog moved to cui 2009-03-03 16:33:14 +0100 mba r268763 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:32:28 +0100 mba r268762 : #i99432#: some tabpages moved to cui 2009-03-03 16:32:09 +0100 mba r268761 : #i99432#: some tabpages moved to cui 2009-03-03 16:29:40 +0100 mba r268760 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:29:08 +0100 mba r268759 : #i99432#: MacroAssignment page moved to cui 2009-03-03 16:28:41 +0100 mba r268758 : #i99432#: MacroAssignment page moved to cui 2009-03-03 16:28:18 +0100 mba r268757 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:27:36 +0100 mba r268756 : #i99465#: replace FN_SYMBOL by SID_CHARMAP 2009-03-03 16:27:02 +0100 mba r268755 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:26:23 +0100 mba r268754 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:25:30 +0100 mba r268753 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:24:49 +0100 mba r268752 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:24:35 +0100 mba r268751 : #i99432#: MacroAssignment page moved to cui 2009-03-03 16:23:20 +0100 mba r268750 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:23:04 +0100 mba r268749 : #i99432#: MacroAssignment page moved to cui 2009-03-03 16:21:56 +0100 mba r268748 : #i99465#: new SfxAbstractDialog interface and creation methods 2009-03-03 16:18:39 +0100 mba r268747 : #i99432#: MacroAssignment page moved to cui 2009-03-03 16:13:14 +0100 mba r268745 : #i99465#: replace FN_SYMBOL by SID_CHARMAP 2009-03-03 16:02:54 +0100 mba r268738 : #i99432#: moved MacroAssignment TabPage from sfx2 2009-03-03 14:57:58 +0100 mba r268729 : #i99465#: transport return value via ItemSet 2009-03-03 00:08:10 +0100 mba r268701 : #i99432#: move acccfg to cuilib 2009-03-03 00:07:32 +0100 mba r268700 : #i99432#: move acccfg to cuilib 2009-03-03 00:02:01 +0100 mba r268699 : #i99432#: move acccfg to cuilib 2009-03-03 00:01:38 +0100 mba r268698 : #i99432#: move acccfg to cuilib 2009-03-03 00:01:11 +0100 mba r268697 : #i99432#: move acccfg to cuilib 2009-03-03 00:00:40 +0100 mba r268696 : #i99432#: move acccfg to cuilib 2009-03-03 00:00:06 +0100 mba r268695 : #i99432#: replace SfxAbstractSingleTabDialog by SfxAbstractDialog 2009-03-02 23:59:22 +0100 mba r268694 : #i99432#: move acccfg to cuilib 2009-03-02 23:57:19 +0100 mba r268693 : #i99432#: move acccfg to svx 2009-03-02 23:56:14 +0100 mba r268692 : #i99432#: replace SfxAbstractSingleTabDialog by SfxAbstractDialog 2009-03-02 23:49:37 +0100 mba r268691 : #i99785#: consolidate dialogs library 2009-03-02 17:26:40 +0100 mba r268683 : #i99785#: consolidate dialogs library 2009-03-02 17:24:28 +0100 mba r268682 : i99465#: consolidate slot for InsertSymbol command 2009-03-02 17:22:29 +0100 mba r268681 : #i99785#: consolidate dialogs library 2009-03-02 17:18:11 +0100 mba r268680 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 17:08:30 +0100 mba r268679 : #i99785#: consolidate dialogs library 2009-03-02 17:06:57 +0100 mba r268678 : #i99785#: consolidate dialogs library 2009-03-02 17:06:30 +0100 mba r268677 : #i99785#: consolidate dialogs library 2009-03-02 17:05:02 +0100 mba r268676 : #i99785#: consolidate dialogs library 2009-03-02 17:04:35 +0100 mba r268675 : #i99785#: consolidate dialogs library 2009-03-02 16:47:53 +0100 mba r268673 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:45:17 +0100 mba r268671 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:39:59 +0100 mba r268670 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:38:59 +0100 mba r268668 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:38:28 +0100 mba r268667 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:36:06 +0100 mba r268666 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:29:50 +0100 mba r268663 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:24:00 +0100 mba r268659 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:23:31 +0100 mba r268658 : i99432#: move accelconfig and macroassignment to cui 2009-03-02 16:22:41 +0100 mba r268657 : i99432#: move accelconfig and macroassignment to cui 2009-02-25 16:57:26 +0100 mba r268453 : obsolete 2009-02-17 10:50:51 +0100 mba r267846 : obsolete 2009-02-12 16:33:54 +0100 mba r267676 : #i96834#: warning fixed 2009-02-11 19:28:47 +0100 mba r267626 : #i91978#: unused code 2009-02-11 18:37:47 +0100 mba r267625 : metafile output, fixes for 3 layer office 2009-02-11 12:56:28 +0100 mba r267593 : selective trees; incomplete build lists; metafile output
1178 lines
38 KiB
C++
1178 lines
38 KiB
C++
/*************************************************************************
|
|
*
|
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
*
|
|
* Copyright 2008 by Sun Microsystems, Inc.
|
|
*
|
|
* OpenOffice.org - a multi-platform office productivity suite
|
|
*
|
|
* $RCSfile: num.cxx,v $
|
|
* $Revision: 1.21 $
|
|
*
|
|
* This file is part of OpenOffice.org.
|
|
*
|
|
* OpenOffice.org is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU Lesser General Public License version 3
|
|
* only, as published by the Free Software Foundation.
|
|
*
|
|
* OpenOffice.org is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU Lesser General Public License version 3 for more details
|
|
* (a copy is included in the LICENSE file that accompanied this code).
|
|
*
|
|
* You should have received a copy of the GNU Lesser General Public License
|
|
* version 3 along with OpenOffice.org. If not, see
|
|
* <http://www.openoffice.org/license.html>
|
|
* for a copy of the LGPLv3 License.
|
|
*
|
|
************************************************************************/
|
|
|
|
// MARKER(update_precomp.py): autogen include statement, do not remove
|
|
#include "precompiled_sw.hxx"
|
|
#ifdef SW_DLLIMPLEMENTATION
|
|
#undef SW_DLLIMPLEMENTATION
|
|
#endif
|
|
|
|
|
|
|
|
#define USE_NUMTABPAGES
|
|
#define _NUM_CXX
|
|
#include <hintids.hxx>
|
|
|
|
#ifndef _MSGBOX_HXX //autogen
|
|
#include <vcl/msgbox.hxx>
|
|
#endif
|
|
#include <tools/urlobj.hxx>
|
|
#include <sfx2/app.hxx>
|
|
#include <sfx2/imgmgr.hxx>
|
|
#include <svx/gallery.hxx>
|
|
#include <svx/brshitem.hxx>
|
|
#include <svx/lrspitem.hxx>
|
|
#include <svx/impgrf.hxx>
|
|
#include <svx/numitem.hxx>
|
|
#include <swvset.hxx>
|
|
#include <swmodule.hxx>
|
|
#include <wrtsh.hxx>
|
|
#ifndef _DOCSH_HXX
|
|
#include <docsh.hxx>
|
|
#endif
|
|
#ifndef _WVIEW_HXX
|
|
#include <wview.hxx>
|
|
#endif
|
|
#include <uitool.hxx>
|
|
#ifndef _WDOCSH_HXX
|
|
#include <wdocsh.hxx>
|
|
#endif
|
|
#include <uiitems.hxx>
|
|
#include <docstyle.hxx>
|
|
#include <charfmt.hxx>
|
|
#include <uinums.hxx>
|
|
#include <poolfmt.hxx>
|
|
#include <shellres.hxx>
|
|
#include <outline.hxx>
|
|
#include <num.hxx>
|
|
#include <viewopt.hxx>
|
|
#include <frmmgr.hxx>
|
|
|
|
#ifndef _MISC_HRC
|
|
#include <misc.hrc>
|
|
#endif
|
|
#ifndef _FRMUI_HRC
|
|
#include <frmui.hrc>
|
|
#endif
|
|
#ifndef _NUM_HRC
|
|
#include <num.hrc>
|
|
#endif
|
|
#ifndef _GLOBALS_HRC
|
|
#include <globals.hrc>
|
|
#endif
|
|
#ifndef _HELPID_H
|
|
#include <helpid.h>
|
|
#endif
|
|
#include <SwStyleNameMapper.hxx>
|
|
#include <svx/svxids.hrc>
|
|
#include <svx/dialogs.hrc>
|
|
#include <svtools/stritem.hxx>
|
|
#include <svtools/aeitem.hxx>
|
|
#include <svtools/slstitm.hxx>
|
|
|
|
static BOOL bLastRelative = FALSE;
|
|
|
|
/*-----------------03.12.97 10:02-------------------
|
|
|
|
--------------------------------------------------*/
|
|
SwNumPositionTabPage::SwNumPositionTabPage(Window* pParent,
|
|
const SfxItemSet& rSet) :
|
|
SfxTabPage( pParent, SW_RES( TP_NUM_POSITION ), rSet ),
|
|
aPositionFL( this, SW_RES(FL_POSITION )),
|
|
aLevelFL( this, SW_RES(FL_LEVEL )),
|
|
aLevelLB( this, SW_RES(LB_LEVEL )),
|
|
|
|
aDistBorderFT( this, SW_RES(FT_BORDERDIST )),
|
|
aDistBorderMF( this, SW_RES(MF_BORDERDIST )),
|
|
aRelativeCB( this, SW_RES(CB_RELATIVE )),
|
|
aIndentFT( this, SW_RES(FT_INDENT )),
|
|
aIndentMF( this, SW_RES(MF_INDENT )),
|
|
aDistNumFT( this, SW_RES(FT_NUMDIST )),
|
|
aDistNumMF( this, SW_RES(MF_NUMDIST )),
|
|
aAlignFT( this, SW_RES(FT_ALIGN )),
|
|
aAlignLB( this, SW_RES(LB_ALIGN )),
|
|
// --> OD 2008-02-01 #newlistlevelattrs#
|
|
aLabelFollowedByFT( this, SW_RES(FT_LABEL_FOLLOWED_BY) ),
|
|
aLabelFollowedByLB( this, SW_RES(LB_LABEL_FOLLOWED_BY) ),
|
|
aListtabFT( this, SW_RES(FT_LISTTAB) ),
|
|
aListtabMF( this, SW_RES(MF_LISTTAB) ),
|
|
aAlign2FT( this, SW_RES(FT_ALIGN_2) ),
|
|
aAlign2LB( this, SW_RES(LB_ALIGN_2) ),
|
|
aAlignedAtFT( this, SW_RES(FT_ALIGNED_AT) ),
|
|
aAlignedAtMF( this, SW_RES(MF_ALIGNED_AT) ),
|
|
aIndentAtFT( this, SW_RES(FT_INDENT_AT) ),
|
|
aIndentAtMF( this, SW_RES(MF_INDENT_AT) ),
|
|
// <--
|
|
aStandardPB( this, SW_RES(PB_STANDARD )),
|
|
|
|
aPreviewWIN( this, SW_RES(WIN_PREVIEW )),
|
|
|
|
pActNum(0),
|
|
pSaveNum(0),
|
|
pWrtSh(0),
|
|
pOutlineDlg(0),
|
|
bPreset( FALSE ),
|
|
bInInintControl(FALSE),
|
|
// --> OD 2008-02-01 #newlistlevelattrs#
|
|
bLabelAlignmentPosAndSpaceModeActive( false )
|
|
// <--
|
|
{
|
|
FreeResource();
|
|
SetExchangeSupport();
|
|
aPreviewWIN.SetBackground(Wallpaper(Color(COL_TRANSPARENT)));
|
|
|
|
aRelativeCB.Check();
|
|
aAlignLB.SetSelectHdl(LINK(this, SwNumPositionTabPage, EditModifyHdl));
|
|
// --> OD 2008-02-01 #newlistlevelattrs#
|
|
aAlign2LB.SetSelectHdl(LINK(this, SwNumPositionTabPage, EditModifyHdl));
|
|
for ( USHORT i = 0; i < aAlignLB.GetEntryCount(); ++i )
|
|
{
|
|
aAlign2LB.InsertEntry( aAlignLB.GetEntry( i ) );
|
|
}
|
|
aAlign2LB.SetDropDownLineCount( aAlign2LB.GetEntryCount() );
|
|
aAlign2FT.SetText( aAlignFT.GetText() );
|
|
// <--
|
|
|
|
Link aLk = LINK(this, SwNumPositionTabPage, DistanceHdl);
|
|
aDistBorderMF.SetUpHdl(aLk);
|
|
aDistNumMF.SetUpHdl(aLk);
|
|
aIndentMF.SetUpHdl(aLk);
|
|
aDistBorderMF.SetDownHdl(aLk);
|
|
aDistNumMF.SetDownHdl(aLk);
|
|
aIndentMF.SetDownHdl(aLk);
|
|
aDistBorderMF.SetLoseFocusHdl(aLk);
|
|
aDistNumMF.SetLoseFocusHdl(aLk);
|
|
aIndentMF.SetLoseFocusHdl(aLk);
|
|
|
|
// --> OD 2008-02-01 #newlistlevelattrs#
|
|
aLabelFollowedByLB.SetDropDownLineCount( aLabelFollowedByLB.GetEntryCount() );
|
|
aLabelFollowedByLB.SetSelectHdl( LINK(this, SwNumPositionTabPage, LabelFollowedByHdl_Impl) );
|
|
|
|
aLk = LINK(this, SwNumPositionTabPage, ListtabPosHdl_Impl);
|
|
aListtabMF.SetUpHdl(aLk);
|
|
aListtabMF.SetDownHdl(aLk);
|
|
aListtabMF.SetLoseFocusHdl(aLk);
|
|
|
|
aLk = LINK(this, SwNumPositionTabPage, AlignAtHdl_Impl);
|
|
aAlignedAtMF.SetUpHdl(aLk);
|
|
aAlignedAtMF.SetDownHdl(aLk);
|
|
aAlignedAtMF.SetLoseFocusHdl(aLk);
|
|
|
|
aLk = LINK(this, SwNumPositionTabPage, IndentAtHdl_Impl);
|
|
aIndentAtMF.SetUpHdl(aLk);
|
|
aIndentAtMF.SetDownHdl(aLk);
|
|
aIndentAtMF.SetLoseFocusHdl(aLk);
|
|
// <--
|
|
|
|
aLevelLB.SetSelectHdl(LINK(this, SwNumPositionTabPage, LevelHdl));
|
|
aRelativeCB.SetClickHdl(LINK(this, SwNumPositionTabPage, RelativeHdl));
|
|
aStandardPB.SetClickHdl(LINK(this, SwNumPositionTabPage, StandardHdl));
|
|
|
|
// Ebenen einfuegen
|
|
for(USHORT i = 1; i <= MAXLEVEL; i++)
|
|
aLevelLB.InsertEntry(String::CreateFromInt32(i));
|
|
String sEntry(String::CreateFromAscii("1 - "));
|
|
sEntry += String::CreateFromInt32(MAXLEVEL);
|
|
aLevelLB.InsertEntry(sEntry);
|
|
aLevelLB.SelectEntry(sEntry);
|
|
|
|
aRelativeCB.Check(bLastRelative);
|
|
aPreviewWIN.SetPositionMode();
|
|
}
|
|
/*-----------------03.12.97 10:02-------------------
|
|
|
|
--------------------------------------------------*/
|
|
SwNumPositionTabPage::~SwNumPositionTabPage()
|
|
{
|
|
delete pActNum;
|
|
}
|
|
/*-----------------03.12.97 10:06-------------------
|
|
|
|
--------------------------------------------------*/
|
|
void SwNumPositionTabPage::InitControls()
|
|
{
|
|
bInInintControl = TRUE;
|
|
// --> OD 2008-02-01 #newlistlevelattrs#
|
|
const bool bRelative = !bLabelAlignmentPosAndSpaceModeActive &&
|
|
aRelativeCB.IsEnabled() && aRelativeCB.IsChecked();
|
|
const bool bSingleSelection = aLevelLB.GetSelectEntryCount() == 1 &&
|
|
USHRT_MAX != nActNumLvl;
|
|
|
|
aDistBorderMF.Enable( !bLabelAlignmentPosAndSpaceModeActive &&
|
|
( bSingleSelection || bRelative || pOutlineDlg != 0 ) );
|
|
aDistBorderFT.Enable( !bLabelAlignmentPosAndSpaceModeActive &&
|
|
( bSingleSelection || bRelative || pOutlineDlg != 0 ) );
|
|
// <--
|
|
|
|
bool bSetDistEmpty = false;
|
|
bool bSameDistBorderNum = !bLabelAlignmentPosAndSpaceModeActive;
|
|
bool bSameDist = !bLabelAlignmentPosAndSpaceModeActive;
|
|
bool bSameIndent = !bLabelAlignmentPosAndSpaceModeActive;
|
|
bool bSameAdjust = true;
|
|
|
|
// --> OD 2008-02-01 #newlistlevelattrs#
|
|
bool bSameLabelFollowedBy = bLabelAlignmentPosAndSpaceModeActive;
|
|
bool bSameListtab = bLabelAlignmentPosAndSpaceModeActive;
|
|
bool bSameAlignAt = bLabelAlignmentPosAndSpaceModeActive;
|
|
bool bSameIndentAt = bLabelAlignmentPosAndSpaceModeActive;
|
|
// <--
|
|
|
|
const SwNumFmt* aNumFmtArr[MAXLEVEL];
|
|
const SwFmtVertOrient* pFirstOrient = 0;
|
|
USHORT nMask = 1;
|
|
USHORT nLvl = USHRT_MAX;
|
|
long nFirstBorderText = 0;
|
|
long nFirstBorderTextRelative = -1;
|
|
for(USHORT i = 0; i < MAXLEVEL; i++)
|
|
{
|
|
aNumFmtArr[i] = &pActNum->Get(i);
|
|
if(nActNumLvl & nMask)
|
|
{
|
|
if(USHRT_MAX == nLvl)
|
|
{
|
|
nLvl = i;
|
|
// --> OD 2008-02-01 #newlistlevelattrs#
|
|
if ( !bLabelAlignmentPosAndSpaceModeActive )
|
|
{
|
|
pFirstOrient = aNumFmtArr[nLvl]->GetGraphicOrientation();
|
|
nFirstBorderText = nLvl > 0 ?
|
|
aNumFmtArr[nLvl]->GetAbsLSpace() + aNumFmtArr[nLvl]->GetFirstLineOffset() -
|
|
aNumFmtArr[nLvl - 1]->GetAbsLSpace() + aNumFmtArr[nLvl - 1]->GetFirstLineOffset():
|
|
aNumFmtArr[nLvl]->GetAbsLSpace() + aNumFmtArr[nLvl]->GetFirstLineOffset();
|
|
}
|
|
// <--
|
|
}
|
|
|
|
if( i > nLvl)
|
|
{
|
|
// --> OD 2008-02-01 #newlistlevelattrs#
|
|
bSameAdjust &= aNumFmtArr[i]->GetNumAdjust() == aNumFmtArr[nLvl]->GetNumAdjust();
|
|
if ( !bLabelAlignmentPosAndSpaceModeActive )
|
|
{
|
|
if(bRelative)
|
|
{
|
|
if(nFirstBorderTextRelative == -1)
|
|
nFirstBorderTextRelative =
|
|
(aNumFmtArr[i]->GetAbsLSpace() + aNumFmtArr[i]->GetFirstLineOffset() -
|
|
aNumFmtArr[i - 1]->GetAbsLSpace() + aNumFmtArr[i - 1]->GetFirstLineOffset());
|
|
else
|
|
bSameDistBorderNum &= nFirstBorderTextRelative ==
|
|
(aNumFmtArr[i]->GetAbsLSpace() + aNumFmtArr[i]->GetFirstLineOffset() -
|
|
aNumFmtArr[i - 1]->GetAbsLSpace() + aNumFmtArr[i - 1]->GetFirstLineOffset());
|
|
|
|
}
|
|
else
|
|
{
|
|
bSameDistBorderNum &=
|
|
aNumFmtArr[i]->GetAbsLSpace() - aNumFmtArr[i]->GetFirstLineOffset() ==
|
|
aNumFmtArr[i - 1]->GetAbsLSpace() - aNumFmtArr[i - 1]->GetFirstLineOffset();
|
|
}
|
|
|
|
bSameDist &= aNumFmtArr[i]->GetCharTextDistance() == aNumFmtArr[nLvl]->GetCharTextDistance();
|
|
bSameIndent &= aNumFmtArr[i]->GetFirstLineOffset() == aNumFmtArr[nLvl]->GetFirstLineOffset();
|
|
}
|
|
else
|
|
{
|
|
bSameLabelFollowedBy &=
|
|
aNumFmtArr[i]->GetLabelFollowedBy() == aNumFmtArr[nLvl]->GetLabelFollowedBy();
|
|
bSameListtab &=
|
|
aNumFmtArr[i]->GetListtabPos() == aNumFmtArr[nLvl]->GetListtabPos();
|
|
bSameAlignAt &=
|
|
( ( aNumFmtArr[i]->GetIndentAt() + aNumFmtArr[i]->GetFirstLineIndent() )
|
|
== ( aNumFmtArr[nLvl]->GetIndentAt() + aNumFmtArr[nLvl]->GetFirstLineIndent() ) );
|
|
bSameIndentAt &=
|
|
aNumFmtArr[i]->GetIndentAt() == aNumFmtArr[nLvl]->GetIndentAt();
|
|
}
|
|
// <--
|
|
|
|
}
|
|
}
|
|
nMask <<= 1;
|
|
|
|
}
|
|
if(bSameDistBorderNum)
|
|
{
|
|
long nDistBorderNum;
|
|
if(bRelative)
|
|
{
|
|
nDistBorderNum = (long)aNumFmtArr[nLvl]->GetAbsLSpace()+ aNumFmtArr[nLvl]->GetFirstLineOffset();
|
|
if(nLvl)
|
|
nDistBorderNum -= (long)aNumFmtArr[nLvl - 1]->GetAbsLSpace()+ aNumFmtArr[nLvl - 1]->GetFirstLineOffset();
|
|
}
|
|
else
|
|
{
|
|
nDistBorderNum = (long)aNumFmtArr[nLvl]->GetAbsLSpace()+ aNumFmtArr[nLvl]->GetFirstLineOffset();
|
|
}
|
|
aDistBorderMF.SetValue(aDistBorderMF.Normalize(nDistBorderNum),FUNIT_TWIP);
|
|
}
|
|
else
|
|
bSetDistEmpty = TRUE;
|
|
|
|
if(bSameDist)
|
|
aDistNumMF .SetValue(aDistNumMF.Normalize(aNumFmtArr[nLvl]->GetCharTextDistance()), FUNIT_TWIP);
|
|
else
|
|
aDistNumMF.SetText(aEmptyStr);
|
|
if(bSameIndent)
|
|
aIndentMF.SetValue(aIndentMF.Normalize(-aNumFmtArr[nLvl]->GetFirstLineOffset()), FUNIT_TWIP);
|
|
else
|
|
aIndentMF.SetText(aEmptyStr);
|
|
|
|
if(bSameAdjust)
|
|
{
|
|
USHORT nPos = 1; // zentriert
|
|
if(aNumFmtArr[nLvl]->GetNumAdjust() == SVX_ADJUST_LEFT)
|
|
nPos = 0;
|
|
else if(aNumFmtArr[nLvl]->GetNumAdjust() == SVX_ADJUST_RIGHT)
|
|
nPos = 2;
|
|
aAlignLB.SelectEntryPos(nPos);
|
|
// --> OD 2008-02-01 #newlistlevelattrs#
|
|
aAlign2LB.SelectEntryPos( nPos );
|
|
// <--
|
|
}
|
|
else
|
|
{
|
|
aAlignLB.SetNoSelection();
|
|
// --> OD 2008-02-01 #newlistlevelattrs#
|
|
aAlign2LB.SetNoSelection();
|
|
// <--
|
|
}
|
|
|
|
// --> OD 2008-02-01 #newlistlevelattrs#
|
|
if ( bSameLabelFollowedBy )
|
|
{
|
|
USHORT nPos = 0; // LISTTAB
|
|
if ( aNumFmtArr[nLvl]->GetLabelFollowedBy() == SvxNumberFormat::SPACE )
|
|
{
|
|
nPos = 1;
|
|
}
|
|
else if ( aNumFmtArr[nLvl]->GetLabelFollowedBy() == SvxNumberFormat::NOTHING )
|
|
{
|
|
nPos = 2;
|
|
}
|
|
aLabelFollowedByLB.SelectEntryPos( nPos );
|
|
}
|
|
else
|
|
{
|
|
aLabelFollowedByLB.SetNoSelection();
|
|
}
|
|
|
|
if ( aNumFmtArr[nLvl]->GetLabelFollowedBy() == SvxNumberFormat::LISTTAB )
|
|
{
|
|
aListtabFT.Enable( true );
|
|
aListtabMF.Enable( true );
|
|
if ( bSameListtab )
|
|
{
|
|
aListtabMF.SetValue(aListtabMF.Normalize(aNumFmtArr[nLvl]->GetListtabPos()),FUNIT_TWIP);
|
|
}
|
|
else
|
|
{
|
|
aListtabMF.SetText(aEmptyStr);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
aListtabFT.Enable( false );
|
|
aListtabMF.Enable( false );
|
|
aListtabMF.SetText(aEmptyStr);
|
|
}
|
|
|
|
if ( bSameAlignAt )
|
|
{
|
|
aAlignedAtMF.SetValue(
|
|
aAlignedAtMF.Normalize( aNumFmtArr[nLvl]->GetIndentAt() +
|
|
aNumFmtArr[nLvl]->GetFirstLineIndent()),
|
|
FUNIT_TWIP );
|
|
}
|
|
else
|
|
{
|
|
aAlignedAtMF.SetText(aEmptyStr);
|
|
}
|
|
|
|
if ( bSameIndentAt )
|
|
{
|
|
aIndentAtMF.SetValue(
|
|
aIndentAtMF.Normalize( aNumFmtArr[nLvl]->GetIndentAt()), FUNIT_TWIP );
|
|
}
|
|
else
|
|
{
|
|
aIndentAtMF.SetText(aEmptyStr);
|
|
}
|
|
// <--
|
|
|
|
if(TRUE == bSetDistEmpty)
|
|
aDistBorderMF.SetText(aEmptyStr);
|
|
|
|
bInInintControl = FALSE;
|
|
}
|
|
|
|
/*-----------------03.12.97 10:02-------------------
|
|
|
|
--------------------------------------------------*/
|
|
void SwNumPositionTabPage::ActivatePage(const SfxItemSet& )
|
|
{
|
|
const SfxPoolItem* pItem;
|
|
UINT16 nTmpNumLvl =
|
|
pOutlineDlg ? pOutlineDlg->GetActNumLevel() : 0;
|
|
const SfxItemSet* pExampleSet = GetTabDialog()->GetExampleSet();
|
|
if(pExampleSet && pExampleSet->GetItemState(FN_PARAM_NUM_PRESET, FALSE, &pItem))
|
|
{
|
|
bPreset = ((const SfxBoolItem*)pItem)->GetValue();
|
|
}
|
|
//
|
|
bModified = (!pActNum->GetNumFmt( 0 ) || bPreset);
|
|
if(*pActNum != *pSaveNum ||
|
|
nActNumLvl != nTmpNumLvl )
|
|
{
|
|
*pActNum = *pSaveNum;
|
|
nActNumLvl = nTmpNumLvl;
|
|
USHORT nMask = 1;
|
|
aLevelLB.SetUpdateMode(FALSE);
|
|
aLevelLB.SetNoSelection();
|
|
aLevelLB.SelectEntryPos( MAXLEVEL, nActNumLvl == USHRT_MAX);
|
|
if(nActNumLvl != USHRT_MAX)
|
|
for(USHORT i = 0; i < MAXLEVEL; i++)
|
|
{
|
|
if(nActNumLvl & nMask)
|
|
aLevelLB.SelectEntryPos( i, TRUE);
|
|
nMask <<= 1 ;
|
|
}
|
|
aLevelLB.SetUpdateMode(TRUE);
|
|
|
|
// --> OD 2008-02-01 #newlistlevelattrs#
|
|
InitPosAndSpaceMode();
|
|
ShowControlsDependingOnPosAndSpaceMode();
|
|
// <--
|
|
|
|
InitControls();
|
|
}
|
|
aRelativeCB.Enable(1 != nActNumLvl);
|
|
aPreviewWIN.Invalidate();
|
|
}
|
|
|
|
/*-----------------03.12.97 10:02-------------------
|
|
|
|
--------------------------------------------------*/
|
|
int SwNumPositionTabPage::DeactivatePage(SfxItemSet *_pSet)
|
|
{
|
|
SwOutlineTabDialog::SetActNumLevel(nActNumLvl);
|
|
if(_pSet)
|
|
FillItemSet(*_pSet);
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
/*-----------------03.12.97 10:02-------------------
|
|
|
|
--------------------------------------------------*/
|
|
BOOL SwNumPositionTabPage::FillItemSet( SfxItemSet& rSet )
|
|
{
|
|
if(pOutlineDlg)
|
|
*pOutlineDlg->GetNumRule() = *pActNum;
|
|
else if(bModified && pActNum)
|
|
{
|
|
*pSaveNum = *pActNum;
|
|
rSet.Put(SwUINumRuleItem( *pSaveNum ));
|
|
rSet.Put(SfxBoolItem(FN_PARAM_NUM_PRESET, FALSE));
|
|
}
|
|
return bModified;
|
|
}
|
|
|
|
/*-----------------03.12.97 10:02-------------------
|
|
|
|
--------------------------------------------------*/
|
|
void SwNumPositionTabPage::Reset( const SfxItemSet& rSet )
|
|
{
|
|
const SfxPoolItem* pItem;
|
|
if(pOutlineDlg)
|
|
{
|
|
pSaveNum = pOutlineDlg->GetNumRule();
|
|
aLevelLB.EnableMultiSelection(FALSE);
|
|
}
|
|
else if(SFX_ITEM_SET == rSet.GetItemState(FN_PARAM_ACT_NUMBER, FALSE, &pItem))
|
|
pSaveNum = ((SwUINumRuleItem*)pItem)->GetNumRule();
|
|
|
|
nActNumLvl = SwOutlineTabDialog::GetActNumLevel();
|
|
USHORT nMask = 1;
|
|
aLevelLB.SetUpdateMode(FALSE);
|
|
aLevelLB.SetNoSelection();
|
|
if(nActNumLvl == USHRT_MAX)
|
|
{
|
|
aLevelLB.SelectEntryPos( MAXLEVEL, TRUE);
|
|
}
|
|
else
|
|
for(USHORT i = 0; i < MAXLEVEL; i++)
|
|
{
|
|
if(nActNumLvl & nMask)
|
|
aLevelLB.SelectEntryPos( i, TRUE);
|
|
nMask <<= 1;
|
|
}
|
|
aLevelLB.SetUpdateMode(TRUE);
|
|
|
|
if(!pActNum)
|
|
pActNum = new SwNumRule(*pSaveNum);
|
|
else if(*pSaveNum != *pActNum)
|
|
*pActNum = *pSaveNum;
|
|
aPreviewWIN.SetNumRule(pActNum);
|
|
// --> OD 2008-02-01 #newlistlevelattrs#
|
|
InitPosAndSpaceMode();
|
|
ShowControlsDependingOnPosAndSpaceMode();
|
|
// <--
|
|
InitControls();
|
|
bModified = FALSE;
|
|
}
|
|
|
|
// --> OD 2008-01-11 #newlistlevelattrs#
|
|
void SwNumPositionTabPage::InitPosAndSpaceMode()
|
|
{
|
|
if ( pActNum == 0 )
|
|
{
|
|
DBG_ASSERT( false,
|
|
"<SwNumPositionTabPage::InitPosAndSpaceMode()> - misusage of method -> <pAktNum> has to be already set!" );
|
|
return;
|
|
}
|
|
|
|
SvxNumberFormat::SvxNumPositionAndSpaceMode ePosAndSpaceMode =
|
|
SvxNumberFormat::LABEL_ALIGNMENT;
|
|
USHORT nMask = 1;
|
|
for( USHORT i = 0; i < MAXLEVEL; ++i )
|
|
{
|
|
if(nActNumLvl & nMask)
|
|
{
|
|
SvxNumberFormat aNumFmt( pActNum->Get(i) );
|
|
ePosAndSpaceMode = aNumFmt.GetPositionAndSpaceMode();
|
|
if ( ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
|
|
{
|
|
break;
|
|
}
|
|
}
|
|
nMask <<= 1;
|
|
}
|
|
|
|
bLabelAlignmentPosAndSpaceModeActive =
|
|
ePosAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT;
|
|
}
|
|
|
|
void SwNumPositionTabPage::ShowControlsDependingOnPosAndSpaceMode()
|
|
{
|
|
aDistBorderFT.Show( !bLabelAlignmentPosAndSpaceModeActive );
|
|
aDistBorderMF.Show( !bLabelAlignmentPosAndSpaceModeActive );
|
|
aRelativeCB.Show( !bLabelAlignmentPosAndSpaceModeActive );
|
|
aIndentFT.Show( !bLabelAlignmentPosAndSpaceModeActive );
|
|
aIndentMF.Show( !bLabelAlignmentPosAndSpaceModeActive );
|
|
aDistNumFT.Show( !bLabelAlignmentPosAndSpaceModeActive );
|
|
aDistNumMF.Show( !bLabelAlignmentPosAndSpaceModeActive );
|
|
aAlignFT.Show( !bLabelAlignmentPosAndSpaceModeActive );
|
|
aAlignLB.Show( !bLabelAlignmentPosAndSpaceModeActive );
|
|
|
|
aLabelFollowedByFT.Show( bLabelAlignmentPosAndSpaceModeActive );
|
|
aLabelFollowedByLB.Show( bLabelAlignmentPosAndSpaceModeActive );
|
|
aListtabFT.Show( bLabelAlignmentPosAndSpaceModeActive );
|
|
aListtabMF.Show( bLabelAlignmentPosAndSpaceModeActive );
|
|
aAlign2FT.Show( bLabelAlignmentPosAndSpaceModeActive );
|
|
aAlign2LB.Show( bLabelAlignmentPosAndSpaceModeActive );
|
|
aAlignedAtFT.Show( bLabelAlignmentPosAndSpaceModeActive );
|
|
aAlignedAtMF.Show( bLabelAlignmentPosAndSpaceModeActive );
|
|
aIndentAtFT.Show( bLabelAlignmentPosAndSpaceModeActive );
|
|
aIndentAtMF.Show( bLabelAlignmentPosAndSpaceModeActive );
|
|
}
|
|
// <--
|
|
|
|
/*-----------------03.12.97 10:02-------------------
|
|
|
|
--------------------------------------------------*/
|
|
SfxTabPage* SwNumPositionTabPage::Create( Window* pParent,
|
|
const SfxItemSet& rAttrSet)
|
|
{
|
|
return new SwNumPositionTabPage(pParent, rAttrSet);
|
|
}
|
|
|
|
/*-----------------04.12.97 12:51-------------------
|
|
|
|
--------------------------------------------------*/
|
|
void SwNumPositionTabPage::SetWrtShell(SwWrtShell* pSh)
|
|
{
|
|
pWrtSh = pSh;
|
|
|
|
// --> OD 2008-02-01 #newlistlevelattrs#
|
|
const SwTwips nWidth = pWrtSh->GetAnyCurRect(RECT_FRM).Width();
|
|
|
|
aDistBorderMF.SetMax(aDistBorderMF.Normalize( nWidth ), FUNIT_TWIP );
|
|
aDistNumMF .SetMax(aDistNumMF .Normalize( nWidth ), FUNIT_TWIP );
|
|
aIndentMF .SetMax(aIndentMF .Normalize( nWidth ), FUNIT_TWIP );
|
|
// --> OD 2008-02-18 #newlistlevelattrs#
|
|
aListtabMF.SetMax(aListtabMF.Normalize( nWidth ), FUNIT_TWIP );
|
|
aAlignedAtMF.SetMax(aAlignedAtMF.Normalize( nWidth ), FUNIT_TWIP );
|
|
aIndentAtMF.SetMax(aIndentAtMF.Normalize( nWidth ), FUNIT_TWIP );
|
|
// <--
|
|
const SwTwips nLast2 = nWidth /2;
|
|
aDistBorderMF.SetLast( aDistBorderMF.Normalize( nLast2 ), FUNIT_TWIP );
|
|
aDistNumMF .SetLast( aDistNumMF .Normalize( nLast2 ), FUNIT_TWIP );
|
|
aIndentMF .SetLast( aIndentMF .Normalize( nLast2 ), FUNIT_TWIP );
|
|
// --> OD 2008-02-18 #newlistlevelattrs#
|
|
aListtabMF.SetLast(aListtabMF.Normalize( nLast2 ), FUNIT_TWIP );
|
|
aAlignedAtMF.SetLast(aAlignedAtMF.Normalize( nLast2 ), FUNIT_TWIP );
|
|
aIndentAtMF.SetLast(aIndentAtMF.Normalize( nLast2 ), FUNIT_TWIP );
|
|
// <--
|
|
// <--
|
|
|
|
const SwRect& rPrtRect = pWrtSh->GetAnyCurRect(RECT_PAGE);
|
|
aPreviewWIN.SetPageWidth(rPrtRect.Width());
|
|
FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &pWrtSh->GetView()));
|
|
if(eMetric == FUNIT_MM)
|
|
{
|
|
aDistBorderMF .SetDecimalDigits(1);
|
|
aDistNumMF .SetDecimalDigits(1);
|
|
aIndentMF .SetDecimalDigits(1);
|
|
// --> OD 2008-02-18 #newlistlevelattrs#
|
|
aListtabMF.SetDecimalDigits(1);
|
|
aAlignedAtMF.SetDecimalDigits(1);
|
|
aIndentAtMF.SetDecimalDigits(1);
|
|
// <--
|
|
}
|
|
aDistBorderMF .SetUnit( eMetric );
|
|
aDistNumMF .SetUnit( eMetric );
|
|
aIndentMF .SetUnit( eMetric );
|
|
// --> OD 2008-02-18 #newlistlevelattrs#
|
|
aListtabMF.SetUnit( eMetric );
|
|
aAlignedAtMF.SetUnit( eMetric );
|
|
aIndentAtMF.SetUnit( eMetric );
|
|
// <--
|
|
}
|
|
|
|
/*-----------------03.12.97 11:06-------------------
|
|
|
|
--------------------------------------------------*/
|
|
IMPL_LINK( SwNumPositionTabPage, EditModifyHdl, Edit *, EMPTYARG )
|
|
{
|
|
USHORT nMask = 1;
|
|
for(USHORT i = 0; i < MAXLEVEL; i++)
|
|
{
|
|
if(nActNumLvl & nMask)
|
|
{
|
|
SwNumFmt aNumFmt(pActNum->Get(i));
|
|
|
|
// --> OD 2008-02-01 #newlistlevelattrs#
|
|
const USHORT nPos = aAlignLB.IsVisible()
|
|
? aAlignLB.GetSelectEntryPos()
|
|
: aAlign2LB.GetSelectEntryPos();
|
|
// <--
|
|
SvxAdjust eAdjust = SVX_ADJUST_CENTER;
|
|
if(nPos == 0)
|
|
eAdjust = SVX_ADJUST_LEFT;
|
|
else if(nPos == 2)
|
|
eAdjust = SVX_ADJUST_RIGHT;
|
|
aNumFmt.SetNumAdjust( eAdjust );
|
|
pActNum->Set(i, aNumFmt);
|
|
}
|
|
nMask <<= 1;
|
|
}
|
|
SetModified();
|
|
return 0;
|
|
}
|
|
/*-----------------03.12.97 11:11-------------------
|
|
|
|
--------------------------------------------------*/
|
|
IMPL_LINK( SwNumPositionTabPage, LevelHdl, ListBox *, pBox )
|
|
{
|
|
USHORT nSaveNumLvl = nActNumLvl;
|
|
nActNumLvl = 0;
|
|
if(pBox->IsEntryPosSelected( MAXLEVEL ) &&
|
|
(pBox->GetSelectEntryCount() == 1 || nSaveNumLvl != 0xffff))
|
|
{
|
|
nActNumLvl = 0xFFFF;
|
|
pBox->SetUpdateMode(FALSE);
|
|
for( USHORT i = 0; i < MAXLEVEL; i++ )
|
|
pBox->SelectEntryPos( i, FALSE );
|
|
pBox->SetUpdateMode(TRUE);
|
|
}
|
|
else if(pBox->GetSelectEntryCount())
|
|
{
|
|
USHORT nMask = 1;
|
|
for( USHORT i = 0; i < MAXLEVEL; i++ )
|
|
{
|
|
if(pBox->IsEntryPosSelected( i ))
|
|
nActNumLvl |= nMask;
|
|
nMask <<= 1;
|
|
}
|
|
pBox->SelectEntryPos( MAXLEVEL, FALSE );
|
|
}
|
|
else
|
|
{
|
|
nActNumLvl = nSaveNumLvl;
|
|
USHORT nMask = 1;
|
|
for( USHORT i = 0; i < MAXLEVEL; i++ )
|
|
{
|
|
if(nActNumLvl & nMask)
|
|
{
|
|
pBox->SelectEntryPos(i);
|
|
break;
|
|
}
|
|
nMask <<=1;
|
|
}
|
|
}
|
|
aRelativeCB.Enable(1 != nActNumLvl);
|
|
SetModified();
|
|
// --> OD 2008-02-01 #newlistlevelattrs#
|
|
InitPosAndSpaceMode();
|
|
ShowControlsDependingOnPosAndSpaceMode();
|
|
// <--
|
|
InitControls();
|
|
return 0;
|
|
}
|
|
/*-----------------03.12.97 12:24-------------------
|
|
|
|
--------------------------------------------------*/
|
|
IMPL_LINK( SwNumPositionTabPage, DistanceHdl, MetricField *, pFld )
|
|
{
|
|
if(bInInintControl)
|
|
return 0;
|
|
long nValue = static_cast< long >(pFld->Denormalize(pFld->GetValue(FUNIT_TWIP)));
|
|
USHORT nMask = 1;
|
|
for(USHORT i = 0; i < MAXLEVEL; i++)
|
|
{
|
|
if(nActNumLvl & nMask)
|
|
{
|
|
SwNumFmt aNumFmt( pActNum->Get( i ) );
|
|
if(pFld == &aDistBorderMF)
|
|
{
|
|
|
|
if(aRelativeCB.IsChecked() && aRelativeCB.IsEnabled())
|
|
{
|
|
if(0 == i)
|
|
{
|
|
long nTmp = aNumFmt.GetFirstLineOffset();
|
|
aNumFmt.SetAbsLSpace( USHORT(nValue - nTmp));
|
|
}
|
|
else
|
|
{
|
|
long nTmp = pActNum->Get( i - 1 ).GetAbsLSpace() +
|
|
pActNum->Get( i - 1 ).GetFirstLineOffset() -
|
|
pActNum->Get( i ).GetFirstLineOffset();
|
|
|
|
aNumFmt.SetAbsLSpace( USHORT(nValue + nTmp));
|
|
}
|
|
}
|
|
else
|
|
{
|
|
aNumFmt.SetAbsLSpace( (short)nValue - aNumFmt.GetFirstLineOffset());
|
|
}
|
|
}
|
|
else if(pFld == &aDistNumMF)
|
|
{
|
|
aNumFmt.SetCharTextDistance( (short)nValue );
|
|
}
|
|
else if(pFld == &aIndentMF)
|
|
{
|
|
//jetzt muss mit dem FirstLineOffset auch der AbsLSpace veraendert werden
|
|
long nDiff = nValue + aNumFmt.GetFirstLineOffset();
|
|
long nAbsLSpace = aNumFmt.GetAbsLSpace();
|
|
aNumFmt.SetAbsLSpace(USHORT(nAbsLSpace + nDiff));
|
|
aNumFmt.SetFirstLineOffset( -(short)nValue );
|
|
}
|
|
|
|
pActNum->Set( i, aNumFmt );
|
|
}
|
|
nMask <<= 1;
|
|
}
|
|
|
|
SetModified();
|
|
if(!aDistBorderMF.IsEnabled())
|
|
aDistBorderMF.SetText(aEmptyStr);
|
|
|
|
return 0;
|
|
}
|
|
|
|
/*-----------------04.12.97 12:35-------------------
|
|
|
|
--------------------------------------------------*/
|
|
IMPL_LINK( SwNumPositionTabPage, RelativeHdl, CheckBox *, pBox )
|
|
{
|
|
BOOL bOn = pBox->IsChecked();
|
|
BOOL bSingleSelection = aLevelLB.GetSelectEntryCount() == 1 && USHRT_MAX != nActNumLvl;
|
|
BOOL bSetValue = FALSE;
|
|
long nValue = 0;
|
|
if(bOn || bSingleSelection)
|
|
{
|
|
USHORT nMask = 1;
|
|
BOOL bFirst = TRUE;
|
|
bSetValue = TRUE;
|
|
for(USHORT i = 0; i < MAXLEVEL; i++)
|
|
{
|
|
if(nActNumLvl & nMask)
|
|
{
|
|
const SwNumFmt &rNumFmt = pActNum->Get(i);
|
|
if(bFirst)
|
|
{
|
|
nValue = rNumFmt.GetAbsLSpace();
|
|
if(bOn && i)
|
|
nValue -= pActNum->Get(i - 1).GetAbsLSpace();
|
|
}
|
|
else
|
|
bSetValue = nValue == rNumFmt.GetAbsLSpace() - pActNum->Get(i - 1).GetAbsLSpace();
|
|
bFirst = FALSE;
|
|
}
|
|
nMask <<= 1;
|
|
}
|
|
|
|
}
|
|
if(bSetValue)
|
|
aDistBorderMF.SetValue(aDistBorderMF.Normalize(nValue), FUNIT_TWIP);
|
|
else
|
|
aDistBorderMF.SetText(aEmptyStr);
|
|
aDistBorderMF.Enable(bOn || bSingleSelection||0 != pOutlineDlg);
|
|
bLastRelative = bOn;
|
|
return 0;
|
|
}
|
|
|
|
// --> OD 2008-02-01 #newlistlevelattrs#
|
|
IMPL_LINK( SwNumPositionTabPage, LabelFollowedByHdl_Impl, ListBox*, EMPTYARG )
|
|
{
|
|
// determine value to be set at the chosen list levels
|
|
SvxNumberFormat::SvxNumLabelFollowedBy eLabelFollowedBy =
|
|
SvxNumberFormat::LISTTAB;
|
|
{
|
|
const USHORT nPos = aLabelFollowedByLB.GetSelectEntryPos();
|
|
if ( nPos == 1 )
|
|
{
|
|
eLabelFollowedBy = SvxNumberFormat::SPACE;
|
|
}
|
|
else if ( nPos == 2 )
|
|
{
|
|
eLabelFollowedBy = SvxNumberFormat::NOTHING;
|
|
}
|
|
}
|
|
|
|
// set value at the chosen list levels
|
|
bool bSameListtabPos = true;
|
|
USHORT nFirstLvl = USHRT_MAX;
|
|
USHORT nMask = 1;
|
|
for( USHORT i = 0; i < MAXLEVEL; ++i )
|
|
{
|
|
if ( nActNumLvl & nMask )
|
|
{
|
|
SwNumFmt aNumFmt( pActNum->Get(i) );
|
|
aNumFmt.SetLabelFollowedBy( eLabelFollowedBy );
|
|
pActNum->Set( i, aNumFmt );
|
|
|
|
if ( nFirstLvl == USHRT_MAX )
|
|
{
|
|
nFirstLvl = i;
|
|
}
|
|
else
|
|
{
|
|
bSameListtabPos &= aNumFmt.GetListtabPos() ==
|
|
pActNum->Get( nFirstLvl ).GetListtabPos();
|
|
}
|
|
}
|
|
nMask <<= 1;
|
|
}
|
|
|
|
// enable/disable metric field for list tab stop position depending on
|
|
// selected item following the list label.
|
|
aListtabFT.Enable( eLabelFollowedBy == SvxNumberFormat::LISTTAB );
|
|
aListtabMF.Enable( eLabelFollowedBy == SvxNumberFormat::LISTTAB );
|
|
if ( bSameListtabPos && eLabelFollowedBy == SvxNumberFormat::LISTTAB )
|
|
{
|
|
aListtabMF.SetValue(
|
|
aListtabMF.Normalize( pActNum->Get( nFirstLvl ).GetListtabPos() ),
|
|
FUNIT_TWIP );
|
|
}
|
|
else
|
|
{
|
|
aListtabMF.SetText( String() );
|
|
}
|
|
|
|
SetModified();
|
|
|
|
return 0;
|
|
}
|
|
// <--
|
|
|
|
// --> OD 2008-02-01 #newlistlevelattrs#
|
|
IMPL_LINK( SwNumPositionTabPage, ListtabPosHdl_Impl, MetricField*, pFld )
|
|
{
|
|
// determine value to be set at the chosen list levels
|
|
const long nValue = static_cast< long >(pFld->Denormalize(pFld->GetValue(FUNIT_TWIP)));
|
|
|
|
// set value at the chosen list levels
|
|
USHORT nMask = 1;
|
|
for( USHORT i = 0; i < MAXLEVEL; ++i )
|
|
{
|
|
if ( nActNumLvl & nMask )
|
|
{
|
|
SwNumFmt aNumFmt( pActNum->Get(i) );
|
|
aNumFmt.SetListtabPos( nValue );
|
|
pActNum->Set( i, aNumFmt );
|
|
}
|
|
nMask <<= 1;
|
|
}
|
|
|
|
SetModified();
|
|
|
|
return 0;
|
|
}
|
|
// <--
|
|
|
|
// --> OD 2008-02-01 #newlistlevelattrs#
|
|
IMPL_LINK( SwNumPositionTabPage, AlignAtHdl_Impl, MetricField*, pFld )
|
|
{
|
|
// determine value to be set at the chosen list levels
|
|
const long nValue = static_cast< long >(pFld->Denormalize(pFld->GetValue(FUNIT_TWIP)));
|
|
|
|
// set value at the chosen list levels
|
|
USHORT nMask = 1;
|
|
for( USHORT i = 0; i < MAXLEVEL; ++i )
|
|
{
|
|
if ( nActNumLvl & nMask )
|
|
{
|
|
SwNumFmt aNumFmt( pActNum->Get(i) );
|
|
const long nFirstLineIndent = nValue - aNumFmt.GetIndentAt();
|
|
aNumFmt.SetFirstLineIndent( nFirstLineIndent );
|
|
pActNum->Set( i, aNumFmt );
|
|
}
|
|
nMask <<= 1;
|
|
}
|
|
|
|
SetModified();
|
|
|
|
return 0;
|
|
}
|
|
// <--
|
|
|
|
// --> OD 2008-02-01 #newlistlevelattrs#
|
|
IMPL_LINK( SwNumPositionTabPage, IndentAtHdl_Impl, MetricField*, pFld )
|
|
{
|
|
// determine value to be set at the chosen list levels
|
|
const long nValue = static_cast< long >(pFld->Denormalize(pFld->GetValue(FUNIT_TWIP)));
|
|
|
|
// set value at the chosen list levels
|
|
USHORT nMask = 1;
|
|
for( USHORT i = 0; i < MAXLEVEL; ++i )
|
|
{
|
|
if ( nActNumLvl & nMask )
|
|
{
|
|
SwNumFmt aNumFmt( pActNum->Get(i) );
|
|
const long nAlignedAt = aNumFmt.GetIndentAt() +
|
|
aNumFmt.GetFirstLineIndent();
|
|
aNumFmt.SetIndentAt( nValue );
|
|
const long nNewFirstLineIndent = nAlignedAt - nValue;
|
|
aNumFmt.SetFirstLineIndent( nNewFirstLineIndent );
|
|
pActNum->Set( i, aNumFmt );
|
|
}
|
|
nMask <<= 1;
|
|
}
|
|
|
|
SetModified();
|
|
|
|
return 0;
|
|
}
|
|
// <--
|
|
|
|
/*-----------------05.12.97 15:33-------------------
|
|
|
|
--------------------------------------------------*/
|
|
IMPL_LINK( SwNumPositionTabPage, StandardHdl, PushButton *, EMPTYARG )
|
|
{
|
|
USHORT nMask = 1;
|
|
for(USHORT i = 0; i < MAXLEVEL; i++)
|
|
{
|
|
if(nActNumLvl & nMask)
|
|
{
|
|
SwNumFmt aNumFmt( pActNum->Get( i ) );
|
|
// --> OD 2008-02-11 #newlistlevelattrs#
|
|
SwNumRule aTmpNumRule( pWrtSh->GetUniqueNumRuleName(),
|
|
aNumFmt.GetPositionAndSpaceMode(),
|
|
pOutlineDlg ? OUTLINE_RULE : NUM_RULE );
|
|
// <--
|
|
SwNumFmt aTempFmt(aTmpNumRule.Get( i ));
|
|
// --> OD 2008-02-05 #newlistlevelattrs#
|
|
aNumFmt.SetPositionAndSpaceMode( aTempFmt.GetPositionAndSpaceMode() );
|
|
if ( aTempFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
|
|
{
|
|
aNumFmt.SetAbsLSpace( aTempFmt.GetAbsLSpace());
|
|
aNumFmt.SetCharTextDistance( aTempFmt.GetCharTextDistance() );
|
|
aNumFmt.SetFirstLineOffset( aTempFmt.GetFirstLineOffset() );
|
|
}
|
|
else if ( aTempFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
|
|
{
|
|
aNumFmt.SetNumAdjust( aTempFmt.GetNumAdjust() );
|
|
aNumFmt.SetLabelFollowedBy( aTempFmt.GetLabelFollowedBy() );
|
|
aNumFmt.SetListtabPos( aTempFmt.GetListtabPos() );
|
|
aNumFmt.SetFirstLineIndent( aTempFmt.GetFirstLineIndent() );
|
|
aNumFmt.SetIndentAt( aTempFmt.GetIndentAt() );
|
|
}
|
|
// <--
|
|
|
|
pActNum->Set( i, aNumFmt );
|
|
}
|
|
nMask <<= 1;
|
|
}
|
|
|
|
InitControls();
|
|
SetModified();
|
|
return 0;
|
|
}
|
|
|
|
#if OSL_DEBUG_LEVEL > 1
|
|
void SwNumPositionTabPage::SetModified(BOOL bRepaint)
|
|
{
|
|
bModified = TRUE;
|
|
if(bRepaint)
|
|
{
|
|
aPreviewWIN.SetLevel(nActNumLvl);
|
|
aPreviewWIN.Invalidate();
|
|
}
|
|
}
|
|
|
|
#endif
|
|
|
|
/**************************************************************************/
|
|
/* */
|
|
/* */
|
|
/**************************************************************************/
|
|
|
|
|
|
SwSvxNumBulletTabDialog::SwSvxNumBulletTabDialog(Window* pParent,
|
|
const SfxItemSet* pSwItemSet, SwWrtShell & rSh) :
|
|
SfxTabDialog(pParent, SW_RES(DLG_SVXTEST_NUM_BULLET), pSwItemSet, FALSE, &aEmptyStr),
|
|
rWrtSh(rSh),
|
|
sRemoveText(SW_RES(ST_RESET)),
|
|
nRetOptionsDialog(USHRT_MAX)
|
|
{
|
|
FreeResource();
|
|
GetUserButton()->SetText(sRemoveText);
|
|
GetUserButton()->SetHelpId(HID_NUM_RESET);
|
|
GetUserButton()->SetClickHdl(LINK(this, SwSvxNumBulletTabDialog, RemoveNumberingHdl));
|
|
if(!rWrtSh.GetCurNumRule())
|
|
GetUserButton()->Enable(FALSE);
|
|
AddTabPage( RID_SVXPAGE_PICK_SINGLE_NUM );
|
|
AddTabPage( RID_SVXPAGE_PICK_BULLET );
|
|
AddTabPage( RID_SVXPAGE_PICK_NUM );
|
|
AddTabPage( RID_SVXPAGE_PICK_BMP );
|
|
AddTabPage( RID_SVXPAGE_NUM_OPTIONS );
|
|
AddTabPage( RID_SVXPAGE_NUM_POSITION );
|
|
|
|
}
|
|
/*-----------------07.02.97 12.08-------------------
|
|
|
|
--------------------------------------------------*/
|
|
|
|
SwSvxNumBulletTabDialog::~SwSvxNumBulletTabDialog()
|
|
{
|
|
}
|
|
|
|
/*-----------------07.02.97 14.48-------------------
|
|
|
|
--------------------------------------------------*/
|
|
|
|
void SwSvxNumBulletTabDialog::PageCreated(USHORT nPageId, SfxTabPage& rPage)
|
|
{
|
|
//Namen der Vorlagen und Metric setzen
|
|
String sNumCharFmt, sBulletCharFmt;
|
|
SwStyleNameMapper::FillUIName( RES_POOLCHR_NUM_LEVEL, sNumCharFmt );
|
|
SwStyleNameMapper::FillUIName( RES_POOLCHR_BUL_LEVEL, sBulletCharFmt );
|
|
|
|
switch ( nPageId )
|
|
{
|
|
case RID_SVXPAGE_PICK_NUM:
|
|
{
|
|
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
|
|
aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt));
|
|
aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt));
|
|
rPage.PageCreated(aSet);
|
|
}
|
|
break;
|
|
case RID_SVXPAGE_PICK_BULLET :
|
|
{
|
|
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
|
|
aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt));
|
|
rPage.PageCreated(aSet);
|
|
}
|
|
break;
|
|
|
|
case RID_SVXPAGE_NUM_OPTIONS:
|
|
{
|
|
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
|
|
aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt));
|
|
aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt));
|
|
// Zeichenvorlagen sammeln
|
|
ListBox rCharFmtLB(this);
|
|
rCharFmtLB.Clear();
|
|
rCharFmtLB.InsertEntry( ViewShell::GetShellRes()->aStrNone );
|
|
SwDocShell* pDocShell = rWrtSh.GetView().GetDocShell();
|
|
::FillCharStyleListBox(rCharFmtLB, pDocShell);
|
|
List aList;
|
|
for(USHORT j = 0; j < rCharFmtLB.GetEntryCount(); j++)
|
|
{
|
|
|
|
aList.Insert( new XubString(rCharFmtLB.GetEntry(j)), LIST_APPEND );
|
|
}
|
|
aSet.Put( SfxStringListItem( SID_CHAR_FMT_LIST_BOX,&aList ) ) ;
|
|
|
|
FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell, pDocShell));
|
|
aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< USHORT >(eMetric) ) );
|
|
rPage.PageCreated(aSet);
|
|
for( USHORT i = (USHORT)aList.Count(); i; --i )
|
|
delete (XubString*)aList.Remove(i);
|
|
aList.Clear();
|
|
}
|
|
break;
|
|
case RID_SVXPAGE_NUM_POSITION:
|
|
{
|
|
SwDocShell* pDocShell = rWrtSh.GetView().GetDocShell();
|
|
FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebDocShell, pDocShell));
|
|
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
|
|
aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< USHORT >(eMetric)) );
|
|
rPage.PageCreated(aSet);
|
|
// ((SvxNumPositionTabPage&)rPage).SetWrtShell(&rWrtSh);
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
/*-----------------17.02.97 16.52-------------------
|
|
|
|
--------------------------------------------------*/
|
|
short SwSvxNumBulletTabDialog::Ok()
|
|
{
|
|
short nRet = SfxTabDialog::Ok();
|
|
pExampleSet->ClearItem(SID_PARAM_NUM_PRESET);
|
|
return nRet;
|
|
}
|
|
/* -----------------02.12.98 08:35-------------------
|
|
*
|
|
* --------------------------------------------------*/
|
|
IMPL_LINK(SwSvxNumBulletTabDialog, RemoveNumberingHdl, PushButton*, EMPTYARG)
|
|
{
|
|
EndDialog(RET_USER);
|
|
return 0;
|
|
}
|
|
|
|
|