From 9840b5ce988888a7c85560e2b1e0c1b99bfa96b4 Mon Sep 17 00:00:00 2001 From: Daniel Rentz Date: Thu, 26 Aug 2010 18:37:44 +0200 Subject: dr77: #i114128# import legacy drawing controls --- sc/source/ui/vba/vbasheetobject.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) mode change 100755 => 100644 sc/source/ui/vba/vbasheetobject.cxx (limited to 'sc/source/ui/vba/vbasheetobject.cxx') diff --git a/sc/source/ui/vba/vbasheetobject.cxx b/sc/source/ui/vba/vbasheetobject.cxx old mode 100755 new mode 100644 index 4bd0f1d60547..f92cafa0da0d --- a/sc/source/ui/vba/vbasheetobject.cxx +++ b/sc/source/ui/vba/vbasheetobject.cxx @@ -350,14 +350,14 @@ void SAL_CALL ScVbaControlObjectBase::setOnAction( const OUString& rMacroName ) // if a macro name has been passed, try to attach it to the event if( rMacroName.getLength() > 0 ) { - VBAMacroResolvedInfo aResolvedMacro = resolveVBAMacro( getSfxObjShell( mxModel ), rMacroName ); - if( !aResolvedMacro.IsResolved() ) + MacroResolvedInfo aResolvedMacro = resolveVBAMacro( getSfxObjShell( mxModel ), rMacroName ); + if( !aResolvedMacro.mbFound ) throw uno::RuntimeException(); script::ScriptEventDescriptor aDescriptor; aDescriptor.ListenerType = maListenerType; aDescriptor.EventMethod = maEventMethod; aDescriptor.ScriptType = CREATE_OUSTRING( "Script" ); - aDescriptor.ScriptCode = makeMacroURL( aResolvedMacro.ResolvedMacro() ); + aDescriptor.ScriptCode = makeMacroURL( aResolvedMacro.msResolvedMacro ); xEventMgr->registerScriptEvent( nIndex, aDescriptor ); } } -- cgit From 9f7c8470ae5b47b3a36e6f447228e8ec6f95d0c3 Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Wed, 8 Sep 2010 14:20:41 +0200 Subject: mib19: #163497# implement VBA Placement property --- sc/source/ui/vba/vbasheetobject.cxx | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) mode change 100755 => 100644 sc/source/ui/vba/vbasheetobject.cxx (limited to 'sc/source/ui/vba/vbasheetobject.cxx') diff --git a/sc/source/ui/vba/vbasheetobject.cxx b/sc/source/ui/vba/vbasheetobject.cxx old mode 100755 new mode 100644 index 4bd0f1d60547..28e54de859ad --- a/sc/source/ui/vba/vbasheetobject.cxx +++ b/sc/source/ui/vba/vbasheetobject.cxx @@ -38,7 +38,9 @@ #include #include #include +#include #include "vbafont.hxx" +#include "drwlayer.hxx" using ::rtl::OUString; using namespace ::com::sun::star; @@ -237,13 +239,38 @@ void SAL_CALL ScVbaSheetObjectBase::setName( const OUString& rName ) throw (uno: sal_Int32 SAL_CALL ScVbaSheetObjectBase::getPlacement() throw (uno::RuntimeException) { - // TODO - return excel::XlPlacement::xlMoveAndSize; + sal_Int32 nRet = excel::XlPlacement::xlMoveAndSize; + SvxShape* pShape = SvxShape::getImplementation( mxShape ); + if(pShape) + { + SdrObject* pObj = pShape->GetSdrObject(); + if (pObj) + { + ScAnchorType eType = ScDrawLayer::GetAnchor(pObj); + if (eType == SCA_PAGE) + nRet = excel::XlPlacement::xlFreeFloating; + } + } + return nRet; } -void SAL_CALL ScVbaSheetObjectBase::setPlacement( sal_Int32 /*nPlacement*/ ) throw (uno::RuntimeException) +void SAL_CALL ScVbaSheetObjectBase::setPlacement( sal_Int32 nPlacement ) throw (uno::RuntimeException) { - // TODO + SvxShape* pShape = SvxShape::getImplementation( mxShape ); + if(pShape) + { + SdrObject* pObj = pShape->GetSdrObject(); + if (pObj) + { + ScAnchorType eType = SCA_CELL; + if ( nPlacement == excel::XlPlacement::xlFreeFloating ) + eType = SCA_PAGE; + + // xlMove is not supported, treated as SCA_CELL (xlMoveAndSize) + + ScDrawLayer::SetAnchor(pObj, eType); + } + } } sal_Bool SAL_CALL ScVbaSheetObjectBase::getPrintObject() throw (uno::RuntimeException) -- cgit