Bug 88116 - OS X: reduce cut/paste coding
Summary: OS X: reduce cut/paste coding
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
4.5.0.0.alpha0+ Master
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: reviewed:2022
Keywords: difficultyMedium, easyHack, skillCpp, topicCleanup
Depends on:
Blocks:
 
Reported: 2015-01-06 15:42 UTC by Michael Meeks
Modified: 2022-07-30 08:41 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Meeks 2015-01-06 15:42:42 UTC
vcl/osx/salinst.cxx has a chunk of code - particularly around the SalYieldMutex - that is duplicated in vcl/generic/app/geninst.cxx.

It'd be great to use the generic code wherever possible there - either by inheriting (as the gtk2 backend does) and killing that duplication.

I hope that that's reasonably easy - but of course, it needs compile testing on the Mac and a clean 'make check' run before and after that =)

Thanks !
Comment 1 Saikat Dey 2015-02-23 16:47:22 UTC
I want to take this assignment,do i need to install mac? I am using ubuntu.
Comment 2 Michael Meeks 2015-02-23 16:56:57 UTC
"but of course, it needs compile testing on the Mac and a clean 'make check' run before and after that =)"

So - I think that means yes. If you don't have a mac this is not a suitable task for you.
Comment 3 Robinson Tryon (qubit) 2015-12-10 11:41:05 UTC
Migrating Whiteboard tags to Keywords: (easyHack, difficultyBeginner, skillCpp, topicCleanup)
Comment 4 Robinson Tryon (qubit) 2016-02-18 14:52:30 UTC
JanI is default CC for Easy Hacks (Add Jan; remove LibreOffice Dev List from CC)
[NinjaEdit]
Comment 5 Vikas Mahato 2018-02-13 09:36:50 UTC
(In reply to Michael Meeks from comment #0)
> vcl/osx/salinst.cxx has a chunk of code - particularly around the
> SalYieldMutex - that is duplicated in vcl/generic/app/geninst.cxx.
> 
> It'd be great to use the generic code wherever possible there - either by
> inheriting (as the gtk2 backend does) and killing that duplication.
> 
> I hope that that's reasonably easy - but of course, it needs compile testing
> on the Mac and a clean 'make check' run before and after that =)
> 
> Thanks !

I cannot find vcl/generic/app/geninst.cxx. Did you mean vcl/unx/generic/app/geninst.cxx ?

https://opengrok.libreoffice.org/search?project=core&q=&defs=&refs=&path=vcl%2Fgeneric%2Fapp%2Fgeninst.cxx&hist=&type=
Comment 6 Michael Meeks 2018-02-13 09:44:20 UTC
Hmm; it is possible that we made progress on this =) The files moved too.

I would read (copy/paste it into a buffer) all of the SalYieldMutex implementations from each backend, and see if common code remains, and if so -
 factor it out into a shared class =)

Thanks!
Comment 7 Hossein 2022-07-30 08:41:24 UTC
Re-evaluating the EasyHack in 2022

This issue is no longer relevant.

Comparing these two files:

  vcl/unx/generic/app/geninst.cxx (moved from above address)
  vcl/osx/salinst.cxx

shows that there is only a member function with similar name in each class in which has different implementation: getOSVersion().

For more information, please take a look at this commit:

commit 3840aede596e6fc24f7ed7df9100fb028134aac6
Author: Jan-Marek Glogowski <glogow@fbihome.de>
Date:   Tue Aug 15 08:05:51 2017 +0200

    Unify SolarMutex implementations