diff options
author | jp <jp@openoffice.org> | 2001-07-09 16:47:47 +0000 |
---|---|---|
committer | jp <jp@openoffice.org> | 2001-07-09 16:47:47 +0000 |
commit | 67e1873c83ae2bc093a42e4dd4f92596d3d7a820 (patch) | |
tree | 5a1d68a36391789892bfd726cb9a9d4971d89885 | |
parent | a34950ad3163fe1de9043f7ceb208e800648cc59 (diff) |
Bug #81672#: don't swap a selected graphic out
-rw-r--r-- | sw/inc/ndgrf.hxx | 8 | ||||
-rw-r--r-- | sw/source/core/doc/notxtfrm.cxx | 5 | ||||
-rw-r--r-- | sw/source/core/graphic/ndgrf.cxx | 57 |
3 files changed, 41 insertions, 29 deletions
diff --git a/sw/inc/ndgrf.hxx b/sw/inc/ndgrf.hxx index 67ef04b63f25..2c41c61ca2e7 100644 --- a/sw/inc/ndgrf.hxx +++ b/sw/inc/ndgrf.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ndgrf.hxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: jp $ $Date: 2001-07-09 11:34:32 $ + * last change: $Author: jp $ $Date: 2001-07-09 17:42:21 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -163,9 +163,9 @@ public: #endif // steht in ndcopy.cxx virtual SwCntntNode* MakeCopy( SwDoc*, const SwNodeIndex& ) const; +#ifndef _FESHVIEW_ONLY_INLINE_NEEDED // erneutes Einlesen, falls Graphic nicht Ok ist. Die // aktuelle wird durch die neue ersetzt. -#ifndef _FESHVIEW_ONLY_INLINE_NEEDED BOOL ReRead( const String& rGrfName, const String& rFltName, const Graphic* pGraphic = 0, const GraphicObject* pGrfObj = 0, @@ -181,6 +181,8 @@ public: void SetStreamName( const String& r ) { aGrfObj.SetUserData( r ); } void SetNewStreamName( const String& r ) { aNewStrmName = r; } void SaveCompleted( BOOL bClear ); + // is this node selected by any shell? + BOOL IsSelected() const; #endif // Der Grafik sagen, dass sich der Node im Undobereich befindet diff --git a/sw/source/core/doc/notxtfrm.cxx b/sw/source/core/doc/notxtfrm.cxx index 93eee3cd4ab6..939117c857b7 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.7 $ + * $Revision: 1.8 $ * - * last change: $Author: ama $ $Date: 2001-07-05 10:13:08 $ + * last change: $Author: jp $ $Date: 2001-07-09 17:47:47 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -997,7 +997,6 @@ void SwNoTxtFrm::PaintPicture( OutputDevice* pOut, const SwRect &rGrfArea, { rGrfObj.Draw( pOut, rGrfArea.Pos(), rGrfArea.SSize(), &aGrfAttr ); - bForceSwap = TRUE; bContinue = FALSE; } } diff --git a/sw/source/core/graphic/ndgrf.cxx b/sw/source/core/graphic/ndgrf.cxx index 25f7c6b23ba2..74aed7817dfb 100644 --- a/sw/source/core/graphic/ndgrf.cxx +++ b/sw/source/core/graphic/ndgrf.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ndgrf.cxx,v $ * - * $Revision: 1.17 $ + * $Revision: 1.18 $ * - * last change: $Author: ama $ $Date: 2001-07-05 10:19:52 $ + * last change: $Author: jp $ $Date: 2001-07-09 17:47:03 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -107,11 +107,10 @@ #include <sot/formats.hxx> #endif - -#ifndef _FMTFSIZE_HXX //autogen +#ifndef _FMTFSIZE_HXX #include <fmtfsize.hxx> #endif -#ifndef _FMTURL_HXX //autogen +#ifndef _FMTURL_HXX #include <fmturl.hxx> #endif #ifndef _FRMFMT_HXX @@ -147,6 +146,12 @@ #ifndef _PAGEFRM_HXX #include <pagefrm.hxx> #endif +#ifndef _EDITSH_HXX +#include <editsh.hxx> +#endif +#ifndef _PAM_HXX +#include <pam.hxx> +#endif // -------------------- // SwGrfNode @@ -1111,7 +1116,10 @@ SwCntntNode* SwGrfNode::MakeCopy( SwDoc* pDoc, const SwNodeIndex& rIdx ) const IMPL_LINK( SwGrfNode, SwapGraphic, GraphicObject*, pGrfObj ) { SvStream* pRet; - if( refLink.Is() ) + + if( pGrfObj->IsInSwapOut() && IsSelected() ) + pRet = GRFMGR_AUTOSWAPSTREAM_NONE; + else if( refLink.Is() ) { if( pGrfObj->IsInSwapIn() ) { @@ -1177,23 +1185,6 @@ IMPL_LINK( SwGrfNode, SwapGraphic, GraphicObject*, pGrfObj ) } return (long)pRet; - -/* - SvStream* pStream = GetSwapStream(); - - if( GRFMGR_AUTOSWAPSTREAM_NONE != pStream ) - { - if( GRFMGR_AUTOSWAPSTREAM_LINK == pStream ) - mbAutoSwapped = maGraphic.SwapOut( NULL ); - else - { - if( GRFMGR_AUTOSWAPSTREAM_TEMP == pStream ) - mbAutoSwapped = maGraphic.SwapOut(); - else - mbAutoSwapped = maGraphic.SwapOut( pStream ); - } - } -*/ } @@ -1286,3 +1277,23 @@ BOOL SwGrfNode::IsTransparent() const } +BOOL SwGrfNode::IsSelected() const +{ + BOOL bRet = FALSE; + const SwEditShell* pESh = GetDoc()->GetEditShell(); + if( pESh ) + { + const SwNode* pN = this; + const ViewShell* pV = pESh; + do { + if( pV->ISA( SwEditShell ) && pN == &((SwCrsrShell*)pV) + ->GetCrsr()->GetPoint()->nNode.GetNode() ) + { + bRet = TRUE; + break; + } + } + while( pESh != ( pV = (ViewShell*)pV->GetNext() )); + } + return bRet; +} |