docst.cxx (69a74367) | docst.cxx (86104fa7) |
---|---|
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 --- 149 unchanged lines hidden (view full) --- 158 { 159 SwTxtFmtColl* pColl = pShell->GetCurTxtFmtColl(); 160 if(pColl) 161 aName = pColl->GetName(); 162 163 SfxTemplateItem aItem(nWhich, aName); 164 165 sal_uInt16 nMask = 0; | 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 --- 149 unchanged lines hidden (view full) --- 158 { 159 SwTxtFmtColl* pColl = pShell->GetCurTxtFmtColl(); 160 if(pColl) 161 aName = pColl->GetName(); 162 163 SfxTemplateItem aItem(nWhich, aName); 164 165 sal_uInt16 nMask = 0; |
166 if( pDoc->get(IDocumentSettingAccess::HTML_MODE) ) | 166 if( mpDoc->get(IDocumentSettingAccess::HTML_MODE) ) |
167 nMask = SWSTYLEBIT_HTML; 168 else 169 { 170 const int nSelection = pShell->GetFrmType(0,sal_True); 171 if(pShell->GetCurTOX()) 172 nMask = SWSTYLEBIT_IDX ; 173 else if(nSelection & FRMTYPE_HEADER || 174 nSelection & FRMTYPE_FOOTER || --- 9 unchanged lines hidden (view full) --- 184 aItem.SetValue(nMask); 185 rSet.Put(aItem); 186 } 187 188 break; 189 190 case SID_STYLE_FAMILY3: 191 | 167 nMask = SWSTYLEBIT_HTML; 168 else 169 { 170 const int nSelection = pShell->GetFrmType(0,sal_True); 171 if(pShell->GetCurTOX()) 172 nMask = SWSTYLEBIT_IDX ; 173 else if(nSelection & FRMTYPE_HEADER || 174 nSelection & FRMTYPE_FOOTER || --- 9 unchanged lines hidden (view full) --- 184 aItem.SetValue(nMask); 185 rSet.Put(aItem); 186 } 187 188 break; 189 190 case SID_STYLE_FAMILY3: 191 |
192 if( pDoc->get(IDocumentSettingAccess::HTML_MODE) ) | 192 if( mpDoc->get(IDocumentSettingAccess::HTML_MODE) ) |
193 rSet.DisableItem( nWhich ); 194 else 195 { 196 SwFrmFmt* pFmt = pShell->GetCurFrmFmt(); 197 if(pFmt && pShell->IsFrmSelected()) 198 { 199 aName = pFmt->GetName(); 200 rSet.Put(SfxTemplateItem(nWhich, aName)); 201 } 202 } 203 break; 204 205 case SID_STYLE_FAMILY4: 206 { 207 SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get(); | 193 rSet.DisableItem( nWhich ); 194 else 195 { 196 SwFrmFmt* pFmt = pShell->GetCurFrmFmt(); 197 if(pFmt && pShell->IsFrmSelected()) 198 { 199 aName = pFmt->GetName(); 200 rSet.Put(SfxTemplateItem(nWhich, aName)); 201 } 202 } 203 break; 204 205 case SID_STYLE_FAMILY4: 206 { 207 SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get(); |
208 if( pDoc->get(IDocumentSettingAccess::HTML_MODE) && !pHtmlOpt->IsPrintLayoutExtension()) | 208 if( mpDoc->get(IDocumentSettingAccess::HTML_MODE) && !pHtmlOpt->IsPrintLayoutExtension()) |
209 rSet.DisableItem( nWhich ); 210 else 211 { 212 sal_uInt16 n = pShell->GetCurPageDesc( sal_False ); 213 if( n < pShell->GetPageDescCnt() ) 214 aName = pShell->GetPageDesc( n ).GetName(); 215 216 rSet.Put(SfxTemplateItem(nWhich, aName)); --- 209 unchanged lines hidden (view full) --- 426 { 427 SwTxtFmtColl* pColl = pShell->GetCurTxtFmtColl(); 428 if(pColl) 429 aParam = pColl->GetName(); 430 } 431 break; 432 case SFX_STYLE_FAMILY_FRAME: 433 { | 209 rSet.DisableItem( nWhich ); 210 else 211 { 212 sal_uInt16 n = pShell->GetCurPageDesc( sal_False ); 213 if( n < pShell->GetPageDescCnt() ) 214 aName = pShell->GetPageDesc( n ).GetName(); 215 216 rSet.Put(SfxTemplateItem(nWhich, aName)); --- 209 unchanged lines hidden (view full) --- 426 { 427 SwTxtFmtColl* pColl = pShell->GetCurTxtFmtColl(); 428 if(pColl) 429 aParam = pColl->GetName(); 430 } 431 break; 432 case SFX_STYLE_FAMILY_FRAME: 433 { |
434 SwFrmFmt* pFrm = pWrtShell->GetCurFrmFmt(); | 434 SwFrmFmt* pFrm = mpWrtShell->GetCurFrmFmt(); |
435 if( pFrm ) 436 aParam = pFrm->GetName(); 437 } 438 break; 439 case SFX_STYLE_FAMILY_CHAR: 440 { | 435 if( pFrm ) 436 aParam = pFrm->GetName(); 437 } 438 break; 439 case SFX_STYLE_FAMILY_CHAR: 440 { |
441 SwCharFmt* pChar = pWrtShell->GetCurCharFmt(); | 441 SwCharFmt* pChar = mpWrtShell->GetCurCharFmt(); |
442 if( pChar ) 443 aParam = pChar->GetName(); 444 } 445 break; 446 case SFX_STYLE_FAMILY_PSEUDO: 447 if(SFX_ITEM_SET == pArgs->GetItemState(SID_STYLE_UPD_BY_EX_NAME, sal_False, &pItem)) 448 { 449 aParam = ((const SfxStringItem*)pItem)->GetValue(); --- 68 unchanged lines hidden (view full) --- 518 const sal_uInt16 nSlot, 519 SwWrtShell* pActShell, 520 const sal_Bool bBasic ) 521{ 522 ASSERT(GetWrtShell(), "Keine Shell, keine Styles"); 523 SfxStyleSheetBase *pStyle = 0; 524 525 sal_uInt16 nRet = nMask; | 442 if( pChar ) 443 aParam = pChar->GetName(); 444 } 445 break; 446 case SFX_STYLE_FAMILY_PSEUDO: 447 if(SFX_ITEM_SET == pArgs->GetItemState(SID_STYLE_UPD_BY_EX_NAME, sal_False, &pItem)) 448 { 449 aParam = ((const SfxStringItem*)pItem)->GetValue(); --- 68 unchanged lines hidden (view full) --- 518 const sal_uInt16 nSlot, 519 SwWrtShell* pActShell, 520 const sal_Bool bBasic ) 521{ 522 ASSERT(GetWrtShell(), "Keine Shell, keine Styles"); 523 SfxStyleSheetBase *pStyle = 0; 524 525 sal_uInt16 nRet = nMask; |
526 sal_Bool bModified = pDoc->IsModified(); | 526 sal_Bool bModified = mpDoc->IsModified(); |
527 528 if( bNew ) 529 { 530 if( SFXSTYLEBIT_ALL != nMask && SFXSTYLEBIT_USED != nMask ) 531 nMask |= SFXSTYLEBIT_USERDEF; 532 else 533 nMask = SFXSTYLEBIT_USERDEF; 534 535 pStyle = &mxBasePool->Make( rName, (SfxStyleFamily)nFamily, nMask ); 536 537 // die aktuellen als Parent setzen 538 SwDocStyleSheet* pDStyle = (SwDocStyleSheet*)pStyle; 539 switch( nFamily ) 540 { 541 case SFX_STYLE_FAMILY_PARA: 542 { 543 if(rParent.Len()) 544 { | 527 528 if( bNew ) 529 { 530 if( SFXSTYLEBIT_ALL != nMask && SFXSTYLEBIT_USED != nMask ) 531 nMask |= SFXSTYLEBIT_USERDEF; 532 else 533 nMask = SFXSTYLEBIT_USERDEF; 534 535 pStyle = &mxBasePool->Make( rName, (SfxStyleFamily)nFamily, nMask ); 536 537 // die aktuellen als Parent setzen 538 SwDocStyleSheet* pDStyle = (SwDocStyleSheet*)pStyle; 539 switch( nFamily ) 540 { 541 case SFX_STYLE_FAMILY_PARA: 542 { 543 if(rParent.Len()) 544 { |
545 SwTxtFmtColl* pColl = pWrtShell->FindTxtFmtCollByName( rParent ); | 545 SwTxtFmtColl* pColl = mpWrtShell->FindTxtFmtCollByName( rParent ); |
546 if(!pColl) 547 { 548 sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rParent, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL); 549 if(USHRT_MAX != nId) | 546 if(!pColl) 547 { 548 sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rParent, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL); 549 if(USHRT_MAX != nId) |
550 pColl = pWrtShell->GetTxtCollFromPool( nId ); | 550 pColl = mpWrtShell->GetTxtCollFromPool( nId ); |
551 } 552 pDStyle->GetCollection()->SetDerivedFrom( pColl ); 553 pDStyle->PresetParent( rParent ); 554 | 551 } 552 pDStyle->GetCollection()->SetDerivedFrom( pColl ); 553 pDStyle->PresetParent( rParent ); 554 |
555 //#outline level,add by zhaojianwei | |
556 /*When a new paragraph style is created based on a "to outline style 557 assigned" paragraph style, the outline level attribute and the list 558 style attribute of the new paragraph style have to be set to 0 559 respectively "".*/ 560 if( pColl->IsAssignedToListLevelOfOutlineStyle()) 561 { 562 SwNumRuleItem aItem(aEmptyStr); 563 pDStyle->GetCollection()->SetFmtAttr( aItem ); 564 pDStyle->GetCollection()->SetAttrOutlineLevel( 0 ); 565 } | 555 /*When a new paragraph style is created based on a "to outline style 556 assigned" paragraph style, the outline level attribute and the list 557 style attribute of the new paragraph style have to be set to 0 558 respectively "".*/ 559 if( pColl->IsAssignedToListLevelOfOutlineStyle()) 560 { 561 SwNumRuleItem aItem(aEmptyStr); 562 pDStyle->GetCollection()->SetFmtAttr( aItem ); 563 pDStyle->GetCollection()->SetAttrOutlineLevel( 0 ); 564 } |
566 //<-end,zhaojianwei | |
567 568 } 569 else 570 { | 565 566 } 567 else 568 { |
571 SwTxtFmtColl* pColl = pWrtShell->GetCurTxtFmtColl(); | 569 SwTxtFmtColl* pColl = mpWrtShell->GetCurTxtFmtColl(); |
572 pDStyle->GetCollection()->SetDerivedFrom( pColl ); 573 if( pColl ) 574 pDStyle->PresetParent( pColl->GetName() ); 575 } 576 } 577 break; 578 case SFX_STYLE_FAMILY_CHAR: 579 { 580 if(rParent.Len()) 581 { | 570 pDStyle->GetCollection()->SetDerivedFrom( pColl ); 571 if( pColl ) 572 pDStyle->PresetParent( pColl->GetName() ); 573 } 574 } 575 break; 576 case SFX_STYLE_FAMILY_CHAR: 577 { 578 if(rParent.Len()) 579 { |
582 SwCharFmt* pCFmt = pWrtShell->FindCharFmtByName( rParent ); | 580 SwCharFmt* pCFmt = mpWrtShell->FindCharFmtByName( rParent ); |
583 if(!pCFmt) 584 { 585 sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rParent, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT); 586 if(USHRT_MAX != nId) | 581 if(!pCFmt) 582 { 583 sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rParent, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT); 584 if(USHRT_MAX != nId) |
587 pCFmt = pWrtShell->GetCharFmtFromPool( nId ); | 585 pCFmt = mpWrtShell->GetCharFmtFromPool( nId ); |
588 } 589 590 pDStyle->GetCharFmt()->SetDerivedFrom( pCFmt ); 591 pDStyle->PresetParent( rParent ); 592 } 593 else 594 { | 586 } 587 588 pDStyle->GetCharFmt()->SetDerivedFrom( pCFmt ); 589 pDStyle->PresetParent( rParent ); 590 } 591 else 592 { |
595 SwCharFmt* pCFmt = pWrtShell->GetCurCharFmt(); | 593 SwCharFmt* pCFmt = mpWrtShell->GetCurCharFmt(); |
596 pDStyle->GetCharFmt()->SetDerivedFrom( pCFmt ); 597 if( pCFmt ) 598 pDStyle->PresetParent( pCFmt->GetName() ); 599 } 600 } 601 break; 602 case SFX_STYLE_FAMILY_FRAME : 603 { 604 if(rParent.Len()) 605 { | 594 pDStyle->GetCharFmt()->SetDerivedFrom( pCFmt ); 595 if( pCFmt ) 596 pDStyle->PresetParent( pCFmt->GetName() ); 597 } 598 } 599 break; 600 case SFX_STYLE_FAMILY_FRAME : 601 { 602 if(rParent.Len()) 603 { |
606 SwFrmFmt* pFFmt = pWrtShell->GetDoc()->FindFrmFmtByName( rParent ); | 604 SwFrmFmt* pFFmt = mpWrtShell->GetDoc()->FindFrmFmtByName( rParent ); |
607 if(!pFFmt) 608 { 609 sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rParent, nsSwGetPoolIdFromName::GET_POOLID_FRMFMT); 610 if(USHRT_MAX != nId) | 605 if(!pFFmt) 606 { 607 sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rParent, nsSwGetPoolIdFromName::GET_POOLID_FRMFMT); 608 if(USHRT_MAX != nId) |
611 pFFmt = pWrtShell->GetFrmFmtFromPool( nId ); | 609 pFFmt = mpWrtShell->GetFrmFmtFromPool( nId ); |
612 } 613 pDStyle->GetFrmFmt()->SetDerivedFrom( pFFmt ); 614 pDStyle->PresetParent( rParent ); 615 } 616 } 617 break; 618 } 619 } --- 47 unchanged lines hidden (view full) --- 667 if (!bBasic) 668 { 669 // vor dem Dialog wird der HtmlMode an der DocShell versenkt 670 sal_uInt16 nHtmlMode = ::GetHtmlMode(this); 671 672 // In HTML mode, we do not always have a printer. In order to show 673 // the correct page size in the Format - Page dialog, we have to 674 // get one here. | 610 } 611 pDStyle->GetFrmFmt()->SetDerivedFrom( pFFmt ); 612 pDStyle->PresetParent( rParent ); 613 } 614 } 615 break; 616 } 617 } --- 47 unchanged lines hidden (view full) --- 665 if (!bBasic) 666 { 667 // vor dem Dialog wird der HtmlMode an der DocShell versenkt 668 sal_uInt16 nHtmlMode = ::GetHtmlMode(this); 669 670 // In HTML mode, we do not always have a printer. In order to show 671 // the correct page size in the Format - Page dialog, we have to 672 // get one here. |
675 SwWrtShell* pCurrShell = ( pActShell ? pActShell : pWrtShell ); | 673 SwWrtShell* pCurrShell = ( pActShell ? pActShell : mpWrtShell ); |
676 if( ( HTMLMODE_ON & nHtmlMode ) && 677 !pCurrShell->getIDocumentDeviceAccess()->getPrinter( false ) ) 678 pCurrShell->InitPrt( pCurrShell->getIDocumentDeviceAccess()->getPrinter( true ) ); 679 680 PutItem(SfxUInt16Item(SID_HTML_MODE, nHtmlMode)); 681 FieldUnit eMetric = ::GetDfltMetric(0 != (HTMLMODE_ON&nHtmlMode)); 682 SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); 683 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); 684 DBG_ASSERT(pFact, "Dialogdiet fail!"); 685 SfxAbstractTabDialog* pDlg = pFact->CreateTemplateDialog( DLG_TEMPLATE_BASE, 686 0, *(xTmp.get()), nFamily, nSlot, | 674 if( ( HTMLMODE_ON & nHtmlMode ) && 675 !pCurrShell->getIDocumentDeviceAccess()->getPrinter( false ) ) 676 pCurrShell->InitPrt( pCurrShell->getIDocumentDeviceAccess()->getPrinter( true ) ); 677 678 PutItem(SfxUInt16Item(SID_HTML_MODE, nHtmlMode)); 679 FieldUnit eMetric = ::GetDfltMetric(0 != (HTMLMODE_ON&nHtmlMode)); 680 SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); 681 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); 682 DBG_ASSERT(pFact, "Dialogdiet fail!"); 683 SfxAbstractTabDialog* pDlg = pFact->CreateTemplateDialog( DLG_TEMPLATE_BASE, 684 0, *(xTmp.get()), nFamily, nSlot, |
687 pActShell ? pActShell : pWrtShell, bNew); | 685 pActShell ? pActShell : mpWrtShell, bNew); |
688 DBG_ASSERT(pDlg, "Dialogdiet fail!"); 689 if(RET_OK == pDlg->Execute()) 690 { 691 GetWrtShell()->StartAllAction(); 692 693 // nur bei Absatz-Vorlagen die Maske neu setzen 694 if( bNew ) 695 { --- 17 unchanged lines hidden (view full) --- 713 else 714 { 715 if(SFX_STYLE_FAMILY_PAGE == nFamily) 716 { 717 static const sal_uInt16 aInval[] = { 718 SID_IMAGE_ORIENTATION, 719 SID_ATTR_CHAR_FONT, 720 FN_INSERT_CTRL, FN_INSERT_OBJ_CTRL, 0}; | 686 DBG_ASSERT(pDlg, "Dialogdiet fail!"); 687 if(RET_OK == pDlg->Execute()) 688 { 689 GetWrtShell()->StartAllAction(); 690 691 // nur bei Absatz-Vorlagen die Maske neu setzen 692 if( bNew ) 693 { --- 17 unchanged lines hidden (view full) --- 711 else 712 { 713 if(SFX_STYLE_FAMILY_PAGE == nFamily) 714 { 715 static const sal_uInt16 aInval[] = { 716 SID_IMAGE_ORIENTATION, 717 SID_ATTR_CHAR_FONT, 718 FN_INSERT_CTRL, FN_INSERT_OBJ_CTRL, 0}; |
721 pView->GetViewFrame()->GetBindings().Invalidate(aInval); | 719 mpView->GetViewFrame()->GetBindings().Invalidate(aInval); |
722 } 723 SfxItemSet aTmpSet( *pDlg->GetOutputItemSet() ); 724 if( SFX_STYLE_FAMILY_CHAR == nFamily ) 725 { 726 const SfxPoolItem *pTmpBrush; 727 if( SFX_ITEM_SET == aTmpSet.GetItemState( RES_BACKGROUND, 728 sal_False, &pTmpBrush ) ) 729 { --- 4 unchanged lines hidden (view full) --- 734 aTmpSet.ClearItem( RES_BACKGROUND ); 735 } 736 xTmp->SetItemSet( aTmpSet ); 737 738 if( SFX_STYLE_FAMILY_PAGE == nFamily && SvtLanguageOptions().IsCTLFontEnabled() ) 739 { 740 const SfxPoolItem *pItem = NULL; 741 if( aTmpSet.GetItemState( GetPool().GetTrueWhich( SID_ATTR_FRAMEDIRECTION, sal_False ) , sal_True, &pItem ) == SFX_ITEM_SET ) | 720 } 721 SfxItemSet aTmpSet( *pDlg->GetOutputItemSet() ); 722 if( SFX_STYLE_FAMILY_CHAR == nFamily ) 723 { 724 const SfxPoolItem *pTmpBrush; 725 if( SFX_ITEM_SET == aTmpSet.GetItemState( RES_BACKGROUND, 726 sal_False, &pTmpBrush ) ) 727 { --- 4 unchanged lines hidden (view full) --- 732 aTmpSet.ClearItem( RES_BACKGROUND ); 733 } 734 xTmp->SetItemSet( aTmpSet ); 735 736 if( SFX_STYLE_FAMILY_PAGE == nFamily && SvtLanguageOptions().IsCTLFontEnabled() ) 737 { 738 const SfxPoolItem *pItem = NULL; 739 if( aTmpSet.GetItemState( GetPool().GetTrueWhich( SID_ATTR_FRAMEDIRECTION, sal_False ) , sal_True, &pItem ) == SFX_ITEM_SET ) |
742 SwChartHelper::DoUpdateAllCharts( pDoc ); | 740 SwChartHelper::DoUpdateAllCharts( mpDoc ); |
743 } 744 } 745 if(SFX_STYLE_FAMILY_PAGE == nFamily) | 741 } 742 } 743 if(SFX_STYLE_FAMILY_PAGE == nFamily) |
746 pView->InvalidateRulerPos(); | 744 mpView->InvalidateRulerPos(); |
747 748 if( bNew ) 749 mxBasePool->Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_CREATED, *xTmp.get() ) ); 750 751 // JP 19.09.97: 752 // Dialog vorm EndAction zerstoeren - bei Seitenvorlagen kann 753 // muss der ItemSet zerstoert werden, damit die Cursor aus den 754 // Kopf-/Fusszeilen entfernt werden. Sonst kommts zu GPFs!!! 755 delete pDlg; 756 | 745 746 if( bNew ) 747 mxBasePool->Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_CREATED, *xTmp.get() ) ); 748 749 // JP 19.09.97: 750 // Dialog vorm EndAction zerstoeren - bei Seitenvorlagen kann 751 // muss der ItemSet zerstoert werden, damit die Cursor aus den 752 // Kopf-/Fusszeilen entfernt werden. Sonst kommts zu GPFs!!! 753 delete pDlg; 754 |
757 pDoc->SetModified(); | 755 mpDoc->SetModified(); |
758 if( !bModified ) // Bug 57028 759 { | 756 if( !bModified ) // Bug 57028 757 { |
760 pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified(); | 758 mpDoc->GetIDocumentUndoRedo().SetUndoNoResetModified(); |
761 } 762 763 GetWrtShell()->EndAllAction(); 764 } 765 else 766 { 767 if( bNew ) 768 { 769 // #116530# 770 //pBasePool->Erase( &aTmp ); 771 GetWrtShell()->Undo(1); | 759 } 760 761 GetWrtShell()->EndAllAction(); 762 } 763 else 764 { 765 if( bNew ) 766 { 767 // #116530# 768 //pBasePool->Erase( &aTmp ); 769 GetWrtShell()->Undo(1); |
772 pDoc->GetIDocumentUndoRedo().ClearRedo(); | 770 mpDoc->GetIDocumentUndoRedo().ClearRedo(); |
773 } 774 775 if( !bModified ) | 771 } 772 773 if( !bModified ) |
776 pDoc->ResetModified(); | 774 mpDoc->ResetModified(); |
777 delete pDlg; 778 } 779 } 780 else 781 { 782 // vor dem Dialog wird der HtmlMode an der DocShell versenkt 783 PutItem(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(this))); 784 --- 24 unchanged lines hidden (view full) --- 809 aTmpBrush.SetWhich( RES_CHRATR_BACKGROUND ); 810 aTmpSet.Put( aTmpBrush ); 811 } 812 aTmpSet.ClearItem( RES_BACKGROUND ); 813 } 814 xTmp->SetItemSet( aTmpSet ); 815 } 816 if(SFX_STYLE_FAMILY_PAGE == nFamily) | 775 delete pDlg; 776 } 777 } 778 else 779 { 780 // vor dem Dialog wird der HtmlMode an der DocShell versenkt 781 PutItem(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(this))); 782 --- 24 unchanged lines hidden (view full) --- 807 aTmpBrush.SetWhich( RES_CHRATR_BACKGROUND ); 808 aTmpSet.Put( aTmpBrush ); 809 } 810 aTmpSet.ClearItem( RES_BACKGROUND ); 811 } 812 xTmp->SetItemSet( aTmpSet ); 813 } 814 if(SFX_STYLE_FAMILY_PAGE == nFamily) |
817 pView->InvalidateRulerPos(); | 815 mpView->InvalidateRulerPos(); |
818 819 if( bNew ) 820 mxBasePool->Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_CREATED, *xTmp.get() ) ); 821 | 816 817 if( bNew ) 818 mxBasePool->Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_CREATED, *xTmp.get() ) ); 819 |
822 pDoc->SetModified(); | 820 mpDoc->SetModified(); |
823 if( !bModified ) // Bug 57028 824 { | 821 if( !bModified ) // Bug 57028 822 { |
825 pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified(); | 823 mpDoc->GetIDocumentUndoRedo().SetUndoNoResetModified(); |
826 } 827 GetWrtShell()->EndAllAction(); 828 } 829 830 return nRet; 831} 832 833/*-------------------------------------------------------------------- --- 34 unchanged lines hidden (view full) --- 868 return sal_False; 869 870 SwWrtShell *pSh = pShell ? pShell : GetWrtShell(); 871 872 ASSERT( pSh, "Keine Shell, keine Styles"); 873 874 pSh->StartAllAction(); 875 | 824 } 825 GetWrtShell()->EndAllAction(); 826 } 827 828 return nRet; 829} 830 831/*-------------------------------------------------------------------- --- 34 unchanged lines hidden (view full) --- 866 return sal_False; 867 868 SwWrtShell *pSh = pShell ? pShell : GetWrtShell(); 869 870 ASSERT( pSh, "Keine Shell, keine Styles"); 871 872 pSh->StartAllAction(); 873 |
876 switch(nFamily) 877 { 878 case SFX_STYLE_FAMILY_CHAR: 879 { 880 SwFmtCharFmt aFmt(pStyle->GetCharFmt()); 881 pSh->SetAttrItem( aFmt, (nMode & KEY_SHIFT) ? 882 nsSetAttrMode::SETATTR_DONTREPLACE : nsSetAttrMode::SETATTR_DEFAULT ); 883 break; 884 } 885 case SFX_STYLE_FAMILY_PARA: 886 { 887 // --> OD 2007-11-06 #i62675# 888 // clear also list attributes at affected text nodes, if paragraph 889 // style has the list style attribute set. 890 pSh->SetTxtFmtColl( pStyle->GetCollection(), true ); 891 // <-- 892 break; 893 } 894 case SFX_STYLE_FAMILY_FRAME: 895 { 896 if ( pSh->IsFrmSelected() ) 897 pSh->SetFrmFmt( pStyle->GetFrmFmt() ); 898 break; 899 } 900 case SFX_STYLE_FAMILY_PAGE: 901 { 902 pSh->SetPageStyle(pStyle->GetPageDesc()->GetName()); 903 break; 904 } 905 case SFX_STYLE_FAMILY_PSEUDO: 906 { 907 // --> OD 2008-02-08 #newlistlevelattrs# 908 // reset indent attribute on applying list style 909 // --> OD 2008-03-17 #refactorlists# 910 // continue list of list style 911 const SwNumRule* pNumRule = pStyle->GetNumRule(); 912 const String sListIdForStyle =pNumRule->GetDefaultListId(); 913 pSh->SetCurNumRule( *pNumRule, false, sListIdForStyle, true ); 914 // <-- 915 break; 916 } 917 default: 918 DBG_ERROR("Unbekannte Familie"); 919 } 920 pSh->EndAllAction(); | 874 switch (nFamily) 875 { 876 case SFX_STYLE_FAMILY_CHAR: 877 { 878 SwFmtCharFmt aFmt( pStyle->GetCharFmt() ); 879 pSh->SetAttrItem( aFmt, ( nMode & KEY_SHIFT ) ? nsSetAttrMode::SETATTR_DONTREPLACE : nsSetAttrMode::SETATTR_DEFAULT ); 880 break; 881 } 882 case SFX_STYLE_FAMILY_PARA: 883 { 884 // clear also list attributes at affected text nodes, if paragraph style has the list style attribute set. 885 pSh->SetTxtFmtColl( pStyle->GetCollection(), true ); 886 break; 887 } 888 case SFX_STYLE_FAMILY_FRAME: 889 { 890 if ( pSh->IsFrmSelected() ) 891 pSh->SetFrmFmt( pStyle->GetFrmFmt() ); 892 break; 893 } 894 case SFX_STYLE_FAMILY_PAGE: 895 { 896 pSh->SetPageStyle( pStyle->GetPageDesc()->GetName() ); 897 break; 898 } 899 case SFX_STYLE_FAMILY_PSEUDO: 900 { 901 const SwNumRule* pNumRule = pStyle->GetNumRule(); 902 const String sListIdForStyle = pNumRule->GetDefaultListId(); 903 pSh->SetCurNumRule( *pNumRule, false, sListIdForStyle, true ); 904 break; 905 } |
921 | 906 |
922 return nFamily; | 907 default: 908 DBG_ERROR( "Unbekannte Familie" ); 909 } 910 pSh->EndAllAction(); 911 912 return nFamily; |
923} 924 925/*-------------------------------------------------------------------- 926 Beschreibung: Giesskanne starten 927 --------------------------------------------------------------------*/ 928 929 930 931sal_uInt16 SwDocShell::DoWaterCan(const String &rName, sal_uInt16 nFamily) 932{ 933 ASSERT(GetWrtShell(), "Keine Shell, keine Styles"); 934 | 913} 914 915/*-------------------------------------------------------------------- 916 Beschreibung: Giesskanne starten 917 --------------------------------------------------------------------*/ 918 919 920 921sal_uInt16 SwDocShell::DoWaterCan(const String &rName, sal_uInt16 nFamily) 922{ 923 ASSERT(GetWrtShell(), "Keine Shell, keine Styles"); 924 |
935 SwEditWin& rEdtWin = pView->GetEditWin(); | 925 SwEditWin& rEdtWin = mpView->GetEditWin(); |
936 SwApplyTemplate* pApply = rEdtWin.GetApplyTemplate(); 937 sal_Bool bWaterCan = !(pApply && pApply->eType != 0); 938 if( !rName.Len() ) 939 bWaterCan = sal_False; 940 SwApplyTemplate aTemplate; 941 aTemplate.eType = nFamily; 942 943 if(bWaterCan) --- 25 unchanged lines hidden (view full) --- 969 default: 970 DBG_ERROR( "Unbekannte Familie"); 971 } 972 } 973 else 974 aTemplate.eType = 0; 975 976 // Template anwenden | 926 SwApplyTemplate* pApply = rEdtWin.GetApplyTemplate(); 927 sal_Bool bWaterCan = !(pApply && pApply->eType != 0); 928 if( !rName.Len() ) 929 bWaterCan = sal_False; 930 SwApplyTemplate aTemplate; 931 aTemplate.eType = nFamily; 932 933 if(bWaterCan) --- 25 unchanged lines hidden (view full) --- 959 default: 960 DBG_ERROR( "Unbekannte Familie"); 961 } 962 } 963 else 964 aTemplate.eType = 0; 965 966 // Template anwenden |
977 pView->GetEditWin().SetApplyTemplate(aTemplate); | 967 mpView->GetEditWin().SetApplyTemplate(aTemplate); |
978 979 return nFamily; 980} 981 982/*-------------------------------------------------------------------- 983 Beschreibung: Vorlage Updaten 984 --------------------------------------------------------------------*/ 985 --- 277 unchanged lines hidden (view full) --- 1263 // abpruefen selbst (wesentlich schneller und laeuft nicht ueber 1264 // die Kruecke SfxStylePool 1265 if( rSource.ISA( SwDocShell )) 1266 { 1267 //JP 28.05.99: damit die Kopf-/Fusszeilen nicht den fixen Inhalt 1268 // der Vorlage erhalten, einmal alle FixFelder der 1269 // Source aktualisieren 1270 if(!bPreserveCurrentDocument) | 968 969 return nFamily; 970} 971 972/*-------------------------------------------------------------------- 973 Beschreibung: Vorlage Updaten 974 --------------------------------------------------------------------*/ 975 --- 277 unchanged lines hidden (view full) --- 1253 // abpruefen selbst (wesentlich schneller und laeuft nicht ueber 1254 // die Kruecke SfxStylePool 1255 if( rSource.ISA( SwDocShell )) 1256 { 1257 //JP 28.05.99: damit die Kopf-/Fusszeilen nicht den fixen Inhalt 1258 // der Vorlage erhalten, einmal alle FixFelder der 1259 // Source aktualisieren 1260 if(!bPreserveCurrentDocument) |
1271 ((SwDocShell&)rSource).pDoc->SetFixFields(false, NULL); 1272 if( pWrtShell ) | 1261 ((SwDocShell&)rSource).mpDoc->SetFixFields(false, NULL); 1262 if( mpWrtShell ) |
1273 { | 1263 { |
1274 pWrtShell->StartAllAction(); 1275 pDoc->ReplaceStyles( *((SwDocShell&)rSource).pDoc ); 1276 pWrtShell->EndAllAction(); | 1264 mpWrtShell->StartAllAction(); 1265 mpDoc->ReplaceStyles( *((SwDocShell&)rSource).mpDoc ); 1266 mpWrtShell->EndAllAction(); |
1277 } 1278 else 1279 { | 1267 } 1268 else 1269 { |
1280 sal_Bool bModified = pDoc->IsModified(); 1281 pDoc->ReplaceStyles( *((SwDocShell&)rSource).pDoc ); 1282 if( !bModified && pDoc->IsModified() && !pView ) | 1270 sal_Bool bModified = mpDoc->IsModified(); 1271 mpDoc->ReplaceStyles( *((SwDocShell&)rSource).mpDoc ); 1272 if( !bModified && mpDoc->IsModified() && !mpView ) |
1283 { 1284 // die View wird spaeter angelegt, ueberschreibt aber das 1285 // Modify-Flag. Per Undo ist sowieso nichts mehr zu machen | 1273 { 1274 // die View wird spaeter angelegt, ueberschreibt aber das 1275 // Modify-Flag. Per Undo ist sowieso nichts mehr zu machen |
1286 pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified(); | 1276 mpDoc->GetIDocumentUndoRedo().SetUndoNoResetModified(); |
1287 } 1288 } 1289 } 1290 else 1291 SfxObjectShell::LoadStyles( rSource ); 1292} 1293 1294 --- 23 unchanged lines hidden --- | 1277 } 1278 } 1279 } 1280 else 1281 SfxObjectShell::LoadStyles( rSource ); 1282} 1283 1284 --- 23 unchanged lines hidden --- |