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 //UUUU 74 #include <svx/xfillit0.hxx> 75 76 using namespace ::com::sun::star; 77 78 const sal_uInt16 PT_3 = 3 * 20; // 3 pt 79 const sal_uInt16 PT_6 = 6 * 20; // 6 pt 80 const sal_uInt16 PT_7 = 7 * 20; // 6 pt 81 const sal_uInt16 PT_8 = 8 * 20; // 8 pt 82 const sal_uInt16 PT_9 = 9 * 20; // 9 pt 83 const sal_uInt16 PT_10 = 10 * 20; // 10 pt 84 const sal_uInt16 PT_11 = 11 * 20; // 11 pt 85 const sal_uInt16 PT_12 = 12 * 20; // 12 pt 86 const sal_uInt16 PT_14 = 14 * 20; // 14 pt 87 const sal_uInt16 PT_16 = 16 * 20; // 16 pt 88 const sal_uInt16 PT_18 = 18 * 20; // 18 pt 89 const sal_uInt16 PT_22 = 22 * 20; // 22 pt 90 const sal_uInt16 PT_24 = 24 * 20; // 22 pt 91 92 93 //const sal_uInt16 HTML_PARSPACE = ((CM_05 * 7) / 10); 94 #define HTML_PARSPACE GetMetricVal( CM_05 ) 95 96 static const sal_Char __FAR_DATA sKomma[] = ", "; 97 98 static const sal_uInt16 aHeadlineSizes[ 2 * MAXLEVEL ] = { 99 // PT_16, PT_14, PT_14, PT_12, PT_12, // normal 100 //JP 10.12.96: jetzt soll alles prozentual sein: 101 115, 100, 100, 85, 85, 102 75, 75, 75, 75, 75, // normal 103 // PT_22, PT_16, PT_12, PT_11, PT_9 // HTML-Mode 104 PT_24, PT_18, PT_14, PT_12, PT_10, 105 PT_7, PT_7, PT_7, PT_7, PT_7 // HTML-Mode 106 }; 107 108 long lcl_GetRightMargin( SwDoc& rDoc ) 109 { 110 // sorge dafuer, dass die Druckereinstellungen in die Standard- 111 // Seitenvorlage uebernommen wurden. 112 const SwFrmFmt& rPgDscFmt = 113 const_cast<const SwDoc *>(&rDoc)->GetPageDesc( 0 ).GetMaster(); 114 const SvxLRSpaceItem& rLR = rPgDscFmt.GetLRSpace(); 115 const long nLeft = rLR.GetLeft(); 116 const long nRight = rLR.GetRight(); 117 const long nWidth = rPgDscFmt.GetFrmSize().GetWidth(); 118 return nWidth - nLeft - nRight; 119 } 120 121 void SetAllScriptItem( SfxItemSet& rSet, const SfxPoolItem& rItem ) 122 { 123 rSet.Put( rItem ); 124 sal_uInt16 nWhCJK = 0, nWhCTL = 0; 125 switch( rItem.Which() ) 126 { 127 case RES_CHRATR_FONTSIZE: 128 nWhCJK = RES_CHRATR_CJK_FONTSIZE, nWhCTL = RES_CHRATR_CTL_FONTSIZE; 129 break; 130 case RES_CHRATR_FONT: 131 nWhCJK = RES_CHRATR_CJK_FONT, nWhCTL = RES_CHRATR_CTL_FONT; 132 break; 133 case RES_CHRATR_LANGUAGE: 134 nWhCJK = RES_CHRATR_CJK_LANGUAGE, nWhCTL = RES_CHRATR_CTL_LANGUAGE; 135 break; 136 case RES_CHRATR_POSTURE: 137 nWhCJK = RES_CHRATR_CJK_POSTURE, nWhCTL = RES_CHRATR_CTL_POSTURE; 138 break; 139 case RES_CHRATR_WEIGHT: 140 nWhCJK = RES_CHRATR_CJK_WEIGHT, nWhCTL = RES_CHRATR_CTL_WEIGHT; 141 break; 142 } 143 144 if( nWhCJK ) 145 rSet.Put( rItem, nWhCJK ); 146 if( nWhCTL ) 147 rSet.Put( rItem, nWhCTL ); 148 } 149 150 void lcl_SetDfltFont( sal_uInt16 nFntType, SfxItemSet& rSet ) 151 { 152 static struct { 153 sal_uInt16 nResLngId; 154 sal_uInt16 nResFntId; 155 } aArr[ 3 ] = { 156 { RES_CHRATR_LANGUAGE, RES_CHRATR_FONT }, 157 { RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_FONT }, 158 { RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_FONT } 159 }; 160 for( sal_uInt16 n = 0; n < 3; ++n ) 161 { 162 sal_uInt16 nLng = ((SvxLanguageItem&)rSet.GetPool()->GetDefaultItem( 163 aArr[n].nResLngId )).GetLanguage(); 164 Font aFnt( OutputDevice::GetDefaultFont( nFntType, 165 nLng, DEFAULTFONT_FLAGS_ONLYONE ) ); 166 167 rSet.Put( SvxFontItem( aFnt.GetFamily(), aFnt.GetName(), 168 aEmptyStr, aFnt.GetPitch(), 169 aFnt.GetCharSet(), aArr[n].nResFntId )); 170 } 171 } 172 173 void lcl_SetDfltFont( sal_uInt16 nLatinFntType, sal_uInt16 nCJKFntType, 174 sal_uInt16 nCTLFntType, SfxItemSet& rSet ) 175 { 176 static struct { 177 sal_uInt16 nResLngId; 178 sal_uInt16 nResFntId; 179 sal_uInt16 nFntType; 180 } aArr[ 3 ] = { 181 { RES_CHRATR_LANGUAGE, RES_CHRATR_FONT, 0 }, 182 { RES_CHRATR_CJK_LANGUAGE, RES_CHRATR_CJK_FONT, 0 }, 183 { RES_CHRATR_CTL_LANGUAGE, RES_CHRATR_CTL_FONT, 0 } 184 }; 185 aArr[0].nFntType = nLatinFntType; 186 aArr[1].nFntType = nCJKFntType; 187 aArr[2].nFntType = nCTLFntType; 188 189 for( sal_uInt16 n = 0; n < 3; ++n ) 190 { 191 sal_uInt16 nLng = ((SvxLanguageItem&)rSet.GetPool()->GetDefaultItem( 192 aArr[n].nResLngId )).GetLanguage(); 193 Font aFnt( OutputDevice::GetDefaultFont( aArr[n].nFntType, 194 nLng, DEFAULTFONT_FLAGS_ONLYONE ) ); 195 196 rSet.Put( SvxFontItem( aFnt.GetFamily(), aFnt.GetName(), 197 aEmptyStr, aFnt.GetPitch(), 198 aFnt.GetCharSet(), aArr[n].nResFntId )); 199 } 200 } 201 202 void lcl_SetHeadline( SwDoc* pDoc, SwTxtFmtColl* pColl, 203 SfxItemSet& rSet, 204 sal_uInt16 nOutLvlBits, sal_uInt8 nLevel, sal_Bool bItalic ) 205 { 206 SetAllScriptItem( rSet, SvxWeightItem( WEIGHT_BOLD, RES_CHRATR_WEIGHT ) ); 207 SvxFontHeightItem aHItem(240, 100, RES_CHRATR_FONTSIZE); 208 const bool bHTMLMode = pDoc->get(IDocumentSettingAccess::HTML_MODE); 209 if( bHTMLMode ) 210 aHItem.SetHeight( aHeadlineSizes[ MAXLEVEL + nLevel ] ); 211 else 212 aHItem.SetHeight( PT_14, aHeadlineSizes[ nLevel ] ); 213 SetAllScriptItem( rSet, aHItem ); 214 215 if( bItalic && !bHTMLMode ) 216 SetAllScriptItem( rSet, SvxPostureItem( ITALIC_NORMAL, RES_CHRATR_POSTURE ) ); 217 218 if( bHTMLMode ) 219 { 220 ::lcl_SetDfltFont( DEFAULTFONT_LATIN_TEXT, DEFAULTFONT_CJK_TEXT, 221 DEFAULTFONT_CTL_TEXT, rSet ); 222 } 223 224 if( pColl ) 225 { 226 if( !( nOutLvlBits & ( 1 << nLevel )) ) 227 { 228 //pColl->SetOutlineLevel( nLevel ); //#outline level zhaojianwei 229 pColl->AssignToListLevelOfOutlineStyle(nLevel);//<-end,zhaojianwei 230 if( !bHTMLMode ) 231 { 232 SwNumRule * pOutlineRule = pDoc->GetOutlineNumRule(); 233 const SwNumFmt& rNFmt = pOutlineRule->Get( nLevel ); 234 // --> OD 2008-02-01 #newlistlevelattrs# 235 if ( rNFmt.GetPositionAndSpaceMode() == 236 SvxNumberFormat::LABEL_WIDTH_AND_POSITION && 237 ( rNFmt.GetAbsLSpace() || rNFmt.GetFirstLineOffset() ) ) 238 // <-- 239 { 240 SvxLRSpaceItem aLR( (SvxLRSpaceItem&)pColl->GetFmtAttr( RES_LR_SPACE ) ); 241 aLR.SetTxtFirstLineOfstValue( rNFmt.GetFirstLineOffset() ); 242 aLR.SetTxtLeft( rNFmt.GetAbsLSpace() ); 243 pColl->SetFmtAttr( aLR ); 244 } 245 246 // --> OD 2006-11-20 #i71764# 247 // Check on document setting OUTLINE_LEVEL_YIELDS_OUTLINE_RULE no longer needed. 248 // All paragraph styles, which are assigned to a level of the 249 // outline style has to have the outline style set as its list style. 250 { 251 SwNumRuleItem aItem(pOutlineRule->GetName()); 252 253 pColl->SetFmtAttr(aItem); 254 } 255 // <-- 256 } 257 } 258 pColl->SetNextTxtFmtColl( *pDoc->GetTxtCollFromPool( 259 RES_POOLCOLL_TEXT )); 260 } 261 } 262 263 264 265 void lcl_SetRegister( SwDoc* pDoc, SfxItemSet& rSet, sal_uInt16 nFact, 266 sal_Bool bHeader, sal_Bool bTab ) 267 { 268 SvxLRSpaceItem aLR( RES_LR_SPACE ); 269 sal_uInt16 nLeft = nFact ? GetMetricVal( CM_05 ) * nFact : 0; 270 aLR.SetTxtLeft( nLeft ); 271 272 rSet.Put( aLR ); 273 if( bHeader ) 274 { 275 SetAllScriptItem( rSet, SvxWeightItem( WEIGHT_BOLD, RES_CHRATR_WEIGHT ) ); 276 SetAllScriptItem( rSet, SvxFontHeightItem( PT_16, 100, RES_CHRATR_FONTSIZE ) ); 277 } 278 if( bTab ) 279 { 280 long nRightMargin = lcl_GetRightMargin( *pDoc ); 281 SvxTabStopItem aTStops( 0, 0, SVX_TAB_ADJUST_DEFAULT, RES_PARATR_TABSTOP ); 282 aTStops.Insert( SvxTabStop( nRightMargin - nLeft, 283 SVX_TAB_ADJUST_RIGHT, 284 cDfltDecimalChar, '.' )); 285 rSet.Put( aTStops ); 286 } 287 } 288 289 290 291 void lcl_SetNumBul( SwDoc* pDoc, SwTxtFmtColl* pColl, 292 SfxItemSet& rSet, 293 sal_uInt16 nNxt, SwTwips nEZ, SwTwips nLeft, 294 SwTwips nUpper, SwTwips nLower ) 295 { 296 297 SvxLRSpaceItem aLR( RES_LR_SPACE ); SvxULSpaceItem aUL( RES_UL_SPACE ); 298 aLR.SetTxtFirstLineOfst( sal_uInt16(nEZ) ); aLR.SetTxtLeft( sal_uInt16(nLeft) ); 299 aUL.SetUpper( sal_uInt16(nUpper) ); aUL.SetLower( sal_uInt16(nLower) ); 300 rSet.Put( aLR ); 301 rSet.Put( aUL ); 302 303 if( !pColl ) 304 pColl->SetNextTxtFmtColl( *pDoc->GetTxtCollFromPool( nNxt )); 305 } 306 307 308 309 // Gebe die "Auto-Collection" mit der Id zurueck. Existiert 310 // sie noch nicht, dann erzeuge sie 311 // Ist der String-Pointer definiert, dann erfrage nur die 312 // Beschreibung der Attribute, !! es legt keine Vorlage an !! 313 314 SvxFrameDirection GetDefaultFrameDirection(sal_uLong nLanguage) 315 { 316 SvxFrameDirection eResult = (MsLangId::isRightToLeft( static_cast<LanguageType>(nLanguage)) ? 317 FRMDIR_HORI_RIGHT_TOP : FRMDIR_HORI_LEFT_TOP); 318 return eResult; 319 } 320 321 SwTxtFmtColl* SwDoc::GetTxtCollFromPool( sal_uInt16 nId, bool bRegardLanguage ) 322 { 323 ASSERT( 324 (RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END) || 325 (RES_POOLCOLL_LISTS_BEGIN <= nId && nId < RES_POOLCOLL_LISTS_END) || 326 (RES_POOLCOLL_EXTRA_BEGIN <= nId && nId < RES_POOLCOLL_EXTRA_END) || 327 (RES_POOLCOLL_REGISTER_BEGIN <= nId && nId < RES_POOLCOLL_REGISTER_END) || 328 (RES_POOLCOLL_DOC_BEGIN <= nId && nId < RES_POOLCOLL_DOC_END) || 329 (RES_POOLCOLL_HTML_BEGIN <= nId && nId < RES_POOLCOLL_HTML_END), 330 "Falsche AutoFormat-Id" ); 331 332 SwTxtFmtColl* pNewColl; 333 sal_uInt16 nOutLvlBits = 0; 334 for( sal_uInt16 n = 0; n < pTxtFmtCollTbl->Count(); ++n ) 335 { 336 if( nId == ( pNewColl = (*pTxtFmtCollTbl)[ n ] )->GetPoolFmtId() ) 337 { 338 return pNewColl; 339 } 340 //if( pNewColl->GetOutlineLevel() < MAXLEVEL ) //#outline level,zhaojianwei 341 //nOutLvlBits |= ( 1 << pNewColl->GetOutlineLevel() ); 342 if( pNewColl->IsAssignedToListLevelOfOutlineStyle()) 343 nOutLvlBits |= ( 1 << pNewColl->GetAssignedOutlineStyleLevel() );//<-end,zhaojianwei 344 } 345 346 // bis hierher nicht gefunden -> neu anlegen 347 sal_uInt16 nResId = 0; 348 if( RES_POOLCOLL_TEXT_BEGIN <= nId && nId < RES_POOLCOLL_TEXT_END ) 349 nResId = RC_POOLCOLL_TEXT_BEGIN - RES_POOLCOLL_TEXT_BEGIN; 350 else if (RES_POOLCOLL_LISTS_BEGIN <= nId && nId < RES_POOLCOLL_LISTS_END) 351 nResId = RC_POOLCOLL_LISTS_BEGIN - RES_POOLCOLL_LISTS_BEGIN; 352 else if (RES_POOLCOLL_EXTRA_BEGIN <= nId && nId < RES_POOLCOLL_EXTRA_END) 353 nResId = RC_POOLCOLL_EXTRA_BEGIN - RES_POOLCOLL_EXTRA_BEGIN; 354 else if (RES_POOLCOLL_REGISTER_BEGIN <= nId && nId < RES_POOLCOLL_REGISTER_END) 355 nResId = RC_POOLCOLL_REGISTER_BEGIN - RES_POOLCOLL_REGISTER_BEGIN; 356 else if (RES_POOLCOLL_DOC_BEGIN <= nId && nId < RES_POOLCOLL_DOC_END) 357 nResId = RC_POOLCOLL_DOC_BEGIN - RES_POOLCOLL_DOC_BEGIN; 358 else if (RES_POOLCOLL_HTML_BEGIN <= nId && nId < RES_POOLCOLL_HTML_END) 359 nResId = RC_POOLCOLL_HTML_BEGIN - RES_POOLCOLL_HTML_BEGIN; 360 361 ASSERT( nResId, "Ungueltige Pool-ID" ); 362 if( !nResId ) 363 return GetTxtCollFromPool( RES_POOLCOLL_STANDARD ); 364 365 ResId aResId( nResId + nId, *pSwResMgr ); 366 String aNm( aResId ); 367 368 // ein Set fuer alle zusetzenden Attribute 369 SwAttrSet aSet( GetAttrPool(), aTxtFmtCollSetRange ); 370 sal_uInt16 nParent = GetPoolParent( nId ); 371 372 { 373 374 //FEATURE::CONDCOLL 375 if(::IsConditionalByPoolId( nId )) 376 pNewColl = new SwConditionTxtFmtColl( GetAttrPool(), aNm, !nParent 377 ? pDfltTxtFmtColl 378 : GetTxtCollFromPool( nParent )); 379 else 380 //FEATURE::CONDCOLL 381 pNewColl = new SwTxtFmtColl( GetAttrPool(), aNm, !nParent 382 ? pDfltTxtFmtColl 383 : GetTxtCollFromPool( nParent )); 384 pNewColl->SetPoolFmtId( nId ); 385 pTxtFmtCollTbl->Insert( pNewColl, pTxtFmtCollTbl->Count() ); 386 } 387 388 switch( nId ) 389 { 390 // allgemeine Inhaltsformen 391 case RES_POOLCOLL_STANDARD: 392 /* #111214# koreans do not like SvxScriptItem(sal_True) */ 393 if (bRegardLanguage) 394 { 395 sal_uLong nAppLanguage = GetAppLanguage(); 396 if (GetDefaultFrameDirection(nAppLanguage) == 397 FRMDIR_HORI_RIGHT_TOP) 398 { 399 SvxAdjustItem aAdjust(SVX_ADJUST_RIGHT, RES_PARATR_ADJUST ); 400 aSet.Put(aAdjust); 401 } 402 if (nAppLanguage == LANGUAGE_KOREAN) 403 { 404 SvxScriptSpaceItem aScriptSpace(sal_False, RES_PARATR_SCRIPTSPACE); 405 aSet.Put(aScriptSpace); 406 } 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 //UUUU for styles of FlyFrames do not set the FillStyle to make it a derived attribute 1320 aSet.ClearItem(XATTR_FILLSTYLE); 1321 } 1322 break; 1323 case RES_POOLFRM_GRAPHIC: 1324 case RES_POOLFRM_OLE: 1325 { 1326 aSet.Put( SwFmtAnchor( FLY_AT_PARA )); 1327 aSet.Put( SwFmtHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME )); 1328 aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME )); 1329 aSet.Put( SwFmtSurround( SURROUND_NONE )); 1330 } 1331 break; 1332 case RES_POOLFRM_FORMEL: 1333 { 1334 aSet.Put( SwFmtAnchor( FLY_AS_CHAR ) ); 1335 aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::CHAR_CENTER, text::RelOrientation::FRAME ) ); 1336 aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) ); 1337 } 1338 break; 1339 case RES_POOLFRM_MARGINAL: 1340 { 1341 aSet.Put( SwFmtAnchor( FLY_AT_PARA )); 1342 aSet.Put( SwFmtHoriOrient( 0, text::HoriOrientation::LEFT, text::RelOrientation::FRAME )); 1343 aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME )); 1344 aSet.Put( SwFmtSurround( SURROUND_PARALLEL )); 1345 // Breite 3.5 centimeter vorgegeben, als Hoehe nur den 1346 // min. Wert benutzen 1347 aSet.Put( SwFmtFrmSize( ATT_MIN_SIZE, 1348 GetMetricVal( CM_1 ) * 3 + GetMetricVal( CM_05 ), 1349 MM50 )); 1350 } 1351 break; 1352 case RES_POOLFRM_WATERSIGN: 1353 { 1354 aSet.Put( SwFmtAnchor( FLY_AT_PAGE )); 1355 aSet.Put( SwFmtHoriOrient( 0, text::HoriOrientation::CENTER, text::RelOrientation::FRAME )); 1356 aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::CENTER, text::RelOrientation::FRAME )); 1357 aSet.Put( SvxOpaqueItem( sal_False )); 1358 aSet.Put( SwFmtSurround( SURROUND_THROUGHT )); 1359 } 1360 break; 1361 1362 case RES_POOLFRM_LABEL: 1363 { 1364 aSet.Put( SwFmtAnchor( FLY_AS_CHAR ) ); 1365 aSet.Put( SwFmtVertOrient( 0, text::VertOrientation::TOP, text::RelOrientation::FRAME ) ); 1366 aSet.Put( SvxLRSpaceItem( 114, 114, 0, 0, RES_LR_SPACE ) ); 1367 1368 SvxProtectItem aProtect( RES_PROTECT ); 1369 aProtect.SetSizeProtect( sal_True ); 1370 aProtect.SetPosProtect( sal_True ); 1371 aSet.Put( aProtect ); 1372 1373 pNewFmt->SetAutoUpdateFmt( sal_True ); 1374 } 1375 break; 1376 } 1377 if( aSet.Count() ) 1378 { 1379 { 1380 pNewFmt->SetFmtAttr( aSet ); 1381 // JP 31.08.95: erzeugen einer PoolVorlage ist keine Modifikation 1382 // (Bug: 18545) 1383 // SetModified(); 1384 } 1385 } 1386 return pNewFmt; 1387 } 1388 1389 SwFrmFmt* SwDoc::GetFrmFmtFromPool( sal_uInt16 nId ) 1390 { 1391 return (SwFrmFmt*)GetFmtFromPool( nId ); 1392 } 1393 1394 SwCharFmt* SwDoc::GetCharFmtFromPool( sal_uInt16 nId ) 1395 { 1396 return (SwCharFmt*)GetFmtFromPool( nId ); 1397 } 1398 1399 // pruefe, ob diese "Auto-Collection" in Dokument schon/noch 1400 // benutzt wird 1401 bool SwDoc::IsPoolFmtUsed( sal_uInt16 nId ) const 1402 { 1403 SwFmt *pNewFmt = 0; 1404 const SvPtrarr* pArray[ 2 ]; 1405 sal_uInt16 nArrCnt = 1; 1406 sal_Bool bFnd = sal_True; 1407 1408 if( RES_POOLCHR_BEGIN <= nId && nId < RES_POOLCHR_END ) 1409 { 1410 pArray[0] = pCharFmtTbl; 1411 } 1412 if( RES_POOLFRM_BEGIN <= nId && nId < RES_POOLFRM_END ) 1413 { 1414 pArray[0] = pFrmFmtTbl; 1415 pArray[1] = pSpzFrmFmtTbl; 1416 nArrCnt = 2; 1417 } 1418 else 1419 { 1420 ASSERT( sal_False, "ungueltige Id" ); 1421 bFnd = sal_False; 1422 } 1423 1424 if( bFnd ) 1425 { 1426 bFnd = sal_False; 1427 while( nArrCnt-- && !bFnd ) 1428 for( sal_uInt16 n = 0; !bFnd && n < (*pArray[nArrCnt]).Count(); ++n ) 1429 if( nId == ( pNewFmt = (SwFmt*)(*pArray[ nArrCnt ] )[ n ] )-> 1430 GetPoolFmtId() ) 1431 bFnd = sal_True; 1432 } 1433 1434 // nicht gefunden oder keine Abhaengigen ? 1435 if( bFnd && pNewFmt->GetDepends() ) 1436 { 1437 // dann teste mal, ob es abhaengige ContentNodes im Nodes Array gibt 1438 // (auch indirekte fuer Format-Ableitung! ) 1439 SwAutoFmtGetDocNode aGetHt( &GetNodes() ); 1440 bFnd = !pNewFmt->GetInfo( aGetHt ); 1441 } 1442 else 1443 bFnd = sal_False; 1444 1445 return bFnd; 1446 } 1447 1448 1449 1450 void lcl_PutStdPageSizeIntoItemSet( SwDoc* pDoc, SfxItemSet& rSet ) 1451 { 1452 SwPageDesc* pStdPgDsc = pDoc->GetPageDescFromPool( RES_POOLPAGE_STANDARD ); 1453 SwFmtFrmSize aFrmSz( pStdPgDsc->GetMaster().GetFrmSize() ); 1454 if( pStdPgDsc->GetLandscape() ) 1455 { 1456 SwTwips nTmp = aFrmSz.GetHeight(); 1457 aFrmSz.SetHeight( aFrmSz.GetWidth() ); 1458 aFrmSz.SetWidth( nTmp ); 1459 } 1460 rSet.Put( aFrmSz ); 1461 } 1462 1463 SwPageDesc* SwDoc::GetPageDescFromPool( sal_uInt16 nId, bool bRegardLanguage ) 1464 { 1465 ASSERT( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END, 1466 "Falsche AutoFormat-Id" ); 1467 1468 for( sal_uInt16 n = 0; n < aPageDescs.Count(); ++n ) 1469 { 1470 if ( nId == aPageDescs[ n ]->GetPoolFmtId() ) 1471 { 1472 return aPageDescs[ n ]; 1473 } 1474 } 1475 1476 if( RES_POOLPAGE_BEGIN > nId || nId >= RES_POOLPAGE_END ) 1477 { 1478 // unknown page pool ID 1479 ASSERT( !this, "<SwDoc::GetPageDescFromPool(..)> - unknown page pool ID" ); 1480 nId = RES_POOLPAGE_BEGIN; 1481 } 1482 1483 SwPageDesc* pNewPgDsc = 0; 1484 { 1485 const ResId aResId( sal_uInt32(RC_POOLPAGEDESC_BEGIN + nId - RES_POOLPAGE_BEGIN), *pSwResMgr ); 1486 const String aNm( aResId ); 1487 const bool bIsModified = IsModified(); 1488 1489 sal_uInt16 nPageDescIdx = 0; 1490 { 1491 ::sw::UndoGuard const undoGuard(GetIDocumentUndoRedo()); 1492 nPageDescIdx = MakePageDesc( aNm, 0, bRegardLanguage ); 1493 } 1494 1495 pNewPgDsc = aPageDescs[ nPageDescIdx ]; 1496 pNewPgDsc->SetPoolFmtId( nId ); 1497 if ( !bIsModified ) 1498 { 1499 ResetModified(); 1500 } 1501 } 1502 1503 SvxLRSpaceItem aLR( RES_LR_SPACE ); 1504 { 1505 aLR.SetLeft( GetMetricVal( CM_1 ) * 2 ); 1506 aLR.SetRight( aLR.GetLeft() ); 1507 } 1508 SvxULSpaceItem aUL( RES_UL_SPACE ); 1509 { 1510 aUL.SetUpper( (sal_uInt16)aLR.GetLeft() ); 1511 aUL.SetLower( (sal_uInt16)aLR.GetLeft() ); 1512 } 1513 1514 SwAttrSet aSet( GetAttrPool(), aPgFrmFmtSetRange ); 1515 bool bSetLeft = true; 1516 1517 switch( nId ) 1518 { 1519 case RES_POOLPAGE_STANDARD: // "Default" 1520 { 1521 aSet.Put( aLR ); 1522 aSet.Put( aUL ); 1523 if( pNewPgDsc ) 1524 pNewPgDsc->SetUseOn( nsUseOnPage::PD_ALL ); 1525 } 1526 break; 1527 1528 case RES_POOLPAGE_FIRST: // "First Page" 1529 case RES_POOLPAGE_REGISTER: // "Index" 1530 { 1531 lcl_PutStdPageSizeIntoItemSet( this, aSet ); 1532 aSet.Put( aLR ); 1533 aSet.Put( aUL ); 1534 if( pNewPgDsc ) 1535 { 1536 pNewPgDsc->SetUseOn( nsUseOnPage::PD_ALL ); 1537 if( RES_POOLPAGE_FIRST == nId ) 1538 pNewPgDsc->SetFollow( GetPageDescFromPool( RES_POOLPAGE_STANDARD )); 1539 } 1540 } 1541 break; 1542 1543 case RES_POOLPAGE_LEFT: // "Left Page" 1544 { 1545 lcl_PutStdPageSizeIntoItemSet( this, aSet ); 1546 aSet.Put( aLR ); 1547 aSet.Put( aUL ); 1548 bSetLeft = false; 1549 if( pNewPgDsc ) 1550 pNewPgDsc->SetUseOn( nsUseOnPage::PD_LEFT ); 1551 } 1552 break; 1553 case RES_POOLPAGE_RIGHT: // "Right Page" 1554 { 1555 lcl_PutStdPageSizeIntoItemSet( this, aSet ); 1556 aSet.Put( aLR ); 1557 aSet.Put( aUL ); 1558 bSetLeft = false; 1559 if( pNewPgDsc ) 1560 pNewPgDsc->SetUseOn( nsUseOnPage::PD_RIGHT ); 1561 } 1562 break; 1563 1564 case RES_POOLPAGE_JAKET: // "Envelope" 1565 { 1566 Size aPSize( SvxPaperInfo::GetPaperSize( PAPER_ENV_C65 ) ); 1567 LandscapeSwap( aPSize ); 1568 aSet.Put( SwFmtFrmSize( ATT_FIX_SIZE, aPSize.Width(), aPSize.Height() )); 1569 aLR.SetLeft( 0 ); aLR.SetRight( 0 ); 1570 aUL.SetUpper( 0 ); aUL.SetLower( 0 ); 1571 aSet.Put( aLR ); 1572 aSet.Put( aUL ); 1573 1574 if( pNewPgDsc ) 1575 { 1576 pNewPgDsc->SetUseOn( nsUseOnPage::PD_ALL ); 1577 pNewPgDsc->SetLandscape( sal_True ); 1578 } 1579 } 1580 break; 1581 1582 case RES_POOLPAGE_HTML: // "HTML" 1583 { 1584 lcl_PutStdPageSizeIntoItemSet( this, aSet ); 1585 aLR.SetRight( GetMetricVal( CM_1 )); 1586 aUL.SetUpper( (sal_uInt16)aLR.GetRight() ); 1587 aUL.SetLower( (sal_uInt16)aLR.GetRight() ); 1588 aSet.Put( aLR ); 1589 aSet.Put( aUL ); 1590 1591 if( pNewPgDsc ) 1592 pNewPgDsc->SetUseOn( nsUseOnPage::PD_ALL ); 1593 } 1594 break; 1595 1596 case RES_POOLPAGE_FOOTNOTE: // "Footnote" 1597 case RES_POOLPAGE_ENDNOTE: // "Endnote" 1598 { 1599 lcl_PutStdPageSizeIntoItemSet( this, aSet ); 1600 aSet.Put( aLR ); 1601 aSet.Put( aUL ); 1602 if( pNewPgDsc ) 1603 pNewPgDsc->SetUseOn( nsUseOnPage::PD_ALL ); 1604 SwPageFtnInfo aInf( pNewPgDsc->GetFtnInfo() ); 1605 aInf.SetLineWidth( 0 ); 1606 aInf.SetTopDist( 0 ); 1607 aInf.SetBottomDist( 0 ); 1608 pNewPgDsc->SetFtnInfo( aInf ); 1609 } 1610 break; 1611 1612 case RES_POOLPAGE_LANDSCAPE: // "Landscape" 1613 { 1614 SwPageDesc* pStdPgDsc = this->GetPageDescFromPool( RES_POOLPAGE_STANDARD ); 1615 SwFmtFrmSize aFrmSz( pStdPgDsc->GetMaster().GetFrmSize() ); 1616 if ( !pStdPgDsc->GetLandscape() ) 1617 { 1618 const SwTwips nTmp = aFrmSz.GetHeight(); 1619 aFrmSz.SetHeight( aFrmSz.GetWidth() ); 1620 aFrmSz.SetWidth( nTmp ); 1621 } 1622 aSet.Put( aFrmSz ); 1623 aSet.Put( aLR ); 1624 aSet.Put( aUL ); 1625 if( pNewPgDsc ) 1626 { 1627 pNewPgDsc->SetUseOn( nsUseOnPage::PD_ALL ); 1628 pNewPgDsc->SetLandscape( sal_True ); 1629 } 1630 } 1631 break; 1632 1633 } 1634 1635 if( aSet.Count() ) 1636 { 1637 if( bSetLeft ) 1638 pNewPgDsc->GetLeft().SetFmtAttr( aSet ); 1639 pNewPgDsc->GetMaster().SetFmtAttr( aSet ); 1640 } 1641 return pNewPgDsc; 1642 } 1643 1644 SwNumRule* SwDoc::GetNumRuleFromPool( sal_uInt16 nId ) 1645 { 1646 ASSERT( RES_POOLNUMRULE_BEGIN <= nId && nId < RES_POOLNUMRULE_END, 1647 "Falsche AutoFormat-Id" ); 1648 1649 SwNumRule* pNewRule; 1650 sal_uInt16 n; 1651 1652 for( n = 0; n < GetNumRuleTbl().Count(); ++n ) 1653 if( nId == ( pNewRule = GetNumRuleTbl()[ n ] )->GetPoolFmtId() ) 1654 { 1655 return pNewRule; 1656 } 1657 1658 // Fehlerfall: unbekannte Poolvorlage 1659 if( RES_POOLNUMRULE_BEGIN > nId || nId >= RES_POOLNUMRULE_END ) 1660 { 1661 ASSERT( !this, "ungueltige Id" ); 1662 nId = RES_POOLNUMRULE_BEGIN; 1663 } 1664 1665 ResId aResId( sal_uInt32(RC_POOLNUMRULE_BEGIN + nId - RES_POOLNUMRULE_BEGIN), *pSwResMgr ); 1666 String aNm( aResId ); 1667 1668 SwCharFmt *pNumCFmt = 0, *pBullCFmt = 0; 1669 1670 // --> OD 2008-02-11 #newlistlevelattrs# 1671 const SvxNumberFormat::SvxNumPositionAndSpaceMode eNumberFormatPositionAndSpaceMode 1672 // --> OD 2008-06-06 #i89178# 1673 = numfunc::GetDefaultPositionAndSpaceMode(); 1674 // <-- 1675 // <-- 1676 { 1677 sal_Bool bIsModified = IsModified(); 1678 // --> OD 2008-02-11 #newlistlevelattrs# 1679 n = MakeNumRule( aNm, 0, sal_False, eNumberFormatPositionAndSpaceMode ); 1680 // <-- 1681 pNewRule = GetNumRuleTbl()[ n ]; 1682 pNewRule->SetPoolFmtId( nId ); 1683 pNewRule->SetAutoRule( sal_False ); 1684 1685 if( RES_POOLNUMRULE_NUM1 <= nId && nId <= RES_POOLNUMRULE_NUM5 ) 1686 pNumCFmt = GetCharFmtFromPool( RES_POOLCHR_NUM_LEVEL ); 1687 1688 if( ( RES_POOLNUMRULE_BUL1 <= nId && nId <= RES_POOLNUMRULE_BUL5 ) || 1689 RES_POOLNUMRULE_NUM5 == nId ) 1690 pBullCFmt = GetCharFmtFromPool( RES_POOLCHR_NUM_LEVEL ); 1691 1692 if( !bIsModified ) 1693 ResetModified(); 1694 } 1695 1696 switch( nId ) 1697 { 1698 case RES_POOLNUMRULE_NUM1: 1699 { 1700 SwNumFmt aFmt; 1701 // --> OD 2008-02-11 #newlistlevelattrs# 1702 aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode ); 1703 // <-- 1704 aFmt.SetNumberingType(SVX_NUM_ARABIC); 1705 aFmt.SetCharFmt( pNumCFmt ); 1706 aFmt.SetStart( 1 ); 1707 aFmt.SetIncludeUpperLevels( 1 ); 1708 aFmt.SetSuffix( aDotStr ); 1709 1710 static const sal_uInt16 aAbsSpace[ MAXLEVEL ] = 1711 { 1712 // cm: 0,5 1,0 1,5 2,0 2,5 3,0 3,5 4,0 4,5 5,0 1713 283, 567, 850, 1134, 1417, 1701, 1984, 2268, 2551, 2835 1714 }; 1715 #ifdef USE_MEASUREMENT 1716 static const sal_uInt16 aAbsSpaceInch[ MAXLEVEL ] = 1717 { 1718 283, 567, 850, 1134, 1417, 1701, 1984, 2268, 2551, 2835 1719 }; 1720 const sal_uInt16* pArr = MEASURE_METRIC == 1721 SvtSysLocale().GetLocaleData().getMeasurementSystemEnum() 1722 ? aAbsSpace 1723 : aAbsSpaceInch; 1724 #else 1725 const sal_uInt16* pArr = aAbsSpace; 1726 #endif 1727 1728 // --> OD 2008-02-11 #newlistlevelattrs# 1729 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 1730 { 1731 aFmt.SetFirstLineOffset( - (*pArr) ); 1732 } 1733 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 1734 { 1735 aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB ); 1736 aFmt.SetFirstLineIndent( - (*pArr) ); 1737 } 1738 // <-- 1739 for( n = 0; n < MAXLEVEL; ++n, ++pArr ) 1740 { 1741 // --> OD 2008-02-11 #newlistlevelattrs# 1742 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 1743 { 1744 aFmt.SetAbsLSpace( *pArr ); 1745 } 1746 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 1747 { 1748 aFmt.SetListtabPos( *pArr ); 1749 aFmt.SetIndentAt( *pArr ); 1750 } 1751 // <-- 1752 pNewRule->Set( n, aFmt ); 1753 } 1754 } 1755 break; 1756 1757 case RES_POOLNUMRULE_NUM2: 1758 { 1759 static const sal_uInt16 aAbsSpace[ MAXLEVEL ] = 1760 { 1761 283, 283, 567, 709, // 0.50, 0.50, 1.00, 1.25 1762 850, 1021, 1304, 1474, // 1.50, 1.80, 2.30, 2.60 1763 1588, 1758 // 2.80, 3.10 1764 }; 1765 1766 #ifdef USE_MEASUREMENT 1767 static const sal_uInt16 aAbsSpaceInch[ MAXLEVEL ] = 1768 { 1769 385, 385, 770, 963, 1770 1155, 1386, 1771, 2002, 1771 2156, 2387 1772 }; 1773 1774 const sal_uInt16* pArr = MEASURE_METRIC == 1775 SvtSysLocale().GetLocaleData().getMeasurementSystemEnum() 1776 ? aAbsSpace 1777 : aAbsSpaceInch; 1778 #else 1779 const sal_uInt16* pArr = aAbsSpace; 1780 #endif 1781 SwNumFmt aFmt; 1782 // --> OD 2008-02-11 #newlistlevelattrs# 1783 aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode ); 1784 // <-- 1785 aFmt.SetNumberingType(SVX_NUM_ARABIC); 1786 aFmt.SetCharFmt( pNumCFmt ); 1787 aFmt.SetIncludeUpperLevels( 1 ); 1788 // --> OD 2008-02-11 #newlistlevelattrs# 1789 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 1790 { 1791 aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB ); 1792 } 1793 // <-- 1794 sal_uInt16 nSpace = 0; 1795 for( n = 0; n < MAXLEVEL; ++n ) 1796 { 1797 // --> OD 2008-02-11 #newlistlevelattrs# 1798 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 1799 { 1800 aFmt.SetAbsLSpace( nSpace = nSpace + pArr[ n ] ); 1801 aFmt.SetFirstLineOffset( - pArr[ n ] ); 1802 } 1803 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 1804 { 1805 aFmt.SetListtabPos( nSpace = nSpace + pArr[ n ] ); 1806 aFmt.SetIndentAt( nSpace ); 1807 aFmt.SetFirstLineIndent( - pArr[ n ] ); 1808 } 1809 // <-- 1810 aFmt.SetStart( n+1 ); 1811 pNewRule->Set( n, aFmt ); 1812 } 1813 } 1814 break; 1815 case RES_POOLNUMRULE_NUM3: 1816 { 1817 SwNumFmt aFmt; 1818 // --> OD 2008-02-11 #newlistlevelattrs# 1819 aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode ); 1820 // <-- 1821 aFmt.SetNumberingType(SVX_NUM_ARABIC); 1822 aFmt.SetCharFmt( pNumCFmt ); 1823 aFmt.SetIncludeUpperLevels( 1 ); 1824 1825 sal_uInt16 nOffs = GetMetricVal( CM_1 ) * 3; 1826 // --> OD 2008-02-11 #newlistlevelattrs# 1827 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 1828 { 1829 aFmt.SetFirstLineOffset( - nOffs ); 1830 } 1831 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 1832 { 1833 aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB ); 1834 aFmt.SetFirstLineIndent( - nOffs ); 1835 } 1836 // <-- 1837 1838 for( n = 0; n < MAXLEVEL; ++n ) 1839 { 1840 // --> OD 2008-02-11 #newlistlevelattrs# 1841 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 1842 { 1843 aFmt.SetAbsLSpace( (n+1) * nOffs ); 1844 } 1845 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 1846 { 1847 aFmt.SetListtabPos( (n+1) * nOffs ); 1848 aFmt.SetIndentAt( (n+1) * nOffs ); 1849 } 1850 // <-- 1851 aFmt.SetStart( n+1 ); 1852 pNewRule->Set( n, aFmt ); 1853 } 1854 } 1855 break; 1856 case RES_POOLNUMRULE_NUM4: 1857 { 1858 SwNumFmt aFmt; 1859 // --> OD 2008-02-11 #newlistlevelattrs# 1860 aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode ); 1861 // <-- 1862 aFmt.SetNumberingType(SVX_NUM_ROMAN_UPPER); 1863 aFmt.SetCharFmt( pNumCFmt ); 1864 aFmt.SetIncludeUpperLevels( 1 ); 1865 aFmt.SetSuffix( aDotStr ); 1866 1867 static const sal_uInt16 aAbsSpace[ MAXLEVEL ] = 1868 { 1869 // cm: 0,5 1,0 1,5 2,0 2,5 3,0 3,5 4,0 4,5 5,0 1870 283, 567, 850, 1134, 1417, 1701, 1984, 2268, 2551, 2835 1871 }; 1872 #ifdef USE_MEASUREMENT 1873 static const sal_uInt16 aAbsSpaceInch[ MAXLEVEL ] = 1874 { 1875 283, 567, 850, 1134, 1417, 1701, 1984, 2268, 2551, 2835 1876 }; 1877 const sal_uInt16* pArr = MEASURE_METRIC == 1878 SvtSysLocale().GetLocaleData().getMeasurementSystemEnum() 1879 ? aAbsSpace 1880 : aAbsSpaceInch; 1881 #else 1882 const sal_uInt16* pArr = aAbsSpace; 1883 #endif 1884 1885 // --> OD 2008-02-11 #newlistlevelattrs# 1886 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 1887 { 1888 aFmt.SetFirstLineOffset( - (*pArr) ); 1889 } 1890 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 1891 { 1892 aFmt.SetLabelFollowedBy( SvxNumberFormat::SPACE ); 1893 aFmt.SetFirstLineIndent( - (*pArr) ); 1894 } 1895 // <-- 1896 for( n = 0; n < MAXLEVEL; ++n, ++pArr ) 1897 { 1898 aFmt.SetStart( n + 1 ); 1899 // --> OD 2008-02-11 #newlistlevelattrs# 1900 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 1901 { 1902 aFmt.SetAbsLSpace( *pArr ); 1903 } 1904 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 1905 { 1906 aFmt.SetListtabPos( *pArr ); 1907 aFmt.SetIndentAt( *pArr ); 1908 } 1909 // <-- 1910 pNewRule->Set( n, aFmt ); 1911 } 1912 } 1913 break; 1914 case RES_POOLNUMRULE_NUM5: 1915 { 1916 // [ First, LSpace ] 1917 static const sal_uInt16 aAbsSpace0to2[] = 1918 { 1919 227, 227, // 0.40, 0.40, 1920 369, 624, // 0.65, 1.10, 1921 255, 879 // 0.45, 1.55 1922 }; 1923 1924 #ifdef USE_MEASUREMENT 1925 static const sal_uInt16 aAbsSpaceInch0to2[] = 1926 { 1927 308, 308, 1928 501, 847, 1929 347, 1194 1930 }; 1931 const sal_uInt16* pArr0to2 = MEASURE_METRIC == 1932 SvtSysLocale().GetLocaleData().getMeasurementSystemEnum() 1933 ? aAbsSpace0to2 1934 : aAbsSpaceInch0to2; 1935 #else 1936 const sal_uInt16* pArr0to2 = aAbsSpace0to2; 1937 #endif 1938 SwNumFmt aFmt; 1939 // --> OD 2008-02-11 #newlistlevelattrs# 1940 aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode ); 1941 // <-- 1942 aFmt.SetNumberingType(SVX_NUM_ARABIC); 1943 aFmt.SetStart( 1 ); 1944 aFmt.SetIncludeUpperLevels( 1 ); 1945 aFmt.SetSuffix( aDotStr ); 1946 // --> OD 2008-02-11 #newlistlevelattrs# 1947 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 1948 { 1949 aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB ); 1950 } 1951 // <-- 1952 1953 // --> OD 2008-02-11 #newlistlevelattrs# 1954 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 1955 { 1956 aFmt.SetFirstLineOffset( -pArr0to2[0] ); // == 0.40 cm 1957 aFmt.SetAbsLSpace( pArr0to2[1] ); // == 0.40 cm 1958 } 1959 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 1960 { 1961 aFmt.SetFirstLineIndent( -pArr0to2[0] ); 1962 aFmt.SetListtabPos( pArr0to2[1] ); 1963 aFmt.SetIndentAt( pArr0to2[1] ); 1964 } 1965 // <-- 1966 1967 aFmt.SetCharFmt( pNumCFmt ); 1968 pNewRule->Set( 0, aFmt ); 1969 1970 aFmt.SetIncludeUpperLevels( 2 ); 1971 aFmt.SetStart( 2 ); 1972 // --> OD 2008-02-11 #newlistlevelattrs# 1973 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 1974 { 1975 aFmt.SetFirstLineOffset( -pArr0to2[2] ); // == 0.65 cm 1976 aFmt.SetAbsLSpace( pArr0to2[3] ); // == 1.10 cm 1977 } 1978 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 1979 { 1980 aFmt.SetFirstLineIndent( -pArr0to2[2] ); 1981 aFmt.SetListtabPos( pArr0to2[3] ); 1982 aFmt.SetIndentAt( pArr0to2[3] ); 1983 } 1984 // <-- 1985 pNewRule->Set( 1, aFmt ); 1986 1987 aFmt.SetNumberingType(SVX_NUM_CHARS_LOWER_LETTER); 1988 aFmt.SetSuffix( ')'); 1989 aFmt.SetIncludeUpperLevels( 1 ); 1990 aFmt.SetStart( 3 ); 1991 // --> OD 2008-02-11 #newlistlevelattrs# 1992 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 1993 { 1994 aFmt.SetFirstLineOffset( - pArr0to2[4] ); // == 0.45cm 1995 aFmt.SetAbsLSpace( pArr0to2[5] ); // == 1.55 cm 1996 } 1997 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 1998 { 1999 aFmt.SetFirstLineIndent( -pArr0to2[4] ); 2000 aFmt.SetListtabPos( pArr0to2[5] ); 2001 aFmt.SetIndentAt( pArr0to2[5] ); 2002 } 2003 // <-- 2004 pNewRule->Set( 2, aFmt ); 2005 2006 2007 aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); 2008 aFmt.SetCharFmt( pBullCFmt ); 2009 // --> OD 2006-06-29 #6440955# 2010 aFmt.SetBulletFont( &numfunc::GetDefBulletFont() ); 2011 // <-- 2012 aFmt.SetBulletChar( cBulletChar ); 2013 sal_uInt16 nOffs = GetMetricVal( CM_01 ) * 4, 2014 nOffs2 = GetMetricVal( CM_1 ) * 2; 2015 2016 // --> OD 2008-02-11 #newlistlevelattrs# 2017 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 2018 { 2019 aFmt.SetFirstLineOffset( - nOffs ); 2020 } 2021 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 2022 { 2023 aFmt.SetFirstLineIndent( - nOffs ); 2024 } 2025 // <-- 2026 aFmt.SetSuffix( aEmptyStr ); 2027 for( n = 3; n < MAXLEVEL; ++n ) 2028 { 2029 aFmt.SetStart( n+1 ); 2030 // --> OD 2008-02-11 #newlistlevelattrs# 2031 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 2032 { 2033 aFmt.SetAbsLSpace( nOffs2 + ((n-3) * nOffs) ); 2034 } 2035 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 2036 { 2037 aFmt.SetListtabPos( nOffs2 + ((n-3) * nOffs) ); 2038 aFmt.SetIndentAt( nOffs2 + ((n-3) * nOffs) ); 2039 } 2040 // <-- 2041 pNewRule->Set( n, aFmt ); 2042 } 2043 } 2044 break; 2045 2046 case RES_POOLNUMRULE_BUL1: 2047 { 2048 SwNumFmt aFmt; 2049 // --> OD 2008-02-11 #newlistlevelattrs# 2050 aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode ); 2051 // <-- 2052 aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); 2053 aFmt.SetCharFmt( pBullCFmt ); 2054 aFmt.SetStart( 1 ); 2055 aFmt.SetIncludeUpperLevels( 1 ); 2056 // --> OD 2006-06-29 #6440955# 2057 aFmt.SetBulletFont( &numfunc::GetDefBulletFont() ); 2058 // <-- 2059 aFmt.SetBulletChar( cBulletChar ); 2060 2061 static const sal_uInt16 aAbsSpace[ MAXLEVEL ] = 2062 { 2063 // cm: 0,4 0,8 1,2 1,6 2,0 2,4 2,8 3,2 3,6 4,0 2064 227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268 2065 }; 2066 #ifdef USE_MEASUREMENT 2067 static const sal_uInt16 aAbsSpaceInch[ MAXLEVEL ] = 2068 { 2069 227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268 2070 }; 2071 const sal_uInt16* pArr = MEASURE_METRIC == 2072 SvtSysLocale().GetLocaleData().getMeasurementSystemEnum() 2073 ? aAbsSpace 2074 : aAbsSpaceInch; 2075 #else 2076 const sal_uInt16* pArr = aAbsSpace; 2077 #endif 2078 2079 // --> OD 2008-02-11 #newlistlevelattrs# 2080 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 2081 { 2082 aFmt.SetFirstLineOffset( - (*pArr) ); 2083 } 2084 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 2085 { 2086 aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB ); 2087 aFmt.SetFirstLineIndent( - (*pArr) ); 2088 } 2089 // <-- 2090 for( n = 0; n < MAXLEVEL; ++n, ++pArr ) 2091 { 2092 // --> OD 2008-02-11 #newlistlevelattrs# 2093 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 2094 { 2095 aFmt.SetAbsLSpace( *pArr ); 2096 } 2097 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 2098 { 2099 aFmt.SetListtabPos( *pArr ); 2100 aFmt.SetIndentAt( *pArr ); 2101 } 2102 // <-- 2103 pNewRule->Set( n, aFmt ); 2104 } 2105 } 2106 break; 2107 case RES_POOLNUMRULE_BUL2: 2108 { 2109 SwNumFmt aFmt; 2110 // --> OD 2008-02-11 #newlistlevelattrs# 2111 aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode ); 2112 // <-- 2113 aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); 2114 aFmt.SetCharFmt( pBullCFmt ); 2115 aFmt.SetStart( 1 ); 2116 aFmt.SetIncludeUpperLevels( 1 ); 2117 // --> OD 2006-06-29 #6440955# 2118 aFmt.SetBulletFont( &numfunc::GetDefBulletFont() ); 2119 // <-- 2120 aFmt.SetBulletChar( 0x2013 ); 2121 2122 static const sal_uInt16 aAbsSpace[ MAXLEVEL ] = 2123 { 2124 // cm: 0,3 0,6 0,9 1,2 1,5 1,8 2,1 2,4 2,7 3,0 2125 170, 340, 510, 680, 850, 1020, 1191, 1361, 1531, 1701 2126 }; 2127 #ifdef USE_MEASUREMENT 2128 static const sal_uInt16 aAbsSpaceInch[ MAXLEVEL ] = 2129 { 2130 170, 340, 510, 680, 850, 1020, 1191, 1361, 1531, 1701 2131 }; 2132 const sal_uInt16* pArr = MEASURE_METRIC == 2133 SvtSysLocale().GetLocaleData().getMeasurementSystemEnum() 2134 ? aAbsSpace 2135 : aAbsSpaceInch; 2136 #else 2137 const sal_uInt16* pArr = aAbsSpace; 2138 #endif 2139 2140 // --> OD 2008-02-11 #newlistlevelattrs# 2141 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 2142 { 2143 aFmt.SetFirstLineOffset( - (*pArr) ); 2144 } 2145 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 2146 { 2147 aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB ); 2148 aFmt.SetFirstLineIndent( - (*pArr) ); 2149 } 2150 // <-- 2151 for( n = 0; n < MAXLEVEL; ++n, ++pArr ) 2152 { 2153 // --> OD 2008-02-11 #newlistlevelattrs# 2154 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 2155 { 2156 aFmt.SetAbsLSpace( *pArr ); 2157 } 2158 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 2159 { 2160 aFmt.SetListtabPos( *pArr ); 2161 aFmt.SetIndentAt( *pArr ); 2162 } 2163 // <-- 2164 pNewRule->Set( n, aFmt ); 2165 } 2166 } 2167 break; 2168 case RES_POOLNUMRULE_BUL3: 2169 { 2170 SwNumFmt aFmt; 2171 // --> OD 2008-02-11 #newlistlevelattrs# 2172 aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode ); 2173 // <-- 2174 aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); 2175 aFmt.SetCharFmt( pBullCFmt ); 2176 aFmt.SetStart( 1 ); 2177 aFmt.SetIncludeUpperLevels( 1 ); 2178 // --> OD 2006-06-29 #6440955# 2179 aFmt.SetBulletFont( &numfunc::GetDefBulletFont() ); 2180 // <-- 2181 2182 sal_uInt16 nOffs = GetMetricVal( CM_01 ) * 4; 2183 // --> OD 2008-02-11 #newlistlevelattrs# 2184 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 2185 { 2186 aFmt.SetFirstLineOffset( - nOffs ); 2187 } 2188 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 2189 { 2190 aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB ); 2191 aFmt.SetFirstLineIndent( - nOffs ); 2192 } 2193 // <-- 2194 2195 for( n = 0; n < MAXLEVEL; ++n ) 2196 { 2197 aFmt.SetBulletChar( ( n & 1 ? 0x25a1 : 0x2611 ) ); 2198 // --> OD 2008-02-11 #newlistlevelattrs# 2199 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 2200 { 2201 aFmt.SetAbsLSpace( ((n & 1) +1) * nOffs ); 2202 } 2203 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 2204 { 2205 aFmt.SetListtabPos( ((n & 1) +1) * nOffs ); 2206 aFmt.SetIndentAt( ((n & 1) +1) * nOffs ); 2207 } 2208 // <-- 2209 pNewRule->Set( n, aFmt ); 2210 } 2211 } 2212 break; 2213 case RES_POOLNUMRULE_BUL4: 2214 { 2215 SwNumFmt aFmt; 2216 // --> OD 2008-02-11 #newlistlevelattrs# 2217 aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode ); 2218 // <-- 2219 aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); 2220 aFmt.SetCharFmt( pBullCFmt ); 2221 aFmt.SetStart( 1 ); 2222 aFmt.SetIncludeUpperLevels( 1 ); 2223 // --> OD 2006-06-29 #6440955# 2224 aFmt.SetBulletFont( &numfunc::GetDefBulletFont() ); 2225 // <-- 2226 2227 static const sal_uInt16 aAbsSpace[ MAXLEVEL ] = 2228 { 2229 // cm: 0,4 0,8 1,2 1,6 2,0 2,4 2,8 3,2 3,6 4,0 2230 227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268 2231 }; 2232 #ifdef USE_MEASUREMENT 2233 static const sal_uInt16 aAbsSpaceInch[ MAXLEVEL ] = 2234 { 2235 227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268 2236 }; 2237 const sal_uInt16* pArr = MEASURE_METRIC == 2238 SvtSysLocale().GetLocaleData().getMeasurementSystemEnum() 2239 ? aAbsSpace 2240 : aAbsSpaceInch; 2241 #else 2242 const sal_uInt16* pArr = aAbsSpace; 2243 #endif 2244 2245 // --> OD 2008-02-11 #newlistlevelattrs# 2246 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 2247 { 2248 aFmt.SetFirstLineOffset( - (*pArr) ); 2249 } 2250 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 2251 { 2252 aFmt.SetLabelFollowedBy( SvxNumberFormat::SPACE ); 2253 aFmt.SetFirstLineIndent( - (*pArr) ); 2254 } 2255 // <-- 2256 for( n = 0; n < MAXLEVEL; ++n, ++pArr ) 2257 { 2258 switch( n ) 2259 { 2260 case 0: aFmt.SetBulletChar( 0x27a2 ); break; 2261 case 1: aFmt.SetBulletChar( 0xE006 ); break; 2262 default: aFmt.SetBulletChar( 0xE004 ); break; 2263 } 2264 // --> OD 2008-02-11 #newlistlevelattrs# 2265 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 2266 { 2267 aFmt.SetAbsLSpace( *pArr ); 2268 } 2269 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 2270 { 2271 aFmt.SetListtabPos( *pArr ); 2272 aFmt.SetIndentAt( *pArr ); 2273 } 2274 // <-- 2275 pNewRule->Set( n, aFmt ); 2276 } 2277 } 2278 break; 2279 case RES_POOLNUMRULE_BUL5: 2280 { 2281 SwNumFmt aFmt; 2282 // --> OD 2008-02-11 #newlistlevelattrs# 2283 aFmt.SetPositionAndSpaceMode( eNumberFormatPositionAndSpaceMode ); 2284 // <-- 2285 aFmt.SetNumberingType(SVX_NUM_CHAR_SPECIAL); 2286 aFmt.SetCharFmt( pBullCFmt ); 2287 aFmt.SetStart( 1 ); 2288 aFmt.SetIncludeUpperLevels( 1 ); 2289 aFmt.SetBulletChar( 0x2717 ); 2290 // --> OD 2006-06-29 #6440955# 2291 aFmt.SetBulletFont( &numfunc::GetDefBulletFont() ); 2292 // <-- 2293 2294 static const sal_uInt16 aAbsSpace[ MAXLEVEL ] = 2295 { 2296 // cm: 0,4 0,8 1,2 1,6 2,0 2,4 2,8 3,2 3,6 4,0 2297 227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268 2298 }; 2299 #ifdef USE_MEASUREMENT 2300 static const sal_uInt16 aAbsSpaceInch[ MAXLEVEL ] = 2301 { 2302 227, 454, 680, 907, 1134, 1361, 1587, 1814, 2041, 2268 2303 }; 2304 const sal_uInt16* pArr = MEASURE_METRIC == 2305 SvtSysLocale().GetLocaleData().getMeasurementSystemEnum() 2306 ? aAbsSpace 2307 : aAbsSpaceInch; 2308 #else 2309 const sal_uInt16* pArr = aAbsSpace; 2310 #endif 2311 2312 // --> OD 2008-02-11 #newlistlevelattrs# 2313 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 2314 { 2315 aFmt.SetFirstLineOffset( - (*pArr) ); 2316 } 2317 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 2318 { 2319 aFmt.SetLabelFollowedBy( SvxNumberFormat::LISTTAB ); 2320 aFmt.SetFirstLineIndent( - (*pArr) ); 2321 } 2322 // <-- 2323 for( n = 0; n < MAXLEVEL; ++n, ++pArr ) 2324 { 2325 // --> OD 2008-02-11 #newlistlevelattrs# 2326 if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) 2327 { 2328 aFmt.SetAbsLSpace( *pArr ); 2329 } 2330 else if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_ALIGNMENT ) 2331 { 2332 aFmt.SetListtabPos( *pArr ); 2333 aFmt.SetIndentAt( *pArr ); 2334 } 2335 // <-- 2336 pNewRule->Set( n, aFmt ); 2337 } 2338 } 2339 break; 2340 } 2341 2342 return pNewRule; 2343 } 2344 2345 2346 2347 // pruefe, ob diese "Auto-Collection" in Dokument schon/noch 2348 // benutzt wird 2349 bool SwDoc::IsPoolPageDescUsed( sal_uInt16 nId ) const 2350 { 2351 ASSERT( RES_POOLPAGE_BEGIN <= nId && nId < RES_POOLPAGE_END, 2352 "Falsche AutoFormat-Id" ); 2353 SwPageDesc *pNewPgDsc = 0; 2354 sal_Bool bFnd = sal_False; 2355 for( sal_uInt16 n = 0; !bFnd && n < aPageDescs.Count(); ++n ) 2356 { 2357 pNewPgDsc = aPageDescs[ n ]; 2358 if( nId == pNewPgDsc->GetPoolFmtId() ) 2359 bFnd = sal_True; 2360 } 2361 2362 // nicht gefunden oder keine Abhaengigen ? 2363 if( !bFnd || !pNewPgDsc->GetDepends() ) // ?????? 2364 return sal_False; 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 !pNewPgDsc->GetInfo( aGetHt ); 2370 } 2371 2372 // erfrage ob die Absatz-/Zeichen-/Rahmen-/Seiten - Vorlage benutzt wird 2373 sal_Bool SwDoc::IsUsed( const SwModify& rModify ) const 2374 { 2375 // dann teste mal, ob es abhaengige ContentNodes im Nodes Array gibt 2376 // (auch indirekte fuer Format-Ableitung! ) 2377 SwAutoFmtGetDocNode aGetHt( &GetNodes() ); 2378 return !rModify.GetInfo( aGetHt ); 2379 } 2380 2381 // erfrage ob die NumRule benutzt wird 2382 sal_Bool SwDoc::IsUsed( const SwNumRule& rRule ) const 2383 { 2384 // --> OD 2008-03-04 #refactorlists# 2385 // // dann teste mal, ob es abhaengige ContentNodes im Nodes Array gibt 2386 // // (auch indirekte fuer Format-Ableitung! ) 2387 // sal_Bool bUsed = sal_False; 2388 // SwAutoFmtGetDocNode aGetHt( &aNodes ); 2389 // SwModify* pMod; 2390 // const SfxPoolItem* pItem; 2391 // sal_uInt16 i, nMaxItems = GetAttrPool().GetItemCount( RES_PARATR_NUMRULE); 2392 // for( i = 0; i < nMaxItems; ++i ) 2393 // { 2394 // if( 0 != (pItem = GetAttrPool().GetItem( RES_PARATR_NUMRULE, i ) ) && 2395 // 0 != ( pMod = (SwModify*)((SwNumRuleItem*)pItem)->GetDefinedIn()) && 2396 // ((SwNumRuleItem*)pItem)->GetValue().Len() && 2397 // ((SwNumRuleItem*)pItem)->GetValue() == rRule.GetName() ) 2398 // { 2399 // if( pMod->IsA( TYPE( SwFmt )) ) 2400 // { 2401 // bUsed = !pMod->GetInfo( aGetHt ); 2402 // if( bUsed ) 2403 // break; 2404 // } 2405 // else if( ((SwTxtNode*)pMod)->GetNodes().IsDocNodes() ) 2406 // { 2407 // bUsed = sal_True; 2408 // break; 2409 // } 2410 // } 2411 // } 2412 2413 // return bUsed; 2414 sal_Bool bUsed = rRule.GetTxtNodeListSize() > 0 || 2415 rRule.GetParagraphStyleListSize() > 0; 2416 2417 return bUsed; 2418 // <-- 2419 } 2420 2421 // Suche die Position vom Vorlagen-Namen. Ist nicht vorhanden 2422 // dann fuege neu ein 2423 sal_uInt16 SwDoc::SetDocPattern( const String& rPatternName ) 2424 { 2425 ASSERT( rPatternName.Len(), "kein Dokument-Vorlagenname" ); 2426 2427 sal_uInt16 nNewPos = aPatternNms.Count(); 2428 for( sal_uInt16 n = 0; n < aPatternNms.Count(); ++n ) 2429 if( !aPatternNms[n] ) 2430 { 2431 if( nNewPos == aPatternNms.Count() ) 2432 nNewPos = n; 2433 } 2434 else if( rPatternName == *aPatternNms[n] ) 2435 return n; 2436 2437 if( nNewPos < aPatternNms.Count() ) 2438 aPatternNms.Remove( nNewPos ); // Platz wieder frei machen 2439 2440 String* pNewNm = new String( rPatternName ); 2441 aPatternNms.Insert( pNewNm, nNewPos ); 2442 SetModified(); 2443 return nNewPos; 2444 } 2445 2446 sal_uInt16 GetPoolParent( sal_uInt16 nId ) 2447 { 2448 sal_uInt16 nRet = USHRT_MAX; 2449 if( POOLGRP_NOCOLLID & nId ) // 1 == Formate / 0 == Collections 2450 { 2451 switch( ( COLL_GET_RANGE_BITS | POOLGRP_NOCOLLID ) & nId ) 2452 { 2453 case POOLGRP_CHARFMT: 2454 case POOLGRP_FRAMEFMT: 2455 nRet = 0; // vom default abgeleitet 2456 break; 2457 case POOLGRP_PAGEDESC: 2458 case POOLGRP_NUMRULE: 2459 break; // es gibt keine Ableitung 2460 } 2461 } 2462 else 2463 { 2464 switch( COLL_GET_RANGE_BITS & nId ) 2465 { 2466 case COLL_TEXT_BITS: 2467 switch( nId ) 2468 { 2469 case RES_POOLCOLL_STANDARD: 2470 nRet = 0; break; 2471 case RES_POOLCOLL_TEXT_IDENT: 2472 case RES_POOLCOLL_TEXT_NEGIDENT: 2473 case RES_POOLCOLL_TEXT_MOVE: 2474 case RES_POOLCOLL_CONFRONTATION: 2475 case RES_POOLCOLL_MARGINAL: 2476 nRet = RES_POOLCOLL_TEXT; break; 2477 2478 case RES_POOLCOLL_TEXT: 2479 case RES_POOLCOLL_GREETING: 2480 case RES_POOLCOLL_SIGNATURE: 2481 case RES_POOLCOLL_HEADLINE_BASE: 2482 nRet = RES_POOLCOLL_STANDARD; break; 2483 2484 case RES_POOLCOLL_HEADLINE1: 2485 case RES_POOLCOLL_HEADLINE2: 2486 case RES_POOLCOLL_HEADLINE3: 2487 case RES_POOLCOLL_HEADLINE4: 2488 case RES_POOLCOLL_HEADLINE5: 2489 case RES_POOLCOLL_HEADLINE6: 2490 case RES_POOLCOLL_HEADLINE7: 2491 case RES_POOLCOLL_HEADLINE8: 2492 case RES_POOLCOLL_HEADLINE9: 2493 case RES_POOLCOLL_HEADLINE10: 2494 nRet = RES_POOLCOLL_HEADLINE_BASE; break; 2495 } 2496 break; 2497 2498 case COLL_LISTS_BITS: 2499 switch( nId ) 2500 { 2501 case RES_POOLCOLL_NUMBUL_BASE: 2502 nRet = RES_POOLCOLL_TEXT; break; 2503 2504 default: 2505 nRet = RES_POOLCOLL_NUMBUL_BASE; break; 2506 } 2507 break; 2508 2509 case COLL_EXTRA_BITS: 2510 switch( nId ) 2511 { 2512 case RES_POOLCOLL_FRAME: 2513 nRet = RES_POOLCOLL_TEXT; break; 2514 2515 case RES_POOLCOLL_TABLE_HDLN: 2516 nRet = RES_POOLCOLL_TABLE; break; 2517 2518 case RES_POOLCOLL_TABLE: 2519 case RES_POOLCOLL_FOOTNOTE: 2520 case RES_POOLCOLL_ENDNOTE: 2521 case RES_POOLCOLL_JAKETADRESS: 2522 case RES_POOLCOLL_SENDADRESS: 2523 case RES_POOLCOLL_HEADER: 2524 case RES_POOLCOLL_HEADERL: 2525 case RES_POOLCOLL_HEADERR: 2526 case RES_POOLCOLL_FOOTER: 2527 case RES_POOLCOLL_FOOTERL: 2528 case RES_POOLCOLL_FOOTERR: 2529 case RES_POOLCOLL_LABEL: 2530 nRet = RES_POOLCOLL_STANDARD; break; 2531 2532 case RES_POOLCOLL_LABEL_ABB: 2533 case RES_POOLCOLL_LABEL_TABLE: 2534 case RES_POOLCOLL_LABEL_FRAME: 2535 case RES_POOLCOLL_LABEL_DRAWING: 2536 nRet = RES_POOLCOLL_LABEL; break; 2537 } 2538 break; 2539 2540 case COLL_REGISTER_BITS: 2541 switch( nId ) 2542 { 2543 case RES_POOLCOLL_REGISTER_BASE: 2544 nRet = RES_POOLCOLL_STANDARD; break; 2545 2546 case RES_POOLCOLL_TOX_USERH: 2547 case RES_POOLCOLL_TOX_CNTNTH: 2548 case RES_POOLCOLL_TOX_IDXH: 2549 case RES_POOLCOLL_TOX_ILLUSH: 2550 case RES_POOLCOLL_TOX_OBJECTH: 2551 case RES_POOLCOLL_TOX_TABLESH: 2552 case RES_POOLCOLL_TOX_AUTHORITIESH: 2553 nRet = RES_POOLCOLL_HEADLINE_BASE; break; 2554 2555 default: 2556 nRet = RES_POOLCOLL_REGISTER_BASE; break; 2557 } 2558 break; 2559 2560 case COLL_DOC_BITS: 2561 nRet = RES_POOLCOLL_HEADLINE_BASE; 2562 break; 2563 2564 case COLL_HTML_BITS: 2565 nRet = RES_POOLCOLL_STANDARD; 2566 break; 2567 } 2568 } 2569 2570 return nRet; 2571 } 2572 2573 void SwDoc::RemoveAllFmtLanguageDependencies() 2574 { 2575 /* #106748# Restore the language independ pool defaults and styles. */ 2576 GetAttrPool().ResetPoolDefaultItem( RES_PARATR_ADJUST ); 2577 2578 SwTxtFmtColl * pTxtFmtColl = GetTxtCollFromPool( RES_POOLCOLL_STANDARD ); 2579 2580 pTxtFmtColl->ResetFmtAttr( RES_PARATR_ADJUST ); 2581 /* #111214# koreans do not like SvxScriptItem(sal_True) */ 2582 pTxtFmtColl->ResetFmtAttr( RES_PARATR_SCRIPTSPACE ); 2583 2584 SvxFrameDirectionItem aFrameDir( FRMDIR_HORI_LEFT_TOP, RES_FRAMEDIR ); 2585 2586 sal_uInt16 nCount = GetPageDescCnt(); 2587 for( sal_uInt16 i=0; i<nCount; ++i ) 2588 { 2589 SwPageDesc& rDesc = _GetPageDesc( i ); 2590 rDesc.GetMaster().SetFmtAttr( aFrameDir ); 2591 rDesc.GetLeft().SetFmtAttr( aFrameDir ); 2592 } 2593 2594 // OD 09.10.2003 #i18732# - restore static pool default for item 2595 // RES_FOLLOW_TEXT_FLOW. 2596 GetAttrPool().ResetPoolDefaultItem( RES_FOLLOW_TEXT_FLOW ); 2597 2598 //#i16874# AutoKerning as default for new documents 2599 GetAttrPool().ResetPoolDefaultItem( RES_CHRATR_AUTOKERN ); 2600 } 2601