diff options
Diffstat (limited to 'sw/source/ui/app/docsh.cxx')
-rw-r--r-- | sw/source/ui/app/docsh.cxx | 64 |
1 files changed, 12 insertions, 52 deletions
diff --git a/sw/source/ui/app/docsh.cxx b/sw/source/ui/app/docsh.cxx index 794b6032b7..47fe7e04c8 100644 --- a/sw/source/ui/app/docsh.cxx +++ b/sw/source/ui/app/docsh.cxx @@ -93,11 +93,8 @@ #include <swcli.hxx> #include <txtftn.hxx> #include <ftnidx.hxx> - -// --> FME 2004-08-05 #i20883# Digital Signatures and Encryption #include <fldbas.hxx> #include <docary.hxx> -// <-- #include <swerror.h> // Fehlermeldungen #include <helpid.h> #include <cmdid.h> @@ -123,7 +120,7 @@ #include <unomid.h> #include <sfx2/Metadatable.hxx> - +#include <switerator.hxx> using rtl::OUString; using namespace ::com::sun::star; @@ -912,32 +909,6 @@ Rectangle SwDocShell::GetVisArea( sal_uInt16 nAspect ) const const SwRect aPageRect = pNd->FindPageFrmRect( sal_False, 0, sal_False ); return aPageRect.SVRect(); - - // Why does this have to be that complicated? I replaced this by the - // call of FindPageFrmRect(): - /* - //PageDesc besorgen, vom ersten Absatz oder den default. - const SwFmtPageDesc &rDesc = pNd->GetSwAttrSet().GetPageDesc(); - const SwPageDesc* pDesc = rDesc.GetPageDesc(); - if( !pDesc ) - pDesc = &const_cast<const SwDoc *>(pDoc)->GetPageDesc( 0 ); - - //Das Format wird evtl. von der virtuellen Seitennummer bestimmt. - const sal_uInt16 nPgNum = rDesc.GetNumOffset(); - const sal_Bool bOdd = nPgNum % 2 ? sal_True : sal_False; - const SwFrmFmt *pFmt = bOdd ? pDesc->GetRightFmt() : pDesc->GetLeftFmt(); - if ( !pFmt ) //#40568# - pFmt = bOdd ? pDesc->GetLeftFmt() : pDesc->GetRightFmt(); - - if ( pFmt->GetFrmSize().GetWidth() == LONG_MAX ) - //Jetzt wird es aber Zeit fuer die Initialisierung - pDoc->getPrinter( true ); - - const SwFmtFrmSize& rFrmSz = pFmt->GetFrmSize(); - const Size aSz( rFrmSz.GetWidth(), rFrmSz.GetHeight() ); - const Point aPt( DOCUMENTBORDER, DOCUMENTBORDER ); - const Rectangle aRect( aPt, aSz ); - return aRect;*/ } return SfxObjectShell::GetVisArea( nAspect ); } @@ -982,17 +953,16 @@ sal_uInt16 SwDocShell::GetHiddenInformationState( sal_uInt16 nStates ) if ( GetWrtShell() ) { SwFieldType* pType = GetWrtShell()->GetFldType( RES_POSTITFLD, aEmptyStr ); - SwClientIter aIter( *pType ); - SwClient* pFirst = aIter.GoStart(); + SwIterator<SwFmtFld,SwFieldType> aIter( *pType ); + SwFmtFld* pFirst = aIter.First(); while( pFirst ) { - if( static_cast<SwFmtFld*>(pFirst)->GetTxtFld() && - static_cast<SwFmtFld*>(pFirst)->IsFldInDoc() ) + if( pFirst->GetTxtFld() && pFirst->IsFldInDoc() ) { nState |= HIDDENINFORMATION_NOTES; break; } - pFirst = ++aIter; + pFirst = aIter.Next(); } } } @@ -1016,26 +986,17 @@ void SwDocShell::GetState(SfxItemSet& rSet) { switch (nWhich) { - // MT: MakroChosser immer enablen, weil Neu moeglich - // case SID_BASICCHOOSER: - // { - // StarBASIC* pBasic = GetBasic(); - // StarBASIC* pAppBasic = SFX_APP()->GetBasic(); - // if ( !(pBasic->GetModules()->Count() || - // pAppBasic->GetModules()->Count()) ) - // rSet.DisableItem(nWhich); - // } - // break; case SID_PRINTPREVIEW: { sal_Bool bDisable = IsInPlaceActive(); + // Disable "multiple layout" if ( !bDisable ) { SfxViewFrame *pTmpFrm = SfxViewFrame::GetFirst(this); while (pTmpFrm) // Preview suchen { if ( PTR_CAST(SwView, pTmpFrm->GetViewShell()) && - ((SwView*)pTmpFrm->GetViewShell())->GetWrtShell().getIDocumentSettingAccess()->get(IDocumentSettingAccess::BROWSE_MODE)) + ((SwView*)pTmpFrm->GetViewShell())->GetWrtShell().GetViewOptions()->getBrowseMode() ) { bDisable = sal_True; break; @@ -1043,6 +1004,7 @@ void SwDocShell::GetState(SfxItemSet& rSet) pTmpFrm = pTmpFrm->GetNext(*pTmpFrm, this); } } + // End of disabled "multiple layout" if ( bDisable ) rSet.DisableItem( SID_PRINTPREVIEW ); else @@ -1244,9 +1206,8 @@ SwFEShell* SwDocShell::GetFEShell() void SwDocShell::RemoveOLEObjects() { - SwClientIter aIter( *(SwModify*)pDoc->GetDfltGrfFmtColl() ); - for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) ); - pNd; pNd = (SwCntntNode*)aIter.Next() ) + SwIterator<SwCntntNode,SwFmtColl> aIter( *pDoc->GetDfltGrfFmtColl() ); + for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() ) { SwOLENode* pOLENd = pNd->GetOLENode(); if( pOLENd && ( pOLENd->IsOLEObjectDeleted() || @@ -1273,9 +1234,8 @@ void SwDocShell::CalcLayoutForOLEObjects() if( !pWrtShell ) return; - SwClientIter aIter( *(SwModify*)pDoc->GetDfltGrfFmtColl() ); - for( SwCntntNode* pNd = (SwCntntNode*)aIter.First( TYPE( SwCntntNode ) ); - pNd; pNd = (SwCntntNode*)aIter.Next() ) + SwIterator<SwCntntNode,SwFmtColl> aIter( *pDoc->GetDfltGrfFmtColl() ); + for( SwCntntNode* pNd = aIter.First(); pNd; pNd = aIter.Next() ) { SwOLENode* pOLENd = pNd->GetOLENode(); if( pOLENd && pOLENd->IsOLESizeInvalid() ) |