sd/source/ui/view/drviewsg.cxx |   10 +++++++++-
 sd/source/ui/view/frmview.cxx  |    3 ++-
 2 files changed, 11 insertions(+), 2 deletions(-)

New commits:
commit fe0d8555150949bb8729c656af62917ffc48bbf8
Author:     Gabor Kelemen <[email protected]>
AuthorDate: Tue Apr 23 16:28:52 2024 +0200
Commit:     Gabor Kelemen <[email protected]>
CommitDate: Fri Apr 26 17:01:25 2024 +0200

    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 <[email protected]>
    Tested-by: Jenkins

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 <sfx2/viewfrm.hxx>
 #include <svx/svdograf.hxx>
 #include <svx/ImageMapInfo.hxx>
+#include <officecfg/Office/Draw.hxx>
+#include <officecfg/Office/Impress.hxx>
 
 #include <app.hrc>
 
@@ -103,6 +105,8 @@ void DrawViewShell::ExecOptionsBar( SfxRequest& rReq )
     sal_uInt16 nSlot = rReq.GetSlot();
 
     SdOptions* pOptions = SD_MOD()->GetSdOptions(GetDoc()->GetDocumentType());
+    std::shared_ptr<comphelper::ConfigurationChanges> 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() );

Reply via email to