From fe0d8555150949bb8729c656af62917ffc48bbf8 Mon Sep 17 00:00:00 2001 From: Gabor Kelemen Date: Tue, 23 Apr 2024 16:28:52 +0200 Subject: Use less SdOptionsLayout->IsDragStripes/SetDragStripes in favor of officecfg Change-Id: I0c0e2dd57d1f1408f85bca4b6ee3bfcebae1cf22 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166596 Reviewed-by: Gabor Kelemen Tested-by: Jenkins --- sd/source/ui/view/drviewsg.cxx | 10 +++++++++- sd/source/ui/view/frmview.cxx | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) (limited to 'sd') diff --git a/sd/source/ui/view/drviewsg.cxx b/sd/source/ui/view/drviewsg.cxx index 2563168433d8..7dfd06e2177c 100644 --- a/sd/source/ui/view/drviewsg.cxx +++ b/sd/source/ui/view/drviewsg.cxx @@ -26,6 +26,8 @@ #include #include #include +#include +#include #include @@ -103,6 +105,8 @@ void DrawViewShell::ExecOptionsBar( SfxRequest& rReq ) sal_uInt16 nSlot = rReq.GetSlot(); SdOptions* pOptions = SD_MOD()->GetSdOptions(GetDoc()->GetDocumentType()); + std::shared_ptr batch( + comphelper::ConfigurationChanges::create()); switch( nSlot ) { @@ -137,7 +141,10 @@ void DrawViewShell::ExecOptionsBar( SfxRequest& rReq ) case SID_HELPLINES_MOVE: { - pOptions->SetDragStripes( !mpDrawView->IsDragStripes() ); + if ( GetDoc()->GetDocumentType() == DocumentType::Impress ) + officecfg::Office::Impress::Layout::Display::Guide::set(!mpDrawView->IsDragStripes(), batch); + else + officecfg::Office::Draw::Layout::Display::Guide::set(!mpDrawView->IsDragStripes(), batch); } break; @@ -192,6 +199,7 @@ void DrawViewShell::ExecOptionsBar( SfxRequest& rReq ) if( bDefault ) return; + batch->commit(); pOptions->StoreConfig(); // Saves the configuration IMMEDIATELY diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx index 4071ee2734bf..88ae6825738b 100644 --- a/sd/source/ui/view/frmview.cxx +++ b/sd/source/ui/view/frmview.cxx @@ -286,11 +286,13 @@ void FrameView::Update(SdOptions const * pOptions) if (pDrawDocument->GetDocumentType() == DocumentType::Impress) { mbRuler = officecfg::Office::Impress::Layout::Display::Ruler::get(); + SetDragStripes( officecfg::Office::Impress::Layout::Display::Guide::get() ); SetNoDragXorPolys ( !officecfg::Office::Impress::Layout::Display::Contour::get() ); } else { mbRuler = officecfg::Office::Draw::Layout::Display::Ruler::get(); + SetDragStripes( officecfg::Office::Draw::Layout::Display::Guide::get() ); SetNoDragXorPolys ( !officecfg::Office::Draw::Layout::Display::Contour::get() ); } @@ -302,7 +304,6 @@ void FrameView::Update(SdOptions const * pOptions) SetOFrmSnap( pOptions->IsSnapFrame() ); SetOPntSnap( pOptions->IsSnapPoints() ); SetHlplVisible( pOptions->IsHelplines() ); - SetDragStripes( pOptions->IsDragStripes() ); SetPlusHandlesAlwaysVisible( pOptions->IsHandlesBezier() ); SetSnapMagneticPixel( pOptions->GetSnapArea() ); SetMarkedHitMovesAlways( pOptions->IsMarkedHitMovesAlways() ); -- cgit