summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2022-05-06 15:31:37 +0900
committerTomaž Vajngerl <quikee@gmail.com>2022-05-10 14:02:46 +0200
commitd5371ec06292b67fd5f401e9ad51586f603089f8 (patch)
treee7394e0b26315e9722cdc8ed1e97ed656193ef72 /chart2
parent6de2fc2a705d3f356cac898201a98d7db6102d1a (diff)
chart2: add func. to convert from css::awt and B2IRectangle
Change-Id: I6da70d4559d1536b788228bcae64f5e43462d8e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133922 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/inc/BaseGFXHelper.hxx2
-rw-r--r--chart2/source/tools/BaseGFXHelper.cxx6
-rw-r--r--chart2/source/view/main/ChartView.cxx4
3 files changed, 10 insertions, 2 deletions
diff --git a/chart2/source/inc/BaseGFXHelper.hxx b/chart2/source/inc/BaseGFXHelper.hxx
index fd24fa2b45b6..18481031e2ef 100644
--- a/chart2/source/inc/BaseGFXHelper.hxx
+++ b/chart2/source/inc/BaseGFXHelper.hxx
@@ -52,6 +52,8 @@ OOO_DLLPUBLIC_CHARTTOOLS css::awt::Point B2IRectangleToAWTPoint(
OOO_DLLPUBLIC_CHARTTOOLS css::awt::Size B2IRectangleToAWTSize(
const ::basegfx::B2IRectangle& rB2IRectangle );
+OOO_DLLPUBLIC_CHARTTOOLS css::awt::Rectangle toAwtRectangle(const basegfx::B2IRectangle& rB2IRectangle);
+
::basegfx::B3DVector Direction3DToB3DVector(
const css::drawing::Direction3D& rDirection );
diff --git a/chart2/source/tools/BaseGFXHelper.cxx b/chart2/source/tools/BaseGFXHelper.cxx
index b518e7dd8b8c..17bd4f5e1809 100644
--- a/chart2/source/tools/BaseGFXHelper.cxx
+++ b/chart2/source/tools/BaseGFXHelper.cxx
@@ -113,6 +113,12 @@ awt::Size B2IRectangleToAWTSize( const ::basegfx::B2IRectangle& rB2IRectangle )
static_cast< sal_Int32 >( rB2IRectangle.getHeight()));
}
+awt::Rectangle toAwtRectangle(const basegfx::B2IRectangle& rRectangle)
+{
+ return awt::Rectangle(rRectangle.getMinX(), rRectangle.getMinY(),
+ rRectangle.getWidth(), rRectangle.getHeight());
+}
+
B3DVector Direction3DToB3DVector( const Direction3D& rDirection )
{
return B3DVector(
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index cfed056234ae..3f96a68b2612 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -751,7 +751,7 @@ awt::Rectangle ChartView::impl_createDiagramAndContent( const CreateShapeParam2D
else
{
::basegfx::B2IRectangle aConsumedInnerRect = aVDiagram.getCurrentRectangle();
- m_aResultingDiagramRectangleExcludingAxes = awt::Rectangle( aConsumedInnerRect.getMinX(), aConsumedInnerRect.getMinY(), aConsumedInnerRect.getWidth(), aConsumedInnerRect.getHeight() );
+ m_aResultingDiagramRectangleExcludingAxes = BaseGFXHelper::toAwtRectangle(aConsumedInnerRect);
}
}
else
@@ -761,7 +761,7 @@ awt::Rectangle ChartView::impl_createDiagramAndContent( const CreateShapeParam2D
else
{
::basegfx::B2IRectangle aConsumedInnerRect = aVDiagram.getCurrentRectangle();
- m_aResultingDiagramRectangleExcludingAxes = awt::Rectangle( aConsumedInnerRect.getMinX(), aConsumedInnerRect.getMinY(), aConsumedInnerRect.getWidth(), aConsumedInnerRect.getHeight() );
+ m_aResultingDiagramRectangleExcludingAxes = BaseGFXHelper::toAwtRectangle(aConsumedInnerRect);
}
}