diff options
author | jp <jp@openoffice.org> | 2000-09-27 16:35:00 +0000 |
---|---|---|
committer | jp <jp@openoffice.org> | 2000-09-27 16:35:00 +0000 |
commit | 0f3a5741f2af8d0cbb2478a6fddca75d6e1ed324 (patch) | |
tree | 02cfa4082f3ef40d76a0905d9676f805f6fc98c8 | |
parent | 0922e1baa5e5c6e148ae45b263265a5a483b088b (diff) |
remove old code of using no graphicobject
-rw-r--r-- | sw/source/core/bastyp/init.cxx | 37 | ||||
-rw-r--r-- | sw/source/core/bastyp/swtypes.cxx | 20 | ||||
-rw-r--r-- | sw/source/core/doc/notxtfrm.cxx | 506 | ||||
-rw-r--r-- | sw/source/core/docnode/swbaslnk.cxx | 259 | ||||
-rw-r--r-- | sw/source/filter/html/htmlgrin.cxx | 32 |
5 files changed, 14 insertions, 840 deletions
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index 250a868d0e2a..ed5c6956c1a3 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -2,9 +2,9 @@ * * $RCSfile: init.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-19 00:08:16 $ + * last change: $Author: jp $ $Date: 2000-09-27 17:34:01 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -300,16 +300,6 @@ #include <breakit.hxx> #endif -// ! Code for the new GraphicObject -#ifndef USE_GRFOBJECT - -#ifndef _GRFCACHE_HXX -#include <grfcache.hxx> -#endif - -#endif - - extern void _FrmFinit(); extern void ClearFEShellTabCols(); @@ -551,14 +541,6 @@ SfxItemInfo __FAR_DATA aSlotTab[] = USHORT* SwAttrPool::pVersionMap1 = 0; USHORT* SwAttrPool::pVersionMap2 = 0; USHORT* SwAttrPool::pVersionMap3 = 0; - -// ! Code for the new GraphicObject -#ifndef USE_GRFOBJECT - -SwGraphicCache* SwGraphicCacheObj::pGrfCache = 0; - -#endif - SwIndexReg* SwIndexReg::pEmptyIndexArray = 0; const sal_Char* __FAR_DATA pMarkToTable = "table"; @@ -858,13 +840,6 @@ void _InitCore() SwSelPaintRects::pMapMode = new MapMode; SwFntObj::pPixMap = new MapMode; -// ! Code for the new GraphicObject -#ifndef USE_GRFOBJECT - // Grafik-Cache Klasse anlegen - SwGraphicCacheObj::pGrfCache = new SwGraphicCache; - -#endif - SwIndexReg::pEmptyIndexArray = new SwIndexReg; pGlobalOLEExcludeList = new SvPtrarr; @@ -888,14 +863,6 @@ void _FinitCore() delete pBreakIt; delete pAppCharClass; -// ! Code for the new GraphicObject -#ifndef USE_GRFOBJECT - - // Grafik-Cache Klasse zerstoeren - delete SwGraphicCacheObj::pGrfCache; - -#endif - // das default TableAutoFormat zerstoeren delete SwTableAutoFmt::pDfltBoxAutoFmt; diff --git a/sw/source/core/bastyp/swtypes.cxx b/sw/source/core/bastyp/swtypes.cxx index 68b12f26b21f..5329b9703666 100644 --- a/sw/source/core/bastyp/swtypes.cxx +++ b/sw/source/core/bastyp/swtypes.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swtypes.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-19 00:08:16 $ + * last change: $Author: jp $ $Date: 2000-09-27 17:34:01 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -161,15 +161,6 @@ #include <sectfrm.hxx> #endif -// ! Code for the new GraphicObject -#ifndef USE_GRFOBJECT - -#ifndef _GRFCACHE_HXX -#include <grfcache.hxx> -#endif - -#endif - using namespace ::com::sun::star; using namespace ::utl; @@ -213,13 +204,6 @@ IMPL_FIXEDMEMPOOL_NEWDEL( SwTableFmt, 10, 10 ) IMPL_FIXEDMEMPOOL_NEWDEL( SwTableLineFmt, 10, 10 ) IMPL_FIXEDMEMPOOL_NEWDEL( SwTableBoxFmt, 50, 50 ) -// ! Code for the new GraphicObject -#ifndef USE_GRFOBJECT - -IMPL_FIXEDMEMPOOL_NEWDEL( SwGraphicCacheObj, 50, 50 ) - -#endif - #ifndef PROFILE #pragma code_seg() diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 9f6603822719..1cf5625c7ee8 100644 --- a/sw/source/core/doc/notxtfrm.cxx +++ b/sw/source/core/doc/notxtfrm.cxx @@ -2,9 +2,9 @@ * * $RCSfile: notxtfrm.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-19 00:08:16 $ + * last change: $Author: jp $ $Date: 2000-09-27 17:34:31 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -840,10 +840,6 @@ BOOL SwNoTxtFrm::GetCrsrOfst(SwPosition* pPos, Point& aPoint, return TRUE; } -/* */ -// Code for the new GraphicObject -#ifdef USE_GRFOBJECT - #define CLEARCACHE( pNd ) {\ (pNd)->GetGrfObj().ReleaseFromCache();\ SwFlyFrm* pFly = FindFlyFrm();\ @@ -1189,503 +1185,5 @@ BOOL SwNoTxtFrm::HasAnimation() const return pGrfNd && pGrfNd->IsAnimated(); } -/* */ -#else -// USE_GRFOBJECT - -#ifndef _GRFCACHE_HXX -#include <grfcache.hxx> -#endif - -#define CLEARCACHE( pNd ) {\ - ( pNd )->ClearQBmpCache();\ - SwFlyFrm* pFly = FindFlyFrm();\ - if( pFly && pFly->GetFmt()->GetSurround().IsContour() )\ - {\ - ClrContourCache( pFly->GetVirtDrawObj() );\ - pFly->NotifyBackground( FindPageFrm(), Prt(), PREP_FLY_ATTR_CHG );\ - }\ -} - -void SwNoTxtFrm::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew ) -{ - USHORT nWhich = pNew ? pNew->Which() : pOld ? pOld->Which() : 0; - - if ( RES_GRAPHIC_PIECE_ARRIVED != nWhich && - RES_GRAPHIC_ARRIVED != nWhich && - RES_GRF_REREAD_AND_INCACHE != nWhich ) - SwCntntFrm::Modify( pOld, pNew ); - - FASTBOOL bCompletePaint = TRUE; - - switch( nWhich ) - { - case RES_OBJECTDYING: - break; - - case RES_UPDATE_ATTR: - case RES_FMT_CHG: - CLEARCACHE( (SwGrfNode*) GetNode() ) - break; - - case RES_GRF_REREAD_AND_INCACHE: - if ( GetNode()->GetNodeType() == ND_GRFNODE ) - { - bCompletePaint = FALSE; - SwGrfNode* pNd = (SwGrfNode*) GetNode(); - - ViewShell *pVSh = 0; - pNd->GetDoc()->GetEditShell( &pVSh ); - if( pVSh ) - { - SwGraphicAccess aGrfAcc( *pNd, Prt().SSize(), - pVSh->GetOut()->GetMapMode() ); - if( aGrfAcc.IsAvailable() ) - { - ViewShell *pSh = pVSh; - do { - SET_CURR_SHELL( pSh ); - if( pSh->GetWin() ) - { - if( pSh->IsPreView() ) - ::RepaintPagePreview( pSh, Frm().SVRect() ); - else - pSh->GetWin()->Invalidate( Frm().SVRect() ); - } - } while( pVSh != (pSh = (ViewShell*)pSh->GetNext() )); - } - else - pNd->SwapIn(); - } - } - break; - - case RES_ATTRSET_CHG: - if ( SFX_ITEM_SET == ((SwAttrSetChg*)pOld)->GetChgSet()->GetItemState( RES_GRFATR_MIRRORGRF, FALSE )|| - SFX_ITEM_SET == ((SwAttrSetChg*)pOld)->GetChgSet()->GetItemState( RES_GRFATR_CROPGRF, FALSE )) - { - CLEARCACHE( (SwGrfNode*) GetNode() ) - break; - } - else - return; - - case RES_GRAPHIC_PIECE_ARRIVED: - case RES_GRAPHIC_ARRIVED: - if ( GetNode()->GetNodeType() == ND_GRFNODE ) - { - bCompletePaint = FALSE; - SwGrfNode* pNd = (SwGrfNode*) GetNode(); - - CLEARCACHE( pNd ) - - SwRect aRect( Frm() ); - - ViewShell *pVSh = 0; - pNd->GetDoc()->GetEditShell( &pVSh ); - if( !pVSh ) - break; - - ViewShell *pSh = pVSh; - do { - SET_CURR_SHELL( pSh ); - if( pSh->IsPreView() ) - { - if( pSh->GetWin() ) - ::RepaintPagePreview( pSh, aRect ); - } - else if ( pSh->VisArea().IsOver( aRect ) && - OUTDEV_WINDOW == pSh->GetOut()->GetOutDevType() ) - { - Graphic& rGrf = (Graphic&) pNd->GetGrf(); - BOOL bSizeUnequal; - if ( rGrf.IsAnimated() ) - pSh->GetWin()->Invalidate( aRect.SVRect() ); - else if ( rGrf.IsTransparent() || - (bSizeUnequal = (Frm().SSize() != Prt().SSize()))) - { - if ( bSizeUnequal ) - { - //Wieder mal die Umrandungen... - aRect.Pos().X() = Max( long(0), - (long)(aRect.Left() - 20) ); - aRect.Pos().Y() = Max( long(0), - (long)(aRect.Top() - 20) ); - aRect.SSize().Width() += 40; - aRect.SSize().Height() += 40; - } - //virtuelles device erzeugen und einstellen. - OutputDevice *pOld = pSh->GetOut(); - VirtualDevice *pVout = new VirtualDevice( *pOld ); - MapMode aMapMode( pOld->GetMapMode() ); - pVout->SetMapMode( aMapMode ); - if( pVout->SetOutputSize( aRect.SSize() ) ) - { -// pVout->SetPen( pOld->GetPen() ); -// pVout->SetFillInBrush( pOld->GetFillInBrush() ); - pVout->SetLineColor(pOld->GetLineColor()); - pVout->SetFillColor(pOld->GetFillColor()); - Point aOrigin( aRect.Pos() ); - aOrigin.X() = -aOrigin.X(); aOrigin.Y() = -aOrigin.Y(); - aMapMode.SetOrigin( aOrigin ); - pVout->SetMapMode( aMapMode ); - ::SetOutDev( pSh, pVout ); - pSh->GetLayout()->Paint( aRect ); - pOld->DrawOutDev( aRect.Pos(), aRect.SSize(), - aRect.Pos(), aRect.SSize(), *pVout ); - ::SetOutDev( pSh, pOld ); - } - else - pSh->Paint( aRect.SVRect() ); - delete pVout; - } - else - { - aRect = Prt(); aRect += Frm().Pos(); - Paint( aRect ); - } - } - - pSh = (ViewShell *)pSh->GetNext(); - } while( pSh != pVSh ); - } - break; - - default: - if( !pNew || RES_GRFATR_BEGIN > nWhich || nWhich >= RES_GRFATR_END ) - return; - } - - if( bCompletePaint ) - { - InvalidatePrt(); - SetCompletePaint(); - } -} - -#pragma optimize("t",off) - - -void SwNoTxtFrm::PaintCntnt( OutputDevice* pOut, const SwRect& rGrfArea, - const SwRect &rPaintGrfArea ) const -{ - switch( GetNode()->GetNodeType() ) - { - case ND_GRFNODE: - { - const ViewShell *pSh = GetShell(); - FASTBOOL bForceSwap = FALSE; - - SwGrfNode* pNd = (SwGrfNode*) GetNode()->GetGrfNode(); - Graphic & rGrf = (Graphic&) pNd->GetGrf(); - - pNd->SetFrameInPaint( TRUE ); - - BOOL bPrn = pOut == (Printer*)pSh->GetPrt() || - pOut->GetConnectMetaFile(); - BOOL bPaintPicture = TRUE; - - if( !bPrn && !rGrf.IsAnimated() && pNd->IsGrafikArrived() ) - { - Size aSize( rPaintGrfArea.SSize() ); - // Muss die QuickDraw-Bitmap neu aufgebaut werden? - MapMode aCurMapMode( pOut->GetMapMode() ); // Hallo MAC - SwGraphicAccess* pGrfAcc = new SwGraphicAccess( *pNd, aSize, - aCurMapMode ); - SwGraphicCacheObj* pGrfObj = 0; - - if( GRAPHIC_DEFAULT == rGrf.GetType() ) - { - if( pGrfAcc->IsAvailable() ) - pGrfObj = pGrfAcc->Get(); // alle klar - else if( pNd->IsLinkedFile() ) - { - SvPseudoObject* pLnkObj = pNd->GetLink()->GetObj(); - if( pLnkObj && ERRCODE_SO_FALSE != pLnkObj->GetUpToDateStatus() ) - { - Size aSz( pNd->GetTwipSize() ); - if( aSz.Width() && aSz.Height() ) - rGrf.Clear(); - } - } - } - - if( GRAPHIC_DEFAULT != rGrf.GetType() ) - { - pNd->SetAutoFmtLvl( 0 ); - if( !pGrfAcc->IsAvailable() ) - pGrfAcc->DeleteNoQBmps(); - pGrfObj = pGrfAcc->Get(); - - if( !pGrfObj->IsQBmp( aSize, aCurMapMode ) ) - { - delete pGrfAcc, pGrfAcc = 0; - pGrfObj = 0; - short nRes = pNd->SwapIn(); - - //Kann sein, dass es erst jetzt eine DefaultGraphic - //geworden ist; - //JP 18.10.96: oder eine Animierte reingeswappt wurde! - if ( GRAPHIC_DEFAULT != rGrf.GetType() && - !rGrf.IsAnimated() ) - { - if( nRes < 0 ) - { - // Durch das Swappen muss ein kompletter Repaint - // ausgeloest werden, wir koennen hier also abbrechen - if( nWeight < 0 ) - { - SwRect aTmp( rPaintGrfArea ); - aTmp.Justify(); - pSh->GetWin()->Invalidate( aTmp.SVRect() ); - pNd->SetFrameInPaint( FALSE ); - break; - } - else - nRes = 1; - } - - if( nRes ) - ((SwNoTxtFrm*)this)->nWeight = 1; - - pGrfAcc = new SwGraphicAccess( *pNd, aSize, aCurMapMode ); - pGrfObj = pGrfAcc->Get(); - pGrfObj->ClearQBmp(); - - if ( nRes && rGrf.IsSupportedGraphic() ) - { - Size aSizePixel( pOut->LogicToPixel( aSize ) ); - ULONG nArea = (ULONG)Abs(aSizePixel.Width()) * - (ULONG)Abs(aSizePixel.Height()); - ULONG nColors = pOut->GetColorCount(); - if( nColors <= 16 ) - nArea /= 2; - else - if( nColors > 65536 ) - nArea *= 4; - nArea *= 2; - - if( rGrf.GetType() != GRAPHIC_BITMAP || - (nArea < 2000000 && rGrf.GetType() == GRAPHIC_BITMAP) ) - { - SwWait *pWait = pNd->GetDoc()->IsBrowseMode() - ? 0 - : new SwWait( *pNd->GetDoc()->GetDocShell(), FALSE ); - - // QuickDraw-Bitmap erzeugen - Point aPos( rPaintGrfArea.Pos() ); - aPos -= rGrfArea.Pos(); - - pGrfObj->SetQBmp( XOutBitmap::CreateQuickDrawBitmapEx( - rGrf, *pOut, aCurMapMode, - rGrfArea.SSize(), aPos, aSize ), - aSize, aCurMapMode ); - delete pWait; - // Hinterher kann die Grafik wieder wech - // (wir haben ja die Bitmap) - bForceSwap = 0 != pGrfObj->GetQuickBmp(); - } - } - } - } - } - - if( pGrfObj && pGrfObj->GetQuickBmp() ) - { - bPaintPicture = FALSE; - //QuickDrawBitmap hat die richtige Size! - SwRect aTmp( rPaintGrfArea ); - aTmp.Justify(); - XOutBitmap::DrawQuickDrawBitmapEx( pOut, aTmp.Pos(), - aTmp.SSize(), *pGrfObj->GetQuickBmp() ); - } - delete pGrfAcc; - } - - if( bPaintPicture ) - { - if ( !bPrn ) - SwGraphicCacheObj::GetCache()->StartTimer(); - PaintPicture( pOut, rGrfArea, rPaintGrfArea ); - } - - pNd->SetFrameInPaint( FALSE ); - - // Erst hier rausswappen, damit der User schon was zu - // bewundern hat! - if( bForceSwap ) - pNd->SwapOut(); - break; - } - case ND_OLENODE: - PaintPicture( pOut, rGrfArea, rPaintGrfArea ); - break; - } -} - -#pragma optimize("",on) - -// Ausgabe der Grafik. Hier wird entweder eine QuickDraw-Bmp oder -// eine Grafik vorausgesetzt. Ist nichts davon vorhanden, wird -// eine Ersatzdarstellung ausgegeben. - -void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea, - const SwRect &rPaintGrfArea ) const -{ - const ViewShell* pShell = GetShell(); - const FASTBOOL bPrn = pOut == (Printer*)pShell->GetPrt() || - pOut->GetConnectMetaFile(); - - switch( GetNode()->GetNodeType() ) - { - case ND_GRFNODE: - { - SwGrfNode* pNd = (SwGrfNode*) GetNode(); - Graphic& rGrf = (Graphic&) pNd->GetGrf(); - if( !bPrn && GRAPHIC_DEFAULT == rGrf.GetType() && - pNd->IsLinkedFile() ) - { - Size aTmpSz; - SvPseudoObject* pGrfObj = pNd->GetLink()->GetObj(); - if( !pGrfObj || - ERRCODE_SO_FALSE == pGrfObj->GetUpToDateStatus() || - !(aTmpSz = pNd->GetTwipSize()).Width() || - !aTmpSz.Height() || !pNd->GetAutoFmtLvl() ) - { - pNd->SetAutoFmtLvl( 1 ); - new SwRequestGraphic( *GetShell(), *pNd );//zerstoert sich selbst! - } - String aTxt( pNd->GetAlternateText() ); - if ( !aTxt.Len() ) - GetRealURL( *pNd, aTxt ); - ::lcl_PaintReplacement( rGrfArea, aTxt, *pShell, this, FALSE ); - break; - } - - const FASTBOOL bSwapped = rGrf.IsSwapOut(); - const FASTBOOL bSwappedIn = pNd->SwapIn( bPrn ); - if( bSwappedIn && rGrf.IsSupportedGraphic() ) - { - const FASTBOOL bAnimate = rGrf.IsAnimated() && !pShell->IsPreView(); - if( bAnimate && FindFlyFrm() != ::GetFlyFromMarked(0,GetShell())) - { - OutputDevice* pVout; - if( pOut == pShell->GetOut() && SwRootFrm::FlushVout() ) - pVout = pOut, pOut = pShell->GetOut(); - else if( pShell->GetWin() && - OUTDEV_VIRDEV == pOut->GetOutDevType() ) - pVout = pOut, pOut = pShell->GetWin(); - else - pVout = 0; - ASSERT( OUTDEV_VIRDEV != pOut->GetOutDevType(), - "pOut sollte kein virtuelles Device sein" ); - rGrf.StartAnimation( pOut, rGrfArea.Pos(), rGrfArea.SSize(), - long(this), pVout ); - } - else - rGrf.Draw( pOut, rGrfArea.Pos(), rGrfArea.SSize() ); - } - else - { - USHORT nResId = 0; - if ( bSwappedIn ) - { - if ( rGrf.GetType() == GRAPHIC_NONE ) - nResId = STR_COMCORE_READERROR; - else if ( !rGrf.IsSupportedGraphic() ) - nResId = STR_COMCORE_CANT_SHOW; - } - ((SwNoTxtFrm*)this)->nWeight = -1; - String aText; - if ( !nResId && - !(aText = pNd->GetAlternateText()).Len() && - (!GetRealURL( *pNd, aText ) || !aText.Len())) - { - nResId = STR_COMCORE_READERROR; - } - if ( nResId ) - aText = SW_RESSTR( nResId ); - - ::lcl_PaintReplacement( rGrfArea, aText, *pShell, this, TRUE ); - } - //Beim Drucken duerfen wir nicht die Grafiken sammeln... - if( bSwapped && bPrn ) - pNd->SwapOut(); - } - break; - - case ND_OLENODE: - { - SwOLENode* pNd = (SwOLENode*) GetNode(); - SvInPlaceObjectRef xRef( pNd->GetOLEObj().GetOleRef() ); - - // Im BrowseModus gibt es nicht unbedingt einen Drucker und - // damit kein JobSetup, also legen wir eines an ... - JobSetup* pJobSetup = (JobSetup*)pNd->GetDoc()->GetJobsetup(); - BOOL bDummyJobSetup = NULL == pJobSetup; - if( bDummyJobSetup ) - pJobSetup = new JobSetup(); - xRef->DoDraw(pOut, rGrfArea.Pos(), rGrfArea.SSize(),*pJobSetup); - if( bDummyJobSetup ) - delete pJobSetup; // ... und raeumen wieder auf. - - //Objecte mit die beim Sichtbarwerden aktiviert werden wollen - //werden jetzt Connected (Aktivieren wird vom Sfx erledigt). - if( !bPrn && - ((SVOBJ_MISCSTATUS_ACTIVATEWHENVISIBLE|SVOBJ_MISCSTATUS_ALWAYSACTIVATE) & - xRef->GetMiscStatus()) && - pShell->ISA( SwCrsrShell )) - { - const SwFlyFrm *pFly = FindFlyFrm(); - ASSERT( pFly, "OLE not in FlyFrm" ); - ((SwFEShell*)pShell)->ConnectObj( xRef, pFly->Prt(), - pFly->Frm()); - } - } - break; - } -} - - -BOOL SwNoTxtFrm::IsTransparent() const -{ - const ViewShell* pSh = GetShell(); - if ( !pSh || !pSh->GetViewOptions()->IsGraphic() ) - return TRUE; - - const SwGrfNode *pNd; - if( 0 != (pNd = GetNode()->GetGrfNode()) ) - return pNd->IsTransparent(); - - //#29381# OLE sind immer Transparent. - return TRUE; -} - - -void SwNoTxtFrm::StopAnimation( OutputDevice* pOut ) const -{ - //animierte Grafiken anhalten - if ( GetNode()->GetNodeType() == ND_GRFNODE ) - { - Graphic& rGrf = (Graphic&)GetNode()->GetGrfNode()->GetGrf(); - if ( rGrf.IsAnimated() ) - rGrf.StopAnimation( pOut, long(this) ); - } -} - - -BOOL SwNoTxtFrm::HasAnimation() const -{ - if ( GetNode()->GetNodeType() == ND_GRFNODE ) - { - Graphic& rGrf = (Graphic&)GetNode()->GetGrfNode()->GetGrf(); - return rGrf.IsAnimated(); - } - return FALSE; -} - -#endif -// USE_GRFOBJECT - diff --git a/sw/source/core/docnode/swbaslnk.cxx b/sw/source/core/docnode/swbaslnk.cxx index 78edb6856f39..e83972f32f9c 100644 --- a/sw/source/core/docnode/swbaslnk.cxx +++ b/sw/source/core/docnode/swbaslnk.cxx @@ -2,9 +2,9 @@ * * $RCSfile: swbaslnk.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-19 00:08:18 $ + * last change: $Author: jp $ $Date: 2000-09-27 17:35:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -156,11 +156,6 @@ SwBaseLink::~SwBaseLink() { } -/* */ -// Code for the new GraphicObject -#ifdef USE_GRFOBJECT - - void SwBaseLink::DataChanged( SvData& rData ) { if( !pCntntNode ) @@ -404,256 +399,6 @@ FASTBOOL SwBaseLink::IsShowQuickDrawBmp() const ; } -/* */ -#else -// USE_GRFOBJECT - -#ifndef _GRFCACHE_HXX -#include <grfcache.hxx> -#endif - -void SwBaseLink::DataChanged( SvData& rData ) -{ - if( !pCntntNode ) - { - ASSERT(!this, "DataChanged ohne ContentNode" ); - return ; - } - - SwDoc* pDoc = pCntntNode->GetDoc(); - if( pDoc->IsInDtor() || ChkNoDataFlag() || bIgnoreDataChanged ) - { - bIgnoreDataChanged = FALSE; - return ; - } - - if( pCntntNode->IsNoTxtNode() && - rData.GetFormat() == SvxLinkManager::RegisterStatusInfoId() ) - { - // nur eine Statusaenderung - Events bedienen ? - String sState; - if( rData.GetData( sState )) - { - USHORT nEvent = 0; - switch( sState.ToInt32() ) - { - case STATE_LOAD_OK: nEvent = SVX_EVENT_IMAGE_LOAD; break; - case STATE_LOAD_ERROR: nEvent = SVX_EVENT_IMAGE_ERROR; break; - case STATE_LOAD_ABORT: nEvent = SVX_EVENT_IMAGE_ABORT; break; - } - - SwFrmFmt* pFmt; - if( nEvent && 0 != ( pFmt = pCntntNode->GetFlyFmt() )) - { - SwCallMouseEvent aCallEvent; - aCallEvent.Set( EVENT_OBJECT_IMAGE, pFmt ); - pDoc->CallEvent( nEvent, aCallEvent ); - } - } - return; // das wars! - } - - FASTBOOL bUpdate = FALSE; - FASTBOOL bGraphicArrived = FALSE; - FASTBOOL bGraphicPieceArrived = FALSE; - FASTBOOL bDontNotify = FALSE; - Size aGrfSz; - - if( pCntntNode->IsGrfNode() ) - { - ((SwGrfNode*)pCntntNode)->InvalidateTransparentFlag(); - Graphic& rGrf = (Graphic&)((SwGrfNode*)pCntntNode)->GetGrf(); - - bDontNotify = ((SwGrfNode*)pCntntNode)->IsFrameInPaint(); - - ULONG nUpDateState = GetObj()->GetUpToDateStatus(); - ((SwGrfNode*)pCntntNode)->SetGrafikArrived( ERRCODE_NONE == nUpDateState ); - - bGraphicArrived = ERRCODE_NONE == nUpDateState; - bGraphicPieceArrived = ERRCODE_SO_PENDING == nUpDateState; - - switch( rData.GetFormat() ) - { - case FORMAT_GDIMETAFILE: - { - GDIMetaFile *pMetaFile; - if( rData.GetData( &pMetaFile, TRANSFER_REFERENCE ) ) - { - rGrf = *pMetaFile; - bUpdate = TRUE; - } - } - break; - - case FORMAT_BITMAP: - { - Bitmap *pBmp; - if( rData.GetData( &pBmp, TRANSFER_REFERENCE ) ) - { - Graphic aEmptyGrf; - if( aEmptyGrf.GetBitmap() == *pBmp ) - rGrf = aEmptyGrf; - else - rGrf = *pBmp; - bUpdate = TRUE; - } - } - break; - - default: - if( rData.GetFormat() == Graphic::RegisterClipboardFormatName() || - FORMAT_PRIVATE == rData.GetFormat() ) - { - Graphic* pGrf; - if( rData.GetData( (SvDataCopyStream **)&pGrf, - Graphic::StaticType(), - TRANSFER_REFERENCE ) && - ( GRAPHIC_DEFAULT != pGrf->GetType() || - GRAPHIC_DEFAULT != rGrf.GetType() ) ) - { - aGrfSz = ::GetGraphicSizeTwip( *pGrf, 0 ); - Size aSz( ((SwGrfNode*)pCntntNode)->GetTwipSize() ); - - if( bGraphicPieceArrived && - GRAPHIC_DEFAULT != pGrf->GetType() && - ( !aSz.Width() || !aSz.Height() ) ) - { - // wenn nur ein Teil ankommt, aber die Groesse nicht - // gesetzt ist, dann muss "unten" der Teil von - // bGraphicArrived durchlaufen werden! - // (ansonten wird die Grafik in deft. Size gepaintet) - bGraphicArrived = TRUE; - bGraphicPieceArrived = FALSE; - } - rGrf = *pGrf; - bUpdate = TRUE; - - // Bug 33999: damit der Node den Transparent-Status - // richtig gesetzt hat, ohne auf die Grafik - // zugreifen zu muessen (sonst erfolgt ein SwapIn!). - if( bGraphicArrived ) - { - ((SwGrfNode*)pCntntNode)->SetTransparent( - rGrf.IsTransparent() ); - // Bug #34735#: immer mit der korrekten Grafik-Size - // arbeiten - if( aGrfSz.Height() && aGrfSz.Width() && - aSz.Height() && aSz.Width() && - aGrfSz != aSz ) - ((SwGrfNode*)pCntntNode)->SetTwipSize( aGrfSz ); - } - } - } - break; - } - if ( bUpdate && !bGraphicArrived && !bGraphicPieceArrived ) - ((SwGrfNode*)pCntntNode)->SetTwipSize( Size(0,0) ); - } - else if( pCntntNode->IsOLENode() ) - bUpdate = TRUE; - - ViewShell *pSh = 0; - SwEditShell* pESh = pDoc->GetEditShell( &pSh ); - - if ( bUpdate && bGraphicPieceArrived && !(bSwapIn || bDontNotify) ) - { - //Hint ohne Actions verschicken, loest direktes Paint aus. - if ( (!pSh || !pSh->ActionPend()) && (!pESh || !pESh->ActionPend()) ) - { - SwMsgPoolItem aMsgHint( RES_GRAPHIC_PIECE_ARRIVED ); - pCntntNode->Modify( &aMsgHint, &aMsgHint ); - bUpdate = FALSE; - } - } - - static BOOL bInNotifyLinks = FALSE; - if( bUpdate && !bDontNotify && (!bSwapIn || bGraphicArrived) && - !bInNotifyLinks) - { - BOOL bLockView = FALSE; - if( pSh ) - { - bLockView = pSh->IsViewLocked(); - pSh->LockView( TRUE ); - } - - if( pESh ) - pESh->StartAllAction(); - else if( pSh ) - pSh->StartAction(); - - SwMsgPoolItem aMsgHint( bGraphicArrived ? RES_GRAPHIC_ARRIVED : - RES_UPDATE_ATTR ); - - if ( bGraphicArrived ) - { - //Alle benachrichtigen, die am gleichen Link horchen. - bInNotifyLinks = TRUE; - - const SvBaseLinks& rLnks = pDoc->GetLinkManager().GetLinks(); - for( USHORT n = rLnks.Count(); n; ) - { - SvBaseLink* pLnk = &(*rLnks[ --n ]); - if( pLnk && OBJECT_CLIENT_GRF == pLnk->GetObjType() && - pLnk->ISA( SwBaseLink ) && pLnk->GetObj() == GetObj() ) - { - SwBaseLink* pBLink = (SwBaseLink*)pLnk; - SwGrfNode* pGrfNd = (SwGrfNode*)pBLink->pCntntNode; - - if( pBLink != this && - ( !bSwapIn || - GRAPHIC_DEFAULT == pGrfNd->GetGrf().GetType())) - { - pBLink->bIgnoreDataChanged = FALSE; - pBLink->DataChanged( rData ); - pBLink->bIgnoreDataChanged = TRUE; - - pGrfNd->SetGrafikArrived( ((SwGrfNode*)pCntntNode)-> - IsGrafikArrived() ); - - // Fly der Grafik anpassen ! - if( !::SetGrfFlySize( aGrfSz, pGrfNd ) ) - pGrfNd->Modify( &aMsgHint, &aMsgHint ); - } - else if( pBLink == this && - !::SetGrfFlySize( aGrfSz, pGrfNd ) ) - // Fly der Grafik anpassen ! - pGrfNd->Modify( &aMsgHint, &aMsgHint ); - } - } - - bInNotifyLinks = FALSE; - } - else - { - pCntntNode->Modify( &aMsgHint, &aMsgHint ); - } - - - if( pESh ) - { - const BOOL bEndActionByVirDev = pESh->IsEndActionByVirDev(); - pESh->SetEndActionByVirDev( TRUE ); - pESh->EndAllAction(); - pESh->SetEndActionByVirDev( bEndActionByVirDev ); - } - else if( pSh ) - pSh->EndAction(); - - if( pSh && !bLockView ) - pSh->LockView( FALSE ); - } - SwGraphicCacheObj::SetTimeout( 10000L ); -} - -FASTBOOL SwBaseLink::IsShowQuickDrawBmp() const -{ - return pCntntNode && pCntntNode->IsGrfNode() && - ((SwGrfNode*)pCntntNode)->HasMagicId(); -} - -#endif -// USE_GRFOBJECT BOOL SetGrfFlySize( const Size& rGrfSz, SwGrfNode* pGrfNd ) { diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx index 49fa2c68a175..98d3e9ef7e04 100644 --- a/sw/source/filter/html/htmlgrin.cxx +++ b/sw/source/filter/html/htmlgrin.cxx @@ -2,9 +2,9 @@ * * $RCSfile: htmlgrin.cxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: hr $ $Date: 2000-09-18 17:14:55 $ + * last change: $Author: jp $ $Date: 2000-09-27 17:33:15 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -705,10 +705,6 @@ IMAGE_SETEVENT: // JP 28.05.96: dann suche doch mal in unserem QuickDraw-Cache, ob // die Groesse dieser Grafik schon vorhanden ist. - -// Code for the new GraphicObject -#ifdef USE_GRFOBJECT - bGrfSzValid = #ifdef NEW_GRFOBJ FindGrfSizeFromCache( sGrfNm, aGrfSz ) @@ -717,14 +713,6 @@ IMAGE_SETEVENT: #endif ; -#else -// USE_GRFOBJECT - - bGrfSzValid = FindGrfSizeFromCache( sGrfNm, aGrfSz ); - -#endif -// USE_GRFOBJECT - // Wenn die Grfik in einer Tabelle steht, wird sie gleich // angefordert, damit sie eventuell schon da ist, bevor die // Tabelle layoutet wird. @@ -819,9 +807,6 @@ IMAGE_SETEVENT: { // Breite und Hoehe wurden angegeben und brauchen nicht gesetzt // zu werden -// Code for the new GraphicObject -#ifdef USE_GRFOBJECT - bGrfSzValid = #ifdef NEW_GRFOBJ FindGrfSizeFromCache( sGrfNm, aGrfSz ) @@ -830,14 +815,6 @@ IMAGE_SETEVENT: #endif ; - -#else -// USE_GRFOBJECT - - bGrfSzValid = FindGrfSizeFromCache( sGrfNm, aGrfSz ); -#endif -// USE_GRFOBJECT - bSetTwipSize = FALSE; if( bPrcWidth ) @@ -1607,11 +1584,14 @@ void SwHTMLParser::StripTrailingPara() Source Code Control System - Header - $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/sw/source/filter/html/htmlgrin.cxx,v 1.1.1.1 2000-09-18 17:14:55 hr Exp $ + $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/sw/source/filter/html/htmlgrin.cxx,v 1.2 2000-09-27 17:33:15 jp Exp $ Source Code Control System - Update $Log: not supported by cvs2svn $ + Revision 1.1.1.1 2000/09/18 17:14:55 hr + initial import + Revision 1.130 2000/09/18 16:04:45 willem.vandorp OpenOffice header added. |