summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorGabor Kelemen <gabor.kelemen.extern@allotropia.de>2024-04-23 16:28:52 +0200
committerGabor Kelemen <gabor.kelemen.extern@allotropia.de>2024-04-26 17:01:25 +0200
commitfe0d8555150949bb8729c656af62917ffc48bbf8 (patch)
treeb8548e417758de8007e98ca662055af47cd812bb /sd
parentc724b81b033a9ff968a1a63d66005d48a6b97e57 (diff)
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 <gabor.kelemen.extern@allotropia.de> Tested-by: Jenkins
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/view/drviewsg.cxx10
-rw-r--r--sd/source/ui/view/frmview.cxx3
2 files changed, 11 insertions, 2 deletions
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() );