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

New commits:
commit ffd199021ec24e3fb2028708a6a191bf5dd49e41
Author:     Gabor Kelemen <gabor.kelemen.ext...@allotropia.de>
AuthorDate: Tue May 7 13:10:40 2024 +0200
Commit:     Gabor Kelemen <gabor.kelemen.ext...@allotropia.de>
CommitDate: Wed May 15 19:22:33 2024 +0200

    Use less SdOptionsSnapItem->IsRotate/SetRotate
    
    in favor of officecfg
    
    Change-Id: I7c08ed5154d8f3c369c28d05381e551fa9639ecb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167538
    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 41dd2545c6de..ac35cbeea34f 100644
--- a/sd/source/ui/dlg/tpoption.cxx
+++ b/sd/source/ui/dlg/tpoption.cxx
@@ -71,6 +71,7 @@ bool SdTpOptionsSnap::FillItemSet( SfxItemSet* rAttrs )
         officecfg::Office::Draw::Snap::Object::ObjectPoint::set( 
m_xCbxSnapPoints->get_active(), batch );
         officecfg::Office::Draw::Snap::Position::CreatingMoving::set( 
m_xCbxOrtho->get_active(), batch );
         officecfg::Office::Draw::Snap::Position::ExtendEdges::set( 
m_xCbxBigOrtho->get_active(), batch );
+        officecfg::Office::Draw::Snap::Position::Rotating::set( 
m_xCbxRotate->get_active(), batch );
     }
     else
     {
@@ -80,9 +81,9 @@ bool SdTpOptionsSnap::FillItemSet( SfxItemSet* rAttrs )
         officecfg::Office::Impress::Snap::Object::ObjectPoint::set( 
m_xCbxSnapPoints->get_active(), batch );
         officecfg::Office::Impress::Snap::Position::CreatingMoving::set( 
m_xCbxOrtho->get_active(), batch );
         officecfg::Office::Impress::Snap::Position::ExtendEdges::set( 
m_xCbxBigOrtho->get_active(), batch );
+        officecfg::Office::Impress::Snap::Position::Rotating::set( 
m_xCbxRotate->get_active(), batch );
     }
 
-    aOptsItem.GetOptionsSnap().SetRotate( m_xCbxRotate->get_active() );
     
aOptsItem.GetOptionsSnap().SetSnapArea(static_cast<sal_Int16>(m_xMtrFldSnapArea->get_value(FieldUnit::PIXEL)));
     
aOptsItem.GetOptionsSnap().SetAngle(Degree100(m_xMtrFldAngle->get_value(FieldUnit::DEGREE)));
     
aOptsItem.GetOptionsSnap().SetEliminatePolyPointLimitAngle(Degree100(m_xMtrFldBezAngle->get_value(FieldUnit::DEGREE)));
@@ -110,6 +111,7 @@ void SdTpOptionsSnap::Reset( const SfxItemSet* rAttrs )
         m_xCbxSnapPoints->set_active( 
officecfg::Office::Draw::Snap::Object::ObjectPoint::get() );
         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() );
     }
     else
     {
@@ -119,6 +121,7 @@ void SdTpOptionsSnap::Reset( const SfxItemSet* rAttrs )
         m_xCbxSnapPoints->set_active( 
officecfg::Office::Impress::Snap::Object::ObjectPoint::get() );
         m_xCbxOrtho->set_active( 
officecfg::Office::Impress::Snap::Position::CreatingMoving::get() );
         m_xCbxBigOrtho->set_active( 
officecfg::Office::Impress::Snap::Position::ExtendEdges::get() );
+        m_xCbxRotate->set_active( 
officecfg::Office::Impress::Snap::Position::Rotating::get() );
     }
 
     bool bReadOnly = bDrawMode ? 
officecfg::Office::Draw::Snap::Object::SnapLine::isReadOnly() :
@@ -153,7 +156,6 @@ void SdTpOptionsSnap::Reset( const SfxItemSet* rAttrs )
 
     bReadOnly = bDrawMode ? 
officecfg::Office::Draw::Snap::Position::Rotating::isReadOnly() :
         officecfg::Office::Impress::Snap::Position::Rotating::isReadOnly();
-    m_xCbxRotate->set_active( aOptsItem.GetOptionsSnap().IsRotate() );
     m_xCbxRotate->set_sensitive(!bReadOnly);
     m_xCbxRotateImg->set_visible(bReadOnly);
 
diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx
index 8d7cff7d904b..318cd0be5f55 100644
--- a/sd/source/ui/view/frmview.cxx
+++ b/sd/source/ui/view/frmview.cxx
@@ -287,6 +287,7 @@ void FrameView::Update(SdOptions const * pOptions)
     if (bImpress)
     {
         mbRuler = officecfg::Office::Impress::Layout::Display::Ruler::get();
+        SetAngleSnapEnabled( 
officecfg::Office::Impress::Snap::Position::Rotating::get() );
         SetBigOrtho( 
officecfg::Office::Impress::Snap::Position::ExtendEdges::get() );
         SetBordSnap( 
officecfg::Office::Impress::Snap::Object::PageMargin::get() );
         SetDragStripes( 
officecfg::Office::Impress::Layout::Display::Guide::get() );
@@ -301,6 +302,7 @@ void FrameView::Update(SdOptions const * pOptions)
     else
     {
         mbRuler = officecfg::Office::Draw::Layout::Display::Ruler::get();
+        SetAngleSnapEnabled( 
officecfg::Office::Draw::Snap::Position::Rotating::get() );
         SetBigOrtho( 
officecfg::Office::Draw::Snap::Position::ExtendEdges::get() );
         SetBordSnap( officecfg::Office::Draw::Snap::Object::PageMargin::get() 
);
         SetDragStripes( officecfg::Office::Draw::Layout::Display::Guide::get() 
);
@@ -321,7 +323,6 @@ void FrameView::Update(SdOptions const * pOptions)
     SetMoveOnlyDragging( pOptions->IsMoveOnlyDragging() );
     SetSlantButShear( pOptions->IsMoveOnlyDragging() );
     SetCrookNoContortion( pOptions->IsCrookNoContortion() );
-    SetAngleSnapEnabled( pOptions->IsRotate() );
     SetEliminatePolyPointLimitAngle( 
pOptions->GetEliminatePolyPointLimitAngle() );
     GetModel().SetPickThroughTransparentTextFrames( pOptions->IsPickThrough() 
);
 

Reply via email to