diff options
author | Hannah Meeks <hmeeks4135@gmail.com> | 2022-08-05 10:48:50 +0100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2022-08-06 14:16:50 +0200 |
commit | 5fecf10b9ef6e76aa1d06b7ab350abb5a495dda0 (patch) | |
tree | 5c523a0591585acd3f5167e189ac0894a1334162 | |
parent | 4d96e375c28f9fe2dded40cba4ee8c67f77817f3 (diff) |
VBA Add conversion methods to global
Change-Id: I920799321f245c015a527c816272c1038cc04544
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137851
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
-rw-r--r-- | oovbaapi/ooo/vba/word/XGlobals.idl | 9 | ||||
-rw-r--r-- | sw/source/ui/vba/vbaglobals.cxx | 45 | ||||
-rw-r--r-- | sw/source/ui/vba/vbaglobals.hxx | 10 |
3 files changed, 64 insertions, 0 deletions
diff --git a/oovbaapi/ooo/vba/word/XGlobals.idl b/oovbaapi/ooo/vba/word/XGlobals.idl index 9808187a0d9f..8d2ee3900fcc 100644 --- a/oovbaapi/ooo/vba/word/XGlobals.idl +++ b/oovbaapi/ooo/vba/word/XGlobals.idl @@ -37,6 +37,15 @@ interface XGlobals : com::sun::star::uno::XInterface any Dialogs( [in] any Index ); any ListGalleries( [in] any aIndex ); float CentimetersToPoints([in] float Centimeters ); + float PointsToCentimeters( [in] float Points); + float PixelsToPoints( [in] float Pixels, [in] boolean fVertical ); + float PointsToPixels( [in] float Points, [in] boolean fVertical); + float InchesToPoints( [in] float Inches); + float PointsToInches( [in] float Points); + float MillimetersToPoints( [in] float Millimeters ); + float PointsToMillimeters( [in] float Points); + float PicasToPoints( [in] float Picas); + float PointsToPicas( [in] float Points); }; }; }; }; diff --git a/sw/source/ui/vba/vbaglobals.cxx b/sw/source/ui/vba/vbaglobals.cxx index 0e5db3802895..6492b2628d59 100644 --- a/sw/source/ui/vba/vbaglobals.cxx +++ b/sw/source/ui/vba/vbaglobals.cxx @@ -129,6 +129,51 @@ float SAL_CALL SwVbaGlobals::CentimetersToPoints( float Centimeters ) return getApplication()->CentimetersToPoints( Centimeters ); } +float SAL_CALL SwVbaGlobals::PointsToCentimeters( float Points ) +{ + return getApplication()->PointsToCentimeters( Points ); +} + +float SAL_CALL SwVbaGlobals::PixelsToPoints( float Pixels, ::sal_Bool fVertical ) +{ + return getApplication()->PixelsToPoints( Pixels, fVertical ); +} + +float SAL_CALL SwVbaGlobals::PointsToPixels( float Points, ::sal_Bool fVertical ) +{ + return getApplication()->PointsToPixels( Points, fVertical ); +} + +float SAL_CALL SwVbaGlobals::InchesToPoints( float Inches ) +{ + return getApplication()->InchesToPoints( Inches ); +} + +float SAL_CALL SwVbaGlobals::PointsToInches( float Points ) +{ + return getApplication()->PointsToInches( Points ); +} + +float SAL_CALL SwVbaGlobals::MillimetersToPoints( float Millimeters ) +{ + return getApplication()->MillimetersToPoints( Millimeters ); +} + +float SAL_CALL SwVbaGlobals::PointsToMillimeters( float Points ) +{ + return getApplication()->PointsToMillimeters( Points ); +} + +float SAL_CALL SwVbaGlobals::PicasToPoints( float Picas ) +{ + return getApplication()->PicasToPoints( Picas ); +} + +float SAL_CALL SwVbaGlobals::PointsToPicas( float Points ) +{ + return getApplication()->PointsToPicas( Points ); +} + OUString SwVbaGlobals::getServiceImplName() { diff --git a/sw/source/ui/vba/vbaglobals.hxx b/sw/source/ui/vba/vbaglobals.hxx index 1d8c0b4f8a2a..af26f1b6256d 100644 --- a/sw/source/ui/vba/vbaglobals.hxx +++ b/sw/source/ui/vba/vbaglobals.hxx @@ -56,6 +56,16 @@ public: virtual css::uno::Any SAL_CALL Dialogs(const css::uno::Any& aIndex) override; virtual css::uno::Any SAL_CALL ListGalleries(const css::uno::Any& aIndex) override; virtual float SAL_CALL CentimetersToPoints(float Centimeters) override; + virtual float SAL_CALL PointsToCentimeters(float Points) override; + virtual float SAL_CALL PixelsToPoints(float Pixels, ::sal_Bool fVertical) override; + virtual float SAL_CALL PointsToPixels(float Pixels, ::sal_Bool fVertical) override; + virtual float SAL_CALL InchesToPoints(float Inches) override; + virtual float SAL_CALL PointsToInches(float Points) override; + virtual float SAL_CALL MillimetersToPoints(float Millimeters) override; + virtual float SAL_CALL PointsToMillimeters(float Points) override; + virtual float SAL_CALL PicasToPoints(float Picas) override; + virtual float SAL_CALL PointsToPicas(float Points) override; + // XMultiServiceFactory virtual css::uno::Sequence<OUString> SAL_CALL getAvailableServiceNames() override; |