From bcc1b9f22d4b2772c735176e78dfa1e7c8c39b3a Mon Sep 17 00:00:00 2001 From: Gabor Kelemen Date: Tue, 7 May 2024 10:49:30 +0200 Subject: [PATCH] Use less SdOptionsSnapItem->IsOrtho/SetOrtho in favor of officecfg Change-Id: Iff78afb987bab8829ea595248b8ad434fe9b4cd9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167536 Tested-by: Jenkins Reviewed-by: Gabor Kelemen --- sd/source/ui/dlg/tpoption.cxx | 6 ++++-- sd/source/ui/view/frmview.cxx | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx index 597fe5705dd1..499b5e31a58f 100644 --- a/sd/source/ui/dlg/tpoption.cxx +++ b/sd/source/ui/dlg/tpoption.cxx @@ -69,6 +69,7 @@ bool SdTpOptionsSnap::FillItemSet( SfxItemSet* rAttrs ) officecfg::Office::Draw::Snap::Object::PageMargin::set( m_xCbxSnapBorder->get_active(), batch ); officecfg::Office::Draw::Snap::Object::ObjectFrame::set( m_xCbxSnapFrame->get_active(), batch ); officecfg::Office::Draw::Snap::Object::ObjectPoint::set( m_xCbxSnapPoints->get_active(), batch ); + officecfg::Office::Draw::Snap::Position::CreatingMoving::set( m_xCbxOrtho->get_active(), batch ); } else { @@ -76,9 +77,9 @@ bool SdTpOptionsSnap::FillItemSet( SfxItemSet* rAttrs ) officecfg::Office::Impress::Snap::Object::PageMargin::set( m_xCbxSnapBorder->get_active(), batch ); officecfg::Office::Impress::Snap::Object::ObjectFrame::set( m_xCbxSnapFrame->get_active(), batch ); officecfg::Office::Impress::Snap::Object::ObjectPoint::set( m_xCbxSnapPoints->get_active(), batch ); + officecfg::Office::Impress::Snap::Position::CreatingMoving::set( m_xCbxOrtho->get_active(), batch ); } - aOptsItem.GetOptionsSnap().SetOrtho( m_xCbxOrtho->get_active() ); aOptsItem.GetOptionsSnap().SetBigOrtho( m_xCbxBigOrtho->get_active() ); aOptsItem.GetOptionsSnap().SetRotate( m_xCbxRotate->get_active() ); aOptsItem.GetOptionsSnap().SetSnapArea(static_cast(m_xMtrFldSnapArea->get_value(FieldUnit::PIXEL))); @@ -106,6 +107,7 @@ void SdTpOptionsSnap::Reset( const SfxItemSet* rAttrs ) m_xCbxSnapBorder->set_active( officecfg::Office::Draw::Snap::Object::PageMargin::get() ); m_xCbxSnapFrame->set_active( officecfg::Office::Draw::Snap::Object::ObjectFrame::get() ); m_xCbxSnapPoints->set_active( officecfg::Office::Draw::Snap::Object::ObjectPoint::get() ); + m_xCbxOrtho->set_active( officecfg::Office::Draw::Snap::Position::CreatingMoving::get() ); } else { @@ -113,6 +115,7 @@ void SdTpOptionsSnap::Reset( const SfxItemSet* rAttrs ) m_xCbxSnapBorder->set_active( officecfg::Office::Impress::Snap::Object::PageMargin::get() ); m_xCbxSnapFrame->set_active( officecfg::Office::Impress::Snap::Object::ObjectFrame::get() ); m_xCbxSnapPoints->set_active( officecfg::Office::Impress::Snap::Object::ObjectPoint::get() ); + m_xCbxOrtho->set_active( officecfg::Office::Impress::Snap::Position::CreatingMoving::get() ); } bool bReadOnly = bDrawMode ? officecfg::Office::Draw::Snap::Object::SnapLine::isReadOnly() : @@ -137,7 +140,6 @@ void SdTpOptionsSnap::Reset( const SfxItemSet* rAttrs ) bReadOnly = bDrawMode ? officecfg::Office::Draw::Snap::Position::CreatingMoving::isReadOnly() : officecfg::Office::Impress::Snap::Position::CreatingMoving::isReadOnly(); - m_xCbxOrtho->set_active( aOptsItem.GetOptionsSnap().IsOrtho() ); m_xCbxOrtho->set_sensitive(!bReadOnly); m_xCbxOrthoImg->set_visible(bReadOnly); diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx index dfb73b027b71..6bd8d31df9f0 100644 --- a/sd/source/ui/view/frmview.cxx +++ b/sd/source/ui/view/frmview.cxx @@ -294,6 +294,7 @@ void FrameView::Update(SdOptions const * pOptions) SetNoDragXorPolys ( !officecfg::Office::Impress::Layout::Display::Contour::get() ); SetOFrmSnap( officecfg::Office::Impress::Snap::Object::ObjectFrame::get() ); SetOPntSnap( officecfg::Office::Impress::Snap::Object::ObjectPoint::get() ); + SetOrtho( officecfg::Office::Impress::Snap::Position::CreatingMoving::get() ); SetPlusHandlesAlwaysVisible( officecfg::Office::Impress::Layout::Display::Bezier::get() ); } else @@ -306,6 +307,7 @@ void FrameView::Update(SdOptions const * pOptions) SetNoDragXorPolys ( !officecfg::Office::Draw::Layout::Display::Contour::get() ); SetOFrmSnap( officecfg::Office::Draw::Snap::Object::ObjectFrame::get() ); SetOPntSnap( officecfg::Office::Draw::Snap::Object::ObjectPoint::get() ); + SetOrtho( officecfg::Office::Draw::Snap::Position::CreatingMoving::get() ); SetPlusHandlesAlwaysVisible( officecfg::Office::Draw::Layout::Display::Bezier::get() ); } @@ -319,7 +321,6 @@ void FrameView::Update(SdOptions const * pOptions) SetCrookNoContortion( pOptions->IsCrookNoContortion() ); SetAngleSnapEnabled( pOptions->IsRotate() ); SetBigOrtho( pOptions->IsBigOrtho() ); - SetOrtho( pOptions->IsOrtho() ); SetEliminatePolyPointLimitAngle( pOptions->GetEliminatePolyPointLimitAngle() ); GetModel().SetPickThroughTransparentTextFrames( pOptions->IsPickThrough() );