Refactoring patches

Pavel Sanda sanda at lyx.org
Wed Oct 14 10:41:19 UTC 2020


On Tue, Oct 13, 2020 at 11:41:28PM +0200, Pavel Sanda wrote:
> The real "forgotten" includes which would trigger compiler analysis could make difference
> but I am afraid you would need to manually check each include of this type.
> 
> If we prefer kicking out any unnecessary header there is already
> development/tools/header_check.sh at our disposal; 

FYI, this is the current output for headers if you have stamina to go through it
and identify the "real" cases of forgotten includes.

Right now I am after the 'suspicious' lines which suggest that include
might be moved from header to .cpp.

Pavel
-------------- next part --------------
BUILD_FN exited without error after removing the following include statements invididually:
./BiblioInfo.h::#include "Citation.h"
./BiblioInfo.h::#include <map>
./BiblioInfo.h::#include <set>
./BiblioInfo.h::#include <vector>
./Buffer.h::#include "support/strfwd.h"
./Buffer.h::#include <set>
./Buffer.h::#include <string>
./Buffer.h::#include <vector>
./BufferEncodings.h::#include "support/docstring.h"
./BufferEncodings.h::#include "support/types.h"
./BufferParams.h::#include "OutputParams.h"
./BufferParams.h::#include <map>
./BufferParams.h::#include <vector>
./BufferView.h::#include "support/strfwd.h"
./BufferView.h::#include "support/types.h"
./Changes.h::#include "support/strfwd.h"
./Citation.h::#include <string>
./CiteEnginesList.h::#include <string>
./CiteEnginesList.h::#include <vector>
./CmdDef.h::#include "support/strfwd.h"
./ColorSet.h::#include <string>
./Compare.h::#include <QObject>
./CompletionList.h::#include "support/docstring.h"
./Converter.h::#include "support/trivstring.h"
./Converter.h::#include <vector>
./Converter.h::#include <set>
./Converter.h::#include <string>
./CursorSlice.h::#include "support/types.h"
./CursorSlice.h::#include "support/strfwd.h"
./CutAndPaste.h::#include "support/docstring.h"
./CutAndPaste.h::#include <vector>
./DepTable.h::#include <string>
./DocIterator.h::#include <vector>
suspicious: ./DocIterator.h::#include <algorithm>
./Encoding.h::#include "support/docstring.h"
./Encoding.h::#include "support/trivstring.h"
./ErrorList.h::#include "support/docstring.h"
./ErrorList.h::#include "support/types.h"
./ErrorList.h::#include <vector>
./Exporter.h::#include <string>
./FloatList.h::#include <string>
./Floating.h::#include <string>
./Font.h::#include "support/strfwd.h"
./FontInfo.h::#include "ColorCode.h"
./FontInfo.h::#include "support/strfwd.h"
./Format.h::#include "support/docstring.h"
./Format.h::#include "support/trivstring.h"
./Format.h::#include <vector>
./Graph.h::#include <vector>
./HunspellChecker.h::#include "SpellChecker.h"
./KeyMap.h::#include "support/strfwd.h"
./KeyMap.h::#include <vector>
./KeySequence.h::#include "frontends/KeyModifier.h"
./KeySequence.h::#include <string>
./LaTeX.h::#include "support/docstring.h"
./LaTeX.h::#include <vector>
./LaTeX.h::#include <set>
./LaTeXFeatures.h::#include "support/docstring.h"
./LaTeXFeatures.h::#include <set>
./Language.h::#include "support/docstring.h"
./Language.h::#include "support/trivstring.h"
./Language.h::#include <map>
./Language.h::#include <set>
./Language.h::#include <vector>
./Layout.h::#include "support/docstring.h"
./Layout.h::#include <string>
./LayoutFile.h::#include "LayoutModuleList.h"
./LayoutFile.h::#include "support/strfwd.h"
./LayoutFile.h::#include <string>
./LayoutFile.h::#include <vector>
./Lexer.h::#include <string>
./LyXAction.h::#include <string>
./LyXRC.h::#include "support/strfwd.h"
./LyXRC.h::#include <string>
./LyXVC.h::#include <string>
./MetricsInfo.h::#include "Changes.h"
./MetricsInfo.h::#include "ColorCode.h"
./MetricsInfo.h::#include "FontInfo.h"
./MetricsInfo.h::#include "support/strfwd.h"
./MetricsInfo.h::#include "support/Changer.h"
./MetricsInfo.h::#include <string>
./Mover.h::#include <string>
./PDFOptions.h::#include "support/strfwd.h"
./PDFOptions.h::#include <string>
./ParIterator.h::#include "support/types.h"
./Paragraph.h::#include "FontEnums.h"
./Paragraph.h::#include "support/strfwd.h"
./ParagraphMetrics.h::#include "Dimension.h"
suspicious: ./ParagraphMetrics.h::#include "Row.h"
./ParagraphMetrics.h::#include <vector>
./ParagraphParameters.h::#include "support/docstring.h"
./PersonalWordList.h::#include "support/strfwd.h"
./PersonalWordList.h::#include <string>
./Row.h::#include "support/docstring.h"
./Row.h::#include "support/types.h"
./Row.h::#include <vector>
./Server.h::#include <vector>
./Server.h::#include <windows.h>
./Server.h::#include <QObject>
./Server.h::#include <QEvent>
./ServerSocket.h::#include <string>
./Session.h::#include <string>
./Spacing.h::#include "support/strfwd.h"
./Spacing.h::#include <string>
./TexRow.h::#include "support/docstring.h"
./TextClass.h::#include "FontInfo.h"
./TextClass.h::#include "Layout.h"
./TextClass.h::#include "LayoutEnums.h"
./TextClass.h::#include "support/docstring.h"
./TextClass.h::#include <list>
./TextClass.h::#include <map>
./TextClass.h::#include <set>
./TextClass.h::#include <string>
./TextClass.h::#include <vector>
./TextMetrics.h::#include "Font.h"
suspicious: ./TextMetrics.h::#include "ParagraphMetrics.h"
./TextMetrics.h::#include "support/types.h"
./Thesaurus.h::#include "support/docstring.h"
./Thesaurus.h::#include <map>
./Thesaurus.h::#include <vector>
./Toc.h::#include <string>
./TocBackend.h::#include "DocIterator.h"
./TocBackend.h::#include "OutputEnums.h"
./TocBackend.h::#include "Toc.h"
./TocBackend.h::#include "support/strfwd.h"
./TocBackend.h::#include "support/unique_ptr.h"
./TocBuilder.h::#include "support/strfwd.h"
./VCBackend.h::#include <string>
./WordLangTuple.h::#include "support/docstring.h"
./frontends/Clipboard.h::#include "support/strfwd.h"
./frontends/Painter.h::#include "support/strfwd.h"
./frontends/WorkArea.h::#include "frontends/KeyModifier.h"
./frontends/qt/BulletsModule.h::#include <QWidget>
./frontends/qt/CategorizedCombo.h::#include "support/strfwd.h"
./frontends/qt/ColorCache.h::#include <QColor>
suspicious: ./frontends/qt/DialogView.h::#include "GuiView.h"
suspicious: ./frontends/qt/DialogView.h::#include <QCloseEvent>
suspicious: ./frontends/qt/DockView.h::#include "GuiView.h"
suspicious: ./frontends/qt/DockView.h::#include <QKeyEvent>
./frontends/qt/FileDialog.h::#include <utility>
./frontends/qt/FindAndReplace.h::#include <string>
./frontends/qt/FloatPlacement.h::#include "support/docstring.h"
./frontends/qt/GuiApplication.h::#include <QList>
./frontends/qt/GuiBibtex.h::#include "ButtonController.h"
./frontends/qt/GuiBox.h::#include "Font.h"
./frontends/qt/GuiBranches.h::#include <QWidget>
./frontends/qt/GuiChanges.h::#include "support/docstring.h"
./frontends/qt/GuiCharacter.h::#include <QAction>
./frontends/qt/GuiCharacter.h::#include <utility>
./frontends/qt/GuiCitation.h::#include "Citation.h"
./frontends/qt/GuiCitation.h::#include <QAbstractListModel>
./frontends/qt/GuiCitation.h::#include <QStringList>
./frontends/qt/GuiClipboard.h::#include <QObject>
./frontends/qt/GuiClipboard.h::#include <QStringList>
./frontends/qt/GuiClipboard.h::#include <cstdint>
./frontends/qt/GuiCommandBuffer.h::#include "support/docstring.h"
./frontends/qt/GuiCommandBuffer.h::#include <QWidget>
./frontends/qt/GuiCommandBuffer.h::#include <vector>
./frontends/qt/GuiCommandEdit.h::#include <QKeyEvent>
./frontends/qt/GuiCommandEdit.h::#include <QEvent>
./frontends/qt/GuiCompleter.h::#include "support/docstring.h"
./frontends/qt/GuiExternal.h::#include <QHash>
./frontends/qt/GuiFontExample.h::#include <QFont>
./frontends/qt/GuiFontExample.h::#include <QString>
./frontends/qt/GuiFontMetrics.h::#include "support/docstring.h"
./frontends/qt/GuiFontMetrics.h::#include <QFont>
./frontends/qt/GuiFontMetrics.h::#include <QHash>
./frontends/qt/GuiGraphics.h::#include <vector>
./frontends/qt/GuiIdListModel.h::#include <vector>
./frontends/qt/GuiIdListModel.h::#include <string>
./frontends/qt/GuiImage.h::#include <QString>
./frontends/qt/GuiIndices.h::#include <QWidget>
./frontends/qt/GuiLyXFiles.h::#include <vector>
./frontends/qt/GuiPainter.h::#include <QPainterPath>
./frontends/qt/GuiParagraph.h::#include <map>
./frontends/qt/GuiPrefs.h::#include "GuiDialog.h"
./frontends/qt/GuiPrefs.h::#include <string>
./frontends/qt/GuiPrefs.h::#include <vector>
./frontends/qt/GuiProgressView.h::#include <string>
./frontends/qt/GuiRef.h::#include <vector>
./frontends/qt/GuiSendto.h::#include <vector>
./frontends/qt/GuiSetBorder.h::#include <QPixmap>
./frontends/qt/GuiSpellchecker.h::#include <QTabWidget>
./frontends/qt/GuiSymbols.h::#include <map>
./frontends/qt/GuiSymbols.h::#include <string>
./frontends/qt/GuiSymbols.h::#include <vector>
./frontends/qt/GuiTabularCreate.h::#include <utility>
./frontends/qt/GuiToolbar.h::#include <QList>
./frontends/qt/GuiToolbar.h::#include "support/strfwd.h"
./frontends/qt/GuiView.h::#include "support/strfwd.h"
./frontends/qt/GuiViewSource.h::#include <QDockWidget>
./frontends/qt/GuiViewSource.h::#include <QString>
suspicious: ./frontends/qt/GuiViewSource.h::#include <QTimer>
./frontends/qt/GuiWorkArea.h::#include <QAbstractScrollArea>
./frontends/qt/GuiWorkArea.h::#include <QTabBar>
./frontends/qt/GuiWorkArea.h::#include <QTabWidget>
./frontends/qt/IconPalette.h::#include <QWidget>
./frontends/qt/InGuiThread.h::#include "support/functional.h"
./frontends/qt/InsetParamsDialog.h::#include <QPushButton>
./frontends/qt/InsetParamsWidget.h::#include "insets/InsetCode.h"
./frontends/qt/InsetParamsWidget.h::#include "support/strfwd.h"
./frontends/qt/InsetParamsWidget.h::#include <QWidget>
./frontends/qt/LaTeXHighlighter.h::#include <QTextCharFormat>
./frontends/qt/PanelStack.h::#include <QHash>
./frontends/qt/PanelStack.h::#include <QWidget>
./frontends/qt/TocModel.h::#include <QHash>
suspicious: ./frontends/qt/TocWidget.h::#include <QTimer>
./frontends/qt/TocWidget.h::#include <QWidget>
suspicious: ./frontends/qt/qt_helpers.h::#include "support/qstring_helpers.h"
suspicious: ./frontends/qt/qt_helpers.h::#include "qt_i18n.h"
./frontends/qt/qt_helpers.h::#include <list>
./graphics/GraphicsCache.h::#include <string>
./graphics/GraphicsParams.h::#include <string>
./graphics/GraphicsParams.h::#include <iosfwd>
./graphics/GraphicsTypes.h::#include "support/strfwd.h"
./insets/ExternalTransforms.h::#include "support/Length.h"
./insets/ExternalTransforms.h::#include <functional>
./insets/ExternalTransforms.h::#include <memory>
./insets/ExternalTransforms.h::#include <string>
./insets/Inset.h::#include "ColorCode.h"
./insets/Inset.h::#include "LayoutEnums.h"
./insets/Inset.h::#include "support/strfwd.h"
./insets/Inset.h::#include "support/types.h"
./insets/InsetCollapsible.h::#include <map>
./insets/InsetCommandParams.h::#include "support/docstring.h"
./insets/InsetCommandParams.h::#include <string>
./insets/InsetCommandParams.h::#include <vector>
./insets/InsetExternal.h::#include "support/FileName.h"
./insets/InsetExternal.h::#include "support/unique_ptr.h"
./insets/InsetGraphics.h::#include <set>
./insets/InsetGraphicsParams.h::#include "support/FileName.h"
./insets/InsetGraphicsParams.h::#include <string>
./insets/InsetIPA.h::#include "Dimension.h"
./insets/InsetIPA.h::#include "support/unique_ptr.h"
./insets/InsetIPAMacro.h::#include "Inset.h"
./insets/InsetInclude.h::#include "RenderButton.h"
./insets/InsetInclude.h::#include "support/unique_ptr.h"
./insets/InsetLayout.h::#include "ColorCode.h"
./insets/InsetLayout.h::#include "FontInfo.h"
./insets/InsetLayout.h::#include "support/docstring.h"
./insets/InsetLayout.h::#include <set>
./insets/InsetLayout.h::#include <string>
./insets/InsetListingsParams.h::#include <map>
./insets/InsetPreview.h::#include "Dimension.h"
./insets/InsetPreview.h::#include "support/unique_ptr.h"
./insets/InsetQuotes.h::#include "support/docstring.h"
./insets/InsetTabular.h::#include <climits>
./insets/InsetTabular.h::#include <iosfwd>
./insets/InsetTabular.h::#include <memory>
./insets/InsetTabular.h::#include <vector>
./insets/InsetText.h::#include "Inset.h"
./insets/InsetText.h::#include "ColorCode.h"
./insets/RenderButton.h::#include "support/docstring.h"
./insets/RenderPreview.h::#include "support/docstring.h"
./insets/RenderPreview.h::#include "support/FileName.h"
./insets/RenderPreview.h::#include "support/signals.h"
./lyxfind.h::#include "support/strfwd.h"
./lyxfind.h::#include "support/docstring.h"
./mathed/InsetMathClass.h::#include "MathClass.h"
./mathed/InsetMathGrid.h::#include <map>
./mathed/InsetMathHull.h::#include "OutputEnums.h"
./mathed/InsetMathHull.h::#include "support/unique_ptr.h"
./mathed/InsetMathMacro.h::#include "MathData.h"
./mathed/InsetMathMacro.h::#include <map>
./mathed/InsetMathMacroArgument.h::#include "support/docstring.h"
./mathed/InsetMathMacroTemplate.h::#include "MathData.h"
./mathed/InsetMathMatrix.h::#include "support/strfwd.h"
./mathed/InsetMathNest.h::#include "InsetMath.h"
./mathed/InsetMathNest.h::#include <map>
./mathed/InsetMathNumber.h::#include "support/docstring.h"
suspicious: ./mathed/InsetMathSize.h::#include "MetricsInfo.h"
./mathed/InsetMathSpecialChar.h::#include "support/docstring.h"
./mathed/InsetMathString.h::#include "support/docstring.h"
./mathed/InsetMathXYMatrix.h::#include "support/Length.h"
./mathed/MacroTable.h::#include "support/docstring.h"
./mathed/MacroTable.h::#include <map>
./mathed/MacroTable.h::#include <set>
./mathed/MacroTable.h::#include <vector>
./mathed/MathAutoCorrect.h::#include "support/strfwd.h"
./mathed/MathCompletionList.h::#include "support/docstring.h"
./mathed/MathCompletionList.h::#include <vector>
./mathed/MathData.h::#include "Dimension.h"
./mathed/MathData.h::#include "OutputEnums.h"
./mathed/MathData.h::#include "support/strfwd.h"
./mathed/MathData.h::#include <cstddef>
./mathed/MathData.h::#include <vector>
./mathed/MathFactory.h::#include "support/strfwd.h"
./mathed/MathRow.h::#include "MathClass.h"
./mathed/MathRow.h::#include "ColorCode.h"
./mathed/MathRow.h::#include "support/docstring.h"
./mathed/MathRow.h::#include <vector>
./mathed/MathStream.h::#include "support/Changer.h"
./mathed/MathStream.h::#include "support/strfwd.h"
./mathed/MathStream.h::#include "support/unique_ptr.h"
./mathed/ReplaceData.h::#include "MathData.h"
./output_docbook.h::#include "LayoutEnums.h"
./output_docbook.h::#include "support/docstream.h"
./output_docbook.h::#include "support/strfwd.h"
./output_latex.h::#include <utility>
./output_latex.h::#include "support/docstream.h"
./output_plaintext.h::#include "support/types.h"
suspicious: ./output_xhtml.h::#include "support/docstream.h"
./output_xhtml.h::#include "support/strfwd.h"
./output_xhtml.h::#include <deque>
./output_xhtml.h::#include <memory>
./support/Cache.h::#include <list>
./support/Cache.h::#include <type_traits>
./support/ConsoleApplicationPrivate.h::#include <string>
./support/ExceptionMessage.h::#include <exception>
./support/FileMonitor.h::#include <memory>
./support/FileMonitor.h::#include <QObject>
./support/FileMonitor.h::#include <QPointer>
./support/FileName.h::#include "support/strfwd.h"
./support/ForkedCalls.h::#include <memory>
./support/Messages.h::#include <string>
./support/Package.h::#include <string>
./support/RandomAccessList.h::#include <vector>
./support/RefChanger.h::#include "support/Changer.h"
./support/Systemcall.h::#include "strfwd.h"
./support/SystemcallPrivate.h::#include <QObject>
./support/SystemcallPrivate.h::#include <string>
./support/Translator.h::#include <vector>
./support/Translator.h::#include <utility>
suspicious: ./support/docstream.h::#include <sstream>
./support/docstring.h::#include <string>
./support/docstring_list.h::#include "support/docstring.h"
./support/filetools.h::#include "support/docstring.h"
./support/filetools.h::#include <utility>
./support/filetools.h::#include <string>
./support/gzstream.h::#include <iostream>
suspicious: ./support/gzstream.h::#include <fstream>
./support/lyxalgo.h::#include <utility>
./support/lyxalgo.h::#include <iterator>
./support/lyxtime.h::#include <time.h>
./support/lyxtime.h::#include <string>
./support/numpunct_lyx_char_type.h::#include <locale>
./support/os.h::#include <cstddef>
./support/os_win32.h::#include <string>
./support/os_win32.h::#include <windows.h>
./support/os_win32.h::#include <tchar.h>
./support/os_win32.h::#include <psapi.h>
./support/pmprof.h::#include <chrono>
./support/pmprof.h::#include <iomanip>
./support/pmprof.h::#include <iostream>
./support/signals.h::#include <memory>
./support/strfwd.h::#include <cstdint>
./support/strfwd.h::#include "support/numpunct_lyx_char_type.h" // implementation for our char_type needed
./support/textutils.h::#include "support/strfwd.h"
./support/trivstring.h::#include "support/strfwd.h"
./support/trivstring.h::#include <cstdlib>
./support/trivstring.h::#include <string>
./support/unicode.h::#include <cstddef>
./support/unicode.h::#include <string>
./support/unique_ptr.h::#include <cstddef>
./support/unique_ptr.h::#include <type_traits>
./support/unique_ptr.h::#include <utility>
./support/weighted_btree.h::#include <algorithm>
./support/weighted_btree.h::#include <functional>
./support/weighted_btree.h::#include <ostream>
./support/weighted_btree.h::#include <iostream>
./tex2lyx/Context.h::#include <iosfwd>
./tex2lyx/Parser.h::#include <string>
./tex2lyx/Parser.h::#include <utility>
./tex2lyx/Preamble.h::#include <iosfwd>
./tex2lyx/Preamble.h::#include <string>
./tex2lyx/Preamble.h::#include <vector>
./tex2lyx/tex2lyx.h::#include <iosfwd>
./tex2lyx/tex2lyx.h::#include <string>
./tex2lyx/tex2lyx.h::#include <vector>
./tex2lyx/tex2lyx.h::#include <map>


More information about the lyx-devel mailing list