From 928957ee04c57a20bab42223b81f55a714b62d9c Mon Sep 17 00:00:00 2001 From: Andreas Heinisch Date: Wed, 8 Mar 2023 17:03:35 +0100 Subject: tdf#151741 - BASIC Organizer: fill various URLs for libraries Otherwise, libraries cannot be renamed in the BASIC organizer. Change-Id: I6c78cdee12f8d6128acf68e889fca463ed782477 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148483 Tested-by: Jenkins Reviewed-by: Andreas Heinisch --- basctl/source/basicide/moduldl2.cxx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'basctl') diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index 12650fc8f66a..2b21a6f6ba64 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -1320,6 +1320,22 @@ void createLibImpl(weld::Window* pWin, const ScriptDocument& rDocument, if ( !rDocument.createModule( aLibName, aModName, true, sModuleCode ) ) throw Exception("could not create module " + aModName, nullptr); + // tdf#151741 - store all libraries to the file system, otherwise they + // cannot be renamed/moved since the SfxLibraryContainer::renameLibrary + // moves the foldes/files on the file system + Reference xModLibContainer( + rDocument.getLibraryContainer(E_SCRIPTS), UNO_QUERY); + Reference xDlgLibContainer( + rDocument.getLibraryContainer(E_DIALOGS), UNO_QUERY); + Reference xModPersLibContainer(xModLibContainer, + UNO_QUERY); + if (xModPersLibContainer.is()) + xModPersLibContainer->storeLibraries(); + Reference xDlgPersLibContainer(xDlgLibContainer, + UNO_QUERY); + if (xDlgPersLibContainer.is()) + xDlgPersLibContainer->storeLibraries(); + SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, rDocument, aLibName, aModName, TYPE_MODULE ); if (SfxDispatcher* pDispatcher = GetDispatcher()) pDispatcher->ExecuteList(SID_BASICIDE_SBXINSERTED, -- cgit v1.2.3