summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oovbaapi/ooo/vba/excel/XApplication.idl1
-rw-r--r--sc/source/ui/vba/vbaapplication.cxx9
-rw-r--r--sc/source/ui/vba/vbaapplication.hxx1
3 files changed, 11 insertions, 0 deletions
diff --git a/oovbaapi/ooo/vba/excel/XApplication.idl b/oovbaapi/ooo/vba/excel/XApplication.idl
index d5c48a723484..d0c346b881e5 100644
--- a/oovbaapi/ooo/vba/excel/XApplication.idl
+++ b/oovbaapi/ooo/vba/excel/XApplication.idl
@@ -89,6 +89,7 @@ interface XApplication
void Volatile([in] any Volatile);
any Caller( [in] any Index );
any MenuBars( [in] any aIndex );
+ void Undo();
};
}; }; };
diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx
index a15aeffa5034..3175f650d628 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -1309,6 +1309,15 @@ void SAL_CALL ScVbaApplication::OnKey( const OUString& Key, const uno::Any& Proc
}
}
+void SAL_CALL ScVbaApplication::Undo() throw (uno::RuntimeException)
+{
+ uno::Reference< frame::XModel > xModel( getThisExcelDoc( mxContext ), uno::UNO_SET_THROW );
+
+ ScTabViewShell* pViewShell = excel::getBestViewShell( xModel );
+ if ( pViewShell )
+ dispatchExecute( pViewShell, SID_UNDO );
+}
+
OUString
ScVbaApplication::getServiceImplName()
{
diff --git a/sc/source/ui/vba/vbaapplication.hxx b/sc/source/ui/vba/vbaapplication.hxx
index 1991714fb77a..3866403543b7 100644
--- a/sc/source/ui/vba/vbaapplication.hxx
+++ b/sc/source/ui/vba/vbaapplication.hxx
@@ -124,6 +124,7 @@ public:
virtual css::uno::Any SAL_CALL Caller( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL GetOpenFilename( const css::uno::Any& rFileFilter, const css::uno::Any& rFilterIndex, const css::uno::Any& rTitle, const css::uno::Any& rButtonText, const css::uno::Any& rMultiSelect ) throw (css::uno::RuntimeException);
virtual css::uno::Any SAL_CALL GetSaveAsFilename( const css::uno::Any& rInitialFileName, const css::uno::Any& rFileFilter, const css::uno::Any& rFilterIndex, const css::uno::Any& rTitle, const css::uno::Any& rButtonText ) throw (css::uno::RuntimeException);
+ virtual void Undo() throw (css::uno::RuntimeException);
// XHelperInterface
virtual OUString getServiceImplName();
virtual css::uno::Sequence<OUString> getServiceNames();