https://bugs.documentfoundation.org/show_bug.cgi?id=170994

            Bug ID: 170994
           Summary: Replace tools/ headers with standard library and other
                    headers
           Product: LibreOffice
           Version: Inherited From OOo
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: LibreOffice
          Assignee: [email protected]
          Reporter: [email protected]

Description:
As tools/README.md says, "tools" library is marked as deprecated and was
supposed to be removed a long time ago. But after many years, it is still
there. This is a task to facilitate migrating from tools/ library to standard
library and other newer/more relevant headers/libraries.

> # Old Tools (Deprecated)
> 
> Predates sal - string functions, url manipulation, stream stuff,
> polygons, etc.
> ...
> This directory will be removed in the near future (see tdf#39445 or
> tdf#63154).

Code count using "cloc tools" shows around 20k line of C++ code and 5.5K line
of C++ headers with "cloc include/tools", which are not small amounts of code.
Therefore, step by step removal is the needed.

It is better to start from less used headers. Counting usages helps:

$ git grep -hE '[<"]tools/[A-Za-z]+\.hxx[">]' *.cxx *.hxx| sed -E
's@.*/([A-Za-z]+\.hxx).*@\1@' | sort | uniq -c | sort -bnr

Result shows the least used headers in the end.

For example, consider tools/line.hxx:

$ git grep tools/line.hxx *.cxx *.hxx
sw/source/core/layout/trvlfrm.cxx:#include <tools/line.hxx>
tools/source/generic/line.cxx:#include <tools/line.hxx>
tools/source/generic/poly.cxx:#include <tools/line.hxx>
vcl/source/outdev/hatch.cxx:#include <tools/line.hxx>

This header is used in vcl/, sw/ and also in the tools library code itself.

When you pick a header, first try researching possible replacement of that
header, including the standard library and/or other newer and more relevant
libraries from LibreOffice.

Upon successful completion of removing the usages of a header, you may try
removing the library code from tools/ and the corresponding header from
include/tools.

As the last resort, you may think about moving some of the headers to a more
appropriate place in the code. Please take a look at some of the older
discussions:
https://lists.freedesktop.org/archives/libreoffice/2017-April/077620.html

Notes: <tools/fract.hxx> is going to be removed in tdf#161837, therefore please
leave it as is for this task.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to