Kaydet (Commit) 4c1926f3 authored tarafından Noel Grandin's avatar Noel Grandin

the ElementTreeVisitable interface is doing nothing useful

Change-Id: I89e8fb90de8aadce89a8f5e353a923c972e1569f
üst f9a55579
...@@ -70,7 +70,7 @@ namespace pdfi ...@@ -70,7 +70,7 @@ namespace pdfi
css::uno::XComponentContext > m_xContext; css::uno::XComponentContext > m_xContext;
}; };
struct Element : public ElementTreeVisitable struct Element
{ {
protected: protected:
Element( Element* pParent ) Element( Element* pParent )
...@@ -83,6 +83,11 @@ namespace pdfi ...@@ -83,6 +83,11 @@ namespace pdfi
public: public:
virtual ~Element(); virtual ~Element();
/**
To be implemented by every tree node that needs to be
visitable.
*/
virtual void visitedBy( ElementTreeVisitor&, const std::list< Element* >::const_iterator& rParentIt ) = 0;
/// Apply visitor to all children /// Apply visitor to all children
void applyToChildren( ElementTreeVisitor& ); void applyToChildren( ElementTreeVisitor& );
/// Union element geometry with given element /// Union element geometry with given element
...@@ -106,7 +111,6 @@ namespace pdfi ...@@ -106,7 +111,6 @@ namespace pdfi
struct ListElement : public Element struct ListElement : public Element
{ {
ListElement() : Element( NULL ) {} ListElement() : Element( NULL ) {}
// ElementTreeVisitable
virtual void visitedBy( ElementTreeVisitor&, const std::list< Element* >::const_iterator& ) SAL_OVERRIDE; virtual void visitedBy( ElementTreeVisitor&, const std::list< Element* >::const_iterator& ) SAL_OVERRIDE;
}; };
...@@ -117,7 +121,6 @@ namespace pdfi ...@@ -117,7 +121,6 @@ namespace pdfi
HyperlinkElement( Element* pParent, const OUString& rURI ) HyperlinkElement( Element* pParent, const OUString& rURI )
: Element( pParent ), URI( rURI ) {} : Element( pParent ), URI( rURI ) {}
public: public:
// ElementTreeVisitable
virtual void visitedBy( ElementTreeVisitor&, const std::list< Element* >::const_iterator& ) SAL_OVERRIDE; virtual void visitedBy( ElementTreeVisitor&, const std::list< Element* >::const_iterator& ) SAL_OVERRIDE;
OUString URI; OUString URI;
...@@ -163,7 +166,6 @@ namespace pdfi ...@@ -163,7 +166,6 @@ namespace pdfi
: DrawElement( pParent, nGCId ) {} : DrawElement( pParent, nGCId ) {}
public: public:
// ElementTreeVisitable
virtual void visitedBy( ElementTreeVisitor&, const std::list< Element* >::const_iterator& ) SAL_OVERRIDE; virtual void visitedBy( ElementTreeVisitor&, const std::list< Element* >::const_iterator& ) SAL_OVERRIDE;
}; };
...@@ -175,7 +177,6 @@ namespace pdfi ...@@ -175,7 +177,6 @@ namespace pdfi
: GraphicalElement( pParent, nGCId ), FontId( nFontId ) {} : GraphicalElement( pParent, nGCId ), FontId( nFontId ) {}
public: public:
// ElementTreeVisitable
virtual void visitedBy( ElementTreeVisitor&, const std::list< Element* >::const_iterator& ) SAL_OVERRIDE; virtual void visitedBy( ElementTreeVisitor&, const std::list< Element* >::const_iterator& ) SAL_OVERRIDE;
OUStringBuffer Text; OUStringBuffer Text;
...@@ -189,7 +190,6 @@ namespace pdfi ...@@ -189,7 +190,6 @@ namespace pdfi
ParagraphElement( Element* pParent ) : Element( pParent ), Type( Normal ), bRtl( false ) {} ParagraphElement( Element* pParent ) : Element( pParent ), Type( Normal ), bRtl( false ) {}
public: public:
// ElementTreeVisitable
virtual void visitedBy( ElementTreeVisitor&, const std::list< Element* >::const_iterator& rParentIt ) SAL_OVERRIDE; virtual void visitedBy( ElementTreeVisitor&, const std::list< Element* >::const_iterator& rParentIt ) SAL_OVERRIDE;
// returns true only if only a single line is contained // returns true only if only a single line is contained
...@@ -213,7 +213,6 @@ namespace pdfi ...@@ -213,7 +213,6 @@ namespace pdfi
const basegfx::B2DPolyPolygon& rPolyPoly, const basegfx::B2DPolyPolygon& rPolyPoly,
sal_Int8 nAction ); sal_Int8 nAction );
public: public:
// ElementTreeVisitable
virtual void visitedBy( ElementTreeVisitor&, const std::list< Element* >::const_iterator& rParentIt ) SAL_OVERRIDE; virtual void visitedBy( ElementTreeVisitor&, const std::list< Element* >::const_iterator& rParentIt ) SAL_OVERRIDE;
void updateGeometry(); void updateGeometry();
...@@ -234,7 +233,6 @@ namespace pdfi ...@@ -234,7 +233,6 @@ namespace pdfi
: DrawElement( pParent, nGCId ), Image( nImage ) {} : DrawElement( pParent, nGCId ), Image( nImage ) {}
public: public:
// ElementTreeVisitable
virtual void visitedBy( ElementTreeVisitor&, const std::list< Element* >::const_iterator& ) SAL_OVERRIDE; virtual void visitedBy( ElementTreeVisitor&, const std::list< Element* >::const_iterator& ) SAL_OVERRIDE;
ImageId Image; ImageId Image;
...@@ -252,10 +250,9 @@ namespace pdfi ...@@ -252,10 +250,9 @@ namespace pdfi
private: private:
// helper method for resolveHyperlinks // helper method for resolveHyperlinks
bool resolveHyperlink( std::list<Element*>::iterator link_it, std::list<Element*>& rElements ); bool resolveHyperlink( std::list<Element*>::iterator link_it, std::list<Element*>& rElements );
public: public:
virtual ~PageElement(); virtual ~PageElement();
// ElementTreeVisitable
virtual void visitedBy( ElementTreeVisitor&, const std::list< Element* >::const_iterator& rParentIt ) SAL_OVERRIDE; virtual void visitedBy( ElementTreeVisitor&, const std::list< Element* >::const_iterator& rParentIt ) SAL_OVERRIDE;
void emitPageAnchoredElements( EmitContext& rEmitContext ); void emitPageAnchoredElements( EmitContext& rEmitContext );
...@@ -282,9 +279,7 @@ namespace pdfi ...@@ -282,9 +279,7 @@ namespace pdfi
public: public:
virtual ~DocumentElement(); virtual ~DocumentElement();
// ElementTreeVisitable
virtual void visitedBy( ElementTreeVisitor&, const std::list< Element* >::const_iterator& ) SAL_OVERRIDE; virtual void visitedBy( ElementTreeVisitor&, const std::list< Element* >::const_iterator& ) SAL_OVERRIDE;
}; };
// this class is the differentiator of document types: it will create // this class is the differentiator of document types: it will create
......
...@@ -31,7 +31,6 @@ namespace pdfi ...@@ -31,7 +31,6 @@ namespace pdfi
{ {
struct Element; struct Element;
struct EmitContext; struct EmitContext;
struct ElementTreeVisitable;
class StyleContainer class StyleContainer
{ {
......
...@@ -55,19 +55,6 @@ namespace pdfi ...@@ -55,19 +55,6 @@ namespace pdfi
}; };
typedef boost::shared_ptr<ElementTreeVisitor> ElementTreeVisitorSharedPtr; typedef boost::shared_ptr<ElementTreeVisitor> ElementTreeVisitorSharedPtr;
/** Visitee interface
To be implemented by every tree node that needs to be
visitable.
*/
struct ElementTreeVisitable
{
virtual void visitedBy( ElementTreeVisitor&, const std::list< Element* >::const_iterator& rParentIt ) = 0;
protected:
~ElementTreeVisitable() {}
};
typedef boost::shared_ptr<ElementTreeVisitable> ElementTreeVisitableSharedPtr;
} }
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment