From eb56caec68477d11f281090a09c130a416626d88 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Sat, 29 Jun 2024 23:01:21 +0500 Subject: [PATCH] Fix VBA Table's *Padding properties type In VBA, it is Single, not Double. See VBA documentation: https://learn.microsoft.com/en-us/office/vba/api/word.table.bottompadding https://learn.microsoft.com/en-us/office/vba/api/word.table.leftpadding https://learn.microsoft.com/en-us/office/vba/api/word.table.rightpadding https://learn.microsoft.com/en-us/office/vba/api/word.table.toppadding Change-Id: I9262462424fc11b5c062a61754ab0fab9103f549 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169763 Reviewed-by: Mike Kaganski Tested-by: Jenkins --- oovbaapi/ooo/vba/word/XTable.idl | 8 ++++---- sw/source/ui/vba/vbatable.cxx | 16 ++++++++-------- sw/source/ui/vba/vbatable.hxx | 16 ++++++++-------- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/oovbaapi/ooo/vba/word/XTable.idl b/oovbaapi/ooo/vba/word/XTable.idl index 683e859e4040..42b05950785c 100644 --- a/oovbaapi/ooo/vba/word/XTable.idl +++ b/oovbaapi/ooo/vba/word/XTable.idl @@ -55,10 +55,10 @@ interface XTable any Rows([in] any aIndex ); any Columns([in] any aIndex ); - [attribute] double BottomPadding; - [attribute] double LeftPadding; - [attribute] double RightPadding; - [attribute] double TopPadding; + [attribute] float BottomPadding; + [attribute] float LeftPadding; + [attribute] float RightPadding; + [attribute] float TopPadding; }; }; }; }; diff --git a/sw/source/ui/vba/vbatable.cxx b/sw/source/ui/vba/vbatable.cxx index 599991a8564b..12825a7fadde 100644 --- a/sw/source/ui/vba/vbatable.cxx +++ b/sw/source/ui/vba/vbatable.cxx @@ -95,7 +95,7 @@ SwVbaTable::Borders( const uno::Any& index ) return uno::Any( xCol ); } -double SAL_CALL +float SAL_CALL SwVbaTable::getBottomPadding() { uno::Reference< beans::XPropertySet > xPropertySet( mxTextTable, uno::UNO_QUERY_THROW); @@ -105,7 +105,7 @@ SwVbaTable::getBottomPadding() } void SAL_CALL -SwVbaTable::setBottomPadding( double fValue ) +SwVbaTable::setBottomPadding( float fValue ) { uno::Reference< beans::XPropertySet > xPropertySet( mxTextTable, uno::UNO_QUERY_THROW); table::TableBorderDistances aTableBorderDistances; @@ -114,7 +114,7 @@ SwVbaTable::setBottomPadding( double fValue ) xPropertySet->setPropertyValue( u"TableBorderDistances"_ustr, uno::Any( aTableBorderDistances ) ); } -double SAL_CALL +float SAL_CALL SwVbaTable::getLeftPadding() { uno::Reference< beans::XPropertySet > xPropertySet( mxTextTable, uno::UNO_QUERY_THROW); @@ -124,7 +124,7 @@ SwVbaTable::getLeftPadding() } void SAL_CALL -SwVbaTable::setLeftPadding( double fValue ) +SwVbaTable::setLeftPadding( float fValue ) { uno::Reference< beans::XPropertySet > xPropertySet( mxTextTable, uno::UNO_QUERY_THROW); table::TableBorderDistances aTableBorderDistances; @@ -133,7 +133,7 @@ SwVbaTable::setLeftPadding( double fValue ) xPropertySet->setPropertyValue( u"TableBorderDistances"_ustr, uno::Any( aTableBorderDistances ) ); } -double SAL_CALL +float SAL_CALL SwVbaTable::getRightPadding() { uno::Reference< beans::XPropertySet > xPropertySet( mxTextTable, uno::UNO_QUERY_THROW); @@ -143,7 +143,7 @@ SwVbaTable::getRightPadding() } void SAL_CALL -SwVbaTable::setRightPadding( double fValue ) +SwVbaTable::setRightPadding( float fValue ) { uno::Reference< beans::XPropertySet > xPropertySet( mxTextTable, uno::UNO_QUERY_THROW); table::TableBorderDistances aTableBorderDistances; @@ -152,7 +152,7 @@ SwVbaTable::setRightPadding( double fValue ) xPropertySet->setPropertyValue( u"TableBorderDistances"_ustr, uno::Any( aTableBorderDistances ) ); } -double SAL_CALL +float SAL_CALL SwVbaTable::getTopPadding() { uno::Reference< beans::XPropertySet > xPropertySet( mxTextTable, uno::UNO_QUERY_THROW); @@ -162,7 +162,7 @@ SwVbaTable::getTopPadding() } void SAL_CALL -SwVbaTable::setTopPadding( double fValue ) +SwVbaTable::setTopPadding( float fValue ) { uno::Reference< beans::XPropertySet > xPropertySet( mxTextTable, uno::UNO_QUERY_THROW); table::TableBorderDistances aTableBorderDistances; diff --git a/sw/source/ui/vba/vbatable.hxx b/sw/source/ui/vba/vbatable.hxx index 2bb802b5c605..0cd2502e07b0 100644 --- a/sw/source/ui/vba/vbatable.hxx +++ b/sw/source/ui/vba/vbatable.hxx @@ -39,14 +39,14 @@ public: virtual void SAL_CALL Delete( ) override; virtual OUString SAL_CALL getName( ) override; virtual css::uno::Any SAL_CALL Borders( const css::uno::Any& aIndex ) override; - virtual double SAL_CALL getBottomPadding( ) override; - virtual void SAL_CALL setBottomPadding( double fValue ) override; - virtual double SAL_CALL getLeftPadding( ) override; - virtual void SAL_CALL setLeftPadding( double fValue ) override; - virtual double SAL_CALL getRightPadding( ) override; - virtual void SAL_CALL setRightPadding( double fValue ) override; - virtual double SAL_CALL getTopPadding( ) override; - virtual void SAL_CALL setTopPadding( double fValue ) override; + virtual float SAL_CALL getBottomPadding( ) override; + virtual void SAL_CALL setBottomPadding( float fValue ) override; + virtual float SAL_CALL getLeftPadding( ) override; + virtual void SAL_CALL setLeftPadding( float fValue ) override; + virtual float SAL_CALL getRightPadding( ) override; + virtual void SAL_CALL setRightPadding( float fValue ) override; + virtual float SAL_CALL getTopPadding( ) override; + virtual void SAL_CALL setTopPadding( float fValue ) override; virtual css::uno::Any SAL_CALL Rows( const css::uno::Any& aIndex ) override; virtual css::uno::Any SAL_CALL Columns( const css::uno::Any& aIndex ) override;