tdf#157589 tdf#153969: Revert "sdext.pdfimport Writer: Do not visit...

... DrawElement twice in WriterXmlEmitter"

This reverts commit 9ea9d3ccc0f8e4833e745d9655b61d42d6d8fe83.

The reason for the revert:
It causes regressions as indicated in tdf#157589 and tdf#153969.
That commit may be my misunderstanding of the code.

Change-Id: Idd188bf83721d309623a7f8484d064327a3a23af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159811
Tested-by: Jenkins
Reviewed-by: Kevin Suo <suokunlong@126.com>
diff --git a/sdext/source/pdfimport/tree/writertreevisiting.cxx b/sdext/source/pdfimport/tree/writertreevisiting.cxx
index 7941f7d..9ecce8f 100644
--- a/sdext/source/pdfimport/tree/writertreevisiting.cxx
+++ b/sdext/source/pdfimport/tree/writertreevisiting.cxx
@@ -413,7 +413,7 @@ void WriterXmlEmitter::visit( DocumentElement& elem, const std::list< std::uniqu
    // only DrawElement types
    for( auto it = elem.Children.begin(); it != elem.Children.end(); ++it )
    {
        if( dynamic_cast<DrawElement*>(it->get()) != nullptr )
        if( dynamic_cast<DrawElement*>(it->get()) == nullptr )
            (*it)->visitedBy( *this, it );
    }