In C++11 you can use: class NonCopyable { public: NonCopyable(const NonCopyable&) = delete; const NonCopyable& operator=(const NonCopyable&) = delete; }; to make a class non-copyable, thus there is no need for boost templates anymore. To find this being used use: git grep boost::noncopyable git grep boost/noncopyable and replace uses of boost::noncopyable with plain C++11 deleted copy constructors.
Hi, This is my first bug fix and I am a new contributor with very little experience. I successfully build libreoffice and tried git grep boost::noncopyable git grep boost/noncopyable I see that there has to be changes in the MANY files. how to approach that ?
Umang, you should make changes in at most one module at a time. Where a module is all of the code under a top-level directory like vcl/ or sd/
ok. So correct me if I am wrong. Have to make changes module by module, then run "make" for that particular module and examine if some error pops up ?
Let's say you pick "sd". Do your changes in "sd", then build the changed code with "make sd.build", and iterate it till you're done with your changes and the code builds. Then run "make check" to run all the automated tests. If all of them pass, then submit the patch to gerrit. :-)
There are some structures using boost noncopyable template, how to remove that ? Does it(i.e. structs) even required to be removed or just only the classes. Like in : core/undoanim.cxx:struct UndoAnimationPathImpl: private boost::noncopyable
The only real difference between structs and classes is the default access. class NonCopyable { public: NonCopyable(const NonCopyable&) = delete; const NonCopyable& operator=(const NonCopyable&) = delete; }; is essentially the same as struct NonCopyable { NonCopyable(const NonCopyable&) = delete; const NonCopyable& operator=(const NonCopyable&) = delete; };
ok regarding the sd/ module, I am not able to make changes in: sd/source/ui/remotecontrol/IBluetoothSocket.hxx : (line) struct IBluetoothSocket : private boost::noncopyable If I change with : class NonCopyable { public: NonCopyable(const NonCopyable&) = delete; const NonCopyable& operator=(const NonCopyable&) = delete; }; It does not builds successfully and throws errors. If I allow boost templates(only for this file), It build successfully. What should I do ?
I just took a look at it, and if I'm correct this is due to the fact that there is no default constructor in IBluetoothSocket. boost::noncopyable defines a default constructor. As a result, you might try something like the following. struct IBluetoothSocket { protected: // I personally would use protected but someone else may disagree IBluetoothSocket() = default; public: // everything else }; No worries, but typically if you have questions regarding errors it is a good idea to post them :-)
Like umang this is my first bug too. i have a working build . in a file in sw : inc/breakit.hxx : should this : class SW_DLLPUBLIC SwBreakIt : private ::boost::noncopyable { com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > m_xContext; mutable com::sun::star::uno::Reference< com::sun::star::i18n::XBreakIterator > xBreak; LanguageTag * m_pLanguageTag; ///< language tag of the current locale com::sun::star::i18n::ForbiddenCharacters * m_pForbidden; LanguageType aForbiddenLang; ///< language of the current forbiddenChar struct void _GetLocale( const LanguageType aLang ); void _GetLocale( const LanguageTag& rLanguageTag ); void _GetForbidden( const LanguageType aLang ); void createBreakIterator() const; // private (see @ _Create, _Delete). explicit SwBreakIt( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > & rxContext); ~SwBreakIt(); public: // private (see @ source/core/bastyp/init.cxx). static void _Create( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > & rxContext); static void _Delete(); public: static SwBreakIt * Get(); com::sun::star::uno::Reference< com::sun::star::i18n::XBreakIterator > GetBreakIter() { createBreakIterator(); return xBreak; } const com::sun::star::lang::Locale& GetLocale( const LanguageType aLang ) { if( !m_pLanguageTag || m_pLanguageTag->getLanguageType() != aLang ) _GetLocale( aLang ); return m_pLanguageTag->getLocale(); } const com::sun::star::lang::Locale& GetLocale( const LanguageTag& rLanguageTag ) { // Use LanguageType comparison instead of LanguageTag::operator!=() // because here the LanguageTag is already a known LanguageType value // assigned, so LanguageTag does not need to convert to BCP47 for // comparison. if( !m_pLanguageTag || m_pLanguageTag->getLanguageType() != rLanguageTag.getLanguageType() ) _GetLocale( rLanguageTag ); return m_pLanguageTag->getLocale(); } const LanguageTag& GetLanguageTag( const LanguageType aLang ) { if( !m_pLanguageTag || m_pLanguageTag->getLanguageType() != aLang ) _GetLocale( aLang ); return *m_pLanguageTag; } const LanguageTag& GetLanguageTag( const LanguageTag& rLanguageTag ) { // Use LanguageType comparison instead of LanguageTag::operator!=() // because here the LanguageTag is already a known LanguageType value // assigned, so LanguageTag does not need to convert to BCP47 for // comparison. if( !m_pLanguageTag || m_pLanguageTag->getLanguageType() != rLanguageTag.getLanguageType() ) _GetLocale( rLanguageTag ); return *m_pLanguageTag; } const com::sun::star::i18n::ForbiddenCharacters& GetForbidden( const LanguageType aLang ) { if( !m_pForbidden || aForbiddenLang != aLang ) _GetForbidden( aLang ); return *m_pForbidden; } sal_uInt16 GetRealScriptOfText( const OUString& rText, sal_Int32 nPos ) const; SvtScriptType GetAllScriptsOfText( const OUString& rText ) const; sal_Int32 getGraphemeCount(const OUString& rStr, sal_Int32 nStart, sal_Int32 nEnd) const; sal_Int32 getGraphemeCount(const OUString& rStr) const { return getGraphemeCount(rStr, 0, rStr.getLength()); } }; be change d to this : class SW_DLLPUBLIC SwBreakIt : private { com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > m_xContext; mutable com::sun::star::uno::Reference< com::sun::star::i18n::XBreakIterator > xBreak; LanguageTag * m_pLanguageTag; ///< language tag of the current locale com::sun::star::i18n::ForbiddenCharacters * m_pForbidden; LanguageType aForbiddenLang; ///< language of the current forbiddenChar struct void _GetLocale( const LanguageType aLang ); void _GetLocale( const LanguageTag& rLanguageTag ); void _GetForbidden( const LanguageType aLang ); void createBreakIterator() const; // private (see @ _Create, _Delete). explicit SwBreakIt( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > & rxContext); ~SwBreakIt(); public: // private (see @ source/core/bastyp/init.cxx). static void _Create( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > & rxContext); static void _Delete(); public: static SwBreakIt * Get(); com::sun::star::uno::Reference< com::sun::star::i18n::XBreakIterator > GetBreakIter() { createBreakIterator(); return xBreak; } const com::sun::star::lang::Locale& GetLocale( const LanguageType aLang ) { if( !m_pLanguageTag || m_pLanguageTag->getLanguageType() != aLang ) _GetLocale( aLang ); return m_pLanguageTag->getLocale(); } const com::sun::star::lang::Locale& GetLocale( const LanguageTag& rLanguageTag ) { // Use LanguageType comparison instead of LanguageTag::operator!=() // because here the LanguageTag is already a known LanguageType value // assigned, so LanguageTag does not need to convert to BCP47 for // comparison. if( !m_pLanguageTag || m_pLanguageTag->getLanguageType() != rLanguageTag.getLanguageType() ) _GetLocale( rLanguageTag ); return m_pLanguageTag->getLocale(); } const LanguageTag& GetLanguageTag( const LanguageType aLang ) { if( !m_pLanguageTag || m_pLanguageTag->getLanguageType() != aLang ) _GetLocale( aLang ); return *m_pLanguageTag; } const LanguageTag& GetLanguageTag( const LanguageTag& rLanguageTag ) { // Use LanguageType comparison instead of LanguageTag::operator!=() // because here the LanguageTag is already a known LanguageType value // assigned, so LanguageTag does not need to convert to BCP47 for // comparison. if( !m_pLanguageTag || m_pLanguageTag->getLanguageType() != rLanguageTag.getLanguageType() ) _GetLocale( rLanguageTag ); return *m_pLanguageTag; } const com::sun::star::i18n::ForbiddenCharacters& GetForbidden( const LanguageType aLang ) { if( !m_pForbidden || aForbiddenLang != aLang ) _GetForbidden( aLang ); return *m_pForbidden; } sal_uInt16 GetRealScriptOfText( const OUString& rText, sal_Int32 nPos ) const; SvtScriptType GetAllScriptsOfText( const OUString& rText ) const; sal_Int32 getGraphemeCount(const OUString& rStr, sal_Int32 nStart, sal_Int32 nEnd) const; sal_Int32 getGraphemeCount(const OUString& rStr) const { return getGraphemeCount(rStr, 0, rStr.getLength()); } };
my apology for the earlier comment that was posted by mistake. i want to ask is that are we supposed to remove boost::noncopyable and add the code provided bu BJORN in the public part of the class ? if not please guide me , as this is my first bug too !
i find this bug great to start off with so can i also join in with umang and do the sw module to get hang of this ? once i am done with with sw how do i submit it ?
(In reply to Daniel L Robertson from comment #8) > I just took a look at it, and if I'm correct this is due to the fact that > there is no default constructor in IBluetoothSocket. boost::noncopyable > defines a default constructor. As a result, you might try something like the > following. It looks somewhat misguided to derive the IBluetoothSocket "interface" from boost::noncopyable in the first place. Just drop that, and let any class deriving from IBluetoothSocket decide for itself whether or not it should be copyable.
(In reply to Siddharth Khabia from comment #10) > my apology for the earlier comment that was posted by mistake. > i want to ask is that are we supposed to remove boost::noncopyable and add > the code provided bu BJORN in the public part of the class ? You can put those deleted members into a private section (as they cannot be called anyway, as they are deleted).
(In reply to Stephan Bergmann from comment #14) > (In reply to Siddharth Khabia from comment #10) > > my apology for the earlier comment that was posted by mistake. > > i want to ask is that are we supposed to remove boost::noncopyable and add > > the code provided bu BJORN in the public part of the class ? > > You can put those deleted members into a private section (as they cannot be > called anyway, as they are deleted). Actually, Scott Meyers recommends those members be put in a public section, for better compiler error messages (c.f. Item 11 in Effective Modern C++).
(In reply to Siddharth Khabia from comment #12) > i find this bug great to start off with so can i also join in with umang and > do the sw module to get hang of this ? > > once i am done with with sw how do i submit it ? Great. Actually there are many changes to make considering all modules. So lets join and get this done. Lets connect via E-mail. I have already done changes in about 9-10 modules. You can start with remaining ones.
I will be glad to do that ! have you completed sw , i changed a few files of that ?
(In reply to Kohei Yoshida from comment #15) > (In reply to Stephan Bergmann from comment #14) > > (In reply to Siddharth Khabia from comment #10) > > > my apology for the earlier comment that was posted by mistake. > > > i want to ask is that are we supposed to remove boost::noncopyable and add > > > the code provided bu BJORN in the public part of the class ? > > > > You can put those deleted members into a private section (as they cannot be > > called anyway, as they are deleted). > > Actually, Scott Meyers recommends those members be put in a public section, > for better compiler error messages (c.f. Item 11 in Effective Modern C++). thanks for the help ! :)
i have replace uses of boost::noncopyable in a module but when i do boost/noncopyable , it shows its use as a header file. will only commenting out/deleteing those headere files work ?
Migrating Whiteboard tags to Keywords: (easyHack, difficultyBeginner, skillCpp, topicCleanup)
JanI is default CC for Easy Hacks (Add Jan; remove LibreOffice Dev List from CC) [NinjaEdit]
Steven Guo committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=5819268ad709f52417b59421260e86e9c7e90f75 tdf#94306 Replace boost::noncopyable with plain C++11 deleted copy ctors 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.
Jochen Nitschke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=3c43a4810f505c071bcc99aeda47162a4b7b1681 tdf#94306 Replace boost::noncopyable in sc/source 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.
Jochen Nitschke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=8c2f2e1dd77cdce9bdf63beff5a79f91adc44630 tdf#94306 replace boost::noncopyable in .. 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=be3c2ff9233e8d4c5afe9c696cb5a60b24b25efc tdf#94306 Replace boost::noncopyable with plain C++11 deleted copy ctors 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.
Jochen Nitschke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=f9b200ce54cd67ddc04747f9676568a86e14d864 tdf#94306 replace boost::noncopyable in canvas 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.
Jochen Nitschke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=98d7b02f2b69f2f88a03054183933df7f190017d tdf#94306 replace boost::noncopyable in cppuhelper 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.
Jochen Nitschke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=f781997ee1dcb61b01b04cc050001e2f46b12dfe tdf#94306 replace boost::noncopyable in c... 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.
Jochen Nitschke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=25934decf8bfd94506bccd48ac66be9d7eb4dce2 tdf#94306 replace boost::noncopyable in chart2 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.
Jochen Nitschke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=922ee9a9da62febfe38a7780b11cf0d7ea0d5685 tdf#94306 replace boost::noncopyable in d... 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.
Jochen Nitschke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=c210bf4510585b554e0e9a371f27fa27e2874762 tdf#94306 replace boost::noncopyable r.. to sdext 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.
Jochen Nitschke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=d84ef731d8f5d8c1e896ecda3d03d4bb9129578d tdf#94306 replace boost::noncopyable ... 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.
Jochen Nitschke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=97abbec95665b43a9a09e10a0fb31854cdbd5c0d tdf#94306 replace boost::noncopyable in stoc to xmlsec.. 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.
Jochen Nitschke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=0de868cd0f430efc6256926c2865530818d7b7dd tdf#94306 replace boost::noncopyable in sfx2 to sot 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.
Jochen Nitschke committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=c664b27505223257f93f05425c52a88172ca199b tdf#94306 remove unused boost dependencies 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.
I just grep'd the source tree and the only instances of 'noncopyable' are in annotations. I'm pretty sure that this should be closed.