Modified: openoffice/branches/AOO410/main/sw/source/ui/app/docst.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/AOO410/main/sw/source/ui/app/docst.cxx?rev=1607011&r1=1607010&r2=1607011&view=diff ============================================================================== --- openoffice/branches/AOO410/main/sw/source/ui/app/docst.cxx (original) +++ openoffice/branches/AOO410/main/sw/source/ui/app/docst.cxx Tue Jul 1 08:14:18 2014 @@ -163,7 +163,7 @@ void SwDocShell::StateStyleSheet(SfxIte SfxTemplateItem aItem(nWhich, aName); sal_uInt16 nMask = 0; - if( pDoc->get(IDocumentSettingAccess::HTML_MODE) ) + if( mpDoc->get(IDocumentSettingAccess::HTML_MODE) ) nMask = SWSTYLEBIT_HTML; else { @@ -189,7 +189,7 @@ void SwDocShell::StateStyleSheet(SfxIte case SID_STYLE_FAMILY3: - if( pDoc->get(IDocumentSettingAccess::HTML_MODE) ) + if( mpDoc->get(IDocumentSettingAccess::HTML_MODE) ) rSet.DisableItem( nWhich ); else { @@ -205,7 +205,7 @@ void SwDocShell::StateStyleSheet(SfxIte case SID_STYLE_FAMILY4: { SvxHtmlOptions* pHtmlOpt = SvxHtmlOptions::Get(); - if( pDoc->get(IDocumentSettingAccess::HTML_MODE) && !pHtmlOpt->IsPrintLayoutExtension()) + if( mpDoc->get(IDocumentSettingAccess::HTML_MODE) && !pHtmlOpt->IsPrintLayoutExtension()) rSet.DisableItem( nWhich ); else { @@ -431,14 +431,14 @@ void SwDocShell::ExecStyleSheet( SfxRequ break; case SFX_STYLE_FAMILY_FRAME: { - SwFrmFmt* pFrm = pWrtShell->GetCurFrmFmt(); + SwFrmFmt* pFrm = mpWrtShell->GetCurFrmFmt(); if( pFrm ) aParam = pFrm->GetName(); } break; case SFX_STYLE_FAMILY_CHAR: { - SwCharFmt* pChar = pWrtShell->GetCurCharFmt(); + SwCharFmt* pChar = mpWrtShell->GetCurCharFmt(); if( pChar ) aParam = pChar->GetName(); } @@ -523,7 +523,7 @@ sal_uInt16 SwDocShell::Edit( SfxStyleSheetBase *pStyle = 0; sal_uInt16 nRet = nMask; - sal_Bool bModified = pDoc->IsModified(); + sal_Bool bModified = mpDoc->IsModified(); if( bNew ) { @@ -542,17 +542,16 @@ sal_uInt16 SwDocShell::Edit( { if(rParent.Len()) { - SwTxtFmtColl* pColl = pWrtShell->FindTxtFmtCollByName( rParent ); + SwTxtFmtColl* pColl = mpWrtShell->FindTxtFmtCollByName( rParent ); if(!pColl) { sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rParent, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL); if(USHRT_MAX != nId) - pColl = pWrtShell->GetTxtCollFromPool( nId ); + pColl = mpWrtShell->GetTxtCollFromPool( nId ); } pDStyle->GetCollection()->SetDerivedFrom( pColl ); pDStyle->PresetParent( rParent ); - //#outline level,add by zhaojianwei /*When a new paragraph style is created based on a "to outline style assigned" paragraph style, the outline level attribute and the list style attribute of the new paragraph style have to be set to 0 @@ -563,12 +562,11 @@ sal_uInt16 SwDocShell::Edit( pDStyle->GetCollection()->SetFmtAttr( aItem ); pDStyle->GetCollection()->SetAttrOutlineLevel( 0 ); } - //<-end,zhaojianwei } else { - SwTxtFmtColl* pColl = pWrtShell->GetCurTxtFmtColl(); + SwTxtFmtColl* pColl = mpWrtShell->GetCurTxtFmtColl(); pDStyle->GetCollection()->SetDerivedFrom( pColl ); if( pColl ) pDStyle->PresetParent( pColl->GetName() ); @@ -579,12 +577,12 @@ sal_uInt16 SwDocShell::Edit( { if(rParent.Len()) { - SwCharFmt* pCFmt = pWrtShell->FindCharFmtByName( rParent ); + SwCharFmt* pCFmt = mpWrtShell->FindCharFmtByName( rParent ); if(!pCFmt) { sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rParent, nsSwGetPoolIdFromName::GET_POOLID_CHRFMT); if(USHRT_MAX != nId) - pCFmt = pWrtShell->GetCharFmtFromPool( nId ); + pCFmt = mpWrtShell->GetCharFmtFromPool( nId ); } pDStyle->GetCharFmt()->SetDerivedFrom( pCFmt ); @@ -592,7 +590,7 @@ sal_uInt16 SwDocShell::Edit( } else { - SwCharFmt* pCFmt = pWrtShell->GetCurCharFmt(); + SwCharFmt* pCFmt = mpWrtShell->GetCurCharFmt(); pDStyle->GetCharFmt()->SetDerivedFrom( pCFmt ); if( pCFmt ) pDStyle->PresetParent( pCFmt->GetName() ); @@ -603,12 +601,12 @@ sal_uInt16 SwDocShell::Edit( { if(rParent.Len()) { - SwFrmFmt* pFFmt = pWrtShell->GetDoc()->FindFrmFmtByName( rParent ); + SwFrmFmt* pFFmt = mpWrtShell->GetDoc()->FindFrmFmtByName( rParent ); if(!pFFmt) { sal_uInt16 nId = SwStyleNameMapper::GetPoolIdFromUIName(rParent, nsSwGetPoolIdFromName::GET_POOLID_FRMFMT); if(USHRT_MAX != nId) - pFFmt = pWrtShell->GetFrmFmtFromPool( nId ); + pFFmt = mpWrtShell->GetFrmFmtFromPool( nId ); } pDStyle->GetFrmFmt()->SetDerivedFrom( pFFmt ); pDStyle->PresetParent( rParent ); @@ -672,7 +670,7 @@ sal_uInt16 SwDocShell::Edit( // In HTML mode, we do not always have a printer. In order to show // the correct page size in the Format - Page dialog, we have to // get one here. - SwWrtShell* pCurrShell = ( pActShell ? pActShell : pWrtShell ); + SwWrtShell* pCurrShell = ( pActShell ? pActShell : mpWrtShell ); if( ( HTMLMODE_ON & nHtmlMode ) && !pCurrShell->getIDocumentDeviceAccess()->getPrinter( false ) ) pCurrShell->InitPrt( pCurrShell->getIDocumentDeviceAccess()->getPrinter( true ) ); @@ -684,7 +682,7 @@ sal_uInt16 SwDocShell::Edit( DBG_ASSERT(pFact, "Dialogdiet fail!"); SfxAbstractTabDialog* pDlg = pFact->CreateTemplateDialog( DLG_TEMPLATE_BASE, 0, *(xTmp.get()), nFamily, nSlot, - pActShell ? pActShell : pWrtShell, bNew); + pActShell ? pActShell : mpWrtShell, bNew); DBG_ASSERT(pDlg, "Dialogdiet fail!"); if(RET_OK == pDlg->Execute()) { @@ -718,7 +716,7 @@ sal_uInt16 SwDocShell::Edit( SID_IMAGE_ORIENTATION, SID_ATTR_CHAR_FONT, FN_INSERT_CTRL, FN_INSERT_OBJ_CTRL, 0}; - pView->GetViewFrame()->GetBindings().Invalidate(aInval); + mpView->GetViewFrame()->GetBindings().Invalidate(aInval); } SfxItemSet aTmpSet( *pDlg->GetOutputItemSet() ); if( SFX_STYLE_FAMILY_CHAR == nFamily ) @@ -739,11 +737,11 @@ sal_uInt16 SwDocShell::Edit( { const SfxPoolItem *pItem = NULL; if( aTmpSet.GetItemState( GetPool().GetTrueWhich( SID_ATTR_FRAMEDIRECTION, sal_False ) , sal_True, &pItem ) == SFX_ITEM_SET ) - SwChartHelper::DoUpdateAllCharts( pDoc ); + SwChartHelper::DoUpdateAllCharts( mpDoc ); } } if(SFX_STYLE_FAMILY_PAGE == nFamily) - pView->InvalidateRulerPos(); + mpView->InvalidateRulerPos(); if( bNew ) mxBasePool->Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_CREATED, *xTmp.get() ) ); @@ -754,10 +752,10 @@ sal_uInt16 SwDocShell::Edit( // Kopf-/Fusszeilen entfernt werden. Sonst kommts zu GPFs!!! delete pDlg; - pDoc->SetModified(); + mpDoc->SetModified(); if( !bModified ) // Bug 57028 { - pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified(); + mpDoc->GetIDocumentUndoRedo().SetUndoNoResetModified(); } GetWrtShell()->EndAllAction(); @@ -769,11 +767,11 @@ sal_uInt16 SwDocShell::Edit( // #116530# //pBasePool->Erase( &aTmp ); GetWrtShell()->Undo(1); - pDoc->GetIDocumentUndoRedo().ClearRedo(); + mpDoc->GetIDocumentUndoRedo().ClearRedo(); } if( !bModified ) - pDoc->ResetModified(); + mpDoc->ResetModified(); delete pDlg; } } @@ -814,15 +812,15 @@ sal_uInt16 SwDocShell::Edit( xTmp->SetItemSet( aTmpSet ); } if(SFX_STYLE_FAMILY_PAGE == nFamily) - pView->InvalidateRulerPos(); + mpView->InvalidateRulerPos(); if( bNew ) mxBasePool->Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_CREATED, *xTmp.get() ) ); - pDoc->SetModified(); + mpDoc->SetModified(); if( !bModified ) // Bug 57028 { - pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified(); + mpDoc->GetIDocumentUndoRedo().SetUndoNoResetModified(); } GetWrtShell()->EndAllAction(); } @@ -873,53 +871,45 @@ sal_uInt16 SwDocShell::ApplyStyles(const pSh->StartAllAction(); - switch(nFamily) - { - case SFX_STYLE_FAMILY_CHAR: - { - SwFmtCharFmt aFmt(pStyle->GetCharFmt()); - pSh->SetAttrItem( aFmt, (nMode & KEY_SHIFT) ? - nsSetAttrMode::SETATTR_DONTREPLACE : nsSetAttrMode::SETATTR_DEFAULT ); - break; - } - case SFX_STYLE_FAMILY_PARA: - { - // --> OD 2007-11-06 #i62675# - // clear also list attributes at affected text nodes, if paragraph - // style has the list style attribute set. - pSh->SetTxtFmtColl( pStyle->GetCollection(), true ); - // <-- - break; - } - case SFX_STYLE_FAMILY_FRAME: - { - if ( pSh->IsFrmSelected() ) - pSh->SetFrmFmt( pStyle->GetFrmFmt() ); - break; - } - case SFX_STYLE_FAMILY_PAGE: - { - pSh->SetPageStyle(pStyle->GetPageDesc()->GetName()); - break; - } - case SFX_STYLE_FAMILY_PSEUDO: - { - // --> OD 2008-02-08 #newlistlevelattrs# - // reset indent attribute on applying list style - // --> OD 2008-03-17 #refactorlists# - // continue list of list style - const SwNumRule* pNumRule = pStyle->GetNumRule(); - const String sListIdForStyle =pNumRule->GetDefaultListId(); - pSh->SetCurNumRule( *pNumRule, false, sListIdForStyle, true ); - // <-- - break; - } - default: - DBG_ERROR("Unbekannte Familie"); - } - pSh->EndAllAction(); + switch (nFamily) + { + case SFX_STYLE_FAMILY_CHAR: + { + SwFmtCharFmt aFmt( pStyle->GetCharFmt() ); + pSh->SetAttrItem( aFmt, ( nMode & KEY_SHIFT ) ? nsSetAttrMode::SETATTR_DONTREPLACE : nsSetAttrMode::SETATTR_DEFAULT ); + break; + } + case SFX_STYLE_FAMILY_PARA: + { + // clear also list attributes at affected text nodes, if paragraph style has the list style attribute set. + pSh->SetTxtFmtColl( pStyle->GetCollection(), true ); + break; + } + case SFX_STYLE_FAMILY_FRAME: + { + if ( pSh->IsFrmSelected() ) + pSh->SetFrmFmt( pStyle->GetFrmFmt() ); + break; + } + case SFX_STYLE_FAMILY_PAGE: + { + pSh->SetPageStyle( pStyle->GetPageDesc()->GetName() ); + break; + } + case SFX_STYLE_FAMILY_PSEUDO: + { + const SwNumRule* pNumRule = pStyle->GetNumRule(); + const String sListIdForStyle = pNumRule->GetDefaultListId(); + pSh->SetCurNumRule( *pNumRule, false, sListIdForStyle, true ); + break; + } - return nFamily; + default: + DBG_ERROR( "Unbekannte Familie" ); + } + pSh->EndAllAction(); + + return nFamily; } /*-------------------------------------------------------------------- @@ -932,7 +922,7 @@ sal_uInt16 SwDocShell::DoWaterCan(const { ASSERT(GetWrtShell(), "Keine Shell, keine Styles"); - SwEditWin& rEdtWin = pView->GetEditWin(); + SwEditWin& rEdtWin = mpView->GetEditWin(); SwApplyTemplate* pApply = rEdtWin.GetApplyTemplate(); sal_Bool bWaterCan = !(pApply && pApply->eType != 0); if( !rName.Len() ) @@ -974,7 +964,7 @@ sal_uInt16 SwDocShell::DoWaterCan(const aTemplate.eType = 0; // Template anwenden - pView->GetEditWin().SetApplyTemplate(aTemplate); + mpView->GetEditWin().SetApplyTemplate(aTemplate); return nFamily; } @@ -1268,22 +1258,22 @@ void SwDocShell::_LoadStyles( SfxObjectS // der Vorlage erhalten, einmal alle FixFelder der // Source aktualisieren if(!bPreserveCurrentDocument) - ((SwDocShell&)rSource).pDoc->SetFixFields(false, NULL); - if( pWrtShell ) + ((SwDocShell&)rSource).mpDoc->SetFixFields(false, NULL); + if( mpWrtShell ) { - pWrtShell->StartAllAction(); - pDoc->ReplaceStyles( *((SwDocShell&)rSource).pDoc ); - pWrtShell->EndAllAction(); + mpWrtShell->StartAllAction(); + mpDoc->ReplaceStyles( *((SwDocShell&)rSource).mpDoc ); + mpWrtShell->EndAllAction(); } else { - sal_Bool bModified = pDoc->IsModified(); - pDoc->ReplaceStyles( *((SwDocShell&)rSource).pDoc ); - if( !bModified && pDoc->IsModified() && !pView ) + sal_Bool bModified = mpDoc->IsModified(); + mpDoc->ReplaceStyles( *((SwDocShell&)rSource).mpDoc ); + if( !bModified && mpDoc->IsModified() && !mpView ) { // die View wird spaeter angelegt, ueberschreibt aber das // Modify-Flag. Per Undo ist sowieso nichts mehr zu machen - pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified(); + mpDoc->GetIDocumentUndoRedo().SetUndoNoResetModified(); } } }
Modified: openoffice/branches/AOO410/main/sw/source/ui/app/docstyle.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/AOO410/main/sw/source/ui/app/docstyle.cxx?rev=1607011&r1=1607010&r2=1607011&view=diff ============================================================================== --- openoffice/branches/AOO410/main/sw/source/ui/app/docstyle.cxx (original) +++ openoffice/branches/AOO410/main/sw/source/ui/app/docstyle.cxx Tue Jul 1 08:14:18 2014 @@ -1201,11 +1201,10 @@ void SwDocStyleSheet::SetItemSet( const if( pColl != &pColl->GetNextTxtFmtColl() ) pCColl->SetNextTxtFmtColl( pColl->GetNextTxtFmtColl() ); - //pCColl->SetOutlineLevel( pColl->GetOutlineLevel() );//#outline level,zhaojianwei if( pColl->IsAssignedToListLevelOfOutlineStyle()) pCColl->AssignToListLevelOfOutlineStyle(pColl->GetAssignedOutlineStyleLevel()); else - pCColl->DeleteAssignmentToListLevelOfOutlineStyle();//<--end,zhaojianwei + pCColl->DeleteAssignmentToListLevelOfOutlineStyle();