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