diff options
Diffstat (limited to 'sw/source/core/docnode/swbaslnk.cxx')
-rw-r--r-- | sw/source/core/docnode/swbaslnk.cxx | 259 |
1 files changed, 2 insertions, 257 deletions
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 ) { |