summaryrefslogtreecommitdiff
path: root/vbahelper/source/msforms/vbacontrol.cxx
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2013-04-05 09:04:42 +0100
committerNoel Power <noel.power@suse.com>2013-04-05 09:06:29 +0100
commitc2ac410fe6b709b1e75a5a7165e3233a8fb4f98b (patch)
treefb14ee2477febff359e92f27285b49e5d7437bbd /vbahelper/source/msforms/vbacontrol.cxx
parent975192e72eacbc2ab53c94a394eca11bb3a60728 (diff)
Revert "Added and fixed various vba API"
Diffstat (limited to 'vbahelper/source/msforms/vbacontrol.cxx')
-rw-r--r--vbahelper/source/msforms/vbacontrol.cxx56
1 files changed, 5 insertions, 51 deletions
diff --git a/vbahelper/source/msforms/vbacontrol.cxx b/vbahelper/source/msforms/vbacontrol.cxx
index b788368b8df4..075c26c8ab23 100644
--- a/vbahelper/source/msforms/vbacontrol.cxx
+++ b/vbahelper/source/msforms/vbacontrol.cxx
@@ -56,10 +56,6 @@
#include <vbahelper/helperdecl.hxx>
#include <toolkit/helper/vclunohelper.hxx>
#include <vcl/window.hxx>
-#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
-#include <com/sun/star/form/XFormsSupplier.hpp>
-#include <svx/svdobj.hxx>
-
using namespace com::sun::star;
using namespace ooo::vba;
@@ -306,7 +302,7 @@ ScVbaControl::getControlSource() throw (uno::RuntimeException)
table::CellAddress aAddress;
xProps->getPropertyValue( "BoundCell" ) >>= aAddress;
xConvertor->setPropertyValue( "Address" , uno::makeAny( aAddress ) );
- xConvertor->getPropertyValue( "XLA1Representation" ) >>= sControlSource;
+ xConvertor->getPropertyValue( "XL_A1_Representation" ) >>= sControlSource;
}
catch(const uno::Exception&)
{
@@ -319,40 +315,7 @@ void SAL_CALL
ScVbaControl::setControlSource( const OUString& _controlsource ) throw (uno::RuntimeException)
{
OUString sEmpty;
- // afaik this is only relevant for Excel documents ( and we need to set up a
- // reference tab in case no Sheet is specified in "_controlsource"
- // Can't use the active sheet either, code may of course access
- uno::Reference< drawing::XDrawPagesSupplier > xSupplier( m_xModel, uno::UNO_QUERY_THROW );
- uno::Reference< container::XIndexAccess > xIndex( xSupplier->getDrawPages(), uno::UNO_QUERY_THROW );
- sal_Int32 nLen = xIndex->getCount();
- bool bMatched = false;
- sal_Int16 nRefTab = 0;
- for ( sal_Int32 index = 0; index < nLen; ++index )
- {
- try
- {
- uno::Reference< form::XFormsSupplier > xFormSupplier( xIndex->getByIndex( index ), uno::UNO_QUERY_THROW );
- uno::Reference< container::XIndexAccess > xFormIndex( xFormSupplier->getForms(), uno::UNO_QUERY_THROW );
- // get the www-standard container
- uno::Reference< container::XIndexAccess > xFormControls( xFormIndex->getByIndex(0), uno::UNO_QUERY_THROW );
- sal_Int32 nCntrls = xFormControls->getCount();
- for( sal_Int32 cIndex = 0; cIndex < nCntrls; ++cIndex )
- {
- uno::Reference< uno::XInterface > xControl( xFormControls->getByIndex( cIndex ), uno::UNO_QUERY_THROW );
- bMatched = ( m_xProps == xControl );
- if ( bMatched )
- {
- nRefTab = index;
- break;
- }
- }
- }
- catch( uno::Exception& ) {}
- if ( bMatched )
- break;
- }
-
- svt::BindableControlHelper::ApplyListSourceAndBindableData( m_xModel, m_xProps, _controlsource, sEmpty, sal_uInt16( nRefTab ) );
+ svt::BindableControlHelper::ApplyListSourceAndBindableData( m_xModel, m_xProps, _controlsource, sEmpty );
}
OUString SAL_CALL
@@ -371,7 +334,7 @@ ScVbaControl::getRowSource() throw (uno::RuntimeException)
table::CellRangeAddress aAddress;
xProps->getPropertyValue( "CellRange" ) >>= aAddress;
xConvertor->setPropertyValue( "Address" , uno::makeAny( aAddress ) );
- xConvertor->getPropertyValue( "XLA1Representation" ) >>= sRowSource;
+ xConvertor->getPropertyValue( "XL_A1_Representation" ) >>= sRowSource;
}
catch(const uno::Exception&)
{
@@ -736,21 +699,12 @@ void ScVbaControl::setBackColor( sal_Int32 nBackColor ) throw (uno::RuntimeExcep
sal_Bool ScVbaControl::getAutoSize() throw (uno::RuntimeException)
{
- bool bIsResizeEnabled = false;
- uno::Reference< uno::XInterface > xIf( m_xControl, uno::UNO_QUERY_THROW );
- SdrObject* pObj = SdrObject::getSdrObjectFromXShape( xIf );
- if ( pObj )
- bIsResizeEnabled = !pObj->IsResizeProtect();
- return bIsResizeEnabled;
+ return sal_False;
}
// currently no implementation for this
-void ScVbaControl::setAutoSize( sal_Bool bAutoSize ) throw (uno::RuntimeException)
+void ScVbaControl::setAutoSize( sal_Bool /*bAutoSize*/ ) throw (uno::RuntimeException)
{
- uno::Reference< uno::XInterface > xIf( m_xControl, uno::UNO_QUERY_THROW );
- SdrObject* pObj = SdrObject::getSdrObjectFromXShape( xIf );
- if ( pObj )
- pObj->SetResizeProtect( !bAutoSize );
}
sal_Bool ScVbaControl::getLocked() throw (uno::RuntimeException)