From 48e07052be600a5abf8ef4cbec20e1122e703b7e Mon Sep 17 00:00:00 2001 From: Gabor Kelemen Date: Thu, 25 Apr 2024 16:52:14 +0200 Subject: Drop now unused GetOptionStream class Change-Id: Iddb1fbb437f0f66c551e9231d79511caf1edafb6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166635 Tested-by: Jenkins Reviewed-by: Gabor Kelemen --- sd/inc/sdmod.hxx | 8 -------- sd/source/ui/app/sdmod.cxx | 43 ------------------------------------------- 2 files changed, 51 deletions(-) diff --git a/sd/inc/sdmod.hxx b/sd/inc/sdmod.hxx index 5008fc001f0b..b872ebf0913d 100644 --- a/sd/inc/sdmod.hxx +++ b/sd/inc/sdmod.hxx @@ -51,12 +51,6 @@ namespace com::sun::star::frame { class XFrame; } -enum class SdOptionStreamMode -{ - Load = 0, - Store = 1 -}; - struct SdExtPropertySetInfoCacheCompare { bool operator()(const std::span& lhs, const std::span& rhs) const @@ -104,7 +98,6 @@ public: void GetState(SfxItemSet&); SdOptions* GetSdOptions(DocumentType eDocType); - SD_DLLPUBLIC rtl::Reference GetOptionStream( std::u16string_view rOptionName, SdOptionStreamMode eMode ); bool GetWaterCan() const { return bWaterCan; } void SetWaterCan( bool bWC ) { bWaterCan = bWC; } @@ -140,7 +133,6 @@ private: SdOptions* pDrawOptions; std::unique_ptr pSearchItem; std::unique_ptr pNumberFormatter; - rtl::Reference xOptionStorage; bool bWaterCan; std::unique_ptr mpErrorHdl; /** This device is used for printer independent layout. It is virtual diff --git a/sd/source/ui/app/sdmod.cxx b/sd/source/ui/app/sdmod.cxx index f1b9a9bbe8a1..f18dd647a209 100644 --- a/sd/source/ui/app/sdmod.cxx +++ b/sd/source/ui/app/sdmod.cxx @@ -157,49 +157,6 @@ SdOptions* SdModule::GetSdOptions(DocumentType eDocType) return pOptions; } -/** - * Open and return option stream for internal options; - * if the stream is opened for reading but does not exist, an 'empty' - * RefObject is returned - */ -rtl::Reference SdModule::GetOptionStream( std::u16string_view rOptionName, - SdOptionStreamMode eMode ) -{ - ::sd::DrawDocShell* pDocSh = dynamic_cast< ::sd::DrawDocShell *>( SfxObjectShell::Current() ); - rtl::Reference xStm; - - if( pDocSh ) - { - DocumentType eType = pDocSh->GetDoc()->GetDocumentType(); - - if( !xOptionStorage.is() ) - { - INetURLObject aURL( SvtPathOptions().GetUserConfigPath() ); - - aURL.Append( u"drawing.cfg" ); - - std::unique_ptr pStm = ::utl::UcbStreamHelper::CreateStream( aURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), StreamMode::READWRITE ); - - if( pStm ) - xOptionStorage = new SotStorage( pStm.release(), true ); - } - - OUString aStmName; - - if( DocumentType::Draw == eType ) - aStmName = "Draw_"; - else - aStmName = "Impress_"; - - aStmName += rOptionName; - - if( SdOptionStreamMode::Store == eMode || xOptionStorage->IsContained( aStmName ) ) - xStm = xOptionStorage->OpenSotStream( aStmName ); - } - - return xStm; -} - SvNumberFormatter* SdModule::GetNumberFormatter() { if( !pNumberFormatter ) -- cgit v1.2.3