1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 // MARKER(update_precomp.py): autogen include statement, do not remove 29 #include "precompiled_sw.hxx" 30 31 #include <hintids.hxx> 32 #include <i18npool/mslangid.hxx> 33 #include <unotools/localedatawrapper.hxx> 34 #include <editeng/paperinf.hxx> 35 #include <editeng/wghtitem.hxx> 36 #include <editeng/fontitem.hxx> 37 #include <editeng/fhgtitem.hxx> 38 #include <editeng/tstpitem.hxx> 39 #include <editeng/lrspitem.hxx> 40 #include <editeng/ulspitem.hxx> 41 #include <editeng/adjitem.hxx> 42 #include <editeng/postitem.hxx> 43 #include <editeng/keepitem.hxx> 44 #include <editeng/opaqitem.hxx> 45 #include <editeng/boxitem.hxx> 46 #include <editeng/cmapitem.hxx> 47 #include <editeng/udlnitem.hxx> 48 #include <editeng/colritem.hxx> 49 #include <editeng/protitem.hxx> 50 #include <editeng/escpitem.hxx> 51 #include <editeng/langitem.hxx> 52 #include <editeng/charrotateitem.hxx> 53 #include <editeng/frmdiritem.hxx> 54 #include <editeng/emphitem.hxx> 55 #include <editeng/scriptspaceitem.hxx> 56 #include <viewopt.hxx> 57 #include <doc.hxx> 58 #include <IDocumentUndoRedo.hxx> 59 #include <fmtanchr.hxx> 60 #include <fmtornt.hxx> 61 #include <fmtsrnd.hxx> 62 #include <fmtfsize.hxx> 63 #include <poolfmt.hxx> 64 #include <paratr.hxx> 65 #include <pagedesc.hxx> 66 #include <frmtool.hxx> 67 #include <charfmt.hxx> 68 #include <docary.hxx> 69 #include <fmtcol.hxx> 70 #include <ndtxt.hxx> 71 #include <fmtline.hxx> 72 #include <poolfmt.hrc> 73 #include <GetMetricVal.hxx> 74 #include <numrule.hxx> 75 76 77 using namespace ::com::sun::star; 78 79 const sal_uInt16 PT_3 = 3 * 20; // 3 pt 80 const sal_uInt16 PT_6 = 6 * 20; // 6 pt 81 const sal_uInt16 PT_7 = 7 * 20; // 6 pt 82 const sal_uInt16 PT_8 = 8 * 20; // 8 pt 83 const sal_uInt16 PT_9 = 9 * 20; // 9 pt 84 const sal_uInt16 PT_10 = 10 * 20; // 10 pt 85 const sal_uInt16 PT_11 = 11 * 20; // 11 pt 86 const sal_uInt16 PT_12 = 12 * 20; // 12 pt 87 const sal_uInt16 PT_14 = 14 * 20; // 14 pt 88 const sal_uInt16 PT_16 = 16 * 20; // 16 pt 89 const sal_uInt16 PT_18 = 18 * 20; // 18 pt 90 const sal_uInt16 PT_22 = 22 * 20; // 22 pt 91 const sal_uInt16 PT_24 = 24 * 20; // 22 pt 92 93 94 //const sal_uInt16 HTML_PARSPACE = ((CM_05 * 7) / 10); 95 #define HTML_PARSPACE GetMetricVal( CM_05 ) 96 97 static const sal_Char __FAR_DATA sKomma[] = ", "; 98 99 static const sal_uInt16 aHeadlineSizes[ 2 * MAXLEVEL ] = { 100 // PT_16, PT_14, PT_14, PT_12, PT_12, // normal 101 //JP 10.12.96: jetzt soll alles prozentual sein: 102 115, 100, 100, 85, 85, 103 75, 75, 75, 75, 75, // normal 104 // PT_22, PT_16, PT_12, PT_11, PT_9 // HTML-Mode 105 PT_24, PT_18, PT_14, PT_12, PT_10, 106 PT_7, PT_7, PT_7, PT_7, PT_7 // HTML-Mode 107 }; 108 109 long lcl_GetRightMargin( SwDoc& rDoc ) 110 { 111 // sorge dafuer, dass die Druckereinstellungen in die Standard- 112 // Seitenvorlage uebernommen wurden. 113 const SwFrmFmt& rPgDscFmt = 114 const_cast<const SwDoc *>(&rDoc)->GetPageDesc( 0 ).GetMaster(); 115 const SvxLRSpaceItem& rLR = rPgDscFmt.GetLRSpace(); 116 const long nLeft = rLR.GetLeft(); 117 const long nRight = rLR.GetRight(); 118 const long nWidth = rPgDscFmt.GetFrmSize().GetWidth(); 119 return nWidth - nLeft - nRight; 120 } 121 122 void SetAllScriptItem( SfxItemSet& rSet, const SfxPoolItem& rItem ) 123 { 124 rSet.Put( rItem ); 125 sal_uInt16 nWhCJK = 0, nWhCTL = 0; 126 switch( rItem.Which() ) 127 { 128 case RES_CHRATR_FONTSIZE: 129 nWhCJK = RES_CHRATR_CJK_FONTSIZE, nWhCTL = RES_CHRATR_CTL_FONTSIZE; 130 break; 131 case RES_CHRATR_FONT: 132 nWhCJK = RES_CHRATR_CJK_FONT, nWhCTL = RES_CHRATR_CTL_FONT; 133 break; 134 case RES_CHRATR_LANGUAGE: 135 nWhCJK = RES_CHRATR_CJK_LANGUAGE, nWhCTL = RES_CHRATR_CTL_LANGUAGE; 136 break; 137 case RES_CHRATR_POSTURE: 138 nWhCJK = RES_CHRATR_CJK_POSTURE, nWhCTL = RES_CHRATR_CTL_POSTURE; 139 break; 140 case RES_CHRATR_WEIGHT: 141 nWhCJK = RES_CHRATR_CJK_WEIGHT, nWhCTL = RES_CHRATR_CTL_WEIGHT; 142 break; 143 } 144 145 if( nWhCJK ) 146 rSet.Put( rItem, nWhCJK ); 147 if( nWhCTL ) 148 rSet.Put( rItem, nWhCTL ); 149 } 150 151 void lcl_SetDfltFont( sal_uInt16 nFntType, SfxItemSet& rSet ) 152 { 153 static struct { 154 sal_uInt16 nResLngId; 155 sal_uInt16 nResFntId; 156 } aArr[ 3 ] = { 157 { RES_CHRATR_LANGUAGE, RES_CHRATR_FONT }, 158 { RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_FONT }, 159 { RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_FONT } 160 }; 161 for( sal_uInt16 n = 0; n < 3; ++n ) 162 { 163 sal_uInt16 nLng = ((SvxLanguageItem&)rSet.GetPool()->GetDefaultItem( 164 aArr[n].nResLngId )).GetLanguage(); 165 Font aFnt( OutputDevice::GetDefaultFont( nFntType, 166 nLng, DEFAULTFONT_FLAGS_ONLYONE ) ); 167 168 rSet.Put( SvxFontItem( aFnt.GetFamily(), aFnt.GetName(), 169 aEmptyStr, aFnt.GetPitch(), 170 aFnt.GetCharSet(), aArr[n].nResFntId )); 171 } 172 } 173 174 void lcl_SetDfltFont( sal_uInt16 nLatinFntType, sal_uInt16 nCJKFntType, 175 sal_uInt16 nCTLFntType, SfxItemSet& rSet ) 176 { 177 static struct { 178 sal_uInt16 nResLngId; 179 sal_uInt16 nResFntId; 180 sal_uInt16 nFntType; 181 } aArr[ 3 ] = { 182 { RES_CHRATR_LANGUAGE, RES_CHRATR_FONT, 0 }, 183 { RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_FONT, 0 }, 184 { RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_FONT, 0 } 185 }; 186 aArr[0].nFntType = nLatinFntType; 187 aArr[1].nFntType = nCJKFntType; 188 aArr[2].nFntType = nCTLFntType; 189 190 for( sal_uInt16 n = 0; n < 3; ++n ) 191 { 192 sal_uInt16 nLng = ((SvxLanguageItem&)rSet.GetPool()->GetDefaultItem( 193 aArr[n].nResLngId )).GetLanguage(); 194 Font aFnt( OutputDevice::GetDefaultFont( aArr[n].nFntType, 195 nLng, DEFAULTFONT_FLAGS_ONLYONE ) ); 196 197 rSet.Put( SvxFontItem( aFnt.GetFamily(), aFnt.GetName(), 198 aEmptyStr, aFnt.GetPitch(), 199 aFnt.GetCharSet(), aArr[n].nResFntId )); 200 } 201 } 202 203 void lcl_SetHeadline( SwDoc* pDoc, SwTxtFmtColl* pColl, 204 SfxItemSet& rSet, 205 sal_uInt16 nOutLvlBits, sal_uInt8 nLevel, sal_Bool bItalic ) 206 { 207 SetAllScriptItem( rSet, SvxWeightItem( WEIGHT_BOLD, RES_CHRATR_WEIGHT ) ); 208 SvxFontHeightItem aHItem(240, 100, RES_CHRATR_FONTSIZE); 209 const bool bHTMLMode = pDoc->get(IDocumentSettingAccess::HTML_MODE); 210 if( bHTMLMode ) 211 aHItem.SetHeight( aHeadlineSizes[ MAXLEVEL + nLevel ] ); 212 else 213 aHItem.SetHeight( PT_14, aHeadlineSizes[ nLevel ] ); 214 SetAllScriptItem( rSet, aHItem ); 215 216 if( bItalic && !bHTMLMode ) 217 SetAllScriptItem( rSet, SvxPostureItem( ITALIC_NORMAL, RES_CHRATR_POSTURE ) ); 218 219 if( bHTMLMode ) 220 { 221 ::lcl_SetDfltFont( DEFAULTFONT_LATIN_TEXT, DEFAULTFONT_CJK_TEXT, 222 DEFAULTFONT_CTL_TEXT, rSet ); 223 } 224 225 if( pColl ) 226 { 227 if( !( nOutLvlBits & ( 1 << nLevel )) ) 228 { 229 //pColl->SetOutlineLevel( nLevel ); //#outline level zhaojianwei 230 pColl->AssignToListLevelOfOutlineStyle(nLevel);//<-end,zhaojianwei 231 if( !bHTMLMode ) 232 { 233 SwNumRule * pOutlineRule = pDoc->GetOutlineNumRule(); 234 const SwNumFmt& rNFmt = pOutlineRule->Get( nLevel ); 235 // --> OD 2008-02-01 #newlistlevelattrs# 236 if ( rNFmt.GetPositionAndSpaceMode() == 237 SvxNumberFormat::LABEL_WIDTH_AND_POSITION && 238 ( rNFmt.GetAbsLSpace() || rNFmt.GetFirstLineOffset() ) ) 239 // <-- 240 { 241 SvxLRSpaceItem aLR( (SvxLRSpaceItem&)pColl->GetFmtAttr( RES_LR_SPACE ) ); 242 aLR.SetTxtFirstLineOfstValue( rNFmt.GetFirstLineOffset() ); 243 aLR.SetTxtLeft( rNFmt.GetAbsLSpace() ); 244 pColl->SetFmtAttr( aLR ); 245 } 246 247 // --> OD 2006-11-20 #i71764# 248 // Check on document setting OUTLINE_LEVEL_YIELDS_OUTLINE_RULE no longer needed. 249 // All paragraph styles, which are assigned to a level of the 250 // outline style has to have the outline style set as its list style. 251 { 252 SwNumRuleItem aItem(pOutlineRule->GetName()); 253 254 pColl->SetFmtAttr(aItem); 255 } 256 // <-- 257 } 258 } 259 pColl->SetNextTxtFmtColl( *pDoc->GetTxtCollFromPool( 260 RES_POOLCOLL_TEXT )); 261 } 262 } 263 264 265 266 void lcl_SetRegister( SwDoc* pDoc, SfxItemSet& rSet, sal_uInt16 nFact, 267 sal_Bool bHeader, sal_Bool bTab ) 268 { 269 SvxLRSpaceItem aLR( RES_LR_SPACE ); 270 sal_uInt16 nLeft = nFact ? GetMetricVal( CM_05 ) * nFact : 0; 271 aLR.SetTxtLeft( nLeft ); 272 273 rSet.Put( aLR ); 274 if( bHeader ) 275 { 276 SetAllScriptItem( rSet, SvxWeightItem( WEIGHT_BOLD, RES_CHRATR_WEIGHT ) ); 277 SetAllScriptItem( rSet, SvxFontHeightItem( PT_16, 100, RES_CHRATR_FONTSIZE ) ); 278 } 279 if( bTab ) 280 { 281 long nRightMargin = lcl_GetRightMargin( *pDoc ); 282 SvxTabStopItem aTStops( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP ); 283 aTStops.Insert( SvxTabStop( nRightMargin - nLeft, 284 SVX_TAB_ADJUST_RIGHT, 285 cDfltDecimalChar, '.' )); 286 rSet.Put( aTStops ); 287 } 288 } 289 290 291 292 void lcl_SetNumBul( SwDoc* pDoc, SwTxtFmtColl* pColl, 293 SfxItemSet& rSet, 294 sal_uInt16 nNxt, SwTwips nEZ, SwTwips nLeft, 295 SwTwips nUpper, SwTwips nLower ) 296 { 297 298 SvxLRSpaceItem aLR( RES_LR_SPACE ); SvxULSpaceItem aUL( RES_UL_SPACE ); 299 aLR.SetTxtFirstLineOfst( sal_uInt16(nEZ) ); aLR.SetTxtLeft( sal_uInt16(nLeft) ); 300 aUL.SetUpper( sal_uInt16(nUpper) ); aUL.SetLower( sal_uInt16(nLower) ); 301 rSet.Put( aLR ); 302 rSet.Put( aUL ); 303 304 if( !pColl ) 305 pColl->SetNextTxtFmtColl( *pDoc->GetTxtCollFromPool( nNxt )); 306 } 307 308 309 310 // Gebe die "Auto-Collection" mit der Id zurueck. Existiert 311 // sie noch nicht, dann erzeuge sie 312 // Ist der String-Pointer definiert, dann erfrage nur die 313 // Beschreibung der Attribute, !! es legt keine Vorlage an !! 314 315 SvxFrameDirection GetDefaultFrameDirection(sal_uLong nLanguage) 316 { 317 SvxFrameDirection eResult = (MsLangId::isRightToLeft( static_cast<LanguageType>(nLanguage)) ? 318 FRMDIR_HORI_RIGHT_TOP : FRMDIR_HORI_LEFT_TOP); 319 return eResult; 320 } 321 322 SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage ) 323 { 324 ASSERT( 325 (RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END) || 326 (RES_POOLCOLL_LISTS_BEGIN <= nId && nId < RES_POOLCOLL_LISTS_END) || 327 (RES_POOLCOLL_EXTRA_BEGIN <= nId && nId < RES_POOLCOLL_EXTRA_END) || 328 (RES_POOLCOLL_REGISTER_BEGIN <= nId && nId < RES_POOLCOLL_REGISTER_END) || 329 (RES_POOLCOLL_DOC_BEGIN <= nId && nId < RES_POOLCOLL_DOC_END) || 330 (RES_POOLCOLL_HTML_BEGIN <= nId && nId < RES_POOLCOLL_HTML_END), 331 "Falsche AutoFormat-Id" ); 332 333 SwTxtFmtColl* pNewColl; 334 sal_uInt16 nOutLvlBits = 0; 335 for( sal_uInt16 n = 0; n < pTxtFmtCollTbl->Count(); ++n ) 336 { 337 if( nId == ( pNewColl = (*pTxtFmtCollTbl)[ n ] )->GetPoolFmtId() ) 338 { 339 return pNewColl; 340 } 341 //if( pNewColl->GetOutlineLevel() < MAXLEVEL ) //#outline level,zhaojianwei 342 //nOutLvlBits |= ( 1 << pNewColl->GetOutlineLevel() ); 343 if( pNewColl->IsAssignedToListLevelOfOutlineStyle()) 344 nOutLvlBits |= ( 1 << pNewColl->GetAssignedOutlineStyleLevel() );//<-end,zhaojianwei 345 } 346 347 // bis hierher nicht gefunden -> neu anlegen 348 sal_uInt16 nResId = 0; 349 if( RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END ) 350 nResId = RC_POOLCOLL_TEXT_BEGIN - RES_POOLCOLL_TEXT_BEGIN; 351 else if (RES_POOLCOLL_LISTS_BEGIN <= nId && nId < RES_POOLCOLL_LISTS_END) 352 nResId = RC_POOLCOLL_LISTS_BEGIN - RES_POOLCOLL_LISTS_BEGIN; 353 else if (RES_POOLCOLL_EXTRA_BEGIN <= nId && nId < RES_POOLCOLL_EXTRA_END) 354 nResId = RC_POOLCOLL_EXTRA_BEGIN - RES_POOLCOLL_EXTRA_BEGIN; 355 else if (RES_POOLCOLL_REGISTER_BEGIN <= nId && nId < RES_POOLCOLL_REGISTER_END) 356 nResId = RC_POOLCOLL_REGISTER_BEGIN - RES_POOLCOLL_REGISTER_BEGIN; 357 else if (RES_POOLCOLL_DOC_BEGIN <= nId && nId < RES_POOLCOLL_DOC_END) 358 nResId = RC_POOLCOLL_DOC_BEGIN - RES_POOLCOLL_DOC_BEGIN; 359 else if (RES_POOLCOLL_HTML_BEGIN <= nId && nId < RES_POOLCOLL_HTML_END) 360 nResId = RC_POOLCOLL_HTML_BEGIN - RES_POOLCOLL_HTML_BEGIN; 361 362 ASSERT( nResId, "Ungueltige Pool-ID" ); 363 if( !nResId ) 364 return GetTxtCollFromPool( RES_POOLCOLL_STANDARD ); 365 366 ResId aResId( nResId + nId, *pSwResMgr ); 367 String aNm( aResId ); 368 369 // ein Set fuer alle zusetzenden Attribute 370 SwAttrSet aSet( GetAttrPool(), aTxtFmtCollSetRange ); 371 sal_uInt16 nParent = GetPoolParent( nId ); 372 373 { 374 375 //FEATURE::CONDCOLL 376 if(::IsConditionalByPoolId( nId )) 377 pNewColl = new SwConditionTxtFmtColl( GetAttrPool(), aNm, !nParent 378 ? pDfltTxtFmtColl 379 : GetTxtCollFromPool( nParent )); 380 else 381 //FEATURE::CONDCOLL 382 pNewColl = new SwTxtFmtColl( GetAttrPool(), aNm, !nParent 383 ? pDfltTxtFmtColl 384 : GetTxtCollFromPool( nParent )); 385 pNewColl->SetPoolFmtId( nId ); 386 pTxtFmtCollTbl->Insert( pNewColl, pTxtFmtCollTbl->Count() ); 387 } 388 389 switch( nId ) 390 { 391 // allgemeine Inhaltsformen 392 case RES_POOLCOLL_STANDARD: 393 /* #111214# koreans do not like SvxScriptItem(sal_True) */ 394 if (bRegardLanguage) 395 { 396 sal_uLong nAppLanguage = GetAppLanguage(); 397 if (GetDefaultFrameDirection(nAppLanguage) == 398 FRMDIR_HORI_RIGHT_TOP) 399 { 400 SvxAdjustItem aAdjust(SVX_ADJUST_RIGHT, RES_PARATR_ADJUST ); 401 aSet.Put(aAdjust); 402 } 403 if (nAppLanguage == LANGUAGE_KOREAN) 404 { 405 SvxScriptSpaceItem aScriptSpace(sal_False, RES_PARATR_SCRIPTSPACE); 406 aSet.Put(aScriptSpace); 407 } 408 } 409 break; 410 411 case RES_POOLCOLL_TEXT: // Textkoerper 412 { 413 SvxULSpaceItem aUL( 0, PT_6, RES_UL_SPACE ); 414 if( get(IDocumentSettingAccess::HTML_MODE) ) aUL.SetLower( HTML_PARSPACE ); 415 aSet.Put( aUL ); 416 } 417 break; 418 case RES_POOLCOLL_TEXT_IDENT: // Textkoerper Einzug 419 { 420 SvxLRSpaceItem aLR( RES_LR_SPACE ); 421 aLR.SetTxtFirstLineOfst( GetMetricVal( CM_05 )); 422 aSet.Put( aLR ); 423 } 424 break; 425 case RES_POOLCOLL_TEXT_NEGIDENT: // Textkoerper neg. Einzug 426 { 427 SvxLRSpaceItem aLR( RES_LR_SPACE ); 428 aLR.SetTxtFirstLineOfst( -(short)GetMetricVal( CM_05 )); 429 aLR.SetTxtLeft( GetMetricVal( CM_1 )); 430 SvxTabStopItem aTStops(RES_PARATR_TABSTOP); aTStops.Insert( SvxTabStop( 0 )); 431 432 aSet.Put( aLR ); 433 aSet.Put( aTStops ); 434 } 435 break; 436 case RES_POOLCOLL_TEXT_MOVE: // Textkoerper Einrueckung 437 { 438 SvxLRSpaceItem aLR( RES_LR_SPACE ); 439 aLR.SetTxtLeft( GetMetricVal( CM_05 )); 440 aSet.Put( aLR ); 441 } 442 break; 443 444 case RES_POOLCOLL_CONFRONTATION: // Textkoerper Gegenueberstellung 445 { 446 SvxLRSpaceItem aLR( RES_LR_SPACE ); 447 aLR.SetTxtFirstLineOfst( - short( GetMetricVal( CM_1 ) * 4 + 448 GetMetricVal( CM_05)) ); 449 aLR.SetTxtLeft( GetMetricVal( CM_1 ) * 5 ); 450 SvxTabStopItem aTStops( RES_PARATR_TABSTOP ); aTStops.Insert( SvxTabStop( 0 )); 451 452 aSet.Put( aLR ); 453 aSet.Put( aTStops ); 454 } 455 break; 456 case RES_POOLCOLL_MARGINAL: // Textkoerper maginalie 457 { 458 SvxLRSpaceItem aLR( RES_LR_SPACE ); 459 aLR.SetTxtLeft( GetMetricVal( CM_1 ) * 4 ); 460 aSet.Put( aLR ); 461 } 462 break; 463 464 case RES_POOLCOLL_HEADLINE_BASE: // Basis Ueberschrift 465 { 466 static const sal_uInt16 aFntInit[] = { 467 DEFAULTFONT_LATIN_HEADING, RES_CHRATR_FONT, 468 RES_CHRATR_LANGUAGE, LANGUAGE_ENGLISH_US, 469 DEFAULTFONT_CJK_HEADING, RES_CHRATR_CJK_FONT, 470 RES_CHRATR_CJK_LANGUAGE, LANGUAGE_ENGLISH_US, 471 DEFAULTFONT_CTL_HEADING, RES_CHRATR_CTL_FONT, 472 RES_CHRATR_CTL_LANGUAGE, LANGUAGE_ARABIC_SAUDI_ARABIA, 473 0 474 }; 475 476 for( const sal_uInt16* pArr = aFntInit; *pArr; pArr += 4 ) 477 { 478 sal_uInt16 nLng = ((SvxLanguageItem&)GetDefault( *(pArr+2) )).GetLanguage(); 479 if( LANGUAGE_DONTKNOW == nLng ) 480 nLng = *(pArr+3); 481 482 Font aFnt( OutputDevice::GetDefaultFont( *pArr, 483 nLng, DEFAULTFONT_FLAGS_ONLYONE ) ); 484 485 aSet.Put( SvxFontItem( aFnt.GetFamily(), aFnt.GetName(), 486 aEmptyStr, aFnt.GetPitch(), 487 aFnt.GetCharSet(), *(pArr+1) )); 488 } 489 490 SvxFontHeightItem aFntSize( PT_14, 100, RES_CHRATR_FONTSIZE ); 491 SvxULSpaceItem aUL( PT_12, PT_6, RES_UL_SPACE ); 492 if( get(IDocumentSettingAccess::HTML_MODE) ) 493 aUL.SetLower( HTML_PARSPACE ); 494 aSet.Put( SvxFmtKeepItem( sal_True, RES_KEEP )); 495 496 pNewColl->SetNextTxtFmtColl( *GetTxtCollFromPool( RES_POOLCOLL_TEXT )); 497 498 aSet.Put( aUL ); 499 SetAllScriptItem( aSet, aFntSize ); 500 } 501 break; 502 503 case RES_POOLCOLL_NUMBUL_BASE: // Basis Numerierung/Aufzaehlung 504 break; 505 506 case RES_POOLCOLL_GREETING: // Grussformel 507 case RES_POOLCOLL_REGISTER_BASE: // Basis Verzeichnisse 508 case RES_POOLCOLL_SIGNATURE: // Unterschrift 509 case RES_POOLCOLL_TABLE: // Tabelle-Inhalt 510 { 511 SwFmtLineNumber aLN; aLN.SetCountLines( sal_False ); 512 aSet.Put( aLN ); 513 } 514 break; 515 516 case RES_POOLCOLL_HEADLINE1: // Ueberschrift 1 517 lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 0, sal_False ); 518 break; 519 case RES_POOLCOLL_HEADLINE2: // Ueberschrift 2 520 lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 1, sal_True ); 521 break; 522 case RES_POOLCOLL_HEADLINE3: // Ueberschrift 3 523 lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 2, sal_False ); 524 break; 525 case RES_POOLCOLL_HEADLINE4: // Ueberschrift 4 526 lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 3, sal_True ); 527 break; 528 case RES_POOLCOLL_HEADLINE5: // Ueberschrift 5 529 lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 4, sal_False ); 530 break; 531 case RES_POOLCOLL_HEADLINE6: // Ueberschrift 6 532 lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 5, sal_False ); 533 break; 534 case RES_POOLCOLL_HEADLINE7: // Ueberschrift 7 535 lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 6, sal_False ); 536 break; 537 case RES_POOLCOLL_HEADLINE8: // Ueberschrift 8 538 lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 7, sal_False ); 539 break; 540 case RES_POOLCOLL_HEADLINE9: // Ueberschrift 9 541 lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 8, sal_False ); 542 break; 543 case RES_POOLCOLL_HEADLINE10: // Ueberschrift 10 544 lcl_SetHeadline( this, pNewColl, aSet, nOutLvlBits, 9, sal_False ); 545 break; 546 547 548 // Sonderbereiche: 549 // Kopfzeilen 550 case RES_POOLCOLL_HEADER: 551 case RES_POOLCOLL_HEADERL: 552 case RES_POOLCOLL_HEADERR: 553 // Fusszeilen 554 case RES_POOLCOLL_FOOTER: 555 case RES_POOLCOLL_FOOTERL: 556 case RES_POOLCOLL_FOOTERR: 557 { 558 SwFmtLineNumber aLN; aLN.SetCountLines( sal_False ); 559 aSet.Put( aLN ); 560 561 long nRightMargin = lcl_GetRightMargin( *this ); 562 563 SvxTabStopItem aTStops( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP ); 564 aTStops.Insert( SvxTabStop( nRightMargin / 2, SVX_TAB_ADJUST_CENTER ) ); 565 aTStops.Insert( SvxTabStop( nRightMargin, SVX_TAB_ADJUST_RIGHT ) ); 566 567 aSet.Put( aTStops ); 568 } 569 break; 570 571 case RES_POOLCOLL_TABLE_HDLN: 572 { 573 SetAllScriptItem( aSet, SvxWeightItem( WEIGHT_BOLD, RES_CHRATR_WEIGHT ) ); 574 aSet.Put( SvxAdjustItem( SVX_ADJUST_CENTER, RES_PARATR_ADJUST ) ); 575 SwFmtLineNumber aLN; aLN.SetCountLines( sal_False ); 576 aSet.Put( aLN ); 577 } 578 break; 579 580 case RES_POOLCOLL_FOOTNOTE: // Fussnote 581 case RES_POOLCOLL_ENDNOTE: 582 { 583 SvxLRSpaceItem aLR( RES_LR_SPACE ); 584 aLR.SetTxtFirstLineOfst( -(short)GetMetricVal( CM_05 )); 585 aLR.SetTxtLeft( GetMetricVal( CM_05 )); 586 SetAllScriptItem( aSet, SvxFontHeightItem( PT_10, 100, RES_CHRATR_FONTSIZE ) ); 587 aSet.Put( aLR ); 588 SwFmtLineNumber aLN; aLN.SetCountLines( sal_False ); 589 aSet.Put( aLN ); 590 } 591 break; 592 593 case RES_POOLCOLL_LABEL: // Beschriftung-Basis 594 { 595 SvxULSpaceItem aUL( RES_UL_SPACE ); aUL.SetUpper( PT_6 ); aUL.SetLower( PT_6 ); 596 aSet.Put( aUL ); 597 SetAllScriptItem( aSet, SvxPostureItem( ITALIC_NORMAL, RES_CHRATR_POSTURE ) ); 598 SetAllScriptItem( aSet, SvxFontHeightItem( PT_10, 100, RES_CHRATR_FONTSIZE ) ); 599 SwFmtLineNumber aLN; aLN.SetCountLines( sal_False ); 600 aSet.Put( aLN ); 601 } 602 break; 603 604 case RES_POOLCOLL_FRAME: // Rahmen Inhalt 605 case RES_POOLCOLL_LABEL_ABB: // Beschriftung-Abbildung 606 case RES_POOLCOLL_LABEL_TABLE: // Beschriftung-Tabelle 607 case RES_POOLCOLL_LABEL_FRAME: // Beschriftung-Rahmen 608 case RES_POOLCOLL_LABEL_DRAWING: // Beschriftung-Zeichnung 609 break; 610 611 case RES_POOLCOLL_JAKETADRESS: // UmschlagAdresse 612 { 613 SvxULSpaceItem aUL( RES_UL_SPACE ); aUL.SetLower( PT_3 ); 614 aSet.Put( aUL ); 615 SwFmtLineNumber aLN; aLN.SetCountLines( sal_False ); 616 aSet.Put( aLN ); 617 } 618 break; 619 620 case RES_POOLCOLL_SENDADRESS: // AbsenderAdresse 621 { 622 if( get(IDocumentSettingAccess::HTML_MODE) ) 623 SetAllScriptItem( aSet, SvxPostureItem(ITALIC_NORMAL, RES_CHRATR_POSTURE) ); 624 else 625 { 626 SvxULSpaceItem aUL( RES_UL_SPACE ); aUL.SetLower( PT_3 ); 627 aSet.Put( aUL ); 628 } 629 SwFmtLineNumber aLN; aLN.SetCountLines( sal_False ); 630 aSet.Put( aLN ); 631 } 632 break; 633 634 // Benutzer-Verzeichnisse: 635 case RES_POOLCOLL_TOX_USERH: // Header 636 lcl_SetRegister( this, aSet, 0, sal_True, sal_False ); 637 { 638 SwFmtLineNumber aLN; aLN.SetCountLines( sal_False ); 639 aSet.Put( aLN ); 640 } 641 break; 642 case RES_POOLCOLL_TOX_USER1: // 1. Ebene 643 lcl_SetRegister( this, aSet, 0, sal_False, sal_True ); 644 break; 645 case RES_POOLCOLL_TOX_USER2: // 2. Ebene 646 lcl_SetRegister( this, aSet, 1, sal_False, sal_True ); 647 break; 648 case RES_POOLCOLL_TOX_USER3: // 3. Ebene 649 lcl_SetRegister( this, aSet, 2, sal_False, sal_True ); 650 break; 651 case RES_POOLCOLL_TOX_USER4: // 4. Ebene 652 lcl_SetRegister( this, aSet, 3, sal_False, sal_True ); 653 break; 654 case RES_POOLCOLL_TOX_USER5: // 5. Ebene 655 lcl_SetRegister( this, aSet, 4, sal_False, sal_True ); 656 break; 657 case RES_POOLCOLL_TOX_USER6: // 6. Ebene 658 lcl_SetRegister( this, aSet, 5, sal_False, sal_True ); 659 break; 660 case RES_POOLCOLL_TOX_USER7: // 7. Ebene 661 lcl_SetRegister( this, aSet, 6, sal_False, sal_True ); 662 break; 663 case RES_POOLCOLL_TOX_USER8: // 8. Ebene 664 lcl_SetRegister( this, aSet, 7, sal_False, sal_True ); 665 break; 666 case RES_POOLCOLL_TOX_USER9: // 9. Ebene 667 lcl_SetRegister( this, aSet, 8, sal_False, sal_True ); 668 break; 669 case RES_POOLCOLL_TOX_USER10: // 10. Ebene 670 lcl_SetRegister( this, aSet, 9, sal_False, sal_True ); 671 break; 672 673 // Index-Verzeichnisse 674 case RES_POOLCOLL_TOX_IDXH: // Header 675 lcl_SetRegister( this, aSet, 0, sal_True, sal_False ); 676 { 677 SwFmtLineNumber aLN; aLN.SetCountLines( sal_False ); 678 aSet.Put( aLN ); 679 } 680 break; 681 case RES_POOLCOLL_TOX_IDX1: // 1. Ebene 682 lcl_SetRegister( this, aSet, 0, sal_False, sal_False ); 683 break; 684 case RES_POOLCOLL_TOX_IDX2: // 2. Ebene 685 lcl_SetRegister( this, aSet, 1, sal_False, sal_False ); 686 break; 687 case RES_POOLCOLL_TOX_IDX3: // 3. Ebene 688 lcl_SetRegister( this, aSet, 2, sal_False, sal_False ); 689 break; 690 case RES_POOLCOLL_TOX_IDXBREAK: // Trenner 691 lcl_SetRegister( this, aSet, 0, sal_False, sal_False ); 692 break; 693 694 // Inhalts-Verzeichnisse 695 case RES_POOLCOLL_TOX_CNTNTH: // Header 696 lcl_SetRegister( this, aSet, 0, sal_True, sal_False ); 697 { 698 SwFmtLineNumber aLN; aLN.SetCountLines( sal_False ); 699 aSet.Put( aLN ); 700 } 701 break; 702 case RES_POOLCOLL_TOX_CNTNT1: // 1. Ebene 703 lcl_SetRegister( this, aSet, 0, sal_False, sal_True ); 704 break; 705 case RES_POOLCOLL_TOX_CNTNT2: // 2. Ebene 706 lcl_SetRegister( this, aSet, 1, sal_False, sal_True ); 707 break; 708 case RES_POOLCOLL_TOX_CNTNT3: // 3. Ebene 709 lcl_SetRegister( this, aSet, 2, sal_False, sal_True ); 710 break; 711 case RES_POOLCOLL_TOX_CNTNT4: // 4. Ebene 712 lcl_SetRegister( this, aSet, 3, sal_False, sal_True ); 713 break; 714 case RES_POOLCOLL_TOX_CNTNT5: // 5. Ebene 715 lcl_SetRegister( this, aSet, 4, sal_False, sal_True ); 716 break; 717 case RES_POOLCOLL_TOX_CNTNT6: // 6. Ebene 718 lcl_SetRegister( this, aSet, 5, sal_False, sal_True ); 719 break; 720 case RES_POOLCOLL_TOX_CNTNT7: // 7. Ebene 721 lcl_SetRegister( this, aSet, 6, sal_False, sal_True ); 722 break; 723 case RES_POOLCOLL_TOX_CNTNT8: // 8. Ebene 724 lcl_SetRegister( this, aSet, 7, sal_False, sal_True ); 725 break; 726 case RES_POOLCOLL_TOX_CNTNT9: // 9. Ebene 727 lcl_SetRegister( this, aSet, 8, sal_False, sal_True ); 728 break; 729 case RES_POOLCOLL_TOX_CNTNT10: // 10. Ebene 730 lcl_SetRegister( this, aSet, 9, sal_False, sal_True ); 731 break; 732 733 case RES_POOLCOLL_TOX_ILLUSH: 734 case RES_POOLCOLL_TOX_OBJECTH: 735 case RES_POOLCOLL_TOX_TABLESH: 736 case RES_POOLCOLL_TOX_AUTHORITIESH: 737 lcl_SetRegister( this, aSet, 0, sal_True, sal_False ); 738 { 739 SwFmtLineNumber aLN; aLN.SetCountLines( sal_False ); 740 aSet.Put( aLN ); 741 } 742 break; 743 case RES_POOLCOLL_TOX_ILLUS1: 744 case RES_POOLCOLL_TOX_OBJECT1: 745 case RES_POOLCOLL_TOX_TABLES1: 746 case RES_POOLCOLL_TOX_AUTHORITIES1: 747 lcl_SetRegister( this, aSet, 0, sal_False, sal_True ); 748 break; 749 750 751 752 case RES_POOLCOLL_NUM_LEVEL1S: 753 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL1, 754 lNumFirstLineOffset, SwNumRule::GetNumIndent( 0 ), 755 PT_12, PT_6 ); 756 break; 757 case RES_POOLCOLL_NUM_LEVEL1: 758 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL1, 759 lNumFirstLineOffset, SwNumRule::GetNumIndent( 0 ), 760 0, PT_6 ); 761 break; 762 case RES_POOLCOLL_NUM_LEVEL1E: 763 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL1, 764 lNumFirstLineOffset, SwNumRule::GetNumIndent( 0 ), 765 0, PT_12 ); 766 break; 767 case RES_POOLCOLL_NUM_NONUM1: 768 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM1, 769 0, SwNumRule::GetNumIndent( 0 ), 0, PT_6 ); 770 break; 771 case RES_POOLCOLL_NUM_LEVEL2S: 772 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL2, 773 lNumFirstLineOffset, SwNumRule::GetNumIndent( 1 ), 774 PT_12, PT_6 ); 775 break; 776 case RES_POOLCOLL_NUM_LEVEL2: 777 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL2, 778 lNumFirstLineOffset, SwNumRule::GetNumIndent( 1 ), 779 0, PT_6 ); 780 break; 781 case RES_POOLCOLL_NUM_LEVEL2E: 782 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL2, 783 lNumFirstLineOffset, SwNumRule::GetNumIndent( 1 ), 784 0, PT_12 ); 785 break; 786 case RES_POOLCOLL_NUM_NONUM2: 787 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM2, 788 0, SwNumRule::GetNumIndent( 1 ), 0, PT_6 ); 789 break; 790 case RES_POOLCOLL_NUM_LEVEL3S: 791 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL3, 792 lNumFirstLineOffset, SwNumRule::GetNumIndent( 2 ), 793 PT_12, PT_6 ); 794 break; 795 case RES_POOLCOLL_NUM_LEVEL3: 796 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL3, 797 lNumFirstLineOffset, SwNumRule::GetNumIndent( 2 ), 798 0, PT_6 ); 799 break; 800 case RES_POOLCOLL_NUM_LEVEL3E: 801 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL3, 802 lNumFirstLineOffset, SwNumRule::GetNumIndent( 2 ), 803 0, PT_12 ); 804 break; 805 case RES_POOLCOLL_NUM_NONUM3: 806 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM3, 807 0, SwNumRule::GetNumIndent( 2 ), 0, PT_6 ); 808 break; 809 case RES_POOLCOLL_NUM_LEVEL4S: 810 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL4, 811 lNumFirstLineOffset, SwNumRule::GetNumIndent( 3 ), 812 PT_12, PT_6 ); 813 break; 814 case RES_POOLCOLL_NUM_LEVEL4: 815 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL4, 816 lNumFirstLineOffset, SwNumRule::GetNumIndent( 3 ), 817 0, PT_6 ); 818 break; 819 case RES_POOLCOLL_NUM_LEVEL4E: 820 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL4, 821 lNumFirstLineOffset, SwNumRule::GetNumIndent( 3 ), 822 0, PT_12 ); 823 break; 824 case RES_POOLCOLL_NUM_NONUM4: 825 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM4, 826 0, SwNumRule::GetNumIndent( 3 ), 0, PT_6 ); 827 break; 828 case RES_POOLCOLL_NUM_LEVEL5S: 829 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL5, 830 lNumFirstLineOffset, SwNumRule::GetNumIndent( 4 ), 831 PT_12, PT_6 ); 832 break; 833 case RES_POOLCOLL_NUM_LEVEL5: 834 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL5, 835 lNumFirstLineOffset, SwNumRule::GetNumIndent( 4 ), 836 0, PT_6 ); 837 break; 838 case RES_POOLCOLL_NUM_LEVEL5E: 839 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_LEVEL5, 840 lNumFirstLineOffset, SwNumRule::GetNumIndent( 4 ), 841 0, PT_12 ); 842 break; 843 case RES_POOLCOLL_NUM_NONUM5: 844 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_NUM_NONUM5, 845 0, SwNumRule::GetNumIndent( 4 ), 0, PT_6 ); 846 break; 847 848 case RES_POOLCOLL_BUL_LEVEL1S: 849 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL1, 850 lBullFirstLineOffset, SwNumRule::GetBullIndent( 0 ), 851 PT_12, PT_6 ); 852 break; 853 case RES_POOLCOLL_BUL_LEVEL1: 854 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL1, 855 lBullFirstLineOffset, SwNumRule::GetBullIndent( 0 ), 856 0, PT_6 ); 857 break; 858 case RES_POOLCOLL_BUL_LEVEL1E: 859 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL1, 860 lBullFirstLineOffset, SwNumRule::GetBullIndent( 0 ), 861 0, PT_12 ); 862 break; 863 case RES_POOLCOLL_BUL_NONUM1: 864 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_NONUM1, 865 0, SwNumRule::GetBullIndent( 0 ), 0, PT_6 ); 866 break; 867 case RES_POOLCOLL_BUL_LEVEL2S: 868 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL2, 869 lBullFirstLineOffset, SwNumRule::GetBullIndent( 1 ), 870 PT_12, PT_6 ); 871 break; 872 case RES_POOLCOLL_BUL_LEVEL2: 873 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL2, 874 lBullFirstLineOffset, SwNumRule::GetBullIndent( 1 ), 875 0, PT_6 ); 876 break; 877 case RES_POOLCOLL_BUL_LEVEL2E: 878 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL2, 879 lBullFirstLineOffset, SwNumRule::GetBullIndent( 1 ), 880 0, PT_12 ); 881 break; 882 case RES_POOLCOLL_BUL_NONUM2: 883 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_NONUM2, 884 0, SwNumRule::GetBullIndent( 1 ), 0, PT_6 ); 885 break; 886 case RES_POOLCOLL_BUL_LEVEL3S: 887 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL3, 888 lBullFirstLineOffset, SwNumRule::GetBullIndent( 2 ), 889 PT_12, PT_6 ); 890 break; 891 case RES_POOLCOLL_BUL_LEVEL3: 892 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL3, 893 lBullFirstLineOffset, SwNumRule::GetBullIndent( 2 ), 894 0, PT_6 ); 895 break; 896 case RES_POOLCOLL_BUL_LEVEL3E: 897 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL3, 898 lBullFirstLineOffset, SwNumRule::GetBullIndent( 2 ), 899 0, PT_12 ); 900 break; 901 case RES_POOLCOLL_BUL_NONUM3: 902 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_NONUM3, 903 0, SwNumRule::GetBullIndent( 2 ), 0, PT_6 ); 904 break; 905 case RES_POOLCOLL_BUL_LEVEL4S: 906 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL4, 907 lBullFirstLineOffset, SwNumRule::GetBullIndent( 3 ), 908 PT_12, PT_6 ); 909 break; 910 case RES_POOLCOLL_BUL_LEVEL4: 911 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL4, 912 lBullFirstLineOffset, SwNumRule::GetBullIndent( 3 ), 913 0, PT_6 ); 914 break; 915 case RES_POOLCOLL_BUL_LEVEL4E: 916 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL4, 917 lBullFirstLineOffset, SwNumRule::GetBullIndent( 3 ), 918 0, PT_12 ); 919 break; 920 case RES_POOLCOLL_BUL_NONUM4: 921 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_NONUM4, 922 0, SwNumRule::GetBullIndent( 3 ), 0, PT_6 ); 923 break; 924 case RES_POOLCOLL_BUL_LEVEL5S: 925 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL5, 926 lBullFirstLineOffset, SwNumRule::GetBullIndent( 4 ), 927 PT_12, PT_6 ); 928 break; 929 case RES_POOLCOLL_BUL_LEVEL5: 930 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL5, 931 lBullFirstLineOffset, SwNumRule::GetBullIndent( 4 ), 932 0, PT_6 ); 933 break; 934 case RES_POOLCOLL_BUL_LEVEL5E: 935 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_LEVEL5, 936 lBullFirstLineOffset, SwNumRule::GetBullIndent( 4 ), 937 0, PT_12 ); 938 break; 939 case RES_POOLCOLL_BUL_NONUM5: 940 lcl_SetNumBul( this, pNewColl, aSet, RES_POOLCOLL_BUL_NONUM5, 941 0, SwNumRule::GetBullIndent( 4 ), 0, PT_6 ); 942 break; 943 944 case RES_POOLCOLL_DOC_TITEL: // Doc. Titel 945 { 946 SetAllScriptItem( aSet, SvxWeightItem( WEIGHT_BOLD, RES_CHRATR_WEIGHT ) ); 947 SetAllScriptItem( aSet, SvxFontHeightItem( PT_18, 100, RES_CHRATR_FONTSIZE ) ); 948 949 aSet.Put( SvxAdjustItem( SVX_ADJUST_CENTER, RES_PARATR_ADJUST ) ); 950 951 pNewColl->SetNextTxtFmtColl( *GetTxtCollFromPool( 952 RES_POOLCOLL_DOC_SUBTITEL )); 953 } 954 break; 955 956 case RES_POOLCOLL_DOC_SUBTITEL: // Doc. UnterTitel 957 { 958 SetAllScriptItem( aSet, SvxPostureItem( ITALIC_NORMAL, RES_CHRATR_POSTURE )); 959 SetAllScriptItem( aSet, SvxFontHeightItem( PT_14, 100, RES_CHRATR_FONTSIZE )); 960 961 aSet.Put( SvxAdjustItem( SVX_ADJUST_CENTER, RES_PARATR_ADJUST )); 962 963 pNewColl->SetNextTxtFmtColl( *GetTxtCollFromPool( 964 RES_POOLCOLL_TEXT )); 965 } 966 break; 967 968 case RES_POOLCOLL_HTML_BLOCKQUOTE: 969 { 970 SvxLRSpaceItem aLR( RES_LR_SPACE ); 971 aLR.SetLeft( GetMetricVal( CM_1 )); 972 aLR.SetRight( GetMetricVal( CM_1 )); 973 aSet.Put( aLR ); 974 // aSet.Put( SvxAdjustItem( SVX_ADJUST_BLOCK, RES_PARATR_ADJUST ) ); 975 SvxULSpaceItem aUL( RES_UL_SPACE ); 976 aUL = pNewColl->GetULSpace(); 977 aUL.SetLower( HTML_PARSPACE ); 978 aSet.Put( aUL); 979 } 980 break; 981 982 case RES_POOLCOLL_HTML_PRE: 983 { 984 ::lcl_SetDfltFont( DEFAULTFONT_FIXED, aSet ); 985 986 // WORKAROUND: PRE auf 10pt setzten 987 SetAllScriptItem( aSet, SvxFontHeightItem(PT_10, 100, RES_CHRATR_FONTSIZE) ); 988 // WORKAROUND: PRE auf 10pt setzten 989 990 // der untere Absatz-Abstand wird explizit gesetzt (macht 991 // die harte Attributierung einfacher) 992 SvxULSpaceItem aULSpaceItem( RES_UL_SPACE ); 993 aULSpaceItem = pNewColl->GetULSpace(); 994 aULSpaceItem.SetLower( 0 ); 995 aSet.Put( aULSpaceItem ); 996 } 997 break; 998 999 case RES_POOLCOLL_HTML_HR: 1000 { 1001 SvxBoxItem aBox( RES_BOX ); 1002 Color aColor( COL_GRAY ); 1003 SvxBorderLine aNew( &aColor, DEF_DOUBLE_LINE0_OUT, 1004 DEF_DOUBLE_LINE0_IN, 1005 DEF_DOUBLE_LINE0_DIST ); 1006 aBox.SetLine( &aNew, BOX_LINE_BOTTOM ); 1007 1008 aSet.Put( aBox ); 1009 aSet.Put( SwParaConnectBorderItem( sal_False ) ); 1010 SetAllScriptItem( aSet, SvxFontHeightItem(120, 100, RES_CHRATR_FONTSIZE) ); 1011 1012 SvxULSpaceItem aUL( RES_UL_SPACE ); 1013 { 1014 pNewColl->SetNextTxtFmtColl( *GetTxtCollFromPool( 1015 RES_POOLCOLL_TEXT )); 1016 aUL = pNewColl->GetULSpace(); 1017 } 1018 aUL.SetLower( HTML_PARSPACE ); 1019 aSet.Put( aUL); 1020 SwFmtLineNumber aLN; aLN.SetCountLines( sal_False ); 1021 aSet.Put( aLN ); 1022 } 1023 break; 1024 1025 case RES_POOLCOLL_HTML_DD: 1026 { 1027 SvxLRSpaceItem aLR( RES_LR_SPACE ); 1028 aLR = pNewColl->GetLRSpace(); 1029 // es wird um 1cm eingerueckt. Die IDs liegen immer 2 auseinander! 1030 aLR.SetLeft( GetMetricVal( CM_1 )); 1031 aSet.Put( aLR ); 1032 } 1033 break; 1034 case RES_POOLCOLL_HTML_DT: 1035 { 1036 SvxLRSpaceItem aLR( RES_LR_SPACE ); 1037 { 1038 pNewColl->SetNextTxtFmtColl( *GetTxtCollFromPool( 1039 RES_POOLCOLL_HTML_DD )); 1040 aLR = pNewColl->GetLRSpace(); 1041 } 1042 // es wird um 0cm eingerueckt. Die IDs liegen immer 2 auseinander! 1043 aLR.SetLeft( 0 ); 1044 aSet.Put( aLR ); 1045 } 1046 break; 1047 } 1048 1049 if( aSet.Count() ) 1050 { 1051 { 1052 pNewColl->SetFmtAttr( aSet ); 1053 // JP 31.08.95: erzeugen einer PoolVorlage ist keine Modifikation 1054 // (Bug: 18545) 1055 // SetModified(); 1056 } 1057 } 1058 return pNewColl; 1059 } 1060 1061 1062 1063 // pruefe, ob diese "Auto-Collection" in Dokument schon/noch 1064 // benutzt wird 1065 bool SwDoc::IsPoolTxtCollUsed( sal_uInt16 nId ) const 1066 { 1067 ASSERT( 1068 (RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END) || 1069 (RES_POOLCOLL_LISTS_BEGIN <= nId && nId < RES_POOLCOLL_LISTS_END) || 1070 (RES_POOLCOLL_EXTRA_BEGIN <= nId && nId < RES_POOLCOLL_EXTRA_END) || 1071 (RES_POOLCOLL_REGISTER_BEGIN <= nId && nId < RES_POOLCOLL_REGISTER_END) || 1072 (RES_POOLCOLL_DOC_BEGIN <= nId && nId < RES_POOLCOLL_DOC_END) || 1073 (RES_POOLCOLL_HTML_BEGIN <= nId && nId < RES_POOLCOLL_HTML_END), 1074 "Falsche AutoFormat-Id" ); 1075 1076 SwTxtFmtColl* pNewColl = 0; 1077 sal_Bool bFnd = sal_False; 1078 for( sal_uInt16 n = 0; !bFnd && n < pTxtFmtCollTbl->Count(); ++n ) 1079 { 1080 pNewColl = (*pTxtFmtCollTbl)[ n ]; 1081 if( nId == pNewColl->GetPoolFmtId() ) 1082 bFnd = sal_True; 1083 } 1084 1085 if( !bFnd || !pNewColl->GetDepends() ) 1086 return sal_False; 1087 1088 SwAutoFmtGetDocNode aGetHt( &GetNodes() ); 1089 return !pNewColl->GetInfo( aGetHt ); 1090 } 1091 1092 // Gebe das "Auto[matische]-Format" mit der Id zurueck. Existiert 1093 // es noch nicht, dann erzeuge es 1094 1095 SwFmt* SwDoc::GetFmtFromPool( sal_uInt16 nId ) 1096 { 1097 SwFmt *pNewFmt = 0; 1098 SwFmt *pDeriveFmt = 0; 1099 1100 SvPtrarr* pArray[ 2 ]; 1101 sal_uInt16 nArrCnt = 1, nRCId = 0; 1102 sal_uInt16* pWhichRange = 0; 1103 1104 switch( nId & (COLL_GET_RANGE_BITS + POOLGRP_NOCOLLID) ) 1105 { 1106 case POOLGRP_CHARFMT: 1107 { 1108 pArray[0] = pCharFmtTbl; 1109 pDeriveFmt = pDfltCharFmt; 1110 1111 if( nId > RES_POOLCHR_NORMAL_END ) 1112 nRCId = RC_POOLCHRFMT_HTML_BEGIN - RES_POOLCHR_HTML_BEGIN; 1113 else 1114 nRCId = RC_POOLCHRFMT_BEGIN - RES_POOLCHR_BEGIN; 1115 pWhichRange = aCharFmtSetRange; 1116 1117 // Fehlerfall: unbekanntes Format, aber CharFormat 1118 // -> returne das erste 1119 if( RES_POOLCHR_BEGIN > nId || nId >= RES_POOLCHR_END ) 1120 { 1121 ASSERT( !this, "ungueltige Id" ); 1122 nId = RES_POOLCHR_BEGIN; 1123 } 1124 } 1125 break; 1126 case POOLGRP_FRAMEFMT: 1127 { 1128 pArray[0] = pFrmFmtTbl; 1129 pArray[1] = pSpzFrmFmtTbl; 1130 pDeriveFmt = pDfltFrmFmt; 1131 nArrCnt = 2; 1132 nRCId = RC_POOLFRMFMT_BEGIN - RES_POOLFRM_BEGIN; 1133 pWhichRange = aFrmFmtSetRange; 1134 1135 // Fehlerfall: unbekanntes Format, aber FrameFormat 1136 // -> returne das erste 1137 if( RES_POOLFRM_BEGIN > nId || nId >= RES_POOLFRM_END ) 1138 { 1139 ASSERT( !this, "ungueltige Id" ); 1140 nId = RES_POOLFRM_BEGIN; 1141 } 1142 } 1143 break; 1144 1145 default: 1146 // Fehlerfall, unbekanntes Format 1147 ASSERT( nId, "ungueltige Id" ); 1148 return 0; 1149 } 1150 ASSERT( nRCId, "ungueltige Id" ); 1151 1152 while( nArrCnt-- ) 1153 for( sal_uInt16 n = 0; n < (*pArray[nArrCnt]).Count(); ++n ) 1154 if( nId == ( pNewFmt = (SwFmt*)(*pArray[ nArrCnt ] )[ n ] )-> 1155 GetPoolFmtId() ) 1156 { 1157 return pNewFmt; 1158 } 1159 1160 ResId aResId( nRCId + nId, *pSwResMgr ); 1161 String aNm( aResId ); 1162 SwAttrSet aSet( GetAttrPool(), pWhichRange ); 1163 1164 { 1165 sal_Bool bIsModified = IsModified(); 1166 1167 { 1168 ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo()); 1169 switch (nId & (COLL_GET_RANGE_BITS + POOLGRP_NOCOLLID) ) 1170 { 1171 case POOLGRP_CHARFMT: 1172 pNewFmt = _MakeCharFmt(aNm, pDeriveFmt, sal_False, sal_True); 1173 break; 1174 case POOLGRP_FRAMEFMT: 1175 pNewFmt = _MakeFrmFmt(aNm, pDeriveFmt, sal_False, sal_True); 1176 break; 1177 default: 1178 break; 1179 } 1180 } 1181 1182 if( !bIsModified ) 1183 ResetModified(); 1184 pNewFmt->SetPoolFmtId( nId ); 1185 pNewFmt->SetAuto( sal_False ); // kein Auto-Format 1186 } 1187 1188 switch( nId ) 1189 { 1190 case RES_POOLCHR_FOOTNOTE: // Fussnote 1191 case RES_POOLCHR_PAGENO: // Seiten/Feld 1192 case RES_POOLCHR_LABEL: // Beschriftung 1193 case RES_POOLCHR_DROPCAPS: // Initialien 1194 case RES_POOLCHR_NUM_LEVEL: // Aufzaehlungszeichen 1195 case RES_POOLCHR_TOXJUMP: // Verzeichnissprung 1196 case RES_POOLCHR_ENDNOTE: // Endnote 1197 case RES_POOLCHR_LINENUM: // Zeilennummerierung 1198 break; 1199 1200 case RES_POOLCHR_ENDNOTE_ANCHOR: // Endnotenanker 1201 case RES_POOLCHR_FOOTNOTE_ANCHOR: // Fussnotenanker 1202 { 1203 aSet.Put( SvxEscapementItem( DFLT_ESC_AUTO_SUPER, 58, RES_CHRATR_ESCAPEMENT ) ); 1204 } 1205 break; 1206 1207 1208 case RES_POOLCHR_BUL_LEVEL: // Aufzaehlungszeichen 1209 { 1210 const Font& rBulletFont = numfunc::GetDefBulletFont(); 1211 SetAllScriptItem( aSet, SvxFontItem( rBulletFont.GetFamily(), 1212 rBulletFont.GetName(), rBulletFont.GetStyleName(), 1213 rBulletFont.GetPitch(), rBulletFont.GetCharSet(), RES_CHRATR_FONT )); 1214 // --> OD 2008-06-02 #i63395# 1215 // no font and no font size any more 1216 // SetAllScriptItem( aSet, SvxFontHeightItem( PT_9, 100, RES_CHRATR_FONTSIZE )); 1217 // <-- 1218 } 1219 break; 1220 1221 case RES_POOLCHR_INET_NORMAL: 1222 { 1223 Color aCol( COL_BLUE ); 1224 aSet.Put( SvxColorItem( aCol, RES_CHRATR_COLOR ) ); 1225 aSet.Put( SvxUnderlineItem( UNDERLINE_SINGLE, RES_CHRATR_UNDERLINE ) ); 1226 // i40133: patch submitted by rail: set language to 'none' to prevent spell checking: 1227 aSet.Put( SvxLanguageItem( LANGUAGE_NONE, RES_CHRATR_LANGUAGE ) ); 1228 aSet.Put( SvxLanguageItem( LANGUAGE_NONE, RES_CHRATR_CJK_LANGUAGE ) ); 1229 aSet.Put( SvxLanguageItem( LANGUAGE_NONE, RES_CHRATR_CTL_LANGUAGE ) ); 1230 } 1231 break; 1232 case RES_POOLCHR_INET_VISIT: 1233 { 1234 Color aCol( COL_RED ); 1235 aSet.Put( SvxColorItem( aCol, RES_CHRATR_COLOR ) ); 1236 aSet.Put( SvxUnderlineItem( UNDERLINE_SINGLE, RES_CHRATR_UNDERLINE ) ); 1237 aSet.Put( SvxLanguageItem( LANGUAGE_NONE, RES_CHRATR_LANGUAGE ) ); 1238 aSet.Put( SvxLanguageItem( LANGUAGE_NONE, RES_CHRATR_CJK_LANGUAGE ) ); 1239 aSet.Put( SvxLanguageItem( LANGUAGE_NONE, RES_CHRATR_CTL_LANGUAGE ) ); 1240 } 1241 break; 1242 case RES_POOLCHR_JUMPEDIT: 1243 { 1244 Color aCol( COL_CYAN ); 1245 aSet.Put( SvxColorItem( aCol, RES_CHRATR_COLOR ) ); 1246 aSet.Put( SvxUnderlineItem( UNDERLINE_DOTTED, RES_CHRATR_UNDERLINE ) ); 1247 aSet.Put( SvxCaseMapItem( SVX_CASEMAP_KAPITAELCHEN, RES_CHRATR_CASEMAP ) ); 1248 } 1249 break; 1250 1251 case RES_POOLCHR_RUBYTEXT: 1252 { 1253 long nH = ((SvxFontHeightItem*)GetDfltAttr( 1254 RES_CHRATR_CJK_FONTSIZE ))->GetHeight() / 2; 1255 SetAllScriptItem( aSet, SvxFontHeightItem( nH, 100, RES_CHRATR_FONTSIZE)); 1256 aSet.Put(SvxUnderlineItem( UNDERLINE_NONE, RES_CHRATR_UNDERLINE )); 1257 aSet.Put(SvxEmphasisMarkItem( EMPHASISMARK_NONE, RES_CHRATR_EMPHASIS_MARK) ); 1258 } 1259 break; 1260 1261 case RES_POOLCHR_HTML_EMPHASIS: 1262 case RES_POOLCHR_HTML_CITIATION: 1263 case RES_POOLCHR_HTML_VARIABLE: 1264 { 1265 SetAllScriptItem( aSet, SvxPostureItem( ITALIC_NORMAL, RES_CHRATR_POSTURE) ); 1266 } 1267 break; 1268 1269 case RES_POOLCHR_IDX_MAIN_ENTRY: 1270 case RES_POOLCHR_HTML_STRONG: 1271 { 1272 SetAllScriptItem( aSet, SvxWeightItem( WEIGHT_BOLD, RES_CHRATR_WEIGHT )); 1273 } 1274 break; 1275 1276 case RES_POOLCHR_HTML_CODE: 1277 case RES_POOLCHR_HTML_SAMPLE: 1278 case RES_POOLCHR_HTML_KEYBOARD: 1279 case RES_POOLCHR_HTML_TELETYPE: 1280 { 1281 ::lcl_SetDfltFont( DEFAULTFONT_FIXED, aSet ); 1282 } 1283 break; 1284 case RES_POOLCHR_VERT_NUM: 1285 aSet.Put( SvxCharRotateItem( 900, sal_False, RES_CHRATR_ROTATE ) ); 1286 break; 1287 //nichts besonderes 1288 // case RES_POOLCHR_HTML_DEFINSTANCE: 1289 // break; 1290 1291 1292 case RES_POOLFRM_FRAME: 1293 { 1294 if ( get(IDocumentSettingAccess::HTML_MODE) ) 1295 { 1296 aSet.Put( SwFmtAnchor( FLY_AS_CHAR )); 1297 aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::LINE_CENTER, text::RelOrientation::PRINT_AREA ) ); 1298 aSet.Put( SwFmtSurround( SURROUND_NONE ) ); 1299 } 1300 else 1301 { 1302 aSet.Put( SwFmtAnchor( FLY_AT_PARA )); 1303 aSet.Put( SwFmtSurround( SURROUND_PARALLEL ) ); 1304 aSet.Put( SwFmtHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::PRINT_AREA ) ); 1305 aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::PRINT_AREA ) ); 1306 Color aCol( COL_BLACK ); 1307 SvxBorderLine aLine( &aCol, DEF_LINE_WIDTH_0 ); 1308 SvxBoxItem aBox( RES_BOX ); 1309 aBox.SetLine( &aLine, BOX_LINE_TOP ); 1310 aBox.SetLine( &aLine, BOX_LINE_BOTTOM ); 1311 aBox.SetLine( &aLine, BOX_LINE_LEFT ); 1312 aBox.SetLine( &aLine, BOX_LINE_RIGHT ); 1313 aBox.SetDistance( 85 ); 1314 aSet.Put( aBox ); 1315 aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) ); 1316 aSet.Put( SvxULSpaceItem( 114, 114, RES_UL_SPACE ) ); 1317 } 1318 } 1319 break; 1320 case RES_POOLFRM_GRAPHIC: 1321 case RES_POOLFRM_OLE: 1322 { 1323 aSet.Put( SwFmtAnchor( FLY_AT_PARA )); 1324 aSet.Put( SwFmtHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME )); 1325 aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME )); 1326 aSet.Put( SwFmtSurround( SURROUND_NONE )); 1327 } 1328 break; 1329 case RES_POOLFRM_FORMEL: 1330 { 1331 aSet.Put( SwFmtAnchor( FLY_AS_CHAR ) ); 1332 aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::CHAR_CENTER, text::RelOrientation::FRAME ) ); 1333 aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) ); 1334 } 1335 break; 1336 case RES_POOLFRM_MARGINAL: 1337 { 1338 aSet.Put( SwFmtAnchor( FLY_AT_PARA )); 1339 aSet.Put( SwFmtHoriOrient( 0, text::HoriOrientation::LEFT, text::RelOrientation::FRAME )); 1340 aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME )); 1341 aSet.Put( SwFmtSurround( SURROUND_PARALLEL )); 1342 // Breite 3.5 centimeter vorgegeben, als Hoehe nur den 1343 // min. Wert benutzen 1344 aSet.Put( SwFmtFrmSize( ATT_MIN_SIZE, 1345 GetMetricVal( CM_1 ) * 3 + GetMetricVal( CM_05 ), 1346 MM50 )); 1347 } 1348 break; 1349 case RES_POOLFRM_WATERSIGN: 1350 { 1351 aSet.Put( SwFmtAnchor( FLY_AT_PAGE )); 1352 aSet.Put( SwFmtHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME )); 1353 aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::CENTER, text::RelOrientation::FRAME )); 1354 aSet.Put( SvxOpaqueItem( sal_False )); 1355 aSet.Put( SwFmtSurround( SURROUND_THROUGHT )); 1356 } 1357 break; 1358 1359 case RES_POOLFRM_LABEL: 1360 { 1361 aSet.Put( SwFmtAnchor( FLY_AS_CHAR ) ); 1362 aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ) ); 1363 aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) ); 1364 1365 SvxProtectItem aProtect( RES_PROTECT ); 1366 aProtect.SetSizeProtect( sal_True ); 1367 aProtect.SetPosProtect( sal_True ); 1368 aSet.Put( aProtect ); 1369 1370 pNewFmt->SetAutoUpdateFmt( sal_True ); 1371 } 1372 break; 1373 } 1374 if( aSet.Count() ) 1375 { 1376 { 1377 pNewFmt->SetFmtAttr( aSet ); 1378 // JP 31.08.95: erzeugen einer PoolVorlage ist keine Modifikation 1379 // (Bug: 18545) 1380 // SetModified(); 1381 } 1382 } 1383 return pNewFmt; 1384 } 1385 1386 SwFrmFmt* SwDoc::GetFrmFmtFromPool( sal_uInt16 nId ) 1387 { 1388 return (SwFrmFmt*)GetFmtFromPool( nId ); 1389 } 1390 1391 SwCharFmt* SwDoc::GetCharFmtFromPool( sal_uInt16 nId ) 1392 { 1393 return (SwCharFmt*)GetFmtFromPool( nId ); 1394 } 1395 1396 // pruefe, ob diese "Auto-Collection" in Dokument schon/noch 1397 // benutzt wird 1398 bool SwDoc::IsPoolFmtUsed( sal_uInt16 nId ) const 1399 { 1400 SwFmt *pNewFmt = 0; 1401 const SvPtrarr* pArray[ 2 ]; 1402 sal_uInt16 nArrCnt = 1; 1403 sal_Bool bFnd = sal_True; 1404 1405 if( RES_POOLCHR_BEGIN <= nId && nId < RES_POOLCHR_END ) 1406 { 1407 pArray[0] = pCharFmtTbl; 1408 } 1409 if( RES_POOLFRM_BEGIN <= nId && nId < RES_POOLFRM_END ) 1410 { 1411 pArray[0] = pFrmFmtTbl; 1412 pArray[1] = pSpzFrmFmtTbl; 1413 nArrCnt = 2; 1414 } 1415 else 1416 { 1417 ASSERT( sal_False, "ungueltige Id" ); 1418 bFnd = sal_False; 1419 } 1420 1421 if( bFnd ) 1422 { 1423 bFnd = sal_False; 1424 while( nArrCnt-- && !bFnd ) 1425 for( sal_uInt16 n = 0; !bFnd && n < (*pArray[nArrCnt]).Count(); ++n ) 1426 if( nId == ( pNewFmt = (SwFmt*)(*pArray[ nArrCnt ] )[ n ] )-> 1427 GetPoolFmtId() ) 1428 bFnd = sal_True; 1429 } 1430 1431 // nicht gefunden oder keine Abhaengigen ? 1432 if( bFnd && pNewFmt->GetDepends() ) 1433 { 1434 // dann teste mal, ob es abhaengige ContentNodes im Nodes Array gibt 1435 // (auch indirekte fuer Format-Ableitung! ) 1436 SwAutoFmtGetDocNode aGetHt( &GetNodes() ); 1437 bFnd = !pNewFmt->GetInfo( aGetHt ); 1438 } 1439 else 1440 bFnd = sal_False; 1441 1442 return bFnd; 1443 } 1444 1445 1446 1447 void lcl_GetStdPgSize( SwDoc* pDoc, SfxItemSet& rSet ) 1448 { 1449 SwPageDesc* pStdPgDsc = pDoc->GetPageDescFromPool( RES_POOLPAGE_STANDARD ); 1450 SwFmtFrmSize aFrmSz( pStdPgDsc->GetMaster().GetFrmSize() ); 1451 if( pStdPgDsc->GetLandscape() ) 1452 { 1453 SwTwips nTmp = aFrmSz.GetHeight(); 1454 aFrmSz.SetHeight( aFrmSz.GetWidth() ); 1455 aFrmSz.SetWidth( nTmp ); 1456 } 1457 rSet.Put( aFrmSz ); 1458 } 1459 1460 SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage ) 1461 { 1462 ASSERT( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END, 1463 "Falsche AutoFormat-Id" ); 1464 1465 SwPageDesc *pNewPgDsc; 1466 sal_uInt16 n; 1467 1468 for( n = 0; n < aPageDescs.Count(); ++n ) 1469 if( nId == ( pNewPgDsc = aPageDescs[ n ] )->GetPoolFmtId() ) 1470 { 1471 return pNewPgDsc; 1472 } 1473 1474 // Fehlerfall: unbekannte Poolvorlage 1475 if( RES_POOLPAGE_BEGIN > nId || nId >= RES_POOLPAGE_END ) 1476 { 1477 ASSERT( !this, "ungueltige Id" ); 1478 nId = RES_POOLPAGE_BEGIN; 1479 } 1480 1481 ResId aResId( sal_uInt32(RC_POOLPAGEDESC_BEGIN + nId - RES_POOLPAGE_BEGIN), *pSwResMgr ); 1482 String aNm( aResId ); 1483 { 1484 sal_Bool bIsModified = IsModified(); 1485 1486 { 1487 ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo()); 1488 n = MakePageDesc( aNm, 0, bRegardLanguage ); 1489 } 1490 1491 pNewPgDsc = aPageDescs[ n ]; 1492 pNewPgDsc->SetPoolFmtId( nId ); 1493 if( !bIsModified ) 1494 ResetModified(); 1495 } 1496 1497 1498 SvxLRSpaceItem aLR( RES_LR_SPACE ); 1499 aLR.SetLeft( GetMetricVal( CM_1 ) * 2 ); 1500 aLR.SetRight( aLR.GetLeft() ); 1501 SvxULSpaceItem aUL( RES_UL_SPACE ); 1502 aUL.SetUpper( (sal_uInt16)aLR.GetLeft() ); 1503 aUL.SetLower( (sal_uInt16)aLR.GetLeft() ); 1504 1505 SwAttrSet aSet( GetAttrPool(), aPgFrmFmtSetRange ); 1506 sal_Bool bSetLeft = sal_True; 1507 1508 switch( nId ) 1509 { 1510 case RES_POOLPAGE_STANDARD: // Standard-Seite 1511 { 1512 aSet.Put( aLR ); 1513 aSet.Put( aUL ); 1514 if( pNewPgDsc ) 1515 pNewPgDsc->SetUseOn( nsUseOnPage::PD_ALL ); 1516 } 1517 break; 1518 1519 case RES_POOLPAGE_FIRST: // Erste Seite 1520 case RES_POOLPAGE_REGISTER: // Verzeichnis 1521 { 1522 lcl_GetStdPgSize( this, aSet ); 1523 aSet.Put( aLR ); 1524 aSet.Put( aUL ); 1525 if( pNewPgDsc ) 1526 { 1527 pNewPgDsc->SetUseOn( nsUseOnPage::PD_ALL ); 1528 if( RES_POOLPAGE_FIRST == nId ) 1529 pNewPgDsc->SetFollow( GetPageDescFromPool( RES_POOLPAGE_STANDARD )); 1530 } 1531 } 1532 break; 1533 1534 case RES_POOLPAGE_LEFT: // Linke Seite 1535 { 1536 lcl_GetStdPgSize( this, aSet ); 1537 aSet.Put( aLR ); 1538 aSet.Put( aUL ); 1539 bSetLeft = sal_False; 1540 if( pNewPgDsc ) 1541 pNewPgDsc->SetUseOn( nsUseOnPage::PD_LEFT ); 1542 } 1543 break; 1544 case RES_POOLPAGE_RIGHT: // Rechte Seite 1545 { 1546 lcl_GetStdPgSize( this, aSet ); 1547 aSet.Put( aLR ); 1548 aSet.Put( aUL ); 1549 bSetLeft = sal_False; 1550 if( pNewPgDsc ) 1551 pNewPgDsc->SetUseOn( nsUseOnPage::PD_RIGHT ); 1552 } 1553 break; 1554 1555 case RES_POOLPAGE_JAKET: // Umschlag 1556 { 1557 aLR.SetLeft( 0 ); aLR.SetRight( 0 ); 1558 aUL.SetUpper( 0 ); aUL.SetLower( 0 ); 1559 Size aPSize( SvxPaperInfo::GetPaperSize( PAPER_ENV_C65 ) ); 1560 LandscapeSwap( aPSize ); 1561 aSet.Put( SwFmtFrmSize( ATT_FIX_SIZE, aPSize.Width(), aPSize.Height() )); 1562 aSet.Put( aLR ); 1563 aSet.Put( aUL ); 1564 1565 if( pNewPgDsc ) 1566 { 1567 pNewPgDsc->SetUseOn( nsUseOnPage::PD_ALL ); 1568 pNewPgDsc->SetLandscape( sal_True ); 1569 } 1570 } 1571 break; 1572 1573 case RES_POOLPAGE_HTML: // HTML 1574 { 1575 lcl_GetStdPgSize( this, aSet ); 1576 aLR.SetRight( GetMetricVal( CM_1 )); 1577 aUL.SetUpper( (sal_uInt16)aLR.GetRight() ); 1578 aUL.SetLower( (sal_uInt16)aLR.GetRight() ); 1579 aSet.Put( aLR ); 1580 aSet.Put( aUL ); 1581 1582 if( pNewPgDsc ) 1583 pNewPgDsc->SetUseOn( nsUseOnPage::PD_ALL ); 1584 } 1585 break; 1586 case RES_POOLPAGE_FOOTNOTE: 1587 case RES_POOLPAGE_ENDNOTE: 1588 { 1589 lcl_GetStdPgSize( this, aSet ); 1590 aSet.Put( aLR ); 1591 aSet.Put( aUL ); 1592 if( pNewPgDsc ) 1593 pNewPgDsc->SetUseOn( nsUseOnPage::PD_ALL ); 1594 SwPageFtnInfo aInf( pNewPgDsc->GetFtnInfo() ); 1595 aInf.SetLineWidth( 0 ); 1596 aInf.SetTopDist( 0 ); 1597 aInf.SetBottomDist( 0 ); 1598 pNewPgDsc->SetFtnInfo( aInf ); 1599 } 1600 break; 1601 case RES_POOLPAGE_LANDSCAPE: 1602 { 1603 SwPageDesc* pStdPgDsc = this->GetPageDescFromPool( RES_POOLPAGE_STANDARD ); 1604 SwFmtFrmSize aFrmSz( pStdPgDsc->GetMaster().GetFrmSize() ); 1605 SwTwips nTmp = aFrmSz.GetHeight(); 1606 aFrmSz.SetHeight( aFrmSz.GetWidth() ); 1607 aFrmSz.SetWidth( nTmp ); 1608 aSet.Put( aFrmSz ); 1609 aSet.Put( aLR ); 1610 aSet.Put( aUL ); 1611 if( pNewPgDsc ) 1612 { 1613 pNewPgDsc->SetUseOn( nsUseOnPage::PD_ALL ); 1614 pNewPgDsc->SetLandscape( sal_True ); 1615 } 1616 } 1617 break; 1618 1619 } 1620 1621 if( aSet.Count() ) 1622 { 1623 { 1624 if( bSetLeft ) 1625 pNewPgDsc->GetLeft().SetFmtAttr( aSet ); 1626 pNewPgDsc->GetMaster().SetFmtAttr( aSet ); 1627 // JP 31.08.95: erzeugen einer PoolVorlage ist keine Modifikation 1628 // (Bug: 18545) 1629 // SetModified(); 1630 } 1631 } 1632 return pNewPgDsc; 1633 } 1634 1635 SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId ) 1636 { 1637 ASSERT( RES_POOLNUMRULE_BEGIN <= nId && nId < RES_POOLNUMRULE_END, 1638 "Falsche AutoFormat-Id" ); 1639 1640 SwNumRule* pNewRule; 1641 sal_uInt16 n; 1642 1643 for( n = 0; n < GetNumRuleTbl().Count(); ++n ) 1644 if( nId == ( pNewRule = GetNumRuleTbl()[ n ] )->GetPoolFmtId() ) 1645 { 1646 return pNewRule; 1647 } 1648 1649 // Fehlerfall: unbekannte Poolvorlage 1650 if( RES_POOLNUMRULE_BEGIN > nId || nId >= RES_POOLNUMRULE_END ) 1651 { 1652 ASSERT( !this, "ungueltige Id" ); 1653 nId = RES_POOLNUMRULE_BEGIN; 1654 } 1655 1656 ResId aResId( sal_uInt32(RC_POOLNUMRULE_BEGIN + nId - RES_POOLNUMRULE_BEGIN), *pSwResMgr ); 1657 String aNm( aResId ); 1658 1659 SwCharFmt *pNumCFmt = 0, *pBullCFmt = 0; 1660 1661 // --> OD 2008-02-11 #newlistlevelattrs# 1662 const SvxNumberFormat::SvxNumPositionAndSpaceMode eNumberFormatPositionAndSpaceMode 1663 // --> OD 2008-06-06 #i89178# 1664 = numfunc::GetDefaultPositionAndSpaceMode(); 1665 // <-- 1666 // <-- 1667 { 1668 sal_Bool bIsModified = IsModified(); 1669 // --> OD 2008-02-11 #newlistlevelattrs# 1670 n = MakeNumRule( aNm, 0, sal_False, eNumberFormatPositionAndSpaceMode ); 1671 // <-- 1672 pNewRule = GetNumRuleTbl()[ n ]; 1673 pNewRule->SetPoolFmtId( nId ); 1674 pNewRule->SetAutoRule( sal_False ); 1675 1676 if( RES_POOLNUMRULE_NUM1 <= nId && nId <= RES_POOLNUMRULE_NUM5 ) 1677 pNumCFmt = GetCharFmtFromPool( RES_POOLCHR_NUM_LEVEL ); 1678 1679 if( ( RES_POOLNUMRULE_BUL1 <= nId && nId <= RES_POOLNUMRULE_BUL5 ) || 1680 RES_POOLNUMRULE_NUM5 == nId ) 1681 pBullCFmt = GetCharFmtFromPool( RES_POOLCHR_NUM_LEVEL ); 1682 1683 if( !bIsModified ) 1684 ResetModified(); 1685 } 1686 1687 switch( nId ) 1688 { 1689 case RES_POOLNUMRULE_NUM1: 1690 { 1691 SwNumFmt aFmt; 1692 // --> OD 2008-02-11 #newlistlevelattrs# 1693 aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode ); 1694 // <-- 1695 aFmt.SetNumberingType(SVX_NUM_ARABIC); 1696 aFmt.SetCharFmt( pNumCFmt ); 1697 aFmt.SetStart( 1 ); 1698 aFmt.SetIncludeUpperLevels( 1 ); 1699 aFmt.SetSuffix( aDotStr ); 1700 1701 static const sal_uInt16 aAbsSpace[ MAXLEVEL ] = 1702 { 1703 // cm: 0,5 1,0 1,5 2,0 2,5 3,0 3,5 4,0 4,5 5,0 1704 283, 567, 850, 1134, 1417, 1701, 1984, 2268, 2551, 2835 1705 }; 1706 #ifdef USE_MEASUREMENT 1707 static const sal_uInt16 aAbsSpaceInch[ MAXLEVEL ] = 1708 { 1709 283, 567, 850, 1134, 1417, 1701, 1984, 2268, 2551, 2835 1710 }; 1711 const sal_uInt16* pArr = MEASURE_METRIC == 1712 SvtSysLocale().GetLocaleData().getMeasurementSystemEnum() 1713 ? aAbsSpace 1714 : aAbsSpaceInch; 1715 #else 1716 const sal_uInt16* pArr = aAbsSpace; 1717 #endif 1718 1719 // --> OD 2008-02-11 #newlistlevelattrs# 1720 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 1721 { 1722 aFmt.SetFirstLineOffset( - (*pArr) ); 1723 } 1724 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 1725 { 1726 aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB ); 1727 aFmt.SetFirstLineIndent( - (*pArr) ); 1728 } 1729 // <-- 1730 for( n = 0; n < MAXLEVEL; ++n, ++pArr ) 1731 { 1732 // --> OD 2008-02-11 #newlistlevelattrs# 1733 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 1734 { 1735 aFmt.SetAbsLSpace( *pArr ); 1736 } 1737 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 1738 { 1739 aFmt.SetListtabPos( *pArr ); 1740 aFmt.SetIndentAt( *pArr ); 1741 } 1742 // <-- 1743 pNewRule->Set( n, aFmt ); 1744 } 1745 } 1746 break; 1747 1748 case RES_POOLNUMRULE_NUM2: 1749 { 1750 static const sal_uInt16 aAbsSpace[ MAXLEVEL ] = 1751 { 1752 283, 283, 567, 709, // 0.50, 0.50, 1.00, 1.25 1753 850, 1021, 1304, 1474, // 1.50, 1.80, 2.30, 2.60 1754 1588, 1758 // 2.80, 3.10 1755 }; 1756 1757 #ifdef USE_MEASUREMENT 1758 static const sal_uInt16 aAbsSpaceInch[ MAXLEVEL ] = 1759 { 1760 385, 385, 770, 963, 1761 1155, 1386, 1771, 2002, 1762 2156, 2387 1763 }; 1764 1765 const sal_uInt16* pArr = MEASURE_METRIC == 1766 SvtSysLocale().GetLocaleData().getMeasurementSystemEnum() 1767 ? aAbsSpace 1768 : aAbsSpaceInch; 1769 #else 1770 const sal_uInt16* pArr = aAbsSpace; 1771 #endif 1772 SwNumFmt aFmt; 1773 // --> OD 2008-02-11 #newlistlevelattrs# 1774 aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode ); 1775 // <-- 1776 aFmt.SetNumberingType(SVX_NUM_ARABIC); 1777 aFmt.SetCharFmt( pNumCFmt ); 1778 aFmt.SetIncludeUpperLevels( 1 ); 1779 // --> OD 2008-02-11 #newlistlevelattrs# 1780 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 1781 { 1782 aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB ); 1783 } 1784 // <-- 1785 sal_uInt16 nSpace = 0; 1786 for( n = 0; n < MAXLEVEL; ++n ) 1787 { 1788 // --> OD 2008-02-11 #newlistlevelattrs# 1789 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 1790 { 1791 aFmt.SetAbsLSpace( nSpace = nSpace + pArr[ n ] ); 1792 aFmt.SetFirstLineOffset( - pArr[ n ] ); 1793 } 1794 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 1795 { 1796 aFmt.SetListtabPos( nSpace = nSpace + pArr[ n ] ); 1797 aFmt.SetIndentAt( nSpace ); 1798 aFmt.SetFirstLineIndent( - pArr[ n ] ); 1799 } 1800 // <-- 1801 aFmt.SetStart( n+1 ); 1802 pNewRule->Set( n, aFmt ); 1803 } 1804 } 1805 break; 1806 case RES_POOLNUMRULE_NUM3: 1807 { 1808 SwNumFmt aFmt; 1809 // --> OD 2008-02-11 #newlistlevelattrs# 1810 aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode ); 1811 // <-- 1812 aFmt.SetNumberingType(SVX_NUM_ARABIC); 1813 aFmt.SetCharFmt( pNumCFmt ); 1814 aFmt.SetIncludeUpperLevels( 1 ); 1815 1816 sal_uInt16 nOffs = GetMetricVal( CM_1 ) * 3; 1817 // --> OD 2008-02-11 #newlistlevelattrs# 1818 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 1819 { 1820 aFmt.SetFirstLineOffset( - nOffs ); 1821 } 1822 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 1823 { 1824 aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB ); 1825 aFmt.SetFirstLineIndent( - nOffs ); 1826 } 1827 // <-- 1828 1829 for( n = 0; n < MAXLEVEL; ++n ) 1830 { 1831 // --> OD 2008-02-11 #newlistlevelattrs# 1832 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 1833 { 1834 aFmt.SetAbsLSpace( (n+1) * nOffs ); 1835 } 1836 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 1837 { 1838 aFmt.SetListtabPos( (n+1) * nOffs ); 1839 aFmt.SetIndentAt( (n+1) * nOffs ); 1840 } 1841 // <-- 1842 aFmt.SetStart( n+1 ); 1843 pNewRule->Set( n, aFmt ); 1844 } 1845 } 1846 break; 1847 case RES_POOLNUMRULE_NUM4: 1848 { 1849 SwNumFmt aFmt; 1850 // --> OD 2008-02-11 #newlistlevelattrs# 1851 aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode ); 1852 // <-- 1853 aFmt.SetNumberingType(SVX_NUM_ROMAN_UPPER); 1854 aFmt.SetCharFmt( pNumCFmt ); 1855 aFmt.SetIncludeUpperLevels( 1 ); 1856 aFmt.SetSuffix( aDotStr ); 1857 1858 static const sal_uInt16 aAbsSpace[ MAXLEVEL ] = 1859 { 1860 // cm: 0,5 1,0 1,5 2,0 2,5 3,0 3,5 4,0 4,5 5,0 1861 283, 567, 850, 1134, 1417, 1701, 1984, 2268, 2551, 2835 1862 }; 1863 #ifdef USE_MEASUREMENT 1864 static const sal_uInt16 aAbsSpaceInch[ MAXLEVEL ] = 1865 { 1866 283, 567, 850, 1134, 1417, 1701, 1984, 2268, 2551, 2835 1867 }; 1868 const sal_uInt16* pArr = MEASURE_METRIC == 1869 SvtSysLocale().GetLocaleData().getMeasurementSystemEnum() 1870 ? aAbsSpace 1871 : aAbsSpaceInch; 1872 #else 1873 const sal_uInt16* pArr = aAbsSpace; 1874 #endif 1875 1876 // --> OD 2008-02-11 #newlistlevelattrs# 1877 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 1878 { 1879 aFmt.SetFirstLineOffset( - (*pArr) ); 1880 } 1881 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 1882 { 1883 aFmt.SetLabelFollowedBy( SvxNumberFormat::SPACE ); 1884 aFmt.SetFirstLineIndent( - (*pArr) ); 1885 } 1886 // <-- 1887 for( n = 0; n < MAXLEVEL; ++n, ++pArr ) 1888 { 1889 aFmt.SetStart( n + 1 ); 1890 // --> OD 2008-02-11 #newlistlevelattrs# 1891 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 1892 { 1893 aFmt.SetAbsLSpace( *pArr ); 1894 } 1895 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 1896 { 1897 aFmt.SetListtabPos( *pArr ); 1898 aFmt.SetIndentAt( *pArr ); 1899 } 1900 // <-- 1901 pNewRule->Set( n, aFmt ); 1902 } 1903 } 1904 break; 1905 case RES_POOLNUMRULE_NUM5: 1906 { 1907 // [ First, LSpace ] 1908 static const sal_uInt16 aAbsSpace0to2[] = 1909 { 1910 227, 227, // 0.40, 0.40, 1911 369, 624, // 0.65, 1.10, 1912 255, 879 // 0.45, 1.55 1913 }; 1914 1915 #ifdef USE_MEASUREMENT 1916 static const sal_uInt16 aAbsSpaceInch0to2[] = 1917 { 1918 308, 308, 1919 501, 847, 1920 347, 1194 1921 }; 1922 const sal_uInt16* pArr0to2 = MEASURE_METRIC == 1923 SvtSysLocale().GetLocaleData().getMeasurementSystemEnum() 1924 ? aAbsSpace0to2 1925 : aAbsSpaceInch0to2; 1926 #else 1927 const sal_uInt16* pArr0to2 = aAbsSpace0to2; 1928 #endif 1929 SwNumFmt aFmt; 1930 // --> OD 2008-02-11 #newlistlevelattrs# 1931 aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode ); 1932 // <-- 1933 aFmt.SetNumberingType(SVX_NUM_ARABIC); 1934 aFmt.SetStart( 1 ); 1935 aFmt.SetIncludeUpperLevels( 1 ); 1936 aFmt.SetSuffix( aDotStr ); 1937 // --> OD 2008-02-11 #newlistlevelattrs# 1938 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 1939 { 1940 aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB ); 1941 } 1942 // <-- 1943 1944 // --> OD 2008-02-11 #newlistlevelattrs# 1945 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 1946 { 1947 aFmt.SetFirstLineOffset( -pArr0to2[0] ); // == 0.40 cm 1948 aFmt.SetAbsLSpace( pArr0to2[1] ); // == 0.40 cm 1949 } 1950 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 1951 { 1952 aFmt.SetFirstLineIndent( -pArr0to2[0] ); 1953 aFmt.SetListtabPos( pArr0to2[1] ); 1954 aFmt.SetIndentAt( pArr0to2[1] ); 1955 } 1956 // <-- 1957 1958 aFmt.SetCharFmt( pNumCFmt ); 1959 pNewRule->Set( 0, aFmt ); 1960 1961 aFmt.SetIncludeUpperLevels( 2 ); 1962 aFmt.SetStart( 2 ); 1963 // --> OD 2008-02-11 #newlistlevelattrs# 1964 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 1965 { 1966 aFmt.SetFirstLineOffset( -pArr0to2[2] ); // == 0.65 cm 1967 aFmt.SetAbsLSpace( pArr0to2[3] ); // == 1.10 cm 1968 } 1969 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 1970 { 1971 aFmt.SetFirstLineIndent( -pArr0to2[2] ); 1972 aFmt.SetListtabPos( pArr0to2[3] ); 1973 aFmt.SetIndentAt( pArr0to2[3] ); 1974 } 1975 // <-- 1976 pNewRule->Set( 1, aFmt ); 1977 1978 aFmt.SetNumberingType(SVX_NUM_CHARS_LOWER_LETTER); 1979 aFmt.SetSuffix( ')'); 1980 aFmt.SetIncludeUpperLevels( 1 ); 1981 aFmt.SetStart( 3 ); 1982 // --> OD 2008-02-11 #newlistlevelattrs# 1983 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 1984 { 1985 aFmt.SetFirstLineOffset( - pArr0to2[4] ); // == 0.45cm 1986 aFmt.SetAbsLSpace( pArr0to2[5] ); // == 1.55 cm 1987 } 1988 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 1989 { 1990 aFmt.SetFirstLineIndent( -pArr0to2[4] ); 1991 aFmt.SetListtabPos( pArr0to2[5] ); 1992 aFmt.SetIndentAt( pArr0to2[5] ); 1993 } 1994 // <-- 1995 pNewRule->Set( 2, aFmt ); 1996 1997 1998 aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); 1999 aFmt.SetCharFmt( pBullCFmt ); 2000 // --> OD 2006-06-29 #6440955# 2001 aFmt.SetBulletFont( &numfunc::GetDefBulletFont() ); 2002 // <-- 2003 aFmt.SetBulletChar( cBulletChar ); 2004 sal_uInt16 nOffs = GetMetricVal( CM_01 ) * 4, 2005 nOffs2 = GetMetricVal( CM_1 ) * 2; 2006 2007 // --> OD 2008-02-11 #newlistlevelattrs# 2008 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 2009 { 2010 aFmt.SetFirstLineOffset( - nOffs ); 2011 } 2012 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 2013 { 2014 aFmt.SetFirstLineIndent( - nOffs ); 2015 } 2016 // <-- 2017 aFmt.SetSuffix( aEmptyStr ); 2018 for( n = 3; n < MAXLEVEL; ++n ) 2019 { 2020 aFmt.SetStart( n+1 ); 2021 // --> OD 2008-02-11 #newlistlevelattrs# 2022 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 2023 { 2024 aFmt.SetAbsLSpace( nOffs2 + ((n-3) * nOffs) ); 2025 } 2026 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 2027 { 2028 aFmt.SetListtabPos( nOffs2 + ((n-3) * nOffs) ); 2029 aFmt.SetIndentAt( nOffs2 + ((n-3) * nOffs) ); 2030 } 2031 // <-- 2032 pNewRule->Set( n, aFmt ); 2033 } 2034 } 2035 break; 2036 2037 case RES_POOLNUMRULE_BUL1: 2038 { 2039 SwNumFmt aFmt; 2040 // --> OD 2008-02-11 #newlistlevelattrs# 2041 aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode ); 2042 // <-- 2043 aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); 2044 aFmt.SetCharFmt( pBullCFmt ); 2045 aFmt.SetStart( 1 ); 2046 aFmt.SetIncludeUpperLevels( 1 ); 2047 // --> OD 2006-06-29 #6440955# 2048 aFmt.SetBulletFont( &numfunc::GetDefBulletFont() ); 2049 // <-- 2050 aFmt.SetBulletChar( cBulletChar ); 2051 2052 static const sal_uInt16 aAbsSpace[ MAXLEVEL ] = 2053 { 2054 // cm: 0,4 0,8 1,2 1,6 2,0 2,4 2,8 3,2 3,6 4,0 2055 227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268 2056 }; 2057 #ifdef USE_MEASUREMENT 2058 static const sal_uInt16 aAbsSpaceInch[ MAXLEVEL ] = 2059 { 2060 227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268 2061 }; 2062 const sal_uInt16* pArr = MEASURE_METRIC == 2063 SvtSysLocale().GetLocaleData().getMeasurementSystemEnum() 2064 ? aAbsSpace 2065 : aAbsSpaceInch; 2066 #else 2067 const sal_uInt16* pArr = aAbsSpace; 2068 #endif 2069 2070 // --> OD 2008-02-11 #newlistlevelattrs# 2071 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 2072 { 2073 aFmt.SetFirstLineOffset( - (*pArr) ); 2074 } 2075 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 2076 { 2077 aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB ); 2078 aFmt.SetFirstLineIndent( - (*pArr) ); 2079 } 2080 // <-- 2081 for( n = 0; n < MAXLEVEL; ++n, ++pArr ) 2082 { 2083 // --> OD 2008-02-11 #newlistlevelattrs# 2084 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 2085 { 2086 aFmt.SetAbsLSpace( *pArr ); 2087 } 2088 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 2089 { 2090 aFmt.SetListtabPos( *pArr ); 2091 aFmt.SetIndentAt( *pArr ); 2092 } 2093 // <-- 2094 pNewRule->Set( n, aFmt ); 2095 } 2096 } 2097 break; 2098 case RES_POOLNUMRULE_BUL2: 2099 { 2100 SwNumFmt aFmt; 2101 // --> OD 2008-02-11 #newlistlevelattrs# 2102 aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode ); 2103 // <-- 2104 aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); 2105 aFmt.SetCharFmt( pBullCFmt ); 2106 aFmt.SetStart( 1 ); 2107 aFmt.SetIncludeUpperLevels( 1 ); 2108 // --> OD 2006-06-29 #6440955# 2109 aFmt.SetBulletFont( &numfunc::GetDefBulletFont() ); 2110 // <-- 2111 aFmt.SetBulletChar( 0x2013 ); 2112 2113 static const sal_uInt16 aAbsSpace[ MAXLEVEL ] = 2114 { 2115 // cm: 0,3 0,6 0,9 1,2 1,5 1,8 2,1 2,4 2,7 3,0 2116 170, 340, 510, 680, 850, 1020, 1191, 1361, 1531, 1701 2117 }; 2118 #ifdef USE_MEASUREMENT 2119 static const sal_uInt16 aAbsSpaceInch[ MAXLEVEL ] = 2120 { 2121 170, 340, 510, 680, 850, 1020, 1191, 1361, 1531, 1701 2122 }; 2123 const sal_uInt16* pArr = MEASURE_METRIC == 2124 SvtSysLocale().GetLocaleData().getMeasurementSystemEnum() 2125 ? aAbsSpace 2126 : aAbsSpaceInch; 2127 #else 2128 const sal_uInt16* pArr = aAbsSpace; 2129 #endif 2130 2131 // --> OD 2008-02-11 #newlistlevelattrs# 2132 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 2133 { 2134 aFmt.SetFirstLineOffset( - (*pArr) ); 2135 } 2136 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 2137 { 2138 aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB ); 2139 aFmt.SetFirstLineIndent( - (*pArr) ); 2140 } 2141 // <-- 2142 for( n = 0; n < MAXLEVEL; ++n, ++pArr ) 2143 { 2144 // --> OD 2008-02-11 #newlistlevelattrs# 2145 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 2146 { 2147 aFmt.SetAbsLSpace( *pArr ); 2148 } 2149 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 2150 { 2151 aFmt.SetListtabPos( *pArr ); 2152 aFmt.SetIndentAt( *pArr ); 2153 } 2154 // <-- 2155 pNewRule->Set( n, aFmt ); 2156 } 2157 } 2158 break; 2159 case RES_POOLNUMRULE_BUL3: 2160 { 2161 SwNumFmt aFmt; 2162 // --> OD 2008-02-11 #newlistlevelattrs# 2163 aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode ); 2164 // <-- 2165 aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); 2166 aFmt.SetCharFmt( pBullCFmt ); 2167 aFmt.SetStart( 1 ); 2168 aFmt.SetIncludeUpperLevels( 1 ); 2169 // --> OD 2006-06-29 #6440955# 2170 aFmt.SetBulletFont( &numfunc::GetDefBulletFont() ); 2171 // <-- 2172 2173 sal_uInt16 nOffs = GetMetricVal( CM_01 ) * 4; 2174 // --> OD 2008-02-11 #newlistlevelattrs# 2175 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 2176 { 2177 aFmt.SetFirstLineOffset( - nOffs ); 2178 } 2179 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 2180 { 2181 aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB ); 2182 aFmt.SetFirstLineIndent( - nOffs ); 2183 } 2184 // <-- 2185 2186 for( n = 0; n < MAXLEVEL; ++n ) 2187 { 2188 aFmt.SetBulletChar( ( n & 1 ? 0x25a1 : 0x2611 ) ); 2189 // --> OD 2008-02-11 #newlistlevelattrs# 2190 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 2191 { 2192 aFmt.SetAbsLSpace( ((n & 1) +1) * nOffs ); 2193 } 2194 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 2195 { 2196 aFmt.SetListtabPos( ((n & 1) +1) * nOffs ); 2197 aFmt.SetIndentAt( ((n & 1) +1) * nOffs ); 2198 } 2199 // <-- 2200 pNewRule->Set( n, aFmt ); 2201 } 2202 } 2203 break; 2204 case RES_POOLNUMRULE_BUL4: 2205 { 2206 SwNumFmt aFmt; 2207 // --> OD 2008-02-11 #newlistlevelattrs# 2208 aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode ); 2209 // <-- 2210 aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); 2211 aFmt.SetCharFmt( pBullCFmt ); 2212 aFmt.SetStart( 1 ); 2213 aFmt.SetIncludeUpperLevels( 1 ); 2214 // --> OD 2006-06-29 #6440955# 2215 aFmt.SetBulletFont( &numfunc::GetDefBulletFont() ); 2216 // <-- 2217 2218 static const sal_uInt16 aAbsSpace[ MAXLEVEL ] = 2219 { 2220 // cm: 0,4 0,8 1,2 1,6 2,0 2,4 2,8 3,2 3,6 4,0 2221 227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268 2222 }; 2223 #ifdef USE_MEASUREMENT 2224 static const sal_uInt16 aAbsSpaceInch[ MAXLEVEL ] = 2225 { 2226 227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268 2227 }; 2228 const sal_uInt16* pArr = MEASURE_METRIC == 2229 SvtSysLocale().GetLocaleData().getMeasurementSystemEnum() 2230 ? aAbsSpace 2231 : aAbsSpaceInch; 2232 #else 2233 const sal_uInt16* pArr = aAbsSpace; 2234 #endif 2235 2236 // --> OD 2008-02-11 #newlistlevelattrs# 2237 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 2238 { 2239 aFmt.SetFirstLineOffset( - (*pArr) ); 2240 } 2241 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 2242 { 2243 aFmt.SetLabelFollowedBy( SvxNumberFormat::SPACE ); 2244 aFmt.SetFirstLineIndent( - (*pArr) ); 2245 } 2246 // <-- 2247 for( n = 0; n < MAXLEVEL; ++n, ++pArr ) 2248 { 2249 switch( n ) 2250 { 2251 case 0: aFmt.SetBulletChar( 0x27a2 ); break; 2252 case 1: aFmt.SetBulletChar( 0xE006 ); break; 2253 default: aFmt.SetBulletChar( 0xE004 ); break; 2254 } 2255 // --> OD 2008-02-11 #newlistlevelattrs# 2256 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 2257 { 2258 aFmt.SetAbsLSpace( *pArr ); 2259 } 2260 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 2261 { 2262 aFmt.SetListtabPos( *pArr ); 2263 aFmt.SetIndentAt( *pArr ); 2264 } 2265 // <-- 2266 pNewRule->Set( n, aFmt ); 2267 } 2268 } 2269 break; 2270 case RES_POOLNUMRULE_BUL5: 2271 { 2272 SwNumFmt aFmt; 2273 // --> OD 2008-02-11 #newlistlevelattrs# 2274 aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode ); 2275 // <-- 2276 aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); 2277 aFmt.SetCharFmt( pBullCFmt ); 2278 aFmt.SetStart( 1 ); 2279 aFmt.SetIncludeUpperLevels( 1 ); 2280 aFmt.SetBulletChar( 0x2717 ); 2281 // --> OD 2006-06-29 #6440955# 2282 aFmt.SetBulletFont( &numfunc::GetDefBulletFont() ); 2283 // <-- 2284 2285 static const sal_uInt16 aAbsSpace[ MAXLEVEL ] = 2286 { 2287 // cm: 0,4 0,8 1,2 1,6 2,0 2,4 2,8 3,2 3,6 4,0 2288 227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268 2289 }; 2290 #ifdef USE_MEASUREMENT 2291 static const sal_uInt16 aAbsSpaceInch[ MAXLEVEL ] = 2292 { 2293 227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268 2294 }; 2295 const sal_uInt16* pArr = MEASURE_METRIC == 2296 SvtSysLocale().GetLocaleData().getMeasurementSystemEnum() 2297 ? aAbsSpace 2298 : aAbsSpaceInch; 2299 #else 2300 const sal_uInt16* pArr = aAbsSpace; 2301 #endif 2302 2303 // --> OD 2008-02-11 #newlistlevelattrs# 2304 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 2305 { 2306 aFmt.SetFirstLineOffset( - (*pArr) ); 2307 } 2308 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 2309 { 2310 aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB ); 2311 aFmt.SetFirstLineIndent( - (*pArr) ); 2312 } 2313 // <-- 2314 for( n = 0; n < MAXLEVEL; ++n, ++pArr ) 2315 { 2316 // --> OD 2008-02-11 #newlistlevelattrs# 2317 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 2318 { 2319 aFmt.SetAbsLSpace( *pArr ); 2320 } 2321 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 2322 { 2323 aFmt.SetListtabPos( *pArr ); 2324 aFmt.SetIndentAt( *pArr ); 2325 } 2326 // <-- 2327 pNewRule->Set( n, aFmt ); 2328 } 2329 } 2330 break; 2331 } 2332 2333 return pNewRule; 2334 } 2335 2336 2337 2338 // pruefe, ob diese "Auto-Collection" in Dokument schon/noch 2339 // benutzt wird 2340 bool SwDoc::IsPoolPageDescUsed( sal_uInt16 nId ) const 2341 { 2342 ASSERT( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END, 2343 "Falsche AutoFormat-Id" ); 2344 SwPageDesc *pNewPgDsc = 0; 2345 sal_Bool bFnd = sal_False; 2346 for( sal_uInt16 n = 0; !bFnd && n < aPageDescs.Count(); ++n ) 2347 { 2348 pNewPgDsc = aPageDescs[ n ]; 2349 if( nId == pNewPgDsc->GetPoolFmtId() ) 2350 bFnd = sal_True; 2351 } 2352 2353 // nicht gefunden oder keine Abhaengigen ? 2354 if( !bFnd || !pNewPgDsc->GetDepends() ) // ?????? 2355 return sal_False; 2356 2357 // dann teste mal, ob es abhaengige ContentNodes im Nodes Array gibt 2358 // (auch indirekte fuer Format-Ableitung! ) 2359 SwAutoFmtGetDocNode aGetHt( &GetNodes() ); 2360 return !pNewPgDsc->GetInfo( aGetHt ); 2361 } 2362 2363 // erfrage ob die Absatz-/Zeichen-/Rahmen-/Seiten - Vorlage benutzt wird 2364 sal_Bool SwDoc::IsUsed( const SwModify& rModify ) const 2365 { 2366 // dann teste mal, ob es abhaengige ContentNodes im Nodes Array gibt 2367 // (auch indirekte fuer Format-Ableitung! ) 2368 SwAutoFmtGetDocNode aGetHt( &GetNodes() ); 2369 return !rModify.GetInfo( aGetHt ); 2370 } 2371 2372 // erfrage ob die NumRule benutzt wird 2373 sal_Bool SwDoc::IsUsed( const SwNumRule& rRule ) const 2374 { 2375 // --> OD 2008-03-04 #refactorlists# 2376 // // dann teste mal, ob es abhaengige ContentNodes im Nodes Array gibt 2377 // // (auch indirekte fuer Format-Ableitung! ) 2378 // sal_Bool bUsed = sal_False; 2379 // SwAutoFmtGetDocNode aGetHt( &aNodes ); 2380 // SwModify* pMod; 2381 // const SfxPoolItem* pItem; 2382 // sal_uInt16 i, nMaxItems = GetAttrPool().GetItemCount( RES_PARATR_NUMRULE); 2383 // for( i = 0; i < nMaxItems; ++i ) 2384 // { 2385 // if( 0 != (pItem = GetAttrPool().GetItem( RES_PARATR_NUMRULE, i ) ) && 2386 // 0 != ( pMod = (SwModify*)((SwNumRuleItem*)pItem)->GetDefinedIn()) && 2387 // ((SwNumRuleItem*)pItem)->GetValue().Len() && 2388 // ((SwNumRuleItem*)pItem)->GetValue() == rRule.GetName() ) 2389 // { 2390 // if( pMod->IsA( TYPE( SwFmt )) ) 2391 // { 2392 // bUsed = !pMod->GetInfo( aGetHt ); 2393 // if( bUsed ) 2394 // break; 2395 // } 2396 // else if( ((SwTxtNode*)pMod)->GetNodes().IsDocNodes() ) 2397 // { 2398 // bUsed = sal_True; 2399 // break; 2400 // } 2401 // } 2402 // } 2403 2404 // return bUsed; 2405 sal_Bool bUsed = rRule.GetTxtNodeListSize() > 0 || 2406 rRule.GetParagraphStyleListSize() > 0; 2407 2408 return bUsed; 2409 // <-- 2410 } 2411 2412 // Suche die Position vom Vorlagen-Namen. Ist nicht vorhanden 2413 // dann fuege neu ein 2414 sal_uInt16 SwDoc::SetDocPattern( const String& rPatternName ) 2415 { 2416 ASSERT( rPatternName.Len(), "kein Dokument-Vorlagenname" ); 2417 2418 sal_uInt16 nNewPos = aPatternNms.Count(); 2419 for( sal_uInt16 n = 0; n < aPatternNms.Count(); ++n ) 2420 if( !aPatternNms[n] ) 2421 { 2422 if( nNewPos == aPatternNms.Count() ) 2423 nNewPos = n; 2424 } 2425 else if( rPatternName == *aPatternNms[n] ) 2426 return n; 2427 2428 if( nNewPos < aPatternNms.Count() ) 2429 aPatternNms.Remove( nNewPos ); // Platz wieder frei machen 2430 2431 String* pNewNm = new String( rPatternName ); 2432 aPatternNms.Insert( pNewNm, nNewPos ); 2433 SetModified(); 2434 return nNewPos; 2435 } 2436 2437 sal_uInt16 GetPoolParent( sal_uInt16 nId ) 2438 { 2439 sal_uInt16 nRet = USHRT_MAX; 2440 if( POOLGRP_NOCOLLID & nId ) // 1 == Formate / 0 == Collections 2441 { 2442 switch( ( COLL_GET_RANGE_BITS | POOLGRP_NOCOLLID ) & nId ) 2443 { 2444 case POOLGRP_CHARFMT: 2445 case POOLGRP_FRAMEFMT: 2446 nRet = 0; // vom default abgeleitet 2447 break; 2448 case POOLGRP_PAGEDESC: 2449 case POOLGRP_NUMRULE: 2450 break; // es gibt keine Ableitung 2451 } 2452 } 2453 else 2454 { 2455 switch( COLL_GET_RANGE_BITS & nId ) 2456 { 2457 case COLL_TEXT_BITS: 2458 switch( nId ) 2459 { 2460 case RES_POOLCOLL_STANDARD: 2461 nRet = 0; break; 2462 case RES_POOLCOLL_TEXT_IDENT: 2463 case RES_POOLCOLL_TEXT_NEGIDENT: 2464 case RES_POOLCOLL_TEXT_MOVE: 2465 case RES_POOLCOLL_CONFRONTATION: 2466 case RES_POOLCOLL_MARGINAL: 2467 nRet = RES_POOLCOLL_TEXT; break; 2468 2469 case RES_POOLCOLL_TEXT: 2470 case RES_POOLCOLL_GREETING: 2471 case RES_POOLCOLL_SIGNATURE: 2472 case RES_POOLCOLL_HEADLINE_BASE: 2473 nRet = RES_POOLCOLL_STANDARD; break; 2474 2475 case RES_POOLCOLL_HEADLINE1: 2476 case RES_POOLCOLL_HEADLINE2: 2477 case RES_POOLCOLL_HEADLINE3: 2478 case RES_POOLCOLL_HEADLINE4: 2479 case RES_POOLCOLL_HEADLINE5: 2480 case RES_POOLCOLL_HEADLINE6: 2481 case RES_POOLCOLL_HEADLINE7: 2482 case RES_POOLCOLL_HEADLINE8: 2483 case RES_POOLCOLL_HEADLINE9: 2484 case RES_POOLCOLL_HEADLINE10: 2485 nRet = RES_POOLCOLL_HEADLINE_BASE; break; 2486 } 2487 break; 2488 2489 case COLL_LISTS_BITS: 2490 switch( nId ) 2491 { 2492 case RES_POOLCOLL_NUMBUL_BASE: 2493 nRet = RES_POOLCOLL_TEXT; break; 2494 2495 default: 2496 nRet = RES_POOLCOLL_NUMBUL_BASE; break; 2497 } 2498 break; 2499 2500 case COLL_EXTRA_BITS: 2501 switch( nId ) 2502 { 2503 case RES_POOLCOLL_FRAME: 2504 nRet = RES_POOLCOLL_TEXT; break; 2505 2506 case RES_POOLCOLL_TABLE_HDLN: 2507 nRet = RES_POOLCOLL_TABLE; break; 2508 2509 case RES_POOLCOLL_TABLE: 2510 case RES_POOLCOLL_FOOTNOTE: 2511 case RES_POOLCOLL_ENDNOTE: 2512 case RES_POOLCOLL_JAKETADRESS: 2513 case RES_POOLCOLL_SENDADRESS: 2514 case RES_POOLCOLL_HEADER: 2515 case RES_POOLCOLL_HEADERL: 2516 case RES_POOLCOLL_HEADERR: 2517 case RES_POOLCOLL_FOOTER: 2518 case RES_POOLCOLL_FOOTERL: 2519 case RES_POOLCOLL_FOOTERR: 2520 case RES_POOLCOLL_LABEL: 2521 nRet = RES_POOLCOLL_STANDARD; break; 2522 2523 case RES_POOLCOLL_LABEL_ABB: 2524 case RES_POOLCOLL_LABEL_TABLE: 2525 case RES_POOLCOLL_LABEL_FRAME: 2526 case RES_POOLCOLL_LABEL_DRAWING: 2527 nRet = RES_POOLCOLL_LABEL; break; 2528 } 2529 break; 2530 2531 case COLL_REGISTER_BITS: 2532 switch( nId ) 2533 { 2534 case RES_POOLCOLL_REGISTER_BASE: 2535 nRet = RES_POOLCOLL_STANDARD; break; 2536 2537 case RES_POOLCOLL_TOX_USERH: 2538 case RES_POOLCOLL_TOX_CNTNTH: 2539 case RES_POOLCOLL_TOX_IDXH: 2540 case RES_POOLCOLL_TOX_ILLUSH: 2541 case RES_POOLCOLL_TOX_OBJECTH: 2542 case RES_POOLCOLL_TOX_TABLESH: 2543 case RES_POOLCOLL_TOX_AUTHORITIESH: 2544 nRet = RES_POOLCOLL_HEADLINE_BASE; break; 2545 2546 default: 2547 nRet = RES_POOLCOLL_REGISTER_BASE; break; 2548 } 2549 break; 2550 2551 case COLL_DOC_BITS: 2552 nRet = RES_POOLCOLL_HEADLINE_BASE; 2553 break; 2554 2555 case COLL_HTML_BITS: 2556 nRet = RES_POOLCOLL_STANDARD; 2557 break; 2558 } 2559 } 2560 2561 return nRet; 2562 } 2563 2564 void SwDoc::RemoveAllFmtLanguageDependencies() 2565 { 2566 /* #106748# Restore the language independ pool defaults and styles. */ 2567 GetAttrPool().ResetPoolDefaultItem( RES_PARATR_ADJUST ); 2568 2569 SwTxtFmtColl * pTxtFmtColl = GetTxtCollFromPool( RES_POOLCOLL_STANDARD ); 2570 2571 pTxtFmtColl->ResetFmtAttr( RES_PARATR_ADJUST ); 2572 /* #111214# koreans do not like SvxScriptItem(sal_True) */ 2573 pTxtFmtColl->ResetFmtAttr( RES_PARATR_SCRIPTSPACE ); 2574 2575 SvxFrameDirectionItem aFrameDir( FRMDIR_HORI_LEFT_TOP, RES_FRAMEDIR ); 2576 2577 sal_uInt16 nCount = GetPageDescCnt(); 2578 for( sal_uInt16 i=0; i<nCount; ++i ) 2579 { 2580 SwPageDesc& rDesc = _GetPageDesc( i ); 2581 rDesc.GetMaster().SetFmtAttr( aFrameDir ); 2582 rDesc.GetLeft().SetFmtAttr( aFrameDir ); 2583 } 2584 2585 // OD 09.10.2003 #i18732# - restore static pool default for item 2586 // RES_FOLLOW_TEXT_FLOW. 2587 GetAttrPool().ResetPoolDefaultItem( RES_FOLLOW_TEXT_FLOW ); 2588 2589 //#i16874# AutoKerning as default for new documents 2590 GetAttrPool().ResetPoolDefaultItem( RES_CHRATR_AUTOKERN ); 2591 } 2592