sd/source/ui/dlg/tpoption.cxx |    7 ++++---
 sd/source/ui/view/frmview.cxx |    3 ++-
 2 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 56f4272f407fed0e013ef694276e640955add154
Author:     Gabor Kelemen <gabor.kelemen.ext...@allotropia.de>
AuthorDate: Sat May 11 22:38:12 2024 +0200
Commit:     Gabor Kelemen <gabor.kelemen.ext...@allotropia.de>
CommitDate: Thu May 16 21:49:36 2024 +0200

    Use less SdOptionsSnapItem->GetAngle/SetAngle
    
    in favor of officecfg
    
    Change-Id: I3196fb36a1513fed983998a33acce05e03a20cbd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167540
    Tested-by: Jenkins
    Reviewed-by: Gabor Kelemen <gabor.kelemen.ext...@allotropia.de>

diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx
index d66536348a8f..73542633a8af 100644
--- a/sd/source/ui/dlg/tpoption.cxx
+++ b/sd/source/ui/dlg/tpoption.cxx
@@ -73,6 +73,7 @@ bool SdTpOptionsSnap::FillItemSet( SfxItemSet* rAttrs )
         officecfg::Office::Draw::Snap::Position::ExtendEdges::set( 
m_xCbxBigOrtho->get_active(), batch );
         officecfg::Office::Draw::Snap::Position::Rotating::set( 
m_xCbxRotate->get_active(), batch );
         officecfg::Office::Draw::Snap::Object::Range::set( 
static_cast<sal_Int16>(m_xMtrFldSnapArea->get_value(FieldUnit::PIXEL)), batch );
+        officecfg::Office::Draw::Snap::Position::RotatingValue::set( 
static_cast<sal_Int32>(Degree100(m_xMtrFldAngle->get_value(FieldUnit::DEGREE))),
 batch );
     }
     else
     {
@@ -84,9 +85,9 @@ bool SdTpOptionsSnap::FillItemSet( SfxItemSet* rAttrs )
         officecfg::Office::Impress::Snap::Position::ExtendEdges::set( 
m_xCbxBigOrtho->get_active(), batch );
         officecfg::Office::Impress::Snap::Position::Rotating::set( 
m_xCbxRotate->get_active(), batch );
         officecfg::Office::Impress::Snap::Object::Range::set( 
static_cast<sal_Int16>(m_xMtrFldSnapArea->get_value(FieldUnit::PIXEL)), batch );
+        officecfg::Office::Impress::Snap::Position::RotatingValue::set( 
static_cast<sal_Int32>(Degree100(m_xMtrFldAngle->get_value(FieldUnit::DEGREE))),
 batch );
     }
 
-    
aOptsItem.GetOptionsSnap().SetAngle(Degree100(m_xMtrFldAngle->get_value(FieldUnit::DEGREE)));
     
aOptsItem.GetOptionsSnap().SetEliminatePolyPointLimitAngle(Degree100(m_xMtrFldBezAngle->get_value(FieldUnit::DEGREE)));
 
     rAttrs->Put( aOptsItem );
@@ -113,7 +114,7 @@ void SdTpOptionsSnap::Reset( const SfxItemSet* rAttrs )
         m_xCbxOrtho->set_active( 
officecfg::Office::Draw::Snap::Position::CreatingMoving::get() );
         m_xCbxBigOrtho->set_active( 
officecfg::Office::Draw::Snap::Position::ExtendEdges::get() );
         m_xCbxRotate->set_active( 
officecfg::Office::Draw::Snap::Position::Rotating::get() );
-
+        m_xMtrFldAngle->set_value( 
officecfg::Office::Draw::Snap::Position::RotatingValue::get(), 
FieldUnit::DEGREE);
     }
     else
     {
@@ -125,6 +126,7 @@ void SdTpOptionsSnap::Reset( const SfxItemSet* rAttrs )
         m_xCbxBigOrtho->set_active( 
officecfg::Office::Impress::Snap::Position::ExtendEdges::get() );
         m_xCbxRotate->set_active( 
officecfg::Office::Impress::Snap::Position::Rotating::get() );
         m_xMtrFldSnapArea->set_value( 
officecfg::Office::Impress::Snap::Object::Range::get(), FieldUnit::PIXEL);
+        m_xMtrFldAngle->set_value( 
officecfg::Office::Impress::Snap::Position::RotatingValue::get(), 
FieldUnit::DEGREE);
     }
 
     bool bReadOnly = bDrawMode ? 
officecfg::Office::Draw::Snap::Object::SnapLine::isReadOnly() :
@@ -169,7 +171,6 @@ void SdTpOptionsSnap::Reset( const SfxItemSet* rAttrs )
 
     bReadOnly = bDrawMode ? 
officecfg::Office::Draw::Snap::Position::RotatingValue::isReadOnly() :
         
officecfg::Office::Impress::Snap::Position::RotatingValue::isReadOnly();
-    m_xMtrFldAngle->set_value(aOptsItem.GetOptionsSnap().GetAngle().get(), 
FieldUnit::DEGREE);
     m_xMtrFldAngle->set_sensitive(!bReadOnly);
 
     bReadOnly = bDrawMode ? 
officecfg::Office::Draw::Snap::Position::PointReduction::isReadOnly() :
diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx
index 1a543d0afc06..f6ef9c350428 100644
--- a/sd/source/ui/view/frmview.cxx
+++ b/sd/source/ui/view/frmview.cxx
@@ -298,6 +298,7 @@ void FrameView::Update(SdOptions const * pOptions)
         SetOPntSnap( 
officecfg::Office::Impress::Snap::Object::ObjectPoint::get() );
         SetOrtho( 
officecfg::Office::Impress::Snap::Position::CreatingMoving::get() );
         SetPlusHandlesAlwaysVisible( 
officecfg::Office::Impress::Layout::Display::Bezier::get() );
+        SetSnapAngle( 
Degree100(officecfg::Office::Impress::Snap::Position::RotatingValue::get()) );
         SetSnapMagneticPixel( 
officecfg::Office::Impress::Snap::Object::Range::get() );
     }
     else
@@ -314,11 +315,11 @@ void FrameView::Update(SdOptions const * pOptions)
         SetOPntSnap( officecfg::Office::Draw::Snap::Object::ObjectPoint::get() 
);
         SetOrtho( 
officecfg::Office::Draw::Snap::Position::CreatingMoving::get() );
         SetPlusHandlesAlwaysVisible( 
officecfg::Office::Draw::Layout::Display::Bezier::get() );
+        SetSnapAngle( 
Degree100(officecfg::Office::Draw::Snap::Position::RotatingValue::get()) );
         SetSnapMagneticPixel( 
officecfg::Office::Draw::Snap::Object::Range::get() );
     }
 
     SetGridVisible( pOptions->IsGridVisible() );
-    SetSnapAngle( pOptions->GetAngle() );
     SetGridSnap( pOptions->IsUseGridSnap() );
     SetMarkedHitMovesAlways( pOptions->IsMarkedHitMovesAlways() );
     SetMoveOnlyDragging( pOptions->IsMoveOnlyDragging() );

Reply via email to