summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoel Power <noel.power@novell.com>2012-04-20 17:57:02 +0100
committerNoel Power <noel.power@novell.com>2012-04-20 18:26:21 +0100
commitf2cf3f30a76cb257bf44f9651b295280fb12d4aa (patch)
tree36fee55032f738e942b3eddbc541fc25c9d8e8fc
parentimplement VBA Application.DisplayFullScreen bnc#757885 (diff)
downloadcore-f2cf3f30a76cb257bf44f9651b295280fb12d4aa.tar.gz
core-f2cf3f30a76cb257bf44f9651b295280fb12d4aa.zip
vba api Application.DisplayScrollBars implementation bnc#757840
-rw-r--r--oovbaapi/ooo/vba/excel/XApplication.idl1
-rw-r--r--sc/source/ui/vba/vbaapplication.cxx21
-rw-r--r--sc/source/ui/vba/vbaapplication.hxx2
3 files changed, 24 insertions, 0 deletions
diff --git a/oovbaapi/ooo/vba/excel/XApplication.idl b/oovbaapi/ooo/vba/excel/XApplication.idl
index 6453011b1131..866ab21decc0 100644
--- a/oovbaapi/ooo/vba/excel/XApplication.idl
+++ b/oovbaapi/ooo/vba/excel/XApplication.idl
@@ -75,6 +75,7 @@ interface XApplication
[attribute] boolean Iteration;
[attribute] long EnableCancelKey;
[attribute] boolean DisplayFullScreen;
+ [attribute] boolean DisplayScrollBars;
void setDefaultFilePath([in] string DefaultFilePath) raises(com::sun::star::script::BasicErrorException);
diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx
index d9f4b10014fe..49638821dc9f 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -895,6 +895,27 @@ ScVbaApplication::setDisplayFullScreen( sal_Bool bSet ) throw (uno::RuntimeExce
}
sal_Bool SAL_CALL
+ScVbaApplication::getDisplayScrollBars() throw (uno::RuntimeException)
+{
+ ScTabViewShell* pShell = excel::getCurrentBestViewShell( mxContext );
+ if ( pShell )
+ {
+ return ( pShell->GetViewData()->IsHScrollMode() && pShell->GetViewData()->IsVScrollMode() );
+ }
+ return true;
+}
+
+void SAL_CALL
+ScVbaApplication::setDisplayScrollBars( sal_Bool bSet ) throw (uno::RuntimeException)
+{
+ // use uno here as it does all he repainting etc. magic
+ uno::Reference< sheet::XSpreadsheetView > xView( getCurrentDocument()->getCurrentController(), uno::UNO_QUERY_THROW );
+ uno::Reference< beans::XPropertySet > xProps( xView, uno::UNO_QUERY );
+ xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HasVerticalScrollBar") ), uno::makeAny( bSet ) );
+ xProps->setPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("HasHorizontalScrollBar") ), uno::makeAny( bSet ) );
+}
+
+sal_Bool SAL_CALL
ScVbaApplication::getVisible() throw (uno::RuntimeException)
{
sal_Bool bVisible = sal_True;
diff --git a/sc/source/ui/vba/vbaapplication.hxx b/sc/source/ui/vba/vbaapplication.hxx
index 3712bc14736a..9b1c5282dc5c 100644
--- a/sc/source/ui/vba/vbaapplication.hxx
+++ b/sc/source/ui/vba/vbaapplication.hxx
@@ -124,6 +124,8 @@ public:
virtual sal_Bool SAL_CALL getDisplayFullScreen() throw (css::uno::RuntimeException);
virtual void SAL_CALL setDisplayFullScreen( sal_Bool bSet ) throw (css::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL getDisplayScrollBars() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setDisplayScrollBars( sal_Bool bSet ) throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL Windows( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
virtual void SAL_CALL wait( double time ) throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL Range( const css::uno::Any& Cell1, const css::uno::Any& Cell2 ) throw (css::uno::RuntimeException);