chart2/source/inc/BaseGFXHelper.hxx   |    2 ++
 chart2/source/tools/BaseGFXHelper.cxx |    6 ++++++
 chart2/source/view/main/ChartView.cxx |    4 ++--
 3 files changed, 10 insertions(+), 2 deletions(-)

New commits:
commit d5371ec06292b67fd5f401e9ad51586f603089f8
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Fri May 6 15:31:37 2022 +0900
Commit:     Tomaž Vajngerl <qui...@gmail.com>
CommitDate: Tue May 10 14:02:46 2022 +0200

    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 <qui...@gmail.com>

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);
         }
     }
 

Reply via email to