33 * v. 2.0. If a copy of the MPL was not distributed with this file, You can
44 * obtain one at https://mozilla.org/MPL/2.0/
55 *
6- * Copyright (C) 2005-2021 , Peter Johnson (gravatar.com/delphidabbler).
6+ * Copyright (C) 2005-2023 , Peter Johnson (gravatar.com/delphidabbler).
77 *
88 * Defines a singleton object and subsidiary classes that encapsulate the
99 * snippets and categories in the CodeSnip database and user defined databases.
@@ -954,11 +954,9 @@ procedure TDatabase.Load;
954954 try
955955 // Load main database: MUST do this first since user database can
956956 // reference objects in main database
957- with TDatabaseIOFactory.CreateMainDBLoader do
958- Load(fSnippets, fCategories, Factory);
957+ TDatabaseIOFactory.CreateMainDBLoader.Load(fSnippets, fCategories, Factory);
959958 // Load any user database
960- with TDatabaseIOFactory.CreateUserDBLoader do
961- Load(fSnippets, fCategories, Factory);
959+ TDatabaseIOFactory.CreateUserDBLoader.Load(fSnippets, fCategories, Factory);
962960 fUpdated := False;
963961 except
964962 // If an exception occurs clear the database
@@ -984,8 +982,7 @@ procedure TDatabase.Save;
984982 // Create object that can provide required information about user database
985983 Provider := TUserDataProvider.Create(fSnippets, fCategories);
986984 // Use a writer object to write out the database
987- with TDatabaseIOFactory.CreateWriter do
988- Write(fSnippets, fCategories, Provider);
985+ TDatabaseIOFactory.CreateWriter.Write(fSnippets, fCategories, Provider);
989986 fUpdated := False;
990987end ;
991988
0 commit comments