summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
Diffstat (limited to 'svx')
-rw-r--r--svx/inc/gallery.hrc1
-rw-r--r--svx/source/gallery2/galbrws2.cxx58
-rw-r--r--svx/source/gallery2/gallery.src38
-rw-r--r--svx/source/items/galleryitem.cxx27
4 files changed, 31 insertions, 93 deletions
diff --git a/svx/inc/gallery.hrc b/svx/inc/gallery.hrc
index 2396db0dceae..526011f7b1a5 100644
--- a/svx/inc/gallery.hrc
+++ b/svx/inc/gallery.hrc
@@ -107,7 +107,6 @@
#define WND_BRSPRV 1
#define MN_ADDMENU 2
#define MN_ADD 6
-#define MN_ADD_LINK 8
#define MN_PREVIEW 10
#define MN_DELETE 12
#define MN_BACKGROUND 14
diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx
index fa960a3e57cd..46d3d5ea2f4a 100644
--- a/svx/source/gallery2/galbrws2.cxx
+++ b/svx/source/gallery2/galbrws2.cxx
@@ -185,9 +185,7 @@ throw ( css::uno::RuntimeException )
{
if ( !rEvent.IsEnabled )
{
- PopupMenu *pAddMenu = maPopupMenu.GetPopupMenu( MN_ADDMENU );
- pAddMenu->EnableItem( MN_ADD, sal_False );
- pAddMenu->EnableItem( MN_ADD_LINK, sal_False );
+ maPopupMenu.EnableItem( MN_ADD, sal_False );
}
}
else if ( rURL.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( CMD_SID_GALLERY_BG_BRUSH ) ) )
@@ -242,16 +240,13 @@ void GalleryThemePopup::ExecutePopup( Window *pWindow, const ::Point &aPos )
css::uno::Reference< css::frame::XStatusListener > xThis( this );
const SgaObjKind eObjKind = mpTheme->GetObjectKind( mnObjectPos );
- PopupMenu* pAddMenu = maPopupMenu.GetPopupMenu( MN_ADDMENU );
INetURLObject aURL;
const_cast< GalleryTheme* >( mpTheme )->GetURL( mnObjectPos, aURL );
const sal_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 );
+ maPopupMenu.EnableItem( MN_ADD, bValidURL && SGA_OBJ_SOUND != eObjKind );
- maPopupMenu.EnableItem( MN_ADDMENU, pAddMenu->IsItemEnabled( MN_ADD ) || pAddMenu->IsItemEnabled( MN_ADD_LINK ) );
maPopupMenu.EnableItem( MN_PREVIEW, bValidURL );
maPopupMenu.CheckItem( MN_PREVIEW, mbPreview );
@@ -335,17 +330,14 @@ void GalleryThemePopup::ExecutePopup( Window *pWindow, const ::Point &aPos )
}
if( !maBackgroundPopup.GetItemCount() || ( eObjKind == SGA_OBJ_SVDRAW ) || ( eObjKind == SGA_OBJ_SOUND ) )
- pAddMenu->EnableItem( MN_BACKGROUND, sal_False );
+ maPopupMenu.EnableItem( MN_BACKGROUND, sal_False );
else
{
- pAddMenu->EnableItem( MN_BACKGROUND, sal_True );
- pAddMenu->SetPopupMenu( MN_BACKGROUND, &maBackgroundPopup );
+ maPopupMenu.EnableItem( MN_BACKGROUND, sal_True );
+ maPopupMenu.SetPopupMenu( MN_BACKGROUND, &maBackgroundPopup );
maBackgroundPopup.SetSelectHdl( LINK( this, GalleryThemePopup, BackgroundMenuSelectHdl ) );
}
- pAddMenu->RemoveDisabledEntries();
- if ( !pAddMenu->GetItemCount() )
- maPopupMenu.EnableItem( MN_ADDMENU, sal_False );
maPopupMenu.RemoveDisabledEntries();
maPopupMenu.SetSelectHdl( LINK( this, GalleryThemePopup, MenuSelectHdl ) );
@@ -361,7 +353,6 @@ IMPL_LINK( GalleryThemePopup, MenuSelectHdl, Menu*, pMenu )
switch ( nId )
{
case( MN_ADD ):
- case( MN_ADD_LINK ):
{
const CommandInfoMap::const_iterator it = m_aCommandInfo.find( SID_GALLERY_FORMATS );
if ( it != m_aCommandInfo.end() )
@@ -688,16 +679,13 @@ sal_Bool GalleryBrowser2::KeyInput( const KeyEvent& rKEvt, Window* pWindow )
if( !bRet && !maViewBox.HasFocus() && nItemId && mpCurTheme )
{
- sal_uInt16 nExecuteId = 0;
- const SgaObjKind eObjKind = mpCurTheme->GetObjectKind( nItemId - 1 );
+ sal_uInt16 nExecuteId = 0;
INetURLObject aURL;
const_cast< GalleryTheme* >( mpCurTheme )->GetURL( nItemId - 1, aURL );
const sal_Bool bValidURL = ( aURL.GetProtocol() != INET_PROT_NOT_VALID );
sal_Bool bPreview = bValidURL;
- sal_Bool bAdd = bValidURL;
- sal_Bool bAddLink = ( bValidURL && SGA_OBJ_SVDRAW != eObjKind );
sal_Bool bDelete = sal_False;
sal_Bool bTitle = sal_False;
@@ -725,13 +713,9 @@ sal_Bool GalleryBrowser2::KeyInput( const KeyEvent& rKEvt, Window* pWindow )
case( KEY_I ):
{
// Inserting a gallery item in the document must be dispatched
- if( bAddLink && rKEvt.GetKeyCode().IsShift() && rKEvt.GetKeyCode().IsMod1() )
- nExecuteId = MN_ADD_LINK;
- else if( bAdd )
- nExecuteId = MN_ADD;
- if( nExecuteId )
+ if( bValidURL )
{
- Dispatch( nExecuteId );
+ Dispatch( MN_ADD );
return sal_True;
}
}
@@ -1109,7 +1093,6 @@ void GalleryBrowser2::Dispatch(
switch( nId )
{
case( MN_ADD ):
- case( MN_ADD_LINK ):
{
css::uno::Reference< css::frame::XDispatch > xDispatch( rxDispatch );
css::util::URL aURL = rURL;
@@ -1133,7 +1116,6 @@ void GalleryBrowser2::Dispatch(
return;
sal_Int8 nType = 0;
- sal_Bool bIsLink( MN_ADD_LINK == nId );
OUString aFileURL, aFilterName;
css::uno::Reference< css::lang::XComponent > xDrawing;
css::uno::Reference< css::graphic::XGraphic > xGraphic;
@@ -1159,12 +1141,6 @@ void GalleryBrowser2::Dispatch(
break;
}
- if ( bIsLink )
- {
- aFileURL = mpCurTheme->GetObjectURL( mnCurActionPos ).GetMainURL( INetURLObject::NO_DECODE );
- OSL_ENSURE( aFileURL.getLength(), "gallery item is link but no URL!" );
- }
-
Graphic aGraphic;
sal_Bool bGraphic = mpCurTheme->GetGraphic( mnCurActionPos, aGraphic );
if ( bGraphic && !!aGraphic )
@@ -1175,16 +1151,14 @@ void GalleryBrowser2::Dispatch(
aSeq[0].Name = OUString( SVXGALLERYITEM_TYPE );
aSeq[0].Value <<= nType;
- aSeq[1].Name = OUString( SVXGALLERYITEM_LINK );
- aSeq[1].Value <<= bIsLink;
- aSeq[2].Name = OUString( SVXGALLERYITEM_URL );
- aSeq[2].Value <<= aFileURL;
- aSeq[3].Name = OUString( SVXGALLERYITEM_FILTER );
- aSeq[3].Value <<= aFilterName;
- aSeq[4].Name = OUString( SVXGALLERYITEM_DRAWING );
- aSeq[4].Value <<= xDrawing;
- aSeq[5].Name = OUString( SVXGALLERYITEM_GRAPHIC );
- aSeq[5].Value <<= xGraphic;
+ aSeq[1].Name = OUString( SVXGALLERYITEM_URL );
+ aSeq[1].Value <<= aFileURL;
+ aSeq[2].Name = OUString( SVXGALLERYITEM_FILTER );
+ aSeq[2].Value <<= aFilterName;
+ aSeq[3].Name = OUString( SVXGALLERYITEM_DRAWING );
+ aSeq[3].Value <<= xDrawing;
+ aSeq[4].Name = OUString( SVXGALLERYITEM_GRAPHIC );
+ aSeq[4].Value <<= xGraphic;
css::uno::Sequence< css::beans::PropertyValue > aArgs( 1 );
aArgs[0].Name = OUString( SVXGALLERYITEM_ARGNAME );
diff --git a/svx/source/gallery2/gallery.src b/svx/source/gallery2/gallery.src
index a5628b4bdcf0..5cb3385e9d34 100644
--- a/svx/source/gallery2/gallery.src
+++ b/svx/source/gallery2/gallery.src
@@ -302,37 +302,15 @@ Menu RID_SVXMN_GALLERY2
{
MenuItem
{
- Identifier = MN_ADDMENU ;
- HelpId = HID_GALLERY_MN_ADDMENU ;
+ Identifier = MN_ADD ;
+ HelpId = HID_GALLERY_MN_ADD ;
Text [ en-US ] = "~Insert" ;
- SubMenu = Menu
- {
- ItemList =
- {
- MenuItem
- {
- Identifier = MN_ADD ;
- HelpId = HID_GALLERY_MN_ADD ;
- Text [ en-US ] = "~Copy" ;
- };
- MenuItem
- {
- Identifier = MN_ADD_LINK ;
- HelpId = HID_GALLERY_MN_ADD_LINK ;
- Text [ en-US ] = "Link" ;
- };
- MenuItem
- {
- Separator = TRUE ;
- };
- MenuItem
- {
- Identifier = MN_BACKGROUND ;
- HelpId = HID_GALLERY_MN_BACKGROUND ;
- Text [ en-US ] = "Bac~kground" ;
- };
- };
- };
+ };
+ MenuItem
+ {
+ Identifier = MN_BACKGROUND ;
+ HelpId = HID_GALLERY_MN_BACKGROUND ;
+ Text [ en-US ] = "Insert as Bac~kground" ;
};
MenuItem
{
diff --git a/svx/source/items/galleryitem.cxx b/svx/source/items/galleryitem.cxx
index 18a73f76ccaf..50b39a1e5326 100644
--- a/svx/source/items/galleryitem.cxx
+++ b/svx/source/items/galleryitem.cxx
@@ -30,7 +30,6 @@ TYPEINIT1_AUTOFACTORY( SvxGalleryItem, SfxPoolItem );
SvxGalleryItem::SvxGalleryItem()
: m_nType( css::gallery::GalleryItemType::EMPTY )
- , m_bIsLink( sal_False )
{
DBG_CTOR(SvxGalleryItem, 0);
}
@@ -38,7 +37,6 @@ SvxGalleryItem::SvxGalleryItem()
SvxGalleryItem::SvxGalleryItem( const SvxGalleryItem &rItem )
: SfxPoolItem( rItem )
, m_nType( rItem.m_nType )
- , m_bIsLink( rItem.m_bIsLink )
, m_aURL( rItem.m_aURL )
, m_xDrawing( rItem.m_xDrawing )
, m_xGraphic( rItem.m_xGraphic )
@@ -50,7 +48,6 @@ SvxGalleryItem::SvxGalleryItem(
const ::sal_uInt16 nId )
: SfxPoolItem( nId )
, m_nType( css::gallery::GalleryItemType::EMPTY )
- , m_bIsLink( sal_False )
{
DBG_CTOR(SvxGalleryItem, 0);
}
@@ -66,16 +63,14 @@ bool SvxGalleryItem::QueryValue( css::uno::Any& rVal, sal_uInt8 /* nMemberId */
aSeq[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SVXGALLERYITEM_TYPE ));
aSeq[0].Value <<= m_nType;
- aSeq[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SVXGALLERYITEM_LINK ));
- aSeq[1].Value <<= m_bIsLink;
- aSeq[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SVXGALLERYITEM_URL ));
+ aSeq[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SVXGALLERYITEM_URL ));
+ aSeq[1].Value <<= m_aURL;
+ aSeq[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SVXGALLERYITEM_FILTER ));
aSeq[2].Value <<= m_aURL;
- aSeq[3].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SVXGALLERYITEM_FILTER ));
- aSeq[3].Value <<= m_aURL;
- aSeq[4].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SVXGALLERYITEM_DRAWING ));
- aSeq[4].Value <<= m_xDrawing;
- aSeq[5].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SVXGALLERYITEM_GRAPHIC ));
- aSeq[5].Value <<= m_xGraphic;
+ aSeq[3].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SVXGALLERYITEM_DRAWING ));
+ aSeq[3].Value <<= m_xDrawing;
+ aSeq[4].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SVXGALLERYITEM_GRAPHIC ));
+ aSeq[4].Value <<= m_xGraphic;
rVal <<= aSeq;
@@ -94,7 +89,6 @@ bool SvxGalleryItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /* nMemberId
sal_Bool bIsSetType( sal_False );
sal_Int8 nType(0);
- sal_Bool bIsLink( sal_False );
rtl::OUString aURL, aFilterName;
css::uno::Reference< css::lang::XComponent > xDrawing;
css::uno::Reference< css::graphic::XGraphic > xGraphic;
@@ -108,11 +102,6 @@ bool SvxGalleryItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /* nMemberId
bAllConverted &= bIsSetType = ( pProp->Value >>= nType );
++nConverted;
}
- else if ( pProp->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SVXGALLERYITEM_LINK ) ) )
- {
- bAllConverted &= ( pProp->Value >>= bIsLink );
- ++nConverted;
- }
else if ( pProp->Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( SVXGALLERYITEM_URL ) ) )
{
bAllConverted &= ( pProp->Value >>= aURL );
@@ -139,7 +128,6 @@ bool SvxGalleryItem::PutValue( const css::uno::Any& rVal, sal_uInt8 /* nMemberId
return false;
m_nType = nType;
- m_bIsLink = bIsLink;
m_aURL = aURL;
m_aFilterName = aFilterName;
m_xDrawing = xDrawing;
@@ -155,7 +143,6 @@ int SvxGalleryItem::operator==( const SfxPoolItem& rAttr ) const
const SvxGalleryItem& rItem = static_cast<const SvxGalleryItem&>(rAttr);
int bRet = m_nType == rItem.m_nType &&
- m_bIsLink == rItem.m_bIsLink &&
m_aURL == rItem.m_aURL &&
m_xDrawing == rItem.m_xDrawing &&
m_xGraphic == rItem.m_xGraphic;