diff options
author | jp <jp@openoffice.org> | 2000-12-22 11:07:52 +0000 |
---|---|---|
committer | jp <jp@openoffice.org> | 2000-12-22 11:07:52 +0000 |
commit | 8218e11fc092b9f505ed9d083860655db52cfaed (patch) | |
tree | a34d31a84e3ece3f1e0f5ebd843dbf09eb335ccb /sw/source | |
parent | 8fa8101bcd0f9e94af18aaa9332c61effc79f008 (diff) |
Bug #81672#: asynch loaded graphics for status updates
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/ui/inc/basesh.hxx | 29 | ||||
-rw-r--r-- | sw/source/ui/shells/basesh.cxx | 151 | ||||
-rw-r--r-- | sw/source/ui/shells/grfsh.cxx | 25 |
3 files changed, 118 insertions, 87 deletions
diff --git a/sw/source/ui/inc/basesh.hxx b/sw/source/ui/inc/basesh.hxx index bc4e3ed65aa8..4afb4bba4269 100644 --- a/sw/source/ui/inc/basesh.hxx +++ b/sw/source/ui/inc/basesh.hxx @@ -2,9 +2,9 @@ * * $RCSfile: basesh.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: jp $ $Date: 2000-11-13 12:32:43 $ + * last change: $Author: jp $ $Date: 2000-12-22 12:07:52 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,16 +61,13 @@ #ifndef _SWBASESH_HXX #define _SWBASESH_HXX + #ifndef _SHELLID_HXX #include <shellid.hxx> #endif -#ifndef _SFXMODULE_HXX //autogen -#include <sfx2/module.hxx> -#endif -#ifndef _SFX_SHELL_HXX //autogen -#include <sfx2/shell.hxx> -#endif +#define _SVSTDARR_USHORTSSORT +#define _SVSTDARR_USHORTS #ifndef _LINK_HXX //autogen #include <tools/link.hxx> @@ -78,6 +75,13 @@ #ifndef _SV_TIMER_HXX //autogen #include <vcl/timer.hxx> #endif +#ifndef _SFXMODULE_HXX //autogen +#include <sfx2/module.hxx> +#endif +#ifndef _SFX_SHELL_HXX //autogen +#include <sfx2/shell.hxx> +#endif +#include <svtools/svstdarr.hxx> class SwWrtShell; class SwCrsrShell; @@ -101,10 +105,7 @@ class SwBaseShell: public SfxShell SfxItemSet* pGetStateSet; //Update-Timer fuer Graphic - BOOL bUpdateSID_IMap :1; - BOOL bUpdateSID_IMapExec :1; - BOOL bUpdateSID_IContour :1; - BOOL bUpdateSID_IContourDlg :1; + SvUShortsSort aGrfUpdateSlots; DECL_LINK( GraphicArrivedHdl, SwCrsrShell* ); DECL_LINK( UpdatePercentHdl, GraphicFilter* ); @@ -120,6 +121,10 @@ protected: DECL_STATIC_LINK( SwBaseShell, InsertDBTextHdl, String* ); + void SetGetStateSet( SfxItemSet* p ) { pGetStateSet = p; } + BOOL AddGrfUpdateSlot( USHORT nSlot ) + { return aGrfUpdateSlots.Insert( nSlot ); } + public: SwBaseShell(SwView &rShell); virtual ~SwBaseShell(); diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx index 7a96d4fe8033..9ae2d0d56c17 100644 --- a/sw/source/ui/shells/basesh.cxx +++ b/sw/source/ui/shells/basesh.cxx @@ -2,9 +2,9 @@ * * $RCSfile: basesh.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: jp $ $Date: 2000-11-23 20:08:52 $ + * last change: $Author: jp $ $Date: 2000-12-22 12:07:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1178,68 +1178,93 @@ void SwBaseShell::Execute(SfxRequest &rReq) * --------------------------------------------------*/ IMPL_LINK(SwBaseShell, GraphicArrivedHdl, SwCrsrShell* , pCrShell ) { + USHORT nGrfType; SwWrtShell &rSh = GetShell(); if( CNT_GRF == rSh.SwEditShell::GetCntType() && - GRAPHIC_NONE != rSh.GetGraphicType() ) + GRAPHIC_NONE != ( nGrfType = rSh.GetGraphicType() ) && + aGrfUpdateSlots.Count() ) { BOOL bProtect = 0 != rSh.IsSelObjProtected( (FlyProtectType) (FLYPROTECT_CONTENT|FLYPROTECT_PARENT) ); - SfxViewFrame* pVFrame = GetView().GetViewFrame(); - if( bUpdateSID_IMap || bUpdateSID_IMapExec ) + USHORT nSlot; + for( USHORT n = 0; n < aGrfUpdateSlots.Count(); ++n ) { - USHORT nId = SvxIMapDlgChildWindow::GetChildWindowId(); - SvxIMapDlg *pDlg = pVFrame->HasChildWindow( nId ) ? - (SvxIMapDlg*) ( pVFrame->GetChildWindow( nId )->GetWindow()) : 0; - - if( pDlg && ( bUpdateSID_IMapExec || (bUpdateSID_IMap && !bProtect)) && - pDlg->GetEditingObject() != rSh.GetIMapInventor() ) - lcl_UpdateIMapDlg(rSh); - - if( !bProtect && bUpdateSID_IMap ) + BOOL bSetState = FALSE; + BOOL bState = FALSE; + switch( nSlot = aGrfUpdateSlots[ n ] ) { - SfxBoolItem aBool(SID_IMAP, 0 != pDlg); - if( pGetStateSet ) - pGetStateSet->Put( aBool ); - else - pVFrame->GetBindings().SetState( aBool ); - } - } + case SID_IMAP: + case SID_IMAP_EXEC: + { + USHORT nId = SvxIMapDlgChildWindow::GetChildWindowId(); + SvxIMapDlg *pDlg = pVFrame->HasChildWindow( nId ) ? + (SvxIMapDlg*) ( pVFrame->GetChildWindow( nId ) + ->GetWindow()) : 0; + + if( pDlg && ( SID_IMAP_EXEC == nSlot || + ( SID_IMAP == nSlot && !bProtect)) && + pDlg->GetEditingObject() != rSh.GetIMapInventor() ) + lcl_UpdateIMapDlg( rSh ); + + if( !bProtect && SID_IMAP == nSlot ) + bSetState = TRUE, bState = 0 != pDlg; + } + break; - if( !bProtect && ( bUpdateSID_IContour || bUpdateSID_IContourDlg )) - { - if( bUpdateSID_IContourDlg ) - { - USHORT nId = SvxContourDlgChildWindow::GetChildWindowId(); - SvxIMapDlg *pDlg = pVFrame->HasChildWindow( nId ) ? - (SvxIMapDlg*) ( pVFrame->GetChildWindow( nId )->GetWindow()) : 0; - if( pDlg && pDlg->GetEditingObject() != rSh.GetIMapInventor() ) - lcl_UpdateContourDlg( rSh, SwWrtShell::SEL_GRF ); + case SID_CONTOUR_DLG: + if( !bProtect ) + { + USHORT nId = SvxContourDlgChildWindow::GetChildWindowId(); + SvxIMapDlg *pDlg = pVFrame->HasChildWindow( nId ) ? + (SvxIMapDlg*) ( pVFrame->GetChildWindow( nId ) + ->GetWindow()) : 0; + if( pDlg && pDlg->GetEditingObject() != + rSh.GetIMapInventor() ) + lcl_UpdateContourDlg( rSh, SwWrtShell::SEL_GRF ); + + bSetState = TRUE; + bState = 0 != pDlg; + } + break; - SfxBoolItem aBool(SID_CONTOUR_DLG, 0 != pDlg); - if( pGetStateSet ) - pGetStateSet->Put( aBool ); - else - pVFrame->GetBindings().SetState( aBool ); + case FN_FRAME_WRAP_CONTOUR: + if( !bProtect ) + { + SfxItemSet aSet(GetPool(), RES_SURROUND, RES_SURROUND); + rSh.GetFlyFrmAttr(aSet); + const SwFmtSurround& rWrap = (const SwFmtSurround&)aSet.Get(RES_SURROUND); + bSetState = TRUE; + bState = rWrap.IsContour(); + } + break; + + case SID_GRFFILTER: + case SID_GRFFILTER_INVERT: + case SID_GRFFILTER_SMOOTH: + case SID_GRFFILTER_SHARPEN: + case SID_GRFFILTER_REMOVENOISE: + case SID_GRFFILTER_SOBEL: + case SID_GRFFILTER_MOSAIC: + case SID_GRFFILTER_EMBOSS: + case SID_GRFFILTER_POSTER: + case SID_GRFFILTER_POPART: + case SID_GRFFILTER_SEPIA: + case SID_GRFFILTER_SOLARIZE: + bSetState = bState = GRAPHIC_BITMAP == nGrfType; + break; } - if( bUpdateSID_IContour ) - { - SfxItemSet aSet(GetPool(), RES_SURROUND, RES_SURROUND); - rSh.GetFlyFrmAttr(aSet); - const SwFmtSurround& rWrap = (const SwFmtSurround&)aSet.Get(RES_SURROUND); - SfxBoolItem aBool( FN_FRAME_WRAP_CONTOUR, rWrap.IsContour() ); + if( bSetState ) + { + SfxBoolItem aBool( nSlot, bState ); if( pGetStateSet ) pGetStateSet->Put( aBool ); else pVFrame->GetBindings().SetState( aBool ); } } - - bUpdateSID_IMap = FALSE; - bUpdateSID_IMapExec = FALSE; - bUpdateSID_IContour = FALSE; - bUpdateSID_IContourDlg = FALSE; + aGrfUpdateSlots.RemoveAt( 0, aGrfUpdateSlots.Count() ); } return 0; } @@ -1324,18 +1349,14 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) //wenn die Grafik ausgeswappt ist, dann muss der //Status asynchron ermittelt werden //bis dahin wird der Slot disabled - if(bIsGraphicSelection && rSh.IsGrfSwapOut(TRUE)) + if( bIsGraphicSelection && rSh.IsGrfSwapOut( TRUE )) { - rSet.DisableItem(nWhich); - if( !bUpdateSID_IMap ) - { - bUpdateSID_IMap = TRUE; + rSet.DisableItem( nWhich ); + if( AddGrfUpdateSlot( nWhich )) rSh.GetGraphic(FALSE); // start the loading - } } else { - if( bProtect || ( !bHas && ( !bFrmSel || (bIsGraphicSelection && rSh.GetIMapGraphic().GetType() == GRAPHIC_NONE )) )) @@ -1361,11 +1382,8 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) if(rSh.GetSelectionType() == SwWrtShell::SEL_GRF && rSh.IsGrfSwapOut(TRUE)) { - if( !bUpdateSID_IMapExec ) - { - bUpdateSID_IMapExec = TRUE; + if( AddGrfUpdateSlot( nWhich )) rSh.GetGraphic(FALSE); // start the loading - } } else { @@ -1407,11 +1425,8 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) rSh.IsGrfSwapOut(TRUE)) { bDisable = TRUE; - if( !bUpdateSID_IContourDlg ) - { - bUpdateSID_IContourDlg = TRUE; + if( AddGrfUpdateSlot( nWhich )) rSh.GetGraphic(FALSE); // start the loading - } } else if( bHas && bOk ) bDisable = !lcl_UpdateContourDlg( rSh, nSel ); @@ -1597,11 +1612,8 @@ void SwBaseShell::GetState( SfxItemSet &rSet ) rSh.IsGrfSwapOut(TRUE)) { bDisable = TRUE; - if( !bUpdateSID_IContour ) - { - bUpdateSID_IContour = TRUE; + if( AddGrfUpdateSlot( nWhich )) rSh.GetGraphic(FALSE); // start the loading - } } else if( rSh.IsFrmSelected() ) bDisable = GRAPHIC_NONE == @@ -1811,11 +1823,7 @@ SwBaseShell::SwBaseShell(SwView& rVw) : SfxShell( &rVw ), rView(rVw), pFrmMgr(0), - pGetStateSet(0), - bUpdateSID_IMap(FALSE), - bUpdateSID_IMapExec(FALSE), - bUpdateSID_IContour(FALSE), - bUpdateSID_IContourDlg(FALSE) + pGetStateSet(0) { SwWrtShell& rWrtSh = rView.GetWrtShell(); @@ -2507,6 +2515,9 @@ void SwBaseShell::ExecField( SfxRequest& rReq ) /*------------------------------------------------------------------------ $Log: not supported by cvs2svn $ + Revision 1.3 2000/11/23 20:08:52 jp + Task #80648#: use new class SvxScriptSetItem + Revision 1.2 2000/11/13 13:19:55 jp new method GetTextFontCtrl diff --git a/sw/source/ui/shells/grfsh.cxx b/sw/source/ui/shells/grfsh.cxx index 7689cb53f02c..8f248db197e1 100644 --- a/sw/source/ui/shells/grfsh.cxx +++ b/sw/source/ui/shells/grfsh.cxx @@ -2,9 +2,9 @@ * * $RCSfile: grfsh.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: jp $ $Date: 2000-12-02 15:23:54 $ + * last change: $Author: jp $ $Date: 2000-12-22 12:07:32 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -590,9 +590,11 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet) rSh.GetAttr( aCoreSet ); BOOL bParentCntProt = 0 != rSh.IsSelObjProtected( (FlyProtectType)(FLYPROTECT_CONTENT|FLYPROTECT_PARENT) ); + BOOL bIsGrfCntnt = CNT_GRF == GetShell().GetCntType(); + BOOL bSwappedOut = rSh.IsGrfSwapOut( TRUE ); + BOOL bBitmapType = !bSwappedOut && GRAPHIC_BITMAP == rSh.GetGraphicType(); - USHORT nGrfType = CNT_GRF == GetShell().GetCntType() - ? GetShell().GetGraphicType() : 0; + SetGetStateSet( &rSet ); SfxWhichIter aIter( rSet ); USHORT nWhich = aIter.FirstWhich(); @@ -694,7 +696,16 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet) case SID_GRFFILTER_POPART: case SID_GRFFILTER_SEPIA: case SID_GRFFILTER_SOLARIZE: - bDisable = bParentCntProt || GRAPHIC_BITMAP != nGrfType; + if( bParentCntProt || !bIsGrfCntnt ) + bDisable = TRUE; + else if( bSwappedOut ) + { + rSet.DisableItem( nWhich ); + if( AddGrfUpdateSlot( nWhich )) + rSh.GetGraphic(FALSE); // start the loading + } + else + bDisable = !bBitmapType; break; default: @@ -705,6 +716,7 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet) rSet.DisableItem( nWhich ); nWhich = aIter.NextWhich(); } + SetGetStateSet( 0 ); } @@ -960,6 +972,9 @@ IMPL_LINK( SwTextShell, InitGraphicFrame, Button *, pButton ) /*------------------------------------------------------------------------ $Log: not supported by cvs2svn $ + Revision 1.7 2000/12/02 15:23:54 jp + Task #80752#: integrate the grafik filter + Revision 1.6 2000/11/28 20:36:10 jp task #80795#: ReRead and InsertGrafik with GraphicObject |