summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubos Lunak <l.lunak@suse.cz>2012-12-26 17:33:02 +0100
committerLubos Lunak <l.lunak@suse.cz>2012-12-26 18:43:27 +0100
commit47b17ca76bd6d0753131a5cb5760213649b3b7fa (patch)
treed043008e95e3b76f348fac0532213ab2d4cc2d95
parent32bd430f4d636b564a4cf796148705fd6ef72304 (diff)
ignore #include inside #if
-rw-r--r--connectivity/inc/pch/precompiled_file.hxx1
-rw-r--r--oox/inc/pch/precompiled_oox.hxx3
-rw-r--r--sc/inc/pch/precompiled_sc.hxx3
-rw-r--r--sd/inc/pch/precompiled_sd.hxx4
-rwxr-xr-xsolenv/bin/update_pch.sh33
-rw-r--r--svtools/inc/pch/precompiled_svt.hxx4
-rw-r--r--svx/inc/pch/precompiled_svx.hxx1
-rw-r--r--svx/inc/pch/precompiled_svxcore.hxx5
-rw-r--r--sw/inc/pch/precompiled_sw.hxx2
-rw-r--r--writerfilter/inc/pch/precompiled_writerfilter.hxx3
-rw-r--r--xmloff/inc/pch/precompiled_xo.hxx3
11 files changed, 35 insertions, 27 deletions
diff --git a/connectivity/inc/pch/precompiled_file.hxx b/connectivity/inc/pch/precompiled_file.hxx
index a98e3b9dcfc4..83eb21ac48cc 100644
--- a/connectivity/inc/pch/precompiled_file.hxx
+++ b/connectivity/inc/pch/precompiled_file.hxx
@@ -45,7 +45,6 @@
#include <cppuhelper/propshlp.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <i18npool/mslangid.hxx>
-#include <iostream>
#include <iterator>
#include <osl/diagnose.h>
#include <osl/nlsupport.h>
diff --git a/oox/inc/pch/precompiled_oox.hxx b/oox/inc/pch/precompiled_oox.hxx
index 76bf93141b3c..28a2030ac532 100644
--- a/oox/inc/pch/precompiled_oox.hxx
+++ b/oox/inc/pch/precompiled_oox.hxx
@@ -196,6 +196,7 @@
#include <com/sun/star/form/binding/XListEntrySink.hpp>
#include <com/sun/star/form/binding/XListEntrySource.hpp>
#include <com/sun/star/form/binding/XValueBinding.hpp>
+#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/XFramesSupplier.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/graphic/GraphicObject.hpp>
@@ -295,7 +296,6 @@
#include <com/sun/star/xml/sax/XLocator.hpp>
#include <comphelper/configurationhelper.hxx>
#include <comphelper/docpasswordhelper.hxx>
-#include <comphelper/genericpropertyset.hxx>
#include <comphelper/mediadescriptor.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/seqstream.hxx>
@@ -360,7 +360,6 @@
#include <vcl/cvtgrf.hxx>
#include <vcl/graph.hxx>
#include <vcl/outdev.hxx>
-#include <vcl/unohelp.hxx>
#include <vector>
#include <xmlscript/xmldlg_imexp.hxx>
diff --git a/sc/inc/pch/precompiled_sc.hxx b/sc/inc/pch/precompiled_sc.hxx
index 2668bae98d64..83b3b9bee39f 100644
--- a/sc/inc/pch/precompiled_sc.hxx
+++ b/sc/inc/pch/precompiled_sc.hxx
@@ -184,6 +184,7 @@
#include <com/sun/star/form/FormButtonType.hpp>
#include <com/sun/star/form/XFormsSupplier.hpp>
#include <com/sun/star/form/XFormsSupplier2.hpp>
+#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/FrameSearchFlag.hpp>
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/frame/XController.hpp>
@@ -530,6 +531,7 @@
#include <mdds/multi_type_vector_types.hpp>
#include <memory>
#include <numeric>
+#include <officecfg/Office/Calc.hxx>
#include <officecfg/Office/Common.hxx>
#include <osl/diagnose.h>
#include <osl/file.hxx>
@@ -673,7 +675,6 @@
#include <svx/compressgraphicdialog.hxx>
#include <svx/dataaccessdescriptor.hxx>
#include <svx/dbaexchange.hxx>
-#include <svx/dbcharsethelper.hxx>
#include <svx/dialmgr.hxx>
#include <svx/drawitem.hxx>
#include <svx/extedit.hxx>
diff --git a/sd/inc/pch/precompiled_sd.hxx b/sd/inc/pch/precompiled_sd.hxx
index 1f93c0cec497..6283dbcff9e1 100644
--- a/sd/inc/pch/precompiled_sd.hxx
+++ b/sd/inc/pch/precompiled_sd.hxx
@@ -7,7 +7,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include "svtools/colrdlg.hxx"
#include "avmedia/mediawindow.hxx"
#include "canvas/elapsedtime.hxx"
#include "com/sun/star/office/XAnnotationEnumeration.hpp"
@@ -24,6 +23,7 @@
#include "sal/log.hxx"
#include "sal/types.h"
#include "sfx2/viewfrm.hxx"
+#include "svtools/colrdlg.hxx"
#include "svtools/slidesorterbaropt.hxx"
#include "svtools/svlbitm.hxx"
#include "svtools/toolpanelopt.hxx"
@@ -187,6 +187,7 @@
#include <com/sun/star/embed/XVisualObject.hpp>
#include <com/sun/star/form/FormButtonType.hpp>
#include <com/sun/star/frame/AutoRecovery.hpp>
+#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/DispatchResultState.hpp>
#include <com/sun/star/frame/DocumentTemplates.hpp>
#include <com/sun/star/frame/FrameAction.hpp>
@@ -196,7 +197,6 @@
#include <com/sun/star/frame/UnknownModuleException.hpp>
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/frame/XController.hpp>
-#include <com/sun/star/frame/XDesktop.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/frame/XDocumentTemplates.hpp>
diff --git a/solenv/bin/update_pch.sh b/solenv/bin/update_pch.sh
index d9bb0cbbbdfe..fdb17a7ae288 100755
--- a/solenv/bin/update_pch.sh
+++ b/solenv/bin/update_pch.sh
@@ -48,7 +48,32 @@ for x in $headers; do
elif ! test -f "$root/$file".cxx ; then
echo No file $file in $module/$makefile >&2
else
- cat "$root/$file".cxx | grep -e '^\s*#include' | sed 's/\(#include [<"][^>"]*[>"]\).*/\1/' | sed 's#\.\./##g#' >>$tmpfile
+
+function list_file_includes()
+(
+ ifdepth=0
+ # filter out only preprocessor lines, get the first and second "words" after the #,
+ # also replace " with @ (would cause trouble when doing echo of the line)
+ cat "$1" | grep '^\s*#' | sed 's/^\s*#/#/' | sed 's/^\(#\w*\s+\w*\)\s+.*/\1/' | sed 's/"/@/g' | \
+ while read line; do
+ # skip everything surrounded by any #if
+ if echo "$line" | grep -q "#if" ; then
+ ifdepth=$((ifdepth + 1))
+ lastif="$line"
+ elif echo "$line" | grep -q "#endif" ; then
+ ifdepth=$((ifdepth - 1))
+ lastif="#if"
+ elif echo "$line" | grep -q "#include"; then
+ if test $ifdepth -eq 0; then
+ echo $line | sed 's/@/"/g'
+ else
+ echo "#include in $lastif : $line" | sed 's/@/"/g' >&2
+ fi
+ fi
+ done
+)
+
+ list_file_includes "$root/$file".cxx | sed 's/\(#include [<@][^>@]*[>@]\).*/\1/' | sed 's#\.\./##g#' >>$tmpfile
fi
fi
done
@@ -97,16 +122,12 @@ function filter_ignore()
# - sores.hxx provides BMP_PLUGIN, which is redefined
# - some sources play ugly #define tricks with editeng/eeitemid.hxx
# - jerror.h and jpeglib.h are not self-contained
-# - prewin.h, postwin.h and shlobj.h are WNT-only (to be fixed in a better way)
grep -e '\.h[">]$' -e '\.hpp[">]$' -e '\.hdl[">]$' -e '\.hxx[">]$' -e '^[^\.]*>$' | \
grep -v -F -e '#include "gperffasttoken.hxx"' | \
grep -v -F -e '#include <svtools/sores.hxx>' | \
grep -v -F -e '#include <editeng/eeitemid.hxx>' | \
grep -v -F -e '#include "jerror.h"' | \
- grep -v -F -e '#include "jpeglib.h"' | \
- grep -v -F -e '#include <prewin.h>' | \
- grep -v -F -e '#include <postwin.h>' | \
- grep -v -F -e '#include <shlobj.h>'
+ grep -v -F -e '#include "jpeglib.h"'
)
# " in #include "foo" breaks echo down below, so " -> @
diff --git a/svtools/inc/pch/precompiled_svt.hxx b/svtools/inc/pch/precompiled_svt.hxx
index fa5565c8ca6f..5fd85ce1589c 100644
--- a/svtools/inc/pch/precompiled_svt.hxx
+++ b/svtools/inc/pch/precompiled_svt.hxx
@@ -7,7 +7,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include "stdio.h"
#include "com/sun/star/beans/XPropertySet.hpp"
#include "com/sun/star/document/XDocumentProperties.hpp"
#include "com/sun/star/script/Converter.hpp"
@@ -27,6 +26,7 @@
#include "rtl/ustring.hxx"
#include "sal/config.h"
#include "sal/types.h"
+#include "stdio.h"
#include "svl/filenotation.hxx"
#include "svl/inettype.hxx"
#include "svl/urihelper.hxx"
@@ -324,7 +324,6 @@
#include <osl/module.hxx>
#include <osl/mutex.hxx>
#include <osl/security.hxx>
-#include <pwd.h>
#include <rtl/bootstrap.hxx>
#include <rtl/crc.h>
#include <rtl/instance.hxx>
@@ -370,7 +369,6 @@
#include <svl/urlfilter.hxx>
#include <svl/zforlist.hxx>
#include <svl/zformat.hxx>
-#include <sys/types.h>
#include <toolkit/awt/vclxaccessiblecomponent.hxx>
#include <toolkit/awt/vclxmenu.hxx>
#include <toolkit/awt/vclxwindow.hxx>
diff --git a/svx/inc/pch/precompiled_svx.hxx b/svx/inc/pch/precompiled_svx.hxx
index 2032b6338058..06dfc00c40d5 100644
--- a/svx/inc/pch/precompiled_svx.hxx
+++ b/svx/inc/pch/precompiled_svx.hxx
@@ -106,6 +106,7 @@
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/form/FormComponentType.hpp>
#include <com/sun/star/frame/AutoRecovery.hpp>
+#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
diff --git a/svx/inc/pch/precompiled_svxcore.hxx b/svx/inc/pch/precompiled_svxcore.hxx
index a42760ffaee6..16efcaed1495 100644
--- a/svx/inc/pch/precompiled_svxcore.hxx
+++ b/svx/inc/pch/precompiled_svxcore.hxx
@@ -18,9 +18,7 @@
#include "editeng/boxitem.hxx"
#include "editeng/editobj.hxx"
#include "editeng/editstat.hxx"
-#include "editeng/editview.hxx"
#include "editeng/fhgtitem.hxx"
-#include "editeng/flditem.hxx"
#include "editeng/fontitem.hxx"
#include "editeng/forbiddencharacterstable.hxx"
#include "editeng/frmdiritem.hxx"
@@ -63,8 +61,6 @@
#include <basegfx/point/b3dpoint.hxx>
#include <basegfx/polygon/b2dlinegeometry.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
-#include <basegfx/polygon/b2dpolygonclipper.hxx>
-#include <basegfx/polygon/b2dpolygoncutandtouch.hxx>
#include <basegfx/polygon/b2dpolygontools.hxx>
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/polygon/b2dpolypolygoncutter.hxx>
@@ -598,7 +594,6 @@
#include <vcl/window.hxx>
#include <vcl/wrkwin.hxx>
#include <vector>
-#include <wchar.h>
#include <xmloff/xmlictxt.hxx>
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/inc/pch/precompiled_sw.hxx b/sw/inc/pch/precompiled_sw.hxx
index f51ad696126d..0e9126ee246b 100644
--- a/sw/inc/pch/precompiled_sw.hxx
+++ b/sw/inc/pch/precompiled_sw.hxx
@@ -165,13 +165,13 @@
#include <com/sun/star/form/XFormController.hpp>
#include <com/sun/star/form/XFormsSupplier.hpp>
#include <com/sun/star/form/XImageProducerSupplier.hpp>
+#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/DispatchHelper.hpp>
#include <com/sun/star/frame/DispatchResultState.hpp>
#include <com/sun/star/frame/FrameSearchFlag.hpp>
#include <com/sun/star/frame/UICommandDescription.hpp>
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/frame/XController.hpp>
-#include <com/sun/star/frame/XDesktop.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/frame/XFrame.hpp>
diff --git a/writerfilter/inc/pch/precompiled_writerfilter.hxx b/writerfilter/inc/pch/precompiled_writerfilter.hxx
index f746fcba8f64..f858c2f941f9 100644
--- a/writerfilter/inc/pch/precompiled_writerfilter.hxx
+++ b/writerfilter/inc/pch/precompiled_writerfilter.hxx
@@ -86,7 +86,6 @@
#include <com/sun/star/style/NumberingType.hpp>
#include <com/sun/star/style/PageStyleLayout.hpp>
#include <com/sun/star/style/ParagraphAdjust.hpp>
-#include <com/sun/star/style/TabStop.hpp>
#include <com/sun/star/style/XStyle.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
@@ -182,7 +181,6 @@
#include <osl/file.hxx>
#include <osl/module.hxx>
#include <osl/mutex.hxx>
-#include <osl/process.h>
#include <rtl/instance.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/string.hxx>
@@ -205,7 +203,6 @@
#include <tools/resmgr.hxx>
#include <tools/solar.h>
#include <tools/stream.hxx>
-#include <unotools/localfilehelper.hxx>
#include <unotools/streamwrap.hxx>
#include <unotools/ucbstreamhelper.hxx>
#include <vcl/graph.hxx>
diff --git a/xmloff/inc/pch/precompiled_xo.hxx b/xmloff/inc/pch/precompiled_xo.hxx
index 3a71ac771167..eb6059b4b5f6 100644
--- a/xmloff/inc/pch/precompiled_xo.hxx
+++ b/xmloff/inc/pch/precompiled_xo.hxx
@@ -7,7 +7,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include <osl/thread.h>
#include "com/sun/star/beans/XPropertySet.hpp"
#include "com/sun/star/beans/XPropertySetInfo.hpp"
#include "com/sun/star/text/XLineNumberingProperties.hpp"
@@ -26,7 +25,6 @@
#include <basegfx/vector/b2dvector.hxx>
#include <basegfx/vector/b3dvector.hxx>
#include <boost/bind.hpp>
-#include <boost/iterator/transform_iterator.hpp>
#include <boost/iterator_adaptors.hpp>
#include <boost/ptr_container/ptr_set.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
@@ -484,7 +482,6 @@
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/implbase3.hxx>
#include <cppuhelper/weakref.hxx>
-#include <cstdio>
#include <functional>
#include <i18npool/languagetag.hxx>
#include <i18npool/mslangid.hxx>