Files
libreoffice/sw/source/ui/misc/outline.cxx

1191 lines
40 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2000-09-18 16:15:01 +00:00
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2000-09-18 16:15:01 +00:00
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
2000-09-18 16:15:01 +00:00
*
* OpenOffice.org - a multi-platform office productivity suite
2000-09-18 16:15:01 +00:00
*
* This file is part of OpenOffice.org.
2000-09-18 16:15:01 +00:00
*
* OpenOffice.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 3
* only, as published by the Free Software Foundation.
2000-09-18 16:15:01 +00:00
*
* OpenOffice.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License version 3 for more details
* (a copy is included in the LICENSE file that accompanied this code).
2000-09-18 16:15:01 +00:00
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
2000-09-18 16:15:01 +00:00
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
#ifdef SW_DLLIMPLEMENTATION
#undef SW_DLLIMPLEMENTATION
#endif
2000-09-18 16:15:01 +00:00
#include <hintids.hxx>
#include <tools/shl.hxx>
#include <vcl/menu.hxx>
#include <vcl/msgbox.hxx>
#include <sfx2/tabdlg.hxx>
#include <editeng/brshitem.hxx>
2001-10-08 12:52:46 +00:00
#include <unotools/configmgr.hxx>
#include <SwStyleNameMapper.hxx>
2000-09-18 16:15:01 +00:00
#ifndef _NUM_HXX //autogen
#define USE_NUMTABPAGES
#include <num.hxx>
#endif
#include <view.hxx>
#include <docsh.hxx>
#include <uitool.hxx>
#include <wrtsh.hxx>
#include <swmodule.hxx>
#include <fmtcol.hxx>
#include <outline.hxx>
#include <uinums.hxx>
#include <poolfmt.hxx>
#include <shellres.hxx>
#include <svl/style.hxx>
2000-09-18 16:15:01 +00:00
#include <charfmt.hxx>
#include <docstyle.hxx>
2002-12-10 08:46:06 +00:00
#include <viewopt.hxx>
#include <svtools/ctrlbox.hxx>
2000-09-18 16:15:01 +00:00
#include <helpid.h>
#include <globals.hrc> // fuer Vorlagenname 'keins'
#include <misc.hrc>
#include <outline.hrc>
#include <paratr.hxx>
#include <unomid.h>
#include <IDocumentOutlineNodes.hxx>
CWS-TOOLING: integrate CWS outlinelevel 2008-12-19 10:32:51 +0100 od r265718 : #i70748# method <SwWW8Writer::StartTOX(..)> - correction for custom to outline style assigned paragraph styles 2008-12-19 09:24:41 +0100 od r265715 : #i70748# method <HandleModifyAtTxtNode(..)> - retrieve former applied list style before potential reset of empty list style due to set outline level 2008-12-17 15:33:57 +0100 hde r265608 : #i97013# 2008-12-17 14:43:42 +0100 od r265603 : #i70748# adjust fix i44177 - adjustment of to outline style assigned paragraph styles only for OOo-Templates. 2008-12-17 12:59:42 +0100 od r265598 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - special handling of OOo 2.x document regarding outline numbering of headings. 2008-12-17 12:45:53 +0100 od r265597 : #i70748# method <HandleModifyAtTxtNode(..)> - correct determination of new and former applied list style 2008-12-17 10:18:41 +0100 od r265581 : #i97312# method <XMLTextNumRuleInfo::Set(..)> - check, if numbering rules instance contains any numbering rule. 2008-12-16 14:34:22 +0100 hde r265542 : #i97013 2008-12-16 14:20:24 +0100 od r265541 : #i70748# adjust documentation of "Which"-ID numbers 2008-12-16 14:19:49 +0100 od r265539 : #i70748# Adjust Attribute-Function-Mapping table due to new attribute 2008-12-16 14:06:24 +0100 od r265538 : #i70748# - Correct handling of to outline style assigned paragraph styles on reset of all paragraph style attributes - WW8 import: Consider refactoring of paragraph style's outline level attribute - NO_NUMBERING define no longer exsits. 2008-12-16 10:37:19 +0100 od r265530 : #i70478# Correction on moving outline paragraph up respectively down in its outline level: - Check also outline paragraph, which are not an outline via a to outline style assigned paragraph style, if action is applicable. 2008-12-16 09:10:13 +0100 hde r265523 : #i97277 2008-12-16 09:09:30 +0100 hde r265522 : #i97277 2008-12-16 09:07:40 +0100 hde r265521 : Added control and purged obsolete id's 2008-12-10 13:09:36 +0100 od r265174 : #i70748# correction of previous fix due to warning-free code 2008-12-10 13:03:30 +0100 od r265172 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - Due to performance issues avoid retrieving outline level value from paragraph's paragraph style for each paragraph. Instead retrieve current outline level value from paragraph, which is the inherited value from its paragraph style, and only when it is needed. 2008-12-09 16:50:36 +0100 ufi r265117 : help 2008-12-09 16:49:50 +0100 ufi r265116 : help 2008-12-09 15:45:05 +0100 od r265107 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - some minor rework and check access to paragraph styles 2008-12-09 15:42:04 +0100 od r265106 : #i70748# adjust name of local variable to avoid hiding of class variable 2008-12-09 15:40:51 +0100 od r265105 : #i70748# correct initialization order 2008-12-09 15:35:07 +0100 od r265101 : #i70748# remove duplicate entry in certain property map 2008-12-09 15:33:39 +0100 od r265100 : #i70748# add end of file token 2008-12-07 15:11:54 +0100 zhaojianwei r264952 : conflicts left not to be resolved when cws rebase 2008-12-04 14:52:21 +0100 zhaojianwei r264846 : CWS-TOOLING: rebase CWS outlinelevel to trunk@264325 (milestone: DEV300:m36) 2008-11-28 03:42:09 +0100 zhaojianwei r264525 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:39 +0100 zhaojianwei r264524 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:11 +0100 zhaojianwei r264523 : #i70748#: migrate CWS outlinelevel to SVN
2009-01-07 11:57:24 +00:00
#include <app.hrc>
#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEROLE_HPP_
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#endif
using namespace ::com::sun::star;
DBG_NAME(outlinehdl)
2000-09-18 16:15:01 +00:00
class SwNumNamesDlg: public ModalDialog
{
FixedLine aFormFL;
2000-09-18 16:15:01 +00:00
Edit aFormEdit;
ListBox aFormBox;
OKButton aOKBtn;
CancelButton aCancelBtn;
HelpButton aHelpBtn;
DECL_LINK( ModifyHdl, Edit * );
DECL_LINK( SelectHdl, ListBox * );
DECL_LINK( DoubleClickHdl, ListBox * );
public:
SwNumNamesDlg(Window *pParent);
~SwNumNamesDlg();
void SetUserNames(const String *pList[]);
String GetName() const { return aFormEdit.GetText(); }
sal_uInt16 GetCurEntryPos() const { return aFormBox.GetSelectEntryPos(); }
2000-09-18 16:15:01 +00:00
};
/*------------------------------------------------------------------------
Beschreibung: selektierten Eintrag merken
------------------------------------------------------------------------*/
IMPL_LINK_INLINE_START( SwNumNamesDlg, SelectHdl, ListBox *, pBox )
{
aFormEdit.SetText(pBox->GetSelectEntry());
aFormEdit.SetSelection(Selection(0, SELECTION_MAX));
return 0;
}
IMPL_LINK_INLINE_END( SwNumNamesDlg, SelectHdl, ListBox *, pBox )
/*------------------------------------------------------------------------
Beschreibung: Setzen der vom Benutzer vergebenen Namen
Parameter: Liste der vom Benutzer vergebenen Namen;
nicht vom Benutzer benannte Positionen sind 0.
------------------------------------------------------------------------*/
void SwNumNamesDlg::SetUserNames(const String *pList[])
{
sal_uInt16 nSelect = 0;
for(sal_uInt16 i = 0; i < SwBaseNumRules::nMaxRules; ++i)
2000-09-18 16:15:01 +00:00
{
if(pList[i])
{
aFormBox.RemoveEntry(i);
aFormBox.InsertEntry(*pList[i], i);
if(i == nSelect && nSelect < SwBaseNumRules::nMaxRules)
nSelect++;
}
}
aFormBox.SelectEntryPos(nSelect);
SelectHdl(&aFormBox);
}
2010-10-12 17:05:15 +01:00
2000-09-18 16:15:01 +00:00
/*------------------------------------------------------------------------
Beschreibung: OK-Button freischalten, wenn Text im Edit steht.
------------------------------------------------------------------------*/
IMPL_LINK_INLINE_START( SwNumNamesDlg, ModifyHdl, Edit *, pBox )
{
aOKBtn.Enable(0 != pBox->GetText().Len());
return 0;
}
IMPL_LINK_INLINE_END( SwNumNamesDlg, ModifyHdl, Edit *, pBox )
2010-10-12 17:05:15 +01:00
2000-09-18 16:15:01 +00:00
/*------------------------------------------------------------------------
Beschreibung: DoubleClickHdl
------------------------------------------------------------------------*/
IMPL_LINK_INLINE_START( SwNumNamesDlg, DoubleClickHdl, ListBox *, EMPTYARG )
{
EndDialog(RET_OK);
return 0;
}
IMPL_LINK_INLINE_END( SwNumNamesDlg, DoubleClickHdl, ListBox *, EMPTYARG )
SwNumNamesDlg::SwNumNamesDlg(Window *pParent)
: ModalDialog(pParent, SW_RES(DLG_NUM_NAMES)),
2011-02-21 18:43:22 +01:00
aFormFL(this, SW_RES(FL_FORM)),
2000-09-18 16:15:01 +00:00
aFormEdit(this, SW_RES(ED_FORM)),
aFormBox(this, SW_RES(LB_FORM)),
aOKBtn(this, SW_RES(BT_OK)),
aCancelBtn(this, SW_RES(BT_CANCEL)),
aHelpBtn(this, SW_RES(BT_HELP))
{
FreeResource();
aFormEdit.SetModifyHdl(LINK(this, SwNumNamesDlg, ModifyHdl));
aFormBox.SetSelectHdl(LINK(this, SwNumNamesDlg, SelectHdl));
aFormBox.SetDoubleClickHdl(LINK(this, SwNumNamesDlg, DoubleClickHdl));
SelectHdl(&aFormBox);
}
2010-12-12 00:08:03 +01:00
SwNumNamesDlg::~SwNumNamesDlg() {}
2000-09-18 16:15:01 +00:00
sal_uInt16 lcl_BitToLevel(sal_uInt16 nActLevel)
2000-09-18 16:15:01 +00:00
{
sal_uInt16 nTmp = nActLevel;
sal_uInt16 nTmpLevel = 0;
2000-09-18 16:15:01 +00:00
while( 0 != (nTmp >>= 1) )
nTmpLevel++;
return nTmpLevel;
}
sal_uInt16 SwOutlineTabDialog::nNumLevel = 1;
2000-09-18 16:15:01 +00:00
SwOutlineTabDialog::SwOutlineTabDialog(Window* pParent,
const SfxItemSet* pSwItemSet,
SwWrtShell &rSh) :
//der UserString wird danach richtig gesetzt
SfxTabDialog(pParent, SW_RES(DLG_TAB_OUTLINE), pSwItemSet, sal_False, &aEmptyStr),
2000-09-18 16:15:01 +00:00
aNullStr(C2S("____")),
aFormMenu(SW_RES(MN_FORM)),
rWrtSh(rSh),
2000-09-18 16:15:01 +00:00
pChapterNumRules(SW_MOD()->GetChapterNumRules()),
bModified(rWrtSh.IsModified())
2000-09-18 16:15:01 +00:00
{
CWS-TOOLING: integrate CWS outlinelevel 2008-12-19 10:32:51 +0100 od r265718 : #i70748# method <SwWW8Writer::StartTOX(..)> - correction for custom to outline style assigned paragraph styles 2008-12-19 09:24:41 +0100 od r265715 : #i70748# method <HandleModifyAtTxtNode(..)> - retrieve former applied list style before potential reset of empty list style due to set outline level 2008-12-17 15:33:57 +0100 hde r265608 : #i97013# 2008-12-17 14:43:42 +0100 od r265603 : #i70748# adjust fix i44177 - adjustment of to outline style assigned paragraph styles only for OOo-Templates. 2008-12-17 12:59:42 +0100 od r265598 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - special handling of OOo 2.x document regarding outline numbering of headings. 2008-12-17 12:45:53 +0100 od r265597 : #i70748# method <HandleModifyAtTxtNode(..)> - correct determination of new and former applied list style 2008-12-17 10:18:41 +0100 od r265581 : #i97312# method <XMLTextNumRuleInfo::Set(..)> - check, if numbering rules instance contains any numbering rule. 2008-12-16 14:34:22 +0100 hde r265542 : #i97013 2008-12-16 14:20:24 +0100 od r265541 : #i70748# adjust documentation of "Which"-ID numbers 2008-12-16 14:19:49 +0100 od r265539 : #i70748# Adjust Attribute-Function-Mapping table due to new attribute 2008-12-16 14:06:24 +0100 od r265538 : #i70748# - Correct handling of to outline style assigned paragraph styles on reset of all paragraph style attributes - WW8 import: Consider refactoring of paragraph style's outline level attribute - NO_NUMBERING define no longer exsits. 2008-12-16 10:37:19 +0100 od r265530 : #i70478# Correction on moving outline paragraph up respectively down in its outline level: - Check also outline paragraph, which are not an outline via a to outline style assigned paragraph style, if action is applicable. 2008-12-16 09:10:13 +0100 hde r265523 : #i97277 2008-12-16 09:09:30 +0100 hde r265522 : #i97277 2008-12-16 09:07:40 +0100 hde r265521 : Added control and purged obsolete id's 2008-12-10 13:09:36 +0100 od r265174 : #i70748# correction of previous fix due to warning-free code 2008-12-10 13:03:30 +0100 od r265172 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - Due to performance issues avoid retrieving outline level value from paragraph's paragraph style for each paragraph. Instead retrieve current outline level value from paragraph, which is the inherited value from its paragraph style, and only when it is needed. 2008-12-09 16:50:36 +0100 ufi r265117 : help 2008-12-09 16:49:50 +0100 ufi r265116 : help 2008-12-09 15:45:05 +0100 od r265107 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - some minor rework and check access to paragraph styles 2008-12-09 15:42:04 +0100 od r265106 : #i70748# adjust name of local variable to avoid hiding of class variable 2008-12-09 15:40:51 +0100 od r265105 : #i70748# correct initialization order 2008-12-09 15:35:07 +0100 od r265101 : #i70748# remove duplicate entry in certain property map 2008-12-09 15:33:39 +0100 od r265100 : #i70748# add end of file token 2008-12-07 15:11:54 +0100 zhaojianwei r264952 : conflicts left not to be resolved when cws rebase 2008-12-04 14:52:21 +0100 zhaojianwei r264846 : CWS-TOOLING: rebase CWS outlinelevel to trunk@264325 (milestone: DEV300:m36) 2008-11-28 03:42:09 +0100 zhaojianwei r264525 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:39 +0100 zhaojianwei r264524 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:11 +0100 zhaojianwei r264523 : #i70748#: migrate CWS outlinelevel to SVN
2009-01-07 11:57:24 +00:00
// --> OD 2008-04-14 #outlinelevel#
SetText( SW_RES( STR_OUTLINE_NUMBERING ) );
// <--
PushButton* pUserButton = GetUserButton();
pUserButton->SetText(SW_RES(ST_FORM));
pUserButton->SetHelpId(HID_OUTLINE_FORM);
pUserButton->SetClickHdl(LINK(this, SwOutlineTabDialog, FormHdl));
pUserButton->SetAccessibleRole( com::sun::star::accessibility::AccessibleRole::BUTTON_MENU );
2000-09-18 16:15:01 +00:00
FreeResource();
pNumRule = new SwNumRule( *rSh.GetOutlineNumRule() );
GetCancelButton().SetClickHdl(LINK(this, SwOutlineTabDialog, CancelHdl));
AddTabPage(TP_NUM_POSITION , &SwNumPositionTabPage::Create, 0);
AddTabPage(TP_OUTLINE_NUM , &SwOutlineSettingsTabPage::Create, 0);
String sHeadline;
sal_uInt16 i;
for( i = 0; i < MAXLEVEL; ++i )
2000-09-18 16:15:01 +00:00
{
// wurde die Vorlage noch nicht angelegt, dann ist sie noch an dieserPosition
if( !rWrtSh.GetParaStyle( sHeadline =
SwStyleNameMapper::GetUIName( static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i),
sHeadline )) )
2000-09-18 16:15:01 +00:00
aCollNames[i] = sHeadline;
}
// Erfragen der Gliederungsebenen der Textvorlagen
const sal_uInt16 nCount = rWrtSh.GetTxtFmtCollCount();
2000-09-18 16:15:01 +00:00
for(i = 0; i < nCount; ++i )
{
SwTxtFmtColl &rTxtColl = rWrtSh.GetTxtFmtColl(i);
if(!rTxtColl.IsDefault())
{
CWS-TOOLING: integrate CWS outlinelevel 2008-12-19 10:32:51 +0100 od r265718 : #i70748# method <SwWW8Writer::StartTOX(..)> - correction for custom to outline style assigned paragraph styles 2008-12-19 09:24:41 +0100 od r265715 : #i70748# method <HandleModifyAtTxtNode(..)> - retrieve former applied list style before potential reset of empty list style due to set outline level 2008-12-17 15:33:57 +0100 hde r265608 : #i97013# 2008-12-17 14:43:42 +0100 od r265603 : #i70748# adjust fix i44177 - adjustment of to outline style assigned paragraph styles only for OOo-Templates. 2008-12-17 12:59:42 +0100 od r265598 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - special handling of OOo 2.x document regarding outline numbering of headings. 2008-12-17 12:45:53 +0100 od r265597 : #i70748# method <HandleModifyAtTxtNode(..)> - correct determination of new and former applied list style 2008-12-17 10:18:41 +0100 od r265581 : #i97312# method <XMLTextNumRuleInfo::Set(..)> - check, if numbering rules instance contains any numbering rule. 2008-12-16 14:34:22 +0100 hde r265542 : #i97013 2008-12-16 14:20:24 +0100 od r265541 : #i70748# adjust documentation of "Which"-ID numbers 2008-12-16 14:19:49 +0100 od r265539 : #i70748# Adjust Attribute-Function-Mapping table due to new attribute 2008-12-16 14:06:24 +0100 od r265538 : #i70748# - Correct handling of to outline style assigned paragraph styles on reset of all paragraph style attributes - WW8 import: Consider refactoring of paragraph style's outline level attribute - NO_NUMBERING define no longer exsits. 2008-12-16 10:37:19 +0100 od r265530 : #i70478# Correction on moving outline paragraph up respectively down in its outline level: - Check also outline paragraph, which are not an outline via a to outline style assigned paragraph style, if action is applicable. 2008-12-16 09:10:13 +0100 hde r265523 : #i97277 2008-12-16 09:09:30 +0100 hde r265522 : #i97277 2008-12-16 09:07:40 +0100 hde r265521 : Added control and purged obsolete id's 2008-12-10 13:09:36 +0100 od r265174 : #i70748# correction of previous fix due to warning-free code 2008-12-10 13:03:30 +0100 od r265172 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - Due to performance issues avoid retrieving outline level value from paragraph's paragraph style for each paragraph. Instead retrieve current outline level value from paragraph, which is the inherited value from its paragraph style, and only when it is needed. 2008-12-09 16:50:36 +0100 ufi r265117 : help 2008-12-09 16:49:50 +0100 ufi r265116 : help 2008-12-09 15:45:05 +0100 od r265107 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - some minor rework and check access to paragraph styles 2008-12-09 15:42:04 +0100 od r265106 : #i70748# adjust name of local variable to avoid hiding of class variable 2008-12-09 15:40:51 +0100 od r265105 : #i70748# correct initialization order 2008-12-09 15:35:07 +0100 od r265101 : #i70748# remove duplicate entry in certain property map 2008-12-09 15:33:39 +0100 od r265100 : #i70748# add end of file token 2008-12-07 15:11:54 +0100 zhaojianwei r264952 : conflicts left not to be resolved when cws rebase 2008-12-04 14:52:21 +0100 zhaojianwei r264846 : CWS-TOOLING: rebase CWS outlinelevel to trunk@264325 (milestone: DEV300:m36) 2008-11-28 03:42:09 +0100 zhaojianwei r264525 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:39 +0100 zhaojianwei r264524 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:11 +0100 zhaojianwei r264523 : #i70748#: migrate CWS outlinelevel to SVN
2009-01-07 11:57:24 +00:00
//->added by zhaojianwei
if(rTxtColl.IsAssignedToListLevelOfOutlineStyle())
{
int nOutLevel = rTxtColl.GetAssignedOutlineStyleLevel();
2000-09-18 16:15:01 +00:00
aCollNames[ nOutLevel ] = rTxtColl.GetName();
CWS-TOOLING: integrate CWS outlinelevel 2008-12-19 10:32:51 +0100 od r265718 : #i70748# method <SwWW8Writer::StartTOX(..)> - correction for custom to outline style assigned paragraph styles 2008-12-19 09:24:41 +0100 od r265715 : #i70748# method <HandleModifyAtTxtNode(..)> - retrieve former applied list style before potential reset of empty list style due to set outline level 2008-12-17 15:33:57 +0100 hde r265608 : #i97013# 2008-12-17 14:43:42 +0100 od r265603 : #i70748# adjust fix i44177 - adjustment of to outline style assigned paragraph styles only for OOo-Templates. 2008-12-17 12:59:42 +0100 od r265598 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - special handling of OOo 2.x document regarding outline numbering of headings. 2008-12-17 12:45:53 +0100 od r265597 : #i70748# method <HandleModifyAtTxtNode(..)> - correct determination of new and former applied list style 2008-12-17 10:18:41 +0100 od r265581 : #i97312# method <XMLTextNumRuleInfo::Set(..)> - check, if numbering rules instance contains any numbering rule. 2008-12-16 14:34:22 +0100 hde r265542 : #i97013 2008-12-16 14:20:24 +0100 od r265541 : #i70748# adjust documentation of "Which"-ID numbers 2008-12-16 14:19:49 +0100 od r265539 : #i70748# Adjust Attribute-Function-Mapping table due to new attribute 2008-12-16 14:06:24 +0100 od r265538 : #i70748# - Correct handling of to outline style assigned paragraph styles on reset of all paragraph style attributes - WW8 import: Consider refactoring of paragraph style's outline level attribute - NO_NUMBERING define no longer exsits. 2008-12-16 10:37:19 +0100 od r265530 : #i70478# Correction on moving outline paragraph up respectively down in its outline level: - Check also outline paragraph, which are not an outline via a to outline style assigned paragraph style, if action is applicable. 2008-12-16 09:10:13 +0100 hde r265523 : #i97277 2008-12-16 09:09:30 +0100 hde r265522 : #i97277 2008-12-16 09:07:40 +0100 hde r265521 : Added control and purged obsolete id's 2008-12-10 13:09:36 +0100 od r265174 : #i70748# correction of previous fix due to warning-free code 2008-12-10 13:03:30 +0100 od r265172 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - Due to performance issues avoid retrieving outline level value from paragraph's paragraph style for each paragraph. Instead retrieve current outline level value from paragraph, which is the inherited value from its paragraph style, and only when it is needed. 2008-12-09 16:50:36 +0100 ufi r265117 : help 2008-12-09 16:49:50 +0100 ufi r265116 : help 2008-12-09 15:45:05 +0100 od r265107 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - some minor rework and check access to paragraph styles 2008-12-09 15:42:04 +0100 od r265106 : #i70748# adjust name of local variable to avoid hiding of class variable 2008-12-09 15:40:51 +0100 od r265105 : #i70748# correct initialization order 2008-12-09 15:35:07 +0100 od r265101 : #i70748# remove duplicate entry in certain property map 2008-12-09 15:33:39 +0100 od r265100 : #i70748# add end of file token 2008-12-07 15:11:54 +0100 zhaojianwei r264952 : conflicts left not to be resolved when cws rebase 2008-12-04 14:52:21 +0100 zhaojianwei r264846 : CWS-TOOLING: rebase CWS outlinelevel to trunk@264325 (milestone: DEV300:m36) 2008-11-28 03:42:09 +0100 zhaojianwei r264525 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:39 +0100 zhaojianwei r264524 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:11 +0100 zhaojianwei r264523 : #i70748#: migrate CWS outlinelevel to SVN
2009-01-07 11:57:24 +00:00
}
//<-end
2000-09-18 16:15:01 +00:00
}
}
}
SwOutlineTabDialog::~SwOutlineTabDialog()
{
delete pNumRule;
}
void SwOutlineTabDialog::PageCreated(sal_uInt16 nPageId, SfxTabPage& rPage)
2000-09-18 16:15:01 +00:00
{
switch ( nPageId )
{
case TP_NUM_POSITION:
((SwNumPositionTabPage&)rPage).SetWrtShell(&rWrtSh);
((SwNumPositionTabPage&)rPage).SetOutlineTabDialog(this);
break;
case TP_OUTLINE_NUM:
((SwOutlineSettingsTabPage&)rPage).SetWrtShell(&rWrtSh);
break;
}
}
2010-10-12 17:05:15 +01:00
IMPL_LINK( SwOutlineTabDialog, CancelHdl, Button *, EMPTYARG )
2000-09-18 16:15:01 +00:00
{
if (!bModified)
rWrtSh.ResetModified();
EndDialog(RET_CANCEL);
return 0;
}
2010-10-12 17:05:15 +01:00
2000-09-18 16:15:01 +00:00
IMPL_LINK( SwOutlineTabDialog, FormHdl, Button *, pBtn )
{
//PopupMenu auffuellen
for( sal_uInt16 i = 0; i < SwChapterNumRules::nMaxRules; ++i )
2000-09-18 16:15:01 +00:00
{
const SwNumRulesWithName *pRules = pChapterNumRules->GetRules(i);
if( pRules )
aFormMenu.SetItemText(i + MN_FORMBASE, pRules->GetName());
}
aFormMenu.SetSelectHdl(LINK(this, SwOutlineTabDialog, MenuSelectHdl));
aFormMenu.Execute(pBtn, Rectangle(Point(0,0), pBtn->GetSizePixel()), POPUPMENU_EXECUTE_DOWN);
return 0;
}
IMPL_LINK( SwOutlineTabDialog, MenuSelectHdl, Menu *, pMenu )
{
sal_uInt8 nLevelNo = 0;
2000-09-18 16:15:01 +00:00
switch(pMenu->GetCurItemId())
{
case MN_FORM1: nLevelNo = 1; break;
case MN_FORM2: nLevelNo = 2; break;
case MN_FORM3: nLevelNo = 3; break;
case MN_FORM4: nLevelNo = 4; break;
case MN_FORM5: nLevelNo = 5; break;
case MN_FORM6: nLevelNo = 6; break;
case MN_FORM7: nLevelNo = 7; break;
case MN_FORM8: nLevelNo = 8; break;
case MN_FORM9: nLevelNo = 9; break;
case MN_SAVE:
{
SwNumNamesDlg *pDlg = new SwNumNamesDlg(this);
const String *aStrArr[SwChapterNumRules::nMaxRules];
for(sal_uInt16 i = 0; i < SwChapterNumRules::nMaxRules; ++i)
2000-09-18 16:15:01 +00:00
{
const SwNumRulesWithName *pRules = pChapterNumRules->GetRules(i);
if(pRules)
aStrArr[i] = &pRules->GetName();
else
aStrArr[i] = 0;
}
pDlg->SetUserNames(aStrArr);
if(RET_OK == pDlg->Execute())
{
const String aName(pDlg->GetName());
pChapterNumRules->ApplyNumRules( SwNumRulesWithName(
*pNumRule, aName ), pDlg->GetCurEntryPos() );
pMenu->SetItemText(
pDlg->GetCurEntryPos() + MN_FORMBASE, aName);
}
delete pDlg;
return 0;
}
}
if( nLevelNo-- )
{
const SwNumRulesWithName *pRules = pChapterNumRules->GetRules( nLevelNo );
if( pRules )
{
pRules->MakeNumRule( rWrtSh, *pNumRule );
pNumRule->SetRuleType( OUTLINE_RULE );
}
else
*pNumRule = *rWrtSh.GetOutlineNumRule();
}
sal_uInt16 nPageId = GetCurPageId();
2000-09-18 16:15:01 +00:00
SfxTabPage* pPage = GetTabPage( nPageId );
pPage->Reset(*GetOutputItemSet());
return 0;
}
2010-10-12 17:05:15 +01:00
sal_uInt16 SwOutlineTabDialog::GetLevel(const String &rFmtName) const
2000-09-18 16:15:01 +00:00
{
for(sal_uInt16 i = 0; i < MAXLEVEL; ++i)
2000-09-18 16:15:01 +00:00
{
if(aCollNames[i] == rFmtName)
return i;
}
CWS-TOOLING: integrate CWS outlinelevel 2008-12-19 10:32:51 +0100 od r265718 : #i70748# method <SwWW8Writer::StartTOX(..)> - correction for custom to outline style assigned paragraph styles 2008-12-19 09:24:41 +0100 od r265715 : #i70748# method <HandleModifyAtTxtNode(..)> - retrieve former applied list style before potential reset of empty list style due to set outline level 2008-12-17 15:33:57 +0100 hde r265608 : #i97013# 2008-12-17 14:43:42 +0100 od r265603 : #i70748# adjust fix i44177 - adjustment of to outline style assigned paragraph styles only for OOo-Templates. 2008-12-17 12:59:42 +0100 od r265598 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - special handling of OOo 2.x document regarding outline numbering of headings. 2008-12-17 12:45:53 +0100 od r265597 : #i70748# method <HandleModifyAtTxtNode(..)> - correct determination of new and former applied list style 2008-12-17 10:18:41 +0100 od r265581 : #i97312# method <XMLTextNumRuleInfo::Set(..)> - check, if numbering rules instance contains any numbering rule. 2008-12-16 14:34:22 +0100 hde r265542 : #i97013 2008-12-16 14:20:24 +0100 od r265541 : #i70748# adjust documentation of "Which"-ID numbers 2008-12-16 14:19:49 +0100 od r265539 : #i70748# Adjust Attribute-Function-Mapping table due to new attribute 2008-12-16 14:06:24 +0100 od r265538 : #i70748# - Correct handling of to outline style assigned paragraph styles on reset of all paragraph style attributes - WW8 import: Consider refactoring of paragraph style's outline level attribute - NO_NUMBERING define no longer exsits. 2008-12-16 10:37:19 +0100 od r265530 : #i70478# Correction on moving outline paragraph up respectively down in its outline level: - Check also outline paragraph, which are not an outline via a to outline style assigned paragraph style, if action is applicable. 2008-12-16 09:10:13 +0100 hde r265523 : #i97277 2008-12-16 09:09:30 +0100 hde r265522 : #i97277 2008-12-16 09:07:40 +0100 hde r265521 : Added control and purged obsolete id's 2008-12-10 13:09:36 +0100 od r265174 : #i70748# correction of previous fix due to warning-free code 2008-12-10 13:03:30 +0100 od r265172 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - Due to performance issues avoid retrieving outline level value from paragraph's paragraph style for each paragraph. Instead retrieve current outline level value from paragraph, which is the inherited value from its paragraph style, and only when it is needed. 2008-12-09 16:50:36 +0100 ufi r265117 : help 2008-12-09 16:49:50 +0100 ufi r265116 : help 2008-12-09 15:45:05 +0100 od r265107 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - some minor rework and check access to paragraph styles 2008-12-09 15:42:04 +0100 od r265106 : #i70748# adjust name of local variable to avoid hiding of class variable 2008-12-09 15:40:51 +0100 od r265105 : #i70748# correct initialization order 2008-12-09 15:35:07 +0100 od r265101 : #i70748# remove duplicate entry in certain property map 2008-12-09 15:33:39 +0100 od r265100 : #i70748# add end of file token 2008-12-07 15:11:54 +0100 zhaojianwei r264952 : conflicts left not to be resolved when cws rebase 2008-12-04 14:52:21 +0100 zhaojianwei r264846 : CWS-TOOLING: rebase CWS outlinelevel to trunk@264325 (milestone: DEV300:m36) 2008-11-28 03:42:09 +0100 zhaojianwei r264525 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:39 +0100 zhaojianwei r264524 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:11 +0100 zhaojianwei r264523 : #i70748#: migrate CWS outlinelevel to SVN
2009-01-07 11:57:24 +00:00
return MAXLEVEL;//NO_NUMBERING; //#outline level,zhaojianwei
2000-09-18 16:15:01 +00:00
}
2010-10-12 17:05:15 +01:00
2000-09-18 16:15:01 +00:00
short SwOutlineTabDialog::Ok()
{
SfxTabDialog::Ok();
2000-09-18 16:15:01 +00:00
// bei allen erzeugten Vorlagen die Ebenen setzen, muss
// geschehen, um evtl. aufgehobene Zuordnungen
// auch wieder zu loeschen
// --> OD 2006-12-11 #130443#
// encapsulate changes into a action to avoid effects on the current cursor
// position during the changes.
rWrtSh.StartAction();
// <--
const SwNumRule * pOutlineRule = rWrtSh.GetOutlineNumRule();
sal_uInt16 i, nCount = rWrtSh.GetTxtFmtCollCount();
2000-09-18 16:15:01 +00:00
for( i = 0; i < nCount; ++i )
{
SwTxtFmtColl &rTxtColl = rWrtSh.GetTxtFmtColl(i);
if( !rTxtColl.IsDefault() )
{
const SfxPoolItem & rItem =
rTxtColl.GetFmtAttr(RES_PARATR_NUMRULE, sal_False);
if ((sal_uInt8)GetLevel(rTxtColl.GetName()) == MAXLEVEL) //add by zhaojianwei
{
CWS-TOOLING: integrate CWS outlinelevel 2008-12-19 10:32:51 +0100 od r265718 : #i70748# method <SwWW8Writer::StartTOX(..)> - correction for custom to outline style assigned paragraph styles 2008-12-19 09:24:41 +0100 od r265715 : #i70748# method <HandleModifyAtTxtNode(..)> - retrieve former applied list style before potential reset of empty list style due to set outline level 2008-12-17 15:33:57 +0100 hde r265608 : #i97013# 2008-12-17 14:43:42 +0100 od r265603 : #i70748# adjust fix i44177 - adjustment of to outline style assigned paragraph styles only for OOo-Templates. 2008-12-17 12:59:42 +0100 od r265598 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - special handling of OOo 2.x document regarding outline numbering of headings. 2008-12-17 12:45:53 +0100 od r265597 : #i70748# method <HandleModifyAtTxtNode(..)> - correct determination of new and former applied list style 2008-12-17 10:18:41 +0100 od r265581 : #i97312# method <XMLTextNumRuleInfo::Set(..)> - check, if numbering rules instance contains any numbering rule. 2008-12-16 14:34:22 +0100 hde r265542 : #i97013 2008-12-16 14:20:24 +0100 od r265541 : #i70748# adjust documentation of "Which"-ID numbers 2008-12-16 14:19:49 +0100 od r265539 : #i70748# Adjust Attribute-Function-Mapping table due to new attribute 2008-12-16 14:06:24 +0100 od r265538 : #i70748# - Correct handling of to outline style assigned paragraph styles on reset of all paragraph style attributes - WW8 import: Consider refactoring of paragraph style's outline level attribute - NO_NUMBERING define no longer exsits. 2008-12-16 10:37:19 +0100 od r265530 : #i70478# Correction on moving outline paragraph up respectively down in its outline level: - Check also outline paragraph, which are not an outline via a to outline style assigned paragraph style, if action is applicable. 2008-12-16 09:10:13 +0100 hde r265523 : #i97277 2008-12-16 09:09:30 +0100 hde r265522 : #i97277 2008-12-16 09:07:40 +0100 hde r265521 : Added control and purged obsolete id's 2008-12-10 13:09:36 +0100 od r265174 : #i70748# correction of previous fix due to warning-free code 2008-12-10 13:03:30 +0100 od r265172 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - Due to performance issues avoid retrieving outline level value from paragraph's paragraph style for each paragraph. Instead retrieve current outline level value from paragraph, which is the inherited value from its paragraph style, and only when it is needed. 2008-12-09 16:50:36 +0100 ufi r265117 : help 2008-12-09 16:49:50 +0100 ufi r265116 : help 2008-12-09 15:45:05 +0100 od r265107 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - some minor rework and check access to paragraph styles 2008-12-09 15:42:04 +0100 od r265106 : #i70748# adjust name of local variable to avoid hiding of class variable 2008-12-09 15:40:51 +0100 od r265105 : #i70748# correct initialization order 2008-12-09 15:35:07 +0100 od r265101 : #i70748# remove duplicate entry in certain property map 2008-12-09 15:33:39 +0100 od r265100 : #i70748# add end of file token 2008-12-07 15:11:54 +0100 zhaojianwei r264952 : conflicts left not to be resolved when cws rebase 2008-12-04 14:52:21 +0100 zhaojianwei r264846 : CWS-TOOLING: rebase CWS outlinelevel to trunk@264325 (milestone: DEV300:m36) 2008-11-28 03:42:09 +0100 zhaojianwei r264525 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:39 +0100 zhaojianwei r264524 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:11 +0100 zhaojianwei r264523 : #i70748#: migrate CWS outlinelevel to SVN
2009-01-07 11:57:24 +00:00
if(rTxtColl.IsAssignedToListLevelOfOutlineStyle())
{
rTxtColl.DeleteAssignmentToListLevelOfOutlineStyle();
}
if (static_cast<const SwNumRuleItem &>(rItem).GetValue() ==
pOutlineRule->GetName())
{
rTxtColl.ResetFmtAttr(RES_PARATR_NUMRULE);
}
}
else
{
CWS-TOOLING: integrate CWS outlinelevel 2008-12-19 10:32:51 +0100 od r265718 : #i70748# method <SwWW8Writer::StartTOX(..)> - correction for custom to outline style assigned paragraph styles 2008-12-19 09:24:41 +0100 od r265715 : #i70748# method <HandleModifyAtTxtNode(..)> - retrieve former applied list style before potential reset of empty list style due to set outline level 2008-12-17 15:33:57 +0100 hde r265608 : #i97013# 2008-12-17 14:43:42 +0100 od r265603 : #i70748# adjust fix i44177 - adjustment of to outline style assigned paragraph styles only for OOo-Templates. 2008-12-17 12:59:42 +0100 od r265598 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - special handling of OOo 2.x document regarding outline numbering of headings. 2008-12-17 12:45:53 +0100 od r265597 : #i70748# method <HandleModifyAtTxtNode(..)> - correct determination of new and former applied list style 2008-12-17 10:18:41 +0100 od r265581 : #i97312# method <XMLTextNumRuleInfo::Set(..)> - check, if numbering rules instance contains any numbering rule. 2008-12-16 14:34:22 +0100 hde r265542 : #i97013 2008-12-16 14:20:24 +0100 od r265541 : #i70748# adjust documentation of "Which"-ID numbers 2008-12-16 14:19:49 +0100 od r265539 : #i70748# Adjust Attribute-Function-Mapping table due to new attribute 2008-12-16 14:06:24 +0100 od r265538 : #i70748# - Correct handling of to outline style assigned paragraph styles on reset of all paragraph style attributes - WW8 import: Consider refactoring of paragraph style's outline level attribute - NO_NUMBERING define no longer exsits. 2008-12-16 10:37:19 +0100 od r265530 : #i70478# Correction on moving outline paragraph up respectively down in its outline level: - Check also outline paragraph, which are not an outline via a to outline style assigned paragraph style, if action is applicable. 2008-12-16 09:10:13 +0100 hde r265523 : #i97277 2008-12-16 09:09:30 +0100 hde r265522 : #i97277 2008-12-16 09:07:40 +0100 hde r265521 : Added control and purged obsolete id's 2008-12-10 13:09:36 +0100 od r265174 : #i70748# correction of previous fix due to warning-free code 2008-12-10 13:03:30 +0100 od r265172 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - Due to performance issues avoid retrieving outline level value from paragraph's paragraph style for each paragraph. Instead retrieve current outline level value from paragraph, which is the inherited value from its paragraph style, and only when it is needed. 2008-12-09 16:50:36 +0100 ufi r265117 : help 2008-12-09 16:49:50 +0100 ufi r265116 : help 2008-12-09 15:45:05 +0100 od r265107 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - some minor rework and check access to paragraph styles 2008-12-09 15:42:04 +0100 od r265106 : #i70748# adjust name of local variable to avoid hiding of class variable 2008-12-09 15:40:51 +0100 od r265105 : #i70748# correct initialization order 2008-12-09 15:35:07 +0100 od r265101 : #i70748# remove duplicate entry in certain property map 2008-12-09 15:33:39 +0100 od r265100 : #i70748# add end of file token 2008-12-07 15:11:54 +0100 zhaojianwei r264952 : conflicts left not to be resolved when cws rebase 2008-12-04 14:52:21 +0100 zhaojianwei r264846 : CWS-TOOLING: rebase CWS outlinelevel to trunk@264325 (milestone: DEV300:m36) 2008-11-28 03:42:09 +0100 zhaojianwei r264525 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:39 +0100 zhaojianwei r264524 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:11 +0100 zhaojianwei r264523 : #i70748#: migrate CWS outlinelevel to SVN
2009-01-07 11:57:24 +00:00
rTxtColl.AssignToListLevelOfOutlineStyle(GetLevel(rTxtColl.GetName()));
if (static_cast<const SwNumRuleItem &>(rItem).GetValue() !=
pOutlineRule->GetName())
{
SwNumRuleItem aItem(pOutlineRule->GetName());
rTxtColl.SetFmtAttr(aItem);
}
CWS-TOOLING: integrate CWS outlinelevel 2008-12-19 10:32:51 +0100 od r265718 : #i70748# method <SwWW8Writer::StartTOX(..)> - correction for custom to outline style assigned paragraph styles 2008-12-19 09:24:41 +0100 od r265715 : #i70748# method <HandleModifyAtTxtNode(..)> - retrieve former applied list style before potential reset of empty list style due to set outline level 2008-12-17 15:33:57 +0100 hde r265608 : #i97013# 2008-12-17 14:43:42 +0100 od r265603 : #i70748# adjust fix i44177 - adjustment of to outline style assigned paragraph styles only for OOo-Templates. 2008-12-17 12:59:42 +0100 od r265598 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - special handling of OOo 2.x document regarding outline numbering of headings. 2008-12-17 12:45:53 +0100 od r265597 : #i70748# method <HandleModifyAtTxtNode(..)> - correct determination of new and former applied list style 2008-12-17 10:18:41 +0100 od r265581 : #i97312# method <XMLTextNumRuleInfo::Set(..)> - check, if numbering rules instance contains any numbering rule. 2008-12-16 14:34:22 +0100 hde r265542 : #i97013 2008-12-16 14:20:24 +0100 od r265541 : #i70748# adjust documentation of "Which"-ID numbers 2008-12-16 14:19:49 +0100 od r265539 : #i70748# Adjust Attribute-Function-Mapping table due to new attribute 2008-12-16 14:06:24 +0100 od r265538 : #i70748# - Correct handling of to outline style assigned paragraph styles on reset of all paragraph style attributes - WW8 import: Consider refactoring of paragraph style's outline level attribute - NO_NUMBERING define no longer exsits. 2008-12-16 10:37:19 +0100 od r265530 : #i70478# Correction on moving outline paragraph up respectively down in its outline level: - Check also outline paragraph, which are not an outline via a to outline style assigned paragraph style, if action is applicable. 2008-12-16 09:10:13 +0100 hde r265523 : #i97277 2008-12-16 09:09:30 +0100 hde r265522 : #i97277 2008-12-16 09:07:40 +0100 hde r265521 : Added control and purged obsolete id's 2008-12-10 13:09:36 +0100 od r265174 : #i70748# correction of previous fix due to warning-free code 2008-12-10 13:03:30 +0100 od r265172 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - Due to performance issues avoid retrieving outline level value from paragraph's paragraph style for each paragraph. Instead retrieve current outline level value from paragraph, which is the inherited value from its paragraph style, and only when it is needed. 2008-12-09 16:50:36 +0100 ufi r265117 : help 2008-12-09 16:49:50 +0100 ufi r265116 : help 2008-12-09 15:45:05 +0100 od r265107 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - some minor rework and check access to paragraph styles 2008-12-09 15:42:04 +0100 od r265106 : #i70748# adjust name of local variable to avoid hiding of class variable 2008-12-09 15:40:51 +0100 od r265105 : #i70748# correct initialization order 2008-12-09 15:35:07 +0100 od r265101 : #i70748# remove duplicate entry in certain property map 2008-12-09 15:33:39 +0100 od r265100 : #i70748# add end of file token 2008-12-07 15:11:54 +0100 zhaojianwei r264952 : conflicts left not to be resolved when cws rebase 2008-12-04 14:52:21 +0100 zhaojianwei r264846 : CWS-TOOLING: rebase CWS outlinelevel to trunk@264325 (milestone: DEV300:m36) 2008-11-28 03:42:09 +0100 zhaojianwei r264525 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:39 +0100 zhaojianwei r264524 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:11 +0100 zhaojianwei r264523 : #i70748#: migrate CWS outlinelevel to SVN
2009-01-07 11:57:24 +00:00
} //<-end,zhaojianwei
}
2000-09-18 16:15:01 +00:00
}
for(i = 0; i < MAXLEVEL; ++i )
2001-04-05 13:37:02 +00:00
{
String sHeadline;
::SwStyleNameMapper::FillUIName( static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i),
sHeadline );
2001-04-05 13:37:02 +00:00
SwTxtFmtColl* pColl = rWrtSh.FindTxtFmtCollByName( sHeadline );
if( !pColl )
2000-09-18 16:15:01 +00:00
{
CWS-TOOLING: integrate CWS outlinelevel 2008-12-19 10:32:51 +0100 od r265718 : #i70748# method <SwWW8Writer::StartTOX(..)> - correction for custom to outline style assigned paragraph styles 2008-12-19 09:24:41 +0100 od r265715 : #i70748# method <HandleModifyAtTxtNode(..)> - retrieve former applied list style before potential reset of empty list style due to set outline level 2008-12-17 15:33:57 +0100 hde r265608 : #i97013# 2008-12-17 14:43:42 +0100 od r265603 : #i70748# adjust fix i44177 - adjustment of to outline style assigned paragraph styles only for OOo-Templates. 2008-12-17 12:59:42 +0100 od r265598 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - special handling of OOo 2.x document regarding outline numbering of headings. 2008-12-17 12:45:53 +0100 od r265597 : #i70748# method <HandleModifyAtTxtNode(..)> - correct determination of new and former applied list style 2008-12-17 10:18:41 +0100 od r265581 : #i97312# method <XMLTextNumRuleInfo::Set(..)> - check, if numbering rules instance contains any numbering rule. 2008-12-16 14:34:22 +0100 hde r265542 : #i97013 2008-12-16 14:20:24 +0100 od r265541 : #i70748# adjust documentation of "Which"-ID numbers 2008-12-16 14:19:49 +0100 od r265539 : #i70748# Adjust Attribute-Function-Mapping table due to new attribute 2008-12-16 14:06:24 +0100 od r265538 : #i70748# - Correct handling of to outline style assigned paragraph styles on reset of all paragraph style attributes - WW8 import: Consider refactoring of paragraph style's outline level attribute - NO_NUMBERING define no longer exsits. 2008-12-16 10:37:19 +0100 od r265530 : #i70478# Correction on moving outline paragraph up respectively down in its outline level: - Check also outline paragraph, which are not an outline via a to outline style assigned paragraph style, if action is applicable. 2008-12-16 09:10:13 +0100 hde r265523 : #i97277 2008-12-16 09:09:30 +0100 hde r265522 : #i97277 2008-12-16 09:07:40 +0100 hde r265521 : Added control and purged obsolete id's 2008-12-10 13:09:36 +0100 od r265174 : #i70748# correction of previous fix due to warning-free code 2008-12-10 13:03:30 +0100 od r265172 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - Due to performance issues avoid retrieving outline level value from paragraph's paragraph style for each paragraph. Instead retrieve current outline level value from paragraph, which is the inherited value from its paragraph style, and only when it is needed. 2008-12-09 16:50:36 +0100 ufi r265117 : help 2008-12-09 16:49:50 +0100 ufi r265116 : help 2008-12-09 15:45:05 +0100 od r265107 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - some minor rework and check access to paragraph styles 2008-12-09 15:42:04 +0100 od r265106 : #i70748# adjust name of local variable to avoid hiding of class variable 2008-12-09 15:40:51 +0100 od r265105 : #i70748# correct initialization order 2008-12-09 15:35:07 +0100 od r265101 : #i70748# remove duplicate entry in certain property map 2008-12-09 15:33:39 +0100 od r265100 : #i70748# add end of file token 2008-12-07 15:11:54 +0100 zhaojianwei r264952 : conflicts left not to be resolved when cws rebase 2008-12-04 14:52:21 +0100 zhaojianwei r264846 : CWS-TOOLING: rebase CWS outlinelevel to trunk@264325 (milestone: DEV300:m36) 2008-11-28 03:42:09 +0100 zhaojianwei r264525 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:39 +0100 zhaojianwei r264524 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:11 +0100 zhaojianwei r264523 : #i70748#: migrate CWS outlinelevel to SVN
2009-01-07 11:57:24 +00:00
if(aCollNames[i] != sHeadline)//->added by zhaojianwei
2001-04-05 13:37:02 +00:00
{
SwTxtFmtColl* pTxtColl = rWrtSh.GetTxtCollFromPool(
static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i) );
CWS-TOOLING: integrate CWS outlinelevel 2008-12-19 10:32:51 +0100 od r265718 : #i70748# method <SwWW8Writer::StartTOX(..)> - correction for custom to outline style assigned paragraph styles 2008-12-19 09:24:41 +0100 od r265715 : #i70748# method <HandleModifyAtTxtNode(..)> - retrieve former applied list style before potential reset of empty list style due to set outline level 2008-12-17 15:33:57 +0100 hde r265608 : #i97013# 2008-12-17 14:43:42 +0100 od r265603 : #i70748# adjust fix i44177 - adjustment of to outline style assigned paragraph styles only for OOo-Templates. 2008-12-17 12:59:42 +0100 od r265598 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - special handling of OOo 2.x document regarding outline numbering of headings. 2008-12-17 12:45:53 +0100 od r265597 : #i70748# method <HandleModifyAtTxtNode(..)> - correct determination of new and former applied list style 2008-12-17 10:18:41 +0100 od r265581 : #i97312# method <XMLTextNumRuleInfo::Set(..)> - check, if numbering rules instance contains any numbering rule. 2008-12-16 14:34:22 +0100 hde r265542 : #i97013 2008-12-16 14:20:24 +0100 od r265541 : #i70748# adjust documentation of "Which"-ID numbers 2008-12-16 14:19:49 +0100 od r265539 : #i70748# Adjust Attribute-Function-Mapping table due to new attribute 2008-12-16 14:06:24 +0100 od r265538 : #i70748# - Correct handling of to outline style assigned paragraph styles on reset of all paragraph style attributes - WW8 import: Consider refactoring of paragraph style's outline level attribute - NO_NUMBERING define no longer exsits. 2008-12-16 10:37:19 +0100 od r265530 : #i70478# Correction on moving outline paragraph up respectively down in its outline level: - Check also outline paragraph, which are not an outline via a to outline style assigned paragraph style, if action is applicable. 2008-12-16 09:10:13 +0100 hde r265523 : #i97277 2008-12-16 09:09:30 +0100 hde r265522 : #i97277 2008-12-16 09:07:40 +0100 hde r265521 : Added control and purged obsolete id's 2008-12-10 13:09:36 +0100 od r265174 : #i70748# correction of previous fix due to warning-free code 2008-12-10 13:03:30 +0100 od r265172 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - Due to performance issues avoid retrieving outline level value from paragraph's paragraph style for each paragraph. Instead retrieve current outline level value from paragraph, which is the inherited value from its paragraph style, and only when it is needed. 2008-12-09 16:50:36 +0100 ufi r265117 : help 2008-12-09 16:49:50 +0100 ufi r265116 : help 2008-12-09 15:45:05 +0100 od r265107 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - some minor rework and check access to paragraph styles 2008-12-09 15:42:04 +0100 od r265106 : #i70748# adjust name of local variable to avoid hiding of class variable 2008-12-09 15:40:51 +0100 od r265105 : #i70748# correct initialization order 2008-12-09 15:35:07 +0100 od r265101 : #i70748# remove duplicate entry in certain property map 2008-12-09 15:33:39 +0100 od r265100 : #i70748# add end of file token 2008-12-07 15:11:54 +0100 zhaojianwei r264952 : conflicts left not to be resolved when cws rebase 2008-12-04 14:52:21 +0100 zhaojianwei r264846 : CWS-TOOLING: rebase CWS outlinelevel to trunk@264325 (milestone: DEV300:m36) 2008-11-28 03:42:09 +0100 zhaojianwei r264525 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:39 +0100 zhaojianwei r264524 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:11 +0100 zhaojianwei r264523 : #i70748#: migrate CWS outlinelevel to SVN
2009-01-07 11:57:24 +00:00
pTxtColl->DeleteAssignmentToListLevelOfOutlineStyle();
pTxtColl->ResetFmtAttr(RES_PARATR_NUMRULE);
CWS-TOOLING: integrate CWS outlinelevel 2008-12-19 10:32:51 +0100 od r265718 : #i70748# method <SwWW8Writer::StartTOX(..)> - correction for custom to outline style assigned paragraph styles 2008-12-19 09:24:41 +0100 od r265715 : #i70748# method <HandleModifyAtTxtNode(..)> - retrieve former applied list style before potential reset of empty list style due to set outline level 2008-12-17 15:33:57 +0100 hde r265608 : #i97013# 2008-12-17 14:43:42 +0100 od r265603 : #i70748# adjust fix i44177 - adjustment of to outline style assigned paragraph styles only for OOo-Templates. 2008-12-17 12:59:42 +0100 od r265598 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - special handling of OOo 2.x document regarding outline numbering of headings. 2008-12-17 12:45:53 +0100 od r265597 : #i70748# method <HandleModifyAtTxtNode(..)> - correct determination of new and former applied list style 2008-12-17 10:18:41 +0100 od r265581 : #i97312# method <XMLTextNumRuleInfo::Set(..)> - check, if numbering rules instance contains any numbering rule. 2008-12-16 14:34:22 +0100 hde r265542 : #i97013 2008-12-16 14:20:24 +0100 od r265541 : #i70748# adjust documentation of "Which"-ID numbers 2008-12-16 14:19:49 +0100 od r265539 : #i70748# Adjust Attribute-Function-Mapping table due to new attribute 2008-12-16 14:06:24 +0100 od r265538 : #i70748# - Correct handling of to outline style assigned paragraph styles on reset of all paragraph style attributes - WW8 import: Consider refactoring of paragraph style's outline level attribute - NO_NUMBERING define no longer exsits. 2008-12-16 10:37:19 +0100 od r265530 : #i70478# Correction on moving outline paragraph up respectively down in its outline level: - Check also outline paragraph, which are not an outline via a to outline style assigned paragraph style, if action is applicable. 2008-12-16 09:10:13 +0100 hde r265523 : #i97277 2008-12-16 09:09:30 +0100 hde r265522 : #i97277 2008-12-16 09:07:40 +0100 hde r265521 : Added control and purged obsolete id's 2008-12-10 13:09:36 +0100 od r265174 : #i70748# correction of previous fix due to warning-free code 2008-12-10 13:03:30 +0100 od r265172 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - Due to performance issues avoid retrieving outline level value from paragraph's paragraph style for each paragraph. Instead retrieve current outline level value from paragraph, which is the inherited value from its paragraph style, and only when it is needed. 2008-12-09 16:50:36 +0100 ufi r265117 : help 2008-12-09 16:49:50 +0100 ufi r265116 : help 2008-12-09 15:45:05 +0100 od r265107 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - some minor rework and check access to paragraph styles 2008-12-09 15:42:04 +0100 od r265106 : #i70748# adjust name of local variable to avoid hiding of class variable 2008-12-09 15:40:51 +0100 od r265105 : #i70748# correct initialization order 2008-12-09 15:35:07 +0100 od r265101 : #i70748# remove duplicate entry in certain property map 2008-12-09 15:33:39 +0100 od r265100 : #i70748# add end of file token 2008-12-07 15:11:54 +0100 zhaojianwei r264952 : conflicts left not to be resolved when cws rebase 2008-12-04 14:52:21 +0100 zhaojianwei r264846 : CWS-TOOLING: rebase CWS outlinelevel to trunk@264325 (milestone: DEV300:m36) 2008-11-28 03:42:09 +0100 zhaojianwei r264525 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:39 +0100 zhaojianwei r264524 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:11 +0100 zhaojianwei r264523 : #i70748#: migrate CWS outlinelevel to SVN
2009-01-07 11:57:24 +00:00
if( aCollNames[i].Len() )
{
CWS-TOOLING: integrate CWS outlinelevel 2008-12-19 10:32:51 +0100 od r265718 : #i70748# method <SwWW8Writer::StartTOX(..)> - correction for custom to outline style assigned paragraph styles 2008-12-19 09:24:41 +0100 od r265715 : #i70748# method <HandleModifyAtTxtNode(..)> - retrieve former applied list style before potential reset of empty list style due to set outline level 2008-12-17 15:33:57 +0100 hde r265608 : #i97013# 2008-12-17 14:43:42 +0100 od r265603 : #i70748# adjust fix i44177 - adjustment of to outline style assigned paragraph styles only for OOo-Templates. 2008-12-17 12:59:42 +0100 od r265598 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - special handling of OOo 2.x document regarding outline numbering of headings. 2008-12-17 12:45:53 +0100 od r265597 : #i70748# method <HandleModifyAtTxtNode(..)> - correct determination of new and former applied list style 2008-12-17 10:18:41 +0100 od r265581 : #i97312# method <XMLTextNumRuleInfo::Set(..)> - check, if numbering rules instance contains any numbering rule. 2008-12-16 14:34:22 +0100 hde r265542 : #i97013 2008-12-16 14:20:24 +0100 od r265541 : #i70748# adjust documentation of "Which"-ID numbers 2008-12-16 14:19:49 +0100 od r265539 : #i70748# Adjust Attribute-Function-Mapping table due to new attribute 2008-12-16 14:06:24 +0100 od r265538 : #i70748# - Correct handling of to outline style assigned paragraph styles on reset of all paragraph style attributes - WW8 import: Consider refactoring of paragraph style's outline level attribute - NO_NUMBERING define no longer exsits. 2008-12-16 10:37:19 +0100 od r265530 : #i70478# Correction on moving outline paragraph up respectively down in its outline level: - Check also outline paragraph, which are not an outline via a to outline style assigned paragraph style, if action is applicable. 2008-12-16 09:10:13 +0100 hde r265523 : #i97277 2008-12-16 09:09:30 +0100 hde r265522 : #i97277 2008-12-16 09:07:40 +0100 hde r265521 : Added control and purged obsolete id's 2008-12-10 13:09:36 +0100 od r265174 : #i70748# correction of previous fix due to warning-free code 2008-12-10 13:03:30 +0100 od r265172 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - Due to performance issues avoid retrieving outline level value from paragraph's paragraph style for each paragraph. Instead retrieve current outline level value from paragraph, which is the inherited value from its paragraph style, and only when it is needed. 2008-12-09 16:50:36 +0100 ufi r265117 : help 2008-12-09 16:49:50 +0100 ufi r265116 : help 2008-12-09 15:45:05 +0100 od r265107 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - some minor rework and check access to paragraph styles 2008-12-09 15:42:04 +0100 od r265106 : #i70748# adjust name of local variable to avoid hiding of class variable 2008-12-09 15:40:51 +0100 od r265105 : #i70748# correct initialization order 2008-12-09 15:35:07 +0100 od r265101 : #i70748# remove duplicate entry in certain property map 2008-12-09 15:33:39 +0100 od r265100 : #i70748# add end of file token 2008-12-07 15:11:54 +0100 zhaojianwei r264952 : conflicts left not to be resolved when cws rebase 2008-12-04 14:52:21 +0100 zhaojianwei r264846 : CWS-TOOLING: rebase CWS outlinelevel to trunk@264325 (milestone: DEV300:m36) 2008-11-28 03:42:09 +0100 zhaojianwei r264525 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:39 +0100 zhaojianwei r264524 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:11 +0100 zhaojianwei r264523 : #i70748#: migrate CWS outlinelevel to SVN
2009-01-07 11:57:24 +00:00
pTxtColl = rWrtSh.GetParaStyle(
aCollNames[i], SwWrtShell::GETSTYLE_CREATESOME);
if(pTxtColl)
{
pTxtColl->AssignToListLevelOfOutlineStyle(i);
SwNumRuleItem aItem(pOutlineRule->GetName());
pTxtColl->SetFmtAttr(aItem);
}
}
}//<--end,zhaojianwei
}
}
rWrtSh.SetOutlineNumRule( *pNumRule);
// --> OD 2006-12-11 #130443#
rWrtSh.EndAction();
// <--
2000-09-18 16:15:01 +00:00
return RET_OK;
}
SwOutlineSettingsTabPage::SwOutlineSettingsTabPage(Window* pParent, const SfxItemSet& rSet) :
SfxTabPage(pParent, SW_RES(TP_OUTLINE_NUM), rSet),
aLevelFL( this, SW_RES(FL_LEVEL )),
2011-02-21 18:43:22 +01:00
aLevelLB( this, SW_RES(LB_LEVEL )),
aNumberFL(this, SW_RES(FL_NUMBER)),
2000-09-18 16:15:01 +00:00
aCollLbl(this, SW_RES(FT_COLL)),
aCollBox(this, SW_RES(LB_COLL)),
aNumberLbl(this, SW_RES(FT_NUMBER)),
aNumberBox(this, SW_RES(LB_NUMBER), INSERT_NUM_TYPE_NO_NUMBERING|INSERT_NUM_EXTENDED_TYPES),
2000-09-18 16:15:01 +00:00
aCharFmtFT(this, SW_RES(FT_CHARFMT)),
aCharFmtLB(this, SW_RES(LB_CHARFMT)),
aAllLevelFT( this, SW_RES(FT_ALL_LEVEL)),
aAllLevelNF( this, SW_RES(NF_ALL_LEVEL)),
2000-09-18 16:15:01 +00:00
aDelim(this, SW_RES(FT_DELIM)),
aPrefixFT(this, SW_RES(FT_PREFIX)),
aPrefixED(this, SW_RES(ED_PREFIX)),
aSuffixFT(this, SW_RES(FT_SUFFIX)),
aSuffixED(this, SW_RES(ED_SUFFIX)),
aStartLbl(this, SW_RES(FT_START)),
aStartEdit(this, SW_RES(ED_START)),
aPreviewWIN( this, SW_RES(WIN_PREVIEW )),
2000-09-18 16:15:01 +00:00
aNoFmtName(SW_RES(ST_NO_COLL)),
pSh(0),
2000-09-18 16:15:01 +00:00
pCollNames(0),
nActLevel(1)
2000-09-18 16:15:01 +00:00
{
FreeResource();
SetExchangeSupport();
aCollBox.InsertEntry(aNoFmtName);
aLevelLB.SetSelectHdl(LINK(this, SwOutlineSettingsTabPage, LevelHdl));
aAllLevelNF.SetModifyHdl(LINK(this, SwOutlineSettingsTabPage, ToggleComplete));
aCollBox.SetSelectHdl(LINK(this, SwOutlineSettingsTabPage, CollSelect));
aCollBox.SetGetFocusHdl(LINK(this, SwOutlineSettingsTabPage, CollSelectGetFocus));
aNumberBox.SetSelectHdl(LINK(this, SwOutlineSettingsTabPage, NumberSelect));
aPrefixED.SetModifyHdl(LINK(this, SwOutlineSettingsTabPage, DelimModify));
aSuffixED.SetModifyHdl(LINK(this, SwOutlineSettingsTabPage, DelimModify));
aStartEdit.SetModifyHdl(LINK(this, SwOutlineSettingsTabPage, StartModified));
aCharFmtLB.SetSelectHdl(LINK(this, SwOutlineSettingsTabPage, CharFmtHdl));
2000-09-18 16:15:01 +00:00
}
2010-10-12 17:05:15 +01:00
2000-09-18 16:15:01 +00:00
void SwOutlineSettingsTabPage::Update()
{
// falls eine Vorlage fuer diese Ebene bereits selektiert wurde,
// diese in der ListBox auswaehlean
aCollBox.Enable(USHRT_MAX != nActLevel);
if(USHRT_MAX == nActLevel)
{
sal_Bool bSamePrefix = sal_True;
sal_Bool bSameSuffix = sal_True;
sal_Bool bSameType = sal_True;
sal_Bool bSameComplete = sal_True;
sal_Bool bSameStart = sal_True;
sal_Bool bSameCharFmt = sal_True;
2000-09-18 16:15:01 +00:00
const SwNumFmt* aNumFmtArr[MAXLEVEL];
const SwCharFmt* pFirstFmt = 0;
for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
2000-09-18 16:15:01 +00:00
{
aNumFmtArr[ i ] = &pNumRule->Get(i);
if(i == 0)
pFirstFmt = aNumFmtArr[i]->GetCharFmt();
else
{
bSameType &= aNumFmtArr[i]->GetNumberingType() == aNumFmtArr[0]->GetNumberingType();
bSameStart &= aNumFmtArr[i]->GetStart() == aNumFmtArr[0]->GetStart();
2000-09-18 16:15:01 +00:00
bSamePrefix &= aNumFmtArr[i]->GetPrefix() == aNumFmtArr[0]->GetPrefix();
bSameSuffix &= aNumFmtArr[i]->GetSuffix() == aNumFmtArr[0]->GetSuffix();
bSameComplete &= aNumFmtArr[i]->GetIncludeUpperLevels() == aNumFmtArr[0]->GetIncludeUpperLevels();
2000-09-18 16:15:01 +00:00
const SwCharFmt* pFmt = aNumFmtArr[i]->GetCharFmt();
2010-11-06 10:30:17 -05:00
bSameCharFmt &= (!pFirstFmt && !pFmt)
|| (pFirstFmt && pFmt && pFmt->GetName() == pFirstFmt->GetName());
2000-09-18 16:15:01 +00:00
}
}
CheckForStartValue_Impl(aNumFmtArr[0]->GetNumberingType());
2000-09-18 16:15:01 +00:00
if(bSameType)
2001-10-08 12:52:46 +00:00
aNumberBox.SelectNumberingType( aNumFmtArr[0]->GetNumberingType() );
2000-09-18 16:15:01 +00:00
else
aNumberBox.SetNoSelection();
if(bSameStart)
aStartEdit.SetValue(aNumFmtArr[0]->GetStart());
2000-09-18 16:15:01 +00:00
else
aStartEdit.SetText(aEmptyStr);
if(bSamePrefix)
aPrefixED.SetText(aNumFmtArr[0]->GetPrefix());
else
aPrefixED.SetText(aEmptyStr);
if(bSameSuffix)
aSuffixED.SetText(aNumFmtArr[0]->GetSuffix());
2000-09-18 16:15:01 +00:00
else
aSuffixED.SetText(aEmptyStr);
if(bSameCharFmt)
{
if(pFirstFmt)
aCharFmtLB.SelectEntry(pFirstFmt->GetName());
else
aCharFmtLB.SelectEntry( ViewShell::GetShellRes()->aStrNone );
}
else
aCharFmtLB.SetNoSelection();
aAllLevelFT.Enable(sal_True);
aAllLevelNF.Enable(sal_True);
2000-09-18 16:15:01 +00:00
aAllLevelNF.SetMax(MAXLEVEL);
if(bSameComplete)
{
aAllLevelNF.SetValue(aNumFmtArr[0]->GetIncludeUpperLevels());
2000-09-18 16:15:01 +00:00
}
else
{
aAllLevelNF.SetText(aEmptyStr);
}
}
else
{
sal_uInt16 nTmpLevel = lcl_BitToLevel(nActLevel);
2000-09-18 16:15:01 +00:00
String aColl(pCollNames[nTmpLevel]);
if(aColl.Len())
aCollBox.SelectEntry(aColl);
else
aCollBox.SelectEntry(aNoFmtName);
const SwNumFmt &rFmt = pNumRule->Get(nTmpLevel);
2001-10-08 12:52:46 +00:00
aNumberBox.SelectNumberingType( rFmt.GetNumberingType() );
2000-09-18 16:15:01 +00:00
aPrefixED.SetText(rFmt.GetPrefix());
aSuffixED.SetText(rFmt.GetSuffix());
2000-09-18 16:15:01 +00:00
const SwCharFmt* pFmt = rFmt.GetCharFmt();
if(pFmt)
aCharFmtLB.SelectEntry(pFmt->GetName());
else
aCharFmtLB.SelectEntry( ViewShell::GetShellRes()->aStrNone );
if(nTmpLevel)
{
aAllLevelFT.Enable(sal_True);
aAllLevelNF.Enable(sal_True);
2000-09-18 16:15:01 +00:00
aAllLevelNF.SetMax(nTmpLevel + 1);
aAllLevelNF.SetValue(rFmt.GetIncludeUpperLevels());
2000-09-18 16:15:01 +00:00
}
else
{
aAllLevelNF.SetText(aEmptyStr);
aAllLevelNF.Enable(sal_False);
aAllLevelFT.Enable(sal_False);
2000-09-18 16:15:01 +00:00
}
CheckForStartValue_Impl(rFmt.GetNumberingType());
aStartEdit.SetValue( rFmt.GetStart() );
2000-09-18 16:15:01 +00:00
}
SetModified();
}
IMPL_LINK( SwOutlineSettingsTabPage, LevelHdl, ListBox *, pBox )
{
nActLevel = 0;
if(pBox->IsEntryPosSelected( MAXLEVEL ))
{
nActLevel = 0xFFFF;
}
else
{
sal_uInt16 nMask = 1;
for( sal_uInt16 i = 0; i < MAXLEVEL; i++ )
2000-09-18 16:15:01 +00:00
{
if(pBox->IsEntryPosSelected( i ))
nActLevel |= nMask;
nMask <<= 1;
}
}
Update();
return 0;
}
2010-10-12 17:05:15 +01:00
2000-09-18 16:15:01 +00:00
IMPL_LINK( SwOutlineSettingsTabPage, ToggleComplete, NumericField *, pFld )
{
sal_uInt16 nMask = 1;
for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
2000-09-18 16:15:01 +00:00
{
if(nActLevel & nMask)
{
SwNumFmt aNumFmt(pNumRule->Get(i));
aNumFmt.SetIncludeUpperLevels( Min( (sal_uInt8)pFld->GetValue(),
(sal_uInt8)(i + 1)) );
2000-09-18 16:15:01 +00:00
pNumRule->Set(i, aNumFmt);
}
nMask <<= 1;
}
SetModified();
return 0;
}
2010-10-12 17:05:15 +01:00
2000-09-18 16:15:01 +00:00
IMPL_LINK( SwOutlineSettingsTabPage, CollSelect, ListBox *, pBox )
{
sal_uInt8 i;
2000-09-18 16:15:01 +00:00
const String aCollName(pBox->GetSelectEntry());
//0xFFFF darf hier nicht sein (disable)
sal_uInt16 nTmpLevel = lcl_BitToLevel(nActLevel);
2000-09-18 16:15:01 +00:00
String sOldName( pCollNames[nTmpLevel] );
for( i = 0; i < MAXLEVEL; ++i)
pCollNames[i] = aSaveCollNames[i];
if(aCollName == aNoFmtName)
pCollNames[nTmpLevel] = aEmptyStr;
else
{
pCollNames[nTmpLevel] = aCollName;
// wird die Vorlage bereits verwendet ?
for( i = 0; i < MAXLEVEL; ++i)
if(i != nTmpLevel && pCollNames[i] == aCollName )
pCollNames[i] = aEmptyStr;
}
// search the oldname and put it into the current entries
if( sOldName.Len() )
for( i = 0; i < MAXLEVEL; ++i)
if( aSaveCollNames[ i ] == sOldName && i != nTmpLevel &&
!pCollNames[ i ].Len() )
{
sal_uInt8 n;
2000-09-18 16:15:01 +00:00
for( n = 0; n < MAXLEVEL; ++n )
if( pCollNames[ n ] == sOldName )
break;
if( MAXLEVEL == n )
// it was a outline leveld name and the current entries is zero.
pCollNames[ i ] = sOldName;
}
SetModified();
return 0;
}
IMPL_LINK( SwOutlineSettingsTabPage, CollSelectGetFocus, ListBox *, EMPTYARG )
2000-09-18 16:15:01 +00:00
{
for( sal_uInt8 i = 0; i < MAXLEVEL; ++i)
2000-09-18 16:15:01 +00:00
aSaveCollNames[i] = pCollNames[i];
return 0;
}
2001-03-02 13:10:47 +00:00
IMPL_LINK( SwOutlineSettingsTabPage, NumberSelect, SwNumberingTypeListBox *, pBox )
2000-09-18 16:15:01 +00:00
{
sal_uInt16 nMask = 1;
2010-11-27 09:02:53 +01:00
sal_Int16 nNumberType = pBox->GetSelectedNumberingType();
for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
2000-09-18 16:15:01 +00:00
{
if(nActLevel & nMask)
{
SwNumFmt aNumFmt(pNumRule->Get(i));
aNumFmt.SetNumberingType(nNumberType);
2000-09-18 16:15:01 +00:00
pNumRule->Set(i, aNumFmt);
CheckForStartValue_Impl(nNumberType);
2000-09-18 16:15:01 +00:00
}
nMask <<= 1;
}
SetModified();
return 0;
}
2010-10-12 17:05:15 +01:00
IMPL_LINK( SwOutlineSettingsTabPage, DelimModify, Edit *, EMPTYARG )
2000-09-18 16:15:01 +00:00
{
sal_uInt16 nMask = 1;
for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
2000-09-18 16:15:01 +00:00
{
if(nActLevel & nMask)
{
SwNumFmt aNumFmt(pNumRule->Get(i));
aNumFmt.SetPrefix( aPrefixED.GetText() );
aNumFmt.SetSuffix( aSuffixED.GetText() );
2000-09-18 16:15:01 +00:00
pNumRule->Set(i, aNumFmt);
}
nMask <<= 1;
}
SetModified();
return 0;
}
2010-10-12 17:05:15 +01:00
2000-09-18 16:15:01 +00:00
IMPL_LINK( SwOutlineSettingsTabPage, StartModified, NumericField *, pFld )
{
sal_uInt16 nMask = 1;
for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
2000-09-18 16:15:01 +00:00
{
if(nActLevel & nMask)
{
SwNumFmt aNumFmt(pNumRule->Get(i));
aNumFmt.SetStart( (sal_uInt16)pFld->GetValue() );
2000-09-18 16:15:01 +00:00
pNumRule->Set(i, aNumFmt);
}
nMask <<= 1;
}
SetModified();
2000-09-18 16:15:01 +00:00
return 0;
}
2010-10-12 17:05:15 +01:00
2000-09-18 16:15:01 +00:00
IMPL_LINK( SwOutlineSettingsTabPage, CharFmtHdl, ListBox *, EMPTYARG )
{
String sEntry = aCharFmtLB.GetSelectEntry();
sal_uInt16 nMask = 1;
sal_Bool bFormatNone = sEntry == ViewShell::GetShellRes()->aStrNone;
2000-09-18 16:15:01 +00:00
SwCharFmt* pFmt = 0;
if(!bFormatNone)
{
sal_uInt16 nChCount = pSh->GetCharFmtCount();
for(sal_uInt16 i = 0; i < nChCount; i++)
2000-09-18 16:15:01 +00:00
{
SwCharFmt& rChFmt = pSh->GetCharFmt(i);
if(rChFmt.GetName() == sEntry)
{
pFmt = &rChFmt;
break;
}
}
if(!pFmt)
{
SfxStyleSheetBasePool* pPool = pSh->GetView().GetDocShell()->GetStyleSheetPool();
SfxStyleSheetBase* pBase;
pBase = pPool->Find(sEntry, SFX_STYLE_FAMILY_CHAR);
if(!pBase)
pBase = &pPool->Make(sEntry, SFX_STYLE_FAMILY_PAGE);
pFmt = ((SwDocStyleSheet*)pBase)->GetCharFmt();
}
}
for(sal_uInt16 i = 0; i < MAXLEVEL; i++)
2000-09-18 16:15:01 +00:00
{
if(nActLevel & nMask)
{
SwNumFmt aNumFmt(pNumRule->Get(i));
if(bFormatNone)
aNumFmt.SetCharFmt(0);
else
aNumFmt.SetCharFmt(pFmt);
pNumRule->Set(i, aNumFmt);
}
nMask <<= 1;
}
return RET_OK;
}
2010-10-12 17:05:15 +01:00
2000-09-18 16:15:01 +00:00
SwOutlineSettingsTabPage::~SwOutlineSettingsTabPage()
{
}
2010-10-12 17:05:15 +01:00
2000-09-18 16:15:01 +00:00
void SwOutlineSettingsTabPage::SetWrtShell(SwWrtShell* pShell)
{
pSh = pShell;
// Erfragen der NumRules dieses Dokumentes
pNumRule = ((SwOutlineTabDialog*)GetTabDialog())->GetNumRule();
pCollNames = ((SwOutlineTabDialog*)GetTabDialog())->GetCollNames();
aPreviewWIN.SetNumRule(pNumRule);
aPreviewWIN.SetOutlineNames(pCollNames);
// Startwert setzen - nActLevel muss hier 1 sein
sal_uInt16 nTmpLevel = lcl_BitToLevel(nActLevel);
2000-09-18 16:15:01 +00:00
const SwNumFmt& rNumFmt = pNumRule->Get( nTmpLevel );
aStartEdit.SetValue( rNumFmt.GetStart() );
2000-09-18 16:15:01 +00:00
// Poolformate fuer Ueberschriften anlegen
String sStr;
sal_uInt16 i;
2000-09-18 16:15:01 +00:00
for( i = 0; i < MAXLEVEL; ++i )
{
aCollBox.InsertEntry( SwStyleNameMapper::GetUIName(
static_cast< sal_uInt16 >(RES_POOLCOLL_HEADLINE1 + i), aEmptyStr ));
2000-09-18 16:15:01 +00:00
aLevelLB.InsertEntry( String::CreateFromInt32(i + 1) );
}
sStr.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "1 - " ));
sStr += String::CreateFromInt32(MAXLEVEL);
aLevelLB.InsertEntry( sStr );
// Erfragen der Gliederungsebenen der Textvorlagen
const sal_uInt16 nCount = pSh->GetTxtFmtCollCount();
2000-09-18 16:15:01 +00:00
for( i = 0; i < nCount; ++i )
{
SwTxtFmtColl &rTxtColl = pSh->GetTxtFmtColl(i);
if(!rTxtColl.IsDefault())
{
sStr = rTxtColl.GetName();
if(LISTBOX_ENTRY_NOTFOUND == aCollBox.GetEntryPos( sStr ))
aCollBox.InsertEntry( sStr );
}
}
2001-10-08 12:52:46 +00:00
aNumberBox.SelectNumberingType(rNumFmt.GetNumberingType());
sal_uInt16 nOutlinePos = pSh->GetOutlinePos(MAXLEVEL);
sal_uInt16 nTmp = 0;
2000-09-18 16:15:01 +00:00
if(nOutlinePos != USHRT_MAX)
{
nTmp = static_cast<sal_uInt16>(pSh->getIDocumentOutlineNodesAccess()->getOutlineLevel(nOutlinePos));
2000-09-18 16:15:01 +00:00
}
CWS-TOOLING: integrate CWS outlinelevel 2008-12-19 10:32:51 +0100 od r265718 : #i70748# method <SwWW8Writer::StartTOX(..)> - correction for custom to outline style assigned paragraph styles 2008-12-19 09:24:41 +0100 od r265715 : #i70748# method <HandleModifyAtTxtNode(..)> - retrieve former applied list style before potential reset of empty list style due to set outline level 2008-12-17 15:33:57 +0100 hde r265608 : #i97013# 2008-12-17 14:43:42 +0100 od r265603 : #i70748# adjust fix i44177 - adjustment of to outline style assigned paragraph styles only for OOo-Templates. 2008-12-17 12:59:42 +0100 od r265598 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - special handling of OOo 2.x document regarding outline numbering of headings. 2008-12-17 12:45:53 +0100 od r265597 : #i70748# method <HandleModifyAtTxtNode(..)> - correct determination of new and former applied list style 2008-12-17 10:18:41 +0100 od r265581 : #i97312# method <XMLTextNumRuleInfo::Set(..)> - check, if numbering rules instance contains any numbering rule. 2008-12-16 14:34:22 +0100 hde r265542 : #i97013 2008-12-16 14:20:24 +0100 od r265541 : #i70748# adjust documentation of "Which"-ID numbers 2008-12-16 14:19:49 +0100 od r265539 : #i70748# Adjust Attribute-Function-Mapping table due to new attribute 2008-12-16 14:06:24 +0100 od r265538 : #i70748# - Correct handling of to outline style assigned paragraph styles on reset of all paragraph style attributes - WW8 import: Consider refactoring of paragraph style's outline level attribute - NO_NUMBERING define no longer exsits. 2008-12-16 10:37:19 +0100 od r265530 : #i70478# Correction on moving outline paragraph up respectively down in its outline level: - Check also outline paragraph, which are not an outline via a to outline style assigned paragraph style, if action is applicable. 2008-12-16 09:10:13 +0100 hde r265523 : #i97277 2008-12-16 09:09:30 +0100 hde r265522 : #i97277 2008-12-16 09:07:40 +0100 hde r265521 : Added control and purged obsolete id's 2008-12-10 13:09:36 +0100 od r265174 : #i70748# correction of previous fix due to warning-free code 2008-12-10 13:03:30 +0100 od r265172 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - Due to performance issues avoid retrieving outline level value from paragraph's paragraph style for each paragraph. Instead retrieve current outline level value from paragraph, which is the inherited value from its paragraph style, and only when it is needed. 2008-12-09 16:50:36 +0100 ufi r265117 : help 2008-12-09 16:49:50 +0100 ufi r265116 : help 2008-12-09 15:45:05 +0100 od r265107 : #i70748# method <XMLTextImportHelper::SetStyleAndAttrs(..)> - some minor rework and check access to paragraph styles 2008-12-09 15:42:04 +0100 od r265106 : #i70748# adjust name of local variable to avoid hiding of class variable 2008-12-09 15:40:51 +0100 od r265105 : #i70748# correct initialization order 2008-12-09 15:35:07 +0100 od r265101 : #i70748# remove duplicate entry in certain property map 2008-12-09 15:33:39 +0100 od r265100 : #i70748# add end of file token 2008-12-07 15:11:54 +0100 zhaojianwei r264952 : conflicts left not to be resolved when cws rebase 2008-12-04 14:52:21 +0100 zhaojianwei r264846 : CWS-TOOLING: rebase CWS outlinelevel to trunk@264325 (milestone: DEV300:m36) 2008-11-28 03:42:09 +0100 zhaojianwei r264525 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:39 +0100 zhaojianwei r264524 : #i70748#: migrate CWS outlinelevel to SVN 2008-11-28 03:41:11 +0100 zhaojianwei r264523 : #i70748#: migrate CWS outlinelevel to SVN
2009-01-07 11:57:24 +00:00
aLevelLB.SelectEntryPos(nTmp-1);//nTmp);//#outline level,zhaojianwei
2000-09-18 16:15:01 +00:00
// Zeichenvorlagen sammeln
aCharFmtLB.Clear();
aCharFmtLB.InsertEntry( ViewShell::GetShellRes()->aStrNone );
// Zeichenvorlagen
::FillCharStyleListBox(aCharFmtLB,
pSh->GetView().GetDocShell());
Update();
}
2010-10-12 17:05:15 +01:00
void SwOutlineSettingsTabPage::ActivatePage(const SfxItemSet& )
2000-09-18 16:15:01 +00:00
{
nActLevel = SwOutlineTabDialog::GetActNumLevel();
2000-09-18 16:15:01 +00:00
if(nActLevel != USHRT_MAX)
aLevelLB.SelectEntryPos(lcl_BitToLevel(nActLevel));
else
aLevelLB.SelectEntryPos(MAXLEVEL);
LevelHdl(&aLevelLB);
}
2010-10-12 17:05:15 +01:00
int SwOutlineSettingsTabPage::DeactivatePage(SfxItemSet*)
2000-09-18 16:15:01 +00:00
{
SwOutlineTabDialog::SetActNumLevel(nActLevel);
2000-09-18 16:15:01 +00:00
return LEAVE_PAGE;
}
2010-10-12 17:05:15 +01:00
sal_Bool SwOutlineSettingsTabPage::FillItemSet( SfxItemSet& )
2000-09-18 16:15:01 +00:00
{
return sal_True;
2000-09-18 16:15:01 +00:00
}
2010-10-12 17:05:15 +01:00
2000-09-18 16:15:01 +00:00
void SwOutlineSettingsTabPage::Reset( const SfxItemSet& rSet )
{
ActivatePage(rSet);
}
2010-10-12 17:05:15 +01:00
2000-09-18 16:15:01 +00:00
SfxTabPage* SwOutlineSettingsTabPage::Create( Window* pParent,
const SfxItemSet& rAttrSet)
{
return new SwOutlineSettingsTabPage(pParent, rAttrSet);
}
2010-10-12 17:05:15 +01:00
void SwOutlineSettingsTabPage::CheckForStartValue_Impl(sal_uInt16 nNumberingType)
{
sal_Bool bIsNull = aStartEdit.GetValue() == 0;
sal_Bool bNoZeroAllowed = nNumberingType < SVX_NUM_ARABIC ||
SVX_NUM_CHARS_UPPER_LETTER_N == nNumberingType ||
SVX_NUM_CHARS_LOWER_LETTER_N == nNumberingType;
aStartEdit.SetMin(bNoZeroAllowed ? 1 : 0);
if(bIsNull && bNoZeroAllowed)
aStartEdit.GetModifyHdl().Call(&aStartEdit);
}
2000-09-18 16:15:01 +00:00
sal_uInt16 lcl_DrawBullet(VirtualDevice* pVDev,
const SwNumFmt& rFmt, sal_uInt16 nXStart,
sal_uInt16 nYStart, const Size& rSize)
2000-09-18 16:15:01 +00:00
{
Font aTmpFont(pVDev->GetFont());
Font aFont(*rFmt.GetBulletFont());
aFont.SetSize(rSize);
aFont.SetTransparent(sal_True);
2000-09-18 16:15:01 +00:00
pVDev->SetFont( aFont );
String aText(rFmt.GetBulletChar());
pVDev->DrawText( Point(nXStart, nYStart), aText );
sal_uInt16 nRet = (sal_uInt16)pVDev->GetTextWidth(aText);
2000-09-18 16:15:01 +00:00
pVDev->SetFont(aTmpFont);
return nRet;
}
sal_uInt16 lcl_DrawGraphic(VirtualDevice* pVDev, const SwNumFmt &rFmt, sal_uInt16 nXStart,
sal_uInt16 nYStart, sal_uInt16 nDivision)
2000-09-18 16:15:01 +00:00
{
const SvxBrushItem* pBrushItem = rFmt.GetBrush();
sal_uInt16 nRet = 0;
2000-09-18 16:15:01 +00:00
if(pBrushItem)
{
const Graphic* pGrf = pBrushItem->GetGraphic();
if(pGrf)
{
Size aGSize( rFmt.GetGraphicSize());
2000-09-18 16:15:01 +00:00
aGSize.Width() /= nDivision;
nRet = (sal_uInt16)aGSize.Width();
2000-09-18 16:15:01 +00:00
aGSize.Height() /= nDivision;
pGrf->Draw( pVDev, Point(nXStart,nYStart),
pVDev->PixelToLogic( aGSize ) );
}
}
return nRet;
}
2010-10-12 17:05:15 +01:00
/*--------------------------------------------------
2000-09-18 16:15:01 +00:00
Vorschau der Numerierung painten
--------------------------------------------------*/
void NumberingPreview::Paint( const Rectangle& /*rRect*/ )
2000-09-18 16:15:01 +00:00
{
Size aSize(PixelToLogic(GetOutputSizePixel()));
Rectangle aRect(Point(0,0), aSize);
VirtualDevice* pVDev = new VirtualDevice(*this);
pVDev->SetMapMode(GetMapMode());
pVDev->SetOutputSize( aSize );
// #101524# OJ
pVDev->SetFillColor( GetSettings().GetStyleSettings().GetWindowColor() );
pVDev->SetLineColor( GetSettings().GetStyleSettings().GetButtonTextColor() );
2000-09-18 16:15:01 +00:00
pVDev->DrawRect(aRect);
if(pActNum)
{
sal_uInt16 nWidthRelation;
2000-09-18 16:15:01 +00:00
if(nPageWidth)
{
nWidthRelation = sal_uInt16 (nPageWidth / aSize.Width());
2000-09-18 16:15:01 +00:00
if(bPosition)
nWidthRelation = nWidthRelation * 2 / 3;
else
nWidthRelation = nWidthRelation / 4;
}
else
nWidthRelation = 30; // Kapiteldialog
//Hoehe pro Ebene
sal_uInt16 nXStep = sal_uInt16(aSize.Width() / (3 * MAXLEVEL));
2000-09-18 16:15:01 +00:00
if(MAXLEVEL < 10)
nXStep /= 2;
sal_uInt16 nYStart = 4;
sal_uInt16 nYStep = sal_uInt16((aSize.Height() - 6)/ MAXLEVEL);
aStdFont = OutputDevice::GetDefaultFont(
DEFAULTFONT_UI_SANS, (LanguageType)GetAppLanguage(),
DEFAULTFONT_FLAGS_ONLYONE, this );
// #101524# OJ
2002-12-10 08:46:06 +00:00
aStdFont.SetColor( SwViewOption::GetFontColor() );
2000-09-18 16:15:01 +00:00
sal_uInt16 nFontHeight = nYStep * 6 / 10;
2000-09-18 16:15:01 +00:00
if(bPosition)
nFontHeight = nYStep * 15 / 10;
aStdFont.SetSize(Size( 0, nFontHeight ));
sal_uInt16 nPreNum = pActNum->Get(0).GetStart();
2000-09-18 16:15:01 +00:00
if(bPosition)
{
sal_uInt16 nLineHeight = nFontHeight * 8 / 7;
sal_uInt8 nStart = 0;
2000-09-18 16:15:01 +00:00
while( !(nActLevel & (1<<nStart)) )
{
nStart++;
}
if(nStart) // damit moeglichs Vorgaenger und Nachfolger gezeigt werden
nStart--;
SwNumberTree::tNumberVector aNumVector;
sal_uInt8 nEnd = Min( (sal_uInt8)(nStart + 3), MAXLEVEL );
for( sal_uInt8 nLevel = nStart; nLevel < nEnd; ++nLevel )
2000-09-18 16:15:01 +00:00
{
const SwNumFmt &rFmt = pActNum->Get(nLevel);
aNumVector.push_back(rFmt.GetStart());
2000-09-18 16:15:01 +00:00
sal_uInt16 nXStart( 0 );
short nTextOffset( 0 );
sal_uInt16 nNumberXPos( 0 );
if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
nXStart = rFmt.GetAbsLSpace() / nWidthRelation;
nTextOffset = rFmt.GetCharTextDistance() / nWidthRelation;
nNumberXPos = nXStart;
sal_uInt16 nFirstLineOffset = (-rFmt.GetFirstLineOffset()) / nWidthRelation;
if(nFirstLineOffset <= nNumberXPos)
nNumberXPos = nNumberXPos - nFirstLineOffset;
else
nNumberXPos = 0;
}
else if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
{
const long nTmpNumberXPos( ( rFmt.GetIndentAt() +
rFmt.GetFirstLineIndent() ) /
nWidthRelation );
if ( nTmpNumberXPos < 0 )
{
nNumberXPos = 0;
}
else
{
nNumberXPos = static_cast<sal_uInt16>(nTmpNumberXPos);
}
}
2000-09-18 16:15:01 +00:00
sal_uInt16 nBulletWidth = 0;
if( SVX_NUM_BITMAP == rFmt.GetNumberingType() )
2000-09-18 16:15:01 +00:00
{
nBulletWidth = lcl_DrawGraphic(pVDev, rFmt,
nNumberXPos,
nYStart, nWidthRelation);
}
else if( SVX_NUM_CHAR_SPECIAL == rFmt.GetNumberingType() )
2000-09-18 16:15:01 +00:00
{
nBulletWidth = lcl_DrawBullet(pVDev, rFmt, nNumberXPos, nYStart, aStdFont.GetSize());
}
else
{
pVDev->SetFont(aStdFont);
if(pActNum->IsContinusNum())
aNumVector[nLevel] = nPreNum;
// --> OD 2005-11-17 #128041#
String aText(pActNum->MakeNumString( aNumVector ));
// <--
2000-09-18 16:15:01 +00:00
pVDev->DrawText( Point(nNumberXPos, nYStart), aText );
nBulletWidth = (sal_uInt16)pVDev->GetTextWidth(aText);
2000-09-18 16:15:01 +00:00
nPreNum++;
}
if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT &&
rFmt.GetLabelFollowedBy() == SvxNumberFormat::SPACE )
{
pVDev->SetFont(aStdFont);
String aText(' ');
pVDev->DrawText( Point(nNumberXPos, nYStart), aText );
nBulletWidth = nBulletWidth + (sal_uInt16)pVDev->GetTextWidth(aText);
}
sal_uInt16 nTextXPos( 0 );
if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
nTextXPos = nXStart;
if(nTextOffset < 0)
nTextXPos = nTextXPos + nTextOffset;
if(nNumberXPos + nBulletWidth + nTextOffset > nTextXPos )
nTextXPos = nNumberXPos + nBulletWidth + nTextOffset;
}
else if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
{
switch ( rFmt.GetLabelFollowedBy() )
{
case SvxNumberFormat::LISTTAB:
{
nTextXPos = static_cast<sal_uInt16>(
rFmt.GetListtabPos() / nWidthRelation );
if ( nTextXPos < nNumberXPos + nBulletWidth )
{
nTextXPos = nNumberXPos + nBulletWidth;
}
}
break;
case SvxNumberFormat::SPACE:
case SvxNumberFormat::NOTHING:
{
nTextXPos = nNumberXPos + nBulletWidth;
}
break;
}
nXStart = static_cast<sal_uInt16>( rFmt.GetIndentAt() / nWidthRelation );
}
2000-09-18 16:15:01 +00:00
Rectangle aRect1(Point(nTextXPos, nYStart + nFontHeight / 2), Size(aSize.Width() / 2, 2));
pVDev->SetFillColor( GetSettings().GetStyleSettings().GetWindowColor() ); // Color( COL_BLACK ) );
2000-09-18 16:15:01 +00:00
pVDev->DrawRect( aRect1 );
Rectangle aRect2(Point(nXStart, nYStart + nLineHeight + nFontHeight / 2 ), Size(aSize.Width() / 2, 2));
pVDev->DrawRect( aRect2 );
nYStart += 2 * nLineHeight;
}
}
else
{
SwNumberTree::tNumberVector aNumVector;
sal_uInt16 nLineHeight = nFontHeight * 3 / 2;
for( sal_uInt8 nLevel = 0; nLevel < MAXLEVEL;
++nLevel, nYStart = nYStart + nYStep )
2000-09-18 16:15:01 +00:00
{
const SwNumFmt &rFmt = pActNum->Get(nLevel);
aNumVector.push_back(rFmt.GetStart());
sal_uInt16 nXStart( 0 );
if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
nXStart = rFmt.GetAbsLSpace() / nWidthRelation;
}
else if ( rFmt.GetPositionAndSpaceMode() == SvxNumberFormat::LABEL_ALIGNMENT )
{
const long nTmpXStart( ( rFmt.GetIndentAt() +
rFmt.GetFirstLineIndent() ) /
nWidthRelation );
if ( nTmpXStart < 0 )
{
nXStart = 0;
}
else
{
nXStart = static_cast<sal_uInt16>(nTmpXStart);
}
}
nXStart /= 2;
nXStart += 2;
sal_uInt16 nTextOffset = 2 * nXStep;
if( SVX_NUM_BITMAP == rFmt.GetNumberingType() )
2000-09-18 16:15:01 +00:00
{
lcl_DrawGraphic(pVDev, rFmt, nXStart, nYStart, nWidthRelation);
nTextOffset = nLineHeight + nXStep;
}
else if( SVX_NUM_CHAR_SPECIAL == rFmt.GetNumberingType() )
2000-09-18 16:15:01 +00:00
{
nTextOffset = lcl_DrawBullet(pVDev, rFmt, nXStart, nYStart, aStdFont.GetSize());
nTextOffset = nTextOffset + nXStep;
2000-09-18 16:15:01 +00:00
}
else
{
pVDev->SetFont(aStdFont);
if(pActNum->IsContinusNum())
aNumVector[nLevel] = nPreNum;
// --> OD 2005-11-17 #128041#
String aText(pActNum->MakeNumString( aNumVector ));
// <--
2000-09-18 16:15:01 +00:00
pVDev->DrawText( Point(nXStart, nYStart), aText );
nTextOffset = (sal_uInt16)pVDev->GetTextWidth(aText);
nTextOffset = nTextOffset + nXStep;
2000-09-18 16:15:01 +00:00
nPreNum++;
}
pVDev->SetFont(aStdFont);
2000-12-07 17:35:30 +00:00
// Changed as per BugID 79541 Branding/Configuration
uno::Any MyAny = ::utl::ConfigManager::GetConfigManager().
GetDirectConfigProperty( ::utl::ConfigManager::PRODUCTNAME );
::rtl::OUString aProductName;
2000-12-07 17:35:30 +00:00
MyAny >>= aProductName;
String sMsg(C2S("%PRODUCTNAME"));
sMsg.SearchAndReplaceAscii( "%PRODUCTNAME" , aProductName );
2000-09-18 16:15:01 +00:00
if(pOutlineNames)
sMsg = pOutlineNames[nLevel];
pVDev->DrawText( Point(nXStart + nTextOffset, nYStart), sMsg );
}
}
}
DrawOutDev( Point(0,0), aSize,
Point(0,0), aSize,
*pVDev );
delete pVDev;
}
NumberingPreview::~NumberingPreview()
{
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */