diff options
Diffstat (limited to 'sw/source/ui')
49 files changed, 1309 insertions, 1063 deletions
diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx index 39b6b06d7b07..80baf675bf44 100644 --- a/sw/source/ui/app/docsh.cxx +++ b/sw/source/ui/app/docsh.cxx @@ -172,7 +172,7 @@ Reader* SwDocShell::StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr, *ppRdr = pPaM ? new SwReader( rMedium, aFileName, *pPaM ) : pCrsrShell ? new SwReader( rMedium, aFileName, *pCrsrShell->GetCrsr() ) - : new SwReader( rMedium, aFileName, pDoc ); + : new SwReader( rMedium, aFileName, mpDoc ); } else return 0; @@ -206,7 +206,7 @@ Reader* SwDocShell::StartConvertFrom(SfxMedium& rMedium, SwReader** ppRdr, // #i30171# set the UpdateDocMode at the SwDocShell SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE ); - nUpdateDocMode = pUpdateDocItem ? pUpdateDocItem->GetValue() : document::UpdateDocMode::NO_UPDATE; + mnUpdateDocMode = pUpdateDocItem ? pUpdateDocItem->GetValue() : document::UpdateDocMode::NO_UPDATE; if( pFlt->GetDefaultTemplate().Len() ) pRead->SetTemplateName( pFlt->GetDefaultTemplate() ); @@ -250,26 +250,26 @@ sal_Bool SwDocShell::ConvertFrom( SfxMedium& rMedium ) pRdr->GetDoc()->set(IDocumentSettingAccess::HTML_MODE, dynamic_cast< SwWebDocShell* >(this)); - /* #106748# Restore the pool default if reading a saved document. */ - pDoc->RemoveAllFmtLanguageDependencies(); + // Restore the pool default if reading a saved document. + mpDoc->RemoveAllFmtLanguageDependencies(); sal_uLong nErr = pRdr->Read( *pRead ); // Evtl. ein altes Doc weg - if ( pDoc != pRdr->GetDoc() ) + if ( mpDoc != pRdr->GetDoc() ) { - if( pDoc ) + if( mpDoc ) RemoveLink(); - pDoc = pRdr->GetDoc(); + mpDoc = pRdr->GetDoc(); AddLink(); if ( !mxBasePool.is() ) - mxBasePool = new SwDocStyleSheetPool( *pDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() ); + mxBasePool = new SwDocStyleSheetPool( *mpDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() ); } UpdateFontList(); - InitDraw(); + InitDrawModelAndDocShell(this, mpDoc ? mpDoc->GetDrawModel() : 0); delete pRdr; @@ -278,22 +278,27 @@ sal_Bool SwDocShell::ConvertFrom( SfxMedium& rMedium ) SetError( nErr, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); sal_Bool bOk = !IsError( nErr ); - // --> OD 2006-11-07 #i59688# -// // StartFinishedLoading rufen. Nicht bei asynchronen Filtern! -// // Diese muessen das selbst rufen! -// if( bOk && !pDoc->IsInLoadAsynchron() ) -// StartLoadFinishedTimer(); - if ( bOk && !pDoc->IsInLoadAsynchron() ) + if ( bOk && !mpDoc->IsInLoadAsynchron() ) { LoadingFinished(); } - // <-- pRead->setSotStorageRef(pStg); // #i45333# save sot storage ref in case of recursive calls return bOk; } + +void SwDocShell::BeforeLoading( SfxMedium&, const ::rtl::OUString &, const ::rtl::OUString & ) +{ + if ( mpDoc == NULL ) + { + return; + } + + mpDoc->RemoveAllFmtLanguageDependencies(); +} + /*-------------------------------------------------------------------- Beschreibung: Sichern des Default-Formats, Stg vorhanden --------------------------------------------------------------------*/ @@ -303,18 +308,18 @@ sal_Bool SwDocShell::Save() { RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDocShell::Save" ); //#i3370# remove quick help to prevent saving of autocorrection suggestions - if(pView) - pView->GetEditWin().StopQuickHelp(); + if(mpView) + mpView->GetEditWin().StopQuickHelp(); SwWait aWait( *this, true ); CalcLayoutForOLEObjects(); // format for OLE objets // --> OD 2006-03-17 #i62875# // reset compatibility flag <DoNotCaptureDrawObjsOnPage>, if possible - if ( pWrtShell && pDoc && - pDoc->get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) && - docfunc::AllDrawObjsOnPage( *pDoc ) ) + if ( mpWrtShell && mpDoc && + mpDoc->get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) && + docfunc::AllDrawObjsOnPage( *mpDoc ) ) { - pDoc->set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false); + mpDoc->set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false); } // <-- @@ -332,7 +337,7 @@ sal_Bool SwDocShell::Save() WriterRef xWrt; ::GetXMLWriter( aEmptyStr, GetMedium()->GetBaseURL( true ), xWrt ); xWrt->SetOrganizerMode( sal_True ); - SwWriter aWrt( *GetMedium(), *pDoc ); + SwWriter aWrt( *GetMedium(), *mpDoc ); nErr = aWrt.Write( xWrt ); xWrt->SetOrganizerMode( sal_False ); } @@ -347,35 +352,35 @@ sal_Bool SwDocShell::Save() case SFX_CREATE_MODE_PREVIEW: default: { - if( pDoc->ContainsMSVBasic() ) + if( mpDoc->ContainsMSVBasic() ) { //TODO/MBA: it looks as that this code can be removed! //SvxImportMSVBasic aTmp( *this, pIo->GetStorage() ); //aTmp.SaveOrDelMSVBAStorage( sal_False, aEmptyStr ); if( SvtFilterOptions::Get()->IsLoadWordBasicStorage() ) nVBWarning = GetSaveWarningOfMSVBAStorage( (SfxObjectShell&) (*this) ); - pDoc->SetContainsMSVBasic( sal_False ); + mpDoc->SetContainsMSVBasic( sal_False ); } // TabellenBox Edit beenden! - if( pWrtShell ) - pWrtShell->EndAllTblBoxEdit(); + if( mpWrtShell ) + mpWrtShell->EndAllTblBoxEdit(); WriterRef xWrt; ::GetXMLWriter( aEmptyStr, GetMedium()->GetBaseURL( true ), xWrt ); sal_Bool bLockedView(sal_False); - if ( pWrtShell ) + if ( mpWrtShell ) { - bLockedView = pWrtShell->IsViewLocked(); - pWrtShell->LockView( sal_True ); //lock visible section + bLockedView = mpWrtShell->IsViewLocked(); + mpWrtShell->LockView( sal_True ); //lock visible section } - SwWriter aWrt( *GetMedium(), *pDoc ); + SwWriter aWrt( *GetMedium(), *mpDoc ); nErr = aWrt.Write( xWrt ); - if ( pWrtShell ) - pWrtShell->LockView( bLockedView ); + if ( mpWrtShell ) + mpWrtShell->LockView( bLockedView ); } break; } @@ -383,7 +388,7 @@ sal_Bool SwDocShell::Save() } SetError( nErr ? nErr : nVBWarning, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); - SfxViewFrame* pFrm = pWrtShell ? pWrtShell->GetView().GetViewFrame() : 0; + SfxViewFrame* pFrm = mpWrtShell ? mpWrtShell->GetView().GetViewFrame() : 0; if( pFrm ) { pFrm->GetBindings().SetState( SfxStringItem( SID_DOC_MODIFIED, ' ' )); @@ -400,7 +405,7 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDocShell::SaveAs" ); - pDoc->setDocAccTitle(String()); + mpDoc->setDocAccTitle(String()); SfxViewFrame* pFrame1 = SfxViewFrame::GetFirst( this ); if (pFrame1) { @@ -416,19 +421,19 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium ) } SwWait aWait( *this, true ); //#i3370# remove quick help to prevent saving of autocorrection suggestions - if(pView) - pView->GetEditWin().StopQuickHelp(); + if(mpView) + mpView->GetEditWin().StopQuickHelp(); //#i91811# mod if we have an active margin window, write back the text - if ( pView && - pView->GetPostItMgr() && - pView->GetPostItMgr()->HasActiveSidebarWin() ) + if ( mpView && + mpView->GetPostItMgr() && + mpView->GetPostItMgr()->HasActiveSidebarWin() ) { - pView->GetPostItMgr()->UpdateDataOnActiveSidebarWin(); + mpView->GetPostItMgr()->UpdateDataOnActiveSidebarWin(); } - if( pDoc->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) && - !pDoc->get(IDocumentSettingAccess::GLOBAL_DOCUMENT_SAVE_LINKS) ) + if( mpDoc->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) && + !mpDoc->get(IDocumentSettingAccess::GLOBAL_DOCUMENT_SAVE_LINKS) ) RemoveOLEObjects(); { @@ -455,11 +460,11 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium ) CalcLayoutForOLEObjects(); // format for OLE objets // --> OD 2006-03-17 #i62875# // reset compatibility flag <DoNotCaptureDrawObjsOnPage>, if possible - if ( pWrtShell && pDoc && - pDoc->get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) && - docfunc::AllDrawObjsOnPage( *pDoc ) ) + if ( mpWrtShell && mpDoc && + mpDoc->get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) && + docfunc::AllDrawObjsOnPage( *mpDoc ) ) { - pDoc->set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false); + mpDoc->set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false); } // <-- @@ -485,26 +490,26 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium ) xDocSh->DoClose(); } - if( pDoc->ContainsMSVBasic() ) + if( mpDoc->ContainsMSVBasic() ) { //TODO/MBA: it looks as that this code can be removed! //SvxImportMSVBasic aTmp( *this, pIo->GetStorage() ); //aTmp.SaveOrDelMSVBAStorage( sal_False, aEmptyStr ); if( SvtFilterOptions::Get()->IsLoadWordBasicStorage() ) nVBWarning = GetSaveWarningOfMSVBAStorage( (SfxObjectShell&) *this ); - pDoc->SetContainsMSVBasic( sal_False ); + mpDoc->SetContainsMSVBasic( sal_False ); } // TabellenBox Edit beenden! - if( pWrtShell ) - pWrtShell->EndAllTblBoxEdit(); + if( mpWrtShell ) + mpWrtShell->EndAllTblBoxEdit(); // Modified-Flag merken und erhalten ohne den Link zu Callen // (fuer OLE; nach Anweisung von MM) - sal_Bool bIsModified = pDoc->IsModified(); - pDoc->GetIDocumentUndoRedo().LockUndoNoModifiedPosition(); - Link aOldOLELnk( pDoc->GetOle2Link() ); - pDoc->SetOle2Link( Link() ); + sal_Bool bIsModified = mpDoc->IsModified(); + mpDoc->GetIDocumentUndoRedo().LockUndoNoModifiedPosition(); + Link aOldOLELnk( mpDoc->GetOle2Link() ); + mpDoc->SetOle2Link( Link() ); // SfxProgress unterdruecken, wenn man Embedded ist SW_MOD()->SetEmbeddedLoadSave( @@ -514,24 +519,24 @@ sal_Bool SwDocShell::SaveAs( SfxMedium& rMedium ) ::GetXMLWriter( aEmptyStr, rMedium.GetBaseURL( true ), xWrt ); sal_Bool bLockedView(sal_False); - if ( pWrtShell ) + if ( mpWrtShell ) { - bLockedView = pWrtShell->IsViewLocked(); - pWrtShell->LockView( sal_True ); //lock visible section + bLockedView = mpWrtShell->IsViewLocked(); + mpWrtShell->LockView( sal_True ); //lock visible section } - SwWriter aWrt( rMedium, *pDoc ); + SwWriter aWrt( rMedium, *mpDoc ); nErr = aWrt.Write( xWrt ); - if ( pWrtShell ) - pWrtShell->LockView( bLockedView ); + if ( mpWrtShell ) + mpWrtShell->LockView( bLockedView ); if( bIsModified ) { - pDoc->SetModified(); - pDoc->GetIDocumentUndoRedo().UnLockUndoNoModifiedPosition(); + mpDoc->SetModified(); + mpDoc->GetIDocumentUndoRedo().UnLockUndoNoModifiedPosition(); } - pDoc->SetOle2Link( aOldOLELnk ); + mpDoc->SetOle2Link( aOldOLELnk ); SW_MOD()->SetEmbeddedLoadSave( sal_False ); } @@ -568,20 +573,20 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium ) } //#i3370# remove quick help to prevent saving of autocorrection suggestions - if(pView) - pView->GetEditWin().StopQuickHelp(); + if(mpView) + mpView->GetEditWin().StopQuickHelp(); //#i91811# mod if we have an active margin window, write back the text - if ( pView && - pView->GetPostItMgr() && - pView->GetPostItMgr()->HasActiveSidebarWin() ) + if ( mpView && + mpView->GetPostItMgr() && + mpView->GetPostItMgr()->HasActiveSidebarWin() ) { - pView->GetPostItMgr()->UpdateDataOnActiveSidebarWin(); + mpView->GetPostItMgr()->UpdateDataOnActiveSidebarWin(); } sal_uLong nVBWarning = 0; - if( pDoc->ContainsMSVBasic() ) + if( mpDoc->ContainsMSVBasic() ) { sal_Bool bSave = pFlt->GetUserData().EqualsAscii( "CWW8" ) && SvtFilterOptions::Get()->IsLoadWordBasicStorage(); @@ -594,14 +599,14 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium ) { nVBWarning = SaveOrDelMSVBAStorage( (SfxObjectShell&) *this, *xStg, bSave, String::CreateFromAscii("Macros") ); xStg->Commit(); - pDoc->SetContainsMSVBasic( sal_True ); + mpDoc->SetContainsMSVBasic( sal_True ); } } } // TabellenBox Edit beenden! - if( pWrtShell ) - pWrtShell->EndAllTblBoxEdit(); + if( mpWrtShell ) + mpWrtShell->EndAllTblBoxEdit(); if( pFlt->GetUserData().EqualsAscii( "HTML") ) { @@ -631,17 +636,17 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium ) } // --> FME 2007-5-7 #i76360# Update document statistics - SwDocStat aDocStat( pDoc->GetDocStat() );; - pDoc->UpdateDocStat( aDocStat ); + SwDocStat aDocStat( mpDoc->GetDocStat() );; + mpDoc->UpdateDocStat( aDocStat ); // <-- CalcLayoutForOLEObjects(); // format for OLE objets // --> OD 2006-03-17 #i62875# // reset compatibility flag <DoNotCaptureDrawObjsOnPage>, if possible - if ( pWrtShell && pDoc && - pDoc->get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) && - docfunc::AllDrawObjsOnPage( *pDoc ) ) + if ( mpWrtShell && mpDoc && + mpDoc->get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) && + docfunc::AllDrawObjsOnPage( *mpDoc ) ) { - pDoc->set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false); + mpDoc->set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false); } // <-- @@ -715,7 +720,7 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium ) } if( pFlt->GetUserData().EqualsAscii( FILTER_TEXT_DLG ) && - ( pWrtShell || !::lcl_GetSourceView( this ) )) + ( mpWrtShell || !::lcl_GetSourceView( this ) )) { SwAsciiOptions aOpt; String sItemOpt; @@ -742,25 +747,25 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium ) String aFileName( rMedium.GetName() ); //Keine View also das ganze Dokument! - if ( pWrtShell ) + if ( mpWrtShell ) { SwWait aWait( *this, true ); // --> OD 2009-12-31 #i106906# - const sal_Bool bFormerLockView = pWrtShell->IsViewLocked(); - pWrtShell->LockView( sal_True ); + const sal_Bool bFormerLockView = mpWrtShell->IsViewLocked(); + mpWrtShell->LockView( sal_True ); // <-- - pWrtShell->StartAllAction(); - pWrtShell->Push(); - SwWriter aWrt( rMedium, *pWrtShell, sal_True ); + mpWrtShell->StartAllAction(); + mpWrtShell->Push(); + SwWriter aWrt( rMedium, *mpWrtShell, sal_True ); nErrno = aWrt.Write( xWriter, &aFileName ); //JP 16.05.97: falls der SFX uns die View waehrend des speicherns // entzieht - if( pWrtShell ) + if( mpWrtShell ) { - pWrtShell->Pop(sal_False); - pWrtShell->EndAllAction(); + mpWrtShell->Pop(sal_False); + mpWrtShell->EndAllAction(); // --> OD 2009-12-31 #i106906# - pWrtShell->LockView( bFormerLockView ); + mpWrtShell->LockView( bFormerLockView ); // <-- } } @@ -775,7 +780,7 @@ sal_Bool SwDocShell::ConvertTo( SfxMedium& rMedium ) } else { - SwWriter aWrt( rMedium, *pDoc ); + SwWriter aWrt( rMedium, *mpDoc ); nErrno = aWrt.Write( xWriter, &aFileName ); } } @@ -806,21 +811,21 @@ sal_Bool SwDocShell::SaveCompleted( const uno::Reference < embed::XStorage >& xS { // erst hier entscheiden, ob das Speichern geklappt hat oder nicht if( IsModified() ) - pDoc->SetModified(); + mpDoc->SetModified(); else - pDoc->ResetModified(); + mpDoc->ResetModified(); } - if( pOLEChildList ) + if( mpOLEChildList ) { sal_Bool bResetModified = IsEnableSetModified(); if( bResetModified ) EnableSetModified( sal_False ); - uno::Sequence < rtl::OUString > aNames = pOLEChildList->GetObjectNames(); + uno::Sequence < rtl::OUString > aNames = mpOLEChildList->GetObjectNames(); for( sal_Int32 n = aNames.getLength(); n; n-- ) { - if ( !pOLEChildList->MoveEmbeddedObject( aNames[n-1], GetEmbeddedObjectContainer() ) ) + if ( !mpOLEChildList->MoveEmbeddedObject( aNames[n-1], GetEmbeddedObjectContainer() ) ) { DBG_ERROR( "Copying of objects didn't work!" ); } @@ -830,7 +835,7 @@ sal_Bool SwDocShell::SaveCompleted( const uno::Reference < embed::XStorage >& xS //pPersist->Move( &aRef, aRef->GetStorageName() ); } - DELETEZ( pOLEChildList ); + DELETEZ( mpOLEChildList ); if( bResetModified ) EnableSetModified( sal_True ); } @@ -868,10 +873,10 @@ void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup, JobSetup *pOrig = 0; if ( rSetup.GetPrinterName().Len() && ASPECT_THUMBNAIL != nAspect ) { - pOrig = const_cast<JobSetup*>(pDoc->getJobsetup()); + pOrig = const_cast<JobSetup*>(mpDoc->getJobsetup()); if( pOrig ) // dann kopieren wir uns den pOrig = new JobSetup( *pOrig ); - pDoc->setJobsetup( rSetup ); + mpDoc->setJobsetup( rSetup ); } Rectangle aRect( nAspect == ASPECT_THUMBNAIL ? @@ -883,12 +888,12 @@ void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup, pDev->SetBackground(); sal_Bool bWeb = 0 != dynamic_cast< SwWebDocShell* >( this); SwPrintData aOpts; - ViewShell::PrtOle2( pDoc, SW_MOD()->GetUsrPref(bWeb), aOpts, pDev, aRect ); + ViewShell::PrtOle2( mpDoc, SW_MOD()->GetUsrPref(bWeb), aOpts, pDev, aRect ); pDev->Pop(); if( pOrig ) { - pDoc->setJobsetup( *pOrig ); + mpDoc->setJobsetup( *pOrig ); delete pOrig; } if ( bResetModified ) @@ -899,9 +904,9 @@ void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup, void SwDocShell::SetVisArea( const Rectangle &rRect ) { Rectangle aRect( rRect ); - if ( pView ) + if ( mpView ) { - Size aSz( pView->GetDocSz() ); + Size aSz( mpView->GetDocSz() ); aSz.Width() += DOCUMENTBORDER; aSz.Height() += DOCUMENTBORDER; long nMoveX = 0, nMoveY = 0; if ( aRect.Right() > aSz.Width() ) @@ -914,7 +919,7 @@ void SwDocShell::SetVisArea( const Rectangle &rRect ) aRect.Move( nMoveX, nMoveY ); //Ruft das SfxInPlaceObject::SetVisArea()! - pView->SetVisArea( aRect, sal_True ); + mpView->SetVisArea( aRect, sal_True ); } else SfxObjectShell::SetVisArea( aRect ); @@ -926,8 +931,8 @@ Rectangle SwDocShell::GetVisArea( sal_uInt16 nAspect ) const if ( nAspect == ASPECT_THUMBNAIL ) { //PreView: VisArea auf die erste Seite einstellen. - SwNodeIndex aIdx( pDoc->GetNodes().GetEndOfExtras(), 1 ); - SwCntntNode* pNd = pDoc->GetNodes().GoNext( &aIdx ); + SwNodeIndex aIdx( mpDoc->GetNodes().GetEndOfExtras(), 1 ); + SwCntntNode* pNd = mpDoc->GetNodes().GoNext( &aIdx ); const SwRect aPageRect = pNd->FindPageFrmRect( sal_False, 0, sal_False ); return aPageRect.SVRect(); @@ -937,12 +942,12 @@ Rectangle SwDocShell::GetVisArea( sal_uInt16 nAspect ) const Printer *SwDocShell::GetDocumentPrinter() { - return pDoc->getPrinter( false ); + return mpDoc->getPrinter( false ); } OutputDevice* SwDocShell::GetDocumentRefDev() { - return pDoc->getReferenceDevice( false ); + return mpDoc->getReferenceDevice( false ); } void SwDocShell::OnDocumentPrinterChanged( Printer * pNewPrinter ) @@ -1001,12 +1006,12 @@ sal_uInt16 SwDocShell::GetHiddenInformationState( sal_uInt16 nStates ) void SwDocShell::GetState(SfxItemSet& rSet) { - SfxWhichIter aIter(rSet); - sal_uInt16 nWhich = aIter.FirstWhich(); + SfxWhichIter aIter( rSet ); + sal_uInt16 nWhich = aIter.FirstWhich(); while (nWhich) { - switch (nWhich) + switch ( nWhich ) { case SID_PRINTPREVIEW: { @@ -1014,16 +1019,16 @@ void SwDocShell::GetState(SfxItemSet& rSet) // Disable "multiple layout" if ( !bDisable ) { - SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this); + SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst( this ); while (pTmpFrm) // Preview suchen { if ( dynamic_cast< SwView* >(pTmpFrm->GetViewShell()) && - ((SwView*)pTmpFrm->GetViewShell())->GetWrtShell().GetViewOptions()->getBrowseMode() ) + ( (SwView*) pTmpFrm->GetViewShell() )->GetWrtShell().GetViewOptions()->getBrowseMode() ) { bDisable = sal_True; break; } - pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, this); + pTmpFrm = pTmpFrm->GetNext( *pTmpFrm, this ); } } // End of disabled "multiple layout" @@ -1031,49 +1036,53 @@ void SwDocShell::GetState(SfxItemSet& rSet) rSet.DisableItem( SID_PRINTPREVIEW ); else { - SfxBoolItem aBool( SID_PRINTPREVIEW, false); - if( dynamic_cast< SwPagePreView* >( SfxViewShell::Current()) ) - aBool.SetValue( true ); + SfxBoolItem aBool( SID_PRINTPREVIEW, sal_False ); + if ( dynamic_cast< SwPagePreView* >( SfxViewShell::Current()) ) + aBool.SetValue( sal_True ); rSet.Put( aBool ); } } break; + case SID_SOURCEVIEW: { - SfxViewShell* pCurrView = GetView() ? (SfxViewShell*)GetView() - : SfxViewShell::Current(); + SfxViewShell* pCurrView = GetView() ? (SfxViewShell*) GetView() + : + SfxViewShell::Current(); sal_Bool bSourceView = 0 != dynamic_cast< SwSrcView* >( pCurrView); - rSet.Put(SfxBoolItem(SID_SOURCEVIEW, bSourceView)); + rSet.Put( SfxBoolItem( SID_SOURCEVIEW, bSourceView ) ); } break; + case SID_HTML_MODE: - rSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(this))); - break; + rSet.Put( SfxUInt16Item( SID_HTML_MODE, ::GetHtmlMode( this ) ) ); + break; case FN_ABSTRACT_STARIMPRESS: case FN_OUTLINE_TO_IMPRESS: - { - SvtModuleOptions aMOpt; - if ( !aMOpt.IsImpress() ) - rSet.DisableItem( nWhich ); - } - /* no break here */ + { + SvtModuleOptions aMOpt; + if ( !aMOpt.IsImpress() ) + rSet.DisableItem( nWhich ); + } + /* no break here */ case FN_ABSTRACT_NEWDOC: case FN_OUTLINE_TO_CLIPBOARD: - { - if ( !GetDoc()->GetNodes().GetOutLineNds().Count() ) - rSet.DisableItem( nWhich ); - } - break; + { + if ( !GetDoc()->GetNodes().GetOutLineNds().Count() ) + rSet.DisableItem( nWhich ); + } + break; + case SID_BROWSER_MODE: case FN_PRINT_LAYOUT: - { - sal_Bool bState = GetDoc()->get(IDocumentSettingAccess::BROWSE_MODE); - if(FN_PRINT_LAYOUT == nWhich) - bState = !bState; - rSet.Put( SfxBoolItem( nWhich, bState)); - } - break; + { + sal_Bool bState = GetDoc()->get( IDocumentSettingAccess::BROWSE_MODE ); + if ( FN_PRINT_LAYOUT == nWhich ) + bState = !bState; + rSet.Put( SfxBoolItem( nWhich, bState ) ); + } + break; case FN_NEW_GLOBAL_DOC: if ( dynamic_cast< SwGlobalDocShell* >(this) ) @@ -1081,29 +1090,32 @@ void SwDocShell::GetState(SfxItemSet& rSet) break; case FN_NEW_HTML_DOC: - if( dynamic_cast< SwWebDocShell* >(this) ) + if ( dynamic_cast< SwWebDocShell* >(this) ) rSet.DisableItem( nWhich ); break; case SID_ATTR_YEAR2000: - { - const SvNumberFormatter* pFmtr = pDoc->GetNumberFormatter(sal_False); - rSet.Put( SfxUInt16Item( nWhich, - static_cast< sal_uInt16 >( - pFmtr ? pFmtr->GetYear2000() - : ::utl::MiscCfg().GetYear2000() ))); - } - break; + { + const SvNumberFormatter* pFmtr = mpDoc->GetNumberFormatter( sal_False ); + rSet.Put( SfxUInt16Item( nWhich, + static_cast< sal_uInt16 >( + pFmtr ? pFmtr->GetYear2000() + : + ::utl::MiscCfg().GetYear2000() ) ) ); + } + break; + case SID_ATTR_CHAR_FONTLIST: { - rSet.Put( SvxFontListItem( pFontList, SID_ATTR_CHAR_FONTLIST ) ); + rSet.Put( SvxFontListItem( mpFontList, SID_ATTR_CHAR_FONTLIST ) ); } break; + case SID_MAIL_PREPAREEXPORT: { //check if linked content or possibly hidden content is available //pDoc->UpdateFlds( NULL, false ); - sfx2::LinkManager& rLnkMgr = pDoc->GetLinkManager(); + sfx2::LinkManager& rLnkMgr = mpDoc->GetLinkManager(); const ::sfx2::SvBaseLinks& rLnks = rLnkMgr.GetLinks(); sal_Bool bRet = sal_False; if( rLnks.Count() ) @@ -1111,13 +1123,14 @@ void SwDocShell::GetState(SfxItemSet& rSet) else { //sections with hidden flag, hidden character attribute, hidden paragraph/text or conditional text fields - bRet = pDoc->HasInvisibleContent(); + bRet = mpDoc->HasInvisibleContent(); } rSet.Put( SfxBoolItem( nWhich, bRet ) ); } break; - default: DBG_ASSERT(!this,"Hier darfst Du nicht hinein!"); + default: + DBG_ASSERT( !this, "Hier darfst Du nicht hinein!" ); } nWhich = aIter.NextWhich(); @@ -1153,20 +1166,20 @@ SfxStyleSheetBasePool* SwDocShell::GetStyleSheetPool() void SwDocShell::SetView(SwView* pVw) { - if(0 != (pView = pVw)) + if(0 != (mpView = pVw)) { - pWrtShell = &pView->GetWrtShell(); + mpWrtShell = &mpView->GetWrtShell(); } else { - pWrtShell = 0; + mpWrtShell = 0; } } void SwDocShell::PrepareReload() { - ::DelAllGrfCacheEntries( pDoc ); + ::DelAllGrfCacheEntries( mpDoc ); } // linked graphics are now loaded on demand. @@ -1179,7 +1192,7 @@ void SwDocShell::LoadingFinished() // enables the document modification again. // Thus, manuell modify the document, if its modified and its links are updated // before <FinishedLoading(..)> is called. - const bool bHasDocToStayModified( pDoc->IsModified() && pDoc->LinksUpdated() ); + const bool bHasDocToStayModified( mpDoc->IsModified() && mpDoc->LinksUpdated() ); FinishedLoading( SFX_LOADED_ALL ); SfxViewFrame* pVFrame = SfxViewFrame::GetFirst(this); if(pVFrame) @@ -1189,9 +1202,9 @@ void SwDocShell::LoadingFinished() ((SwSrcView*)pShell)->Load(this); } - if ( bHasDocToStayModified && !pDoc->IsModified() ) + if ( bHasDocToStayModified && !mpDoc->IsModified() ) { - pDoc->SetModified(); + mpDoc->SetModified(); } } @@ -1200,29 +1213,29 @@ void SwDocShell::CancelTransfers() { // alle Links vom LinkManager Canceln aFinishedTimer.Stop(); - pDoc->GetLinkManager().CancelTransfers(); + mpDoc->GetLinkManager().CancelTransfers(); SfxObjectShell::CancelTransfers(); } SwFEShell* SwDocShell::GetFEShell() { - return pWrtShell; + return mpWrtShell; } void SwDocShell::RemoveOLEObjects() { - SwIterator<SwCntntNode,SwFmtColl> aIter( *pDoc->GetDfltGrfFmtColl() ); + SwIterator<SwCntntNode,SwFmtColl> aIter( *mpDoc->GetDfltGrfFmtColl() ); for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() ) { SwOLENode* pOLENd = pNd->GetOLENode(); if( pOLENd && ( pOLENd->IsOLEObjectDeleted() || pOLENd->IsInGlobalDocSection() ) ) { - if( !pOLEChildList ) - pOLEChildList = new comphelper::EmbeddedObjectContainer; + if( !mpOLEChildList ) + mpOLEChildList = new comphelper::EmbeddedObjectContainer; ::rtl::OUString aObjName = pOLENd->GetOLEObj().GetCurrentPersistName(); - GetEmbeddedObjectContainer().MoveEmbeddedObject( aObjName, *pOLEChildList ); + GetEmbeddedObjectContainer().MoveEmbeddedObject( aObjName, *mpOLEChildList ); } } } @@ -1236,16 +1249,16 @@ void SwDocShell::RemoveOLEObjects() // saved, but of course only id there are OLE objects with bOLESizeInvalid set. void SwDocShell::CalcLayoutForOLEObjects() { - if( !pWrtShell ) + if( !mpWrtShell ) return; - SwIterator<SwCntntNode,SwFmtColl> aIter( *pDoc->GetDfltGrfFmtColl() ); + SwIterator<SwCntntNode,SwFmtColl> aIter( *mpDoc->GetDfltGrfFmtColl() ); for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() ) { SwOLENode* pOLENd = pNd->GetOLENode(); if( pOLENd && pOLENd->IsOLESizeInvalid() ) { - pWrtShell->CalcLayout(); + mpWrtShell->CalcLayout(); break; } } @@ -1281,34 +1294,36 @@ uno::Reference< frame::XController > ---------------------------------------------------------------------------*/ void SwDocShell::setDocAccTitle( const String& rTitle ) { - if (pDoc ) + if ( mpDoc ) { - pDoc->setDocAccTitle( rTitle ); + mpDoc->setDocAccTitle( rTitle ); } } const String SwDocShell::getDocAccTitle() const { String sRet; - if (pDoc) + if ( mpDoc ) { - sRet = pDoc->getDocAccTitle(); + sRet = mpDoc->getDocAccTitle(); } return sRet; } -void SwDocShell::setDocReadOnly( sal_Bool bReadOnly) +void SwDocShell::setDocReadOnly( + sal_Bool bReadOnly ) { - if (pDoc ) + if ( mpDoc ) { - pDoc->setDocReadOnly( bReadOnly ); + mpDoc->setDocReadOnly( bReadOnly ); } } + sal_Bool SwDocShell::getDocReadOnly() const { - if (pDoc) + if ( mpDoc ) { - return pDoc->getDocReadOnly(); + return mpDoc->getDocReadOnly(); } return sal_False; @@ -1352,27 +1367,27 @@ rtl::OUString SwDocShell::GetEventName( sal_Int32 nIndex ) const ::sfx2::IXmlIdRegistry* SwDocShell::GetXmlIdRegistry() const { - return pDoc ? &pDoc->GetXmlIdRegistry() : 0; + return mpDoc ? &mpDoc->GetXmlIdRegistry() : 0; } bool SwDocShell::IsChangeRecording() const { - return (pWrtShell->GetRedlineMode() & nsRedlineMode_t::REDLINE_ON) != 0; + return (mpWrtShell->GetRedlineMode() & nsRedlineMode_t::REDLINE_ON) != 0; } bool SwDocShell::HasChangeRecordProtection() const { - return pWrtShell->getIDocumentRedlineAccess()->GetRedlinePassword().getLength() > 0; + return mpWrtShell->getIDocumentRedlineAccess()->GetRedlinePassword().getLength() > 0; } void SwDocShell::SetChangeRecording( bool bActivate ) { sal_uInt16 nOn = bActivate ? nsRedlineMode_t::REDLINE_ON : 0; - sal_uInt16 nMode = pWrtShell->GetRedlineMode(); - pWrtShell->SetRedlineModeAndCheckInsMode( (nMode & ~nsRedlineMode_t::REDLINE_ON) | nOn); + sal_uInt16 nMode = mpWrtShell->GetRedlineMode(); + mpWrtShell->SetRedlineModeAndCheckInsMode( (nMode & ~nsRedlineMode_t::REDLINE_ON) | nOn); } @@ -1382,7 +1397,7 @@ bool SwDocShell::SetProtectionPassword( const String &rNewPassword ) const SfxItemSet* pArgs = &aSet; const SfxPoolItem* pItem = NULL; - IDocumentRedlineAccess* pIDRA = pWrtShell->getIDocumentRedlineAccess(); + IDocumentRedlineAccess* pIDRA = mpWrtShell->getIDocumentRedlineAccess(); Sequence< sal_Int8 > aPasswd = pIDRA->GetRedlinePassword(); if (pArgs && SFX_ITEM_SET == pArgs->GetItemState( FN_REDLINE_PROTECT, sal_False, &pItem ) && ((SfxBoolItem*)pItem)->GetValue() == (aPasswd.getLength() > 0)) @@ -1418,7 +1433,7 @@ bool SwDocShell::GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal const SfxItemSet* pArgs = &aSet; const SfxPoolItem* pItem = NULL; - IDocumentRedlineAccess* pIDRA = pWrtShell->getIDocumentRedlineAccess(); + IDocumentRedlineAccess* pIDRA = mpWrtShell->getIDocumentRedlineAccess(); Sequence< sal_Int8 > aPasswdHash( pIDRA->GetRedlinePassword() ); if (pArgs && SFX_ITEM_SET == pArgs->GetItemState( FN_REDLINE_PROTECT, sal_False, &pItem ) && ((SfxBoolItem*)pItem)->GetValue() == (aPasswdHash.getLength() != 0)) diff --git a/sw/source/ui/app/docsh2.cxx b/sw/source/ui/app/docsh2.cxx index ce7b00c98dfe..611a9469a763 100644 --- a/sw/source/ui/app/docsh2.cxx +++ b/sw/source/ui/app/docsh2.cxx @@ -196,21 +196,21 @@ void SwDocShell::ToggleBrowserMode(sal_Bool bSet, SwView* _pView ) /// update text fields on document properties changes void SwDocShell::DoFlushDocInfo() { - if ( !pDoc ) return; + if ( !mpDoc ) return; bool bUnlockView(true); - if ( pWrtShell ) { - bUnlockView = !pWrtShell->IsViewLocked(); - pWrtShell->LockView( sal_True ); // lock visible section - pWrtShell->StartAllAction(); + if ( mpWrtShell ) { + bUnlockView = !mpWrtShell->IsViewLocked(); + mpWrtShell->LockView( sal_True ); // lock visible section + mpWrtShell->StartAllAction(); } - pDoc->DocInfoChgd(); + mpDoc->DocInfoChgd(); - if ( pWrtShell ) { - pWrtShell->EndAllAction(); + if ( mpWrtShell ) { + mpWrtShell->EndAllAction(); if ( bUnlockView ) { - pWrtShell->LockView( sal_False ); + mpWrtShell->LockView( sal_False ); } } } @@ -244,13 +244,13 @@ void lcl_processCompatibleSfxHint( const uno::Reference< script::vba::XVBAEventP void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) { - if( !pDoc ) + if( !mpDoc ) { return ; } #ifdef FUTURE_VBA - uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = pDoc->GetVbaEventProcessor(); + uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = mpDoc->GetVbaEventProcessor(); if( xVbaEvents.is() ) lcl_processCompatibleSfxHint( xVbaEvents, rHint ); #endif @@ -271,16 +271,16 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) if( nAction ) { sal_Bool bUnlockView = sal_True; //initializing prevents warning - if( pWrtShell ) + if( mpWrtShell ) { - bUnlockView = !pWrtShell->IsViewLocked(); - pWrtShell->LockView( sal_True ); //lock visible section - pWrtShell->StartAllAction(); + bUnlockView = !mpWrtShell->IsViewLocked(); + mpWrtShell->LockView( sal_True ); //lock visible section + mpWrtShell->StartAllAction(); } switch( nAction ) { case 2: - pDoc->GetSysFldType( RES_FILENAMEFLD )->UpdateFlds(); + mpDoc->GetSysFldType( RES_FILENAMEFLD )->UpdateFlds(); break; // own action for event LOADFINISHED in order to avoid a modified document. @@ -291,23 +291,23 @@ void SwDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) const bool bResetModified = IsEnableSetModified(); if ( bResetModified ) EnableSetModified( sal_False ); - const bool bIsDocModified = pDoc->IsModified(); + const bool bIsDocModified = mpDoc->IsModified(); - pDoc->DocInfoChgd( ); + mpDoc->DocInfoChgd( ); if ( !bIsDocModified ) - pDoc->ResetModified(); + mpDoc->ResetModified(); if ( bResetModified ) EnableSetModified( sal_True ); } break; } - if( pWrtShell ) + if( mpWrtShell ) { - pWrtShell->EndAllAction(); + mpWrtShell->EndAllAction(); if( bUnlockView ) - pWrtShell->LockView( sal_False ); + mpWrtShell->LockView( sal_False ); } } } @@ -324,9 +324,9 @@ sal_uInt16 SwDocShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing ) EndListening( *this ); #ifdef FUTURE_VBA - if( pDoc && IsInPrepareClose() ) + if( mpDoc && IsInPrepareClose() ) { - uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = pDoc->GetVbaEventProcessor(); + uno::Reference< script::vba::XVBAEventProcessor > xVbaEvents = mpDoc->GetVbaEventProcessor(); if( xVbaEvents.is() ) { using namespace com::sun::star::script::vba::VBAEventId; @@ -385,7 +385,7 @@ sal_Bool SwDocShell::Insert( SfxObjectShell &rSource, // dflt. PageDesc und StandardZeichenvorlage nie loeschen !!! if( ( SFX_STYLE_FAMILY_PAGE == eOldFamily && - const_cast<const SwDoc *>(pDoc)->GetPageDesc(0).GetName() == + const_cast<const SwDoc *>(mpDoc)->GetPageDesc(0).GetName() == rOldName ) || ( SFX_STYLE_FAMILY_CHAR == eOldFamily && rOldName == *SwStyleNameMapper::GetTextUINameArray()[ RES_POOLCOLL_STANDARD - @@ -396,7 +396,7 @@ sal_Bool SwDocShell::Insert( SfxObjectShell &rSource, sal_uInt16 nMySrchMask = pMyPool->GetSearchMask(); SfxStyleSheetBase* pExist; - if( ::FindPhyStyle( *pDoc, rOldName, eOldFamily ) ) + if( ::FindPhyStyle( *mpDoc, rOldName, eOldFamily ) ) { // Bug 20365: nur uebernehmen, wenn das gewuenscht ist! if( ERRCODE_BUTTON_OK != ErrorHandler::HandleError( @@ -436,7 +436,7 @@ sal_Bool SwDocShell::Insert( SfxObjectShell &rSource, // gesondert behandeln!! SwPageDesc* pDestDsc = (SwPageDesc*)xNewSheet->GetPageDesc(); SwPageDesc* pCpyDsc = (SwPageDesc*)((SwDocStyleSheet*)pHisSheet)->GetPageDesc(); - pDoc->CopyPageDesc( *pCpyDsc, *pDestDsc ); + mpDoc->CopyPageDesc( *pCpyDsc, *pDestDsc ); } else // die neue Vorlage mit den Attributen fuellen @@ -536,7 +536,7 @@ sal_Bool SwDocShell::Insert( SfxObjectShell &rSource, pMyPool->SetSearchMask( eMyOldFamily, nMySrchMask ); // Model geaendert - ASSERT(pDoc, "Doc fehlt"); + ASSERT(mpDoc, "Doc fehlt"); GetDoc()->SetModified(); bRet = sal_True; @@ -584,7 +584,7 @@ sal_Bool SwDocShell::Remove(sal_uInt16 nIdx1, // siehe Insert // dflt. PageDesc und StandardZeichenvorlage nie loeschen !!! if( ( SFX_STYLE_FAMILY_PAGE == eFamily && - const_cast<const SwDoc *>(pDoc)->GetPageDesc(0).GetName() + const_cast<const SwDoc *>(mpDoc)->GetPageDesc(0).GetName() == aName ) || ( SFX_STYLE_FAMILY_CHAR == eFamily && aName == *SwStyleNameMapper::GetTextUINameArray()[ RES_POOLCOLL_STANDARD - @@ -626,7 +626,7 @@ sal_Bool SwDocShell::Remove(sal_uInt16 nIdx1, // siehe Insert // Model geaendert - ASSERT(pDoc, "Doc fehlt"); + ASSERT(mpDoc, "Doc fehlt"); GetDoc()->SetModified(); return bRet; @@ -1030,7 +1030,7 @@ void SwDocShell::Execute(SfxRequest& rReq) xDocSh->DoInitNew( 0 ); sal_Bool bImpress = FN_ABSTRACT_STARIMPRESS == nWhich; - pDoc->Summary( pSmryDoc, nLevel, nPara, bImpress ); + mpDoc->Summary( pSmryDoc, nLevel, nPara, bImpress ); if( bImpress ) { WriterRef xWrt; @@ -1174,24 +1174,24 @@ void SwDocShell::Execute(SfxRequest& rReq) case SID_MAIL_PREPAREEXPORT: { //pWrtShell is not set in page preview - if(pWrtShell) - pWrtShell->StartAllAction(); - pDoc->UpdateFlds( NULL, false ); - pDoc->EmbedAllLinks(); - pDoc->RemoveInvisibleContent(); - if(pWrtShell) - pWrtShell->EndAllAction(); + if(mpWrtShell) + mpWrtShell->StartAllAction(); + mpDoc->UpdateFlds( NULL, false ); + mpDoc->EmbedAllLinks(); + mpDoc->RemoveInvisibleContent(); + if(mpWrtShell) + mpWrtShell->EndAllAction(); } break; case SID_MAIL_EXPORT_FINISHED: { - if(pWrtShell) - pWrtShell->StartAllAction(); + if(mpWrtShell) + mpWrtShell->StartAllAction(); //try to undo the removal of invisible content - pDoc->RestoreInvisibleContent(); - if(pWrtShell) - pWrtShell->EndAllAction(); + mpDoc->RestoreInvisibleContent(); + if(mpWrtShell) + mpWrtShell->EndAllAction(); } break; case FN_NEW_HTML_DOC: @@ -1332,7 +1332,7 @@ void SwDocShell::Execute(SfxRequest& rReq) ///////////////////////////////////////////////////////////////////// bool bOutline[MAXLEVEL] = {false}; - const SwOutlineNodes& rOutlNds = pDoc->GetNodes().GetOutLineNds(); + const SwOutlineNodes& rOutlNds = mpDoc->GetNodes().GetOutLineNds(); if( rOutlNds.Count() ) { int nLevel; @@ -1344,7 +1344,7 @@ void SwDocShell::Execute(SfxRequest& rReq) } } - const sal_uInt16 nStyleCount = pDoc->GetTxtFmtColls()->Count(); + const sal_uInt16 nStyleCount = mpDoc->GetTxtFmtColls()->Count(); Sequence<OUString> aListBoxEntries( MAXLEVEL + nStyleCount); OUString* pEntries = aListBoxEntries.getArray(); sal_Int32 nIdx = 0 ; @@ -1360,7 +1360,7 @@ void SwDocShell::Execute(SfxRequest& rReq) for(sal_uInt16 i = 0; i < nStyleCount; ++i) { SwTxtFmtColl &rTxtColl = - *pDoc->GetTxtFmtColls()->GetObject( i ); + *mpDoc->GetTxtFmtColls()->GetObject( i ); if( !rTxtColl.IsDefault() && rTxtColl.IsAtDocNodeSet() ) { pEntries[nIdx++] = sStyle + rTxtColl.GetName(); @@ -1442,17 +1442,17 @@ void SwDocShell::Execute(SfxRequest& rReq) if ( bCreateByOutlineLevel ) //add by zhaojianwei { bDone = bCreateHtml //#outline level,removed by zhaojianwei - ? pDoc->GenerateHTMLDoc( aFileName, nTemplateOutlineLevel ) - : pDoc->GenerateGlobalDoc( aFileName, nTemplateOutlineLevel ); + ? mpDoc->GenerateHTMLDoc( aFileName, nTemplateOutlineLevel ) + : mpDoc->GenerateGlobalDoc( aFileName, nTemplateOutlineLevel ); } else { const SwTxtFmtColl* pSplitColl = 0; if ( aTemplateName.Len() ) - pSplitColl = pDoc->FindTxtFmtCollByName(aTemplateName); + pSplitColl = mpDoc->FindTxtFmtCollByName(aTemplateName); bDone = bCreateHtml //#outline level,removed by zhaojianwei - ? pDoc->GenerateHTMLDoc( aFileName, pSplitColl ) - : pDoc->GenerateGlobalDoc( aFileName, pSplitColl ); + ? mpDoc->GenerateHTMLDoc( aFileName, pSplitColl ) + : mpDoc->GenerateGlobalDoc( aFileName, pSplitColl ); } //<-end,zhaojianwei if( bDone ) @@ -1514,7 +1514,7 @@ void SwDocShell::Execute(SfxRequest& rReq) pViewShell = pVFrame ? pVFrame->GetViewShell() : 0; pCurrView = dynamic_cast<SwView*>( pViewShell ); } - pDoc->GetNumberFormatter(sal_True)->SetYear2000(nYear2K); + mpDoc->GetNumberFormatter(sal_True)->SetYear2000(nYear2K); } break; @@ -1530,7 +1530,7 @@ void SwDocShell::Execute(SfxRequest& rReq) long SwDocShell::DdeGetData( const String& rItem, const String& rMimeType, uno::Any & rValue ) { - return pDoc->GetData( rItem, rMimeType, rValue ); + return mpDoc->GetData( rItem, rMimeType, rValue ); } @@ -1541,7 +1541,7 @@ long SwDocShell::DdeGetData( const String& rItem, const String& rMimeType, long SwDocShell::DdeSetData( const String& rItem, const String& rMimeType, const uno::Any & rValue ) { - return pDoc->SetData( rItem, rMimeType, rValue ); + return mpDoc->SetData( rItem, rMimeType, rValue ); } @@ -1551,7 +1551,7 @@ long SwDocShell::DdeSetData( const String& rItem, const String& rMimeType, ::sfx2::SvLinkSource* SwDocShell::DdeCreateLinkSource( const String& rItem ) { - return pDoc->CreateLinkSource( rItem ); + return mpDoc->CreateLinkSource( rItem ); } /*-------------------------------------------------------------------- @@ -1592,20 +1592,20 @@ void SwDocShell::SetModified( sal_Bool bSet ) SfxObjectShell::SetModified( bSet ); if( IsEnableSetModified()) { - if (!pDoc->IsInCallModified() ) + if (!mpDoc->IsInCallModified() ) { EnableSetModified( sal_False ); if( bSet ) { - sal_Bool bOld = pDoc->IsModified(); - pDoc->SetModified(); + sal_Bool bOld = mpDoc->IsModified(); + mpDoc->SetModified(); if( !bOld ) { - pDoc->GetIDocumentUndoRedo().SetUndoNoResetModified(); + mpDoc->GetIDocumentUndoRedo().SetUndoNoResetModified(); } } else - pDoc->ResetModified(); + mpDoc->ResetModified(); EnableSetModified( sal_True ); } @@ -1698,7 +1698,7 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView "Loschen des Basics hat nicht geklappt" ); } } - sal_Bool bWasBrowseMode = pDoc->get(IDocumentSettingAccess::BROWSE_MODE); + sal_Bool bWasBrowseMode = mpDoc->get(IDocumentSettingAccess::BROWSE_MODE); RemoveLink(); //jetzt muss auch das UNO-Model ueber das neue Doc informiert werden #51535# @@ -1709,7 +1709,7 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView AddLink(); //#116402# update font list when new document is created UpdateFontList(); - pDoc->set(IDocumentSettingAccess::BROWSE_MODE, bWasBrowseMode); + mpDoc->set(IDocumentSettingAccess::BROWSE_MODE, bWasBrowseMode); pSrcView->SetPool(&GetPool()); @@ -1730,7 +1730,7 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView // the base URL has to be set to the filename of the document <rMedname> // and not to the base URL of the temporary file <aMed> in order to get // the URLs of the linked graphics correctly resolved. - SwReloadFromHtmlReader aReader( aMed, rMedname, pDoc ); + SwReloadFromHtmlReader aReader( aMed, rMedname, mpDoc ); // <-- aReader.Read( *ReadHTML ); @@ -1753,7 +1753,7 @@ void SwDocShell::ReloadFromHtml( const String& rStreamName, SwSrcView* pSrcView if(bModified && !IsReadOnly()) SetModified(); else - pDoc->ResetModified(); + mpDoc->ResetModified(); } sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL, @@ -1819,13 +1819,13 @@ sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL, // insert the styles! if( bUnoCall ) { - SwNodeIndex aIdx( pDoc->GetNodes().GetEndOfContent(), -1 ); + SwNodeIndex aIdx( mpDoc->GetNodes().GetEndOfContent(), -1 ); pPam = new SwPaM( aIdx ); pReader = new SwReader( aMed, rURL, *pPam ); } else { - pReader = new SwReader( aMed, rURL, *pWrtShell->GetCrsr() ); + pReader = new SwReader( aMed, rURL, *mpWrtShell->GetCrsr() ); } pRead->GetReaderOpt().SetTxtFmts( rOpt.IsTxtFmts() ); @@ -1836,14 +1836,14 @@ sal_uLong SwDocShell::LoadStylesFromFile( const String& rURL, if( bUnoCall ) { - UnoActionContext aAction( pDoc ); + UnoActionContext aAction( mpDoc ); nErr = pReader->Read( *pRead ); } else { - pWrtShell->StartAllAction(); + mpWrtShell->StartAllAction(); nErr = pReader->Read( *pRead ); - pWrtShell->EndAllAction(); + mpWrtShell->EndAllAction(); } delete pPam; delete pReader; diff --git a/sw/source/ui/app/docshdrw.cxx b/sw/source/ui/app/docshdrw.cxx index a3764be9a45a..2f1093d7ded7 100644 --- a/sw/source/ui/app/docshdrw.cxx +++ b/sw/source/ui/app/docshdrw.cxx @@ -19,36 +19,20 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include <hintids.hxx> - -#ifndef _SVX_SVXIDS_HRC //autogen #include <svx/svxids.hrc> -#endif - - - - - - - - #include <svl/stritem.hxx> #include <svx/drawitem.hxx> #include <svx/svdmodel.hxx> #include <svx/svdoutl.hxx> #include <svx/xtable.hxx> - -#ifndef _DOCSH_HXX #include <docsh.hxx> -#endif #include <doc.hxx> #include <svx/fmmodel.hxx> +#include <drawdoc.hxx> using namespace ::com::sun::star; @@ -56,26 +40,58 @@ using namespace ::com::sun::star; Beschreibung: Document laden --------------------------------------------------------------------*/ - -void SwDocShell::InitDraw() +void InitDrawModelAndDocShell(SwDocShell* pSwDocShell, SwDrawModel* pSwDrawDocument) { - SdrModel *pDrDoc = pDoc->GetDrawModel(); - if( pDrDoc ) + if(pSwDrawDocument) { - // Listen, bzw. Tables im ItemSet der DocShell anlegen - PutItem( SvxGradientListItem( pDrDoc->GetGradientListFromSdrModel(), SID_GRADIENT_LIST ) ); - PutItem( SvxHatchListItem( pDrDoc->GetHatchListFromSdrModel(), SID_HATCH_LIST ) ); - PutItem( SvxBitmapListItem( pDrDoc->GetBitmapListFromSdrModel(), SID_BITMAP_LIST ) ); - PutItem( SvxDashListItem( pDrDoc->GetDashListFromSdrModel(), SID_DASH_LIST ) ); - PutItem( SvxLineEndListItem( pDrDoc->GetLineEndListFromSdrModel(), SID_LINEEND_LIST ) ); - - Outliner& rOutliner = pDrDoc->GetDrawOutliner(); - uno::Reference<linguistic2::XHyphenator> xHyphenator( ::GetHyphenator() ); - rOutliner.SetHyphenator( xHyphenator ); + if(pSwDocShell == pSwDrawDocument->GetObjectShell()) + { + // association already done, nothing to do + } + else + { + // set object shell (mainly for FormControl stuff), maybe zero + pSwDrawDocument->SetObjectShell(pSwDocShell); + + // set persist, maybe zero + pSwDrawDocument->SetPersist(pSwDocShell); + + // get and decide on the color table to use + if(pSwDocShell) + { + const SvxColorTableItem* pColItemFromDocShell = static_cast< const SvxColorTableItem* >(pSwDocShell->GetItem(SID_COLOR_TABLE)); + + if(pColItemFromDocShell) + { + // the DocShell has a ColorTable, use it also in DrawingLayer + pSwDrawDocument->SetColorTableAtSdrModel(pColItemFromDocShell->GetColorTable()); + } + else + { + // Use the ColorTable which is used at the DrawingLayer's SdrModel + pSwDocShell->PutItem(SvxColorTableItem(pSwDrawDocument->GetColorTableFromSdrModel(), SID_COLOR_TABLE)); + } + + // add other tables in SfxItemSet of the DocShell + pSwDocShell->PutItem(SvxGradientListItem(pSwDrawDocument->GetGradientListFromSdrModel(), SID_GRADIENT_LIST)); + pSwDocShell->PutItem(SvxHatchListItem(pSwDrawDocument->GetHatchListFromSdrModel(), SID_HATCH_LIST)); + pSwDocShell->PutItem(SvxBitmapListItem(pSwDrawDocument->GetBitmapListFromSdrModel(), SID_BITMAP_LIST)); + pSwDocShell->PutItem(SvxDashListItem(pSwDrawDocument->GetDashListFromSdrModel(), SID_DASH_LIST)); + pSwDocShell->PutItem(SvxLineEndListItem(pSwDrawDocument->GetLineEndListFromSdrModel(), SID_LINEEND_LIST)); + } + + // init hyphenator for DrawingLayer outliner + uno::Reference<linguistic2::XHyphenator> xHyphenator(::GetHyphenator()); + Outliner& rOutliner = pSwDrawDocument->GetDrawOutliner(); + + rOutliner.SetHyphenator(xHyphenator); + } + } + else if(pSwDocShell) + { + // fallback: add the default color list to have one when someone requests it from the DocShell + pSwDocShell->PutItem(SvxColorTableItem(XColorList::GetStdColorList(), SID_COLOR_TABLE)); } - else - PutItem( SvxColorTableItem( XColorList::GetStdColorList(), SID_COLOR_TABLE )); } - - +//eof diff --git a/sw/source/ui/app/docshini.cxx b/sw/source/ui/app/docshini.cxx index 9591bc7bb9cf..3cdd059f7854 100644 --- a/sw/source/ui/app/docshini.cxx +++ b/sw/source/ui/app/docshini.cxx @@ -137,7 +137,7 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) RES_PARATR_TABSTOP)); */ if ( GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) - SwTransferable::InitOle( this, *pDoc ); + SwTransferable::InitOle( this, *mpDoc ); // set forbidden characters if necessary SvxAsianConfig aAsian; @@ -150,20 +150,20 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) ForbiddenCharacters aForbidden; aAsian.GetStartEndChars( pLocales[i], aForbidden.beginLine, aForbidden.endLine); LanguageType eLang = SvxLocaleToLanguage(pLocales[i]); - pDoc->setForbiddenCharacters( eLang, aForbidden); + mpDoc->setForbiddenCharacters( eLang, aForbidden); } } - pDoc->set(IDocumentSettingAccess::KERN_ASIAN_PUNCTUATION, + mpDoc->set(IDocumentSettingAccess::KERN_ASIAN_PUNCTUATION, !aAsian.IsKerningWesternTextOnly()); - pDoc->setCharacterCompressionType(static_cast<SwCharCompressType>(aAsian.GetCharDistanceCompression())); - pDoc->setPrintData(*SW_MOD()->GetPrtOptions(bWeb)); + mpDoc->setCharacterCompressionType(static_cast<SwCharCompressType>(aAsian.GetCharDistanceCompression())); + mpDoc->setPrintData(*SW_MOD()->GetPrtOptions(bWeb)); SubInitNew(); // fuer alle SwStdFontConfig* pStdFont = SW_MOD()->GetStdFontConfig(); - SfxPrinter* pPrt = pDoc->getPrinter( false ); + SfxPrinter* pPrt = mpDoc->getPrinter( false ); String sEntry; sal_uInt16 aFontWhich[] = @@ -201,7 +201,7 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) sal_uInt16 nFontWhich = aFontWhich[i]; sal_uInt16 nFontId = aFontIds[i]; SvxFontItem* pFontItem = 0; - const SvxLanguageItem& rLang = (const SvxLanguageItem&)pDoc->GetDefault( aLangTypes[i] ); + const SvxLanguageItem& rLang = (const SvxLanguageItem&)mpDoc->GetDefault( aLangTypes[i] ); LanguageType eLanguage = rLang.GetLanguage(); if(!pStdFont->IsFontDefault(nFontId)) { @@ -238,20 +238,20 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) pFontItem = new SvxFontItem(aLangDefFont.GetFamily(), aLangDefFont.GetName(), aEmptyStr, aLangDefFont.GetPitch(), aLangDefFont.GetCharSet(), nFontWhich); } - pDoc->SetDefault(*pFontItem); + mpDoc->SetDefault(*pFontItem); if( !bHTMLTemplSet ) { - SwTxtFmtColl *pColl = pDoc->GetTxtCollFromPool(RES_POOLCOLL_STANDARD); + SwTxtFmtColl *pColl = mpDoc->GetTxtCollFromPool(RES_POOLCOLL_STANDARD); pColl->ResetFmtAttr(nFontWhich); } delete pFontItem; sal_Int32 nFontHeight = pStdFont->GetFontHeight( FONT_STANDARD, i, eLanguage ); if(nFontHeight <= 0) nFontHeight = pStdFont->GetDefaultHeightFor( nFontId, eLanguage ); - pDoc->SetDefault(SvxFontHeightItem( nFontHeight, 100, aFontHeightWhich[i] )); + mpDoc->SetDefault(SvxFontHeightItem( nFontHeight, 100, aFontHeightWhich[i] )); if( !bHTMLTemplSet ) { - SwTxtFmtColl *pColl = pDoc->GetTxtCollFromPool(RES_POOLCOLL_STANDARD); + SwTxtFmtColl *pColl = mpDoc->GetTxtCollFromPool(RES_POOLCOLL_STANDARD); pColl->ResetFmtAttr(aFontHeightWhich[i]); } @@ -274,20 +274,20 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) sal_uInt16 nFontWhich = RES_CHRATR_FONT; sal_uInt16 nFontHeightWhich = RES_CHRATR_FONTSIZE; - LanguageType eLanguage = static_cast<const SvxLanguageItem&>(pDoc->GetDefault( RES_CHRATR_LANGUAGE )).GetLanguage(); + LanguageType eLanguage = static_cast<const SvxLanguageItem&>(mpDoc->GetDefault( RES_CHRATR_LANGUAGE )).GetLanguage(); for(sal_uInt8 nIdx = 0; nIdx < 24; nIdx += 2) { if(nIdx == 8) { nFontWhich = RES_CHRATR_CJK_FONT; nFontHeightWhich = RES_CHRATR_CJK_FONTSIZE; - eLanguage = static_cast<const SvxLanguageItem&>(pDoc->GetDefault( RES_CHRATR_CJK_LANGUAGE )).GetLanguage(); + eLanguage = static_cast<const SvxLanguageItem&>(mpDoc->GetDefault( RES_CHRATR_CJK_LANGUAGE )).GetLanguage(); } else if(nIdx == 16) { nFontWhich = RES_CHRATR_CTL_FONT; nFontHeightWhich = RES_CHRATR_CTL_FONTSIZE; - eLanguage = static_cast<const SvxLanguageItem&>(pDoc->GetDefault( RES_CHRATR_CTL_LANGUAGE )).GetLanguage(); + eLanguage = static_cast<const SvxLanguageItem&>(mpDoc->GetDefault( RES_CHRATR_CTL_LANGUAGE )).GetLanguage(); } SwTxtFmtColl *pColl = 0; if(!pStdFont->IsFontDefault(aFontIdPoolId[nIdx])) @@ -298,7 +298,7 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) if( pPrt ) aFont = pPrt->GetFontMetric( aFont ); - pColl = pDoc->GetTxtCollFromPool(aFontIdPoolId[nIdx + 1]); + pColl = mpDoc->GetTxtCollFromPool(aFontIdPoolId[nIdx + 1]); if( !bHTMLTemplSet || SFX_ITEM_SET != pColl->GetAttrSet().GetItemState( nFontWhich, sal_False ) ) @@ -311,7 +311,7 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) if(nFontHeight <= 0) nFontHeight = pStdFont->GetDefaultHeightFor( aFontIdPoolId[nIdx], eLanguage ); if(!pColl) - pColl = pDoc->GetTxtCollFromPool(aFontIdPoolId[nIdx + 1]); + pColl = mpDoc->GetTxtCollFromPool(aFontIdPoolId[nIdx + 1]); SvxFontHeightItem aFontHeight( (const SvxFontHeightItem&)pColl->GetFmtAttr( nFontHeightWhich, sal_True )); if(aFontHeight.GetHeight() != sal::static_int_cast<sal_uInt32, sal_Int32>(nFontHeight)) { @@ -323,7 +323,7 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) // the default for documents created via 'File/New' should be 'on' // (old documents, where this property was not yet implemented, will get the // value 'false' in the SwDoc c-tor) - pDoc->set( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT, + mpDoc->set( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT, SW_MOD()->GetUsrPref( bWeb )->IsAlignMathObjectsToBaseline() ); } @@ -331,26 +331,26 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) the default adjusment is to the right. */ if( !bHTMLTemplSet && FRMDIR_HORI_RIGHT_TOP == GetDefaultFrameDirection(GetAppLanguage()) ) - pDoc->SetDefault( SvxAdjustItem(SVX_ADJUST_RIGHT, RES_PARATR_ADJUST ) ); + mpDoc->SetDefault( SvxAdjustItem(SVX_ADJUST_RIGHT, RES_PARATR_ADJUST ) ); // OD 09.10.2003 #i18732# - set dynamic pool default for // item RES_FOLLOW_TEXT_FLOW to sal_False for *new document*. // Thus, redo this change in method <SwDoc::RemoveAllFmtLanguageDependencies()>, // which is called from <SwDocShell::ConvertFrom(..)> in order to restore // the static pool default. - pDoc->SetDefault( SwFmtFollowTextFlow( sal_False ) ); + mpDoc->SetDefault( SwFmtFollowTextFlow( sal_False ) ); // --> collapsing borders FME 2005-05-27 #i29550# - pDoc->SetDefault( SfxBoolItem( RES_COLLAPSING_BORDERS, sal_True ) ); + mpDoc->SetDefault( SfxBoolItem( RES_COLLAPSING_BORDERS, sal_True ) ); // <-- collapsing //#i16874# AutoKerning as default for new documents - pDoc->SetDefault( SvxAutoKernItem( sal_True, RES_CHRATR_AUTOKERN ) ); + mpDoc->SetDefault( SvxAutoKernItem( sal_True, RES_CHRATR_AUTOKERN ) ); // --> OD 2005-02-10 #i42080# - Due to the several calls of method <SetDefault(..)> // at the document instance, the document is modified. Thus, reset this // status here. Note: In method <SubInitNew()> this is also done. - pDoc->ResetModified(); + mpDoc->ResetModified(); // <-- return bRet; @@ -363,13 +363,13 @@ sal_Bool SwDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor ) SwDocShell::SwDocShell( SfxObjectCreateMode eMode ) : SfxObjectShell ( eMode ), - pDoc(0), - pFontList(0), - pView( 0 ), - pWrtShell( 0 ), - pOLEChildList( 0 ), - nUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG), - bInUpdateFontList(false) + mpDoc(0), + mpFontList(0), + mpView( 0 ), + mpWrtShell( 0 ), + mpOLEChildList( 0 ), + mnUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG), + mbInUpdateFontList(false) { RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDocShell::SwDocShell" ); Init_Impl(); @@ -382,13 +382,13 @@ SwDocShell::SwDocShell( SfxObjectCreateMode eMode ) : SwDocShell::SwDocShell( const sal_uInt64 i_nSfxCreationFlags ) : SfxObjectShell ( i_nSfxCreationFlags ), - pDoc(0), - pFontList(0), - pView( 0 ), - pWrtShell( 0 ), - pOLEChildList( 0 ), - nUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG), - bInUpdateFontList(false) + mpDoc(0), + mpFontList(0), + mpView( 0 ), + mpWrtShell( 0 ), + mpOLEChildList( 0 ), + mnUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG), + mbInUpdateFontList(false) { RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDocShell::SwDocShell" ); Init_Impl(); @@ -401,13 +401,13 @@ SwDocShell::SwDocShell( const sal_uInt64 i_nSfxCreationFlags ) : SwDocShell::SwDocShell( SwDoc *pD, SfxObjectCreateMode eMode ): SfxObjectShell ( eMode ), - pDoc(pD), - pFontList(0), - pView( 0 ), - pWrtShell( 0 ), - pOLEChildList( 0 ), - nUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG), - bInUpdateFontList(false) + mpDoc(pD), + mpFontList(0), + mpView( 0 ), + mpWrtShell( 0 ), + mpOLEChildList( 0 ), + mnUpdateDocMode(document::UpdateDocMode::ACCORDING_TO_CONFIG), + mbInUpdateFontList(false) { RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDocShell::SwDocShell" ); Init_Impl(); @@ -421,22 +421,22 @@ SwDocShell::SwDocShell( SwDoc *pD, SfxObjectCreateMode eMode ): SwDocShell::~SwDocShell() { // disable chart related objects now because in ~SwDoc it may be to late for this - if( pDoc ) + if( mpDoc ) { - pDoc->GetChartControllerHelper().Disconnect(); - SwChartDataProvider *pPCD = pDoc->GetChartDataProvider(); + mpDoc->GetChartControllerHelper().Disconnect(); + SwChartDataProvider *pPCD = mpDoc->GetChartDataProvider(); if (pPCD) pPCD->dispose(); } RemoveLink(); - delete pFontList; + delete mpFontList; // wir als BroadCaster werden auch unser eigener Listener // (fuer DocInfo/FileNamen/....) EndListening( *this ); - delete pOLEChildList; + delete mpOLEChildList; } /* -----------------------------10.09.2001 15:59------------------------------ @@ -461,23 +461,23 @@ void SwDocShell::Init_Impl() void SwDocShell::AddLink() { - if( !pDoc ) + if( !mpDoc ) { SwDocFac aFactory; - pDoc = aFactory.GetDoc(); - pDoc->acquire(); - pDoc->set(IDocumentSettingAccess::HTML_MODE, dynamic_cast< SwWebDocShell* >(this) ); + mpDoc = aFactory.GetDoc(); + mpDoc->acquire(); + mpDoc->set(IDocumentSettingAccess::HTML_MODE, dynamic_cast< SwWebDocShell* >(this) ); } else - pDoc->acquire(); - pDoc->SetDocShell( this ); // am Doc den DocShell-Pointer setzen + mpDoc->acquire(); + mpDoc->SetDocShell( this ); // am Doc den DocShell-Pointer setzen uno::Reference< text::XTextDocument > xDoc(GetBaseModel(), uno::UNO_QUERY); ((SwXTextDocument*)xDoc.get())->Reactivate(this); - SetPool(&pDoc->GetAttrPool()); + SetPool(&mpDoc->GetAttrPool()); // am besten erst wenn eine sdbcx::View erzeugt wird !!! - pDoc->SetOle2Link(LINK(this, SwDocShell, Ole2ModifiedHdl)); + mpDoc->SetOle2Link(LINK(this, SwDocShell, Ole2ModifiedHdl)); } /*-------------------------------------------------------------------- @@ -487,17 +487,17 @@ void SwDocShell::AddLink() void SwDocShell::UpdateFontList() { - if(!bInUpdateFontList) + if(!mbInUpdateFontList) { - bInUpdateFontList = true; - ASSERT(pDoc, "Kein Doc keine FontList"); - if( pDoc ) + mbInUpdateFontList = true; + ASSERT(mpDoc, "Kein Doc keine FontList"); + if( mpDoc ) { - delete pFontList; - pFontList = new FontList( pDoc->getReferenceDevice( true ) ); - PutItem( SvxFontListItem( pFontList, SID_ATTR_CHAR_FONTLIST ) ); + delete mpFontList; + mpFontList = new FontList( mpDoc->getReferenceDevice( true ) ); + PutItem( SvxFontListItem( mpFontList, SID_ATTR_CHAR_FONTLIST ) ); } - bInUpdateFontList = false; + mbInUpdateFontList = false; } } @@ -512,19 +512,19 @@ void SwDocShell::RemoveLink() uno::Reference< text::XTextDocument > xDoc(GetBaseModel(), uno::UNO_QUERY); ((SwXTextDocument*)xDoc.get())->Invalidate(); aFinishedTimer.Stop(); - if(pDoc) + if(mpDoc) { if( mxBasePool.is() ) { static_cast<SwDocStyleSheetPool*>(mxBasePool.get())->dispose(); mxBasePool.clear(); } - sal_Int8 nRefCt = static_cast< sal_Int8 >(pDoc->release()); - pDoc->SetOle2Link(Link()); - pDoc->SetDocShell( 0 ); + sal_Int8 nRefCt = static_cast< sal_Int8 >(mpDoc->release()); + mpDoc->SetOle2Link(Link()); + mpDoc->SetDocShell( 0 ); if( !nRefCt ) - delete pDoc; - pDoc = 0; // wir haben das Doc nicht mehr !! + delete mpDoc; + mpDoc = 0; // wir haben das Doc nicht mehr !! } } void SwDocShell::InvalidateModel() @@ -552,7 +552,7 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium ) if( SfxObjectShell::Load( rMedium )) { RTL_LOGFILE_CONTEXT_TRACE( aLog, "after SfxInPlaceObject::Load" ); - if( pDoc ) // fuer Letzte Version !! + if( mpDoc ) // fuer Letzte Version !! RemoveLink(); // das existierende Loslassen AddLink(); // Link setzen und Daten updaten !! @@ -560,11 +560,11 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium ) // Das Laden // fuer MD ASSERT( !mxBasePool.is(), "wer hat seinen Pool nicht zerstoert?" ); - mxBasePool = new SwDocStyleSheetPool( *pDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() ); + mxBasePool = new SwDocStyleSheetPool( *mpDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() ); if(GetCreateMode() != SFX_CREATE_MODE_ORGANIZER) { SFX_ITEMSET_ARG( rMedium.GetItemSet(), pUpdateDocItem, SfxUInt16Item, SID_UPDATEDOCMODE ); - nUpdateDocMode = pUpdateDocItem ? pUpdateDocItem->GetValue() : document::UpdateDocMode::NO_UPDATE; + mnUpdateDocMode = pUpdateDocItem ? pUpdateDocItem->GetValue() : document::UpdateDocMode::NO_UPDATE; } SwWait aWait( *this, true ); @@ -580,7 +580,7 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium ) if( ReadXML ) { ReadXML->SetOrganizerMode( sal_True ); - SwReader aRdr( rMedium, aEmptyStr, pDoc ); + SwReader aRdr( rMedium, aEmptyStr, mpDoc ); nErr = aRdr.Read( *ReadXML ); ReadXML->SetOrganizerMode( sal_False ); } @@ -591,7 +591,7 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium ) case SFX_CREATE_MODE_EMBEDDED: { // fuer MWERKS (Mac-Compiler): kann nicht selbststaendig casten - SwTransferable::InitOle( this, *pDoc ); + SwTransferable::InitOle( this, *mpDoc ); } // SfxProgress unterdruecken, wenn man Embedded ist SW_MOD()->SetEmbeddedLoadSave( sal_True ); @@ -605,7 +605,7 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium ) { // die DocInfo vom Doc am DocShell-Medium setzen RTL_LOGFILE_CONTEXT_TRACE( aLog, "before ReadDocInfo" ); - SwReader aRdr( rMedium, aEmptyStr, pDoc ); + SwReader aRdr( rMedium, aEmptyStr, mpDoc ); RTL_LOGFILE_CONTEXT_TRACE( aLog, "before Read" ); nErr = aRdr.Read( *pReader ); RTL_LOGFILE_CONTEXT_TRACE( aLog, "after Read" ); @@ -615,13 +615,13 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium ) // by this formats. if( dynamic_cast< SwWebDocShell* >(this) ) { - if( !pDoc->get(IDocumentSettingAccess::HTML_MODE) ) - pDoc->set(IDocumentSettingAccess::HTML_MODE, true); + if( !mpDoc->get(IDocumentSettingAccess::HTML_MODE) ) + mpDoc->set(IDocumentSettingAccess::HTML_MODE, true); } if( dynamic_cast< SwGlobalDocShell* >(this) ) { - if( !pDoc->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) ) - pDoc->set(IDocumentSettingAccess::GLOBAL_DOCUMENT, true); + if( !mpDoc->get(IDocumentSettingAccess::GLOBAL_DOCUMENT) ) + mpDoc->set(IDocumentSettingAccess::GLOBAL_DOCUMENT, true); } } #ifdef DBG_UTIL @@ -637,7 +637,7 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium ) } UpdateFontList(); - InitDraw(); + InitDrawModelAndDocShell(this, mpDoc ? mpDoc->GetDrawModel() : 0); SetError( nErr, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) ); bRet = !IsError( nErr ); @@ -647,7 +647,7 @@ sal_Bool SwDocShell::Load( SfxMedium& rMedium ) // if( bRet && !pDoc->IsInLoadAsynchron() && // GetCreateMode() == SFX_CREATE_MODE_STANDARD ) // StartLoadFinishedTimer(); - if ( bRet && !pDoc->IsInLoadAsynchron() && + if ( bRet && !mpDoc->IsInLoadAsynchron() && GetCreateMode() == SFX_CREATE_MODE_STANDARD ) { LoadingFinished(); @@ -670,7 +670,7 @@ sal_Bool SwDocShell::LoadFrom( SfxMedium& rMedium ) { RTL_LOGFILE_CONTEXT_AUTHOR( aLog, "SW", "JP93722", "SwDocShell::LoadFrom" ); sal_Bool bRet = sal_False; - if( pDoc ) + if( mpDoc ) RemoveLink(); AddLink(); // Link setzen und Daten updaten !! @@ -687,11 +687,11 @@ sal_Bool SwDocShell::LoadFrom( SfxMedium& rMedium ) SwWait aWait( *this, true ); { ASSERT( !mxBasePool.is(), "wer hat seinen Pool nicht zerstoert?" ); - mxBasePool = new SwDocStyleSheetPool( *pDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() ); + mxBasePool = new SwDocStyleSheetPool( *mpDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() ); if( ReadXML ) { ReadXML->SetOrganizerMode( sal_True ); - SwReader aRdr( rMedium, aEmptyStr, pDoc ); + SwReader aRdr( rMedium, aEmptyStr, mpDoc ); nErr = aRdr.Read( *ReadXML ); ReadXML->SetOrganizerMode( sal_False ); } @@ -726,7 +726,7 @@ sal_Bool SwDocShell::LoadFrom( SfxMedium& rMedium ) } while( sal_False ); SfxObjectShell::LoadFrom( rMedium ); - pDoc->ResetModified(); + mpDoc->ResetModified(); return bRet; } @@ -734,12 +734,12 @@ sal_Bool SwDocShell::LoadFrom( SfxMedium& rMedium ) void SwDocShell::SubInitNew() { ASSERT( !mxBasePool.is(), "wer hat seinen Pool nicht zerstoert?" ); - mxBasePool = new SwDocStyleSheetPool( *pDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() ); + mxBasePool = new SwDocStyleSheetPool( *mpDoc, SFX_CREATE_MODE_ORGANIZER == GetCreateMode() ); UpdateFontList(); - InitDraw(); + InitDrawModelAndDocShell(this, mpDoc ? mpDoc->GetDrawModel() : 0); - pDoc->setLinkUpdateMode( GLOBALSETTING ); - pDoc->setFieldUpdateFlags( AUTOUPD_GLOBALSETTING ); + mpDoc->setLinkUpdateMode( GLOBALSETTING ); + mpDoc->setFieldUpdateFlags( AUTOUPD_GLOBALSETTING ); const bool bWeb(dynamic_cast< SwWebDocShell* >(this)); @@ -755,7 +755,7 @@ void SwDocShell::SubInitNew() nRange[ (sizeof(nRange)/sizeof(nRange[0])) - 3 ] = RES_PARATR_TABSTOP; nRange[ (sizeof(nRange)/sizeof(nRange[0])) - 2 ] = RES_PARATR_HYPHENZONE; } - SfxItemSet aDfltSet( pDoc->GetAttrPool(), nRange ); + SfxItemSet aDfltSet( mpDoc->GetAttrPool(), nRange ); //! get lingu options without loading lingu DLL SvtLinguOptions aLinguOpt; @@ -771,7 +771,7 @@ void SwDocShell::SubInitNew() if(!bWeb) { - SvxHyphenZoneItem aHyp( (SvxHyphenZoneItem&) pDoc->GetDefault( + SvxHyphenZoneItem aHyp( (SvxHyphenZoneItem&) mpDoc->GetDefault( RES_PARATR_HYPHENZONE) ); aHyp.GetMinLead() = static_cast< sal_uInt8 >(aLinguOpt.nHyphMinLeading); aHyp.GetMinTrail() = static_cast< sal_uInt8 >(aLinguOpt.nHyphMinTrailing); @@ -785,21 +785,21 @@ void SwDocShell::SubInitNew() } aDfltSet.Put( SvxColorItem( Color( COL_AUTO ), RES_CHRATR_COLOR ) ); - pDoc->SetDefault( aDfltSet ); + mpDoc->SetDefault( aDfltSet ); //default page mode for text grid if(!bWeb) { sal_Bool bSquaredPageMode = SW_MOD()->GetUsrPref(sal_False)->IsSquaredPageMode(); - pDoc->SetDefaultPageMode( bSquaredPageMode ); + mpDoc->SetDefaultPageMode( bSquaredPageMode ); } - pDoc->ResetModified(); + mpDoc->ResetModified(); } /* * Document Interface Access */ -IDocumentDeviceAccess* SwDocShell::getIDocumentDeviceAccess() { return pDoc; } -const IDocumentSettingAccess* SwDocShell::getIDocumentSettingAccess() const { return pDoc; } -IDocumentChartDataProviderAccess* SwDocShell::getIDocumentChartDataProviderAccess() { return pDoc; } +IDocumentDeviceAccess* SwDocShell::getIDocumentDeviceAccess() { return mpDoc; } +const IDocumentSettingAccess* SwDocShell::getIDocumentSettingAccess() const { return mpDoc; } +IDocumentChartDataProviderAccess* SwDocShell::getIDocumentChartDataProviderAccess() { return mpDoc; } diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx index b4ff235e7f8e..f01db878d514 100644 --- a/sw/source/ui/app/docst.cxx +++ b/sw/source/ui/app/docst.cxx @@ -19,15 +19,12 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/container/XNameAccess.hpp> - #include <hintids.hxx> #include <sfx2/app.hxx> #include <svl/whiter.hxx> @@ -43,6 +40,7 @@ #include <svl/languageoptions.hxx> #include <editeng/eeitem.hxx> #include <svx/htmlmode.hxx> +#include <svx/xdef.hxx> #include <swmodule.hxx> #include <wdocsh.hxx> #include <fmtfsize.hxx> @@ -52,7 +50,8 @@ #include <SwRewriter.hxx> #include <numrule.hxx> #include <swundo.hxx> - +#include <svx/svdmodel.hxx> +#include <svx/drawitem.hxx> #include "view.hxx" #include "wrtsh.hxx" #include "docsh.hxx" @@ -74,15 +73,12 @@ #include "swevent.hxx" #include "edtwin.hxx" #include "unochart.hxx" - #include "app.hrc" #include <fmtui.hrc> #include "swabstdlg.hxx" -// --> OD 2008-03-27 #refactorlists# #include <list.hxx> -// <-- - #include <paratr.hxx> //#outline level,add by zhaojianwei +#include <drawdoc.hxx> using namespace ::com::sun::star; @@ -163,7 +159,7 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh) 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 +185,7 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh) case SID_STYLE_FAMILY3: - if( pDoc->get(IDocumentSettingAccess::HTML_MODE) ) + if( mpDoc->get(IDocumentSettingAccess::HTML_MODE) ) rSet.DisableItem( nWhich ); else { @@ -205,7 +201,7 @@ void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh) 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 +427,14 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq ) 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(); } @@ -508,10 +504,6 @@ void SwDocShell::ExecStyleSheet( SfxRequest& rReq ) Beschreibung: Edit --------------------------------------------------------------------*/ -//UUUU -//#include <svx/svdmodel.hxx> -//#include <svx/drawitem.hxx> - sal_uInt16 SwDocShell::Edit( const String &rName, const String &rParent, @@ -526,7 +518,7 @@ sal_uInt16 SwDocShell::Edit( SfxStyleSheetBase *pStyle = 0; sal_uInt16 nRet = nMask; - sal_Bool bModified = pDoc->IsModified(); + sal_Bool bModified = mpDoc->IsModified(); if( bNew ) { @@ -545,17 +537,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 @@ -566,12 +557,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() ); @@ -582,12 +572,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 ); @@ -595,7 +585,7 @@ sal_uInt16 SwDocShell::Edit( } else { - SwCharFmt* pCFmt = pWrtShell->GetCurCharFmt(); + SwCharFmt* pCFmt = mpWrtShell->GetCurCharFmt(); pDStyle->GetCharFmt()->SetDerivedFrom( pCFmt ); if( pCFmt ) pDStyle->PresetParent( pCFmt->GetName() ); @@ -606,12 +596,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 ); @@ -667,29 +657,29 @@ sal_uInt16 SwDocShell::Edit( rSet.Put( aTmpBrush ); } } - if (!bBasic) + + if(SFX_STYLE_FAMILY_PAGE == nFamily || SFX_STYLE_FAMILY_PARA == nFamily) { - //UUUU - //if(SFX_STYLE_FAMILY_FRAME == nFamily) - //{ - // //UUUU create needed items for XPropertyList entries from the DrawModel so that - // // the Area TabPage can access them - // SfxItemSet& rSet = xTmp->GetItemSet(); - // const SdrModel* pDrawModel = GetDoc()->GetDrawModel(); - // - // rSet.Put(SvxColorTableItem(pDrawModel->GetColorTableFromSdrModel(), SID_COLOR_TABLE)); - // rSet.Put(SvxGradientListItem(pDrawModel->GetGradientListFromSdrModel(), SID_GRADIENT_LIST)); - // rSet.Put(SvxHatchListItem(pDrawModel->GetHatchListFromSdrModel(), SID_HATCH_LIST)); - // rSet.Put(SvxBitmapListItem(pDrawModel->GetBitmapListFromSdrModel(), SID_BITMAP_LIST)); - //} + //UUUU create needed items for XPropertyList entries from the DrawModel so that + // the Area TabPage can access them + SfxItemSet& rSet = xTmp->GetItemSet(); + const SwDrawModel* pDrawModel = GetDoc()->GetDrawModel(); + + rSet.Put(SvxColorTableItem(pDrawModel->GetColorTableFromSdrModel(), SID_COLOR_TABLE)); + rSet.Put(SvxGradientListItem(pDrawModel->GetGradientListFromSdrModel(), SID_GRADIENT_LIST)); + rSet.Put(SvxHatchListItem(pDrawModel->GetHatchListFromSdrModel(), SID_HATCH_LIST)); + rSet.Put(SvxBitmapListItem(pDrawModel->GetBitmapListFromSdrModel(), SID_BITMAP_LIST)); + } + if (!bBasic) + { // vor dem Dialog wird der HtmlMode an der DocShell versenkt sal_uInt16 nHtmlMode = ::GetHtmlMode(this); // 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 ) ); @@ -701,7 +691,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()) { @@ -735,7 +725,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 ) @@ -751,24 +741,31 @@ sal_uInt16 SwDocShell::Edit( aTmpSet.ClearItem( RES_BACKGROUND ); } - //UUUU - if(bNew && SFX_STYLE_FAMILY_FRAME == nFamily) - { - // clear FillStyle so that it works as a derived attribute - aTmpSet.ClearItem(XATTR_FILLSTYLE); - } - xTmp->SetItemSet( aTmpSet ); if( SFX_STYLE_FAMILY_PAGE == nFamily && SvtLanguageOptions().IsCTLFontEnabled() ) { 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 ); } } + + //UUUU + if(bNew) + { + if(SFX_STYLE_FAMILY_FRAME == nFamily || SFX_STYLE_FAMILY_PARA == nFamily) + { + // clear FillStyle so that it works as a derived attribute + SfxItemSet aTmpSet(*pDlg->GetOutputItemSet()); + + aTmpSet.ClearItem(XATTR_FILLSTYLE); + xTmp->SetItemSet(aTmpSet); + } + } + if(SFX_STYLE_FAMILY_PAGE == nFamily) - pView->InvalidateRulerPos(); + mpView->InvalidateRulerPos(); if( bNew ) mxBasePool->Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_CREATED, *xTmp.get() ) ); @@ -779,10 +776,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(); @@ -794,11 +791,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; } } @@ -839,15 +836,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(); } @@ -910,11 +907,8 @@ sal_uInt16 SwDocShell::ApplyStyles( } 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. + // 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: @@ -931,14 +925,9 @@ sal_uInt16 SwDocShell::ApplyStyles( 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; } @@ -960,7 +949,7 @@ sal_uInt16 SwDocShell::DoWaterCan(const String &rName, sal_uInt16 nFamily) { 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() ) @@ -1002,7 +991,7 @@ sal_uInt16 SwDocShell::DoWaterCan(const String &rName, sal_uInt16 nFamily) aTemplate.eType = 0; // Template anwenden - pView->GetEditWin().SetApplyTemplate(aTemplate); + mpView->GetEditWin().SetApplyTemplate(aTemplate); return nFamily; } @@ -1296,22 +1285,22 @@ void SwDocShell::_LoadStyles( SfxObjectShell& rSource, sal_Bool bPreserveCurrent // 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(); } } } diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx index 5566b8c6e8aa..4551b214e7d0 100644 --- a/sw/source/ui/app/docstyle.cxx +++ b/sw/source/ui/app/docstyle.cxx @@ -19,23 +19,19 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" #define _SVSTDARR_USHORTS - #include <svl/smplhint.hxx> #include <hintids.hxx> #include <svl/itemiter.hxx> #include <svl/eitem.hxx> +#include <svx/xdef.hxx> #include <unotools/syslocale.hxx> #include <editeng/boxitem.hxx> #include <editeng/numitem.hxx> -// --> OD 2008-02-13 #newlistlevelattrs# #include <editeng/lrspitem.hxx> -// <-- #include <fmtcol.hxx> #include <uitool.hxx> #include <swmodule.hxx> @@ -65,6 +61,11 @@ #include <svx/svxids.hrc> #include <SwRewriter.hxx> #include <svx/fmmodel.hxx> +#include <svx/xfillit0.hxx> +#include <svx/xflftrit.hxx> +#include <svx/svdmodel.hxx> +#include <svx/drawitem.hxx> +#include <drawdoc.hxx> // MD 06.02.95: Die Formatnamen in der Liste aller Namen haben als // erstes Zeichen die Familie: @@ -663,6 +664,11 @@ String SwDocStyleSheet::GetDescription(SfxMapUnit eUnit) sal_Bool bHasCJKFontPrefix = sal_False; SvtCJKOptions aCJKOptions; + //UUUU Get currently used FillStyle and remember, also need the XFillFloatTransparenceItem + // to decide if gradient transparence is used + const XFillStyle eFillStyle(static_cast< const XFillStyleItem& >(pSet->Get(XATTR_FILLSTYLE)).GetValue()); + const bool bUseFloatTransparence(static_cast< const XFillFloatTransparenceItem& >(pSet->Get(XATTR_FILLFLOATTRANSPARENCE)).IsEnabled()); + while ( pItem ) { if(!IsInvalidItem(pItem)) @@ -689,6 +695,44 @@ String SwDocStyleSheet::GetDescription(SfxMapUnit eUnit) sal_Bool bIsDefault = sal_False; switch ( pItem->Which() ) { + //UUUU + case XATTR_FILLCOLOR: + { + // only use active FillStyle information + bIsDefault = (XFILL_SOLID == eFillStyle); + break; + } + case XATTR_FILLGRADIENT: + { + // only use active FillStyle information + bIsDefault = (XFILL_GRADIENT == eFillStyle); + break; + } + case XATTR_FILLHATCH: + { + // only use active FillStyle information + bIsDefault = (XFILL_HATCH == eFillStyle); + break; + } + case XATTR_FILLBITMAP: + { + // only use active FillStyle information + bIsDefault = (XFILL_BITMAP == eFillStyle); + break; + } + case XATTR_FILLTRANSPARENCE: + { + // only active when not FloatTransparence + bIsDefault = !bUseFloatTransparence; + break; + } + case XATTR_FILLFLOATTRANSPARENCE: + { + // only active when FloatTransparence + bIsDefault = bUseFloatTransparence; + break; + } + case SID_ATTR_PARA_PAGENUM: sPageNum = aItemPresentation; break; @@ -1023,10 +1067,6 @@ sal_Bool SwDocStyleSheet::SetFollow( const String& rStr) Beschreibung: ueber Name und Family, Mask den ItemSet rausholen --------------------------------------------------------------------*/ -//UUUU -#include <svx/svdmodel.hxx> -#include <svx/drawitem.hxx> - SfxItemSet& SwDocStyleSheet::GetItemSet() { if(!bPhysical) @@ -1072,7 +1112,7 @@ SfxItemSet& SwDocStyleSheet::GetItemSet() //UUUU create needed items for XPropertyList entries from the DrawModel so that // the Area TabPage can access them - const SdrModel* pDrawModel = rDoc.GetDrawModel(); + const SwDrawModel* pDrawModel = rDoc.GetDrawModel(); aCoreSet.Put(SvxColorTableItem(pDrawModel->GetColorTableFromSdrModel(), SID_COLOR_TABLE)); aCoreSet.Put(SvxGradientListItem(pDrawModel->GetGradientListFromSdrModel(), SID_GRADIENT_LIST)); @@ -1084,6 +1124,12 @@ SfxItemSet& SwDocStyleSheet::GetItemSet() case SFX_STYLE_FAMILY_PAGE : { + //UUUU set correct parent to get the XFILL_NONE FillStyle as needed + if(!aCoreSet.GetParent()) + { + aCoreSet.SetParent(&rDoc.GetDfltFrmFmt()->GetAttrSet()); + } + ASSERT(pDesc, "Kein PageDescriptor"); ::PageDescToItemSet(*((SwPageDesc*)pDesc), aCoreSet); } @@ -1222,11 +1268,10 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, 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(); diff --git a/sw/source/ui/chrdlg/paradlg.src b/sw/source/ui/chrdlg/paradlg.src index fa7f710134f8..b71c2fa1e316 100644 --- a/sw/source/ui/chrdlg/paradlg.src +++ b/sw/source/ui/chrdlg/paradlg.src @@ -24,6 +24,8 @@ #include "globals.hrc" #include "chrdlg.hrc" #include "paradlg.hrc" +#include <svx/dialogs.hrc> + #define HelpText "error - hier keine HelpTexte HelpText" // #define DLG_PARA 256 TabDialog DLG_PARA @@ -85,12 +87,28 @@ TabDialog DLG_PARA Text [ en-US ] = "Borders" ; PageResID = TP_BORDER ; }; + + //UUUU new Area and Transparence TabPages + PageItem + { + Identifier = RID_SVXPAGE_AREA; + PageResID = RID_SVXPAGE_AREA; + Text [ en-US ] = "Area" ; + }; PageItem { - Identifier = TP_BACKGROUND ; - Text [ en-US ] = "Background" ; - PageResID = TP_BACKGROUND ; + Identifier = RID_SVXPAGE_TRANSPARENCE; + PageResID = RID_SVXPAGE_TRANSPARENCE; + Text [ en-US ] = "Transparency" ; }; + + //UUUU Remove? + //PageItem + //{ + // Identifier = TP_BACKGROUND ; + // Text [ en-US ] = "Background" ; + // PageResID = TP_BACKGROUND ; + //}; }; }; }; diff --git a/sw/source/ui/chrdlg/pardlg.cxx b/sw/source/ui/chrdlg/pardlg.cxx index 8f548fbdb561..3836f495d240 100644 --- a/sw/source/ui/chrdlg/pardlg.cxx +++ b/sw/source/ui/chrdlg/pardlg.cxx @@ -150,13 +150,20 @@ SwParaDlg::SwParaDlg(Window *pParent, } if(!bHtmlMode || (nHtmlMode & (HTMLMODE_SOME_STYLES|HTMLMODE_FULL_STYLES))) { - DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!"); - AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) ); + //UUUU remove? + //DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!"); + //DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!"); + //AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) ); + + //UUUU add Area and Transparence TabPages + AddTabPage(RID_SVXPAGE_AREA); + AddTabPage(RID_SVXPAGE_TRANSPARENCE); } else { - RemoveTabPage(TP_BACKGROUND); + //UUUU RemoveTabPage(TP_BACKGROUND); + RemoveTabPage(RID_SVXPAGE_AREA); + RemoveTabPage(RID_SVXPAGE_TRANSPARENCE); } if(!bHtmlMode || (nHtmlMode & HTMLMODE_PARA_BORDER)) { @@ -178,88 +185,123 @@ __EXPORT SwParaDlg::~SwParaDlg() } -void __EXPORT SwParaDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) +void __EXPORT SwParaDlg::PageCreated(sal_uInt16 nId,SfxTabPage& rPage) { SwWrtShell& rSh = rView.GetWrtShell(); SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); - // Bei Tabellenumrandung kann im Writer kein Schatten eingestellt werden - if (nId == TP_BORDER) + switch(nId) { - aSet.Put (SfxUInt16Item(SID_SWMODE_TYPE,SW_BORDER_MODE_PARA)); - rPage.PageCreated(aSet); - } - else if( nId == TP_PARA_STD ) - { - aSet.Put(SfxUInt16Item(SID_SVXSTDPARAGRAPHTABPAGE_PAGEWIDTH, - static_cast< sal_uInt16 >(rSh.GetAnyCurRect(RECT_PAGE_PRT).Width()) )); - - if (!bDrawParaDlg) + case TP_BORDER: { - aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_FLAGSET,0x000E)); - aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_ABSLINEDIST, MM50/10)); - + // Bei Tabellenumrandung kann im Writer kein Schatten eingestellt werden + aSet.Put(SfxUInt16Item(SID_SWMODE_TYPE,SW_BORDER_MODE_PARA)); + rPage.PageCreated(aSet); + break; } - rPage.PageCreated(aSet); - } - else if( TP_PARA_ALIGN == nId) - { - if (!bDrawParaDlg) + case TP_PARA_STD: { - aSet.Put(SfxBoolItem(SID_SVXPARAALIGNTABPAGE_ENABLEJUSTIFYEXT,sal_True)); + aSet.Put(SfxUInt16Item(SID_SVXSTDPARAGRAPHTABPAGE_PAGEWIDTH, + static_cast<sal_uInt16>(rSh.GetAnyCurRect(RECT_PAGE_PRT).Width()))); + + if(!bDrawParaDlg) + { + aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_FLAGSET,0x000E)); + aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_ABSLINEDIST,MM50 / 10)); + + } rPage.PageCreated(aSet); + break; } - } - else if( TP_PARA_EXT == nId ) - { - // Seitenumbruch nur, wenn der Cursor im Body-Bereich und nicht in - // einer Tabelle steht - const sal_uInt16 eType = rSh.GetFrmType(0,sal_True); - if( !(FRMTYPE_BODY & eType) || - rSh.GetSelectionType() & nsSelectionType::SEL_TBL ) + case TP_PARA_ALIGN: { - aSet.Put(SfxBoolItem(SID_DISABLE_SVXEXTPARAGRAPHTABPAGE_PAGEBREAK,sal_True)); - rPage.PageCreated(aSet); + if(!bDrawParaDlg) + { + aSet.Put(SfxBoolItem(SID_SVXPARAALIGNTABPAGE_ENABLEJUSTIFYEXT,sal_True)); + rPage.PageCreated(aSet); + } + break; } - } - else if( TP_DROPCAPS == nId ) - { - ((SwDropCapsPage&)rPage).SetFormat(sal_False); - } - else if( TP_BACKGROUND == nId ) - { - if(!( nHtmlMode & HTMLMODE_ON ) || - nHtmlMode & HTMLMODE_SOME_STYLES) + case TP_PARA_EXT: { - aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, SVX_SHOW_SELECTOR)); - rPage.PageCreated(aSet); + // Seitenumbruch nur, wenn der Cursor im Body-Bereich und nicht in + // einer Tabelle steht + const sal_uInt16 eType = rSh.GetFrmType(0,sal_True); + if(!(FRMTYPE_BODY & eType) || + rSh.GetSelectionType() & nsSelectionType::SEL_TBL) + { + aSet.Put(SfxBoolItem(SID_DISABLE_SVXEXTPARAGRAPHTABPAGE_PAGEBREAK,sal_True)); + rPage.PageCreated(aSet); + } + break; } - } - else if( TP_NUMPARA == nId) - { - //-->#outline level,added by zhaojianwei - SwTxtFmtColl* pTmpColl = rSh.GetCurTxtFmtColl(); - if( pTmpColl && pTmpColl->IsAssignedToListLevelOfOutlineStyle() ) + case TP_DROPCAPS: + { + ((SwDropCapsPage&)rPage).SetFormat(sal_False); + break; + } + case TP_BACKGROUND: { - ((SwParagraphNumTabPage&)rPage).DisableOutline() ; - }//<-end - - ((SwParagraphNumTabPage&)rPage).EnableNewStart(); - ListBox & rBox = ((SwParagraphNumTabPage&)rPage).GetStyleBox(); - SfxStyleSheetBasePool* pPool = rView.GetDocShell()->GetStyleSheetPool(); - pPool->SetSearchMask(SFX_STYLE_FAMILY_PSEUDO, SFXSTYLEBIT_ALL); - const SfxStyleSheetBase* pBase = pPool->First(); - SvStringsSortDtor aNames; - while(pBase) + if(!(nHtmlMode & HTMLMODE_ON) || + nHtmlMode & HTMLMODE_SOME_STYLES) + { + aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,SVX_SHOW_SELECTOR)); + rPage.PageCreated(aSet); + } + break; + } + case TP_NUMPARA: { - aNames.Insert(new String(pBase->GetName())); - pBase = pPool->Next(); + //-->#outline level,added by zhaojianwei + SwTxtFmtColl* pTmpColl = rSh.GetCurTxtFmtColl(); + if(pTmpColl && pTmpColl->IsAssignedToListLevelOfOutlineStyle()) + { + ((SwParagraphNumTabPage&)rPage).DisableOutline(); + }//<-end + + ((SwParagraphNumTabPage&)rPage).EnableNewStart(); + ListBox & rBox = ((SwParagraphNumTabPage&)rPage).GetStyleBox(); + SfxStyleSheetBasePool* pPool = rView.GetDocShell()->GetStyleSheetPool(); + pPool->SetSearchMask(SFX_STYLE_FAMILY_PSEUDO,SFXSTYLEBIT_ALL); + const SfxStyleSheetBase* pBase = pPool->First(); + SvStringsSortDtor aNames; + while(pBase) + { + aNames.Insert(new String(pBase->GetName())); + pBase = pPool->Next(); + } + for(sal_uInt16 i = 0; i < aNames.Count(); i++) + rBox.InsertEntry(*aNames.GetObject(i)); + break; } - for(sal_uInt16 i = 0; i < aNames.Count(); i++) - rBox.InsertEntry(*aNames.GetObject(i)); - } -} + //UUUU inits for Area and Transparency TabPages + // The selection attribute lists (XPropertyList derivates, e.g. XColorList for + // the color table) need to be added as items (e.g. SvxColorTableItem) to make + // these pages find the needed attributes for fill style suggestions. + // These are added in SwDocStyleSheet::GetItemSet() for the SFX_STYLE_FAMILY_PARA on + // demand, but could also be directly added from the DrawModel. + case RID_SVXPAGE_AREA: + { + SfxItemSet aNew(*aSet.GetPool(), + SID_COLOR_TABLE, SID_BITMAP_LIST, + SID_OFFER_IMPORT, SID_OFFER_IMPORT, 0, 0); + + aNew.Put(*GetInputSetImpl()); + // add flag for direct graphic content selection + aNew.Put(SfxBoolItem(SID_OFFER_IMPORT, true)); + + rPage.PageCreated(aNew); + break; + } + case RID_SVXPAGE_TRANSPARENCE: + { + rPage.PageCreated(*GetInputSetImpl()); + break; + } + } +} +// eof diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx index 7b3dd1cc0df3..e6002d6d46c9 100644 --- a/sw/source/ui/dbui/dbinsdlg.cxx +++ b/sw/source/ui/dbui/dbinsdlg.cxx @@ -1809,7 +1809,7 @@ void SwInsertDBColAutoPilot::Load() rtl::OUString sColumn; pSubProps[0] >>= sColumn; - //check for existance of the loaded column name + //check for existence of the loaded column name sal_Bool bFound = sal_False; for(sal_Int32 nRealColumn = 0; nRealColumn < aDBColumns.Count(); nRealColumn++) { diff --git a/sw/source/ui/dbui/maildispatcher.cxx b/sw/source/ui/dbui/maildispatcher.cxx index e9061b9ff06b..7a7f23a81f50 100644 --- a/sw/source/ui/dbui/maildispatcher.cxx +++ b/sw/source/ui/dbui/maildispatcher.cxx @@ -112,7 +112,7 @@ MailDispatcher::MailDispatcher(uno::Reference<mail::XSmtpService> mailserver) : throw uno::RuntimeException(); // wait until the mail dispatcher thread is really alive - // and has aquired a reference to this instance of the + // and has acquired a reference to this instance of the // class mail_dispatcher_active_.wait(); } @@ -242,7 +242,7 @@ void MailDispatcher::sendMailMessageNotifyListener(uno::Reference<mail::XMailMes void MailDispatcher::run() { - // aquire a self reference in order to avoid race + // acquire a self reference in order to avoid race // conditions. The last client of this class must // call shutdown before releasing his last reference // to this class in order to shutdown this thread diff --git a/sw/source/ui/dbui/swdbtoolsclient.cxx b/sw/source/ui/dbui/swdbtoolsclient.cxx index 9035985a2c7f..6248f9618815 100644 --- a/sw/source/ui/dbui/swdbtoolsclient.cxx +++ b/sw/source/ui/dbui/swdbtoolsclient.cxx @@ -159,7 +159,7 @@ void SwDbtoolsClient::getFactory() if (pDBTFactory) { m_xDataAccessFactory = pDBTFactory; - // by definition, the factory was aquired once + // by definition, the factory was acquired once m_xDataAccessFactory->release(); } } diff --git a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx index a8a53adcf94e..85e1e15eee04 100644 --- a/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx +++ b/sw/source/ui/dialog/SwSpellDialogChildWindow.cxx @@ -19,8 +19,6 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" @@ -56,6 +54,7 @@ #include <cmdid.h> #include <svx/svdlegacy.hxx> #include <svx/fmmodel.hxx> +#include <drawdoc.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; diff --git a/sw/source/ui/dochdl/swdtflvr.cxx b/sw/source/ui/dochdl/swdtflvr.cxx index 754a6121bc8c..0e30896ff90d 100644 --- a/sw/source/ui/dochdl/swdtflvr.cxx +++ b/sw/source/ui/dochdl/swdtflvr.cxx @@ -3865,7 +3865,7 @@ void SwTrnsfrDdeLink::Disconnect( sal_Bool bRemoveDataAdvise ) sal_Bool bIsModified = pDoc->IsModified(); IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess(); - // check, if DdeBookmark is already in its desctruction + // check, if DdeBookmark is already in its destruction IDocumentMarkAccess::const_iterator_t ppMark = pMarkAccess->findMark(sName); if ( ppMark != pMarkAccess->getAllMarksEnd() ) { diff --git a/sw/source/ui/docvw/PostItMgr.cxx b/sw/source/ui/docvw/PostItMgr.cxx index 1c38eacbfc69..a1ed2e1bdf20 100644 --- a/sw/source/ui/docvw/PostItMgr.cxx +++ b/sw/source/ui/docvw/PostItMgr.cxx @@ -127,7 +127,7 @@ SwPostItMgr::SwPostItMgr(SwView* pView) SW_MOD()->GetRedlineAuthor(); // collect all PostIts and redline comments that exist after loading the document - // don't check for existance for any of them, don't focus them + // don't check for existence for any of them, don't focus them AddPostIts(false,false); /* this code can be used once we want redline comments in the Sidebar AddRedlineComments(false,false); @@ -620,9 +620,9 @@ void SwPostItMgr::LayoutPostIts() mbLayouting = true; //loop over all pages and do the layout - // - create SwPostIt if neccessary + // - create SwPostIt if necessary // - place SwPostIts on their initial position - // - calculate neccessary height for all PostIts together + // - calculate necessary height for all PostIts together bool bUpdate = false; for (unsigned long n=0;n<mPages.size();n++) { @@ -866,7 +866,7 @@ bool SwPostItMgr::BorderOverPageBorder(unsigned long aPage) const void SwPostItMgr::Scroll(const long lScroll,const unsigned long aPage) { DBG_ASSERT((lScroll % GetScrollSize() )==0,"SwPostItMgr::Scroll: scrolling by wrong value"); - // do not scroll more than neccessary up or down + // do not scroll more than necessary up or down if ( ((mPages[aPage-1]->lOffset == 0) && (lScroll>0)) || ( BorderOverPageBorder(aPage) && (lScroll<0)) ) return; @@ -1013,7 +1013,7 @@ bool SwPostItMgr::LayoutByPage(std::list<SwSidebarWin*> &aVisiblePostItList,cons bool bDone = false; bool bScrollbars = false; - // do all neccessary resizings + // do all necessary resizings if (lVisibleHeight < lNeededHeight) { // ok, now we have to really resize and adding scrollbars @@ -1223,7 +1223,7 @@ void SwPostItMgr::RemoveSidebarWin() } // copy to new vector, otherwise RemoveItem would operate and delete stuff on mvPostItFlds as well -// RemoveItem will clean up the core field and visible postit if neccessary +// RemoveItem will clean up the core field and visible postit if necessary // we cannot just delete everything as before, as postits could move into change tracking void SwPostItMgr::Delete(String aAuthor) { diff --git a/sw/source/ui/docvw/SidebarWin.cxx b/sw/source/ui/docvw/SidebarWin.cxx index cdcbcb7bcb1c..3af6c58c8c45 100644 --- a/sw/source/ui/docvw/SidebarWin.cxx +++ b/sw/source/ui/docvw/SidebarWin.cxx @@ -579,7 +579,8 @@ void SwSidebarWin::SetPosAndSize() } // text range overlay - if ( mrSidebarItem.maLayoutInfo.mnStartNodeIdx != 0 + if ( mrMgr.ShowNotes() + && mrSidebarItem.maLayoutInfo.mnStartNodeIdx != 0 && mrSidebarItem.maLayoutInfo.mnStartContent != STRING_NOTFOUND ) { std::vector< basegfx::B2DRange > aAnnotationTextRanges; @@ -1447,7 +1448,7 @@ void SwRedComment::MouseButtonDown( const MouseEvent& rMEvt ) void SwRedComment::Delete() { SwSidebarWin::Delete(); - // we are not neccessarily on our redline, so let's move there + // we are not necessarily on our redline, so let's move there GotoPos(); DocView()->GetWrtShell().SetRedlineComment(EMPTYSTRING); DocView()->GetWrtShell().ClearMark(); diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index a7d2807fae27..b54ee51ab788 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -5485,7 +5485,7 @@ void SwEditWin::SetChainMode( sal_Bool bOn ) uno::Reference< ::com::sun::star::accessibility::XAccessible > SwEditWin::CreateAccessible() { vos::OGuard aGuard(Application::GetSolarMutex()); // this should have - // happend already!!! + // happened already!!! SwWrtShell *pSh = rView.GetWrtShellPtr(); ASSERT( pSh, "no writer shell, no accessible object" ); uno::Reference< diff --git a/sw/source/ui/envelp/labimg.cxx b/sw/source/ui/envelp/labimg.cxx index ffb3ff365b3f..694ac9da099a 100644 --- a/sw/source/ui/envelp/labimg.cxx +++ b/sw/source/ui/envelp/labimg.cxx @@ -208,7 +208,7 @@ Sequence<rtl::OUString> SwLabCfgItem::GetPropertyNames() { static const char* aLabelPropNames[] = { - "Medium/Continous", // 0 + "Medium/Continuous", // 0 "Medium/Brand", // 1 "Medium/Type", // 2 "Format/Column", // 3 @@ -302,7 +302,7 @@ SwLabCfgItem::SwLabCfgItem(sal_Bool bLabel) : bNoConfigValues = sal_False; switch(nProperty) { - case 0: aItem.bCont = *(sal_Bool*)pValues[nProp].getValue(); break;// "Medium/Continous", + case 0: aItem.bCont = *(sal_Bool*)pValues[nProp].getValue(); break;// "Medium/Continuous", case 1: pValues[nProp] >>= aItem.aMake; break;// "Medium/Brand", case 2: pValues[nProp] >>= aItem.aType; break;// "Medium/Type", case 3: pValues[nProp] >>= aItem.nCols; break;// "Format/Column", @@ -419,7 +419,7 @@ void SwLabCfgItem::Commit() nProperty += 3; switch(nProperty) { - case 0: pValues[nProp].setValue(&aItem.bCont, rType); break;// "Medium/Continous", + case 0: pValues[nProp].setValue(&aItem.bCont, rType); break;// "Medium/Continuous", case 1: pValues[nProp] <<= aItem.aMake; break;// "Medium/Brand", case 2: pValues[nProp] <<= aItem.aType; break;// "Medium/Type", case 3: pValues[nProp] <<= aItem.nCols; break;// "Format/Column", diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx index 6d83b9b07b3e..8fba4e5ae446 100644 --- a/sw/source/ui/fmtui/tmpdlg.cxx +++ b/sw/source/ui/fmtui/tmpdlg.cxx @@ -199,9 +199,15 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent, SwParagraphNumTabPage::GetRanges); AddTabPage(TP_DROPCAPS, SwDropCapsPage::Create, SwDropCapsPage::GetRanges ); - DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!"); - AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) ); + //UUUU remove? + //DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!"); + //DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!"); + //AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) ); + + //UUUU add Area and Transparence TabPages + AddTabPage(RID_SVXPAGE_AREA); + AddTabPage(RID_SVXPAGE_TRANSPARENCE); + DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "GetTabPageCreatorFunc fail!"); DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "GetTabPageRangesFunc fail!"); AddTabPage(TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) ); @@ -248,8 +254,10 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent, SwFrmAddPage::GetRanges ); AddTabPage(TP_FRM_WRAP, SwWrapTabPage::Create, SwWrapTabPage::GetRanges ); - DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!"); + + //UUUU remove? + //DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!"); + //DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!"); //UUUU remove? //AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) ); @@ -272,9 +280,15 @@ SwTemplateDlg::SwTemplateDlg(Window* pParent, // Seitenvorlagen case SFX_STYLE_FAMILY_PAGE: { - DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!"); - DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!"); - AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) ); + //UUUU remove? + //DBG_ASSERT(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!"); + //DBG_ASSERT(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageRangesFunc fail!"); + //AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) ); + + //UUUU add Area and Transparence TabPages + AddTabPage(RID_SVXPAGE_AREA); + AddTabPage(RID_SVXPAGE_TRANSPARENCE); + AddTabPage(TP_HEADER_PAGE, String(SW_RES(STR_PAGE_HEADER)), SvxHeaderPage::Create, SvxHeaderPage::GetRanges ); @@ -401,247 +415,296 @@ const SfxItemSet* SwTemplateDlg::GetRefreshedSet() Beschreibung: --------------------------------------------------------------------*/ -void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) +void SwTemplateDlg::PageCreated(sal_uInt16 nId,SfxTabPage &rPage) { //Namen der Vorlagen und Metric setzen - String sNumCharFmt, sBulletCharFmt; - SwStyleNameMapper::FillUIName( RES_POOLCHR_NUM_LEVEL, sNumCharFmt); - SwStyleNameMapper::FillUIName( RES_POOLCHR_BUL_LEVEL, sBulletCharFmt); + String sNumCharFmt,sBulletCharFmt; + SwStyleNameMapper::FillUIName(RES_POOLCHR_NUM_LEVEL,sNumCharFmt); + SwStyleNameMapper::FillUIName(RES_POOLCHR_BUL_LEVEL,sBulletCharFmt); SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); - switch( nId ) + switch(nId) { case TP_CHAR_STD: - { - ASSERT(::GetActiveView(), "keine View aktiv"); - - SvxFontListItem aFontListItem( *( (SvxFontListItem*)::GetActiveView()-> - GetDocShell()->GetItem( SID_ATTR_CHAR_FONTLIST ) ) ); - - aSet.Put (SvxFontListItem( aFontListItem.GetFontList(), SID_ATTR_CHAR_FONTLIST)); - sal_uInt32 nFlags = 0; - if(rPage.GetItemSet().GetParent() && 0 == (nHtmlMode & HTMLMODE_ON )) - nFlags = SVX_RELATIVE_MODE; - if( SFX_STYLE_FAMILY_CHAR == nType ) - nFlags = nFlags|SVX_PREVIEW_CHARACTER; - aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, nFlags)); - rPage.PageCreated(aSet); - } + { + ASSERT(::GetActiveView(),"keine View aktiv"); + + SvxFontListItem aFontListItem(*((SvxFontListItem*)::GetActiveView()-> + GetDocShell()->GetItem(SID_ATTR_CHAR_FONTLIST))); + + aSet.Put(SvxFontListItem(aFontListItem.GetFontList(),SID_ATTR_CHAR_FONTLIST)); + sal_uInt32 nFlags = 0; + if(rPage.GetItemSet().GetParent() && 0 == (nHtmlMode & HTMLMODE_ON)) + nFlags = SVX_RELATIVE_MODE; + if(SFX_STYLE_FAMILY_CHAR == nType) + nFlags = nFlags | SVX_PREVIEW_CHARACTER; + aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,nFlags)); + rPage.PageCreated(aSet); break; + } case TP_CHAR_EXT: - { + { sal_uInt32 nFlags = SVX_ENABLE_FLASH; - if( SFX_STYLE_FAMILY_CHAR == nType ) - nFlags = nFlags|SVX_PREVIEW_CHARACTER; - aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, nFlags)); + if(SFX_STYLE_FAMILY_CHAR == nType) + nFlags = nFlags | SVX_PREVIEW_CHARACTER; + aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,nFlags)); rPage.PageCreated(aSet); - } break; + } case TP_CHAR_POS: - if( SFX_STYLE_FAMILY_CHAR == nType ) + { + if(SFX_STYLE_FAMILY_CHAR == nType) { - aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, SVX_PREVIEW_CHARACTER)); + aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,SVX_PREVIEW_CHARACTER)); rPage.PageCreated(aSet); } - break; + break; + } case TP_CHAR_TWOLN: - if( SFX_STYLE_FAMILY_CHAR == nType ) + { + if(SFX_STYLE_FAMILY_CHAR == nType) { - aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, SVX_PREVIEW_CHARACTER)); + aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,SVX_PREVIEW_CHARACTER)); rPage.PageCreated(aSet); } - break; + break; + } case TP_PARA_STD: + { + if(rPage.GetItemSet().GetParent()) { - if( rPage.GetItemSet().GetParent() ) - { - aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_ABSLINEDIST,MM50/10)); - aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_FLAGSET,0x000F)); - rPage.PageCreated(aSet); - } - + aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_ABSLINEDIST,MM50 / 10)); + aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_FLAGSET,0x000F)); + rPage.PageCreated(aSet); } + break; + } + case TP_NUMPARA: + { + //-->#outlinelevel added by zhaojianwei + // handle if the current paragraph style is assigned to a list level of outline style, + SwTxtFmtColl* pTmpColl = pWrtShell->FindTxtFmtCollByName(GetStyleSheet().GetName()); + if(pTmpColl && pTmpColl->IsAssignedToListLevelOfOutlineStyle()) { - //-->#outlinelevel added by zhaojianwei - // handle if the current paragraph style is assigned to a list level of outline style, - SwTxtFmtColl* pTmpColl = pWrtShell->FindTxtFmtCollByName( GetStyleSheet().GetName() ); - if( pTmpColl && pTmpColl->IsAssignedToListLevelOfOutlineStyle() ) - { - ((SwParagraphNumTabPage&)rPage).DisableOutline() ; - ((SwParagraphNumTabPage&)rPage).DisableNumbering(); - }//<-end - ListBox & rBox = ((SwParagraphNumTabPage&)rPage).GetStyleBox(); - SfxStyleSheetBasePool* pPool = pWrtShell->GetView().GetDocShell()->GetStyleSheetPool(); - pPool->SetSearchMask(SFX_STYLE_FAMILY_PSEUDO, SFXSTYLEBIT_ALL); - const SfxStyleSheetBase* pBase = pPool->First(); - SvStringsSortDtor aNames; - while(pBase) - { - aNames.Insert(new String(pBase->GetName())); - pBase = pPool->Next(); - } - for(sal_uInt16 i = 0; i < aNames.Count(); i++) - rBox.InsertEntry(*aNames.GetObject(i)); - } - break; - case TP_PARA_ALIGN: + ((SwParagraphNumTabPage&)rPage).DisableOutline(); + ((SwParagraphNumTabPage&)rPage).DisableNumbering(); + }//<-end + ListBox & rBox = ((SwParagraphNumTabPage&)rPage).GetStyleBox(); + SfxStyleSheetBasePool* pPool = pWrtShell->GetView().GetDocShell()->GetStyleSheetPool(); + pPool->SetSearchMask(SFX_STYLE_FAMILY_PSEUDO,SFXSTYLEBIT_ALL); + const SfxStyleSheetBase* pBase = pPool->First(); + SvStringsSortDtor aNames; + while(pBase) { - aSet.Put(SfxBoolItem(SID_SVXPARAALIGNTABPAGE_ENABLEJUSTIFYEXT,sal_True)); - rPage.PageCreated(aSet); + aNames.Insert(new String(pBase->GetName())); + pBase = pPool->Next(); } + for(sal_uInt16 i = 0; i < aNames.Count(); i++) + rBox.InsertEntry(*aNames.GetObject(i)); break; + } + + case TP_PARA_ALIGN: + { + aSet.Put(SfxBoolItem(SID_SVXPARAALIGNTABPAGE_ENABLEJUSTIFYEXT,sal_True)); + rPage.PageCreated(aSet); + break; + } case TP_FRM_STD: - ((SwFrmPage&)rPage).SetNewFrame( sal_True ); - ((SwFrmPage&)rPage).SetFormatUsed( sal_True ); + { + ((SwFrmPage&)rPage).SetNewFrame(sal_True); + ((SwFrmPage&)rPage).SetFormatUsed(sal_True); break; + } case TP_FRM_ADD: + { ((SwFrmAddPage&)rPage).SetFormatUsed(sal_True); ((SwFrmAddPage&)rPage).SetNewFrame(sal_True); break; + } case TP_FRM_WRAP: - ((SwWrapTabPage&)rPage).SetFormatUsed( sal_True, sal_False ); + { + ((SwWrapTabPage&)rPage).SetFormatUsed(sal_True,sal_False); break; + } case TP_COLUMN: - if( nType == SFX_STYLE_FAMILY_FRAME ) + { + if(nType == SFX_STYLE_FAMILY_FRAME) ((SwColumnPage&)rPage).SetFrmMode(sal_True); - ((SwColumnPage&)rPage).SetFormatUsed( sal_True ); + ((SwColumnPage&)rPage).SetFormatUsed(sal_True); break; + } //UUUU do not remove; many other style dialog combinations still use the SfxTabPage // for the SvxBrushItem (see RID_SVXPAGE_BACKGROUND) case TP_BACKGROUND: { sal_Int32 nFlagType = 0; - if( SFX_STYLE_FAMILY_PARA == nType ) + if(SFX_STYLE_FAMILY_PARA == nType) nFlagType |= SVX_SHOW_PARACTL; - if( SFX_STYLE_FAMILY_CHAR != nType ) + if(SFX_STYLE_FAMILY_CHAR != nType) nFlagType |= SVX_SHOW_SELECTOR; - if( SFX_STYLE_FAMILY_FRAME == nType ) + if(SFX_STYLE_FAMILY_FRAME == nType) nFlagType |= SVX_ENABLE_TRANSPARENCY; - aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, nFlagType)); + aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,nFlagType)); rPage.PageCreated(aSet); + break; } - break; + case TP_CONDCOLL: + { ((SwCondCollPage&)rPage).SetCollection( - ((SwDocStyleSheet&)GetStyleSheet()).GetCollection(), bNewStyle ); + ((SwDocStyleSheet&)GetStyleSheet()).GetCollection(),bNewStyle); break; + } case TP_PAGE_STD: - if(0 == (nHtmlMode & HTMLMODE_ON )) + { + if(0 == (nHtmlMode & HTMLMODE_ON)) { List aList; String* pNew = new String; - SwStyleNameMapper::FillUIName( RES_POOLCOLL_TEXT, *pNew ); - aList.Insert( pNew, (sal_uLong)0 ); - if( pWrtShell ) + SwStyleNameMapper::FillUIName(RES_POOLCOLL_TEXT,*pNew); + aList.Insert(pNew,(sal_uLong)0); + + if(pWrtShell) { - SfxStyleSheetBasePool* pStyleSheetPool = pWrtShell-> - GetView().GetDocShell()->GetStyleSheetPool(); + SfxStyleSheetBasePool* pStyleSheetPool = pWrtShell->GetView().GetDocShell()->GetStyleSheetPool(); pStyleSheetPool->SetSearchMask(SFX_STYLE_FAMILY_PARA); SfxStyleSheetBase *pFirstStyle = pStyleSheetPool->First(); + while(pFirstStyle) { - aList.Insert( new String(pFirstStyle->GetName()), - aList.Count()); + aList.Insert(new String(pFirstStyle->GetName()), aList.Count()); pFirstStyle = pStyleSheetPool->Next(); } } - aSet.Put (SfxStringListItem(SID_COLLECT_LIST, &aList)); + + //UUUU set DrawingLayer FillStyles active + aSet.Put(SfxBoolItem(SID_DRAWINGLAYER_FILLSTYLES, true)); + aSet.Put(SfxStringListItem(SID_COLLECT_LIST, &aList)); rPage.PageCreated(aSet); - for( sal_uInt16 i = (sal_uInt16)aList.Count(); i; --i ) + + for(sal_uInt16 i = (sal_uInt16)aList.Count(); i; --i) + { delete (String*)aList.Remove(i); + } } + break; + } case TP_MACRO_ASSIGN: { SfxAllItemSet aNewSet(*aSet.GetPool()); - aNewSet.Put( SwMacroAssignDlg::AddEvents(MACASSGN_ALLFRM) ); - if ( pWrtShell ) - rPage.SetFrame( pWrtShell->GetView().GetViewFrame()->GetFrame().GetFrameInterface() ); + aNewSet.Put(SwMacroAssignDlg::AddEvents(MACASSGN_ALLFRM)); + if(pWrtShell) + rPage.SetFrame(pWrtShell->GetView().GetViewFrame()->GetFrame().GetFrameInterface()); rPage.PageCreated(aNewSet); break; } case RID_SVXPAGE_PICK_NUM: - { + { aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt)); aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt)); rPage.PageCreated(aSet); - } - break; + break; + } + case RID_SVXPAGE_NUM_OPTIONS: { - - aSet.Put (SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt)); - aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt)); + aSet.Put(SfxStringItem(SID_NUM_CHAR_FMT,sNumCharFmt)); + aSet.Put(SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt)); // Zeichenvorlagen sammeln ListBox rCharFmtLB(this); rCharFmtLB.Clear(); - rCharFmtLB.InsertEntry( ViewShell::GetShellRes()->aStrNone ); + rCharFmtLB.InsertEntry(ViewShell::GetShellRes()->aStrNone); SwDocShell* pDocShell = ::GetActiveWrtShell()->GetView().GetDocShell(); - ::FillCharStyleListBox(rCharFmtLB, pDocShell); + ::FillCharStyleListBox(rCharFmtLB,pDocShell); List aList; for(sal_uInt16 j = 0; j < rCharFmtLB.GetEntryCount(); j++) { - - aList.Insert( new XubString(rCharFmtLB.GetEntry(j)), LIST_APPEND ); + aList.Insert(new XubString(rCharFmtLB.GetEntry(j)),LIST_APPEND); } - aSet.Put( SfxStringListItem( SID_CHAR_FMT_LIST_BOX,&aList ) ) ; + aSet.Put(SfxStringListItem(SID_CHAR_FMT_LIST_BOX,&aList)); FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast< SwWebDocShell* >( pDocShell)); - aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric))); + aSet.Put(SfxAllEnumItem(SID_METRIC_ITEM,static_cast<sal_uInt16>(eMetric))); rPage.PageCreated(aSet); - for( sal_uInt16 i = (sal_uInt16)aList.Count(); i; --i ) - delete (XubString*)aList.Remove(i); + for(sal_uInt16 i = (sal_uInt16)aList.Count(); i; --i) + delete (XubString*)aList.Remove(i); aList.Clear(); + break; } - break; + case RID_SVXPAGE_NUM_POSITION: { SwDocShell* pDocShell = ::GetActiveWrtShell()->GetView().GetDocShell(); FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast< SwWebDocShell* >( pDocShell)); - aSet.Put ( SfxAllEnumItem(SID_METRIC_ITEM, static_cast< sal_uInt16 >(eMetric))); + aSet.Put(SfxAllEnumItem(SID_METRIC_ITEM,static_cast<sal_uInt16>(eMetric))); rPage.PageCreated(aSet); + break; } - break; - case RID_SVXPAGE_PICK_BULLET : + + case RID_SVXPAGE_PICK_BULLET: + { + aSet.Put(SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt)); + rPage.PageCreated(aSet); + break; + } + + case TP_HEADER_PAGE: + { + if(0 == (nHtmlMode & HTMLMODE_ON)) { - aSet.Put (SfxStringItem(SID_BULLET_CHAR_FMT,sBulletCharFmt)); - rPage.PageCreated(aSet); + static_cast< SvxHeaderPage& >(rPage).EnableDynamicSpacing(); } - break; - case TP_HEADER_PAGE: - if(0 == (nHtmlMode & HTMLMODE_ON )) - ((SvxHeaderPage&)rPage).EnableDynamicSpacing(); - break; + + //UUUU set DrawingLayer FillStyles active + aSet.Put(SfxBoolItem(SID_DRAWINGLAYER_FILLSTYLES, true)); + rPage.PageCreated(aSet); + + break; + } + case TP_FOOTER_PAGE: - if(0 == (nHtmlMode & HTMLMODE_ON )) - ((SvxFooterPage&)rPage).EnableDynamicSpacing(); - break; - case TP_BORDER : - if( SFX_STYLE_FAMILY_PARA == nType ) + { + if(0 == (nHtmlMode & HTMLMODE_ON)) + { + static_cast< SvxFooterPage& >(rPage).EnableDynamicSpacing(); + } + + //UUUU set DrawingLayer FillStyles active + aSet.Put(SfxBoolItem(SID_DRAWINGLAYER_FILLSTYLES, true)); + rPage.PageCreated(aSet); + + break; + } + + case TP_BORDER: + { + if(SFX_STYLE_FAMILY_PARA == nType) { - aSet.Put (SfxUInt16Item(SID_SWMODE_TYPE,SW_BORDER_MODE_PARA)); + aSet.Put(SfxUInt16Item(SID_SWMODE_TYPE,SW_BORDER_MODE_PARA)); } - else if( SFX_STYLE_FAMILY_FRAME == nType ) + else if(SFX_STYLE_FAMILY_FRAME == nType) { - aSet.Put (SfxUInt16Item(SID_SWMODE_TYPE,SW_BORDER_MODE_FRAME)); + aSet.Put(SfxUInt16Item(SID_SWMODE_TYPE,SW_BORDER_MODE_FRAME)); } rPage.PageCreated(aSet); - - break; + break; + } //UUUU inits for Area and Transparency TabPages // The selection attribute lists (XPropertyList derivates, e.g. XColorList for @@ -651,24 +714,20 @@ void SwTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) // demand, but could also be directly added from the DrawModel. case RID_SVXPAGE_AREA: { - SfxItemSet aNew(*aSet.GetPool(), - SID_COLOR_TABLE, SID_BITMAP_LIST, - SID_OFFER_IMPORT, SID_OFFER_IMPORT, 0, 0); - - aNew.Put(GetStyleSheet().GetItemSet()); + aSet.Put(GetStyleSheet().GetItemSet()); // add flag for direct graphic content selection - aNew.Put(SfxBoolItem(SID_OFFER_IMPORT, true)); + aSet.Put(SfxBoolItem(SID_OFFER_IMPORT, true)); - rPage.PageCreated(aNew); + rPage.PageCreated(aSet); + break; } - break; case RID_SVXPAGE_TRANSPARENCE: { rPage.PageCreated(GetStyleSheet().GetItemSet()); + break; } - break; } } diff --git a/sw/source/ui/fmtui/tmpdlg.src b/sw/source/ui/fmtui/tmpdlg.src index f9b23a473ec5..383c1149f525 100644 --- a/sw/source/ui/fmtui/tmpdlg.src +++ b/sw/source/ui/fmtui/tmpdlg.src @@ -148,12 +148,29 @@ TabDialog DLG_TEMPLATE_2 Text [ en-US ] = "Drop Caps" ; PageResID = TP_DROPCAPS ; }; + + //UUUU new Area and Transparence TabPages PageItem { - Identifier = TP_BACKGROUND ; - Text [ en-US ] = "Background" ; - PageResID = TP_BACKGROUND ; + Identifier = RID_SVXPAGE_AREA; + PageResID = RID_SVXPAGE_AREA; + Text [ en-US ] = "Area" ; + }; + PageItem + { + Identifier = RID_SVXPAGE_TRANSPARENCE; + PageResID = RID_SVXPAGE_TRANSPARENCE; + Text [ en-US ] = "Transparency" ; }; + + //UUUU remove? + //PageItem + //{ + // Identifier = TP_BACKGROUND ; + // Text [ en-US ] = "Background" ; + // PageResID = TP_BACKGROUND ; + //}; + PageItem { Identifier = TP_BORDER ; @@ -196,12 +213,28 @@ TabDialog DLG_TEMPLATE_4 Text [ en-US ] = "Page" ; PageResID = TP_PAGE_STD ; };*/ + + //UUUU new Area and Transparence TabPages PageItem { - Identifier = TP_BACKGROUND ; - Text [ en-US ] = "Background" ; - PageResID = TP_BACKGROUND ; + Identifier = RID_SVXPAGE_AREA; + PageResID = RID_SVXPAGE_AREA; + Text [ en-US ] = "Area" ; }; + PageItem + { + Identifier = RID_SVXPAGE_TRANSPARENCE; + PageResID = RID_SVXPAGE_TRANSPARENCE; + Text [ en-US ] = "Transparency" ; + }; + + //UUUU remove? + //PageItem + //{ + // Identifier = TP_BACKGROUND ; + // Text [ en-US ] = "Background" ; + // PageResID = TP_BACKGROUND ; + //}; /* PageItem { Identifier = TP_BORDER ; diff --git a/sw/source/ui/frmdlg/colex.cxx b/sw/source/ui/frmdlg/colex.cxx index 81f348c1e28e..4df7a20b648d 100644 --- a/sw/source/ui/frmdlg/colex.cxx +++ b/sw/source/ui/frmdlg/colex.cxx @@ -19,19 +19,12 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - - - #include "cmdid.h" #include "hintids.hxx" #include <algorithm> - - #include <svl/eitem.hxx> #include <editeng/lrspitem.hxx> #include <editeng/ulspitem.hxx> @@ -46,6 +39,9 @@ #include "colex.hxx" #include "colmgr.hxx" +//UUUU +#include <svx/unobrushitemhelper.hxx> + /*----------------------------------------------------------------------- Beschreibung: Uebernahme der aktualisierten Werte aus dem Set -----------------------------------------------------------------------*/ @@ -128,12 +124,20 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet ) SetHdLeft( rLR.GetLeft() ); SetHdRight( rLR.GetRight() ); SetHeader( sal_True ); - if ( rHeaderSet.GetItemState( RES_BACKGROUND ) == SFX_ITEM_SET ) + + if(SFX_ITEM_SET == rHeaderSet.GetItemState(RES_BACKGROUND)) { - const SvxBrushItem& rItem = - (const SvxBrushItem&)rHeaderSet.Get( RES_BACKGROUND ); - SetHdColor( rItem.GetColor() ); + //UUUU create FillAttributes from SvxBrushItem //SetHdColor(rItem.GetColor()); + const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rHeaderSet.Get(RES_BACKGROUND)); + SfxItemSet aTempSet(*rHeaderSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST); + + setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); + setHeaderFillAttributes( + drawinglayer::attribute::SdrAllFillAttributesHelperPtr( + new drawinglayer::attribute::SdrAllFillAttributesHelper( + aTempSet))); } + if ( rHeaderSet.GetItemState( RES_BOX ) == SFX_ITEM_SET ) { const SvxBoxItem& rItem = @@ -167,12 +171,20 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet ) SetFtLeft( rLR.GetLeft() ); SetFtRight( rLR.GetRight() ); SetFooter( sal_True ); + if( rFooterSet.GetItemState( RES_BACKGROUND ) == SFX_ITEM_SET ) { - const SvxBrushItem& rItem = - (const SvxBrushItem&)rFooterSet.Get( RES_BACKGROUND ); - SetFtColor( rItem.GetColor() ); + //UUUU create FillAttributes from SvxBrushItem //SetFtColor(rItem.GetColor()); + const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(rFooterSet.Get(RES_BACKGROUND)); + SfxItemSet aTempSet(*rFooterSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST); + + setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); + setFooterFillAttributes( + drawinglayer::attribute::SdrAllFillAttributesHelperPtr( + new drawinglayer::attribute::SdrAllFillAttributesHelper( + aTempSet))); } + if( rFooterSet.GetItemState( RES_BOX ) == SFX_ITEM_SET ) { const SvxBoxItem& rItem = @@ -183,19 +195,18 @@ void SwPageExample::UpdateExample( const SfxItemSet& rSet ) else SetFooter( sal_False ); } - if( SFX_ITEM_SET == rSet.GetItemState( RES_BACKGROUND, - sal_False, &pItem ) ) - { - SetColor( ( (const SvxBrushItem*)pItem )->GetColor() ); - const Graphic* pGrf = ( (const SvxBrushItem*)pItem )->GetGraphic(); - if ( pGrf ) - { - Bitmap aBitmap = pGrf->GetBitmap(); - SetBitmap( &aBitmap ); - } - else - SetBitmap( NULL ); + if(SFX_ITEM_SET == rSet.GetItemState(RES_BACKGROUND, sal_False, &pItem)) + { + //UUUU create FillAttributes from SvxBrushItem + const SvxBrushItem& rItem = static_cast< const SvxBrushItem& >(*pItem); + SfxItemSet aTempSet(*rSet.GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST); + + setSvxBrushItemAsFillAttributesToTargetSet(rItem, aTempSet); + setPageFillAttributes( + drawinglayer::attribute::SdrAllFillAttributesHelperPtr( + new drawinglayer::attribute::SdrAllFillAttributesHelper( + aTempSet))); } Invalidate(); @@ -233,14 +244,23 @@ void SwColExample::DrawPage( const Point& rOrg, - GetFtHeight() - GetFtDist(); DrawRect(aRect); - if(GetColor() == Color(COL_TRANSPARENT)) + //UUUU + const Rectangle aDefineRect(aRect); + + //UUUU + const drawinglayer::attribute::SdrAllFillAttributesHelperPtr& rFillAttributes = getPageFillAttributes(); + + if(!rFillAttributes.get() || !rFillAttributes->isUsed()) { + //UUUU If there is no fill, use fallback color const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); const Color& rFieldColor = rStyleSettings.GetFieldColor(); - SetFillColor( rFieldColor ); + + setPageFillAttributes( + drawinglayer::attribute::SdrAllFillAttributesHelperPtr( + new drawinglayer::attribute::SdrAllFillAttributesHelper( + rFieldColor))); } - else - SetFillColor( GetColor() ); // #97495# make sure that the automatic column widht's are always equal sal_Bool bAutoWidth = pColMgr->IsAutoWidth(); @@ -260,7 +280,10 @@ void SwColExample::DrawPage( const Point& rOrg, if(!bAutoWidth) nAutoColWidth = pColMgr->GetColWidth( i ); aRect.Right() = aRect.Left() + nAutoColWidth; - DrawRect(aRect); + + //UUUU use primitive draw command + drawFillAttributes(getPageFillAttributes(), aRect, aDefineRect); + if(i < nColumnCount - 1) aRect.Left() = aRect.Right() + pColMgr->GetGutterWidth(i); } diff --git a/sw/source/ui/frmdlg/frmmgr.cxx b/sw/source/ui/frmdlg/frmmgr.cxx index e1840cc2f732..83e22491d60f 100644 --- a/sw/source/ui/frmdlg/frmmgr.cxx +++ b/sw/source/ui/frmdlg/frmmgr.cxx @@ -35,6 +35,7 @@ #include <editeng/ulspitem.hxx> #include <editeng/shaditem.hxx> #include <svx/swframevalidation.hxx> +#include <svx/xdef.hxx> #include <fmtclds.hxx> #include "wrtsh.hxx" #include "view.hxx" diff --git a/sw/source/ui/frmdlg/frmpage.src b/sw/source/ui/frmdlg/frmpage.src index 82f0a3967415..abf689ce2aef 100644 --- a/sw/source/ui/frmdlg/frmpage.src +++ b/sw/source/ui/frmdlg/frmpage.src @@ -157,14 +157,31 @@ TabDialog DLG_FRM_GRF PageResID = TP_BORDER ; Text [ en-US ] = "Borders" ; }; + + //UUUU new Area and Transparence TabPages PageItem { - Identifier = TP_BACKGROUND ; - PageResID = TP_BACKGROUND ; - Text [ en-US ] = "Background" ; + Identifier = RID_SVXPAGE_AREA; + PageResID = RID_SVXPAGE_AREA; + Text [ en-US ] = "Area" ; }; PageItem { + Identifier = RID_SVXPAGE_TRANSPARENCE; + PageResID = RID_SVXPAGE_TRANSPARENCE; + Text [ en-US ] = "Transparency" ; + }; + + //UUUU remove? + //PageItem + //{ + // Identifier = TP_BACKGROUND ; + // PageResID = TP_BACKGROUND ; + // Text [ en-US ] = "Background" ; + //}; + + PageItem + { Identifier = TP_MACRO_ASSIGN ; Text [ en-US ] = "Macro" ; }; @@ -212,12 +229,29 @@ TabDialog DLG_FRM_OLE PageResID = TP_BORDER ; Text [ en-US ] = "Borders" ; }; + + //UUUU new Area and Transparence TabPages + PageItem + { + Identifier = RID_SVXPAGE_AREA; + PageResID = RID_SVXPAGE_AREA; + Text [ en-US ] = "Area" ; + }; + PageItem + { + Identifier = RID_SVXPAGE_TRANSPARENCE; + PageResID = RID_SVXPAGE_TRANSPARENCE; + Text [ en-US ] = "Transparency" ; + }; + + //UUUU remove? PageItem { Identifier = TP_BACKGROUND ; PageResID = TP_BACKGROUND ; Text [ en-US ] = "Background" ; }; + /* PageItem { Identifier = TP_COLUMN ; diff --git a/sw/source/ui/inc/tablemgr.hxx b/sw/source/ui/inc/tablemgr.hxx index 4ebeea506f42..44e95bccc7df 100644 --- a/sw/source/ui/inc/tablemgr.hxx +++ b/sw/source/ui/inc/tablemgr.hxx @@ -76,7 +76,7 @@ public: // @deprecated void UpdateChart(); - /// @return the XModel of the newly inserted chart if successfull + /// @return the XModel of the newly inserted chart if successful ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > InsertChart( ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataProvider > &rxDataProvider, sal_Bool bFillWithData, const rtl::OUString &rCellRange, SwFlyFrmFmt** ppFlyFrmFmt = 0 ); }; diff --git a/sw/source/ui/inc/uitool.hxx b/sw/source/ui/inc/uitool.hxx index 766079ab2f0d..9c2b4851df70 100644 --- a/sw/source/ui/inc/uitool.hxx +++ b/sw/source/ui/inc/uitool.hxx @@ -81,7 +81,7 @@ SwTwips GetTableWidth( SwFrmFmt* pFmt, SwTabCols& rCols, sal_uInt16 *pPercent, String GetAppLangDateTimeString( const DateTime& ); -// search for a command string withing the menu structure and execute it +// search for a command string within the menu structure and execute it // at the dispatcher if there is one, if executed return true bool ExecuteMenuCommand( PopupMenu& rMenu, SfxViewFrame& rViewFrame, sal_uInt16 nId ); diff --git a/sw/source/ui/lingu/olmenu.cxx b/sw/source/ui/lingu/olmenu.cxx index ce800f3bcefa..855d5f3c5d03 100644 --- a/sw/source/ui/lingu/olmenu.cxx +++ b/sw/source/ui/lingu/olmenu.cxx @@ -740,7 +740,7 @@ void SwSpellPopup::Execute( sal_uInt16 nId ) String aTmp( aSuggestions[ nAltIdx ] ); String aOrig( bGrammarResults ? OUString() : xSpellAlt->getWord() ); - // if orginal word has a trailing . (likely the end of a sentence) + // if original word has a trailing . (likely the end of a sentence) // and the replacement text hasn't, then add it to the replacement if (aTmp.Len() && aOrig.Len() && '.' == aOrig.GetChar( aOrig.Len() - 1) && /* !IsAlphaNumeric ??*/ diff --git a/sw/source/ui/lingu/sdrhhcwrap.cxx b/sw/source/ui/lingu/sdrhhcwrap.cxx index d111cef9f10f..11a48d572444 100644 --- a/sw/source/ui/lingu/sdrhhcwrap.cxx +++ b/sw/source/ui/lingu/sdrhhcwrap.cxx @@ -19,10 +19,9 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" + #include <hintids.hxx> #include <svx/svditer.hxx> #include <svx/svdotext.hxx> @@ -40,19 +39,16 @@ #include <unotools/localedatawrapper.hxx> #include <sdrhhcwrap.hxx> #include <frmfmt.hxx> -#ifndef _DOCSH_HXX #include <docsh.hxx> // " " " -#endif #include <wrtsh.hxx> // MakeVisible -#ifndef _VIEW_HXX #include <view.hxx> -#endif #include <dcontact.hxx> // Spelling von DrawObj #include <doc.hxx> // " " " #include <docary.hxx> #include <edtwin.hxx> #include <svx/svdlegacy.hxx> #include <svx/fmmodel.hxx> +#include <drawdoc.hxx> using namespace ::com::sun::star; using ::rtl::OUString; diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx index 10a53cf75ed0..12622bbe1f02 100644 --- a/sw/source/ui/misc/glossary.cxx +++ b/sw/source/ui/misc/glossary.cxx @@ -349,7 +349,12 @@ IMPL_LINK( SwGlossaryDlg, GrpSelect, SvTreeListBox *, pBox ) ShowAutoText(*::GetCurrGlosGroup(), aShortNameEdit.GetText()); } else + { + aNameED.SetText(aEmptyStr); + aShortNameEdit.SetText(aEmptyStr); + aInsertBtn.Enable(sal_False); ShowAutoText(aEmptyStr, aEmptyStr); + } //Controls aktualisieren NameModify(&aShortNameEdit); if( SfxRequest::HasMacroRecorder( pSh->GetView().GetViewFrame() ) ) diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx index 17379d8a152f..9ae8e60a0835 100644 --- a/sw/source/ui/shells/basesh.cxx +++ b/sw/source/ui/shells/basesh.cxx @@ -19,8 +19,6 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" @@ -28,7 +26,6 @@ #include <hintids.hxx> #include <svl/urihelper.hxx> #include <svl/languageoptions.hxx> - #include <svx/svxids.hrc> #include <sfx2/linkmgr.hxx> #include <svx/htmlmode.hxx> @@ -101,7 +98,6 @@ #include <crsskip.hxx> #include <fmtinfmt.hxx> #include <doc.hxx> - #include "swabstdlg.hxx" #include "dialog.hrc" #include "fldui.hrc" @@ -111,13 +107,14 @@ #include <svx/fmshell.hxx> // for FN_XFORMS_DESIGN_MODE #include <SwRewriter.hxx> #include <comcore.hrc> - #include <unomid.h> #include <svx/galleryitem.hxx> #include <com/sun/star/gallery/GalleryItemType.hpp> -FlyMode SwBaseShell::eFrameMode = FLY_DRAG_END; +//UUUU +#include <svx/unobrushitemhelper.hxx> +FlyMode SwBaseShell::eFrameMode = FLY_DRAG_END; //Fuer die Erkennung der Id, die variable von Gallery mit SID_GALLERY_BG_BRUSH //ankommt. @@ -2256,28 +2253,10 @@ void SwBaseShell::GetTxtFontCtrlState( SfxItemSet& rSet ) void SwBaseShell::GetBckColState(SfxItemSet &rSet) { SwWrtShell &rSh = GetShell(); - SfxWhichIter aIter( rSet ); - sal_uInt16 nWhich = aIter.FirstWhich(); - int nSelType = rSh.GetSelectionType(); - -// if ( nSelType & nsSelectionType::SEL_GRF || - if( nSelType & nsSelectionType::SEL_OLE ) - { - rSet.DisableItem( SID_BACKGROUND_COLOR ); - return; - } - - if ( nSelType & nsSelectionType::SEL_FRM ) - { - sal_Bool bParentCntProt = rSh.IsSelObjProtected( FLYPROTECT_CONTENT|FLYPROTECT_PARENT ) != 0; - if (bParentCntProt) - { - rSet.DisableItem( SID_BACKGROUND_COLOR ); - return; - } - } - - SvxBrushItem aBrushItem( RES_BACKGROUND ); + SfxWhichIter aIter(rSet); + sal_uInt16 nWhich(aIter.FirstWhich()); + int nSelType(rSh.GetSelectionType()); + SvxBrushItem aBrushItem(RES_BACKGROUND); if( nsSelectionType::SEL_TBL_CELLS & nSelType ) { @@ -2285,54 +2264,41 @@ void SwBaseShell::GetBckColState(SfxItemSet &rSet) } else { - //UUUU - if(nSelType & nsSelectionType::SEL_GRF) - { - SfxItemSet aCoreSet(GetPool(), RES_BACKGROUND, RES_BACKGROUND); + //UUUU Adapt to new DrawingLayer FillStyle; use a parent which has XFILL_NONE set + SfxItemSet aCoreSet(GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST); - rSh.GetFlyFrmAttr( aCoreSet ); - aBrushItem = (const SvxBrushItem&)aCoreSet.Get(RES_BACKGROUND); - } - else if(nsSelectionType::SEL_FRM & nSelType) - { - SfxItemSet aCoreSet(GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST); - const XFillStyleItem& rXFillStyleItem(static_cast< const XFillStyleItem& >(aCoreSet.Get(XATTR_FILLSTYLE))); + aCoreSet.SetParent(&GetView().GetDocShell()->GetDoc()->GetDfltFrmFmt()->GetAttrSet()); - if(XFILL_SOLID == rXFillStyleItem.GetValue()) - { - const Color aFillColor(static_cast< const XFillColorItem& >(aCoreSet.Get(XATTR_FILLCOLOR)).GetColorValue()); - - aBrushItem.SetColor(aFillColor); - } - else - { - // keep default in SvxBrushItem which equals no fill - } + if(nSelType & nsSelectionType::SEL_GRF || nsSelectionType::SEL_FRM & nSelType) + { + rSh.GetFlyFrmAttr(aCoreSet); } else { - SfxItemSet aCoreSet(GetPool(), RES_BACKGROUND, RES_BACKGROUND); - - rSh.GetCurAttr( aCoreSet ); - aBrushItem = (const SvxBrushItem&)aCoreSet.Get(RES_BACKGROUND); + rSh.GetCurAttr(aCoreSet); } + + aBrushItem = getSvxBrushItemFromSourceSet(aCoreSet, RES_BACKGROUND); } - while ( nWhich ) + while(nWhich) { switch(nWhich) { - case SID_BACKGROUND_COLOR : + case SID_BACKGROUND_COLOR: { - SvxColorItem aColorItem(aBrushItem.GetColor(), SID_BACKGROUND_COLOR); - rSet.Put( aColorItem, SID_BACKGROUND_COLOR ); + SvxColorItem aColorItem(aBrushItem.GetColor(),SID_BACKGROUND_COLOR); + rSet.Put(aColorItem,SID_BACKGROUND_COLOR); + break; } - break; case SID_ATTR_BRUSH: case RES_BACKGROUND: - rSet.Put( aBrushItem, GetPool().GetWhich(nWhich) ); - break; + { + rSet.Put(aBrushItem,GetPool().GetWhich(nWhich)); + break; + } } + nWhich = aIter.NextWhich(); } } @@ -2344,18 +2310,16 @@ void SwBaseShell::GetBckColState(SfxItemSet &rSet) void SwBaseShell::ExecBckCol(SfxRequest& rReq) { SwWrtShell &rSh = GetShell(); - int nSelType = rSh.GetSelectionType(); - if ( nSelType & nsSelectionType::SEL_OLE ) + int nSelType(rSh.GetSelectionType()); + const SfxItemSet* pArgs = rReq.GetArgs(); + sal_uInt16 nSlot(rReq.GetSlot()); + + if(!pArgs && nSlot != SID_BACKGROUND_COLOR) { return; } - const SfxItemSet* pArgs = rReq.GetArgs(); - sal_uInt16 nSlot = rReq.GetSlot(); - if( !pArgs && nSlot != SID_BACKGROUND_COLOR) - return ; - - SvxBrushItem aBrushItem( RES_BACKGROUND ); + SvxBrushItem aBrushItem(RES_BACKGROUND); if( nsSelectionType::SEL_TBL_CELLS & nSelType ) { @@ -2363,129 +2327,98 @@ void SwBaseShell::ExecBckCol(SfxRequest& rReq) } else { - //UUUU - if(nSelType & nsSelectionType::SEL_GRF) - { - SfxItemSet aCoreSet(GetPool(), RES_BACKGROUND, RES_BACKGROUND); - - rSh.GetFlyFrmAttr( aCoreSet ); - aBrushItem = (const SvxBrushItem&)aCoreSet.Get(RES_BACKGROUND); - } - else if(nsSelectionType::SEL_FRM & nSelType) - { - SfxItemSet aCoreSet(GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST); - const XFillStyleItem& rXFillStyleItem(static_cast< const XFillStyleItem& >(aCoreSet.Get(XATTR_FILLSTYLE))); + //UUUU Adapt to new DrawingLayer FillStyle; use a parent which has XFILL_NONE set + SfxItemSet aCoreSet(GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST); - if(XFILL_SOLID == rXFillStyleItem.GetValue()) - { - const Color aFillColor(static_cast< const XFillColorItem& >(aCoreSet.Get(XATTR_FILLCOLOR)).GetColorValue()); + aCoreSet.SetParent(&GetView().GetDocShell()->GetDoc()->GetDfltFrmFmt()->GetAttrSet()); - aBrushItem.SetColor(aFillColor); - } - else - { - // keep default in SvxBrushItem which equals no fill - } + if((nsSelectionType::SEL_FRM & nSelType) || (nsSelectionType::SEL_GRF & nSelType)) + { + rSh.GetFlyFrmAttr(aCoreSet); } else { - SfxItemSet aCoreSet(GetPool(), RES_BACKGROUND, RES_BACKGROUND); - - rSh.GetCurAttr( aCoreSet ); - aBrushItem = (const SvxBrushItem&)aCoreSet.Get(RES_BACKGROUND); + rSh.GetCurAttr(aCoreSet); } - } -// sal_Bool bMsgOk = sal_False; + aBrushItem = getSvxBrushItemFromSourceSet(aCoreSet, RES_BACKGROUND); + } - switch (nSlot) + switch(nSlot) { - // RES_BACKGROUND (=SID_ATTR_BRUSH) muss ueber zwei IDs - // gesetzt werden: case SID_BACKGROUND_COLOR: - { - aBrushItem.SetGraphicPos(GPOS_NONE); + { + aBrushItem.SetGraphicPos(GPOS_NONE); - //Brush &rBrush = aBrushItem.GetBrush(); - if(pArgs) - { - const SvxColorItem& rNewColorItem = (const SvxColorItem&) - pArgs->Get(SID_BACKGROUND_COLOR); - const Color& rNewColor = rNewColorItem.GetValue(); - aBrushItem.SetColor( rNewColor ); - GetView().GetViewFrame()->GetBindings().SetState(rNewColorItem); - } - else - { - aBrushItem.SetColor( COL_TRANSPARENT ); - rReq.AppendItem( SvxColorItem( Color( COL_TRANSPARENT ), nSlot ) ); - } + if(pArgs) + { + const SvxColorItem& rNewColorItem = (const SvxColorItem&)pArgs->Get(SID_BACKGROUND_COLOR); + const Color& rNewColor = rNewColorItem.GetValue(); + aBrushItem.SetColor(rNewColor); + GetView().GetViewFrame()->GetBindings().SetState(rNewColorItem); + } + else + { + aBrushItem.SetColor(COL_TRANSPARENT); + rReq.AppendItem(SvxColorItem(Color(COL_TRANSPARENT),nSlot)); } break; + } case SID_ATTR_BRUSH: case RES_BACKGROUND: { - const SvxBrushItem& rNewBrushItem = (const SvxBrushItem&) - pArgs->Get( GetPool().GetWhich(nSlot) ); + const SvxBrushItem& rNewBrushItem = (const SvxBrushItem&)pArgs->Get(GetPool().GetWhich(nSlot)); aBrushItem = rNewBrushItem; + break; } - break; default: -// bMsgOk = sal_False; + { rReq.Ignore(); - DBG_ERROR( "Unbekannte Message bei ExecuteAttr!" ); + DBG_ERROR("Unbekannte Message bei ExecuteAttr!"); return; + } } if( nsSelectionType::SEL_TBL_CELLS & nSelType ) { rSh.SetBoxBackground( aBrushItem ); } - //UUUU - else if(nsSelectionType::SEL_GRF & nSelType) - { - SfxItemSet aCoreSet(GetPool(), RES_BACKGROUND, RES_BACKGROUND); - aCoreSet.Put( aBrushItem ); - // Vorlagen-AutoUpdate - SwFrmFmt* pFmt = rSh.GetCurFrmFmt(); - if(pFmt && pFmt->IsAutoUpdateFmt()) - rSh.AutoUpdateFrame( pFmt, aCoreSet); - else - rSh.SetFlyFrmAttr( aCoreSet ); - } - else if(nsSelectionType::SEL_FRM & nSelType) + else { + //UUUU Adapt to new DrawingLayer FillStyle; use a parent which has XFILL_NONE set SfxItemSet aCoreSet(GetPool(), XATTR_FILL_FIRST, XATTR_FILL_LAST); - const XubString aNullStr; - - // set FillStyle and color when applying - aCoreSet.Put(XFillStyleItem(XFILL_SOLID)); - aCoreSet.Put(XFillColorItem(aNullStr, aBrushItem.GetColor())); - // Vorlagen-AutoUpdate - SwFrmFmt* pFmt = rSh.GetCurFrmFmt(); + aCoreSet.SetParent(&GetView().GetDocShell()->GetDoc()->GetDfltFrmFmt()->GetAttrSet()); + setSvxBrushItemAsFillAttributesToTargetSet(aBrushItem, aCoreSet); - if(pFmt && pFmt->IsAutoUpdateFmt()) + if((nsSelectionType::SEL_FRM & nSelType) || (nsSelectionType::SEL_GRF & nSelType)) { - rSh.AutoUpdateFrame( pFmt, aCoreSet); + // Vorlagen-AutoUpdate + SwFrmFmt* pFmt = rSh.GetCurFrmFmt(); + + if(pFmt && pFmt->IsAutoUpdateFmt()) + { + rSh.AutoUpdateFrame(pFmt, aCoreSet); + } + else + { + rSh.SetFlyFrmAttr(aCoreSet); + } } else { - rSh.SetFlyFrmAttr( aCoreSet ); - } - } - else - { - SwTxtFmtColl* pColl = rSh.GetCurTxtFmtColl(); - if( pColl && pColl->IsAutoUpdateFmt()) - { - SfxItemSet aSet(GetPool(), RES_BACKGROUND, RES_BACKGROUND ); - aSet.Put(aBrushItem); - rSh.AutoUpdatePara( pColl, aSet); + SwTxtFmtColl* pColl = rSh.GetCurTxtFmtColl(); + + if(pColl && pColl->IsAutoUpdateFmt()) + { + rSh.AutoUpdatePara(pColl, aCoreSet); + } + else + { + rSh.SetAttrSet(aCoreSet); + } } - else - rSh.SetAttrItem( aBrushItem ); } rReq.Done(); diff --git a/sw/source/ui/shells/drwbassh.cxx b/sw/source/ui/shells/drwbassh.cxx index 7d183ccd1fcc..bea5ca19c6f7 100644 --- a/sw/source/ui/shells/drwbassh.cxx +++ b/sw/source/ui/shells/drwbassh.cxx @@ -19,12 +19,9 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include <tools/shl.hxx> #include <hintids.hxx> #include <helpid.h> @@ -57,7 +54,6 @@ #include <svx/svdogrp.hxx> #include <svx/svdpage.hxx> #include <svx/svditer.hxx> - #include <shells.hrc> #define SwDrawBaseShell #include <sfx2/msg.hxx> @@ -70,9 +66,9 @@ #include <com/sun/star/text/HoriOrientation.hpp> #include <com/sun/star/text/VertOrientation.hpp> #include <com/sun/star/text/RelOrientation.hpp> - #include <IDocumentDrawModelAccess.hxx> #include <svx/fmmodel.hxx> +#include <drawdoc.hxx> using namespace ::com::sun::star; @@ -647,7 +643,7 @@ IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxNameDialog*, pNam else { nRet = 1; - SdrModel* pModel = rSh.getIDocumentDrawModelAccess()->GetDrawModel(); + SwDrawModel* pModel = rSh.getIDocumentDrawModelAccess()->GetDrawModel(); // --> OD 2006-03-09 #i51726# - all drawing objects can be named now. // consider also drawing objects inside group objects // SdrPage* pPage = pModel->GetPage(0); diff --git a/sw/source/ui/shells/drwtxtex.cxx b/sw/source/ui/shells/drwtxtex.cxx index 0fbf9789852d..e40201385c3e 100644 --- a/sw/source/ui/shells/drwtxtex.cxx +++ b/sw/source/ui/shells/drwtxtex.cxx @@ -654,7 +654,7 @@ void SwDrawTextShell::GetState(SfxItemSet& rSet) !xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( aLocale )) rSet.DisableItem( SID_THES ); - //! avoid puting the same item as SfxBoolItem at the end of this function + //! avoid putting the same item as SfxBoolItem at the end of this function nSlotId = 0; break; } diff --git a/sw/source/ui/shells/frmsh.cxx b/sw/source/ui/shells/frmsh.cxx index 8621be134bcd..b9f9587b764b 100644 --- a/sw/source/ui/shells/frmsh.cxx +++ b/sw/source/ui/shells/frmsh.cxx @@ -76,10 +76,10 @@ #include "swabstdlg.hxx" #include "misc.hrc" #include <svx/dialogs.hrc> - #include <docsh.hxx> #include <svx/drawitem.hxx> #include <svx/fmmodel.hxx> +#include <drawdoc.hxx> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -441,18 +441,16 @@ void SwFrameShell::Execute(SfxRequest &rReq) SID_HTML_MODE, SID_HTML_MODE, // [10414 FN_GET_PRINT_AREA, FN_GET_PRINT_AREA, // [21032 FN_SURROUND, FN_HORI_ORIENT, // [21303 - FN_SET_FRM_NAME, FN_SET_FRM_NAME, // [21306 - FN_KEEP_ASPECT_RATIO, FN_KEEP_ASPECT_RATIO, // [21307 + FN_SET_FRM_NAME, FN_KEEP_ASPECT_RATIO, // [21306 FN_SET_FRM_ALT_NAME, FN_SET_FRM_ALT_NAME, // [21318 - FN_OLE_IS_MATH, FN_OLE_IS_MATH, // [22314 - FN_MATH_BASELINE_ALIGNMENT, FN_MATH_BASELINE_ALIGNMENT, // [22315 + FN_OLE_IS_MATH, FN_MATH_BASELINE_ALIGNMENT, // [22314 FN_PARAM_CHAIN_PREVIOUS, FN_PARAM_CHAIN_NEXT, // [22420 0); //UUUU create needed items for XPropertyList entries from the DrawModel so that // the Area TabPage can access them - const SdrModel* pDrawModel = rSh.GetView().GetDocShell()->GetDoc()->GetDrawModel(); + const SwDrawModel* pDrawModel = rSh.GetView().GetDocShell()->GetDoc()->GetDrawModel(); aSet.Put(SvxColorTableItem(pDrawModel->GetColorTableFromSdrModel(), SID_COLOR_TABLE)); aSet.Put(SvxGradientListItem(pDrawModel->GetGradientListFromSdrModel(), SID_GRADIENT_LIST)); diff --git a/sw/source/ui/shells/grfsh.cxx b/sw/source/ui/shells/grfsh.cxx index 2ec894b605e4..2ecdeda8360b 100644 --- a/sw/source/ui/shells/grfsh.cxx +++ b/sw/source/ui/shells/grfsh.cxx @@ -19,17 +19,10 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - - - -#ifndef _CMDID_H #include <cmdid.h> -#endif #include <hintids.hxx> #include <tools/urlobj.hxx> #include <vcl/msgbox.hxx> @@ -38,7 +31,6 @@ #include <svl/urihelper.hxx> #include <sfx2/docfile.hxx> #include <sfx2/dispatch.hxx> - #include <sfx2/objface.hxx> #include <editeng/sizeitem.hxx> #include <editeng/protitem.hxx> @@ -74,12 +66,14 @@ #include <swwait.hxx> #include <shells.hrc> #include <popup.hrc> - +#include <doc.hxx> +#include <docsh.hxx> +#include <svx/drawitem.hxx> #define SwGrfShell #include <sfx2/msg.hxx> #include "swslots.hxx" - #include "swabstdlg.hxx" +#include <drawdoc.hxx> #define TOOLBOX_NAME ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "colorbar" ) ) @@ -128,22 +122,41 @@ void SwGrfShell::Execute(SfxRequest &rReq) const SwViewOption* pVOpt = rSh.GetViewOptions(); SwViewOption aUsrPref( *pVOpt ); - SfxItemSet aSet(GetPool(), RES_FRMATR_BEGIN, RES_FRMATR_END-1, - RES_GRFATR_MIRRORGRF, RES_GRFATR_CROPGRF, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, - SID_ATTR_GRAF_KEEP_ZOOM, SID_ATTR_GRAF_KEEP_ZOOM, - SID_ATTR_GRAF_FRMSIZE, SID_ATTR_GRAF_FRMSIZE, - SID_ATTR_GRAF_FRMSIZE_PERCENT, SID_ATTR_GRAF_FRMSIZE_PERCENT, - SID_ATTR_GRAF_GRAPHIC, SID_ATTR_GRAF_GRAPHIC, - FN_PARAM_GRF_CONNECT, FN_PARAM_GRF_CONNECT, - SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE, - FN_GET_PRINT_AREA, FN_GET_PRINT_AREA, - FN_SET_FRM_NAME, FN_KEEP_ASPECT_RATIO, - FN_PARAM_GRF_DIALOG, FN_PARAM_GRF_DIALOG, - SID_DOCFRAME, SID_DOCFRAME, - SID_HTML_MODE, SID_HTML_MODE, - FN_SET_FRM_ALT_NAME, FN_SET_FRM_ALT_NAME, - 0); + SfxItemSet aSet(GetPool(), //UUUU sorted by indices + + RES_FRMATR_BEGIN,RES_FRMATR_END - 1, // [ 82 + RES_GRFATR_MIRRORGRF,RES_GRFATR_CROPGRF, // [ 123 + + //UUUU FillAttribute support + XATTR_FILL_FIRST, XATTR_FILL_LAST, // [ 1014 + + SID_DOCFRAME,SID_DOCFRAME, // [ 5598 + SID_ATTR_BORDER_INNER,SID_ATTR_BORDER_INNER, // [10023 + SID_ATTR_PAGE_SIZE,SID_ATTR_PAGE_SIZE, // [10051 + SID_ATTR_GRAF_KEEP_ZOOM,SID_ATTR_GRAF_KEEP_ZOOM, // [10882 + SID_ATTR_GRAF_FRMSIZE,SID_ATTR_GRAF_GRAPHIC, // [10884, contains SID_ATTR_GRAF_FRMSIZE_PERCENT + + //UUUU items to hand over XPropertyList things like + // XColorList, XHatchList, XGradientList and XBitmapList + // to the Area TabPage + SID_COLOR_TABLE, SID_BITMAP_LIST, // [10179 + + SID_HTML_MODE,SID_HTML_MODE, // [10414 + FN_GET_PRINT_AREA,FN_GET_PRINT_AREA, // [21032 + FN_PARAM_GRF_CONNECT,FN_PARAM_GRF_CONNECT, // [21153 + FN_PARAM_GRF_DIALOG,FN_PARAM_GRF_DIALOG, // [21171 + FN_SET_FRM_NAME,FN_KEEP_ASPECT_RATIO, // [21306 + FN_SET_FRM_ALT_NAME,FN_SET_FRM_ALT_NAME, // [21318 + 0); + + //UUUU create needed items for XPropertyList entries from the DrawModel so that + // the Area TabPage can access them + const SwDrawModel* pDrawModel = rSh.GetView().GetDocShell()->GetDoc()->GetDrawModel(); + + aSet.Put(SvxColorTableItem(pDrawModel->GetColorTableFromSdrModel(), SID_COLOR_TABLE)); + aSet.Put(SvxGradientListItem(pDrawModel->GetGradientListFromSdrModel(), SID_GRADIENT_LIST)); + aSet.Put(SvxHatchListItem(pDrawModel->GetHatchListFromSdrModel(), SID_HATCH_LIST)); + aSet.Put(SvxBitmapListItem(pDrawModel->GetBitmapListFromSdrModel(), SID_BITMAP_LIST)); sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell()); aSet.Put(SfxUInt16Item(SID_HTML_MODE, nHtmlMode)); diff --git a/sw/source/ui/shells/grfshex.cxx b/sw/source/ui/shells/grfshex.cxx index 2bd91838b3a2..521c92d552fb 100644 --- a/sw/source/ui/shells/grfshex.cxx +++ b/sw/source/ui/shells/grfshex.cxx @@ -19,12 +19,9 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include <docary.hxx> #include <grfsh.hxx> #include <wrtsh.hxx> @@ -52,7 +49,6 @@ #include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp> #include <com/sun/star/ui/dialogs/ListboxControlActions.hpp> #include <poolfmt.hrc> - #include <sfx2/request.hxx> #include <sfx2/viewfrm.hxx> #include <svl/stritem.hxx> @@ -60,11 +56,9 @@ #include <vcl/svapp.hxx> #include <doc.hxx> #include <svx/fmmodel.hxx> - -// -> #111827# #include <SwRewriter.hxx> #include <comcore.hrc> -// <- #111827# +#include <drawdoc.hxx> using namespace ::com::sun::star::uno; using namespace ::com::sun::star::ui::dialogs; diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx index 0ea6c9181b5c..ddf3e1609567 100644 --- a/sw/source/ui/shells/textsh1.cxx +++ b/sw/source/ui/shells/textsh1.cxx @@ -19,20 +19,16 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" #include <com/sun/star/i18n/WordType.hpp> #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp> - #include <comphelper/processfactory.hxx> #include <svx/dialogs.hrc> #include <hintids.hxx> #include <cmdid.h> #include <helpid.h> - #include <i18npool/mslangid.hxx> #include <svl/languageoptions.hxx> #include <editeng/langitem.hxx> @@ -91,7 +87,6 @@ #include <edtwin.hxx> #include <redlndlg.hxx> #include "fldmgr.hxx" - #include <globals.hrc> #include <shells.hrc> #include <app.hrc> @@ -102,15 +97,12 @@ #include <vcl/svapp.hxx> #include <sfx2/app.hxx> #include <breakit.hxx> - #include <SwSmartTagMgr.hxx> - #include <editeng/acorrcfg.hxx> #include "swabstdlg.hxx" #include "misc.hrc" #include "chrdlg.hrc" #include <IDocumentStatistics.hxx> - #include <sfx2/sfxdlg.hxx> #include <svl/languageoptions.hxx> #include <unotools/lingucfg.hxx> @@ -125,22 +117,16 @@ #include <pam.hxx> #include <sfx2/objface.hxx> #include <langhelper.hxx> - -#ifndef _NBDTMGFACT_HXX #include <svx/nbdtmgfact.hxx> -#endif -#ifndef _NBDTMG_HXX #include <svx/nbdtmg.hxx> -#endif - - +#include <svx/svdmodel.hxx> +#include <svx/drawitem.hxx> #include <numrule.hxx> - +#include <drawdoc.hxx> using namespace ::com::sun::star; using namespace svx::sidebar; - void lcl_CharDialog( SwWrtShell &rWrtSh, sal_Bool bUseDialog, sal_uInt16 nSlot,const SfxItemSet *pArgs, SfxRequest *pReq ) { FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast< SwWebView* >( &rWrtSh.GetView())); @@ -896,27 +882,45 @@ void SwTextShell::Execute(SfxRequest &rReq) { FieldUnit eMetric = ::GetDfltMetric(0 != dynamic_cast< SwWebView* >( &GetView())); SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric))); - SfxItemSet aCoreSet( GetPool(), - RES_PARATR_BEGIN, RES_PARATR_END - 1, - // --> OD 2008-02-25 #refactorlists# - RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END - 1, - // <-- - RES_FRMATR_BEGIN, RES_FRMATR_END - 1, - SID_ATTR_TABSTOP_POS, SID_ATTR_TABSTOP_POS, - SID_ATTR_TABSTOP_DEFAULTS, SID_ATTR_TABSTOP_DEFAULTS, - SID_ATTR_TABSTOP_OFFSET, SID_ATTR_TABSTOP_OFFSET, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, - SID_ATTR_PARA_MODEL, SID_ATTR_PARA_KEEP, - SID_ATTR_PARA_PAGENUM, SID_ATTR_PARA_PAGENUM, - SID_HTML_MODE, SID_HTML_MODE, - FN_PARAM_1, FN_PARAM_1, - FN_NUMBER_NEWSTART, FN_NUMBER_NEWSTART_AT, - FN_DROP_TEXT, FN_DROP_CHAR_STYLE_NAME, + SfxItemSet aCoreSet( GetPool(), //UUUU sorted by indices, one group of three concatenated + RES_PARATR_BEGIN, RES_PARATR_END - 1, // [60 + RES_PARATR_LIST_BEGIN, RES_PARATR_LIST_END - 1, // [77 + RES_FRMATR_BEGIN, RES_FRMATR_END - 1, // [82 + + //UUUU FillAttribute support + XATTR_FILL_FIRST, XATTR_FILL_LAST, // [1014 + + // includes SID_ATTR_TABSTOP_POS + SID_ATTR_TABSTOP_DEFAULTS, SID_ATTR_TABSTOP_OFFSET, // [10003 .. 10005 + + SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, // [10023 + SID_ATTR_PARA_MODEL, SID_ATTR_PARA_KEEP, // [10065 + + //UUUU items to hand over XPropertyList things like + // XColorList, XHatchList, XGradientList and XBitmapList + // to the Area TabPage + SID_COLOR_TABLE, SID_BITMAP_LIST, // [10179 + + SID_HTML_MODE, SID_HTML_MODE, // [10414 + SID_ATTR_PARA_PAGENUM, SID_ATTR_PARA_PAGENUM, // [10457 + FN_PARAM_1, FN_PARAM_1, // [21160 + FN_NUMBER_NEWSTART, FN_NUMBER_NEWSTART_AT, // [21738 + FN_DROP_TEXT, FN_DROP_CHAR_STYLE_NAME, // [22418 0); - // --> OD 2008-01-16 #newlistlevelattrs# + // get also the list level indent values merged as LR-SPACE item, if needed. rWrtSh.GetCurAttr( aCoreSet, true ); - // <-- + + //UUUU create needed items for XPropertyList entries from the DrawModel so that + // the Area TabPage can access them + // Do this after GetCurAttr, this resets the ItemSet content again + const SwDrawModel* pDrawModel = GetView().GetDocShell()->GetDoc()->GetDrawModel(); + + aCoreSet.Put(SvxColorTableItem(pDrawModel->GetColorTableFromSdrModel(), SID_COLOR_TABLE)); + aCoreSet.Put(SvxGradientListItem(pDrawModel->GetGradientListFromSdrModel(), SID_GRADIENT_LIST)); + aCoreSet.Put(SvxHatchListItem(pDrawModel->GetHatchListFromSdrModel(), SID_HATCH_LIST)); + aCoreSet.Put(SvxBitmapListItem(pDrawModel->GetBitmapListFromSdrModel(), SID_BITMAP_LIST)); + aCoreSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(GetView().GetDocShell()))); diff --git a/sw/source/ui/sidebar/WrapPropertyPanel.hxx b/sw/source/ui/sidebar/WrapPropertyPanel.hxx index 292cb1e22d6b..cac77ade11ce 100644 --- a/sw/source/ui/sidebar/WrapPropertyPanel.hxx +++ b/sw/source/ui/sidebar/WrapPropertyPanel.hxx @@ -72,7 +72,7 @@ namespace sw { namespace sidebar { ImageList aWrapIL; ImageList aWrapILH; - //Controler Items================================== + //Controller Items================================== ::sfx2::sidebar::ControllerItem maSwNoWrapControl; ::sfx2::sidebar::ControllerItem maSwWrapLeftControl; ::sfx2::sidebar::ControllerItem maSwWrapRightControl; diff --git a/sw/source/ui/uiview/pview.cxx b/sw/source/ui/uiview/pview.cxx index 11988add957f..246b5543e8fe 100644 --- a/sw/source/ui/uiview/pview.cxx +++ b/sw/source/ui/uiview/pview.cxx @@ -2105,7 +2105,7 @@ uno::Reference< ::com::sun::star::accessibility::XAccessible > SwPagePreViewWin::CreateAccessible() { vos::OGuard aGuard(Application::GetSolarMutex()); // this should have - // happend already!!! + // happened already!!! DBG_ASSERT( GetViewShell() != NULL, "We need a view shell" ); ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc = GetAccessible( sal_False ); diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx index d0e6a373bfd1..646dc91ef60b 100644 --- a/sw/source/ui/uiview/view.cxx +++ b/sw/source/ui/uiview/view.cxx @@ -1682,10 +1682,11 @@ void SwView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) //#i76332# if document is to be opened in alive-mode then this has to be regarded while switching from readonly-mode to edit-mode if( !bReadonly ) { - SwDrawDocument * pDrawDoc = 0; - if ( 0 != ( pDrawDoc = dynamic_cast< SwDrawDocument * > (GetDocShell()->GetDoc()->GetDrawModel() ) ) ) + SwDrawModel* pDrawModel = 0; + + if ( 0 != ( pDrawModel = GetDocShell()->GetDoc()->GetDrawModel() ) ) { - if( !pDrawDoc->GetOpenInDesignMode() ) + if( !pDrawModel->GetOpenInDesignMode() ) break;// don't touch the design mode } } diff --git a/sw/source/ui/uiview/view2.cxx b/sw/source/ui/uiview/view2.cxx index dd4eab5a9455..c437d0992030 100644 --- a/sw/source/ui/uiview/view2.cxx +++ b/sw/source/ui/uiview/view2.cxx @@ -1013,7 +1013,7 @@ void __EXPORT SwView::Execute(SfxRequest &rReq) //GetViewFrame()->ShowChildWindow(nSlot, bShow && bInMailMerge); if((bShow && bInMailMerge) != GetViewFrame()->HasChildWindow(nSlot)) GetViewFrame()->ToggleChildWindow(nSlot); - //if fields have been succesfully inserted call the "real" + //if fields have been successfully inserted call the "real" //mail merge dialog SwWrtShell &rSh = GetWrtShell(); if(bInMailMerge && rSh.IsAnyDatabaseFieldInDoc()) diff --git a/sw/source/ui/uiview/viewport.cxx b/sw/source/ui/uiview/viewport.cxx index 5e6c8128b597..6ec26419a25e 100644 --- a/sw/source/ui/uiview/viewport.cxx +++ b/sw/source/ui/uiview/viewport.cxx @@ -714,7 +714,7 @@ IMPL_LINK( SwView, ScrollHdl, SwScrollbar *, pScrollbar ) { //Hier wieder auskommentieren wenn das mitscrollen nicht gewuenscht ist. // JP 21.07.00: the end scrollhandler invalidate the FN_STAT_PAGE, - // so we dont must do it agin. + // so we dont must do it again. EndScrollHdl(pScrollbar); if ( Help::IsQuickHelpEnabled() && @@ -730,7 +730,7 @@ IMPL_LINK( SwView, ScrollHdl, SwScrollbar *, pScrollbar ) if(pWrtShell->GetPageNumber( aPos.Y(), sal_False, nPhNum, nVirtNum, sDisplay )) { // JP 21.07.00: the end scrollhandler invalidate the FN_STAT_PAGE, - // so we dont must do it agin. + // so we dont must do it again. // if(!GetViewFrame()->GetFrame().IsInPlace()) // S F X_BINDINGS().Update(FN_STAT_PAGE); diff --git a/sw/source/ui/uiview/viewstat.cxx b/sw/source/ui/uiview/viewstat.cxx index aee1ca50f096..6a86182e04d7 100644 --- a/sw/source/ui/uiview/viewstat.cxx +++ b/sw/source/ui/uiview/viewstat.cxx @@ -19,8 +19,6 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" @@ -30,7 +28,6 @@ #include <svl/aeitem.hxx> #include <svl/whiter.hxx> #include <svl/cjkoptions.hxx> - #include <sfx2/viewfrm.hxx> #include <sfx2/objitem.hxx> #include <svl/imageitm.hxx> @@ -58,11 +55,12 @@ #include <svl/stritem.hxx> #include <unotools/moduleoptions.hxx> #include <svl/visitem.hxx> - #include <cmdid.h> - #include <IDocumentRedlineAccess.hxx> +//UUUU +#include <doc.hxx> + using namespace ::com::sun::star; /*-------------------------------------------------------------------- @@ -144,6 +142,15 @@ void SwView::GetState(SfxItemSet &rSet) { const sal_uInt16 nCurIdx = pWrtShell->GetCurPageDesc(); const SwPageDesc& rDesc = pWrtShell->GetPageDesc( nCurIdx ); + + //UUUU set correct parent to get the XFILL_NONE FillStyle as needed + if(!rSet.GetParent()) + { + const SwFrmFmt& rMaster = rDesc.GetMaster(); + + rSet.SetParent(&rMaster.GetDoc()->GetDfltFrmFmt()->GetAttrSet()); + } + ::PageDescToItemSet( rDesc, rSet); } break; diff --git a/sw/source/ui/uno/unodefaults.cxx b/sw/source/ui/uno/unodefaults.cxx index da4913d9acd9..10b5cc96d2e5 100644 --- a/sw/source/ui/uno/unodefaults.cxx +++ b/sw/source/ui/uno/unodefaults.cxx @@ -19,17 +19,15 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" - #include <unodefaults.hxx> #include <svx/svdmodel.hxx> #include <svx/unoprov.hxx> #include <doc.hxx> #include <svx/fmmodel.hxx> +#include <drawdoc.hxx> /* -----------------------------13.03.01 14:16-------------------------------- diff --git a/sw/source/ui/uno/unodispatch.cxx b/sw/source/ui/uno/unodispatch.cxx index 732f32ddc5e4..6f2b765d5f54 100644 --- a/sw/source/ui/uno/unodispatch.cxx +++ b/sw/source/ui/uno/unodispatch.cxx @@ -60,7 +60,7 @@ SwXDispatchProviderInterceptor::SwXDispatchProviderInterceptor(SwView& rVw) : m_refCount++; m_xIntercepted->registerDispatchProviderInterceptor((frame::XDispatchProviderInterceptor*)this); // this should make us the top-level dispatch-provider for the component, via a call to our - // setDispatchProvider we should have got an fallback for requests we (i.e. our master) cannot fullfill + // setDispatchProvider we should have got an fallback for requests we (i.e. our master) cannot fulfill uno::Reference< lang::XComponent> xInterceptedComponent(m_xIntercepted, uno::UNO_QUERY); if (xInterceptedComponent.is()) xInterceptedComponent->addEventListener((lang::XEventListener*)this); diff --git a/sw/source/ui/uno/unomailmerge.cxx b/sw/source/ui/uno/unomailmerge.cxx index 77740e822081..bb0d92981621 100644 --- a/sw/source/ui/uno/unomailmerge.cxx +++ b/sw/source/ui/uno/unomailmerge.cxx @@ -111,7 +111,7 @@ osl::Mutex & GetMailMergeMutex() enum CloseResult { eSuccess, // successfully closed - eVetoed, // vetoed, ownership transfered to the vetoing instance + eVetoed, // vetoed, ownership transferred to the vetoing instance eFailed // failed for some unknown reason }; static CloseResult CloseModelAndDocSh( @@ -279,7 +279,7 @@ namespace try { sal_Bool bDeliverOwnership = ( 0 == m_nPendingDeleteAttempts ); - // if this is our last attemt, then anybody which vetoes this has to take the consequences + // if this is our last attempt, then anybody which vetoes this has to take the consequences // (means take the ownership) m_xDocument->close( bDeliverOwnership ); bSuccess = sal_True; @@ -448,7 +448,7 @@ SwXMailMerge::~SwXMailMerge() //! because there is no automatism that will do that later. //! #120086# if ( eVetoed == CloseModelAndDocSh( xModel, xDocSh ) ) - DBG_WARNING( "owner ship transfered to vetoing object!" ); + DBG_WARNING( "owner ship transferred to vetoing object!" ); xModel = 0; xDocSh = 0; // destroy doc shell diff --git a/sw/source/ui/uno/unotxdoc.cxx b/sw/source/ui/uno/unotxdoc.cxx index 408d6b1a44f3..9aa3cf421152 100644 --- a/sw/source/ui/uno/unotxdoc.cxx +++ b/sw/source/ui/uno/unotxdoc.cxx @@ -1258,7 +1258,7 @@ void SwXTextDocument::printPages(const Sequence< beans::PropertyValue >& xOption OUString sFileURL; if ( (rProp.Value >>= sFileURL ) ) { - // Convert the File URL into a system dependant path, as the SalPrinter expects + // Convert the File URL into a system dependent path, as the SalPrinter expects OUString sSystemPath; FileBase::getSystemPathFromFileURL ( sFileURL, sSystemPath ); aReq.AppendItem(SfxStringItem( SID_FILE_NAME, sSystemPath ) ); @@ -2093,11 +2093,13 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, break; case WID_DOC_AUTOMATIC_CONTROL_FOCUS: { - SwDrawDocument * pDrawDoc; + SwDrawModel* pDrawModel = 0; sal_Bool bAuto = *(sal_Bool*) aValue.getValue(); - if ( 0 != ( pDrawDoc = dynamic_cast< SwDrawDocument * >( pDocShell->GetDoc()->GetDrawModel() ) ) ) - pDrawDoc->SetAutoControlFocus( bAuto ); + if ( 0 != ( pDrawModel = pDocShell->GetDoc()->GetDrawModel() ) ) + { + pDrawModel->SetAutoControlFocus( bAuto ); + } else if (bAuto) { // if setting to true, and we don't have an @@ -2106,19 +2108,21 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, // SdrModel and we are leaving the default at false, // we don't need to make an SdrModel and can do nothing // --> OD 2005-08-08 #i52858# - method name changed - pDrawDoc = dynamic_cast< SwDrawDocument * > (pDocShell->GetDoc()->GetOrCreateDrawModel() ); + pDrawModel = pDocShell->GetDoc()->GetOrCreateDrawModel(); // <-- - pDrawDoc->SetAutoControlFocus ( bAuto ); + pDrawModel->SetAutoControlFocus ( bAuto ); } } break; case WID_DOC_APPLY_FORM_DESIGN_MODE: { - SwDrawDocument * pDrawDoc; + SwDrawModel* pDrawModel = 0; sal_Bool bMode = *(sal_Bool*)aValue.getValue(); - if ( 0 != ( pDrawDoc = dynamic_cast< SwDrawDocument * > (pDocShell->GetDoc()->GetDrawModel() ) ) ) - pDrawDoc->SetOpenInDesignMode( bMode ); + if ( 0 != ( pDrawModel = pDocShell->GetDoc()->GetDrawModel() ) ) + { + pDrawModel->SetOpenInDesignMode( bMode ); + } else if (!bMode) { // if setting to false, and we don't have an @@ -2128,9 +2132,9 @@ void SwXTextDocument::setPropertyValue(const OUString& rPropertyName, // we don't need to make an SdrModel and can do // nothing // --> OD 2005-08-08 #i52858# - method name changed - pDrawDoc = dynamic_cast< SwDrawDocument * > (pDocShell->GetDoc()->GetOrCreateDrawModel() ); + pDrawModel = pDocShell->GetDoc()->GetOrCreateDrawModel(); // <-- - pDrawDoc->SetOpenInDesignMode ( bMode ); + pDrawModel->SetOpenInDesignMode ( bMode ); } } break; @@ -2273,23 +2277,35 @@ Any SwXTextDocument::getPropertyValue(const OUString& rPropertyName) break; case WID_DOC_AUTOMATIC_CONTROL_FOCUS: { - SwDrawDocument * pDrawDoc; - sal_Bool bAuto; - if ( 0 != ( pDrawDoc = dynamic_cast< SwDrawDocument * > (pDocShell->GetDoc()->GetDrawModel() ) ) ) - bAuto = pDrawDoc->GetAutoControlFocus(); + SwDrawModel* pDrawModel = 0; + sal_Bool bAuto(sal_False); + + if ( 0 != ( pDrawModel = pDocShell->GetDoc()->GetDrawModel() ) ) + { + bAuto = pDrawModel->GetAutoControlFocus(); + } else + { bAuto = sal_False; + } + aAny.setValue(&bAuto, ::getBooleanCppuType()); } break; case WID_DOC_APPLY_FORM_DESIGN_MODE: { - SwDrawDocument * pDrawDoc; - sal_Bool bMode; - if ( 0 != ( pDrawDoc = dynamic_cast< SwDrawDocument * > (pDocShell->GetDoc()->GetDrawModel() ) ) ) - bMode = pDrawDoc->GetOpenInDesignMode(); + SwDrawModel* pDrawModel = 0; + sal_Bool bMode(sal_False); + + if ( 0 != ( pDrawModel = pDocShell->GetDoc()->GetDrawModel() ) ) + { + bMode = pDrawModel->GetOpenInDesignMode(); + } else + { bMode = sal_True; + } + aAny.setValue(&bMode, ::getBooleanCppuType()); } break; diff --git a/sw/source/ui/utlui/content.cxx b/sw/source/ui/utlui/content.cxx index abd5759f9c44..913aca6ca15d 100644 --- a/sw/source/ui/utlui/content.cxx +++ b/sw/source/ui/utlui/content.cxx @@ -19,8 +19,6 @@ * *************************************************************/ - - // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" @@ -85,22 +83,16 @@ #include <numrule.hxx> #include <swundo.hxx> #include <ndtxt.hxx> -//#include <ndgrf.hxx> #include <fmtcntnt.hxx> #include <PostItMgr.hxx> -//#include <../../core/inc/flyfrm.hxx> -//#include <../../core/inc/cntfrm.hxx> -//#include <ndnotxt.hxx> -//#include <postit.hxx> #include <postithelper.hxx> #include <redline.hxx> #include <docary.hxx> - #include "swabstdlg.hxx" #include "globals.hrc" #include <unomid.h> #include <svx/fmmodel.hxx> - +#include <drawdoc.hxx> #define CTYPE_CNT 0 #define CTYPE_CTT 1 @@ -447,7 +439,7 @@ void SwContentType::Init(sal_Bool* pbInvalidateWindow) { sTypeToken = aEmptyStr; nMemberCount = 0; - SdrModel* pModel = pWrtShell->getIDocumentDrawModelAccess()->GetDrawModel(); + SwDrawModel* pModel = pWrtShell->getIDocumentDrawModelAccess()->GetDrawModel(); if(pModel) { SdrPage* pPage = pModel->GetPage(0); @@ -816,7 +808,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibiblityChanged) pMember->DeleteAndDestroy(0, pMember->Count()); IDocumentDrawModelAccess* pIDDMA = pWrtShell->getIDocumentDrawModelAccess(); - SdrModel* pModel = pIDDMA->GetDrawModel(); + SwDrawModel* pModel = pIDDMA->GetDrawModel(); if(pModel) { SdrPage* pPage = pModel->GetPage(0); @@ -956,7 +948,7 @@ String SwContentTree::GetEntryAltText( SvLBoxEntry* pEntry ) const SdrView* pDrawView = pActiveShell->GetDrawView(); if (pDrawView) { - SdrModel* pDrawModel = pActiveShell->GetDoc()->GetDrawModel(); + SwDrawModel* pDrawModel = pActiveShell->GetDoc()->GetDrawModel(); SdrPage* pPage = pDrawModel->GetPage(0); const sal_uInt32 nCount = pPage->GetObjCount(); for( sal_uInt32 i=0; i< nCount; i++ ) @@ -1034,7 +1026,7 @@ String SwContentTree::GetEntryLongDescription( SvLBoxEntry* pEntry ) const SdrView* pDrawView = pActiveShell->GetDrawView(); if (pDrawView) { - SdrModel* pDrawModel = pActiveShell->GetDoc()->GetDrawModel(); + SwDrawModel* pDrawModel = pActiveShell->GetDoc()->GetDrawModel(); SdrPage* pPage = pDrawModel->GetPage(0); sal_uInt32 nCount = pPage->GetObjCount(); for( sal_uInt32 i=0; i< nCount; i++ ) @@ -1400,7 +1392,7 @@ SdrObject* SwContentTree::GetDrawingObjectsByContent(const SwContent *pCnt) SdrView* pDrawView = pActiveShell->GetDrawView(); if (pDrawView) { - SdrModel* pDrawModel = pActiveShell->GetDoc()->GetDrawModel(); + SwDrawModel* pDrawModel = pActiveShell->GetDoc()->GetDrawModel(); SdrPage* pPage = pDrawModel->GetPage(0); sal_uInt32 nCount = pPage->GetObjCount(); @@ -2681,7 +2673,7 @@ void SwContentTree::KeyInput(const KeyEvent& rEvent) { pDrawView->SdrEndTextEdit();//Change from "EndTextEdit" to "SdrEndTextEdit" for acc migration - SdrModel* pDrawModel = pActiveShell->GetDoc()->GetDrawModel(); + SwDrawModel* pDrawModel = pActiveShell->GetDoc()->GetDrawModel(); SdrPage* pPage = pDrawModel->GetPage(0); sal_uInt32 nCount = pPage->GetObjCount(); sal_Bool hasObjectMarked = sal_False; @@ -3381,7 +3373,7 @@ void SwContentTree::GotoContent(SwContent* pCnt) { pDrawView->SdrEndTextEdit(); pDrawView->UnmarkAll(); - SdrModel* _pModel = pActiveShell->getIDocumentDrawModelAccess()->GetDrawModel(); + SwDrawModel* _pModel = pActiveShell->getIDocumentDrawModelAccess()->GetDrawModel(); SdrPage* pPage = _pModel->GetPage(0); sal_uInt32 nCount = pPage->GetObjCount(); for( sal_uInt32 i=0; i< nCount; i++ ) diff --git a/sw/source/ui/utlui/navipi.cxx b/sw/source/ui/utlui/navipi.cxx index 869a48a521ae..050e57b3bf27 100644 --- a/sw/source/ui/utlui/navipi.cxx +++ b/sw/source/ui/utlui/navipi.cxx @@ -803,6 +803,7 @@ SwNavigationPI::SwNavigationPI( SfxBindings* _pBindings, aContentToolBox.SetHelpId(HID_NAVIGATOR_TOOLBOX ); aGlobalToolBox.SetHelpId(HID_NAVIGATOR_GLOBAL_TOOLBOX); aDocListBox.SetHelpId(HID_NAVIGATOR_LISTBOX ); + aDocListBox.SetDropDownLineCount(9); nDocLBIniHeight = aDocListBox.GetSizePixel().Height(); nZoomOutInit = nZoomOut = Resource::ReadShortRes(); diff --git a/sw/source/ui/utlui/uitool.cxx b/sw/source/ui/utlui/uitool.cxx index 78a2d381d097..4db50c999776 100644 --- a/sw/source/ui/utlui/uitool.cxx +++ b/sw/source/ui/utlui/uitool.cxx @@ -385,12 +385,19 @@ void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet) // HeaderInfo, Raender, Hintergrund, Umrandung // - SfxItemSet aHeaderSet( *rSet.GetPool(), - SID_ATTR_PAGE_ON, SID_ATTR_PAGE_SHARED, - SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, - RES_FRMATR_BEGIN, RES_FRMATR_END-1, - 0); + SfxItemSet aHeaderSet(*rSet.GetPool(), + RES_FRMATR_BEGIN,RES_FRMATR_END - 1, // [82 + + //UUUU FillAttribute support + XATTR_FILL_FIRST, XATTR_FILL_LAST, // [1014 + + SID_ATTR_BORDER_INNER,SID_ATTR_BORDER_INNER, // [10023 + SID_ATTR_PAGE_SIZE,SID_ATTR_PAGE_SIZE, // [10051 + SID_ATTR_PAGE_ON,SID_ATTR_PAGE_SHARED, // [10060 + 0, 0); + + //UUUU set correct parent to get the XFILL_NONE FillStyle as needed + aHeaderSet.SetParent(&rMaster.GetDoc()->GetDfltFrmFmt()->GetAttrSet()); // dynamische oder feste Hoehe // @@ -431,12 +438,19 @@ void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet) // FooterInfo, Raender, Hintergrund, Umrandung // - SfxItemSet aFooterSet( *rSet.GetPool(), - SID_ATTR_PAGE_ON, SID_ATTR_PAGE_SHARED, - SID_ATTR_PAGE_SIZE, SID_ATTR_PAGE_SIZE, - SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, - RES_FRMATR_BEGIN, RES_FRMATR_END-1, - 0); + SfxItemSet aFooterSet(*rSet.GetPool(), + RES_FRMATR_BEGIN,RES_FRMATR_END - 1, // [82 + + //UUUU FillAttribute support + XATTR_FILL_FIRST, XATTR_FILL_LAST, // [1014 + + SID_ATTR_BORDER_INNER,SID_ATTR_BORDER_INNER, // [10023 + SID_ATTR_PAGE_SIZE,SID_ATTR_PAGE_SIZE, // [10051 + SID_ATTR_PAGE_ON,SID_ATTR_PAGE_SHARED, // [10060 + 0, 0); + + //UUUU set correct parent to get the XFILL_NONE FillStyle as needed + aFooterSet.SetParent(&rMaster.GetDoc()->GetDfltFrmFmt()->GetAttrSet()); // dynamische oder feste Hoehe // diff --git a/sw/source/ui/wrtsh/select.cxx b/sw/source/ui/wrtsh/select.cxx index 574decb055d0..60be62e7de97 100644 --- a/sw/source/ui/wrtsh/select.cxx +++ b/sw/source/ui/wrtsh/select.cxx @@ -65,7 +65,7 @@ static sal_Bool bStartDrag = sal_False; void SwWrtShell::Invalidate() { - // to avoid making the slot volatile, invalidate it everytime if something could have been changed + // to avoid making the slot volatile, invalidate it every time if something could have been changed // this is still much cheaper than asking for the state every 200 ms (and avoid background processing) GetView().GetViewFrame()->GetBindings().Invalidate( FN_STAT_SELMODE ); } diff --git a/sw/source/ui/wrtsh/wrtsh2.cxx b/sw/source/ui/wrtsh/wrtsh2.cxx index 00ccaf63b9af..4ad98e910a1c 100644 --- a/sw/source/ui/wrtsh/wrtsh2.cxx +++ b/sw/source/ui/wrtsh/wrtsh2.cxx @@ -100,7 +100,10 @@ void SwWrtShell::Insert( SwField& rFld ) GetTblCrs()->Normalize( sal_False ); const SwPosition rStartPos( *(GetTblCrs()->GetMark()->nNode.GetNode().GetCntntNode()), 0 ); KillPams(); - EndPara(); + if ( !IsEndOfPara() ) + { + EndPara(); + } const SwPosition rEndPos( *GetCurrentShellCursor().GetPoint() ); pAnnotationTextRange = new SwPaM( rStartPos, rEndPos ); } |