diff options
author | Kai Ahrens <ka@openoffice.org> | 2001-10-25 09:32:00 +0000 |
---|---|---|
committer | Kai Ahrens <ka@openoffice.org> | 2001-10-25 09:32:00 +0000 |
commit | cf605400afba73cf4e76fdc1d6b0a905ab2cc8b4 (patch) | |
tree | c601c63d7b81a0d6277b9f5636dd460a1c3694ca /svx/source/gallery2 | |
parent | 6646f8ed3bcaab65d300e18b868be82400eddfa1 (diff) |
#93677#: don't start drag action if URL is not valid
Diffstat (limited to 'svx/source/gallery2')
-rw-r--r-- | svx/source/gallery2/galbrws2.cxx | 14 | ||||
-rw-r--r-- | svx/source/gallery2/galmisc.cxx | 14 |
2 files changed, 19 insertions, 9 deletions
diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx index 6c52a6036113..680ca765b139 100644 --- a/svx/source/gallery2/galbrws2.cxx +++ b/svx/source/gallery2/galbrws2.cxx @@ -2,9 +2,9 @@ * * $RCSfile: galbrws2.cxx,v $ * - * $Revision: 1.25 $ + * $Revision: 1.26 $ * - * last change: $Author: ka $ $Date: 2001-10-19 12:21:22 $ + * last change: $Author: ka $ $Date: 2001-10-25 10:32:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -208,10 +208,16 @@ GalleryThemePopup::GalleryThemePopup( const GalleryTheme* pTheme, ULONG nObjectP const SgaObjKind eObjKind = mpTheme->GetObjectKind( mnObjectPos ); PopupMenu* pAddMenu = GetPopupMenu( MN_ADDMENU ); SfxBindings& rBindings = SfxViewFrame::Current()->GetBindings(); + INetURLObject aURL; + + const_cast< GalleryTheme* >( mpTheme )->GetURL( mnObjectPos, aURL ); + const BOOL bValidURL = ( aURL.GetProtocol() != INET_PROT_NOT_VALID ); + + pAddMenu->EnableItem( MN_ADD, bValidURL && SGA_OBJ_SOUND != eObjKind ); + pAddMenu->EnableItem( MN_ADD_LINK, bValidURL && SGA_OBJ_SVDRAW != eObjKind && SGA_OBJ_SOUND != eObjKind ); - pAddMenu->EnableItem( MN_ADD, SGA_OBJ_SOUND != eObjKind ); - pAddMenu->EnableItem( MN_ADD_LINK, SGA_OBJ_SVDRAW != eObjKind && SGA_OBJ_SOUND != eObjKind ); EnableItem( MN_ADDMENU, pAddMenu->IsItemEnabled( MN_ADD ) || pAddMenu->IsItemEnabled( MN_ADD_LINK ) ); + EnableItem( MN_PREVIEW, bValidURL ); CheckItem( MN_PREVIEW, mbPreview ); diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx index a04a7c4c96bc..3cb7b55033eb 100644 --- a/svx/source/gallery2/galmisc.cxx +++ b/svx/source/gallery2/galmisc.cxx @@ -2,9 +2,9 @@ * * $RCSfile: galmisc.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: hr $ $Date: 2001-10-17 13:15:17 $ + * last change: $Author: ka $ $Date: 2001-10-25 10:32:00 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -738,8 +738,12 @@ void GalleryTransferable::CopyToClipboard( Window* pWindow ) void GalleryTransferable::StartDrag( Window* pWindow, sal_Int8 nDragSourceActions, sal_Int32 nDragPointer, sal_Int32 nDragImage ) { - mpTheme->SetDragging( sal_True ); - mpTheme->SetDragPos( mnObjectPos ); + INetURLObject aURL; - TransferableHelper::StartDrag( pWindow, nDragSourceActions, nDragPointer, nDragImage ); + if( mpTheme->GetURL( mnObjectPos, aURL ) && ( aURL.GetProtocol() != INET_PROT_NOT_VALID ) ) + { + mpTheme->SetDragging( sal_True ); + mpTheme->SetDragPos( mnObjectPos ); + TransferableHelper::StartDrag( pWindow, nDragSourceActions, nDragPointer, nDragImage ); + } } |