Currently instantiating an UNO service implementation is a long process. First we call foo_component_getFactory(), where we create the right factory, which then creates the c++ object. Instead, the new way, is to call just foo_get_implementation function which directly creates the c++ object. This task is about splitting foo_component_getFactory functions to have an exported function for each implementation it contains. This simplifies the process and makes it a bit faster. Additionally, helps us to select and use only implementations we need for e.g. mobile platforms or anything compiled as one big library / executable and allows the instantiation to be even faster. To work on this, just choose a component, e.g. xmloff/util/xo.component 1, Find a implementation in there you want to covert, e.g. <implementation name="XMLVersionListPersistence"> 2, Add a constructor name for it, e.g. constructor="XMLVersionListPersistence_get_implementation" 2, git grep for its implementation and/or service name in the module (xmloff in this case) to find the c++ class implementation: XMLVersionListPersistence. 3, Remove its use from xo_component_getFactory. 4, Add new function which looks as: extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL XMLVersionListPersistence_get_implementation( css::uno::XComponentContext *, css::uno::Sequence<css::uno::Any> const &) { return cppu::acquire(new XMLVersionListPersistence()); } You may need to use the XComponentContext variable. 5, Remove any static methods which were previously used in foo_component_getFactory : There should be now at most one function using them, so move the code there. Best to look at examples: http://cgit.freedesktop.org/libreoffice/core/commit/?id=1790ff71bd0772a37ad6ab7885cdbe2752dfdadf http://cgit.freedesktop.org/libreoffice/core/commit/?id=fe537786a42abea57551395f73328db48bebd086 Optionally, if it's possible, move the code to anonymous namespace, as in http://cgit.freedesktop.org/libreoffice/core/commit/?id=ed9e1e739041c8ef30e68559e9e9415632b21d94 You can do that in one commit. Another example: http://cgit.freedesktop.org/libreoffice/core/commit/?id=1d77f5ce5e13720d46b41fd3ee4c7fe1d92a9839 Unfortunately, every module looks different, but once you get used to it, it's easy, just don't be afraid to start and ask if in doubt.
(In reply to comment #0) > Optionally, if it's possible, move the code to anonymous namespace, as in > http://cgit.freedesktop.org/libreoffice/core/commit/ > ?id=ed9e1e739041c8ef30e68559e9e9415632b21d94 > You can do that in one commit. ...but it makes review unnecessarily complicated if you fold an include file into a .cxx Also, watch out for single-instance implementations, that currently use cppu::createOneInstanceComponentFactory or similar to ensure only a single instance is ever created.
Hi, I sent following patch for this bug: https://gerrit.libreoffice.org/#/c/19671/
kripton committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=c5d16f557c3dbac8b7c0736216e8da5d681d8075 tdf#74608 xmloff: Constructor feature for XMLMetaImportComponent. It will be available in 5.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
(In reply to Stephan Bergmann from comment #1) > (In reply to comment #0) > > Optionally, if it's possible, move the code to anonymous namespace, as in > > http://cgit.freedesktop.org/libreoffice/core/commit/ > > ?id=ed9e1e739041c8ef30e68559e9e9415632b21d94 > > You can do that in one commit. > > ...but it makes review unnecessarily complicated if you fold an include file > into a .cxx Right, it's perhaps not that good idea to move code from header file in the end. Please don't do that.
Matúš Kukan committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=81fa5340191baf8687f9c82f1f414f5afc86b529 tdf#74608 dbaccess: Constructor feature for ODatabaseSource It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Matúš Kukan committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=f7c94c5b8a7de7f24bea8c612eb2b15a26c2a61a tdf#74608 dbaccess: Constructor feature for OCommandDefinition It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Matúš Kukan committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=970f518989d8984089a5ee2be95d0a178b314d4c tdf#74608 dbaccess: Constructor feature for OComponentDefinition It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Matúš Kukan committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=f229b9b04a9267f7f277304c0ebed7f8b2582a5d tdf#74608 dbaccess: Constructor feature for ODatabaseDocument It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Hi, I sent following patch for this bug: https://gerrit.libreoffice.org/#/c/20457/
Matúš Kukan committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=1ded035f853ba62f02958175046948d2b47b8075 tdf#74608 dbaccess: Constructor for singleton DataAccessDescriptorFactory It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Migrating Whiteboard tags to Keywords: (EasyHack SkillCpp TopicCleanup) [NinjaEdit]
Matúš Kukan committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=9e3c7725909ebce86e30f1e774d5f9e1d761c16a tdf#74608: Constructor function for OfficeRestartManager singleton It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Matúš Kukan committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=4db23a9d17cccc2103b72506e3837a3b6576c181 tdf#74608: Constructor function for OfficeInstallationDirectories singleton It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Matúš Kukan committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=11c9bad89d6582b5bf5c2d47a42afc5c2758fa63 tdf#74608: Constructor function for LoggerPool singleton It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Matúš Kukan committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=3bda8734f88b9c86fc9d5cfa83580844eeaf2221 tdf#74608: Ctor function for logging::FileHandler It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Matúš Kukan committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=cc6ccaf922bc8cefec714b9110a7d36ae113817c tdf#74608: Ctor function for logging::ConsoleHandler It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Matúš Kukan committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=42ab260e502c29034d4deb0c4a5a29d7a34c7b96 tdf#74608: Ctor function for logging::CsvFormatter It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Matúš Kukan committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=e65709245cb844205f47ab1ccc79f718fbf2d025 tdf#74608: Ctor function for logging::PlainTextFormatter It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Matúš Kukan committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=d4bbf358eb19a8c96720595b9aa3fdf47d9e02f9 tdf#74608: Ctor function for abp::OABSPilotUno It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Matúš Kukan committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=7f36d2e25572978ee6ee79a4089db81c191df260 tdf#74608: Ctor function for css.embed.OLESimpleStorage It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
kripton committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=94699cdec88ae181548d108b4a96f97be1f6c365 tdf#74608 xmloff: Constructor feature for XMLMetaExportComponent It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
kripton committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=ea6fdbaeeb51ad695f1c3754b796b7273eb4baad tdf#74608 lotuswordpro: Constructor feature for LotusWordProImportFilter It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
kripton committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=2416a2965f4d51e1b14b8539436f5f8fc16cc399 tdf#74608 comphelper: Constructor feature for IndexedPropertyValuesContainer It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
kripton committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=9ab1bdc217792e90b1b27d81128881d57152afc8 tdf#74608 comphelper: Constructor feature for NamedPropertyValuesContainer It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Hi, I sent following patch for this bug: https://gerrit.libreoffice.org/#/c/21936/
kripton committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=a395a1137d2e9430dfd5fd20e81c9413f06a554d tdf#74608 comphelper: Constructor feature for AnyCompareFactory It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
David Ostrovsky committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=3466423b8670a1de589126d2a9a55c1f95367a24 tdf#74608: Ctor function for mork component implementation It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
JanI is default CC for Easy Hacks (Add Jan; remove LibreOffice Dev List from CC) [NinjaEdit]
yeliztaneroglu committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=1b6a84a5a24e7e02c6066ca0fcb5a0011d2decd6 tdf#74608: Constructor function for SimpleLogRing singleton It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
For .component files that use a non-standard environment="@CPPU_ENV@:affine" (i.e., connectivity/source/drivers/ado/ado.component and connectivity/source/drivers/jdbc/jdbc.component), bug 98128 must be fixed first if they shall be changed to use the constructor feature.
Yeliz Taneroğlu committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=df750471d757562671e612fe83d758231dd58b58 tdf#74608 comphelper: Constructor feature for InstanceLocker It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Christian Lohmaier committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=524df0cc563bfe9e22c505d369c12303e2273df7 android: add constructor functions that fell victim to tdf#74608 It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
######### @ reviewers @ ############ please don't forget the android port that needs (at least some of) those changes reflected in solenv/bin/native-code.py as well (see the above commit in comment 32)
I've been asked to clarify when modification to the native-code.py is necessary, unfortunately I don't have an easy answer for that. Unless you know the internal dependencies/lifecycle it's a matter of trying whether opening a document in the android viewer works. If you get "unknown constructor" messages, followed by an exception and crash of the app, than that constructor is needed.. e.g. W/cppuhelper: 1:cppuhelper/source/shlib.cxx:227: unknown constructor name "IndexedPropertyValuesContainer_get_implementation" W/legacy.osl: 1:sw/source/filter/xml/swxml.cxx:270: uno exception caught while importing: component context fails to supply service com.sun.star.document.IndexedPropertyValues of type com.sun.star.container.XIndexContainer: unknown constructor name "IndexedPropertyValuesContainer_get_implementation" other unknown constructors don't do any harm, like those for lesser used document filters.
Steven Guo committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=e81ad8c8ed960cf0765a4c3896b5ee449c973cd0 tdf#74608 Constructor function for SequenceInputStreamService It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Yeliz Taneroğlu committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=0ea748be9cc2db67dd72f9989f495c5f7cbd8071 tdf#74608 Constructor function for SequenceOutputStreamService It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Hi, I sent following patch for this bug: https://gerrit.libreoffice.org/#/c/23989/
Seems solved
(In reply to jan iversen from comment #38) > Seems solved Not at all. Given a fully transformed .component file will no longer need to specify a prefix="..." attribute, git grep -lw prefix -- \*.component can serve as a rough indicator of areas that can still be worked on.
(In reply to Stephan Bergmann from comment #39) > (In reply to jan iversen from comment #38) > > Seems solved > > Not at all. Given a fully transformed .component file will no longer need > to specify a prefix="..." attribute, > > git grep -lw prefix -- \*.component > > can serve as a rough indicator of areas that can still be worked on. Thanks for reopening it, and giving a nice easy to understand code pointer.
Yeliz Taneroğlu committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=b8c04ea449750b39ab5dc64f91f74688fd9a4d3a tdf#74608 Constructor function for XMLOasisBasicExporter It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Yeliz Taneroğlu committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=2dc8f1b25c157a597905fb33f1527244baf977f3 tdf#74608 Constructor function for XMLOasisBasicImporter It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Yeliz Taneroğlu committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=955ca134fd62f809efdf1ce87c8646586871597a tdf#74608 Constructor function for XMLBasicImporter It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Yeliz Taneroğlu committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=d46bfe13675735caf6d7fbf11ed2d1f5d30a49cd tdf#74608 Constructor function for XMLBasicExporter It will be available in 5.2.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Steven Guo committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=85f404151e308bc1e97a0f3f15702c1c40a3b59b tdf#74608 Constructor functions for OPropertyBag It will be available in 5.3.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
(In reply to jan iversen from comment #46) > Seems solved No. Is solved once every implementation element has a constructor attribute in every "internal" *.component file (i.e., every *.component file outside desktop/test/deployment/passive/ mysqlc/ odk/examples/ )
Christian Lohmaier committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=6cac8409642e3b53dd21ccb833a0d0b85e005f85 android: another constructor function that fell victim to tdf#74608 It will be available in 5.3.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Yeliz Taneroğlu committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=5f37f56088eae48508336d68100b68cca407668a tdf#74608 Constructor function for MemoryStream It will be available in 5.3.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Matúš Kukan committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=22b0c09f8463b9c6cceb9e2c3addcab79d42aa0b tdf#74608: Ctor function for css.comp.uui.UUIInteractionRequestStringResolver It will be available in 5.3.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
(removed easyHack as per ESC discussion; the really easy cases are probably taken by now, and easy-hacker's work on this reportedly causes more frustration than fun; and then, it probably doesn't make much sense to keep this cleanup task open as a bugzilla bug, so closing)