diff options
-rw-r--r-- | oovbaapi/ooo/vba/excel/XWorkbook.idl | 1 | ||||
-rw-r--r-- | sc/source/ui/vba/vbaworkbook.cxx | 18 | ||||
-rw-r--r-- | sc/source/ui/vba/vbaworkbook.hxx | 2 |
3 files changed, 21 insertions, 0 deletions
diff --git a/oovbaapi/ooo/vba/excel/XWorkbook.idl b/oovbaapi/ooo/vba/excel/XWorkbook.idl index 2c9b5871fdb6..fe310e2adc1a 100644 --- a/oovbaapi/ooo/vba/excel/XWorkbook.idl +++ b/oovbaapi/ooo/vba/excel/XWorkbook.idl @@ -32,6 +32,7 @@ interface XWorkbook [attribute, readonly] string CodeName; [attribute, readonly] long FileFormat; [attribute] boolean PrecisionAsDisplayed; + [attribute] string Author; any Worksheets( [in] any Index ); any Styles( [in] any Index ) raises (com::sun::star::script::BasicErrorException); diff --git a/sc/source/ui/vba/vbaworkbook.cxx b/sc/source/ui/vba/vbaworkbook.cxx index de08c8b59114..96ee2bf64a99 100644 --- a/sc/source/ui/vba/vbaworkbook.cxx +++ b/sc/source/ui/vba/vbaworkbook.cxx @@ -292,6 +292,24 @@ void SAL_CALL ScVbaWorkbook::setPrecisionAsDisplayed( sal_Bool _precisionAsDispl rDoc.SetDocOptions( aOpt ); } +OUString SAL_CALL ScVbaWorkbook::getAuthor() +{ + uno::Reference<document::XDocumentPropertiesSupplier> xDPS( getModel(), uno::UNO_QUERY ); + if (!xDPS.is()) + return OUString("?"); + uno::Reference<document::XDocumentProperties> xDocProps = xDPS->getDocumentProperties(); + return xDocProps->getAuthor(); +} + +void SAL_CALL ScVbaWorkbook::setAuthor( const OUString& _author ) +{ + uno::Reference<document::XDocumentPropertiesSupplier> xDPS( getModel(), uno::UNO_QUERY ); + if (!xDPS.is()) + return; + uno::Reference<document::XDocumentProperties> xDocProps = xDPS->getDocumentProperties(); + xDocProps->setAuthor( _author ); +} + void ScVbaWorkbook::SaveCopyAs( const OUString& sFileName ) { diff --git a/sc/source/ui/vba/vbaworkbook.hxx b/sc/source/ui/vba/vbaworkbook.hxx index 25c4b188017c..6efaa938cfa8 100644 --- a/sc/source/ui/vba/vbaworkbook.hxx +++ b/sc/source/ui/vba/vbaworkbook.hxx @@ -44,6 +44,8 @@ public: virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL getActiveSheet() override; virtual sal_Bool SAL_CALL getPrecisionAsDisplayed() override; virtual void SAL_CALL setPrecisionAsDisplayed( sal_Bool _precisionAsDisplayed ) override; + virtual OUString SAL_CALL getAuthor() override; + virtual void SAL_CALL setAuthor( const OUString& _author ) override; // Methods virtual css::uno::Any SAL_CALL Worksheets( const css::uno::Any& aIndex ) override; |