Use less SdOptionsZoom->GetScale/SetScale in favor of officecfg

Change-Id: I34fca9ba9546f10268d22f92aaa5249d88f607d0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166629
Tested-by: Jenkins
Reviewed-by: Gabor Kelemen <gabor.kelemen.extern@allotropia.de>
This commit is contained in:
Gabor Kelemen
2024-05-10 14:11:23 +02:00
parent dd8cf8a3f0
commit edcfc1ba8e
2 changed files with 10 additions and 3 deletions
+2 -1
View File
@@ -158,7 +158,8 @@ SdDrawDocument::SdDrawDocument(DocumentType eType, SfxObjectShell* pDrDocSh)
// Set measuring unit (of the application) and scale (of SdMod)
sal_Int32 nX, nY;
SdOptions* pOptions = SD_MOD()->GetSdOptions(meDocType);
pOptions->GetScale( nX, nY );
nX = officecfg::Office::Draw::Zoom::ScaleX::get();
nY = officecfg::Office::Draw::Zoom::ScaleY::get();
SvtSysLocale aSysLocale;
// Allow UI scale only for draw documents.
+8 -2
View File
@@ -543,7 +543,8 @@ std::optional<SfxItemSet> SdModule::CreateItemSet( sal_uInt16 nSlot )
else
{
// Get options from configuration file
pOptions->GetScale( nX, nY );
nX = officecfg::Office::Draw::Zoom::ScaleX::get();
nY = officecfg::Office::Draw::Zoom::ScaleY::get();
}
aRet.Put( SfxInt32Item( ATTR_OPTIONS_SCALE_X, nX ) );
@@ -660,7 +661,12 @@ void SdModule::ApplyItemSet( sal_uInt16 nSlot, const SfxItemSet& rSet )
if( pItem )
{
sal_Int32 nY = pItem->GetValue();
pOptions->SetScale( nX, nY );
std::shared_ptr<comphelper::ConfigurationChanges> batch(
comphelper::ConfigurationChanges::create());
officecfg::Office::Draw::Zoom::ScaleX::set(nX, batch);
officecfg::Office::Draw::Zoom::ScaleY::set(nY, batch);
batch->commit();
// Apply to document only if doc type match
if( pDocSh && pDoc && eDocType == pDoc->GetDocumentType() )