[Libreoffice-commits] core.git: chart2/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sat Jan 2 07:37:13 UTC 2021


 chart2/source/controller/dialogs/tp_PolarOptions.cxx                   |    8 ++++----
 chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx |    5 +++--
 chart2/source/view/main/ChartItemPool.cxx                              |    2 +-
 3 files changed, 8 insertions(+), 7 deletions(-)

New commits:
commit 152b651cd023b7f411affce49ff160c99826abd5
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Thu Dec 31 19:04:37 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Jan 2 08:36:33 2021 +0100

    use SdrAngleItem for SCHATTR_STARTING_ANGLE
    
    Change-Id: Ibe6b882806df1b30e38f4461284a7514f4407b3c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108554
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.cxx b/chart2/source/controller/dialogs/tp_PolarOptions.cxx
index f96d9c614450..865736b3b66d 100644
--- a/chart2/source/controller/dialogs/tp_PolarOptions.cxx
+++ b/chart2/source/controller/dialogs/tp_PolarOptions.cxx
@@ -22,6 +22,7 @@
 
 #include <svl/eitem.hxx>
 #include <svl/intitem.hxx>
+#include <svx/sdangitm.hxx>
 #include <officecfg/Office/Compatibility.hxx>
 
 namespace chart
@@ -55,8 +56,7 @@ bool PolarOptionsTabPage::FillItemSet( SfxItemSet* rOutAttrs )
 {
     if (m_xAngleDialWin->get_visible())
     {
-        rOutAttrs->Put(SfxInt32Item(SCHATTR_STARTING_ANGLE,
-            static_cast< sal_Int32 >(m_xAngleDial->GetRotation()/100)));
+        rOutAttrs->Put(SdrAngleItem(SCHATTR_STARTING_ANGLE, m_xAngleDial->GetRotation()));
     }
 
     if( m_xCB_Clockwise->get_visible() )
@@ -74,8 +74,8 @@ void PolarOptionsTabPage::Reset(const SfxItemSet* rInAttrs)
 
     if (rInAttrs->GetItemState(SCHATTR_STARTING_ANGLE, true, &pPoolItem) == SfxItemState::SET)
     {
-        tools::Long nTmp = static_cast<tools::Long>(static_cast<const SfxInt32Item*>(pPoolItem)->GetValue());
-        m_xAngleDial->SetRotation( nTmp*100 );
+        sal_Int32 nTmp = static_cast<const SdrAngleItem*>(pPoolItem)->GetValue();
+        m_xAngleDial->SetRotation( nTmp );
     }
     else
     {
diff --git a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
index d50f39abc3bb..3c8fbcca9990 100644
--- a/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/SeriesOptionsItemConverter.cxx
@@ -32,6 +32,7 @@
 #include <svl/eitem.hxx>
 #include <svl/intitem.hxx>
 #include <svl/ilstitem.hxx>
+#include <svx/sdangitm.hxx>
 #include <tools/diagnose_ex.h>
 
 using namespace ::com::sun::star;
@@ -276,7 +277,7 @@ bool SeriesOptionsItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const Sf
          {
             if( m_bSupportingStartingAngle )
             {
-                m_nStartingAngle = static_cast< const SfxInt32Item & >( rItemSet.Get( nWhichId )).GetValue();
+                m_nStartingAngle = static_cast< const SdrAngleItem & >( rItemSet.Get( nWhichId )).GetValue() / 100;
                 uno::Reference< beans::XPropertySet > xDiagramProperties( ChartModelHelper::findDiagram(m_xChartModel), uno::UNO_QUERY );
                 if( xDiagramProperties.is() )
                 {
@@ -398,7 +399,7 @@ void SeriesOptionsItemConverter::FillSpecialItem(
         case SCHATTR_STARTING_ANGLE:
         {
             if( m_bSupportingStartingAngle )
-                rOutItemSet.Put( SfxInt32Item(nWhichId,m_nStartingAngle));
+                rOutItemSet.Put( SdrAngleItem(nWhichId,m_nStartingAngle*100));
             break;
         }
         case SCHATTR_CLOCKWISE:
diff --git a/chart2/source/view/main/ChartItemPool.cxx b/chart2/source/view/main/ChartItemPool.cxx
index fbe61098290e..4df7e269a56d 100644
--- a/chart2/source/view/main/ChartItemPool.cxx
+++ b/chart2/source/view/main/ChartItemPool.cxx
@@ -142,7 +142,7 @@ ChartItemPool::ChartItemPool():
     rPoolDefaults[SCHATTR_SPLINE_ORDER         - SCHATTR_START] = new SfxInt32Item( SCHATTR_SPLINE_ORDER, 3 );
     rPoolDefaults[SCHATTR_SPLINE_RESOLUTION    - SCHATTR_START] = new SfxInt32Item( SCHATTR_SPLINE_RESOLUTION, 20 );
     rPoolDefaults[SCHATTR_GROUP_BARS_PER_AXIS  - SCHATTR_START] = new SfxBoolItem(SCHATTR_GROUP_BARS_PER_AXIS, false);
-    rPoolDefaults[SCHATTR_STARTING_ANGLE       - SCHATTR_START] = new SfxInt32Item( SCHATTR_STARTING_ANGLE, 90 );
+    rPoolDefaults[SCHATTR_STARTING_ANGLE       - SCHATTR_START] = new SdrAngleItem( SCHATTR_STARTING_ANGLE, 9000 );
     rPoolDefaults[SCHATTR_CLOCKWISE            - SCHATTR_START] = new SfxBoolItem( SCHATTR_CLOCKWISE, false );
 
     rPoolDefaults[SCHATTR_MISSING_VALUE_TREATMENT    - SCHATTR_START] = new SfxInt32Item(SCHATTR_MISSING_VALUE_TREATMENT, 0);


More information about the Libreoffice-commits mailing list