summaryrefslogtreecommitdiff
path: root/sc/source/ui/vba/vbasheetobject.cxx
diff options
context:
space:
mode:
authorDaniel Rentz [dr] <daniel.rentz@oracle.com>2010-12-27 12:33:29 +0100
committerDaniel Rentz [dr] <daniel.rentz@oracle.com>2010-12-27 12:33:29 +0100
commitd1743d1d6b0cffe02ddf247ea7f370992791ed7c (patch)
treea86147c926dfcc5056ee2bb19c1c112722a7d247 /sc/source/ui/vba/vbasheetobject.cxx
parentc2582bb129a0368f5ca054ea8efcc075a75136e8 (diff)
parente0cef95bab1bd41fce1f08be9d6a2fed71f16944 (diff)
dr77: rebase to DEV300m96
Diffstat (limited to 'sc/source/ui/vba/vbasheetobject.cxx')
-rw-r--r--sc/source/ui/vba/vbasheetobject.cxx35
1 files changed, 31 insertions, 4 deletions
diff --git a/sc/source/ui/vba/vbasheetobject.cxx b/sc/source/ui/vba/vbasheetobject.cxx
index f92cafa0da0d..7c8d80d9fcfa 100644
--- a/sc/source/ui/vba/vbasheetobject.cxx
+++ b/sc/source/ui/vba/vbasheetobject.cxx
@@ -38,7 +38,9 @@
#include <rtl/ustrbuf.hxx>
#include <filter/msfilter/msvbahelper.hxx>
#include <oox/helper/helper.hxx>
+#include <svx/unoshape.hxx>
#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)