summaryrefslogtreecommitdiff
path: root/sc/source/ui/vba/vbaworkbook.cxx
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2018-04-25 17:04:49 +0300
committerTor Lillqvist <tml@collabora.com>2018-05-31 15:46:25 +0300
commit034e8bfafadf3dfe930447696b7a686345aa6632 (patch)
tree8106381c203afb3d750219298d83296613f54718 /sc/source/ui/vba/vbaworkbook.cxx
parentb11329eed924483a24f2c05d97c573b9a95b26e8 (diff)
Add Author property to ooo::vba::excel::XWorkbook and implement it
Corresponds to the Author attribute of css::document::XDocumentProperties. I.e. the initial creator of the document. Change-Id: I07d3ce9dfb87900948d2bb7af14109b17546fb4c
Diffstat (limited to 'sc/source/ui/vba/vbaworkbook.cxx')
-rw-r--r--sc/source/ui/vba/vbaworkbook.cxx18
1 files changed, 18 insertions, 0 deletions
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 )
{