tdf#42949 Fix IWYU warnings in sc/inc; sc/source/filter/inc/

Found with bin/find-unneeded-includes after recent improvements
- remove UNO headers from blacklist
- remove newly found unneeded fw declarations
- fix up some not self contained headers

Change-Id: I605656bc98a64640a78d2ff4de9c7c37326033cf
Reviewed-on: https://gerrit.libreoffice.org/62264
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
diff --git a/sc/IwyuFilter_sc.yaml b/sc/IwyuFilter_sc.yaml
index 0b8fff4..e3c0a34 100644
--- a/sc/IwyuFilter_sc.yaml
+++ b/sc/IwyuFilter_sc.yaml
@@ -10,9 +10,6 @@ blacklist:
    sc/inc/AccessibleFilterMenuItem.hxx:
    # base class has to be a complete type
    - com/sun/star/accessibility/XAccessibleAction.hpp
    sc/inc/address.hxx:
    # base class has to be a complete type
    - com/sun/star/uno/Sequence.hxx
    sc/inc/addruno.hxx:
    # base class has to be a complete type
    - com/sun/star/beans/XPropertySet.hpp
@@ -79,6 +76,8 @@ blacklist:
    sc/inc/conditio.hxx:
    # base class has to be a complete type
    - tools/link.hxx
    # Used as type for a boost::optional variable
    - tools/color.hxx
    sc/inc/dapiuno.hxx:
    # base class has to be a complete type
    - com/sun/star/container/XEnumerationAccess.hpp
@@ -202,6 +201,7 @@ blacklist:
    - memory
    # needed for conditionally enabled code path
    - struct ScFormulaCellGroup
    - namespace osl { class File; }
    sc/inc/formulaparserpool.hxx:
    # base class has to be a complete type
    - com/sun/star/sheet/XFormulaParser.hpp
@@ -215,7 +215,6 @@ blacklist:
    - com/sun/star/sheet/XFunctionAccess.hpp
    sc/inc/global.hxx:
    # base class has to be a complete type
    - com/sun/star/uno/Reference.hxx
    - tools/ref.hxx
    sc/inc/linkuno.hxx:
    # base class has to be a complete type
diff --git a/sc/inc/AccessibleFilterMenu.hxx b/sc/inc/AccessibleFilterMenu.hxx
index f5ede6e..878c27a 100644
--- a/sc/inc/AccessibleFilterMenu.hxx
+++ b/sc/inc/AccessibleFilterMenu.hxx
@@ -28,12 +28,6 @@

#include <vector>

namespace com { namespace sun { namespace star {
    namespace accessibility {
        struct AccessibleEventObject;
    }
}}}

class ScMenuFloatingWindow;

typedef ::cppu::ImplHelper1<
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index ffa43e1..bdaeccd 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -40,7 +40,6 @@ namespace formula { struct VectorRefArray; }

namespace sc {

struct FormulaGroupContext;
struct FormulaGroupEntry;
class StartListeningContext;
class EndListeningContext;
@@ -49,7 +48,6 @@ class CopyToClipContext;
class CopyToDocContext;
class MixDocContext;
class ColumnSpanSet;
struct ColumnBlockPosition;
class SingleColumnSpanSet;
struct RefUpdateContext;
struct RefUpdateInsertTabContext;
@@ -64,7 +62,6 @@ struct RowSpan;
class RowHeightContext;
class CompileFormulaContext;
struct SetFormulaDirtyContext;
class RefMovedHint;
enum class MatrixEdge;
class ColumnIterator;

diff --git a/sc/inc/datamapper.hxx b/sc/inc/datamapper.hxx
index 27bb011..d54e1a8 100644
--- a/sc/inc/datamapper.hxx
+++ b/sc/inc/datamapper.hxx
@@ -24,7 +24,6 @@ namespace sc {

class ScDBDataManager;
class DataProvider;
class ScDBDataManager;
class DataTransformation;

class SC_DLLPUBLIC ExternalDataSource
diff --git a/sc/inc/dpresfilter.hxx b/sc/inc/dpresfilter.hxx
index 7fed713..a66a846 100644
--- a/sc/inc/dpresfilter.hxx
+++ b/sc/inc/dpresfilter.hxx
@@ -58,7 +58,6 @@ public:
private:

    struct MemberNode;
    struct DimensionNode;
    typedef std::map<OUString, std::shared_ptr<MemberNode> > MembersType;

    struct DimensionNode
diff --git a/sc/inc/dpshttab.hxx b/sc/inc/dpshttab.hxx
index 9d2cc6e..3b15cef 100644
--- a/sc/inc/dpshttab.hxx
+++ b/sc/inc/dpshttab.hxx
@@ -28,10 +28,6 @@
#include <unordered_set>
#include <vector>

namespace com { namespace sun { namespace star { namespace sheet {
    struct DataPilotFieldFilter;
}}}}

class ScDPDimensionSaveData;

/**
diff --git a/sc/inc/dptabdat.hxx b/sc/inc/dptabdat.hxx
index b0dc990..3df053e 100644
--- a/sc/inc/dptabdat.hxx
+++ b/sc/inc/dptabdat.hxx
@@ -28,10 +28,6 @@
#include <unordered_set>
#include <vector>

namespace com { namespace sun { namespace star { namespace sheet {
    struct DataPilotFieldFilter;
}}}}

#define SC_DAPI_HIERARCHY_FLAT      0
#define SC_DAPI_HIERARCHY_QUARTER   1
#define SC_DAPI_HIERARCHY_WEEK      2
diff --git a/sc/inc/dptabsrc.hxx b/sc/inc/dptabsrc.hxx
index 3d5d977..4c222f1 100644
--- a/sc/inc/dptabsrc.hxx
+++ b/sc/inc/dptabsrc.hxx
@@ -55,9 +55,6 @@ namespace com { namespace sun { namespace star {
        struct DataPilotFieldFilter;
        struct MemberResult;
    }
    namespace table {
        struct CellAddress;
    }
}}}

class ScDPResultMember;
diff --git a/sc/inc/formulacell.hxx b/sc/inc/formulacell.hxx
index d0842e8e..3af68fbb 100644
--- a/sc/inc/formulacell.hxx
+++ b/sc/inc/formulacell.hxx
@@ -32,7 +32,6 @@

namespace sc {

class CompiledFormula;
class StartListeningContext;
class EndListeningContext;
struct RefUpdateContext;
diff --git a/sc/inc/interpretercontext.hxx b/sc/inc/interpretercontext.hxx
index 2855370..b12bf17 100644
--- a/sc/inc/interpretercontext.hxx
+++ b/sc/inc/interpretercontext.hxx
@@ -11,9 +11,13 @@
#define INCLUDED_SC_INC_INTERPRETERCONTEXT_HXX

#include <vector>
#include <formula/token.hxx>
#include "types.hxx"

namespace formula
{
class FormulaToken;
}

#define TOKEN_CACHE_SIZE 8

class ScDocument;
diff --git a/sc/inc/listenercalls.hxx b/sc/inc/listenercalls.hxx
index d9f1a47..6e71be2 100644
--- a/sc/inc/listenercalls.hxx
+++ b/sc/inc/listenercalls.hxx
@@ -28,9 +28,6 @@ namespace com { namespace sun { namespace star {
    namespace util {
        class XModifyListener;
    }
    namespace lang {
        struct EventObject;
    }
} } }

struct ScUnoListenerEntry
diff --git a/sc/inc/markdata.hxx b/sc/inc/markdata.hxx
index c4497da..ca1443a 100644
--- a/sc/inc/markdata.hxx
+++ b/sc/inc/markdata.hxx
@@ -30,7 +30,6 @@

namespace sc {

struct RowSpan;
struct ColRowSpan;

}
diff --git a/sc/inc/scmatrix.hxx b/sc/inc/scmatrix.hxx
index 7b08d5e..4b58cd19 100644
--- a/sc/inc/scmatrix.hxx
+++ b/sc/inc/scmatrix.hxx
@@ -39,8 +39,6 @@ class SvNumberFormatter;
class ScMatrixImpl;
enum class FormulaError : sal_uInt16;

namespace formula { class DoubleVectorRefToken; }

namespace sc {

struct Compare;
diff --git a/sc/inc/token.hxx b/sc/inc/token.hxx
index c552302..e0507eb 100644
--- a/sc/inc/token.hxx
+++ b/sc/inc/token.hxx
@@ -33,12 +33,6 @@
// Matrix token constants.
#define MATRIX_TOKEN_HAS_RANGE 1

namespace sc {

struct RangeMatrix;

}

class ScJumpMatrix;
class ScMatrix;

diff --git a/sc/inc/validat.hxx b/sc/inc/validat.hxx
index a37df6a..f9e24ad 100644
--- a/sc/inc/validat.hxx
+++ b/sc/inc/validat.hxx
@@ -23,7 +23,6 @@
#include "conditio.hxx"
#include "scdllapi.h"

namespace vcl { class Window; }
namespace weld { class Window; }

namespace sc {
diff --git a/sc/source/core/tool/chartlis.cxx b/sc/source/core/tool/chartlis.cxx
index 80a974e..8ef3edf 100644
--- a/sc/source/core/tool/chartlis.cxx
+++ b/sc/source/core/tool/chartlis.cxx
@@ -24,6 +24,7 @@
#include <brdcst.hxx>
#include <document.hxx>
#include <reftokenhelper.hxx>
#include <formula/token.hxx>
#include <com/sun/star/chart/XChartDataChangeEventListener.hpp>

using namespace com::sun::star;
diff --git a/sc/source/core/tool/interpretercontext.cxx b/sc/source/core/tool/interpretercontext.cxx
index 35e7769..e7fe0fe 100644
--- a/sc/source/core/tool/interpretercontext.cxx
+++ b/sc/source/core/tool/interpretercontext.cxx
@@ -18,7 +18,7 @@
 */

#include <interpretercontext.hxx>

#include <formula/token.hxx>
#include <lookupcache.hxx>

ScInterpreterContext::~ScInterpreterContext()
diff --git a/sc/source/filter/inc/externallinkfragment.hxx b/sc/source/filter/inc/externallinkfragment.hxx
index ec82be8..e2964c9 100644
--- a/sc/source/filter/inc/externallinkfragment.hxx
+++ b/sc/source/filter/inc/externallinkfragment.hxx
@@ -26,8 +26,6 @@
namespace oox {
namespace xls {

class ExternalLink;

/** This class implements importing the sheetData element in external sheets.

    The sheetData element embedded in the externalBook element contains cached
diff --git a/sc/source/filter/inc/sheetdatabuffer.hxx b/sc/source/filter/inc/sheetdatabuffer.hxx
index 1cd4b1d..3b43544 100644
--- a/sc/source/filter/inc/sheetdatabuffer.hxx
+++ b/sc/source/filter/inc/sheetdatabuffer.hxx
@@ -26,6 +26,7 @@

#include "richstring.hxx"
#include "worksheethelper.hxx"
#include "addressconverter.hxx"

namespace com { namespace sun { namespace star {
    namespace util { struct DateTime; }
@@ -151,7 +152,6 @@ public:
                            const ScAddress& rCellAddr,
                            const ApiTokenSequence& rTokens );
private:
    struct XfIdRowRange;

    /** Creates a formula token array representing the shared formula with the
        passed identifier. */
diff --git a/sc/source/filter/inc/xiescher.hxx b/sc/source/filter/inc/xiescher.hxx
index f984725..f9e8d00 100644
--- a/sc/source/filter/inc/xiescher.hxx
+++ b/sc/source/filter/inc/xiescher.hxx
@@ -46,8 +46,6 @@ class XclImpChart;
class XclImpDffConverter;
class XclImpDrawing;

struct SdrObjectFreeOp;

// Drawing objects ============================================================

class XclImpDrawObjBase;