summaryrefslogtreecommitdiff
path: root/sc/source/ui/drawfunc
diff options
context:
space:
mode:
authorNoel Power <noel.power@novell.com>2010-10-06 10:15:43 +0100
committerNoel Power <noel.power@novell.com>2010-10-06 10:15:43 +0100
commitf13fd7b138caee676cf5dbeae3474e4a4b0b177a (patch)
tree58bbab934d3fd26a8fd886a2dbc52b5a2d283092 /sc/source/ui/drawfunc
parent44231089eeda805727f6c7143729612059891b02 (diff)
initial commit for vba blob ( not including container_control stuff )
Diffstat (limited to 'sc/source/ui/drawfunc')
-rw-r--r--sc/source/ui/drawfunc/drawsh.cxx4
-rw-r--r--sc/source/ui/drawfunc/drawsh2.cxx4
-rw-r--r--sc/source/ui/drawfunc/drawsh5.cxx4
-rw-r--r--sc/source/ui/drawfunc/fudraw.cxx4
-rw-r--r--sc/source/ui/drawfunc/fusel.cxx16
-rw-r--r--sc/source/ui/drawfunc/makefile.mk1
-rw-r--r--sc/source/ui/drawfunc/objdraw.src6
7 files changed, 12 insertions, 27 deletions
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 5199b721352a..cb44b695469a 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -205,7 +205,6 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
ExecuteTextAttrDlg( rReq );
break;
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
case SID_DRAW_HLINK_EDIT:
if ( pSingleSelectedObj )
pViewData->GetDispatcher().Execute( SID_HYPERLINK_DIALOG );
@@ -233,7 +232,6 @@ void ScDrawShell::ExecDrawAttr( SfxRequest& rReq )
ScGlobal::OpenURL( pInfo->GetHlink(), String::EmptyString() );
}
break;
-#endif
case SID_ATTR_TRANSFORM:
{
@@ -473,7 +471,6 @@ void ScDrawShell::ExecuteTextAttrDlg( SfxRequest& rReq, USHORT /* nTabPage */ )
delete( pDlg );
}
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
void ScDrawShell::SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk )
{
if ( pObj )
@@ -483,5 +480,4 @@ void ScDrawShell::SetHlinkForObject( SdrObject* pObj, const rtl::OUString& rHlnk
lcl_setModified( GetObjectShell() );
}
}
-#endif
diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx
index 7da571fc05a7..67e3114976c1 100644
--- a/sc/source/ui/drawfunc/drawsh2.cxx
+++ b/sc/source/ui/drawfunc/drawsh2.cxx
@@ -197,24 +197,20 @@ void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet ) // Funktionen disabl
BOOL bCanRename = FALSE;
if ( nMarkCount > 1 )
{
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
// no hypelink options for a selected group
rSet.DisableItem( SID_DRAW_HLINK_EDIT );
rSet.DisableItem( SID_DRAW_HLINK_DELETE );
rSet.DisableItem( SID_OPEN_HYPERLINK );
-#endif
}
else if ( nMarkCount == 1 )
{
SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj();
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
if ( !pInfo || (pInfo->GetHlink().getLength() == 0) )
{
rSet.DisableItem( SID_DRAW_HLINK_DELETE );
rSet.DisableItem( SID_OPEN_HYPERLINK );
}
-#endif
SdrLayerID nLayerID = pObj->GetLayer();
if ( nLayerID != SC_LAYER_INTERN )
bCanRename = TRUE; // #i51351# anything except internal objects can be renamed
diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx
index a05083eeadcc..21c9dc39526f 100644
--- a/sc/source/ui/drawfunc/drawsh5.cxx
+++ b/sc/source/ui/drawfunc/drawsh5.cxx
@@ -90,14 +90,12 @@ void ScDrawShell::GetHLinkState( SfxItemSet& rSet ) // Hyperlink
if ( nMarkCount == 1 ) // URL-Button markiert ?
{
SdrObject* pObj = rMarkList.GetMark(0)->GetMarkedSdrObj();
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj );
if ( pInfo && (pInfo->GetHlink().getLength() > 0) )
{
aHLinkItem.SetURL( pInfo->GetHlink() );
aHLinkItem.SetInsertMode(HLINK_FIELD);
}
-#endif
SdrUnoObj* pUnoCtrl = PTR_CAST(SdrUnoObj, pObj);
if (pUnoCtrl && FmFormInventor == pUnoCtrl->GetObjInventor())
{
@@ -240,13 +238,11 @@ void ScDrawShell::ExecuteHLink( SfxRequest& rReq )
bDone = TRUE;
}
}
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
else
{
SetHlinkForObject( pObj, rURL );
bDone = TRUE;
}
-#endif
}
}
diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx
index bad23bf26ed1..a99f8b4298fb 100644
--- a/sc/source/ui/drawfunc/fudraw.cxx
+++ b/sc/source/ui/drawfunc/fudraw.cxx
@@ -828,11 +828,7 @@ void FuDraw::ForcePointer(const MouseEvent* pMEvt)
SdrObjMacroHitRec aHitRec; //! muss da noch irgendwas gesetzt werden ????
pViewShell->SetActivePointer( pObj->GetMacroPointer(aHitRec) );
}
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
else if ( !bAlt && pInfo && ((pInfo->GetMacro().getLength() > 0) || (pInfo->GetHlink().getLength() > 0)) )
-#else
- else if ( !bAlt && pInfo && (pInfo->GetMacro().getLength() > 0) )
-#endif
pWindow->SetPointer( Pointer( POINTER_REFHAND ) );
else if ( IsDetectiveHit( aPnt ) )
pViewShell->SetActivePointer( Pointer( POINTER_DETECTIVE ) );
diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx
index 4a456522003c..6972834ced02 100644
--- a/sc/source/ui/drawfunc/fusel.cxx
+++ b/sc/source/ui/drawfunc/fusel.cxx
@@ -202,7 +202,6 @@ BOOL __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
}
ScMacroInfo* pInfo = ScDrawLayer::GetMacroInfo( pObj, TRUE );
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
// For interoperability favour links over macros if both are defined
if ( pInfo->GetHlink().getLength() > 0 )
{
@@ -210,20 +209,27 @@ BOOL __EXPORT FuSelection::MouseButtonDown(const MouseEvent& rMEvt)
sURL = pInfo->GetHlink();
}
else if ( pInfo->GetMacro().getLength() > 0 )
-#else
- if ( pInfo->GetMacro().getLength() > 0 )
-#endif
{
SfxObjectShell* pObjSh = SfxObjectShell::Current();
if ( pObjSh && SfxApplication::IsXScriptURL( pInfo->GetMacro() ) )
{
+ uno::Reference< beans::XPropertySet > xProps( pObj->getUnoShape(), uno::UNO_QUERY );
+ uno::Any aCaller;
+ if ( xProps.is() )
+ {
+ try
+ {
+ aCaller = xProps->getPropertyValue( rtl::OUString::createFromAscii("Name") );
+ }
+ catch( uno::Exception& ) {}
+ }
uno::Any aRet;
uno::Sequence< sal_Int16 > aOutArgsIndex;
uno::Sequence< uno::Any > aOutArgs;
uno::Sequence< uno::Any >* pInArgs =
new uno::Sequence< uno::Any >(0);
pObjSh->CallXScript( pInfo->GetMacro(),
- *pInArgs, aRet, aOutArgsIndex, aOutArgs);
+ *pInArgs, aRet, aOutArgsIndex, aOutArgs, true, &aCaller );
pViewShell->FakeButtonUp( pViewShell->GetViewData()->GetActivePart() );
return TRUE; // kein CaptureMouse etc.
}
diff --git a/sc/source/ui/drawfunc/makefile.mk b/sc/source/ui/drawfunc/makefile.mk
index a50c450ab373..f82008e4cdeb 100644
--- a/sc/source/ui/drawfunc/makefile.mk
+++ b/sc/source/ui/drawfunc/makefile.mk
@@ -75,6 +75,7 @@ SLOFILES = \
$(SLO)$/mediash.obj
EXCEPTIONSFILES= \
+ $(SLO)$/fusel.obj \
$(SLO)$/fuins2.obj \
$(SLO)$/graphsh.obj \
$(SLO)$/mediash.obj
diff --git a/sc/source/ui/drawfunc/objdraw.src b/sc/source/ui/drawfunc/objdraw.src
index 82649044b38c..c221567f3671 100644
--- a/sc/source/ui/drawfunc/objdraw.src
+++ b/sc/source/ui/drawfunc/objdraw.src
@@ -186,7 +186,6 @@
ITEM_FORMAT_PARA_DLG\
};
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
#define MN_EDITLNK \
MenuItem\
{\
@@ -202,7 +201,6 @@
HelpID = SID_DRAW_HLINK_DELETE ; \
Text [ en-US ] = "~Remove Hyperlink" ; \
};
-#endif
#define MN_DRWTXTATTR \
MenuItem\
@@ -1297,14 +1295,12 @@ Menu RID_POPUP_DRAW
MenuItem { Separator = TRUE ; };
//------------------------------
ITEM_GROUP_MENU
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
//------------------------------
MenuItem { Separator = TRUE ; };
//------------------------------
MN_EDITLNK
MN_DELLNK
MenuItem { ITEM_OPEN_HYPERLINK };
-#endif
};
};
@@ -1374,14 +1370,12 @@ Menu RID_POPUP_GRAPHIC
MenuItem { Separator = TRUE ; };
//------------------------------
ITEM_GROUP_MENU
-#ifdef ISSUE66550_HLINK_FOR_SHAPES
//------------------------------
MenuItem { Separator = TRUE ; };
//------------------------------
MN_EDITLNK
MN_DELLNK
MenuItem { ITEM_OPEN_HYPERLINK };
-#endif
};
};