On Tue, Oct 01, 2024 at 07:09:03PM +0200, Jean-Marc Lasgouttes wrote:
> Le 01/10/2024 ?? 18:18, Pavel Sanda a écrit :
> > I could produce patch which ditches strfwd and let Enrico/Eugene test it?
> > 
> >  From what I see it might do more harm than good in linux nowadys...
> 
> Go for it. And do not forget to remove <string> and/or <ostream> from the
> cpp file.

This is my take on this. I moved docstring definitions to docstring.h where
it actually belongs and made <string> inclusion mandatory.

I am little bit scared of commits like a0a472c16e09 so I tried to avoid any
additional "improvements" within docstring.h itself and am still concerned
about the effects of this patch on MSVC. This patch does not remove the header
file itself (yet).
Anyway without trying we'll never get rid of this archaic stuff.

Any additional comments?

Enrico/Eugene/Stephan can you confirm you can compile and run master
with the attached patch?

Pavel
diff --git a/src/Box.h b/src/Box.h
index 9522ad0a79..e0aa633b43 100644
--- a/src/Box.h
+++ b/src/Box.h
@@ -12,7 +12,7 @@
 #ifndef BOX_H
 #define BOX_H
 
-#include "support/strfwd.h"
+#include <ostream>
 
 
 namespace lyx {
diff --git a/src/Buffer.h b/src/Buffer.h
index d4e8db8748..fa240a4cbf 100644
--- a/src/Buffer.h
+++ b/src/Buffer.h
@@ -16,13 +16,12 @@
 #include "OutputEnums.h"
 
 #include "support/unique_ptr.h"
-#include "support/strfwd.h"
+#include "support/docstring.h"
 #include "support/types.h"
 
 #include <map>
 #include <list>
 #include <set>
-#include <string>
 #include <vector>
 
 
diff --git a/src/BufferEncodings.h b/src/BufferEncodings.h
index d5a9081f09..917a8371a1 100644
--- a/src/BufferEncodings.h
+++ b/src/BufferEncodings.h
@@ -16,8 +16,6 @@
 
 #include "Encoding.h"
 
-#include "support/strfwd.h"
-
 namespace lyx {
 
 class Buffer;
diff --git a/src/BufferList.h b/src/BufferList.h
index ff5156657b..1384467c73 100644
--- a/src/BufferList.h
+++ b/src/BufferList.h
@@ -12,8 +12,7 @@
 #ifndef BUFFER_LIST_H
 #define BUFFER_LIST_H
 
-#include "support/strfwd.h"
-
+#include <string>
 #include <vector>
 
 
diff --git a/src/BufferView.h b/src/BufferView.h
index 0f673e38e6..deeeb7061b 100644
--- a/src/BufferView.h
+++ b/src/BufferView.h
@@ -20,7 +20,6 @@
 #include "TexRow.h"
 #include "update_flags.h"
 
-#include "support/strfwd.h"
 #include "support/types.h"
 
 namespace lyx {
diff --git a/src/Changes.h b/src/Changes.h
index d53887556d..1bad1b2bc0 100644
--- a/src/Changes.h
+++ b/src/Changes.h
@@ -15,7 +15,6 @@
 #ifndef CHANGES_H
 #define CHANGES_H
 
-#include "support/strfwd.h"
 #include "support/types.h"
 #include "support/lyxtime.h"
 
diff --git a/src/Citation.h b/src/Citation.h
index 747599d5f8..4be8c3f09a 100644
--- a/src/Citation.h
+++ b/src/Citation.h
@@ -13,7 +13,6 @@
 #define CITATION_H
 
 #include "support/docstring.h"
-#include <string>
 #include <vector>
 
 namespace lyx {
diff --git a/src/CmdDef.h b/src/CmdDef.h
index 946730e64e..e250015bee 100644
--- a/src/CmdDef.h
+++ b/src/CmdDef.h
@@ -12,10 +12,9 @@
 #ifndef CMDDEF_H
 #define CMDDEF_H
 
-#include "support/strfwd.h"
-
 #include <map>
 #include <set>
+#include <string>
 
 namespace lyx {
 
diff --git a/src/Color.h b/src/Color.h
index d67c4989a7..e85efbfbae 100644
--- a/src/Color.h
+++ b/src/Color.h
@@ -21,7 +21,7 @@
 
 #include "ColorCode.h"
 
-#include "support/strfwd.h"
+#include <string>
 
 namespace lyx {
 
diff --git a/src/ColorSet.h b/src/ColorSet.h
index c1de480f4f..88684079ba 100644
--- a/src/ColorSet.h
+++ b/src/ColorSet.h
@@ -19,10 +19,10 @@
 #ifndef COLORSET_H
 #define COLORSET_H
 
+#include "support/docstring.h"
 #include "Color.h"
 
 #include <map>
-#include <string>
 
 namespace lyx {
 
diff --git a/src/Converter.h b/src/Converter.h
index 720990013a..c1abe62fee 100644
--- a/src/Converter.h
+++ b/src/Converter.h
@@ -13,12 +13,11 @@
 #define CONVERTER_H
 
 #include "Graph.h"
-#include "support/trivstring.h"
+#include "support/docstring.h"
 
 #include <memory>
 #include <vector>
 #include <set>
-#include <string>
 
 
 namespace lyx {
diff --git a/src/ConverterCache.h b/src/ConverterCache.h
index 72afe293e5..46176c70bf 100644
--- a/src/ConverterCache.h
+++ b/src/ConverterCache.h
@@ -21,7 +21,7 @@
 #ifndef CONVERTERCACHE_H
 #define CONVERTERCACHE_H
 
-#include "support/strfwd.h"
+#include <string>
 
 
 namespace lyx {
diff --git a/src/CursorSlice.h b/src/CursorSlice.h
index eb865de948..6eb6ff5aba 100644
--- a/src/CursorSlice.h
+++ b/src/CursorSlice.h
@@ -18,7 +18,6 @@
 #define CURSORSLICE_H
 
 #include "support/types.h"
-#include "support/strfwd.h"
 #include "insets/Inset.h"
 
 
diff --git a/src/CutAndPaste.h b/src/CutAndPaste.h
index 0692afe596..edea773321 100644
--- a/src/CutAndPaste.h
+++ b/src/CutAndPaste.h
@@ -17,7 +17,6 @@
 #include "Author.h"
 #include "DocumentClassPtr.h"
 
-#include "support/strfwd.h"
 #include "support/types.h"
 
 #include "frontends/Clipboard.h"
diff --git a/src/ErrorList.h b/src/ErrorList.h
index 29cb03cfe6..267c2f82d0 100644
--- a/src/ErrorList.h
+++ b/src/ErrorList.h
@@ -14,8 +14,6 @@
 
 #include "TexRow.h"
 
-#include "support/strfwd.h"
-
 #include <vector>
 
 
diff --git a/src/Floating.h b/src/Floating.h
index ab57c4dd94..6fabe729ce 100644
--- a/src/Floating.h
+++ b/src/Floating.h
@@ -12,10 +12,7 @@
 #ifndef FLOATING_H
 #define FLOATING_H
 
-#include "support/strfwd.h"
-
-#include <string>
-
+#include "support/docstring.h"
 
 namespace lyx {
 
diff --git a/src/Font.h b/src/Font.h
index b59f015eca..61e2a535b0 100644
--- a/src/Font.h
+++ b/src/Font.h
@@ -17,8 +17,6 @@
 
 #include "FontInfo.h"
 
-#include "support/strfwd.h"
-
 
 namespace lyx {
 
diff --git a/src/FontInfo.cpp b/src/FontInfo.cpp
index b6f45f88b5..86e995e6d3 100644
--- a/src/FontInfo.cpp
+++ b/src/FontInfo.cpp
@@ -27,7 +27,6 @@
 #include "support/lstrings.h"
 
 #include <algorithm>
-#include <ostream>
 #include <sstream>
 
 using namespace std;
diff --git a/src/FontInfo.h b/src/FontInfo.h
index bd0f125a7a..008504653e 100644
--- a/src/FontInfo.h
+++ b/src/FontInfo.h
@@ -20,7 +20,7 @@
 #include "FontEnums.h"
 
 #include "support/Changer.h"
-#include "support/strfwd.h"
+#include "support/docstring.h"
 
 
 namespace lyx {
diff --git a/src/Format.h b/src/Format.h
index d1d6d74183..9895b0193b 100644
--- a/src/Format.h
+++ b/src/Format.h
@@ -12,11 +12,9 @@
 #ifndef FORMAT_H
 #define FORMAT_H
 
-#include "support/strfwd.h"
-#include "support/trivstring.h"
+#include "support/docstring.h"
 
 #include <vector>
-#include <string>
 
 namespace lyx {
 
diff --git a/src/KeyMap.h b/src/KeyMap.h
index ac9de6298b..9644835224 100644
--- a/src/KeyMap.h
+++ b/src/KeyMap.h
@@ -17,8 +17,6 @@
 #include "FuncRequest.h"
 #include "KeySequence.h"
 
-#include "support/strfwd.h"
-
 #include <memory>
 #include <vector>
 
diff --git a/src/LaTeX.h b/src/LaTeX.h
index 502834348b..185b9ebdd9 100644
--- a/src/LaTeX.h
+++ b/src/LaTeX.h
@@ -16,7 +16,6 @@
 
 #include "OutputParams.h"
 
-#include "support/strfwd.h"
 #include "support/FileName.h"
 #include "support/signals.h"
 
diff --git a/src/Layout.h b/src/Layout.h
index c8f08439f5..421ab239fd 100644
--- a/src/Layout.h
+++ b/src/Layout.h
@@ -22,7 +22,6 @@
 
 #include <map>
 #include <set>
-#include <string>
 
 namespace lyx {
 
diff --git a/src/LayoutFile.h b/src/LayoutFile.h
index 87548187ed..ad7effdab6 100644
--- a/src/LayoutFile.h
+++ b/src/LayoutFile.h
@@ -15,8 +15,6 @@
 
 #include "TextClass.h"
 
-#include "support/strfwd.h"
-
 #include <string>
 #include <vector>
 
diff --git a/src/LyX.h b/src/LyX.h
index c35464e210..b7c71ce660 100644
--- a/src/LyX.h
+++ b/src/LyX.h
@@ -14,8 +14,7 @@
 #ifndef LYX_H
 #define LYX_H
 
-#include "support/strfwd.h"
-
+#include <string>
 #include <vector>
 
 namespace lyx {
diff --git a/src/LyXRC.h b/src/LyXRC.h
index a8b4b04452..8c34712d90 100644
--- a/src/LyXRC.h
+++ b/src/LyXRC.h
@@ -22,7 +22,6 @@
 #include "update_flags.h"
 
 #include "support/Length.h"
-#include "support/strfwd.h"
 #include "support/userinfo.h"
 
 #include <map>
diff --git a/src/LyXVC.h b/src/LyXVC.h
index fd22357017..48e544808f 100644
--- a/src/LyXVC.h
+++ b/src/LyXVC.h
@@ -15,8 +15,6 @@
 #include "support/docstring.h"
 #include "support/unique_ptr.h"
 
-#include <string>
-
 
 namespace lyx {
 
diff --git a/src/MetricsInfo.h b/src/MetricsInfo.h
index 6f1d404822..48d313ba71 100644
--- a/src/MetricsInfo.h
+++ b/src/MetricsInfo.h
@@ -17,7 +17,6 @@
 #include "ColorCode.h"
 #include "FontInfo.h"
 
-#include "support/strfwd.h"
 #include "support/Changer.h"
 
 #include "insets/Inset.h"
diff --git a/src/PDFOptions.cpp b/src/PDFOptions.cpp
index c3d057eba8..6a7c80144a 100644
--- a/src/PDFOptions.cpp
+++ b/src/PDFOptions.cpp
@@ -26,7 +26,6 @@
 #include "support/lstrings.h"
 
 #include <sstream>
-#include <string>
 #include <algorithm>
 
 using namespace std;
diff --git a/src/Paragraph.h b/src/Paragraph.h
index 0de720e2d8..467054499c 100644
--- a/src/Paragraph.h
+++ b/src/Paragraph.h
@@ -19,7 +19,6 @@
 #include "LayoutEnums.h"
 #include "SpellChecker.h"
 
-#include "support/strfwd.h"
 #include "support/types.h"
 
 #include "insets/InsetCode.h"
diff --git a/src/ParagraphParameters.h b/src/ParagraphParameters.h
index 6f5b4f1b3f..540ea95679 100644
--- a/src/ParagraphParameters.h
+++ b/src/ParagraphParameters.h
@@ -18,7 +18,6 @@
 #include "Spacing.h"
 
 #include "support/types.h"
-#include "support/strfwd.h"
 #include "support/Length.h"
 
 
diff --git a/src/PersonalWordList.h b/src/PersonalWordList.h
index 0194bbcbe6..9abb3fd146 100644
--- a/src/PersonalWordList.h
+++ b/src/PersonalWordList.h
@@ -12,7 +12,6 @@
 #ifndef PERSONAL_WORD_LIST_H
 #define PERSONAL_WORD_LIST_H
 
-#include "support/strfwd.h"
 #include "support/docstring_list.h"
 #include "support/FileName.h"
 
diff --git a/src/Spacing.h b/src/Spacing.h
index 7311f792b5..d394b28b2b 100644
--- a/src/Spacing.h
+++ b/src/Spacing.h
@@ -12,8 +12,6 @@
 #ifndef SPACING_H
 #define SPACING_H
 
-#include "support/strfwd.h"
-
 #include <string>
 
 namespace lyx {
diff --git a/src/SpellChecker.h b/src/SpellChecker.h
index 58e5de6bd2..fe8cb9dfc0 100644
--- a/src/SpellChecker.h
+++ b/src/SpellChecker.h
@@ -13,7 +13,7 @@
 #ifndef SPELL_BASE_H
 #define SPELL_BASE_H
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 #include <vector>
 
 
diff --git a/src/Statistics.h b/src/Statistics.h
index 195af0382c..4ccd276752 100644
--- a/src/Statistics.h
+++ b/src/Statistics.h
@@ -12,7 +12,7 @@
 #ifndef STATISTICS_H
 #define STATISTICS_H
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 #include "support/types.h"
 
 namespace lyx {
diff --git a/src/TextClass.h b/src/TextClass.h
index 7626dc329d..ef5ed7789e 100644
--- a/src/TextClass.h
+++ b/src/TextClass.h
@@ -26,7 +26,6 @@
 #include <list>
 #include <map>
 #include <set>
-#include <string>
 #include <vector>
 
 #ifdef ERROR
diff --git a/src/Thesaurus.h b/src/Thesaurus.h
index 9c13b044cb..b85c81621c 100644
--- a/src/Thesaurus.h
+++ b/src/Thesaurus.h
@@ -13,7 +13,7 @@
 #ifndef THESAURUS_H
 #define THESAURUS_H
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 
 #include <map>
 #include <vector>
diff --git a/src/TocBackend.h b/src/TocBackend.h
index 68eb825c6d..eefe7873c6 100644
--- a/src/TocBackend.h
+++ b/src/TocBackend.h
@@ -21,7 +21,6 @@
 #include "Toc.h"
 #include "TocBuilder.h"
 
-#include "support/strfwd.h"
 #include "support/unique_ptr.h"
 
 
diff --git a/src/TocBuilder.h b/src/TocBuilder.h
index eca655ca16..af9c41cb24 100644
--- a/src/TocBuilder.h
+++ b/src/TocBuilder.h
@@ -14,7 +14,7 @@
 
 #include "Toc.h"
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 
 #include <stack>
 
diff --git a/src/frontends/Application.h b/src/frontends/Application.h
index 4d2d249b23..f52b124e2c 100644
--- a/src/frontends/Application.h
+++ b/src/frontends/Application.h
@@ -15,7 +15,7 @@
 #include "FuncCode.h"
 #include "update_flags.h"
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 
 #include <functional>
 
diff --git a/src/frontends/Clipboard.h b/src/frontends/Clipboard.h
index 5e16a26bbf..13066eb279 100644
--- a/src/frontends/Clipboard.h
+++ b/src/frontends/Clipboard.h
@@ -14,8 +14,6 @@
 #ifndef BASE_CLIPBOARD_H
 #define BASE_CLIPBOARD_H
 
-#include "support/strfwd.h"
-
 namespace lyx {
 
 class Cursor;
diff --git a/src/frontends/Delegates.h b/src/frontends/Delegates.h
index c50df6b33f..715505edc6 100644
--- a/src/frontends/Delegates.h
+++ b/src/frontends/Delegates.h
@@ -12,7 +12,7 @@
 #ifndef DELEGATES_H
 #define DELEGATES_H
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 
 namespace lyx {
 
diff --git a/src/frontends/FontLoader.h b/src/frontends/FontLoader.h
index e876e78200..c59885b77e 100644
--- a/src/frontends/FontLoader.h
+++ b/src/frontends/FontLoader.h
@@ -12,7 +12,7 @@
 #ifndef FONTLOADER_H
 #define FONTLOADER_H
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 
 namespace lyx {
 
diff --git a/src/frontends/FontMetrics.h b/src/frontends/FontMetrics.h
index c9a1d86cda..28e3dec4dd 100644
--- a/src/frontends/FontMetrics.h
+++ b/src/frontends/FontMetrics.h
@@ -16,7 +16,7 @@
 
 
 #include "support/mute_warning.h"
-#include "support/strfwd.h"
+#include "support/docstring.h"
 
 #include <vector>
 
diff --git a/src/frontends/Painter.h b/src/frontends/Painter.h
index 60953341af..d408ca68b2 100644
--- a/src/frontends/Painter.h
+++ b/src/frontends/Painter.h
@@ -13,7 +13,7 @@
 #ifndef PAINTER_H
 #define PAINTER_H
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 #include "support/types.h"
 
 namespace lyx {
diff --git a/src/frontends/Selection.h b/src/frontends/Selection.h
index 931cb4470e..1aba5bfdd2 100644
--- a/src/frontends/Selection.h
+++ b/src/frontends/Selection.h
@@ -14,7 +14,7 @@
 #ifndef SELECTION_H
 #define SELECTION_H
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 
 namespace lyx {
 namespace frontend {
diff --git a/src/frontends/alert.h b/src/frontends/alert.h
index a4556ca2d4..dd1318614f 100644
--- a/src/frontends/alert.h
+++ b/src/frontends/alert.h
@@ -12,7 +12,7 @@
 #ifndef LYX_ALERT_H
 #define LYX_ALERT_H
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 
 
 namespace lyx {
diff --git a/src/frontends/qt/CategorizedCombo.h b/src/frontends/qt/CategorizedCombo.h
index 51bdb4ff07..f2a19a69c2 100644
--- a/src/frontends/qt/CategorizedCombo.h
+++ b/src/frontends/qt/CategorizedCombo.h
@@ -17,8 +17,6 @@
 #ifndef LYX_CATEGORIZEDCOMBO_H
 #define LYX_CATEGORIZEDCOMBO_H
 
-#include "support/strfwd.h"
-
 #include <QComboBox>
 
 
diff --git a/src/frontends/qt/Dialog.h b/src/frontends/qt/Dialog.h
index 928513c3fe..b778f18755 100644
--- a/src/frontends/qt/Dialog.h
+++ b/src/frontends/qt/Dialog.h
@@ -16,8 +16,6 @@
 
 #include "insets/InsetCode.h"
 
-#include "support/strfwd.h"
-
 #include <QString>
 
 class QSettings;
diff --git a/src/frontends/qt/FindAndReplace.h b/src/frontends/qt/FindAndReplace.h
index 07c03eab0f..cb4691a07b 100644
--- a/src/frontends/qt/FindAndReplace.h
+++ b/src/frontends/qt/FindAndReplace.h
@@ -18,7 +18,6 @@
 #include "ui_FindAndReplaceUi.h"
 #include "support/docstring.h"
 
-#include <string>
 
 namespace lyx {
 
diff --git a/src/frontends/qt/GuiCitation.cpp b/src/frontends/qt/GuiCitation.cpp
index 1800543d4a..8c3be320ad 100644
--- a/src/frontends/qt/GuiCitation.cpp
+++ b/src/frontends/qt/GuiCitation.cpp
@@ -49,7 +49,6 @@
 
 #include <algorithm>
 #include <regex>
-#include <string>
 #include <vector>
 
 using namespace std;
diff --git a/src/frontends/qt/GuiDelimiter.cpp b/src/frontends/qt/GuiDelimiter.cpp
index 3d064288f5..3cb70449f6 100644
--- a/src/frontends/qt/GuiDelimiter.cpp
+++ b/src/frontends/qt/GuiDelimiter.cpp
@@ -34,7 +34,6 @@
 #include <QScrollBar>
 
 #include <map>
-#include <string>
 
 using namespace std;
 
diff --git a/src/frontends/qt/GuiDelimiter.h b/src/frontends/qt/GuiDelimiter.h
index e0450a296d..f36ecd10ee 100644
--- a/src/frontends/qt/GuiDelimiter.h
+++ b/src/frontends/qt/GuiDelimiter.h
@@ -12,6 +12,8 @@
 #ifndef GUIDELIMITERDIALOG_H
 #define GUIDELIMITERDIALOG_H
 
+#include "support/docstring.h"
+
 #include "GuiDialog.h"
 
 #include "ui_DelimiterUi.h"
diff --git a/src/frontends/qt/GuiSymbols.h b/src/frontends/qt/GuiSymbols.h
index 260ce53a74..775969012b 100644
--- a/src/frontends/qt/GuiSymbols.h
+++ b/src/frontends/qt/GuiSymbols.h
@@ -12,11 +12,12 @@
 #ifndef GUISYMBOLSDIALOG_H
 #define GUISYMBOLSDIALOG_H
 
+#include "support/docstring.h"
+
 #include "DialogView.h"
 #include "ui_SymbolsUi.h"
 
 #include <map>
-#include <string>
 #include <vector>
 
 namespace lyx {
diff --git a/src/frontends/qt/GuiToolbar.h b/src/frontends/qt/GuiToolbar.h
index 23ee9610d1..1b780b6bbb 100644
--- a/src/frontends/qt/GuiToolbar.h
+++ b/src/frontends/qt/GuiToolbar.h
@@ -20,8 +20,6 @@
 #include <QToolBar>
 #include <QToolButton>
 
-#include "support/strfwd.h"
-
 class QSettings;
 
 namespace lyx {
diff --git a/src/frontends/qt/GuiView.h b/src/frontends/qt/GuiView.h
index b7726e0230..7ff366c3b4 100644
--- a/src/frontends/qt/GuiView.h
+++ b/src/frontends/qt/GuiView.h
@@ -17,8 +17,6 @@
 
 #include "frontends/Delegates.h"
 
-#include "support/strfwd.h"
-
 #include <QMainWindow>
 #include <QLabel>
 #include <QMenu>
diff --git a/src/frontends/qt/InsetParamsDialog.h b/src/frontends/qt/InsetParamsDialog.h
index 2683a4da83..cab2c5edf9 100644
--- a/src/frontends/qt/InsetParamsDialog.h
+++ b/src/frontends/qt/InsetParamsDialog.h
@@ -12,6 +12,8 @@
 #ifndef INSET_PARAMS_DIALOG_H
 #define INSET_PARAMS_DIALOG_H
 
+#include "support/docstring.h"
+
 #include "DialogView.h"
 #include "ui_InsetParamsUi.h"
 
diff --git a/src/frontends/qt/InsetParamsWidget.h b/src/frontends/qt/InsetParamsWidget.h
index 0811ca5e49..8a0fb98fd5 100644
--- a/src/frontends/qt/InsetParamsWidget.h
+++ b/src/frontends/qt/InsetParamsWidget.h
@@ -16,7 +16,7 @@
 
 #include "FuncCode.h"
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 
 #include <QWidget>
 
diff --git a/src/frontends/qt/LayoutBox.h b/src/frontends/qt/LayoutBox.h
index bbccb74ae8..90dde03449 100644
--- a/src/frontends/qt/LayoutBox.h
+++ b/src/frontends/qt/LayoutBox.h
@@ -16,7 +16,7 @@
 #ifndef LYX_LAYOUT_BOX_H
 #define LYX_LAYOUT_BOX_H
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 
 #include <QComboBox>
 
diff --git a/src/graphics/GraphicsTypes.h b/src/graphics/GraphicsTypes.h
index 90d390cae1..a0625a4a42 100644
--- a/src/graphics/GraphicsTypes.h
+++ b/src/graphics/GraphicsTypes.h
@@ -15,9 +15,6 @@
 #ifndef GRAPHICSTYPES_H
 #define GRAPHICSTYPES_H
 
-#include "support/strfwd.h"
-
-
 namespace lyx {
 namespace graphics {
 
diff --git a/src/graphics/PreviewImage.h b/src/graphics/PreviewImage.h
index 6d26748092..c36c607a11 100644
--- a/src/graphics/PreviewImage.h
+++ b/src/graphics/PreviewImage.h
@@ -12,7 +12,7 @@
 #ifndef PREVIEWIMAGE_H
 #define PREVIEWIMAGE_H
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 
 namespace lyx {
 
diff --git a/src/insets/Inset.h b/src/insets/Inset.h
index 336843d41a..19ca818073 100644
--- a/src/insets/Inset.h
+++ b/src/insets/Inset.h
@@ -24,7 +24,6 @@
 #include "RowFlags.h"
 
 #include "support/docstring.h"
-#include "support/strfwd.h"
 #include "support/types.h"
 
 #include <climits>
diff --git a/src/insets/InsetCommandParams.h b/src/insets/InsetCommandParams.h
index 2faaf3f545..bfb8b04cf6 100644
--- a/src/insets/InsetCommandParams.h
+++ b/src/insets/InsetCommandParams.h
@@ -18,7 +18,6 @@
 
 #include "support/docstring.h"
 
-#include <string>
 #include <vector>
 #include <map>
 
diff --git a/src/insets/InsetLayout.h b/src/insets/InsetLayout.h
index 21f5095d1a..eb1bb1df86 100644
--- a/src/insets/InsetLayout.h
+++ b/src/insets/InsetLayout.h
@@ -20,7 +20,6 @@
 #include "support/docstring.h"
 
 #include <set>
-#include <string>
 
 namespace lyx {
 
diff --git a/src/lyxfind.h b/src/lyxfind.h
index b700e0ce1a..84d2400e2b 100644
--- a/src/lyxfind.h
+++ b/src/lyxfind.h
@@ -16,8 +16,6 @@
 #ifndef LYXFIND_H
 #define LYXFIND_H
 
-#include "support/strfwd.h"
-
 // FIXME
 #include "support/docstring.h"
 
diff --git a/src/mathed/InsetMathDecoration.cpp b/src/mathed/InsetMathDecoration.cpp
index 960b6b78ab..92140368c3 100644
--- a/src/mathed/InsetMathDecoration.cpp
+++ b/src/mathed/InsetMathDecoration.cpp
@@ -30,7 +30,6 @@
 #include "support/lstrings.h"
 
 #include <algorithm>
-#include <ostream>
 
 using namespace lyx::support;
 
diff --git a/src/mathed/InsetMathMatrix.h b/src/mathed/InsetMathMatrix.h
index 6aa44c1d5c..3b752c22b9 100644
--- a/src/mathed/InsetMathMatrix.h
+++ b/src/mathed/InsetMathMatrix.h
@@ -13,7 +13,6 @@
 #define MATH_MATRIXINSET_H
 
 #include "InsetMathGrid.h"
-#include "support/strfwd.h"
 
 
 namespace lyx {
diff --git a/src/mathed/MathAutoCorrect.h b/src/mathed/MathAutoCorrect.h
index a782d678ee..3a4a25a811 100644
--- a/src/mathed/MathAutoCorrect.h
+++ b/src/mathed/MathAutoCorrect.h
@@ -12,7 +12,7 @@
 #ifndef MATHAUTOCORRECT_H
 #define MATHAUTOCORRECT_H
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 
 namespace lyx {
 
diff --git a/src/mathed/MathClass.cpp b/src/mathed/MathClass.cpp
index 1d352cd746..f2d015ada5 100644
--- a/src/mathed/MathClass.cpp
+++ b/src/mathed/MathClass.cpp
@@ -20,8 +20,6 @@
 #include "support/docstring.h"
 #include "support/lassert.h"
 
-#include <ostream>
-
 using namespace std;
 
 namespace lyx {
diff --git a/src/mathed/MathClass.h b/src/mathed/MathClass.h
index af4f884cca..f78ea2bae3 100644
--- a/src/mathed/MathClass.h
+++ b/src/mathed/MathClass.h
@@ -12,7 +12,7 @@
 #ifndef MATH_CLASS_H
 #define MATH_CLASS_H
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 
 namespace lyx {
 
diff --git a/src/mathed/MathData.h b/src/mathed/MathData.h
index 6ff477f592..dc04a9bb4c 100644
--- a/src/mathed/MathData.h
+++ b/src/mathed/MathData.h
@@ -21,8 +21,6 @@
 #include "Dimension.h"
 #include "OutputEnums.h"
 
-#include "support/strfwd.h"
-
 #include <cstddef>
 #include <vector>
 
diff --git a/src/mathed/MathExtern.h b/src/mathed/MathExtern.h
index 2544ebf811..a1a9020ac9 100644
--- a/src/mathed/MathExtern.h
+++ b/src/mathed/MathExtern.h
@@ -12,7 +12,7 @@
 #ifndef MATH_EXTERN_H
 #define MATH_EXTERN_H
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 
 namespace lyx {
 
diff --git a/src/mathed/MathFactory.h b/src/mathed/MathFactory.h
index b6fdb5044a..d653c54fb3 100644
--- a/src/mathed/MathFactory.h
+++ b/src/mathed/MathFactory.h
@@ -14,8 +14,6 @@
 
 #include "MathParser.h"
 
-#include "support/strfwd.h"
-
 #include <map>
 
 namespace lyx {
diff --git a/src/mathed/MathStream.cpp b/src/mathed/MathStream.cpp
index a9d6e0498e..6c0bb31940 100644
--- a/src/mathed/MathStream.cpp
+++ b/src/mathed/MathStream.cpp
@@ -25,7 +25,6 @@
 
 #include <algorithm>
 #include <cstring>
-#include <ostream>
 #include <FontInfo.h>
 
 using namespace std;
diff --git a/src/mathed/MathStream.h b/src/mathed/MathStream.h
index c49384cdda..bd0e90c3f5 100644
--- a/src/mathed/MathStream.h
+++ b/src/mathed/MathStream.h
@@ -19,7 +19,6 @@
 #include "texstream.h"
 
 #include "support/Changer.h"
-#include "support/strfwd.h"
 
 
 namespace lyx {
diff --git a/src/mathed/MathSupport.h b/src/mathed/MathSupport.h
index 1f83ffb6f2..d3766c693e 100644
--- a/src/mathed/MathSupport.h
+++ b/src/mathed/MathSupport.h
@@ -14,7 +14,7 @@
 #define MATH_SUPPORT_H
 
 #include "MathParser_flags.h"
-#include "support/strfwd.h"
+#include "support/docstring.h"
 
 namespace lyx {
 
diff --git a/src/output_docbook.h b/src/output_docbook.h
index 1fd8d5e896..aaf17559f2 100644
--- a/src/output_docbook.h
+++ b/src/output_docbook.h
@@ -28,7 +28,6 @@
 #include "ParagraphList.h"
 
 #include "support/docstream.h"
-#include "support/strfwd.h"
 #include "xml.h"
 
 namespace lyx {
diff --git a/src/output_plaintext.h b/src/output_plaintext.h
index 8b2e4f9d1c..63519cf338 100644
--- a/src/output_plaintext.h
+++ b/src/output_plaintext.h
@@ -12,7 +12,7 @@
 #ifndef OUTPUT_PLAINTEXT_H
 #define OUTPUT_PLAINTEXT_H
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 #include "support/types.h"
 
 #include <climits>
diff --git a/src/output_xhtml.h b/src/output_xhtml.h
index 3877fb0c7b..930798b777 100644
--- a/src/output_xhtml.h
+++ b/src/output_xhtml.h
@@ -14,7 +14,6 @@
 
 #include "LayoutEnums.h"
 
-#include "support/strfwd.h"
 #include "xml.h"
 
 
diff --git a/src/support/ConsoleApplication.h b/src/support/ConsoleApplication.h
index 2b8ed2b80b..4c025cdb8f 100644
--- a/src/support/ConsoleApplication.h
+++ b/src/support/ConsoleApplication.h
@@ -11,7 +11,7 @@
 #ifndef CONSOLEAPPLICATION_H
 #define CONSOLEAPPLICATION_H
 
-#include "support/strfwd.h"
+#include <string>
 
 namespace lyx {
 
diff --git a/src/support/FileName.h b/src/support/FileName.h
index 35f182e428..4611ee8b6f 100644
--- a/src/support/FileName.h
+++ b/src/support/FileName.h
@@ -13,7 +13,6 @@
 #define FILENAME_H
 
 #include "support/os.h"
-#include "support/strfwd.h"
 
 #include <ctime>
 #include <set>
diff --git a/src/support/ForkedCalls.h b/src/support/ForkedCalls.h
index e64e53c6df..734f193b87 100644
--- a/src/support/ForkedCalls.h
+++ b/src/support/ForkedCalls.h
@@ -15,7 +15,7 @@
 #define FORKEDCALLS_H
 
 #include "support/signals.h"
-#include "support/strfwd.h"
+#include "support/docstring.h"
 
 #ifdef HAVE_SYS_TYPES_H
 # include <sys/types.h>
diff --git a/src/support/Length.h b/src/support/Length.h
index cb612b6135..0a4e1adb1c 100644
--- a/src/support/Length.h
+++ b/src/support/Length.h
@@ -15,7 +15,7 @@
 #ifndef LENGTH_H
 #define LENGTH_H
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 
 
 namespace lyx {
diff --git a/src/support/Lexer.h b/src/support/Lexer.h
index 96ac205aba..9ca6e1e6f7 100644
--- a/src/support/Lexer.h
+++ b/src/support/Lexer.h
@@ -17,8 +17,7 @@
 #ifndef LEXER_H
 #define LEXER_H
 
-#include "support/strfwd.h"
-#include <string>
+#include "support/docstring.h"
 
 namespace lyx {
 
diff --git a/src/support/Messages.h b/src/support/Messages.h
index 9f33d45e6f..e4670e4f6f 100644
--- a/src/support/Messages.h
+++ b/src/support/Messages.h
@@ -14,7 +14,6 @@
 #include "support/docstring.h"
 
 #include <map>
-#include <string>
 
 namespace lyx {
 
diff --git a/src/support/ProgressInterface.h b/src/support/ProgressInterface.h
index 4a9a1edb68..2f411abcfe 100644
--- a/src/support/ProgressInterface.h
+++ b/src/support/ProgressInterface.h
@@ -12,7 +12,7 @@
 #ifndef LYX_SUPPORT_PROGRESSINTERFACE_H
 #define LYX_SUPPORT_PROGRESSINTERFACE_H
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 
 class QString;
 
diff --git a/src/support/Systemcall.h b/src/support/Systemcall.h
index 537a701afa..d73a928097 100644
--- a/src/support/Systemcall.h
+++ b/src/support/Systemcall.h
@@ -15,8 +15,6 @@
 #ifndef SYSTEMCALL_H
 #define SYSTEMCALL_H
 
-#include "strfwd.h"
-
 namespace lyx {
 namespace support {
 
diff --git a/src/support/convert.cpp b/src/support/convert.cpp
index 46de4b455c..d172469bc8 100644
--- a/src/support/convert.cpp
+++ b/src/support/convert.cpp
@@ -14,7 +14,6 @@
 #include "support/convert.h"
 #include "support/docstring.h"
 
-#include <string>
 #include <sstream>
 //needed for Mac OSX 10.5.2 Leopard
 #include <cstdlib>
diff --git a/src/support/convert.h b/src/support/convert.h
index ac0fd2903a..e49f5bd880 100644
--- a/src/support/convert.h
+++ b/src/support/convert.h
@@ -16,7 +16,7 @@
 #ifndef CONVERT_H
 #define CONVERT_H
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 
 namespace lyx {
 
diff --git a/src/support/counter_reps.h b/src/support/counter_reps.h
index 59305dc427..bafec250f9 100644
--- a/src/support/counter_reps.h
+++ b/src/support/counter_reps.h
@@ -17,7 +17,7 @@
 #ifndef COUNTER_REPS_H
 #define COUNTER_REPS_H
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 
 namespace lyx {
 
diff --git a/src/support/debug.h b/src/support/debug.h
index f823ee156e..6ab59b5538 100644
--- a/src/support/debug.h
+++ b/src/support/debug.h
@@ -15,7 +15,7 @@
 #ifndef LYXDEBUG_H
 #define LYXDEBUG_H
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 
 // Forward definitions do not work with libc++
 // but ios_base has already been defined in strfwd
diff --git a/src/support/docstring.h b/src/support/docstring.h
index 2c2901bf9d..2a760eacee 100644
--- a/src/support/docstring.h
+++ b/src/support/docstring.h
@@ -13,12 +13,71 @@
 #ifndef LYX_DOCSTRING_H
 #define LYX_DOCSTRING_H
 
-#include "support/strfwd.h"
+#ifdef USE_WCHAR_T
+
+// Prefer this if possible because GNU libstdc++ has usable
+// std::ctype<wchar_t> locale facets but not
+// std::ctype<boost::uint32_t>. gcc older than 3.4 is also missing
+// usable std::char_traits<boost::uint32_t>.
+namespace lyx { typedef wchar_t char_type; }
+
+#else
+
+#include <cstdint>
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1600)
+namespace lyx { typedef uint32_t char_type; }
+#include "support/numpunct_lyx_char_type.h" // implementation for our char_type needed
+#else
+namespace lyx { typedef std::uint32_t char_type; }
+#endif
+
+#endif
 
 #include <string>
 
 namespace lyx {
 
+/**
+ * String type for storing the main text in UCS4 encoding.
+ * Use std::string only in cases 7-bit ASCII is to be manipulated
+ * within the variable.
+ */
+typedef std::basic_string<char_type, std::char_traits<char_type>,
+	std::allocator<char_type> > docstring;
+
+/// Base class for UCS4 input streams
+typedef std::basic_istream<char_type, std::char_traits<char_type> > idocstream;
+
+/// Base class for UCS4 output streams
+typedef std::basic_ostream<char_type, std::char_traits<char_type> > odocstream;
+
+/// UCS4 output stringstream
+typedef std::basic_ostringstream<char_type, std::char_traits<char_type>, std::allocator<char_type> > odocstringstream;
+
+#if ! defined(USE_WCHAR_T)
+extern odocstream & operator<<(odocstream &, char);
+#endif
+
+// defined in lstrings.cpp
+docstring const & empty_docstring();
+std::string const & empty_string();
+// defined in docstring.cpp
+bool operator==(docstring const &, char const *);
+
+#ifdef STD_STRING_USES_COW
+template<typename Char> class trivial_string;
+typedef trivial_string<char> trivstring;
+typedef trivial_string<char_type> trivdocstring;
+#else
+typedef std::string trivstring;
+typedef docstring trivdocstring;
+#endif
+
+} // namespace lyx
+
+namespace lyx {
+
 /// Creates a docstring from a C string of ASCII characters
 docstring const from_ascii(char const *);
 
diff --git a/src/support/filetools.h b/src/support/filetools.h
index ceb1da62be..14aea9c216 100644
--- a/src/support/filetools.h
+++ b/src/support/filetools.h
@@ -15,7 +15,6 @@
 #include "support/docstring.h"
 
 #include <utility>
-#include <string>
 #include <set>
 
 namespace lyx {
diff --git a/src/support/gettext.h b/src/support/gettext.h
index 317feec82e..19ba3bf0fa 100644
--- a/src/support/gettext.h
+++ b/src/support/gettext.h
@@ -13,7 +13,7 @@
 #ifndef GETTEXT_H
 #define GETTEXT_H
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 
 
 namespace lyx {
diff --git a/src/support/lassert.h b/src/support/lassert.h
index 58f299f7af..2d53a3b52f 100644
--- a/src/support/lassert.h
+++ b/src/support/lassert.h
@@ -15,7 +15,7 @@
 
 #ifdef __cplusplus
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 
 namespace lyx {
 
diff --git a/src/support/lyxtime.h b/src/support/lyxtime.h
index 05cbc50841..366ee221a1 100644
--- a/src/support/lyxtime.h
+++ b/src/support/lyxtime.h
@@ -14,9 +14,8 @@
 #define LYXTIME_H
 
 #include <time.h>
-#include <string>
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 
 
 namespace lyx {
diff --git a/src/support/os.h b/src/support/os.h
index 20b4e96346..1b664e4444 100644
--- a/src/support/os.h
+++ b/src/support/os.h
@@ -14,7 +14,7 @@
 #ifndef OS_H
 #define OS_H
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 #include <cstddef>
 
 
diff --git a/src/support/qstring_helpers.h b/src/support/qstring_helpers.h
index 905343e77d..bb608b2334 100644
--- a/src/support/qstring_helpers.h
+++ b/src/support/qstring_helpers.h
@@ -12,7 +12,7 @@
 #ifndef QSTRING_HELPERS_H
 #define QSTRING_HELPERS_H
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 
 class QString;
 
diff --git a/src/support/strfwd.h b/src/support/strfwd.h
index eef3a83a0c..7a943009e8 100644
--- a/src/support/strfwd.h
+++ b/src/support/strfwd.h
@@ -13,102 +13,5 @@
 #ifndef STRFWD_H
 #define STRFWD_H
 
-#ifdef USE_WCHAR_T
-
-// Prefer this if possible because GNU libstdc++ has usable
-// std::ctype<wchar_t> locale facets but not
-// std::ctype<boost::uint32_t>. gcc older than 3.4 is also missing
-// usable std::char_traits<boost::uint32_t>.
-namespace lyx { typedef wchar_t char_type; }
-
-#else
-
-#include <cstdint>
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1600)
-namespace lyx { typedef uint32_t char_type; }
-#include "support/numpunct_lyx_char_type.h" // implementation for our char_type needed
-#else
-namespace lyx { typedef std::uint32_t char_type; }
-#endif
-
-#endif
-
-// Forward definitions do not work with libc++
-// For gcc5 with the new std::string ABI forward declarations would work in
-// principle, but I am not sure whether we want non-standard
-// "namespace __cxx11" in our sources.
-#if defined(USE_LLVM_LIBCPP) || defined(USE_GLIBCXX_CXX11_ABI)
-#include <string>
-#else
-
-namespace std {
-
-template<typename Alloc> class allocator;
-
-template<typename Char> struct char_traits;
-template<> struct char_traits<char>;
-#ifdef USE_WCHAR_T
-template<> struct char_traits<wchar_t>;
-#endif
-
-template<typename Char, typename Traits, typename Alloc> class basic_string;
-typedef basic_string<char, char_traits<char>, allocator<char> > string;
-
-template<class Char, class Traits> class basic_istream;
-template<class Char, class Traits> class basic_ostream;
-template<class Char, class Traits, class Allocator> class basic_ostringstream;
-
-typedef basic_istream<char, char_traits<char> > istream;
-typedef basic_ostream<char, char_traits<char> > ostream;
-typedef basic_ostringstream<char, char_traits<char>, allocator<char> > ostringstream;
-
-} // namespace std
-
-#endif
-
-
-
-
-
-namespace lyx {
-
-/**
- * String type for storing the main text in UCS4 encoding.
- * Use std::string only in cases 7-bit ASCII is to be manipulated
- * within the variable.
- */
-typedef std::basic_string<char_type, std::char_traits<char_type>,
-	std::allocator<char_type> > docstring;
-
-/// Base class for UCS4 input streams
-typedef std::basic_istream<char_type, std::char_traits<char_type> > idocstream;
-
-/// Base class for UCS4 output streams
-typedef std::basic_ostream<char_type, std::char_traits<char_type> > odocstream;
-
-/// UCS4 output stringstream
-typedef std::basic_ostringstream<char_type, std::char_traits<char_type>, std::allocator<char_type> > odocstringstream;
-
-#if ! defined(USE_WCHAR_T)
-extern odocstream & operator<<(odocstream &, char);
-#endif
-
-// defined in lstrings.cpp
-docstring const & empty_docstring();
-std::string const & empty_string();
-// defined in docstring.cpp
-bool operator==(docstring const &, char const *);
-
-#ifdef STD_STRING_USES_COW
-template<typename Char> class trivial_string;
-typedef trivial_string<char> trivstring;
-typedef trivial_string<char_type> trivdocstring;
-#else
-typedef std::string trivstring;
-typedef docstring trivdocstring;
-#endif
-
-} // namespace lyx
 
 #endif
diff --git a/src/support/textutils.h b/src/support/textutils.h
index 64498fab70..1409b0a2fb 100644
--- a/src/support/textutils.h
+++ b/src/support/textutils.h
@@ -15,9 +15,6 @@
 #ifndef TEXTUTILS_H
 #define TEXTUTILS_H
 
-#include "support/strfwd.h"
-
-
 namespace lyx {
 
 /// return true if the char is a line separator
diff --git a/src/support/trivstring.cpp b/src/support/trivstring.cpp
index d2325cbbab..c5102526a8 100644
--- a/src/support/trivstring.cpp
+++ b/src/support/trivstring.cpp
@@ -15,7 +15,6 @@
 
 #ifdef STD_STRING_USES_COW
 #include <algorithm>
-#include <ostream>
 #include <stdexcept>
 
 using namespace std;
diff --git a/src/support/trivstring.h b/src/support/trivstring.h
index 6b935eee02..3b47f6dc85 100644
--- a/src/support/trivstring.h
+++ b/src/support/trivstring.h
@@ -12,8 +12,6 @@
 #ifndef LYX_TRIVSTRING_H
 #define LYX_TRIVSTRING_H
 
-#include "support/strfwd.h"
-
 #ifdef STD_STRING_USES_COW
 #include <cstdlib>
 
diff --git a/src/support/unicode.h b/src/support/unicode.h
index 74c37bdf4a..46cea696cc 100644
--- a/src/support/unicode.h
+++ b/src/support/unicode.h
@@ -14,11 +14,10 @@
 #ifndef LYX_SUPPORT_UNICODE_H
 #define LYX_SUPPORT_UNICODE_H
 
-#include "support/strfwd.h"
+#include "support/docstring.h"
 #include "support/unique_ptr.h"
 
 #include <cstddef>
-#include <string>
 #include <vector>
 
 
diff --git a/src/support/userinfo.h b/src/support/userinfo.h
index 096e8ff47b..deee3ed809 100644
--- a/src/support/userinfo.h
+++ b/src/support/userinfo.h
@@ -12,7 +12,7 @@
 #ifndef USERINFO_H
 #define USERINFO_H
 
-#include "support/strfwd.h"
+#include <string>
 
 
 namespace lyx {
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to