Kaydet (Commit) 034e8bfa authored tarafından Tor Lillqvist's avatar Tor Lillqvist

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
üst b11329ee
......@@ -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);
......
......@@ -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 )
{
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment