diff options
author | Andreas Heinisch <andreas.heinisch@yahoo.de> | 2023-03-08 17:03:35 +0100 |
---|---|---|
committer | Andreas Heinisch <andreas.heinisch@yahoo.de> | 2023-03-17 14:22:44 +0000 |
commit | 928957ee04c57a20bab42223b81f55a714b62d9c (patch) | |
tree | 0f19ceb13293264574c979acdf9da92d0bd9e0ec /basctl | |
parent | f18b76cad2e27fe5167cd683916d592088c5bf99 (diff) |
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 <andreas.heinisch@yahoo.de>
Diffstat (limited to 'basctl')
-rw-r--r-- | basctl/source/basicide/moduldl2.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
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<script::XLibraryContainer2> xModLibContainer( + rDocument.getLibraryContainer(E_SCRIPTS), UNO_QUERY); + Reference<script::XLibraryContainer2> xDlgLibContainer( + rDocument.getLibraryContainer(E_DIALOGS), UNO_QUERY); + Reference<script::XPersistentLibraryContainer> xModPersLibContainer(xModLibContainer, + UNO_QUERY); + if (xModPersLibContainer.is()) + xModPersLibContainer->storeLibraries(); + Reference<script::XPersistentLibraryContainer> 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, |