diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2004-11-27 11:31:43 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2004-11-27 11:31:43 +0000 |
commit | 975d9471ea0f5a0e41210b20e05d70ab22ae58a2 (patch) | |
tree | b1220cfb78731a4ab53d3d13d7c9397ecac4350a /sw/source/ui/uiview/viewdraw.cxx | |
parent | f56ead9efe36c7dfd9a926a51460e819b993c9c6 (diff) |
INTEGRATION: CWS os42 (1.25.80); FILE MERGED
2004/11/11 12:34:42 iha 1.25.80.2: #i36242# custom shapes could not be selected if another was selected before
2004/11/10 16:34:07 os 1.25.80.1: #i35593# optimization
Diffstat (limited to 'sw/source/ui/uiview/viewdraw.cxx')
-rw-r--r-- | sw/source/ui/uiview/viewdraw.cxx | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/sw/source/ui/uiview/viewdraw.cxx b/sw/source/ui/uiview/viewdraw.cxx index da71f30904..609b9fb4a3 100644 --- a/sw/source/ui/uiview/viewdraw.cxx +++ b/sw/source/ui/uiview/viewdraw.cxx @@ -2,9 +2,9 @@ * * $RCSfile: viewdraw.cxx,v $ * - * $Revision: 1.26 $ + * $Revision: 1.27 $ * - * last change: $Author: hr $ $Date: 2004-11-26 19:59:49 $ + * last change: $Author: hr $ $Date: 2004-11-27 12:31:43 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -325,7 +325,24 @@ void SwView::ExecDraw(SfxRequest& rReq) pWindow->LeaveWait(); } - if (nSlotId == nDrawSfxId || bDeselect) + if( nSlotId == SID_DRAW_CS_ID ) + { + //deselect if same custom shape is selected again + SwDrawBase* pFuncPtr = GetDrawFuncPtr(); + if( pFuncPtr && pFuncPtr->GetSlotId() == SID_DRAW_CS_ID ) + { + ConstCustomShape* pConstCustomShape = (ConstCustomShape*)(pFuncPtr); + rtl::OUString aNew = ConstCustomShape::GetShapeTypeFromRequest( rReq ); + rtl::OUString aOld = pConstCustomShape->GetShapeType(); + if( aNew == aOld ) + { + bDeselect = true; + } + } + } + + //deselect if same shape is selected again (but different custom shapes do have same slot id) + if ( bDeselect || (nSlotId == nDrawSfxId && (nSlotId != SID_DRAW_CS_ID) ) ) { if (GetDrawFuncPtr()) { @@ -403,6 +420,7 @@ void SwView::ExecDraw(SfxRequest& rReq) case SID_DRAW_CS_ID : { pFuncPtr = new ConstCustomShape(pWrtShell, pEditWin, this, rReq ); + nDrawSfxId = nSlotId; if ( nSlotId != SID_DRAW_CS_ID ) { SFX_REQUEST_ARG( rReq, pEnumCommand, SfxStringItem, nSlotId, sal_False ); @@ -725,10 +743,7 @@ sal_Bool SwView::IsFormMode() const { if (GetDrawFuncPtr() && GetDrawFuncPtr()->IsCreateObj()) { - if (GetDrawFuncPtr()->IsInsertForm()) - return sal_True; - else - return sal_False; + return (GetDrawFuncPtr()->IsInsertForm()); } return AreOnlyFormsSelected(); |