Files
libreoffice/sw/source/core/doc/poolfmt.cxx

2602 lines
94 KiB
C++
Raw Normal View History

2000-09-18 23:08:29 +00:00
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2000-09-18 23:08:29 +00:00
*
* Copyright 2008 by Sun Microsystems, Inc.
2000-09-18 23:08:29 +00:00
*
* OpenOffice.org - a multi-platform office productivity suite
2000-09-18 23:08:29 +00:00
*
* $RCSfile: poolfmt.cxx,v $
2008-10-29 11:35:03 +00:00
* $Revision: 1.54.108.1 $
2000-09-18 23:08:29 +00:00
*
* This file is part of OpenOffice.org.
2000-09-18 23:08:29 +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 23:08:29 +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 23:08:29 +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 23:08:29 +00:00
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sw.hxx"
2000-09-18 23:08:29 +00:00
#include <hintids.hxx>
#include <i18npool/mslangid.hxx>
2000-11-20 08:16:31 +00:00
#include <unotools/localedatawrapper.hxx>
2000-09-18 23:08:29 +00:00
#include <svx/paperinf.hxx>
#include <svx/wghtitem.hxx>
#include <svx/fontitem.hxx>
#include <svx/fhgtitem.hxx>
#ifndef _SVX_TSTPITEM_HXX //autogen
#include <svx/tstpitem.hxx>
#endif
#include <svx/lrspitem.hxx>
#include <svx/ulspitem.hxx>
#include <svx/adjitem.hxx>
#include <svx/postitem.hxx>
#include <svx/keepitem.hxx>
#include <svx/opaqitem.hxx>
#include <svx/boxitem.hxx>
#include <svx/cmapitem.hxx>
#include <svx/udlnitem.hxx>
#include <svx/colritem.hxx>
#include <svx/protitem.hxx>
#include <svx/escpitem.hxx>
#include <svx/langitem.hxx>
#include <svx/charrotateitem.hxx>
#include <svx/frmdiritem.hxx>
#ifndef _SVX_EMPHITEM_HXX
#include <svx/emphitem.hxx>
#endif
#include <svx/scriptspaceitem.hxx>
#include <viewopt.hxx>
2000-09-18 23:08:29 +00:00
#include <doc.hxx>
#include <fmtanchr.hxx>
#include <fmtornt.hxx>
#include <fmtsrnd.hxx>
#include <fmtfsize.hxx>
#include <poolfmt.hxx>
#include <paratr.hxx>
#include <pagedesc.hxx>
#include <frmtool.hxx>
#include <charfmt.hxx>
#include <docary.hxx>
#include <fmtcol.hxx>
#include <ndtxt.hxx>
#include <fmtline.hxx>
#ifndef _POOLFMT_HRC
#include <poolfmt.hrc>
#endif
#include <GetMetricVal.hxx>
#include <numrule.hxx>
using namespace ::com::sun::star;
2000-09-18 23:08:29 +00:00
const USHORT PT_3 = 3 * 20; // 3 pt
const USHORT PT_6 = 6 * 20; // 6 pt
const USHORT PT_7 = 7 * 20; // 6 pt
const USHORT PT_8 = 8 * 20; // 8 pt
const USHORT PT_9 = 9 * 20; // 9 pt
const USHORT PT_10 = 10 * 20; // 10 pt
const USHORT PT_11 = 11 * 20; // 11 pt
const USHORT PT_12 = 12 * 20; // 12 pt
const USHORT PT_14 = 14 * 20; // 14 pt
const USHORT PT_16 = 16 * 20; // 16 pt
const USHORT PT_18 = 18 * 20; // 18 pt
const USHORT PT_22 = 22 * 20; // 22 pt
const USHORT PT_24 = 24 * 20; // 22 pt
//const USHORT HTML_PARSPACE = ((CM_05 * 7) / 10);
#define HTML_PARSPACE GetMetricVal( CM_05 )
static const sal_Char __FAR_DATA sKomma[] = ", ";
static const USHORT aHeadlineSizes[ 2 * MAXLEVEL ] = {
// PT_16, PT_14, PT_14, PT_12, PT_12, // normal
//JP 10.12.96: jetzt soll alles prozentual sein:
115, 100, 100, 85, 85,
75, 75, 75, 75, 75, // normal
// PT_22, PT_16, PT_12, PT_11, PT_9 // HTML-Mode
PT_24, PT_18, PT_14, PT_12, PT_10,
PT_7, PT_7, PT_7, PT_7, PT_7 // HTML-Mode
};
long lcl_GetRightMargin( SwDoc& rDoc )
{
// sorge dafuer, dass die Druckereinstellungen in die Standard-
// Seitenvorlage uebernommen wurden.
const SwFrmFmt& rPgDscFmt =
const_cast<const SwDoc *>(&rDoc)->GetPageDesc( 0 ).GetMaster();
const SvxLRSpaceItem& rLR = rPgDscFmt.GetLRSpace();
const long nLeft = rLR.GetLeft();
const long nRight = rLR.GetRight();
const long nWidth = rPgDscFmt.GetFrmSize().GetWidth();
2000-09-18 23:08:29 +00:00
return nWidth - nLeft - nRight;
}
void SetAllScriptItem( SfxItemSet& rSet, const SfxPoolItem& rItem )
{
rSet.Put( rItem );
USHORT nWhCJK = 0, nWhCTL = 0;
switch( rItem.Which() )
{
case RES_CHRATR_FONTSIZE:
nWhCJK = RES_CHRATR_CJK_FONTSIZE, nWhCTL = RES_CHRATR_CTL_FONTSIZE;
break;
case RES_CHRATR_FONT:
nWhCJK = RES_CHRATR_CJK_FONT, nWhCTL = RES_CHRATR_CTL_FONT;
break;
case RES_CHRATR_LANGUAGE:
nWhCJK = RES_CHRATR_CJK_LANGUAGE, nWhCTL = RES_CHRATR_CTL_LANGUAGE;
break;
case RES_CHRATR_POSTURE:
nWhCJK = RES_CHRATR_CJK_POSTURE, nWhCTL = RES_CHRATR_CTL_POSTURE;
break;
case RES_CHRATR_WEIGHT:
nWhCJK = RES_CHRATR_CJK_WEIGHT, nWhCTL = RES_CHRATR_CTL_WEIGHT;
break;
}
if( nWhCJK )
rSet.Put( rItem, nWhCJK );
if( nWhCTL )
rSet.Put( rItem, nWhCTL );
}
void lcl_SetDfltFont( USHORT nFntType, SfxItemSet& rSet )
{
static struct {
USHORT nResLngId;
USHORT nResFntId;
} aArr[ 3 ] = {
{ RES_CHRATR_LANGUAGE, RES_CHRATR_FONT },
{ RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_FONT },
{ RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_FONT }
};
for( USHORT n = 0; n < 3; ++n )
{
USHORT nLng = ((SvxLanguageItem&)rSet.GetPool()->GetDefaultItem(
aArr[n].nResLngId )).GetLanguage();
Font aFnt( OutputDevice::GetDefaultFont( nFntType,
nLng, DEFAULTFONT_FLAGS_ONLYONE ) );
rSet.Put( SvxFontItem( aFnt.GetFamily(), aFnt.GetName(),
aEmptyStr, aFnt.GetPitch(),
aFnt.GetCharSet(), aArr[n].nResFntId ));
}
}
void lcl_SetDfltFont( USHORT nLatinFntType, USHORT nCJKFntType,
USHORT nCTLFntType, SfxItemSet& rSet )
{
static struct {
USHORT nResLngId;
USHORT nResFntId;
USHORT nFntType;
} aArr[ 3 ] = {
{ RES_CHRATR_LANGUAGE, RES_CHRATR_FONT, 0 },
{ RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_FONT, 0 },
{ RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_FONT, 0 }
};
aArr[0].nFntType = nLatinFntType;
aArr[1].nFntType = nCJKFntType;
aArr[2].nFntType = nCTLFntType;
for( USHORT n = 0; n < 3; ++n )
{
USHORT nLng = ((SvxLanguageItem&)rSet.GetPool()->GetDefaultItem(
aArr[n].nResLngId )).GetLanguage();
Font aFnt( OutputDevice::GetDefaultFont( aArr[n].nFntType,
nLng, DEFAULTFONT_FLAGS_ONLYONE ) );
rSet.Put( SvxFontItem( aFnt.GetFamily(), aFnt.GetName(),
aEmptyStr, aFnt.GetPitch(),
aFnt.GetCharSet(), aArr[n].nResFntId ));
}
}
2000-09-18 23:08:29 +00:00
void lcl_SetHeadline( SwDoc* pDoc, SwTxtFmtColl* pColl,
SfxItemSet& rSet,
USHORT nOutLvlBits, BYTE nLevel, BOOL bItalic )
{
SetAllScriptItem( rSet, SvxWeightItem( WEIGHT_BOLD, RES_CHRATR_WEIGHT ) );
SvxFontHeightItem aHItem(240, 100, RES_CHRATR_FONTSIZE);
const bool bHTMLMode = pDoc->get(IDocumentSettingAccess::HTML_MODE);
if( bHTMLMode )
aHItem.SetHeight( aHeadlineSizes[ MAXLEVEL + nLevel ] );
2000-09-18 23:08:29 +00:00
else
aHItem.SetHeight( PT_14, aHeadlineSizes[ nLevel ] );
SetAllScriptItem( rSet, aHItem );
2000-09-18 23:08:29 +00:00
if( bItalic && !bHTMLMode )
SetAllScriptItem( rSet, SvxPostureItem( ITALIC_NORMAL, RES_CHRATR_POSTURE ) );
2000-09-18 23:08:29 +00:00
if( bHTMLMode )
2000-09-18 23:08:29 +00:00
{
::lcl_SetDfltFont( DEFAULTFONT_LATIN_TEXT, DEFAULTFONT_CJK_TEXT,
DEFAULTFONT_CTL_TEXT, rSet );
2000-09-18 23:08:29 +00:00
}
if( pColl )
{
if( !( nOutLvlBits & ( 1 << nLevel )) )
{
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
//pColl->SetOutlineLevel( nLevel ); //#outline level zhaojianwei
pColl->AssignToListLevelOfOutlineStyle(nLevel);//<-end,zhaojianwei
if( !bHTMLMode )
2000-09-18 23:08:29 +00:00
{
SwNumRule * pOutlineRule = pDoc->GetOutlineNumRule();
const SwNumFmt& rNFmt = pOutlineRule->Get( nLevel );
// --> OD 2008-02-01 #newlistlevelattrs#
if ( rNFmt.GetPositionAndSpaceMode() ==
SvxNumberFormat::LABEL_WIDTH_AND_POSITION &&
( rNFmt.GetAbsLSpace() || rNFmt.GetFirstLineOffset() ) )
// <--
2000-09-18 23:08:29 +00:00
{
SvxLRSpaceItem aLR( (SvxLRSpaceItem&)pColl->GetFmtAttr( RES_LR_SPACE ) );
2000-09-18 23:08:29 +00:00
aLR.SetTxtFirstLineOfstValue( rNFmt.GetFirstLineOffset() );
aLR.SetTxtLeft( rNFmt.GetAbsLSpace() );
pColl->SetFmtAttr( aLR );
2000-09-18 23:08:29 +00:00
}
// --> OD 2006-11-20 #i71764#
// Check on document setting OUTLINE_LEVEL_YIELDS_OUTLINE_RULE no longer needed.
// All paragraph styles, which are assigned to a level of the
// outline style has to have the outline style set as its list style.
{
SwNumRuleItem aItem(pOutlineRule->GetName());
pColl->SetFmtAttr(aItem);
}
// <--
2000-09-18 23:08:29 +00:00
}
}
pColl->SetNextTxtFmtColl( *pDoc->GetTxtCollFromPool(
RES_POOLCOLL_TEXT ));
}
}
void lcl_SetRegister( SwDoc* pDoc, SfxItemSet& rSet, USHORT nFact,
BOOL bHeader, BOOL bTab )
{
SvxLRSpaceItem aLR( RES_LR_SPACE );
2000-09-18 23:08:29 +00:00
USHORT nLeft = nFact ? GetMetricVal( CM_05 ) * nFact : 0;
aLR.SetTxtLeft( nLeft );
rSet.Put( aLR );
if( bHeader )
{
SetAllScriptItem( rSet, SvxWeightItem( WEIGHT_BOLD, RES_CHRATR_WEIGHT ) );
SetAllScriptItem( rSet, SvxFontHeightItem( PT_16, 100, RES_CHRATR_FONTSIZE ) );
2000-09-18 23:08:29 +00:00
}
if( bTab )
{
long nRightMargin = lcl_GetRightMargin( *pDoc );
SvxTabStopItem aTStops( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP );
2000-09-18 23:08:29 +00:00
aTStops.Insert( SvxTabStop( nRightMargin - nLeft,
SVX_TAB_ADJUST_RIGHT,
cDfltDecimalChar, '.' ));
rSet.Put( aTStops );
}
}
void lcl_SetNumBul( SwDoc* pDoc, SwTxtFmtColl* pColl,
SfxItemSet& rSet,
USHORT nNxt, SwTwips nEZ, SwTwips nLeft,
SwTwips nUpper, SwTwips nLower )
{
SvxLRSpaceItem aLR( RES_LR_SPACE ); SvxULSpaceItem aUL( RES_UL_SPACE );
2000-09-18 23:08:29 +00:00
aLR.SetTxtFirstLineOfst( USHORT(nEZ) ); aLR.SetTxtLeft( USHORT(nLeft) );
aUL.SetUpper( USHORT(nUpper) ); aUL.SetLower( USHORT(nLower) );
rSet.Put( aLR );
rSet.Put( aUL );
if( !pColl )
pColl->SetNextTxtFmtColl( *pDoc->GetTxtCollFromPool( nNxt ));
}
// Gebe die "Auto-Collection" mit der Id zurueck. Existiert
// sie noch nicht, dann erzeuge sie
// Ist der String-Pointer definiert, dann erfrage nur die
// Beschreibung der Attribute, !! es legt keine Vorlage an !!
2000-09-18 23:08:29 +00:00
SvxFrameDirection GetDefaultFrameDirection(ULONG nLanguage)
{
SvxFrameDirection eResult = (MsLangId::isRightToLeft( static_cast<LanguageType>(nLanguage)) ?
FRMDIR_HORI_RIGHT_TOP : FRMDIR_HORI_LEFT_TOP);
return eResult;
}
SwTxtFmtColl* SwDoc::GetTxtCollFromPool( USHORT nId, bool bRegardLanguage )
2000-09-18 23:08:29 +00:00
{
ASSERT(
(RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END) ||
(RES_POOLCOLL_LISTS_BEGIN <= nId && nId < RES_POOLCOLL_LISTS_END) ||
(RES_POOLCOLL_EXTRA_BEGIN <= nId && nId < RES_POOLCOLL_EXTRA_END) ||
(RES_POOLCOLL_REGISTER_BEGIN <= nId && nId < RES_POOLCOLL_REGISTER_END) ||
(RES_POOLCOLL_DOC_BEGIN <= nId && nId < RES_POOLCOLL_DOC_END) ||
(RES_POOLCOLL_HTML_BEGIN <= nId && nId < RES_POOLCOLL_HTML_END),
"Falsche AutoFormat-Id" );
SwTxtFmtColl* pNewColl;
USHORT nOutLvlBits = 0;
for( USHORT n = 0; n < pTxtFmtCollTbl->Count(); ++n )
{
if( nId == ( pNewColl = (*pTxtFmtCollTbl)[ n ] )->GetPoolFmtId() )
{
return pNewColl;
}
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( pNewColl->GetOutlineLevel() < MAXLEVEL ) //#outline level,zhaojianwei
//nOutLvlBits |= ( 1 << pNewColl->GetOutlineLevel() );
if( pNewColl->IsAssignedToListLevelOfOutlineStyle())
nOutLvlBits |= ( 1 << pNewColl->GetAssignedOutlineStyleLevel() );//<-end,zhaojianwei
2000-09-18 23:08:29 +00:00
}
// bis hierher nicht gefunden -> neu anlegen
USHORT nResId = 0;
if( RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END )
nResId = RC_POOLCOLL_TEXT_BEGIN - RES_POOLCOLL_TEXT_BEGIN;
else if (RES_POOLCOLL_LISTS_BEGIN <= nId && nId < RES_POOLCOLL_LISTS_END)
nResId = RC_POOLCOLL_LISTS_BEGIN - RES_POOLCOLL_LISTS_BEGIN;
else if (RES_POOLCOLL_EXTRA_BEGIN <= nId && nId < RES_POOLCOLL_EXTRA_END)
nResId = RC_POOLCOLL_EXTRA_BEGIN - RES_POOLCOLL_EXTRA_BEGIN;
else if (RES_POOLCOLL_REGISTER_BEGIN <= nId && nId < RES_POOLCOLL_REGISTER_END)
nResId = RC_POOLCOLL_REGISTER_BEGIN - RES_POOLCOLL_REGISTER_BEGIN;
else if (RES_POOLCOLL_DOC_BEGIN <= nId && nId < RES_POOLCOLL_DOC_END)
nResId = RC_POOLCOLL_DOC_BEGIN - RES_POOLCOLL_DOC_BEGIN;
else if (RES_POOLCOLL_HTML_BEGIN <= nId && nId < RES_POOLCOLL_HTML_END)
nResId = RC_POOLCOLL_HTML_BEGIN - RES_POOLCOLL_HTML_BEGIN;
ASSERT( nResId, "Ungueltige Pool-ID" );
if( !nResId )
return GetTxtCollFromPool( RES_POOLCOLL_STANDARD );
2000-09-18 23:08:29 +00:00
ResId aResId( nResId + nId, *pSwResMgr );
2000-09-18 23:08:29 +00:00
String aNm( aResId );
// ein Set fuer alle zusetzenden Attribute
SwAttrSet aSet( GetAttrPool(), aTxtFmtCollSetRange );
USHORT nParent = GetPoolParent( nId );
2000-09-18 23:08:29 +00:00
{
//FEATURE::CONDCOLL
if(::IsConditionalByPoolId( nId ))
pNewColl = new SwConditionTxtFmtColl( GetAttrPool(), aNm, !nParent
? pDfltTxtFmtColl
: GetTxtCollFromPool( nParent ));
else
//FEATURE::CONDCOLL
pNewColl = new SwTxtFmtColl( GetAttrPool(), aNm, !nParent
? pDfltTxtFmtColl
: GetTxtCollFromPool( nParent ));
pNewColl->SetPoolFmtId( nId );
pTxtFmtCollTbl->Insert( pNewColl, pTxtFmtCollTbl->Count() );
}
switch( nId )
{
// allgemeine Inhaltsformen
case RES_POOLCOLL_STANDARD:
/* #111214# koreans do not like SvxScriptItem(TRUE) */
if (bRegardLanguage)
{
ULONG nAppLanguage = GetAppLanguage();
if (GetDefaultFrameDirection(nAppLanguage) ==
FRMDIR_HORI_RIGHT_TOP)
{
SvxAdjustItem aAdjust(SVX_ADJUST_RIGHT, RES_PARATR_ADJUST );
aSet.Put(aAdjust);
}
if (nAppLanguage == LANGUAGE_KOREAN)
{
SvxScriptSpaceItem aScriptSpace(FALSE, RES_PARATR_SCRIPTSPACE);
aSet.Put(aScriptSpace);
}
}
2000-09-18 23:08:29 +00:00
break;
case RES_POOLCOLL_TEXT: // Textkoerper
{
SvxULSpaceItem aUL( 0, PT_6, RES_UL_SPACE );
if( get(IDocumentSettingAccess::HTML_MODE) ) aUL.SetLower( HTML_PARSPACE );
2000-09-18 23:08:29 +00:00
aSet.Put( aUL );
}
break;
case RES_POOLCOLL_TEXT_IDENT: // Textkoerper Einzug
{
SvxLRSpaceItem aLR( RES_LR_SPACE );
2000-09-18 23:08:29 +00:00
aLR.SetTxtFirstLineOfst( GetMetricVal( CM_05 ));
aSet.Put( aLR );
}
break;
case RES_POOLCOLL_TEXT_NEGIDENT: // Textkoerper neg. Einzug
{
SvxLRSpaceItem aLR( RES_LR_SPACE );
2000-09-18 23:08:29 +00:00
aLR.SetTxtFirstLineOfst( -(short)GetMetricVal( CM_05 ));
aLR.SetTxtLeft( GetMetricVal( CM_1 ));
SvxTabStopItem aTStops(RES_PARATR_TABSTOP); aTStops.Insert( SvxTabStop( 0 ));
2000-09-18 23:08:29 +00:00
aSet.Put( aLR );
aSet.Put( aTStops );
}
break;
case RES_POOLCOLL_TEXT_MOVE: // Textkoerper Einrueckung
{
SvxLRSpaceItem aLR( RES_LR_SPACE );
2000-09-18 23:08:29 +00:00
aLR.SetTxtLeft( GetMetricVal( CM_05 ));
aSet.Put( aLR );
}
break;
case RES_POOLCOLL_CONFRONTATION: // Textkoerper Gegenueberstellung
{
SvxLRSpaceItem aLR( RES_LR_SPACE );
2000-09-18 23:08:29 +00:00
aLR.SetTxtFirstLineOfst( - short( GetMetricVal( CM_1 ) * 4 +
GetMetricVal( CM_05)) );
aLR.SetTxtLeft( GetMetricVal( CM_1 ) * 5 );
SvxTabStopItem aTStops( RES_PARATR_TABSTOP ); aTStops.Insert( SvxTabStop( 0 ));
2000-09-18 23:08:29 +00:00
aSet.Put( aLR );
aSet.Put( aTStops );
}
break;
case RES_POOLCOLL_MARGINAL: // Textkoerper maginalie
{
SvxLRSpaceItem aLR( RES_LR_SPACE );
2000-09-18 23:08:29 +00:00
aLR.SetTxtLeft( GetMetricVal( CM_1 ) * 4 );
aSet.Put( aLR );
}
break;
case RES_POOLCOLL_HEADLINE_BASE: // Basis Ueberschrift
{
2001-08-16 12:11:36 +00:00
static const USHORT aFntInit[] = {
DEFAULTFONT_LATIN_HEADING, RES_CHRATR_FONT,
RES_CHRATR_LANGUAGE, LANGUAGE_ENGLISH_US,
DEFAULTFONT_CJK_HEADING, RES_CHRATR_CJK_FONT,
RES_CHRATR_CJK_LANGUAGE, LANGUAGE_ENGLISH_US,
DEFAULTFONT_CTL_HEADING, RES_CHRATR_CTL_FONT,
RES_CHRATR_CTL_LANGUAGE, LANGUAGE_ARABIC_SAUDI_ARABIA,
2001-08-16 12:11:36 +00:00
0
};
for( const USHORT* pArr = aFntInit; *pArr; pArr += 4 )
2001-08-16 12:11:36 +00:00
{
USHORT nLng = ((SvxLanguageItem&)GetDefault( *(pArr+2) )).GetLanguage();
if( LANGUAGE_DONTKNOW == nLng )
nLng = *(pArr+3);
2001-08-16 12:11:36 +00:00
Font aFnt( OutputDevice::GetDefaultFont( *pArr,
nLng, DEFAULTFONT_FLAGS_ONLYONE ) );
2001-08-16 12:11:36 +00:00
aSet.Put( SvxFontItem( aFnt.GetFamily(), aFnt.GetName(),
aEmptyStr, aFnt.GetPitch(),
aFnt.GetCharSet(), *(pArr+1) ));
}
2000-09-18 23:08:29 +00:00
SvxFontHeightItem aFntSize( PT_14, 100, RES_CHRATR_FONTSIZE );
SvxULSpaceItem aUL( PT_12, PT_6, RES_UL_SPACE );
if( get(IDocumentSettingAccess::HTML_MODE) )
aUL.SetLower( HTML_PARSPACE );
aSet.Put( SvxFmtKeepItem( TRUE, RES_KEEP ));
2000-09-18 23:08:29 +00:00
pNewColl->SetNextTxtFmtColl( *GetTxtCollFromPool( RES_POOLCOLL_TEXT ));
2000-09-18 23:08:29 +00:00
aSet.Put( aUL );
SetAllScriptItem( aSet, aFntSize );
2000-09-18 23:08:29 +00:00
}
break;
case RES_POOLCOLL_NUMBUL_BASE: // Basis Numerierung/Aufzaehlung
break;
case RES_POOLCOLL_GREETING: // Grussformel
case RES_POOLCOLL_REGISTER_BASE: // Basis Verzeichnisse
case RES_POOLCOLL_SIGNATURE: // Unterschrift
case RES_POOLCOLL_TABLE: // Tabelle-Inhalt
{
SwFmtLineNumber aLN; aLN.SetCountLines( FALSE );
aSet.Put( aLN );
}
break;
case RES_POOLCOLL_HEADLINE1: // Ueberschrift 1
lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 0, FALSE );
break;
case RES_POOLCOLL_HEADLINE2: // Ueberschrift 2
lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 1, TRUE );
break;
case RES_POOLCOLL_HEADLINE3: // Ueberschrift 3
lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 2, FALSE );
break;
case RES_POOLCOLL_HEADLINE4: // Ueberschrift 4
lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 3, TRUE );
break;
case RES_POOLCOLL_HEADLINE5: // Ueberschrift 5
lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 4, FALSE );
break;
case RES_POOLCOLL_HEADLINE6: // Ueberschrift 6
lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 5, FALSE );
break;
case RES_POOLCOLL_HEADLINE7: // Ueberschrift 7
lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 6, FALSE );
break;
case RES_POOLCOLL_HEADLINE8: // Ueberschrift 8
lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 7, FALSE );
break;
case RES_POOLCOLL_HEADLINE9: // Ueberschrift 9
lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 8, FALSE );
break;
case RES_POOLCOLL_HEADLINE10: // Ueberschrift 10
lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 9, FALSE );
break;
// Sonderbereiche:
// Kopfzeilen
case RES_POOLCOLL_HEADER:
case RES_POOLCOLL_HEADERL:
case RES_POOLCOLL_HEADERR:
// Fusszeilen
case RES_POOLCOLL_FOOTER:
case RES_POOLCOLL_FOOTERL:
case RES_POOLCOLL_FOOTERR:
{
SwFmtLineNumber aLN; aLN.SetCountLines( FALSE );
aSet.Put( aLN );
long nRightMargin = lcl_GetRightMargin( *this );
SvxTabStopItem aTStops( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP );
2000-09-18 23:08:29 +00:00
aTStops.Insert( SvxTabStop( nRightMargin / 2, SVX_TAB_ADJUST_CENTER ) );
aTStops.Insert( SvxTabStop( nRightMargin, SVX_TAB_ADJUST_RIGHT ) );
aSet.Put( aTStops );
}
break;
case RES_POOLCOLL_TABLE_HDLN:
{
SetAllScriptItem( aSet, SvxWeightItem( WEIGHT_BOLD, RES_CHRATR_WEIGHT ) );
aSet.Put( SvxAdjustItem( SVX_ADJUST_CENTER, RES_PARATR_ADJUST ) );
2000-09-18 23:08:29 +00:00
SwFmtLineNumber aLN; aLN.SetCountLines( FALSE );
aSet.Put( aLN );
}
break;
case RES_POOLCOLL_FOOTNOTE: // Fussnote
case RES_POOLCOLL_ENDNOTE:
{
SvxLRSpaceItem aLR( RES_LR_SPACE );
2000-09-18 23:08:29 +00:00
aLR.SetTxtFirstLineOfst( -(short)GetMetricVal( CM_05 ));
aLR.SetTxtLeft( GetMetricVal( CM_05 ));
SetAllScriptItem( aSet, SvxFontHeightItem( PT_10, 100, RES_CHRATR_FONTSIZE ) );
2000-09-18 23:08:29 +00:00
aSet.Put( aLR );
SwFmtLineNumber aLN; aLN.SetCountLines( FALSE );
aSet.Put( aLN );
}
break;
case RES_POOLCOLL_LABEL: // Beschriftung-Basis
{
SvxULSpaceItem aUL( RES_UL_SPACE ); aUL.SetUpper( PT_6 ); aUL.SetLower( PT_6 );
2000-09-18 23:08:29 +00:00
aSet.Put( aUL );
SetAllScriptItem( aSet, SvxPostureItem( ITALIC_NORMAL, RES_CHRATR_POSTURE ) );
SetAllScriptItem( aSet, SvxFontHeightItem( PT_10, 100, RES_CHRATR_FONTSIZE ) );
2000-09-18 23:08:29 +00:00
SwFmtLineNumber aLN; aLN.SetCountLines( FALSE );
aSet.Put( aLN );
}
break;
case RES_POOLCOLL_FRAME: // Rahmen Inhalt
case RES_POOLCOLL_LABEL_ABB: // Beschriftung-Abbildung
case RES_POOLCOLL_LABEL_TABLE: // Beschriftung-Tabelle
case RES_POOLCOLL_LABEL_FRAME: // Beschriftung-Rahmen
case RES_POOLCOLL_LABEL_DRAWING: // Beschriftung-Zeichnung
break;
case RES_POOLCOLL_JAKETADRESS: // UmschlagAdresse
{
SvxULSpaceItem aUL( RES_UL_SPACE ); aUL.SetLower( PT_3 );
2000-09-18 23:08:29 +00:00
aSet.Put( aUL );
SwFmtLineNumber aLN; aLN.SetCountLines( FALSE );
aSet.Put( aLN );
}
break;
case RES_POOLCOLL_SENDADRESS: // AbsenderAdresse
{
if( get(IDocumentSettingAccess::HTML_MODE) )
SetAllScriptItem( aSet, SvxPostureItem(ITALIC_NORMAL, RES_CHRATR_POSTURE) );
2000-09-18 23:08:29 +00:00
else
{
SvxULSpaceItem aUL( RES_UL_SPACE ); aUL.SetLower( PT_3 );
2000-09-18 23:08:29 +00:00
aSet.Put( aUL );
}
SwFmtLineNumber aLN; aLN.SetCountLines( FALSE );
aSet.Put( aLN );
}
break;
// Benutzer-Verzeichnisse:
case RES_POOLCOLL_TOX_USERH: // Header
lcl_SetRegister( this, aSet, 0, TRUE, FALSE );
{
SwFmtLineNumber aLN; aLN.SetCountLines( FALSE );
aSet.Put( aLN );
}
break;
case RES_POOLCOLL_TOX_USER1: // 1. Ebene
lcl_SetRegister( this, aSet, 0, FALSE, TRUE );
break;
case RES_POOLCOLL_TOX_USER2: // 2. Ebene
lcl_SetRegister( this, aSet, 1, FALSE, TRUE );
break;
case RES_POOLCOLL_TOX_USER3: // 3. Ebene
lcl_SetRegister( this, aSet, 2, FALSE, TRUE );
break;
case RES_POOLCOLL_TOX_USER4: // 4. Ebene
lcl_SetRegister( this, aSet, 3, FALSE, TRUE );
break;
case RES_POOLCOLL_TOX_USER5: // 5. Ebene
lcl_SetRegister( this, aSet, 4, FALSE, TRUE );
break;
case RES_POOLCOLL_TOX_USER6: // 6. Ebene
lcl_SetRegister( this, aSet, 5, FALSE, TRUE );
break;
case RES_POOLCOLL_TOX_USER7: // 7. Ebene
lcl_SetRegister( this, aSet, 6, FALSE, TRUE );
break;
case RES_POOLCOLL_TOX_USER8: // 8. Ebene
lcl_SetRegister( this, aSet, 7, FALSE, TRUE );
break;
case RES_POOLCOLL_TOX_USER9: // 9. Ebene
lcl_SetRegister( this, aSet, 8, FALSE, TRUE );
break;
case RES_POOLCOLL_TOX_USER10: // 10. Ebene
lcl_SetRegister( this, aSet, 9, FALSE, TRUE );
break;
// Index-Verzeichnisse
case RES_POOLCOLL_TOX_IDXH: // Header
lcl_SetRegister( this, aSet, 0, TRUE, FALSE );
{
SwFmtLineNumber aLN; aLN.SetCountLines( FALSE );
aSet.Put( aLN );
}
break;
case RES_POOLCOLL_TOX_IDX1: // 1. Ebene
lcl_SetRegister( this, aSet, 0, FALSE, FALSE );
break;
case RES_POOLCOLL_TOX_IDX2: // 2. Ebene
lcl_SetRegister( this, aSet, 1, FALSE, FALSE );
break;
case RES_POOLCOLL_TOX_IDX3: // 3. Ebene
lcl_SetRegister( this, aSet, 2, FALSE, FALSE );
break;
case RES_POOLCOLL_TOX_IDXBREAK: // Trenner
lcl_SetRegister( this, aSet, 0, FALSE, FALSE );
break;
// Inhalts-Verzeichnisse
case RES_POOLCOLL_TOX_CNTNTH: // Header
lcl_SetRegister( this, aSet, 0, TRUE, FALSE );
{
SwFmtLineNumber aLN; aLN.SetCountLines( FALSE );
aSet.Put( aLN );
}
break;
case RES_POOLCOLL_TOX_CNTNT1: // 1. Ebene
lcl_SetRegister( this, aSet, 0, FALSE, TRUE );
break;
case RES_POOLCOLL_TOX_CNTNT2: // 2. Ebene
lcl_SetRegister( this, aSet, 1, FALSE, TRUE );
break;
case RES_POOLCOLL_TOX_CNTNT3: // 3. Ebene
lcl_SetRegister( this, aSet, 2, FALSE, TRUE );
break;
case RES_POOLCOLL_TOX_CNTNT4: // 4. Ebene
lcl_SetRegister( this, aSet, 3, FALSE, TRUE );
break;
case RES_POOLCOLL_TOX_CNTNT5: // 5. Ebene
lcl_SetRegister( this, aSet, 4, FALSE, TRUE );
break;
case RES_POOLCOLL_TOX_CNTNT6: // 6. Ebene
lcl_SetRegister( this, aSet, 5, FALSE, TRUE );
break;
case RES_POOLCOLL_TOX_CNTNT7: // 7. Ebene
lcl_SetRegister( this, aSet, 6, FALSE, TRUE );
break;
case RES_POOLCOLL_TOX_CNTNT8: // 8. Ebene
lcl_SetRegister( this, aSet, 7, FALSE, TRUE );
break;
case RES_POOLCOLL_TOX_CNTNT9: // 9. Ebene
lcl_SetRegister( this, aSet, 8, FALSE, TRUE );
break;
case RES_POOLCOLL_TOX_CNTNT10: // 10. Ebene
lcl_SetRegister( this, aSet, 9, FALSE, TRUE );
break;
case RES_POOLCOLL_TOX_ILLUSH:
case RES_POOLCOLL_TOX_OBJECTH:
case RES_POOLCOLL_TOX_TABLESH:
case RES_POOLCOLL_TOX_AUTHORITIESH:
lcl_SetRegister( this, aSet, 0, TRUE, FALSE );
{
SwFmtLineNumber aLN; aLN.SetCountLines( FALSE );
aSet.Put( aLN );
}
break;
case RES_POOLCOLL_TOX_ILLUS1:
case RES_POOLCOLL_TOX_OBJECT1:
case RES_POOLCOLL_TOX_TABLES1:
case RES_POOLCOLL_TOX_AUTHORITIES1:
lcl_SetRegister( this, aSet, 0, FALSE, TRUE );
break;
case RES_POOLCOLL_NUM_LEVEL1S:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL1,
lNumFirstLineOffset, SwNumRule::GetNumIndent( 0 ),
PT_12, PT_6 );
break;
case RES_POOLCOLL_NUM_LEVEL1:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL1,
lNumFirstLineOffset, SwNumRule::GetNumIndent( 0 ),
0, PT_6 );
break;
case RES_POOLCOLL_NUM_LEVEL1E:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL1,
lNumFirstLineOffset, SwNumRule::GetNumIndent( 0 ),
0, PT_12 );
break;
case RES_POOLCOLL_NUM_NONUM1:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM1,
0, SwNumRule::GetNumIndent( 0 ), 0, PT_6 );
break;
case RES_POOLCOLL_NUM_LEVEL2S:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL2,
lNumFirstLineOffset, SwNumRule::GetNumIndent( 1 ),
PT_12, PT_6 );
break;
case RES_POOLCOLL_NUM_LEVEL2:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL2,
lNumFirstLineOffset, SwNumRule::GetNumIndent( 1 ),
0, PT_6 );
break;
case RES_POOLCOLL_NUM_LEVEL2E:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL2,
lNumFirstLineOffset, SwNumRule::GetNumIndent( 1 ),
0, PT_12 );
break;
case RES_POOLCOLL_NUM_NONUM2:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM2,
0, SwNumRule::GetNumIndent( 1 ), 0, PT_6 );
break;
case RES_POOLCOLL_NUM_LEVEL3S:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL3,
lNumFirstLineOffset, SwNumRule::GetNumIndent( 2 ),
PT_12, PT_6 );
break;
case RES_POOLCOLL_NUM_LEVEL3:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL3,
lNumFirstLineOffset, SwNumRule::GetNumIndent( 2 ),
0, PT_6 );
break;
case RES_POOLCOLL_NUM_LEVEL3E:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL3,
lNumFirstLineOffset, SwNumRule::GetNumIndent( 2 ),
0, PT_12 );
break;
case RES_POOLCOLL_NUM_NONUM3:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM3,
0, SwNumRule::GetNumIndent( 2 ), 0, PT_6 );
break;
case RES_POOLCOLL_NUM_LEVEL4S:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL4,
lNumFirstLineOffset, SwNumRule::GetNumIndent( 3 ),
PT_12, PT_6 );
break;
case RES_POOLCOLL_NUM_LEVEL4:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL4,
lNumFirstLineOffset, SwNumRule::GetNumIndent( 3 ),
0, PT_6 );
break;
case RES_POOLCOLL_NUM_LEVEL4E:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL4,
lNumFirstLineOffset, SwNumRule::GetNumIndent( 3 ),
0, PT_12 );
break;
case RES_POOLCOLL_NUM_NONUM4:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM4,
0, SwNumRule::GetNumIndent( 3 ), 0, PT_6 );
break;
case RES_POOLCOLL_NUM_LEVEL5S:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL5,
lNumFirstLineOffset, SwNumRule::GetNumIndent( 4 ),
PT_12, PT_6 );
break;
case RES_POOLCOLL_NUM_LEVEL5:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL5,
lNumFirstLineOffset, SwNumRule::GetNumIndent( 4 ),
0, PT_6 );
break;
case RES_POOLCOLL_NUM_LEVEL5E:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL5,
lNumFirstLineOffset, SwNumRule::GetNumIndent( 4 ),
0, PT_12 );
break;
case RES_POOLCOLL_NUM_NONUM5:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM5,
0, SwNumRule::GetNumIndent( 4 ), 0, PT_6 );
break;
case RES_POOLCOLL_BUL_LEVEL1S:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL1,
lBullFirstLineOffset, SwNumRule::GetBullIndent( 0 ),
PT_12, PT_6 );
break;
case RES_POOLCOLL_BUL_LEVEL1:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL1,
lBullFirstLineOffset, SwNumRule::GetBullIndent( 0 ),
0, PT_6 );
break;
case RES_POOLCOLL_BUL_LEVEL1E:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL1,
lBullFirstLineOffset, SwNumRule::GetBullIndent( 0 ),
0, PT_12 );
break;
case RES_POOLCOLL_BUL_NONUM1:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_NONUM1,
0, SwNumRule::GetBullIndent( 0 ), 0, PT_6 );
break;
case RES_POOLCOLL_BUL_LEVEL2S:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL2,
lBullFirstLineOffset, SwNumRule::GetBullIndent( 1 ),
PT_12, PT_6 );
break;
case RES_POOLCOLL_BUL_LEVEL2:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL2,
lBullFirstLineOffset, SwNumRule::GetBullIndent( 1 ),
0, PT_6 );
break;
case RES_POOLCOLL_BUL_LEVEL2E:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL2,
lBullFirstLineOffset, SwNumRule::GetBullIndent( 1 ),
0, PT_12 );
break;
case RES_POOLCOLL_BUL_NONUM2:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_NONUM2,
0, SwNumRule::GetBullIndent( 1 ), 0, PT_6 );
break;
case RES_POOLCOLL_BUL_LEVEL3S:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL3,
lBullFirstLineOffset, SwNumRule::GetBullIndent( 2 ),
PT_12, PT_6 );
break;
case RES_POOLCOLL_BUL_LEVEL3:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL3,
lBullFirstLineOffset, SwNumRule::GetBullIndent( 2 ),
0, PT_6 );
break;
case RES_POOLCOLL_BUL_LEVEL3E:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL3,
lBullFirstLineOffset, SwNumRule::GetBullIndent( 2 ),
0, PT_12 );
break;
case RES_POOLCOLL_BUL_NONUM3:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_NONUM3,
0, SwNumRule::GetBullIndent( 2 ), 0, PT_6 );
break;
case RES_POOLCOLL_BUL_LEVEL4S:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL4,
lBullFirstLineOffset, SwNumRule::GetBullIndent( 3 ),
PT_12, PT_6 );
break;
case RES_POOLCOLL_BUL_LEVEL4:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL4,
lBullFirstLineOffset, SwNumRule::GetBullIndent( 3 ),
0, PT_6 );
break;
case RES_POOLCOLL_BUL_LEVEL4E:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL4,
lBullFirstLineOffset, SwNumRule::GetBullIndent( 3 ),
0, PT_12 );
break;
case RES_POOLCOLL_BUL_NONUM4:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_NONUM4,
0, SwNumRule::GetBullIndent( 3 ), 0, PT_6 );
break;
case RES_POOLCOLL_BUL_LEVEL5S:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL5,
lBullFirstLineOffset, SwNumRule::GetBullIndent( 4 ),
PT_12, PT_6 );
break;
case RES_POOLCOLL_BUL_LEVEL5:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL5,
lBullFirstLineOffset, SwNumRule::GetBullIndent( 4 ),
0, PT_6 );
break;
case RES_POOLCOLL_BUL_LEVEL5E:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL5,
lBullFirstLineOffset, SwNumRule::GetBullIndent( 4 ),
0, PT_12 );
break;
case RES_POOLCOLL_BUL_NONUM5:
lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_NONUM5,
0, SwNumRule::GetBullIndent( 4 ), 0, PT_6 );
break;
case RES_POOLCOLL_DOC_TITEL: // Doc. Titel
{
SetAllScriptItem( aSet, SvxWeightItem( WEIGHT_BOLD, RES_CHRATR_WEIGHT ) );
SetAllScriptItem( aSet, SvxFontHeightItem( PT_18, 100, RES_CHRATR_FONTSIZE ) );
aSet.Put( SvxAdjustItem( SVX_ADJUST_CENTER, RES_PARATR_ADJUST ) );
2000-09-18 23:08:29 +00:00
pNewColl->SetNextTxtFmtColl( *GetTxtCollFromPool(
2000-09-18 23:08:29 +00:00
RES_POOLCOLL_DOC_SUBTITEL ));
}
break;
case RES_POOLCOLL_DOC_SUBTITEL: // Doc. UnterTitel
{
SetAllScriptItem( aSet, SvxPostureItem( ITALIC_NORMAL, RES_CHRATR_POSTURE ));
SetAllScriptItem( aSet, SvxFontHeightItem( PT_14, 100, RES_CHRATR_FONTSIZE ));
aSet.Put( SvxAdjustItem( SVX_ADJUST_CENTER, RES_PARATR_ADJUST ));
2000-09-18 23:08:29 +00:00
pNewColl->SetNextTxtFmtColl( *GetTxtCollFromPool(
2000-09-18 23:08:29 +00:00
RES_POOLCOLL_TEXT ));
}
break;
case RES_POOLCOLL_HTML_BLOCKQUOTE:
{
SvxLRSpaceItem aLR( RES_LR_SPACE );
2000-09-18 23:08:29 +00:00
aLR.SetLeft( GetMetricVal( CM_1 ));
aLR.SetRight( GetMetricVal( CM_1 ));
aSet.Put( aLR );
// aSet.Put( SvxAdjustItem( SVX_ADJUST_BLOCK, RES_PARATR_ADJUST ) );
SvxULSpaceItem aUL( RES_UL_SPACE );
aUL = pNewColl->GetULSpace();
2000-09-18 23:08:29 +00:00
aUL.SetLower( HTML_PARSPACE );
aSet.Put( aUL);
}
break;
case RES_POOLCOLL_HTML_PRE:
{
::lcl_SetDfltFont( DEFAULTFONT_FIXED, aSet );
2000-09-18 23:08:29 +00:00
// WORKAROUND: PRE auf 10pt setzten
SetAllScriptItem( aSet, SvxFontHeightItem(PT_10, 100, RES_CHRATR_FONTSIZE) );
2000-09-18 23:08:29 +00:00
// WORKAROUND: PRE auf 10pt setzten
// der untere Absatz-Abstand wird explizit gesetzt (macht
// die harte Attributierung einfacher)
SvxULSpaceItem aULSpaceItem( RES_UL_SPACE );
aULSpaceItem = pNewColl->GetULSpace();
2000-09-18 23:08:29 +00:00
aULSpaceItem.SetLower( 0 );
aSet.Put( aULSpaceItem );
}
break;
case RES_POOLCOLL_HTML_HR:
{
SvxBoxItem aBox( RES_BOX );
2000-09-18 23:08:29 +00:00
Color aColor( COL_GRAY );
SvxBorderLine aNew( &aColor, DEF_DOUBLE_LINE0_OUT,
DEF_DOUBLE_LINE0_IN,
DEF_DOUBLE_LINE0_DIST );
aBox.SetLine( &aNew, BOX_LINE_BOTTOM );
aSet.Put( aBox );
aSet.Put( SwParaConnectBorderItem( FALSE ) );
SetAllScriptItem( aSet, SvxFontHeightItem(120, 100, RES_CHRATR_FONTSIZE) );
2000-09-18 23:08:29 +00:00
SvxULSpaceItem aUL( RES_UL_SPACE );
2000-09-18 23:08:29 +00:00
{
pNewColl->SetNextTxtFmtColl( *GetTxtCollFromPool(
RES_POOLCOLL_TEXT ));
aUL = pNewColl->GetULSpace();
}
aUL.SetLower( HTML_PARSPACE );
aSet.Put( aUL);
SwFmtLineNumber aLN; aLN.SetCountLines( FALSE );
aSet.Put( aLN );
}
break;
case RES_POOLCOLL_HTML_DD:
{
SvxLRSpaceItem aLR( RES_LR_SPACE );
aLR = pNewColl->GetLRSpace();
2000-09-18 23:08:29 +00:00
// es wird um 1cm eingerueckt. Die IDs liegen immer 2 auseinander!
aLR.SetLeft( GetMetricVal( CM_1 ));
aSet.Put( aLR );
}
break;
case RES_POOLCOLL_HTML_DT:
{
SvxLRSpaceItem aLR( RES_LR_SPACE );
2000-09-18 23:08:29 +00:00
{
pNewColl->SetNextTxtFmtColl( *GetTxtCollFromPool(
RES_POOLCOLL_HTML_DD ));
aLR = pNewColl->GetLRSpace();
}
// es wird um 0cm eingerueckt. Die IDs liegen immer 2 auseinander!
aLR.SetLeft( 0 );
aSet.Put( aLR );
}
break;
}
if( aSet.Count() )
{
{
pNewColl->SetFmtAttr( aSet );
2000-09-18 23:08:29 +00:00
// JP 31.08.95: erzeugen einer PoolVorlage ist keine Modifikation
// (Bug: 18545)
// SetModified();
}
}
return pNewColl;
}
// pruefe, ob diese "Auto-Collection" in Dokument schon/noch
// benutzt wird
bool SwDoc::IsPoolTxtCollUsed( USHORT nId ) const
2000-09-18 23:08:29 +00:00
{
ASSERT(
(RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END) ||
(RES_POOLCOLL_LISTS_BEGIN <= nId && nId < RES_POOLCOLL_LISTS_END) ||
(RES_POOLCOLL_EXTRA_BEGIN <= nId && nId < RES_POOLCOLL_EXTRA_END) ||
(RES_POOLCOLL_REGISTER_BEGIN <= nId && nId < RES_POOLCOLL_REGISTER_END) ||
(RES_POOLCOLL_DOC_BEGIN <= nId && nId < RES_POOLCOLL_DOC_END) ||
(RES_POOLCOLL_HTML_BEGIN <= nId && nId < RES_POOLCOLL_HTML_END),
"Falsche AutoFormat-Id" );
SwTxtFmtColl* pNewColl = 0;
2000-09-18 23:08:29 +00:00
BOOL bFnd = FALSE;
for( USHORT n = 0; !bFnd && n < pTxtFmtCollTbl->Count(); ++n )
{
pNewColl = (*pTxtFmtCollTbl)[ n ];
if( nId == pNewColl->GetPoolFmtId() )
2000-09-18 23:08:29 +00:00
bFnd = TRUE;
}
2000-09-18 23:08:29 +00:00
if( !bFnd || !pNewColl->GetDepends() )
return FALSE;
SwAutoFmtGetDocNode aGetHt( &aNodes );
return !pNewColl->GetInfo( aGetHt );
}
// Gebe das "Auto[matische]-Format" mit der Id zurueck. Existiert
// es noch nicht, dann erzeuge es
SwFmt* SwDoc::GetFmtFromPool( USHORT nId )
2000-09-18 23:08:29 +00:00
{
SwFmt *pNewFmt = 0;
SwFmt *pDeriveFmt = 0;
2000-09-18 23:08:29 +00:00
SvPtrarr* pArray[ 2 ];
USHORT nArrCnt = 1, nRCId = 0;
USHORT* pWhichRange = 0;
switch( nId & (COLL_GET_RANGE_BITS + POOLGRP_NOCOLLID) )
{
case POOLGRP_CHARFMT:
{
pArray[0] = pCharFmtTbl;
pDeriveFmt = pDfltCharFmt;
if( nId > RES_POOLCHR_NORMAL_END )
nRCId = RC_POOLCHRFMT_HTML_BEGIN - RES_POOLCHR_HTML_BEGIN;
else
nRCId = RC_POOLCHRFMT_BEGIN - RES_POOLCHR_BEGIN;
pWhichRange = aCharFmtSetRange;
// Fehlerfall: unbekanntes Format, aber CharFormat
// -> returne das erste
if( RES_POOLCHR_BEGIN > nId || nId >= RES_POOLCHR_END )
{
ASSERT( !this, "ungueltige Id" );
nId = RES_POOLCHR_BEGIN;
}
}
break;
case POOLGRP_FRAMEFMT:
{
pArray[0] = pFrmFmtTbl;
pArray[1] = pSpzFrmFmtTbl;
pDeriveFmt = pDfltFrmFmt;
nArrCnt = 2;
nRCId = RC_POOLFRMFMT_BEGIN - RES_POOLFRM_BEGIN;
pWhichRange = aFrmFmtSetRange;
// Fehlerfall: unbekanntes Format, aber FrameFormat
// -> returne das erste
if( RES_POOLFRM_BEGIN > nId || nId >= RES_POOLFRM_END )
{
ASSERT( !this, "ungueltige Id" );
nId = RES_POOLFRM_BEGIN;
}
}
break;
default:
// Fehlerfall, unbekanntes Format
ASSERT( nId, "ungueltige Id" );
return 0;
}
ASSERT( nRCId, "ungueltige Id" );
while( nArrCnt-- )
for( USHORT n = 0; n < (*pArray[nArrCnt]).Count(); ++n )
if( nId == ( pNewFmt = (SwFmt*)(*pArray[ nArrCnt ] )[ n ] )->
GetPoolFmtId() )
{
return pNewFmt;
}
ResId aResId( nRCId + nId, *pSwResMgr );
2000-09-18 23:08:29 +00:00
String aNm( aResId );
SwAttrSet aSet( GetAttrPool(), pWhichRange );
{
BOOL bIsModified = IsModified();
BOOL bDoesUndo = DoesUndo();
DoUndo(FALSE);
switch (nId & (COLL_GET_RANGE_BITS + POOLGRP_NOCOLLID) )
{
case POOLGRP_CHARFMT:
pNewFmt = _MakeCharFmt( aNm, pDeriveFmt, FALSE, TRUE );
break;
case POOLGRP_FRAMEFMT:
pNewFmt = _MakeFrmFmt(aNm, pDeriveFmt, FALSE, TRUE );
break;
default:
break;
}
DoUndo(bDoesUndo);
2000-09-18 23:08:29 +00:00
if( !bIsModified )
ResetModified();
pNewFmt->SetPoolFmtId( nId );
pNewFmt->SetAuto( FALSE ); // kein Auto-Format
}
switch( nId )
{
case RES_POOLCHR_FOOTNOTE: // Fussnote
case RES_POOLCHR_PAGENO: // Seiten/Feld
case RES_POOLCHR_LABEL: // Beschriftung
case RES_POOLCHR_DROPCAPS: // Initialien
case RES_POOLCHR_NUM_LEVEL: // Aufzaehlungszeichen
case RES_POOLCHR_TOXJUMP: // Verzeichnissprung
case RES_POOLCHR_ENDNOTE: // Endnote
case RES_POOLCHR_LINENUM: // Zeilennummerierung
break;
case RES_POOLCHR_ENDNOTE_ANCHOR: // Endnotenanker
case RES_POOLCHR_FOOTNOTE_ANCHOR: // Fussnotenanker
{
aSet.Put( SvxEscapementItem( DFLT_ESC_AUTO_SUPER, 58, RES_CHRATR_ESCAPEMENT ) );
2000-09-18 23:08:29 +00:00
}
break;
2000-10-23 10:58:55 +00:00
2000-09-18 23:08:29 +00:00
case RES_POOLCHR_BUL_LEVEL: // Aufzaehlungszeichen
{
const Font& rBulletFont = numfunc::GetDefBulletFont();
SetAllScriptItem( aSet, SvxFontItem( rBulletFont.GetFamily(),
rBulletFont.GetName(), rBulletFont.GetStyleName(),
rBulletFont.GetPitch(), rBulletFont.GetCharSet(), RES_CHRATR_FONT ));
// --> OD 2008-06-02 #i63395#
// no font and no font size any more
// SetAllScriptItem( aSet, SvxFontHeightItem( PT_9, 100, RES_CHRATR_FONTSIZE ));
// <--
2000-09-18 23:08:29 +00:00
}
break;
case RES_POOLCHR_INET_NORMAL:
{
Color aCol( COL_BLUE );
aSet.Put( SvxColorItem( aCol, RES_CHRATR_COLOR ) );
aSet.Put( SvxUnderlineItem( UNDERLINE_SINGLE, RES_CHRATR_UNDERLINE ) );
// i40133: patch submitted by rail: set language to 'none' to prevent spell checking:
aSet.Put( SvxLanguageItem( LANGUAGE_NONE, RES_CHRATR_LANGUAGE ) );
aSet.Put( SvxLanguageItem( LANGUAGE_NONE, RES_CHRATR_CJK_LANGUAGE ) );
aSet.Put( SvxLanguageItem( LANGUAGE_NONE, RES_CHRATR_CTL_LANGUAGE ) );
2000-09-18 23:08:29 +00:00
}
break;
case RES_POOLCHR_INET_VISIT:
{
Color aCol( COL_RED );
aSet.Put( SvxColorItem( aCol, RES_CHRATR_COLOR ) );
aSet.Put( SvxUnderlineItem( UNDERLINE_SINGLE, RES_CHRATR_UNDERLINE ) );
aSet.Put( SvxLanguageItem( LANGUAGE_NONE, RES_CHRATR_LANGUAGE ) );
aSet.Put( SvxLanguageItem( LANGUAGE_NONE, RES_CHRATR_CJK_LANGUAGE ) );
aSet.Put( SvxLanguageItem( LANGUAGE_NONE, RES_CHRATR_CTL_LANGUAGE ) );
2000-09-18 23:08:29 +00:00
}
break;
case RES_POOLCHR_JUMPEDIT:
{
Color aCol( COL_CYAN );
aSet.Put( SvxColorItem( aCol, RES_CHRATR_COLOR ) );
aSet.Put( SvxUnderlineItem( UNDERLINE_DOTTED, RES_CHRATR_UNDERLINE ) );
aSet.Put( SvxCaseMapItem( SVX_CASEMAP_KAPITAELCHEN, RES_CHRATR_CASEMAP ) );
2000-09-18 23:08:29 +00:00
}
break;
2000-10-23 10:58:55 +00:00
case RES_POOLCHR_RUBYTEXT:
{
2001-05-11 17:43:17 +00:00
long nH = ((SvxFontHeightItem*)GetDfltAttr(
RES_CHRATR_CJK_FONTSIZE ))->GetHeight() / 2;
SetAllScriptItem( aSet, SvxFontHeightItem( nH, 100, RES_CHRATR_FONTSIZE));
aSet.Put(SvxUnderlineItem( UNDERLINE_NONE, RES_CHRATR_UNDERLINE ));
aSet.Put(SvxEmphasisMarkItem( EMPHASISMARK_NONE, RES_CHRATR_EMPHASIS_MARK) );
2000-10-23 10:58:55 +00:00
}
break;
2000-09-18 23:08:29 +00:00
case RES_POOLCHR_HTML_EMPHASIS:
case RES_POOLCHR_HTML_CITIATION:
case RES_POOLCHR_HTML_VARIABLE:
{
SetAllScriptItem( aSet, SvxPostureItem( ITALIC_NORMAL, RES_CHRATR_POSTURE) );
2000-09-18 23:08:29 +00:00
}
break;
case RES_POOLCHR_IDX_MAIN_ENTRY:
case RES_POOLCHR_HTML_STRONG:
{
SetAllScriptItem( aSet, SvxWeightItem( WEIGHT_BOLD, RES_CHRATR_WEIGHT ));
2000-09-18 23:08:29 +00:00
}
break;
case RES_POOLCHR_HTML_CODE:
case RES_POOLCHR_HTML_SAMPLE:
case RES_POOLCHR_HTML_KEYBOARD:
case RES_POOLCHR_HTML_TELETYPE:
{
::lcl_SetDfltFont( DEFAULTFONT_FIXED, aSet );
2000-09-18 23:08:29 +00:00
}
break;
case RES_POOLCHR_VERT_NUM:
aSet.Put( SvxCharRotateItem( 900, sal_False, RES_CHRATR_ROTATE ) );
break;
2000-09-18 23:08:29 +00:00
//nichts besonderes
// case RES_POOLCHR_HTML_DEFINSTANCE:
// break;
case RES_POOLFRM_FRAME:
{
if ( get(IDocumentSettingAccess::BROWSE_MODE) )
2000-09-18 23:08:29 +00:00
{
aSet.Put( SwFmtAnchor( FLY_IN_CNTNT ));
aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::LINE_CENTER, text::RelOrientation::PRINT_AREA ) );
2000-09-18 23:08:29 +00:00
aSet.Put( SwFmtSurround( SURROUND_NONE ) );
}
else
{
aSet.Put( SwFmtAnchor( FLY_AT_CNTNT ));
aSet.Put( SwFmtSurround( SURROUND_PARALLEL ) );
aSet.Put( SwFmtHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::PRINT_AREA ) );
aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::PRINT_AREA ) );
2000-09-18 23:08:29 +00:00
Color aCol( COL_BLACK );
SvxBorderLine aLine( &aCol, DEF_LINE_WIDTH_0 );
SvxBoxItem aBox( RES_BOX );
2000-09-18 23:08:29 +00:00
aBox.SetLine( &aLine, BOX_LINE_TOP );
aBox.SetLine( &aLine, BOX_LINE_BOTTOM );
aBox.SetLine( &aLine, BOX_LINE_LEFT );
aBox.SetLine( &aLine, BOX_LINE_RIGHT );
aBox.SetDistance( 85 );
aSet.Put( aBox );
aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) );
aSet.Put( SvxULSpaceItem( 114, 114, RES_UL_SPACE ) );
2000-09-18 23:08:29 +00:00
}
}
break;
case RES_POOLFRM_GRAPHIC:
case RES_POOLFRM_OLE:
{
aSet.Put( SwFmtAnchor( FLY_AT_CNTNT ));
aSet.Put( SwFmtHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME ));
aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ));
2000-09-18 23:08:29 +00:00
aSet.Put( SwFmtSurround( SURROUND_NONE ));
}
break;
case RES_POOLFRM_FORMEL:
{
aSet.Put( SwFmtAnchor( FLY_IN_CNTNT ) );
aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::CHAR_CENTER, text::RelOrientation::FRAME ) );
aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) );
2000-09-18 23:08:29 +00:00
}
break;
case RES_POOLFRM_MARGINAL:
{
aSet.Put( SwFmtAnchor( FLY_AT_CNTNT ));
aSet.Put( SwFmtHoriOrient( 0, text::HoriOrientation::LEFT, text::RelOrientation::FRAME ));
aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ));
2000-09-18 23:08:29 +00:00
aSet.Put( SwFmtSurround( SURROUND_PARALLEL ));
// Breite 3.5 centimeter vorgegeben, als Hoehe nur den
// min. Wert benutzen
aSet.Put( SwFmtFrmSize( ATT_MIN_SIZE,
GetMetricVal( CM_1 ) * 3 + GetMetricVal( CM_05 ),
MM50 ));
}
break;
case RES_POOLFRM_WATERSIGN:
{
aSet.Put( SwFmtAnchor( FLY_PAGE ));
aSet.Put( SwFmtHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME ));
aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::CENTER, text::RelOrientation::FRAME ));
2000-09-18 23:08:29 +00:00
aSet.Put( SvxOpaqueItem( FALSE ));
aSet.Put( SwFmtSurround( SURROUND_THROUGHT ));
}
break;
case RES_POOLFRM_LABEL:
{
aSet.Put( SwFmtAnchor( FLY_IN_CNTNT ) );
aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ) );
aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) );
2000-09-18 23:08:29 +00:00
SvxProtectItem aProtect( RES_PROTECT );
2000-09-18 23:08:29 +00:00
aProtect.SetSizeProtect( TRUE );
aProtect.SetPosProtect( TRUE );
aSet.Put( aProtect );
pNewFmt->SetAutoUpdateFmt( TRUE );
2000-09-18 23:08:29 +00:00
}
break;
}
if( aSet.Count() )
{
{
pNewFmt->SetFmtAttr( aSet );
2000-09-18 23:08:29 +00:00
// JP 31.08.95: erzeugen einer PoolVorlage ist keine Modifikation
// (Bug: 18545)
// SetModified();
}
}
return pNewFmt;
}
SwFrmFmt* SwDoc::GetFrmFmtFromPool( sal_uInt16 nId )
{
return (SwFrmFmt*)GetFmtFromPool( nId );
}
2000-09-18 23:08:29 +00:00
SwCharFmt* SwDoc::GetCharFmtFromPool( sal_uInt16 nId )
{
return (SwCharFmt*)GetFmtFromPool( nId );
}
2000-09-18 23:08:29 +00:00
// pruefe, ob diese "Auto-Collection" in Dokument schon/noch
// benutzt wird
bool SwDoc::IsPoolFmtUsed( USHORT nId ) const
2000-09-18 23:08:29 +00:00
{
SwFmt *pNewFmt = 0;
2000-09-18 23:08:29 +00:00
const SvPtrarr* pArray[ 2 ];
USHORT nArrCnt = 1;
BOOL bFnd = TRUE;
if( RES_POOLCHR_BEGIN <= nId && nId < RES_POOLCHR_END )
{
pArray[0] = pCharFmtTbl;
}
if( RES_POOLFRM_BEGIN <= nId && nId < RES_POOLFRM_END )
{
pArray[0] = pFrmFmtTbl;
pArray[1] = pSpzFrmFmtTbl;
nArrCnt = 2;
}
else
{
ASSERT( FALSE, "ungueltige Id" );
bFnd = FALSE;
}
if( bFnd )
{
bFnd = FALSE;
while( nArrCnt-- && !bFnd )
for( USHORT n = 0; !bFnd && n < (*pArray[nArrCnt]).Count(); ++n )
if( nId == ( pNewFmt = (SwFmt*)(*pArray[ nArrCnt ] )[ n ] )->
GetPoolFmtId() )
bFnd = TRUE;
}
// nicht gefunden oder keine Abhaengigen ?
if( bFnd && pNewFmt->GetDepends() )
{
// dann teste mal, ob es abhaengige ContentNodes im Nodes Array gibt
// (auch indirekte fuer Format-Ableitung! )
SwAutoFmtGetDocNode aGetHt( &aNodes );
bFnd = !pNewFmt->GetInfo( aGetHt );
}
else
bFnd = FALSE;
return bFnd;
}
void lcl_GetStdPgSize( SwDoc* pDoc, SfxItemSet& rSet )
{
SwPageDesc* pStdPgDsc = pDoc->GetPageDescFromPool( RES_POOLPAGE_STANDARD );
SwFmtFrmSize aFrmSz( pStdPgDsc->GetMaster().GetFrmSize() );
if( pStdPgDsc->GetLandscape() )
{
SwTwips nTmp = aFrmSz.GetHeight();
aFrmSz.SetHeight( aFrmSz.GetWidth() );
aFrmSz.SetWidth( nTmp );
}
rSet.Put( aFrmSz );
}
SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage )
2000-09-18 23:08:29 +00:00
{
ASSERT( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END,
"Falsche AutoFormat-Id" );
SwPageDesc *pNewPgDsc;
USHORT n;
for( n = 0; n < aPageDescs.Count(); ++n )
2000-09-18 23:08:29 +00:00
if( nId == ( pNewPgDsc = aPageDescs[ n ] )->GetPoolFmtId() )
{
return pNewPgDsc;
}
// Fehlerfall: unbekannte Poolvorlage
if( RES_POOLPAGE_BEGIN > nId || nId >= RES_POOLPAGE_END )
{
ASSERT( !this, "ungueltige Id" );
nId = RES_POOLPAGE_BEGIN;
}
ResId aResId( sal_uInt32(RC_POOLPAGEDESC_BEGIN + nId - RES_POOLPAGE_BEGIN), *pSwResMgr );
2000-09-18 23:08:29 +00:00
String aNm( aResId );
{
BOOL bIsModified = IsModified();
BOOL bDoesUndo = DoesUndo();
DoUndo(FALSE);
n = MakePageDesc( aNm, 0, bRegardLanguage );
DoUndo(bDoesUndo);
2000-09-18 23:08:29 +00:00
pNewPgDsc = aPageDescs[ n ];
pNewPgDsc->SetPoolFmtId( nId );
if( !bIsModified )
ResetModified();
}
SvxLRSpaceItem aLR( RES_LR_SPACE );
2000-09-18 23:08:29 +00:00
aLR.SetLeft( GetMetricVal( CM_1 ) * 2 );
aLR.SetRight( aLR.GetLeft() );
SvxULSpaceItem aUL( RES_UL_SPACE );
2001-05-11 17:43:17 +00:00
aUL.SetUpper( (USHORT)aLR.GetLeft() );
aUL.SetLower( (USHORT)aLR.GetLeft() );
2000-09-18 23:08:29 +00:00
SwAttrSet aSet( GetAttrPool(), aPgFrmFmtSetRange );
BOOL bSetLeft = TRUE;
switch( nId )
{
case RES_POOLPAGE_STANDARD: // Standard-Seite
{
aSet.Put( aLR );
aSet.Put( aUL );
if( pNewPgDsc )
pNewPgDsc->SetUseOn( nsUseOnPage::PD_ALL );
2000-09-18 23:08:29 +00:00
}
break;
case RES_POOLPAGE_FIRST: // Erste Seite
case RES_POOLPAGE_REGISTER: // Verzeichnis
{
lcl_GetStdPgSize( this, aSet );
aSet.Put( aLR );
aSet.Put( aUL );
if( pNewPgDsc )
{
pNewPgDsc->SetUseOn( nsUseOnPage::PD_ALL );
2000-09-18 23:08:29 +00:00
if( RES_POOLPAGE_FIRST == nId )
pNewPgDsc->SetFollow( GetPageDescFromPool( RES_POOLPAGE_STANDARD ));
}
}
break;
case RES_POOLPAGE_LEFT: // Linke Seite
{
lcl_GetStdPgSize( this, aSet );
aSet.Put( aLR );
aSet.Put( aUL );
bSetLeft = FALSE;
if( pNewPgDsc )
pNewPgDsc->SetUseOn( nsUseOnPage::PD_LEFT );
2000-09-18 23:08:29 +00:00
}
break;
case RES_POOLPAGE_RIGHT: // Rechte Seite
{
lcl_GetStdPgSize( this, aSet );
aSet.Put( aLR );
aSet.Put( aUL );
bSetLeft = FALSE;
if( pNewPgDsc )
pNewPgDsc->SetUseOn( nsUseOnPage::PD_RIGHT );
2000-09-18 23:08:29 +00:00
}
break;
case RES_POOLPAGE_JAKET: // Umschlag
{
aLR.SetLeft( 0 ); aLR.SetRight( 0 );
aUL.SetUpper( 0 ); aUL.SetLower( 0 );
CWS-TOOLING: integrate CWS unifypaper01 2009-05-27 17:14:41 +0200 cmc r272362 : #i92819#, psprint moved into vcl 2009-05-19 15:45:46 +0200 cmc r272083 : #i92819# having difficultly in getting this right under windows 2009-05-18 18:04:22 +0200 cmc r272043 : #i92819# missing some export magic somewhere 2009-05-18 15:34:18 +0200 cmc r272028 : #i92819# get depends right 2009-05-18 11:50:43 +0200 cmc r272010 : ##i92819# fix import/export stuff 2009-05-18 10:07:00 +0200 cmc r272000 : #i92819# fix window imp name 2009-05-16 15:17:23 +0200 cmc r271975 : #i92819# fix win paper names 2009-05-16 11:11:29 +0200 cmc r271974 : #i92819# std::abs prolematic for msvc 2009-05-15 15:36:56 +0200 cmc r271941 : #i92819# handle missing setting, at least on mac 2009-05-15 10:13:44 +0200 cmc r271927 : #i92819# adjust for moved page dialog 2009-05-14 13:47:14 +0200 cmc r271887 : remove dead files that reappeared 2009-05-14 09:57:17 +0200 cmc r271872 : CWS-TOOLING: rebase CWS unifypaper01 to trunk@271830 (milestone: DEV300:m48) 2009-05-11 12:27:18 +0200 cmc r271763 : #i92819# check return value 2009-05-06 17:28:25 +0200 cmc r271602 : #i92819# these B4/B5s are the JIS ones according to their dimensions 2009-05-06 17:17:03 +0200 cmc r271601 : #i92819# micro-optimization 2009-05-03 18:20:48 +0200 cmc r271434 : #i92819# paper libs 2009-05-03 16:08:32 +0200 cmc r271433 : CWS-TOOLING: rebase CWS unifypaper01 to trunk@271427 (milestone: DEV300:m47) 2009-04-06 15:33:37 +0200 cmc r270556 : CWS-TOOLING: rebase CWS unifypaper01 to trunk@270033 (milestone: DEV300:m45) 2009-03-12 14:36:35 +0100 cmc r269415 : #i92819# merge paper utilities 2009-03-11 13:44:27 +0100 cmc r269328 : CWS-TOOLING: rebase CWS unifypaper01 to trunk@269297 (milestone: DEV300:m43) 2009-03-09 14:42:07 +0100 cmc r269190 : remove config_office from synced version 2009-03-09 14:34:50 +0100 cmc r269187 : CWS-TOOLING: rebase CWS unifypaper01 to trunk@268395 (milestone: DEV300:m42) 2009-03-09 12:11:29 +0100 cmc r269077 : CWS-TOOLING: rebase CWS unifypaper01 to trunk@265758 (milestone: DEV300:m38) 2009-03-06 17:17:39 +0100 cmc r269027 : #i92819# paper goo 2008-12-04 11:29:30 +0100 cmc r264826 : CWS-TOOLING: rebase CWS unifypaper01 to trunk@264807 (milestone: DEV300:m37) 2008-11-26 10:33:06 +0100 cmc r264357 : CWS-TOOLING: rebase CWS unifypaper01 to trunk@264325 (milestone: DEV300:m36) 2008-11-21 14:09:36 +0100 cmc r264138 : #i92819# paper consolidation
2009-06-12 09:36:34 +00:00
Size aPSize( SvxPaperInfo::GetPaperSize( PAPER_ENV_C65 ) );
2000-09-18 23:08:29 +00:00
LandscapeSwap( aPSize );
aSet.Put( SwFmtFrmSize( ATT_FIX_SIZE, aPSize.Width(), aPSize.Height() ));
aSet.Put( aLR );
aSet.Put( aUL );
if( pNewPgDsc )
{
pNewPgDsc->SetUseOn( nsUseOnPage::PD_ALL );
2000-09-18 23:08:29 +00:00
pNewPgDsc->SetLandscape( TRUE );
}
}
break;
case RES_POOLPAGE_HTML: // HTML
{
lcl_GetStdPgSize( this, aSet );
2000-09-18 23:08:29 +00:00
aLR.SetRight( GetMetricVal( CM_1 ));
2001-05-11 17:43:17 +00:00
aUL.SetUpper( (USHORT)aLR.GetRight() );
aUL.SetLower( (USHORT)aLR.GetRight() );
2000-09-18 23:08:29 +00:00
aSet.Put( aLR );
aSet.Put( aUL );
if( pNewPgDsc )
pNewPgDsc->SetUseOn( nsUseOnPage::PD_ALL );
2000-09-18 23:08:29 +00:00
}
break;
case RES_POOLPAGE_FOOTNOTE:
case RES_POOLPAGE_ENDNOTE:
{
lcl_GetStdPgSize( this, aSet );
aSet.Put( aLR );
aSet.Put( aUL );
if( pNewPgDsc )
pNewPgDsc->SetUseOn( nsUseOnPage::PD_ALL );
2000-09-18 23:08:29 +00:00
SwPageFtnInfo aInf( pNewPgDsc->GetFtnInfo() );
aInf.SetLineWidth( 0 );
aInf.SetTopDist( 0 );
aInf.SetBottomDist( 0 );
pNewPgDsc->SetFtnInfo( aInf );
}
break;
2008-10-29 11:35:03 +00:00
case RES_POOLPAGE_LANDSCAPE:
{
SwPageDesc* pStdPgDsc = this->GetPageDescFromPool( RES_POOLPAGE_STANDARD );
SwFmtFrmSize aFrmSz( pStdPgDsc->GetMaster().GetFrmSize() );
SwTwips nTmp = aFrmSz.GetHeight();
aFrmSz.SetHeight( aFrmSz.GetWidth() );
aFrmSz.SetWidth( nTmp );
aSet.Put( aFrmSz );
aSet.Put( aLR );
aSet.Put( aUL );
if( pNewPgDsc )
{
pNewPgDsc->SetUseOn( nsUseOnPage::PD_ALL );
pNewPgDsc->SetLandscape( TRUE );
}
}
break;
2000-09-18 23:08:29 +00:00
}
if( aSet.Count() )
{
{
if( bSetLeft )
pNewPgDsc->GetLeft().SetFmtAttr( aSet );
pNewPgDsc->GetMaster().SetFmtAttr( aSet );
2000-09-18 23:08:29 +00:00
// JP 31.08.95: erzeugen einer PoolVorlage ist keine Modifikation
// (Bug: 18545)
// SetModified();
}
}
return pNewPgDsc;
}
SwNumRule* SwDoc::GetNumRuleFromPool( USHORT nId )
2000-09-18 23:08:29 +00:00
{
ASSERT( RES_POOLNUMRULE_BEGIN <= nId && nId < RES_POOLNUMRULE_END,
"Falsche AutoFormat-Id" );
SwNumRule* pNewRule;
USHORT n;
for( n = 0; n < GetNumRuleTbl().Count(); ++n )
2000-09-18 23:08:29 +00:00
if( nId == ( pNewRule = GetNumRuleTbl()[ n ] )->GetPoolFmtId() )
{
return pNewRule;
}
// Fehlerfall: unbekannte Poolvorlage
if( RES_POOLNUMRULE_BEGIN > nId || nId >= RES_POOLNUMRULE_END )
{
ASSERT( !this, "ungueltige Id" );
nId = RES_POOLNUMRULE_BEGIN;
}
ResId aResId( sal_uInt32(RC_POOLNUMRULE_BEGIN + nId - RES_POOLNUMRULE_BEGIN), *pSwResMgr );
2000-09-18 23:08:29 +00:00
String aNm( aResId );
SwCharFmt *pNumCFmt = 0, *pBullCFmt = 0;
// --> OD 2008-02-11 #newlistlevelattrs#
const SvxNumberFormat::SvxNumPositionAndSpaceMode eNumberFormatPositionAndSpaceMode
// --> OD 2008-06-06 #i89178#
= numfunc::GetDefaultPositionAndSpaceMode();
// <--
// <--
2000-09-18 23:08:29 +00:00
{
BOOL bIsModified = IsModified();
// --> OD 2008-02-11 #newlistlevelattrs#
n = MakeNumRule( aNm, 0, FALSE, eNumberFormatPositionAndSpaceMode );
// <--
2000-09-18 23:08:29 +00:00
pNewRule = GetNumRuleTbl()[ n ];
pNewRule->SetPoolFmtId( nId );
pNewRule->SetAutoRule( FALSE );
if( RES_POOLNUMRULE_NUM1 <= nId && nId <= RES_POOLNUMRULE_NUM5 )
pNumCFmt = GetCharFmtFromPool( RES_POOLCHR_NUM_LEVEL );
if( ( RES_POOLNUMRULE_BUL1 <= nId && nId <= RES_POOLNUMRULE_BUL5 ) ||
RES_POOLNUMRULE_NUM5 == nId )
pBullCFmt = GetCharFmtFromPool( RES_POOLCHR_NUM_LEVEL );
if( !bIsModified )
ResetModified();
}
switch( nId )
{
case RES_POOLNUMRULE_NUM1:
{
SwNumFmt aFmt;
// --> OD 2008-02-11 #newlistlevelattrs#
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
// <--
aFmt.SetNumberingType(SVX_NUM_ARABIC);
2000-09-18 23:08:29 +00:00
aFmt.SetCharFmt( pNumCFmt );
aFmt.SetStart( 1 );
aFmt.SetIncludeUpperLevels( 1 );
aFmt.SetSuffix( aDotStr );
2000-09-18 23:08:29 +00:00
static const USHORT aAbsSpace[ MAXLEVEL ] =
{
// cm: 0,5 1,0 1,5 2,0 2,5 3,0 3,5 4,0 4,5 5,0
283, 567, 850, 1134, 1417, 1701, 1984, 2268, 2551, 2835
};
#ifdef USE_MEASUREMENT
static const USHORT aAbsSpaceInch[ MAXLEVEL ] =
{
283, 567, 850, 1134, 1417, 1701, 1984, 2268, 2551, 2835
};
2000-11-20 08:16:31 +00:00
const USHORT* pArr = MEASURE_METRIC ==
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
SvtSysLocale().GetLocaleData().getMeasurementSystemEnum()
2000-09-18 23:08:29 +00:00
? aAbsSpace
: aAbsSpaceInch;
#else
const USHORT* pArr = aAbsSpace;
#endif
// --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - (*pArr) );
}
else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
aFmt.SetFirstLineIndent( - (*pArr) );
}
// <--
2000-09-18 23:08:29 +00:00
for( n = 0; n < MAXLEVEL; ++n, ++pArr )
{
// --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( *pArr );
}
else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetListtabPos( *pArr );
aFmt.SetIndentAt( *pArr );
}
// <--
2000-09-18 23:08:29 +00:00
pNewRule->Set( n, aFmt );
}
}
break;
case RES_POOLNUMRULE_NUM2:
{
static const USHORT aAbsSpace[ MAXLEVEL ] =
{
283, 283, 567, 709, // 0.50, 0.50, 1.00, 1.25
850, 1021, 1304, 1474, // 1.50, 1.80, 2.30, 2.60
1588, 1758 // 2.80, 3.10
};
#ifdef USE_MEASUREMENT
static const USHORT aAbsSpaceInch[ MAXLEVEL ] =
{
385, 385, 770, 963,
1155, 1386, 1771, 2002,
2156, 2387
};
2000-11-20 08:16:31 +00:00
const USHORT* pArr = MEASURE_METRIC ==
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
SvtSysLocale().GetLocaleData().getMeasurementSystemEnum()
2000-09-18 23:08:29 +00:00
? aAbsSpace
: aAbsSpaceInch;
#else
const USHORT* pArr = aAbsSpace;
#endif
SwNumFmt aFmt;
// --> OD 2008-02-11 #newlistlevelattrs#
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
// <--
aFmt.SetNumberingType(SVX_NUM_ARABIC);
2000-09-18 23:08:29 +00:00
aFmt.SetCharFmt( pNumCFmt );
aFmt.SetIncludeUpperLevels( 1 );
// --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
}
// <--
2000-09-18 23:08:29 +00:00
USHORT nSpace = 0;
for( n = 0; n < MAXLEVEL; ++n )
{
// --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( nSpace = nSpace + pArr[ n ] );
aFmt.SetFirstLineOffset( - pArr[ n ] );
}
else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetListtabPos( nSpace = nSpace + pArr[ n ] );
aFmt.SetIndentAt( nSpace );
aFmt.SetFirstLineIndent( - pArr[ n ] );
}
// <--
aFmt.SetStart( n+1 );
2000-09-18 23:08:29 +00:00
pNewRule->Set( n, aFmt );
}
}
break;
case RES_POOLNUMRULE_NUM3:
{
SwNumFmt aFmt;
// --> OD 2008-02-11 #newlistlevelattrs#
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
// <--
aFmt.SetNumberingType(SVX_NUM_ARABIC);
2000-09-18 23:08:29 +00:00
aFmt.SetCharFmt( pNumCFmt );
aFmt.SetIncludeUpperLevels( 1 );
2000-09-18 23:08:29 +00:00
USHORT nOffs = GetMetricVal( CM_1 ) * 3;
// --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - nOffs );
}
else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
aFmt.SetFirstLineIndent( - nOffs );
}
// <--
2000-09-18 23:08:29 +00:00
for( n = 0; n < MAXLEVEL; ++n )
{
// --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( (n+1) * nOffs );
}
else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetListtabPos( (n+1) * nOffs );
aFmt.SetIndentAt( (n+1) * nOffs );
}
// <--
aFmt.SetStart( n+1 );
2000-09-18 23:08:29 +00:00
pNewRule->Set( n, aFmt );
}
}
break;
case RES_POOLNUMRULE_NUM4:
{
SwNumFmt aFmt;
// --> OD 2008-02-11 #newlistlevelattrs#
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
// <--
aFmt.SetNumberingType(SVX_NUM_ROMAN_UPPER);
2000-09-18 23:08:29 +00:00
aFmt.SetCharFmt( pNumCFmt );
aFmt.SetIncludeUpperLevels( 1 );
aFmt.SetSuffix( aDotStr );
2000-09-18 23:08:29 +00:00
static const USHORT aAbsSpace[ MAXLEVEL ] =
{
// cm: 0,5 1,0 1,5 2,0 2,5 3,0 3,5 4,0 4,5 5,0
283, 567, 850, 1134, 1417, 1701, 1984, 2268, 2551, 2835
};
#ifdef USE_MEASUREMENT
static const USHORT aAbsSpaceInch[ MAXLEVEL ] =
{
283, 567, 850, 1134, 1417, 1701, 1984, 2268, 2551, 2835
};
2000-11-20 08:16:31 +00:00
const USHORT* pArr = MEASURE_METRIC ==
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
SvtSysLocale().GetLocaleData().getMeasurementSystemEnum()
2000-09-18 23:08:29 +00:00
? aAbsSpace
: aAbsSpaceInch;
#else
const USHORT* pArr = aAbsSpace;
#endif
// --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - (*pArr) );
}
else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetLabelFollowedBy( SvxNumberFormat::SPACE );
aFmt.SetFirstLineIndent( - (*pArr) );
}
// <--
2000-09-18 23:08:29 +00:00
for( n = 0; n < MAXLEVEL; ++n, ++pArr )
{
aFmt.SetStart( n + 1 );
// --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( *pArr );
}
else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetListtabPos( *pArr );
aFmt.SetIndentAt( *pArr );
}
// <--
2000-09-18 23:08:29 +00:00
pNewRule->Set( n, aFmt );
}
}
break;
case RES_POOLNUMRULE_NUM5:
{
// [ First, LSpace ]
static const USHORT aAbsSpace0to2[] =
{
227, 227, // 0.40, 0.40,
369, 624, // 0.65, 1.10,
255, 879 // 0.45, 1.55
};
#ifdef USE_MEASUREMENT
2000-09-18 23:08:29 +00:00
static const USHORT aAbsSpaceInch0to2[] =
{
308, 308,
501, 847,
347, 1194
};
2000-11-20 08:16:31 +00:00
const USHORT* pArr0to2 = MEASURE_METRIC ==
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
SvtSysLocale().GetLocaleData().getMeasurementSystemEnum()
2000-09-18 23:08:29 +00:00
? aAbsSpace0to2
: aAbsSpaceInch0to2;
#else
const USHORT* pArr0to2 = aAbsSpace0to2;
#endif
SwNumFmt aFmt;
// --> OD 2008-02-11 #newlistlevelattrs#
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
// <--
aFmt.SetNumberingType(SVX_NUM_ARABIC);
aFmt.SetStart( 1 );
aFmt.SetIncludeUpperLevels( 1 );
aFmt.SetSuffix( aDotStr );
// --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
}
// <--
// --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( -pArr0to2[0] ); // == 0.40 cm
aFmt.SetAbsLSpace( pArr0to2[1] ); // == 0.40 cm
}
else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetFirstLineIndent( -pArr0to2[0] );
aFmt.SetListtabPos( pArr0to2[1] );
aFmt.SetIndentAt( pArr0to2[1] );
}
// <--
2000-09-18 23:08:29 +00:00
aFmt.SetCharFmt( pNumCFmt );
pNewRule->Set( 0, aFmt );
aFmt.SetIncludeUpperLevels( 2 );
aFmt.SetStart( 2 );
// --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( -pArr0to2[2] ); // == 0.65 cm
aFmt.SetAbsLSpace( pArr0to2[3] ); // == 1.10 cm
}
else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetFirstLineIndent( -pArr0to2[2] );
aFmt.SetListtabPos( pArr0to2[3] );
aFmt.SetIndentAt( pArr0to2[3] );
}
// <--
2000-09-18 23:08:29 +00:00
pNewRule->Set( 1, aFmt );
aFmt.SetNumberingType(SVX_NUM_CHARS_LOWER_LETTER);
aFmt.SetSuffix( ')');
aFmt.SetIncludeUpperLevels( 1 );
aFmt.SetStart( 3 );
// --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - pArr0to2[4] ); // == 0.45cm
aFmt.SetAbsLSpace( pArr0to2[5] ); // == 1.55 cm
}
else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetFirstLineIndent( -pArr0to2[4] );
aFmt.SetListtabPos( pArr0to2[5] );
aFmt.SetIndentAt( pArr0to2[5] );
}
// <--
2000-09-18 23:08:29 +00:00
pNewRule->Set( 2, aFmt );
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
2000-09-18 23:08:29 +00:00
aFmt.SetCharFmt( pBullCFmt );
// --> OD 2006-06-29 #6440955#
aFmt.SetBulletFont( &numfunc::GetDefBulletFont() );
// <--
2000-09-18 23:08:29 +00:00
aFmt.SetBulletChar( cBulletChar );
USHORT nOffs = GetMetricVal( CM_01 ) * 4,
nOffs2 = GetMetricVal( CM_1 ) * 2;
// --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - nOffs );
}
else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetFirstLineIndent( - nOffs );
}
// <--
aFmt.SetSuffix( aEmptyStr );
2000-09-18 23:08:29 +00:00
for( n = 3; n < MAXLEVEL; ++n )
{
aFmt.SetStart( n+1 );
// --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( nOffs2 + ((n-3) * nOffs) );
}
else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetListtabPos( nOffs2 + ((n-3) * nOffs) );
aFmt.SetIndentAt( nOffs2 + ((n-3) * nOffs) );
}
// <--
2000-09-18 23:08:29 +00:00
pNewRule->Set( n, aFmt );
}
}
break;
case RES_POOLNUMRULE_BUL1:
{
SwNumFmt aFmt;
// --> OD 2008-02-11 #newlistlevelattrs#
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
// <--
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
2000-09-18 23:08:29 +00:00
aFmt.SetCharFmt( pBullCFmt );
aFmt.SetStart( 1 );
aFmt.SetIncludeUpperLevels( 1 );
// --> OD 2006-06-29 #6440955#
aFmt.SetBulletFont( &numfunc::GetDefBulletFont() );
// <--
2000-09-18 23:08:29 +00:00
aFmt.SetBulletChar( cBulletChar );
static const USHORT aAbsSpace[ MAXLEVEL ] =
{
// cm: 0,4 0,8 1,2 1,6 2,0 2,4 2,8 3,2 3,6 4,0
227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268
};
#ifdef USE_MEASUREMENT
static const USHORT aAbsSpaceInch[ MAXLEVEL ] =
{
227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268
};
2000-11-20 08:16:31 +00:00
const USHORT* pArr = MEASURE_METRIC ==
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
SvtSysLocale().GetLocaleData().getMeasurementSystemEnum()
2000-09-18 23:08:29 +00:00
? aAbsSpace
: aAbsSpaceInch;
#else
const USHORT* pArr = aAbsSpace;
#endif
// --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - (*pArr) );
}
else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
aFmt.SetFirstLineIndent( - (*pArr) );
}
// <--
2000-09-18 23:08:29 +00:00
for( n = 0; n < MAXLEVEL; ++n, ++pArr )
{
// --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( *pArr );
}
else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetListtabPos( *pArr );
aFmt.SetIndentAt( *pArr );
}
// <--
2000-09-18 23:08:29 +00:00
pNewRule->Set( n, aFmt );
}
}
break;
case RES_POOLNUMRULE_BUL2:
{
SwNumFmt aFmt;
// --> OD 2008-02-11 #newlistlevelattrs#
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
// <--
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
2000-09-18 23:08:29 +00:00
aFmt.SetCharFmt( pBullCFmt );
aFmt.SetStart( 1 );
aFmt.SetIncludeUpperLevels( 1 );
// --> OD 2006-06-29 #6440955#
aFmt.SetBulletFont( &numfunc::GetDefBulletFont() );
// <--
aFmt.SetBulletChar( 0x2013 );
2000-09-18 23:08:29 +00:00
static const USHORT aAbsSpace[ MAXLEVEL ] =
{
// cm: 0,3 0,6 0,9 1,2 1,5 1,8 2,1 2,4 2,7 3,0
170, 340, 510, 680, 850, 1020, 1191, 1361, 1531, 1701
};
#ifdef USE_MEASUREMENT
static const USHORT aAbsSpaceInch[ MAXLEVEL ] =
{
170, 340, 510, 680, 850, 1020, 1191, 1361, 1531, 1701
};
2000-11-20 08:16:31 +00:00
const USHORT* pArr = MEASURE_METRIC ==
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
SvtSysLocale().GetLocaleData().getMeasurementSystemEnum()
2000-09-18 23:08:29 +00:00
? aAbsSpace
: aAbsSpaceInch;
#else
const USHORT* pArr = aAbsSpace;
#endif
// --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - (*pArr) );
}
else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
aFmt.SetFirstLineIndent( - (*pArr) );
}
// <--
2000-09-18 23:08:29 +00:00
for( n = 0; n < MAXLEVEL; ++n, ++pArr )
{
// --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( *pArr );
}
else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetListtabPos( *pArr );
aFmt.SetIndentAt( *pArr );
}
// <--
2000-09-18 23:08:29 +00:00
pNewRule->Set( n, aFmt );
}
}
break;
case RES_POOLNUMRULE_BUL3:
{
SwNumFmt aFmt;
// --> OD 2008-02-11 #newlistlevelattrs#
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
// <--
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
2000-09-18 23:08:29 +00:00
aFmt.SetCharFmt( pBullCFmt );
aFmt.SetStart( 1 );
aFmt.SetIncludeUpperLevels( 1 );
// --> OD 2006-06-29 #6440955#
aFmt.SetBulletFont( &numfunc::GetDefBulletFont() );
// <--
2000-09-18 23:08:29 +00:00
USHORT nOffs = GetMetricVal( CM_01 ) * 4;
// --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - nOffs );
}
else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
aFmt.SetFirstLineIndent( - nOffs );
}
// <--
2000-09-18 23:08:29 +00:00
for( n = 0; n < MAXLEVEL; ++n )
{
aFmt.SetBulletChar( ( n & 1 ? 0x25a1 : 0x2611 ) );
// --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( ((n & 1) +1) * nOffs );
}
else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetListtabPos( ((n & 1) +1) * nOffs );
aFmt.SetIndentAt( ((n & 1) +1) * nOffs );
}
// <--
2000-09-18 23:08:29 +00:00
pNewRule->Set( n, aFmt );
}
}
break;
case RES_POOLNUMRULE_BUL4:
{
SwNumFmt aFmt;
// --> OD 2008-02-11 #newlistlevelattrs#
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
// <--
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
2000-09-18 23:08:29 +00:00
aFmt.SetCharFmt( pBullCFmt );
aFmt.SetStart( 1 );
aFmt.SetIncludeUpperLevels( 1 );
// --> OD 2006-06-29 #6440955#
aFmt.SetBulletFont( &numfunc::GetDefBulletFont() );
// <--
2000-09-18 23:08:29 +00:00
static const USHORT aAbsSpace[ MAXLEVEL ] =
{
// cm: 0,4 0,8 1,2 1,6 2,0 2,4 2,8 3,2 3,6 4,0
227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268
};
#ifdef USE_MEASUREMENT
static const USHORT aAbsSpaceInch[ MAXLEVEL ] =
{
227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268
};
2000-11-20 08:16:31 +00:00
const USHORT* pArr = MEASURE_METRIC ==
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
SvtSysLocale().GetLocaleData().getMeasurementSystemEnum()
2000-09-18 23:08:29 +00:00
? aAbsSpace
: aAbsSpaceInch;
#else
const USHORT* pArr = aAbsSpace;
#endif
// --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - (*pArr) );
}
else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetLabelFollowedBy( SvxNumberFormat::SPACE );
aFmt.SetFirstLineIndent( - (*pArr) );
}
// <--
2000-09-18 23:08:29 +00:00
for( n = 0; n < MAXLEVEL; ++n, ++pArr )
{
switch( n )
{
case 0: aFmt.SetBulletChar( 0x27a2 ); break;
case 1: aFmt.SetBulletChar( 0xE006 ); break;
default: aFmt.SetBulletChar( 0xE004 ); break;
2000-09-18 23:08:29 +00:00
}
// --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( *pArr );
}
else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetListtabPos( *pArr );
aFmt.SetIndentAt( *pArr );
}
// <--
2000-09-18 23:08:29 +00:00
pNewRule->Set( n, aFmt );
}
}
break;
case RES_POOLNUMRULE_BUL5:
{
SwNumFmt aFmt;
// --> OD 2008-02-11 #newlistlevelattrs#
aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode );
// <--
aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL);
2000-09-18 23:08:29 +00:00
aFmt.SetCharFmt( pBullCFmt );
aFmt.SetStart( 1 );
aFmt.SetIncludeUpperLevels( 1 );
aFmt.SetBulletChar( 0x2717 );
// --> OD 2006-06-29 #6440955#
aFmt.SetBulletFont( &numfunc::GetDefBulletFont() );
// <--
2000-09-18 23:08:29 +00:00
static const USHORT aAbsSpace[ MAXLEVEL ] =
{
// cm: 0,4 0,8 1,2 1,6 2,0 2,4 2,8 3,2 3,6 4,0
227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268
};
#ifdef USE_MEASUREMENT
static const USHORT aAbsSpaceInch[ MAXLEVEL ] =
{
227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268
};
2000-11-20 08:16:31 +00:00
const USHORT* pArr = MEASURE_METRIC ==
CWS-TOOLING: integrate CWS oj18 2009-08-21 15:08:49 +0200 oj r275263 : wrong check 2009-08-21 08:56:01 +0200 oj r275215 : missing not 2009-08-20 07:27:13 +0200 oj r275164 : use new method from global 2009-08-19 10:22:35 +0200 oj r275138 : call GetLocale instead of pLocale 2009-08-18 10:39:32 +0200 oj r275082 : missing header include 2009-08-18 10:09:44 +0200 oj r275081 : new methods at global 2009-08-18 10:09:00 +0200 oj r275080 : unused var 2009-08-18 08:59:04 +0200 oj r275078 : move files from classes to xml 2009-08-17 14:58:16 +0200 oj r275056 : CWS-TOOLING: rebase CWS oj18 to trunk@275001 (milestone: DEV300:m55) 2009-08-17 13:29:44 +0200 oj r275047 : compile error 2009-08-17 13:27:47 +0200 oj r275045 : compile error 2009-08-17 11:44:54 +0200 oj r275040 : add dep 2009-07-22 14:26:05 +0200 oj r274240 : move unused services into fwl 2009-07-22 14:25:35 +0200 oj r274239 : move unused services into fwl 2009-07-22 13:47:45 +0200 oj r274233 : remove some unused code 2009-07-22 09:06:20 +0200 oj r274219 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 08:48:58 +0200 oj r274218 : create NumberFormatter on demand 2009-07-22 08:39:23 +0200 oj r274217 : change char to sal_Char 2009-07-22 07:33:34 +0200 oj r274214 : export dbtoolsclient dbcharsethelper for sc 2009-07-22 07:30:04 +0200 oj r274213 : late init of numberformatter and breakiterator 2009-07-22 07:28:55 +0200 oj r274212 : export dbtoolsclient dbcharsethelper for sc 2009-07-21 13:43:28 +0200 oj r274196 : check if quick start is enbaled 2009-07-21 13:40:09 +0200 oj r274195 : check config entry for UiEventsLogger 2009-07-21 13:37:40 +0200 oj r274194 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:35:38 +0200 oj r274193 : code refactoring, remove of duplicate code and some late inits and removale of not needed files 2009-07-21 13:33:41 +0200 oj r274192 : doc meta data will now be created on demand 2009-07-21 13:13:40 +0200 oj r274187 : load ldap functions on demand 2009-07-21 13:03:17 +0200 oj r274183 : late init of TransliterationImpl 2009-07-21 12:36:10 +0200 oj r274180 : late init of charClass
2009-09-08 04:57:32 +00:00
SvtSysLocale().GetLocaleData().getMeasurementSystemEnum()
2000-09-18 23:08:29 +00:00
? aAbsSpace
: aAbsSpaceInch;
#else
const USHORT* pArr = aAbsSpace;
#endif
// --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetFirstLineOffset( - (*pArr) );
}
else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB );
aFmt.SetFirstLineIndent( - (*pArr) );
}
// <--
2000-09-18 23:08:29 +00:00
for( n = 0; n < MAXLEVEL; ++n, ++pArr )
{
// --> OD 2008-02-11 #newlistlevelattrs#
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
aFmt.SetAbsLSpace( *pArr );
}
else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT )
{
aFmt.SetListtabPos( *pArr );
aFmt.SetIndentAt( *pArr );
}
// <--
2000-09-18 23:08:29 +00:00
pNewRule->Set( n, aFmt );
}
}
break;
}
return pNewRule;
}
// pruefe, ob diese "Auto-Collection" in Dokument schon/noch
// benutzt wird
bool SwDoc::IsPoolPageDescUsed( USHORT nId ) const
2000-09-18 23:08:29 +00:00
{
ASSERT( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END,
"Falsche AutoFormat-Id" );
SwPageDesc *pNewPgDsc = 0;
2000-09-18 23:08:29 +00:00
BOOL bFnd = FALSE;
for( USHORT n = 0; !bFnd && n < aPageDescs.Count(); ++n )
{
pNewPgDsc = aPageDescs[ n ];
if( nId == pNewPgDsc->GetPoolFmtId() )
2000-09-18 23:08:29 +00:00
bFnd = TRUE;
}
2000-09-18 23:08:29 +00:00
// nicht gefunden oder keine Abhaengigen ?
if( !bFnd || !pNewPgDsc->GetDepends() ) // ??????
return FALSE;
// dann teste mal, ob es abhaengige ContentNodes im Nodes Array gibt
// (auch indirekte fuer Format-Ableitung! )
SwAutoFmtGetDocNode aGetHt( &aNodes );
return !pNewPgDsc->GetInfo( aGetHt );
}
// erfrage ob die Absatz-/Zeichen-/Rahmen-/Seiten - Vorlage benutzt wird
sal_Bool SwDoc::IsUsed( const SwModify& rModify ) const
2000-09-18 23:08:29 +00:00
{
// dann teste mal, ob es abhaengige ContentNodes im Nodes Array gibt
// (auch indirekte fuer Format-Ableitung! )
SwAutoFmtGetDocNode aGetHt( &aNodes );
return !rModify.GetInfo( aGetHt );
}
// erfrage ob die NumRule benutzt wird
sal_Bool SwDoc::IsUsed( const SwNumRule& rRule ) const
2000-09-18 23:08:29 +00:00
{
// --> OD 2008-03-04 #refactorlists#
// // dann teste mal, ob es abhaengige ContentNodes im Nodes Array gibt
// // (auch indirekte fuer Format-Ableitung! )
// sal_Bool bUsed = FALSE;
// SwAutoFmtGetDocNode aGetHt( &aNodes );
// SwModify* pMod;
// const SfxPoolItem* pItem;
// USHORT i, nMaxItems = GetAttrPool().GetItemCount( RES_PARATR_NUMRULE);
// for( i = 0; i < nMaxItems; ++i )
// {
// if( 0 != (pItem = GetAttrPool().GetItem( RES_PARATR_NUMRULE, i ) ) &&
// 0 != ( pMod = (SwModify*)((SwNumRuleItem*)pItem)->GetDefinedIn()) &&
// ((SwNumRuleItem*)pItem)->GetValue().Len() &&
// ((SwNumRuleItem*)pItem)->GetValue() == rRule.GetName() )
// {
// if( pMod->IsA( TYPE( SwFmt )) )
// {
// bUsed = !pMod->GetInfo( aGetHt );
// if( bUsed )
// break;
// }
// else if( ((SwTxtNode*)pMod)->GetNodes().IsDocNodes() )
// {
// bUsed = TRUE;
// break;
// }
// }
// }
// return bUsed;
sal_Bool bUsed = rRule.GetTxtNodeListSize() > 0 ||
rRule.GetParagraphStyleListSize() > 0;
2000-09-18 23:08:29 +00:00
return bUsed;
// <--
2000-09-18 23:08:29 +00:00
}
// Suche die Position vom Vorlagen-Namen. Ist nicht vorhanden
// dann fuege neu ein
USHORT SwDoc::SetDocPattern( const String& rPatternName )
{
ASSERT( rPatternName.Len(), "kein Dokument-Vorlagenname" );
USHORT nNewPos = aPatternNms.Count();
for( USHORT n = 0; n < aPatternNms.Count(); ++n )
if( !aPatternNms[n] )
{
if( nNewPos == aPatternNms.Count() )
nNewPos = n;
}
else if( rPatternName == *aPatternNms[n] )
return n;
if( nNewPos < aPatternNms.Count() )
aPatternNms.Remove( nNewPos ); // Platz wieder frei machen
String* pNewNm = new String( rPatternName );
aPatternNms.Insert( pNewNm, nNewPos );
SetModified();
return nNewPos;
}
USHORT GetPoolParent( USHORT nId )
{
USHORT nRet = USHRT_MAX;
if( POOLGRP_NOCOLLID & nId ) // 1 == Formate / 0 == Collections
{
switch( ( COLL_GET_RANGE_BITS | POOLGRP_NOCOLLID ) & nId )
{
case POOLGRP_CHARFMT:
case POOLGRP_FRAMEFMT:
nRet = 0; // vom default abgeleitet
break;
case POOLGRP_PAGEDESC:
case POOLGRP_NUMRULE:
break; // es gibt keine Ableitung
}
}
else
{
switch( COLL_GET_RANGE_BITS & nId )
{
case COLL_TEXT_BITS:
switch( nId )
{
case RES_POOLCOLL_STANDARD:
nRet = 0; break;
case RES_POOLCOLL_TEXT_IDENT:
case RES_POOLCOLL_TEXT_NEGIDENT:
case RES_POOLCOLL_TEXT_MOVE:
case RES_POOLCOLL_CONFRONTATION:
case RES_POOLCOLL_MARGINAL:
nRet = RES_POOLCOLL_TEXT; break;
case RES_POOLCOLL_TEXT:
case RES_POOLCOLL_GREETING:
case RES_POOLCOLL_SIGNATURE:
case RES_POOLCOLL_HEADLINE_BASE:
nRet = RES_POOLCOLL_STANDARD; break;
case RES_POOLCOLL_HEADLINE1:
case RES_POOLCOLL_HEADLINE2:
case RES_POOLCOLL_HEADLINE3:
case RES_POOLCOLL_HEADLINE4:
case RES_POOLCOLL_HEADLINE5:
case RES_POOLCOLL_HEADLINE6:
case RES_POOLCOLL_HEADLINE7:
case RES_POOLCOLL_HEADLINE8:
case RES_POOLCOLL_HEADLINE9:
case RES_POOLCOLL_HEADLINE10:
nRet = RES_POOLCOLL_HEADLINE_BASE; break;
}
break;
case COLL_LISTS_BITS:
switch( nId )
{
case RES_POOLCOLL_NUMBUL_BASE:
nRet = RES_POOLCOLL_TEXT; break;
default:
nRet = RES_POOLCOLL_NUMBUL_BASE; break;
}
break;
case COLL_EXTRA_BITS:
switch( nId )
{
case RES_POOLCOLL_FRAME:
nRet = RES_POOLCOLL_TEXT; break;
case RES_POOLCOLL_TABLE_HDLN:
nRet = RES_POOLCOLL_TABLE; break;
case RES_POOLCOLL_TABLE:
2000-09-18 23:08:29 +00:00
case RES_POOLCOLL_FOOTNOTE:
case RES_POOLCOLL_ENDNOTE:
case RES_POOLCOLL_JAKETADRESS:
case RES_POOLCOLL_SENDADRESS:
case RES_POOLCOLL_HEADER:
case RES_POOLCOLL_HEADERL:
case RES_POOLCOLL_HEADERR:
case RES_POOLCOLL_FOOTER:
case RES_POOLCOLL_FOOTERL:
case RES_POOLCOLL_FOOTERR:
case RES_POOLCOLL_LABEL:
nRet = RES_POOLCOLL_STANDARD; break;
case RES_POOLCOLL_LABEL_ABB:
case RES_POOLCOLL_LABEL_TABLE:
case RES_POOLCOLL_LABEL_FRAME:
case RES_POOLCOLL_LABEL_DRAWING:
nRet = RES_POOLCOLL_LABEL; break;
}
break;
case COLL_REGISTER_BITS:
switch( nId )
{
case RES_POOLCOLL_REGISTER_BASE:
nRet = RES_POOLCOLL_STANDARD; break;
case RES_POOLCOLL_TOX_USERH:
case RES_POOLCOLL_TOX_CNTNTH:
case RES_POOLCOLL_TOX_IDXH:
case RES_POOLCOLL_TOX_ILLUSH:
case RES_POOLCOLL_TOX_OBJECTH:
case RES_POOLCOLL_TOX_TABLESH:
case RES_POOLCOLL_TOX_AUTHORITIESH:
nRet = RES_POOLCOLL_HEADLINE_BASE; break;
default:
nRet = RES_POOLCOLL_REGISTER_BASE; break;
}
break;
case COLL_DOC_BITS:
nRet = RES_POOLCOLL_HEADLINE_BASE;
break;
case COLL_HTML_BITS:
nRet = RES_POOLCOLL_STANDARD;
break;
}
}
return nRet;
}
void SwDoc::RemoveAllFmtLanguageDependencies()
{
/* #106748# Restore the language independ pool defaults and styles. */
GetAttrPool().ResetPoolDefaultItem( RES_PARATR_ADJUST );
SwTxtFmtColl * pTxtFmtColl = GetTxtCollFromPool( RES_POOLCOLL_STANDARD );
pTxtFmtColl->ResetFmtAttr( RES_PARATR_ADJUST );
/* #111214# koreans do not like SvxScriptItem(TRUE) */
pTxtFmtColl->ResetFmtAttr( RES_PARATR_SCRIPTSPACE );
SvxFrameDirectionItem aFrameDir( FRMDIR_HORI_LEFT_TOP, RES_FRAMEDIR );
sal_uInt16 nCount = GetPageDescCnt();
for( sal_uInt16 i=0; i<nCount; ++i )
{
SwPageDesc& rDesc = _GetPageDesc( i );
rDesc.GetMaster().SetFmtAttr( aFrameDir );
rDesc.GetLeft().SetFmtAttr( aFrameDir );
}
// OD 09.10.2003 #i18732# - restore static pool default for item
// RES_FOLLOW_TEXT_FLOW.
GetAttrPool().ResetPoolDefaultItem( RES_FOLLOW_TEXT_FLOW );
//#i16874# AutoKerning as default for new documents
GetAttrPool().ResetPoolDefaultItem( RES_CHRATR_AUTOKERN );
}