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 <gabor.kelemen.extern@allotropia.de>
This commit is contained in:
Gabor Kelemen 2024-05-07 10:49:30 +02:00
parent bb2655206a
commit bcc1b9f22d
2 changed files with 6 additions and 3 deletions

View file

@ -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<sal_Int16>(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);

View file

@ -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() );