tdf#105809: Drop the PlaceWare export filter

Hard to think of any reason why anybody would need it.

Change-Id: If989cdeb1728847973da601f9d3fa60aba1f3bad
Reviewed-on: https://gerrit.libreoffice.org/36169
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
diff --git a/Repository.mk b/Repository.mk
index 7dbaed7..7c2a746 100644
--- a/Repository.mk
+++ b/Repository.mk
@@ -268,7 +268,6 @@ $(eval $(call gb_Helper_register_executables_for_install,OOO,tde, \

$(eval $(call gb_Helper_register_libraries_for_install,OOOLIBS,impress, \
	animcore \
	placeware \
	PresenterScreen \
	PresentationMinimizer \
	wpftimpress \
diff --git a/filter/Configuration_filter.mk b/filter/Configuration_filter.mk
index 4f0ef2c..7f3843c 100644
--- a/filter/Configuration_filter.mk
+++ b/filter/Configuration_filter.mk
@@ -589,7 +589,6 @@ $(eval $(call filter_Configuration_add_types,fcfg_langpack,fcfg_impress_types.xc
	impress_StarOffice_XML_Impress \
	impress_StarOffice_XML_Impress_Template \
	pdf_Portable_Document_Format \
	pwp_PlaceWare \
	impress8 \
	impress8_template \
	draw8 \
@@ -615,7 +614,6 @@ $(eval $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_impress_filter
	StarOffice_XML__Impress_ \
	impress_StarOffice_XML_Impress_Template \
	impress_pdf_Export \
	placeware_Export \
	impress8 \
	impress8_template \
	impress8_draw \
diff --git a/filter/Library_placeware.mk b/filter/Library_placeware.mk
deleted file mode 100644
index 439293f..0000000
--- a/filter/Library_placeware.mk
+++ /dev/null
@@ -1,45 +0,0 @@
# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This file incorporates work covered by the following license notice:
#
#   Licensed to the Apache Software Foundation (ASF) under one or more
#   contributor license agreements. See the NOTICE file distributed
#   with this work for additional information regarding copyright
#   ownership. The ASF licenses this file to you under the Apache
#   License, Version 2.0 (the "License"); you may not use this file
#   except in compliance with the License. You may obtain a copy of
#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
#

$(eval $(call gb_Library_Library,placeware))

$(eval $(call gb_Library_set_componentfile,placeware,filter/source/placeware/placeware))

$(eval $(call gb_Library_use_external,placeware,boost_headers))

$(eval $(call gb_Library_use_sdk_api,placeware))

$(eval $(call gb_Library_use_libraries,placeware,\
	comphelper \
	cppuhelper \
	cppu \
	sal \
	sax \
	$(gb_UWINAPI) \
))

$(eval $(call gb_Library_add_exception_objects,placeware,\
	filter/source/placeware/exporter \
	filter/source/placeware/filter \
	filter/source/placeware/tempfile \
	filter/source/placeware/uno \
	filter/source/placeware/zip \
))

# vim: set noet sw=4 ts=4:
diff --git a/filter/Module_filter.mk b/filter/Module_filter.mk
index 884ec28..45cd545 100644
--- a/filter/Module_filter.mk
+++ b/filter/Module_filter.mk
@@ -28,7 +28,6 @@ $(eval $(call gb_Module_add_targets,filter,\
	Library_msfilter \
	Library_odfflatxml \
	Library_pdffilter \
	Library_placeware \
	Library_storagefd \
	Library_svgfilter \
	Library_graphicfilter \
diff --git a/filter/source/config/cache/typedetection.cxx b/filter/source/config/cache/typedetection.cxx
index b2778eb..38065bc 100644
--- a/filter/source/config/cache/typedetection.cxx
+++ b/filter/source/config/cache/typedetection.cxx
@@ -269,7 +269,6 @@ int getFlatTypeRank(const OUString& rType)

        // Export only
        "writer_layout_dump_xml",
        "pwp_PlaceWare",
        "graphic_SWF",
        "graphic_HTML",

diff --git a/filter/source/config/fragments/filters/placeware_Export.xcu b/filter/source/config/fragments/filters/placeware_Export.xcu
deleted file mode 100644
index 25aae56..0000000
--- a/filter/source/config/fragments/filters/placeware_Export.xcu
+++ /dev/null
@@ -1,30 +0,0 @@
<!--
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
    <node oor:name="placeware_Export" oor:op="replace">
        <prop oor:name="Flags"><value>EXPORT ALIEN 3RDPARTYFILTER</value></prop>
        <prop oor:name="UIComponent"/>
        <prop oor:name="FilterService"><value>com.sun.star.comp.Impress.PlaceWareExportFilter</value></prop>
        <prop oor:name="UserData"><value></value></prop>
        <prop oor:name="UIName">
            <value xml:lang="en-US">PWP - PlaceWare</value>
        </prop>
        <prop oor:name="FileFormatVersion"><value>0</value></prop>
        <prop oor:name="Type"><value>pwp_PlaceWare</value></prop>
        <prop oor:name="TemplateName"/>
        <prop oor:name="DocumentService"><value>com.sun.star.presentation.PresentationDocument</value></prop>
    </node>
diff --git a/filter/source/config/fragments/types/pwp_PlaceWare.xcu b/filter/source/config/fragments/types/pwp_PlaceWare.xcu
deleted file mode 100644
index 70fc9ad..0000000
--- a/filter/source/config/fragments/types/pwp_PlaceWare.xcu
+++ /dev/null
@@ -1,29 +0,0 @@
<!--
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
-->
    <node oor:name="pwp_PlaceWare" oor:op="replace" >
        <prop oor:name="DetectService"/>
        <prop oor:name="URLPattern"/>
        <prop oor:name="Extensions"><value>pwp</value></prop>
        <prop oor:name="MediaType"/>
        <prop oor:name="Preferred"><value>false</value></prop>
        <prop oor:name="PreferredFilter"/>
        <prop oor:name="UIName">
            <value>PWP - PlaceWare</value>
        </prop>
        <prop oor:name="ClipboardFormat"/>
    </node>
diff --git a/filter/source/placeware/exporter.cxx b/filter/source/placeware/exporter.cxx
deleted file mode 100644
index d655890..0000000
--- a/filter/source/placeware/exporter.cxx
+++ /dev/null
@@ -1,497 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

#include <com/sun/star/container/XNamed.hpp>
#include <com/sun/star/io/IOException.hpp>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
#include <com/sun/star/drawing/GraphicExportFilter.hpp>
#include <com/sun/star/presentation/XPresentationPage.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
#include <com/sun/star/document/XFilter.hpp>
#include <com/sun/star/text/XText.hpp>
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/task/XStatusIndicatorFactory.hpp>
#include <rtl/ustrbuf.hxx>
#include <rtl/string.hxx>
#include <sax/tools/converter.hxx>
#include <osl/diagnose.h>

#include <vector>

#include "exporter.hxx"
#include "zip.hxx"
#include "tempfile.hxx"

using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::drawing;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::document;
using namespace ::com::sun::star::io;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::text;

using com::sun::star::beans::PropertyValue;
using com::sun::star::beans::XPropertySet;
using com::sun::star::presentation::XPresentationPage;
using com::sun::star::task::XStatusIndicator;


PlaceWareExporter::PlaceWareExporter(const Reference< XComponentContext > & rxContext)
:   mxContext( rxContext )
{
}


PlaceWareExporter::~PlaceWareExporter()
{
}


class PageEntry
{
private:
    PlaceWareTempFile maTempFile;
    OUString maName;
    OUString maTitle;
    OUString maNotes;
    OUString maURL;

public:
    PageEntry();

    OUString getTempURL() { return maTempFile.getFileURL(); }

    void setName( const OUString& rName ) { maName = rName; }
    const OUString& getName() const { return maName; }

    void setTitle( const OUString& rTitle ) { maTitle = rTitle; }
    const OUString& getTitle() const { return maTitle; }

    void setNotes( const OUString& rNotes ) { maNotes = rNotes; }
    const OUString& getNotes() const { return maNotes; }

    void setURL( const OUString& rURL ) { maURL = rURL; }
    const OUString& getURL() const { return maURL; }
};

PageEntry::PageEntry()
: maTempFile( PlaceWareTempFile::createTempFileURL() )
{
}

/// @throws css::uno::Exception
static void encodeFile( osl::File& rSourceFile, Reference< XOutputStream > const & xOutputStream )
{
    if( xOutputStream.is() )
    {
        sal_uInt64 nTemp( 0 );

        osl::File::RC nRC = rSourceFile.setPos( osl_Pos_End, 0  );
        if( osl::File::E_None == nRC )
        {
            nRC = rSourceFile.getPos( nTemp );
            if( osl::File::E_None == nRC )
            {
                nRC = rSourceFile.setPos( osl_Pos_Absolut, 0 );
            }
        }

        sal_Int32 nLen = static_cast<sal_Int32>(nTemp);

        if( osl::File::E_None != nRC )
            throw IOException();

        sal_Int32 nBufferSize = 3*1024; // !!! buffer size must be a factor of 3 for base64 to work
        Sequence< sal_Int8 > aInBuffer( nBufferSize < nLen ? nBufferSize : nLen );
        void* pInBuffer = aInBuffer.getArray();

        Sequence< sal_Int8 > aOutBuffer;
        sal_Int32 nRead;
        while( nLen )
        {
            nRC = rSourceFile.read( pInBuffer, aInBuffer.getLength(), nTemp );

            if( (nRC != osl::File::E_None) || (0 == nTemp) )
                throw IOException();

            nRead = static_cast<sal_Int32>( nTemp );

            if( nRead < aInBuffer.getLength() )
            {
                aInBuffer.realloc( nRead );
                pInBuffer = aInBuffer.getArray();
            }

            nLen -= nRead;

            OUStringBuffer aStrBuffer;
            ::sax::Converter::encodeBase64(aStrBuffer, aInBuffer);

            sal_Int32 nCount = aStrBuffer.getLength();

            if( aOutBuffer.getLength() != nCount )
                aOutBuffer.realloc( nCount );

            sal_Int8* pBytes = aOutBuffer.getArray();
            const sal_Unicode* pUnicode = aStrBuffer.getStr();

            while( nCount-- )
            {
                // since base64 is always ascii, we can cast safely
                *pBytes++ = static_cast<sal_Int8>(*pUnicode++);
            }

            xOutputStream->writeBytes( aOutBuffer );
        }
    }
}

static OString convertString( const OUString& aInput )
{
    OString aRet( aInput.getStr(), aInput.getLength(), RTL_TEXTENCODING_ASCII_US );
    aRet = aRet.replace( '\r', ' ' );
    aRet = aRet.replace( '\n', ' ' );

    return aRet;
}

/// @throws css::uno::Exception
static void createSlideFile( const Reference< XComponent >& xDoc, PlacewareZipFile& rZipFile, const OUString& rURL, std::vector< PageEntry* >& rPageEntries  )
{
    OString aInfo;

    const OString aNewLine( "\r\n" );
    OUString aTemp;

    Reference< XDocumentPropertiesSupplier > xDPS( xDoc, UNO_QUERY );
    Reference< XDocumentProperties > xDocProps( xDPS->getDocumentProperties() );

    aTemp = xDocProps->getTitle();
    if( aTemp.isEmpty() )
    {
        sal_Int32 nPos1 = rURL.lastIndexOf( '/' );
        if( -1 != nPos1 )
        {
            sal_Int32 nPos2 = rURL.lastIndexOf( '.' );
            if( nPos2 > nPos1 )
            {
                aTemp = rURL.copy( nPos1 + 1, nPos2 - nPos1 - 1 );
            }
            else
            {
                aTemp = rURL.copy( nPos1 + 1 );
            }
        }
        else
        {
            aTemp = rURL;
        }
    }

    aInfo += OString( "SlideSetName: " );
    aInfo += convertString( aTemp );
    aInfo += aNewLine;

    aTemp = xDocProps->getAuthor();

    if( !aTemp.isEmpty() )
    {
        aInfo += OString( "PresenterName: " );
        aInfo += convertString( aTemp );
        aInfo += aNewLine;
    }

    std::vector< PageEntry* >::iterator aIter( rPageEntries.begin() );
    std::vector< PageEntry* >::iterator aEnd( rPageEntries.end() );
    while( aIter != aEnd )
    {
        PageEntry* pEntry = (*aIter++);

        aInfo += OString( "slide: " );
        if( !pEntry->getTitle().isEmpty() )
        {
            aInfo += convertString( pEntry->getTitle() );
        }
        else
        {
            aInfo += convertString( pEntry->getName() );
        }
        aInfo += aNewLine;

        aInfo += OString( "type: gif");
        aInfo += aNewLine;

        aInfo += OString( "url: " );
        aInfo += convertString( pEntry->getURL() );
        aInfo += aNewLine;


        if( !pEntry->getNotes().isEmpty() )
        {
            aInfo += OString( "notes: " );
            aInfo += convertString( pEntry->getNotes() );
            aInfo += aNewLine;
        }
    }

    PlaceWareTempFile aInfoFile( PlaceWareTempFile::createTempFileURL() );

    osl::File::RC nRC;
    sal_uInt64 nTemp;

    nRC = aInfoFile.open( osl_File_OpenFlag_Write );
    if( osl::File::E_None == nRC )
    {
        nRC = aInfoFile.write( aInfo.getStr(), aInfo.getLength(), nTemp );
        if( osl::File::E_None == nRC )
        {
            nRC = aInfoFile.setPos( osl_Pos_Absolut, 0 );
            if( osl::File::E_None == nRC )
            {
                nRC = aInfoFile.close();
            }
        }
    }

    if( (osl::File::E_None != nRC) || !rZipFile.addFile( aInfoFile, OString( "slides.txt" ) ))
        throw IOException();
}

//#define PLACEWARE_DEBUG 1

bool PlaceWareExporter::doExport( const Reference< XComponent >& xDoc, Reference < XOutputStream > const &xOutputStream,
                                  const OUString& rURL, const Reference < XInterface >& /* xHandler */, Reference < XStatusIndicator >& xStatusIndicator )
{
    bool bRet = false;

    mxGraphicExporter = GraphicExportFilter::create( mxContext );

    Reference< XDrawPagesSupplier > xDrawPagesSupplier(xDoc, UNO_QUERY);
    if(!xDrawPagesSupplier.is())
        return false;

    Reference< XIndexAccess > xDrawPages( xDrawPagesSupplier->getDrawPages(), UNO_QUERY );
    if(!xDrawPages.is())
        return false;

    if(xStatusIndicator.is())
    {
        xStatusIndicator->start( "PlaceWare:", xDrawPages->getCount());
    }

    Reference< XDrawPage > xDrawPage;

    osl::File::RC nRC;

#ifndef PLACEWARE_DEBUG
    PlaceWareTempFile aTempFile( PlaceWareTempFile::createTempFileURL() );
    nRC = aTempFile.open( osl_File_OpenFlag_Write|osl_File_OpenFlag_Read );
#else
    OUString aURL("file:///e:/test.zip");
    osl::File::remove( aURL );
    osl::File aTempFile( aURL );
    nRC = aTempFile.open( osl_File_OpenFlag_Create|osl_File_OpenFlag_Write|osl_File_OpenFlag_Read );
#endif

    if( osl::File::E_None != nRC )
        return false;

    std::vector< PageEntry* > aPageEntries;

    // Create new package...
    try
    {
        PlacewareZipFile aZipFile(aTempFile);

        // export slides as gifs and collect information for slides

        const sal_Int32 nPageCount = xDrawPages->getCount();
        sal_Int32 nPage;

        for( nPage = 0; nPage < nPageCount; nPage++)
        {
            xDrawPages->getByIndex(nPage) >>= xDrawPage;

            if( !xDrawPage.is() )
                continue;

            PageEntry* pEntry = exportPage( xDrawPage );
            aPageEntries.push_back( pEntry );

            OUString aName("i");
            aName += OUString::number( nPage );
            aName += ".gif";
            pEntry->setURL( aName );

            if(xStatusIndicator.is())
            {
                xStatusIndicator->setValue( nPage + 1 );
            }
        }

        // create the slide.txt file

        createSlideFile( xDoc, aZipFile, rURL, aPageEntries );

        // add gifs to zip
        std::vector< PageEntry* >::iterator aIter( aPageEntries.begin() );
        std::vector< PageEntry* >::iterator aEnd( aPageEntries.end() );
        while( aIter != aEnd )
        {
            PageEntry* pEntry = (*aIter++);

            osl::File aFile(pEntry->getTempURL() );
            const OUString aTemp( pEntry->getURL() );

            if( (osl::File::E_None != nRC) || !aZipFile.addFile( aFile, OString( aTemp.getStr(), aTemp.getLength(), RTL_TEXTENCODING_ASCII_US ) ) )
                throw IOException();
        }

        if(!aZipFile.close())
            throw IOException();

        encodeFile( aTempFile, xOutputStream );

        bRet = true;
    }
    catch ( RuntimeException const & )
    {
    }
    catch ( Exception const & )
    {
    }

    std::vector< PageEntry* >::iterator aIter( aPageEntries.begin() );
    std::vector< PageEntry* >::iterator aEnd( aPageEntries.end() );
    while( aIter != aEnd )
    {
        delete (*aIter++);
    }

    if( xStatusIndicator.is() )
        xStatusIndicator->end();

    return bRet;
}


PageEntry* PlaceWareExporter::exportPage( Reference< XDrawPage >&xDrawPage )
{
    Reference< XComponent > xComp( xDrawPage, UNO_QUERY );

    PageEntry* pEntry = new PageEntry();

    // get page name
    Reference< XNamed > xNamed( xDrawPage, UNO_QUERY );
    if( xNamed.is() )
        pEntry->setName( xNamed->getName() );

    // get title text from title presentation shape if available
    const OUString szTitleTextShape("com.sun.star.presentation.TitleTextShape");
    const OUString szIsEmptyPresObj("IsEmptyPresentationObject");

    sal_Int32 nShapeCount = xDrawPage->getCount();
    sal_Int32 nShape;
    for( nShape = 0; nShape < nShapeCount; nShape++ )
    {
        Reference< XShape > xShape;
        xDrawPage->getByIndex( nShape ) >>= xShape;

        if( xShape.is() && xShape->getShapeType() == szTitleTextShape )
        {
            Reference< XPropertySet > xPropSet( xShape, UNO_QUERY );
            if( xPropSet.is() )
            {
                bool bIsEmpty = true;
                xPropSet->getPropertyValue( szIsEmptyPresObj ) >>= bIsEmpty;

                if( !bIsEmpty )
                {
                    Reference< XText > xText( xShape, UNO_QUERY );
                    if( xText.is() )
                    {
                        pEntry->setTitle( xText->getString() );
                    }
                }
            }
            break;
        }
    }

    // get notes text if available
    Reference< XPresentationPage > xPresPage( xDrawPage, UNO_QUERY );
    if( xPresPage.is() )
    {
        Reference< XDrawPage > xNotesPage( xPresPage->getNotesPage() );

        const OUString szNotesShape("com.sun.star.presentation.NotesShape");

        nShapeCount = xNotesPage->getCount();
        for( nShape = 0; nShape < nShapeCount; nShape++ )
        {
            Reference< XShape > xShape;
            xNotesPage->getByIndex( nShape ) >>= xShape;

            if( xShape.is() && (xShape->getShapeType() == szNotesShape) )
            {
                Reference< XPropertySet > xPropSet( xShape, UNO_QUERY );
                if( xPropSet.is() )
                {
                    bool bIsEmpty = true;
                    xPropSet->getPropertyValue( szIsEmptyPresObj ) >>= bIsEmpty;

                    if( !bIsEmpty )
                    {
                        Reference< XText > xText( xShape, UNO_QUERY );
                        if( xText.is() )
                        {
                            pEntry->setNotes( xText->getString() );
                        }
                    }
                }
                break;
            }
        }
    }

    // create the gif

    Sequence< PropertyValue > aFilterData( 2 );
    aFilterData[0].Name = "Width";
    aFilterData[0].Value <<= (sal_Int32)704;
    aFilterData[1].Name = "Translucent";
    aFilterData[1].Value <<= false;

    Sequence< PropertyValue > aDescriptor( 3 );
    aDescriptor[0].Name = "FilterName";
    aDescriptor[0].Value <<= OUString("GIF");
    aDescriptor[1].Name = "URL";
    aDescriptor[1].Value <<= OUString( pEntry->getTempURL() );
    aDescriptor[2].Name = "FilterData";
    aDescriptor[2].Value <<= aFilterData;
    mxGraphicExporter->setSourceDocument( xComp );
    mxGraphicExporter->filter( aDescriptor );

    return pEntry;
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/placeware/exporter.hxx b/filter/source/placeware/exporter.hxx
deleted file mode 100644
index 015c1a7..0000000
--- a/filter/source/placeware/exporter.hxx
+++ /dev/null
@@ -1,53 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */
#ifndef INCLUDED_FILTER_SOURCE_PLACEWARE_EXPORTER_HXX
#define INCLUDED_FILTER_SOURCE_PLACEWARE_EXPORTER_HXX

#include <com/sun/star/drawing/XDrawPage.hpp>
#include <com/sun/star/drawing/XGraphicExportFilter.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/task/XInteractionHandler.hpp>
#include <com/sun/star/task/XStatusIndicator.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>

class PageEntry;

class PlaceWareExporter
{
public:
    explicit PlaceWareExporter( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
    ~PlaceWareExporter();

    bool doExport( const css::uno::Reference< css::lang::XComponent >& xDoc,
                   css::uno::Reference < css::io::XOutputStream > const & xOutputStream,
                   const OUString& rURL,
                   const css::uno::Reference < css::uno::XInterface >& xHandler,
                   css::uno::Reference < css::task::XStatusIndicator >& rxStatusIndicator );

private:
    PageEntry* exportPage( css::uno::Reference< css::drawing::XDrawPage >&xDrawPage );

    css::uno::Reference< css::uno::XComponentContext >        mxContext;
    css::uno::Reference< css::drawing::XGraphicExportFilter > mxGraphicExporter;
};

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/placeware/filter.cxx b/filter/source/placeware/filter.cxx
deleted file mode 100644
index 54f6d353..0000000
--- a/filter/source/placeware/filter.cxx
+++ /dev/null
@@ -1,170 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

#include <com/sun/star/document/XFilter.hpp>
#include <com/sun/star/document/XExporter.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <osl/diagnose.h>
#include <comphelper/processfactory.hxx>

#include "exporter.hxx"
#include "filter.hxx"

using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;

using ::com::sun::star::lang::XComponent;
using ::com::sun::star::beans::PropertyValue;
using ::com::sun::star::io::XOutputStream;
using ::com::sun::star::task::XStatusIndicator;

namespace pwp {


class PlaceWareExportFilter : public cppu::WeakImplHelper
<
    css::document::XFilter,
    css::document::XExporter,
    css::lang::XInitialization,
    css::lang::XServiceInfo
>
{
    Reference< XComponent > mxDoc;
    Reference< XComponentContext > mxContext;

public:
    explicit PlaceWareExportFilter( const Reference< XComponentContext > &rxContext);

    // XFilter
    virtual sal_Bool SAL_CALL filter( const Sequence< PropertyValue >& aDescriptor ) override;
    virtual void SAL_CALL cancel( ) override;

    // XExporter
    virtual void SAL_CALL setSourceDocument( const Reference< XComponent >& xDoc ) override;

    // XInitialization
    virtual void SAL_CALL initialize( const Sequence< Any >& aArguments ) override;

    // XServiceInfo
    virtual OUString SAL_CALL getImplementationName() override;
    virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
    virtual Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
};


PlaceWareExportFilter::PlaceWareExportFilter(const Reference< XComponentContext > &rxContext)
:   mxContext( rxContext )
{
}


sal_Bool SAL_CALL PlaceWareExportFilter::filter( const css::uno::Sequence< css::beans::PropertyValue >& aDescriptor )
{
    sal_Int32 nLength = aDescriptor.getLength();
    const PropertyValue * pValue = aDescriptor.getConstArray();
    OUString sURL;
    Reference < XInterface > xInteractionHandler;
    Reference < XOutputStream > xOutputStream;
    Reference < XStatusIndicator > xStatusIndicator;
    for ( sal_Int32 i = 0 ; i < nLength; i++)
    {
        if ( pValue[i].Name == "OutputStream" )
        {
            pValue[i].Value >>= xOutputStream;
        }
        else if( pValue[i].Name == "URL" )
        {
            pValue[i].Value >>= sURL;
        }
        else if( pValue[i].Name == "InteractionHandler" )
        {
            pValue[i].Value >>= xInteractionHandler;
        }
        else if ( pValue[i].Name == "StatusIndicator" )
        {
            pValue[i].Value >>= xStatusIndicator;
        }
    }
    if ( !xOutputStream.is() )
    {
        OSL_ASSERT ( false );
        return false;
    }

    PlaceWareExporter aExporter( mxContext );
    return aExporter.doExport( mxDoc, xOutputStream, sURL, xInteractionHandler, xStatusIndicator );
}


void SAL_CALL PlaceWareExportFilter::cancel(  )
{
}


// XExporter
void SAL_CALL PlaceWareExportFilter::setSourceDocument( const css::uno::Reference< css::lang::XComponent >& xDoc )
{
    mxDoc = xDoc;
}


// XInitialization
void SAL_CALL PlaceWareExportFilter::initialize( const css::uno::Sequence< css::uno::Any >& /* aArguments */ )
{
}

OUString PlaceWareExportFilter_getImplementationName ()
{
    return OUString( "com.sun.star.comp.Impress.PlaceWareExportFilter" );
}

Sequence< OUString > SAL_CALL PlaceWareExportFilter_getSupportedServiceNames(  )
{
    Sequence<OUString> aRet { "com.sun.star.document.ExportFilter" };
    return aRet;
}

Reference< XInterface > SAL_CALL PlaceWareExportFilter_createInstance( const Reference< XMultiServiceFactory > & rSMgr)
{
    return static_cast<cppu::OWeakObject*>(new PlaceWareExportFilter( comphelper::getComponentContext(rSMgr) ));
}

// XServiceInfo
OUString SAL_CALL PlaceWareExportFilter::getImplementationName(  )
{
    return PlaceWareExportFilter_getImplementationName();
}

sal_Bool SAL_CALL PlaceWareExportFilter::supportsService( const OUString& rServiceName )
{
    return cppu::supportsService( this, rServiceName );
}

css::uno::Sequence< OUString > SAL_CALL PlaceWareExportFilter::getSupportedServiceNames(  )
{
    return PlaceWareExportFilter_getSupportedServiceNames();
}


}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/placeware/filter.hxx b/filter/source/placeware/filter.hxx
deleted file mode 100644
index fc807cc..0000000
--- a/filter/source/placeware/filter.hxx
+++ /dev/null
@@ -1,55 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

#ifndef INCLUDED_FILTER_SOURCE_PLACEWARE_FILTER_HXX
#define INCLUDED_FILTER_SOURCE_PLACEWARE_FILTER_HXX

#include <sal/config.h>

#include <com/sun/star/uno/Exception.hpp>
#include <com/sun/star/uno/Reference.hxx>
#include <com/sun/star/uno/RuntimeException.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <rtl/ustring.hxx>
#include <sal/types.h>

namespace com { namespace sun { namespace star {
    namespace lang { class XMultiSerivceFactory; }
    namespace uno { class XInterface; }
} } }

namespace pwp {

/// @throws css::uno::RuntimeException
OUString PlaceWareExportFilter_getImplementationName();

/// @throws css::uno::RuntimeException
css::uno::Sequence<OUString> SAL_CALL
PlaceWareExportFilter_getSupportedServiceNames();

/// @throws css::uno::Exception
css::uno::Reference<css::uno::XInterface> SAL_CALL
PlaceWareExportFilter_createInstance(
    css::uno::Reference<css::lang::XMultiServiceFactory> const & rSMgr);

}

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/placeware/placeware.component b/filter/source/placeware/placeware.component
deleted file mode 100644
index b852c2b..0000000
--- a/filter/source/placeware/placeware.component
+++ /dev/null
@@ -1,25 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 -->

<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
    prefix="placeware" xmlns="http://openoffice.org/2010/uno-components">
  <implementation name="com.sun.star.comp.Impress.PlaceWareExportFilter">
    <service name="com.sun.star.document.ExportFilter"/>
  </implementation>
</component>
diff --git a/filter/source/placeware/tempfile.cxx b/filter/source/placeware/tempfile.cxx
deleted file mode 100644
index 6352418..0000000
--- a/filter/source/placeware/tempfile.cxx
+++ /dev/null
@@ -1,48 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

#include <osl/file.hxx>
#include <sal/macros.h>

#include "tempfile.hxx"

PlaceWareTempFile::PlaceWareTempFile( const OUString& rTempFileURL )
:osl::File( rTempFileURL ), maURL( rTempFileURL )
{
}

PlaceWareTempFile::~PlaceWareTempFile()
{
    close();

    if( !maURL.isEmpty() )
        osl::File::remove( maURL );
}

OUString PlaceWareTempFile::createTempFileURL()
{
    OUString aTempFileURL;

    ::osl::File::createTempFile(nullptr, nullptr, &aTempFileURL);
    // TODO: there does not appear to be any way to report an error here?

    return aTempFileURL;
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/placeware/tempfile.hxx b/filter/source/placeware/tempfile.hxx
deleted file mode 100644
index e960841..0000000
--- a/filter/source/placeware/tempfile.hxx
+++ /dev/null
@@ -1,42 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

#ifndef INCLUDED_FILTER_SOURCE_PLACEWARE_TEMPFILE_HXX
#define INCLUDED_FILTER_SOURCE_PLACEWARE_TEMPFILE_HXX

#include <osl/file.hxx>
#include <rtl/ustring.hxx>

class PlaceWareTempFile : public osl::File
{
public:
    explicit PlaceWareTempFile( const OUString& aURL );
    ~PlaceWareTempFile();

    static OUString createTempFileURL();
    const OUString& getFileURL() { return maURL;}

private:
    OUString   maURL;
};


#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/placeware/uno.cxx b/filter/source/placeware/uno.cxx
deleted file mode 100644
index 7f0a5ee..0000000
--- a/filter/source/placeware/uno.cxx
+++ /dev/null
@@ -1,61 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */


#include <osl/mutex.hxx>
#include <osl/thread.h>
#include <cppuhelper/factory.hxx>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>

#include <filter.hxx>

using namespace ::cppu;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::registry;

using namespace ::pwp;

extern "C"
{
SAL_DLLPUBLIC_EXPORT void * SAL_CALL placeware_component_getFactory(
    const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ )
{
    void * pRet = nullptr;

    OUString implName = OUString::createFromAscii( pImplName );
    if ( pServiceManager && implName.equals(PlaceWareExportFilter_getImplementationName()) )
    {
        Reference< XSingleServiceFactory > xFactory( createSingleFactory(
            static_cast< XMultiServiceFactory * >( pServiceManager ),
            OUString::createFromAscii( pImplName ),
            PlaceWareExportFilter_createInstance, PlaceWareExportFilter_getSupportedServiceNames() ) );

        if (xFactory.is())
        {
            xFactory->acquire();
            pRet = xFactory.get();
        }
    }

    return pRet;
}
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/placeware/zip.cxx b/filter/source/placeware/zip.cxx
deleted file mode 100644
index 585d749..0000000
--- a/filter/source/placeware/zip.cxx
+++ /dev/null
@@ -1,318 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

#include <osl/diagnose.h>
#include <rtl/crc.h>

#include "zip.hxx"
#include "zipfile.hxx"

/** this struct describes one entry in a zip file */
struct ZipEntry
{
    OString name;           /* the name we used */
    sal_Int32 offset;       /* where the header starts */
    sal_Int32 endOffset;    /* where the file data ends */
    sal_Int32 crc;
    sal_Int32 modTime;      /* dos mod time & date */
    sal_Int32 fileLen;      /* file size, in bytes */
};

/** put one byte inside this stream */
static osl::File::RC putC( unsigned char c, osl::File& rFile )
{
    sal_uInt64 nBytesWritten;
    osl::File::RC nRC = rFile.write( &c, 1, nBytesWritten );

    OSL_ASSERT( nBytesWritten == 1 );
    return nRC;
}

/** write a short to the PlacewareZipFile */
void PlacewareZipFile::writeShort( sal_Int16 s)
{
    if( !isError() )
    {
        mnRC = putC( static_cast< unsigned char >( s & 0xff ), mrFile );
        if( !isError() )
            mnRC = putC( static_cast< unsigned char >( (s >> 8) & 0xff ), mrFile );
    }
}

/** write a long to the PlacewareZipFile */

void PlacewareZipFile::writeLong( sal_Int32 l )
{
    if( !isError() )
    {
        mnRC = putC( static_cast< unsigned char >( l & 0xff ), mrFile);
        if( !isError() )
        {
            mnRC = putC( static_cast< unsigned char >( (l >> 8) & 0xff ), mrFile);
            if( !isError() )
            {
                mnRC = putC( static_cast< unsigned char >( (l >> 16) & 0xff ), mrFile);
                if( !isError() )
                {
                    mnRC = putC( static_cast< unsigned char >( (l >> 24) & 0xff ), mrFile);
                }
            }
        }
    }
}

/** copy the zipentries file to the zipfile and updates the crc of that zipentry */
void PlacewareZipFile::copyAndCRC(ZipEntry *e, osl::File& rFile)
{
    char buf[2048];
    sal_uInt64 n, nWritten;

    e->crc = rtl_crc32( 0, nullptr, 0 );

    while( !isError() )
    {
        mnRC = rFile.read( buf, sizeof(buf), n );
        if(n == 0)
            break;

        if( !isError() )
        {
            sal_uInt32 nTemp = static_cast<sal_uInt32>(n);
            e->crc = rtl_crc32( e->crc, static_cast<const void *>(buf), nTemp );
            mnRC = mrFile.write( buf, n, nWritten );
            OSL_ASSERT( n == nWritten );
        }
    }

    if( !isError() )
    {
        sal_uInt64 nPosition = 0;
        mnRC = mrFile.getPos( nPosition );
        if( !isError() )
        {
            e->endOffset = static_cast< sal_Int32 >( nPosition );
        }
    }
}

/** write a yet empty local header for a zipentry to the zipfile */
void PlacewareZipFile::writeDummyLocalHeader(ZipEntry *e)
{
    sal_Int32 len = zf_lfhSIZE + e->name.getLength();
    sal_Int32 i;

    sal_uInt64 nPosition = 0;
    mnRC = mrFile.getPos( nPosition );
    if( !isError() )
    {
        e->offset = static_cast< sal_Int32 >( nPosition );

        for (i = 0; (i < len) && !isError(); ++i)
            mnRC = putC(0, mrFile);
    }
}

/** write the local header for a zipentry to the zipfile */
void PlacewareZipFile::writeLocalHeader(ZipEntry *e)
{
    TimeValue aTime;
    osl_getSystemTime( &aTime );

    oslDateTime aDate;
    osl_getDateTimeFromTimeValue( &aTime, &aDate );

    e->modTime = ((aDate.Year - 1980) << 25) | (aDate.Month << 21) |    (aDate.Day << 16) |
    (aDate.Hours << 11) | (aDate.Minutes << 5) | (aDate.Seconds >> 1);

    e->fileLen = e->endOffset - e->offset - zf_lfhSIZE - e->name.getLength();

    if(!isError())
    {
        mnRC = mrFile.setPos( osl_Pos_Absolut, e->offset );

        writeLong(zf_LFHSIGValue);                              // magic number
        writeShort(zf_Vers(1, 0));                              // extract version
        writeShort(0);                                          // flags
        writeShort(zf_compNone);                                // compression method
        writeLong(e->modTime);                                  // file mod date & time
        writeLong(e->crc);                                      // file crc
        writeLong(e->fileLen);                                  // compressed size
        writeLong(e->fileLen);                                  // uncompressed size
        writeShort((sal_Int16) e->name.getLength());                    // name length
        writeShort(0);                                          // extra length field

        if( !isError() )
        {
            sal_uInt64 nWritten;
            mnRC = mrFile.write( e->name.getStr(), e->name.getLength(), nWritten ); // file name
            OSL_ASSERT( nWritten == (sal_uInt64)e->name.getLength() );
            if( !isError() )
            {
                mnRC = mrFile.setPos( osl_Pos_Absolut, e->endOffset );
            }
        }
    }
}

/* write a zipentry in the central dir to the zipfile */
void PlacewareZipFile::writeCentralDir(ZipEntry *e)
{
    writeLong(zf_CDHSIGValue);              // magic number
    writeShort(zf_Vers(1, 0));              // version made by
    writeShort(zf_Vers(1, 0));              // vers to extract
    writeShort(0);                          // flags
    writeShort(zf_compNone);                // compression method
    writeLong(e->modTime);                  // file mod time & date
    writeLong(e->crc);
    writeLong(e->fileLen);                  // compressed file size
    writeLong(e->fileLen);                  // uncompressed file size
    writeShort((sal_Int16) e->name.getLength());    // name length
    writeShort(0);                          // extra field length
    writeShort(0);                          // file comment length
    writeShort(0);                          // disk number start
    writeShort(0);                          // internal file attributes
    writeLong(0);                           // external file attributes
    writeLong(e->offset);                   // offset w.r.t disk
    if( !isError() )
    {
        sal_uInt64 nWritten;
        mrFile.write( e->name.getStr(), e->name.getLength(), nWritten );    // file name
        OSL_ASSERT( nWritten == (sal_uInt64)e->name.getLength() );
    }
}

/* write the end of the central dir to the zipfile */
void PlacewareZipFile::writeEndCentralDir(sal_Int32 nCdOffset, sal_Int32 nCdSize)
{
    writeLong(zf_ECDSIGValue);      // magic number
    writeShort(0);                  // disk num
    writeShort(0);                  // disk with central dir
    writeShort( static_cast< sal_Int16 >( maEntries.size() ) ); // number of file entries
    writeShort( static_cast< sal_Int16 >( maEntries.size() ) ); // number of file entries
    writeLong(nCdSize);             // central dir size
    writeLong(nCdOffset);
    writeShort(0);                  // comment len
}


/****************************************************************
 * The exported functions
 ****************************************************************/

/* Create a zip file for writing, return a handle for it.
 * RETURNS: A new zip-file output object, or NULL if it failed, in
 *   which case *errMsgBuffer will contain an error message string. */
PlacewareZipFile::PlacewareZipFile(osl::File& rFile )
: mrFile( rFile ), mbOpen( true ), mnRC( osl::File::E_None )
{
}

PlacewareZipFile::~PlacewareZipFile()
{
    if( mbOpen )
        close();
}

/* Add a file to this zip with the given name.
 * RETURNS: true if successful, else false. If false, the caller should
 *   call zip_Close() and delete the bum zip file.
*/
bool PlacewareZipFile::addFile( osl::File& rFile, const OString& rName )
{
    OSL_ASSERT( mbOpen );

    if( !mbOpen )
        return false;

    OSL_ASSERT( !rName.isEmpty() );

    if(rName.isEmpty())
        return false;

    mnRC = rFile.open( osl_File_OpenFlag_Read );

    if( !isError() )
    {
        ZipEntry *e = new ZipEntry;
        e->name = rName;
        maEntries.push_back(e);

        writeDummyLocalHeader(e);
        if( !isError() )
        {
            copyAndCRC(e, rFile);
            if(!isError())
            {
                writeLocalHeader(e);
            }
        }

        rFile.close();
    }

    return !isError();
}

/* Finish up the zip file, close it, and deallocate the zip file object.
 * RETURNS: true if successful, else false.
*/
bool PlacewareZipFile::close()
{
    OSL_ASSERT( mbOpen );

    if( !mbOpen )
        return false;

    if( !isError() )
    {
        sal_uInt64 nCdOffset;
        mrFile.getPos( nCdOffset );

        std::vector< ZipEntry* >::iterator aIter( maEntries.begin() );
        while((aIter != maEntries.end()) && !isError())
        {
            writeCentralDir( (*aIter++) );
        }

        if( !isError() )
        {
            sal_uInt64 nCdSize;
            mrFile.getPos( nCdSize );

            nCdSize -= nCdOffset;

            if( !isError() )
            {
                writeEndCentralDir(static_cast<sal_Int32>(nCdOffset), static_cast<sal_Int32>(nCdSize));
            }
        }
    }

    std::vector< ZipEntry* >::iterator aIter( maEntries.begin() );
    while( aIter != maEntries.end() )
    {
        delete (*aIter++);
    }

    mbOpen = false;

    return !isError();
}

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/placeware/zip.hxx b/filter/source/placeware/zip.hxx
deleted file mode 100644
index 99dc576..0000000
--- a/filter/source/placeware/zip.hxx
+++ /dev/null
@@ -1,61 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

#ifndef INCLUDED_FILTER_SOURCE_PLACEWARE_ZIP_HXX
#define INCLUDED_FILTER_SOURCE_PLACEWARE_ZIP_HXX

#include <sal/types.h>
#include <rtl/string.hxx>
#include <osl/file.hxx>

#include <vector>

struct ZipEntry;

class PlacewareZipFile
{
public:
    explicit PlacewareZipFile( osl::File& rFile );
    ~PlacewareZipFile();

    bool addFile( osl::File& rFile, const OString& rName );
    bool close();

private:
    void writeShort( sal_Int16 s);
    void writeLong( sal_Int32 l );

    void copyAndCRC( ZipEntry *e, osl::File& rFile );
    void writeDummyLocalHeader(ZipEntry *e);
    void writeLocalHeader(ZipEntry *e);
    void writeCentralDir(ZipEntry *e);
    void writeEndCentralDir(sal_Int32 nCdOffset, sal_Int32 nCdSize);

private:
    bool isError() const { return osl::File::E_None != mnRC; }

    osl::File& mrFile;              /* file we're writing to */
    bool mbOpen;
    osl::File::RC mnRC;
    std::vector<ZipEntry*> maEntries;
};

#endif // INCLUDED_FILTER_SOURCE_PLACEWARE_ZIP_HXX

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/placeware/zipfile.hxx b/filter/source/placeware/zipfile.hxx
deleted file mode 100644
index 92514c3..0000000
--- a/filter/source/placeware/zipfile.hxx
+++ /dev/null
@@ -1,38 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

#ifndef INCLUDED_FILTER_SOURCE_PLACEWARE_ZIPFILE_HXX
#define INCLUDED_FILTER_SOURCE_PLACEWARE_ZIPFILE_HXX

#define zf_lfhSIZE      30 /* total size of header */

/* Magic constants to put in these structures. */
#define zf_LFHSIGValue      0x04034b50
#define zf_CDHSIGValue      0x02014b50
#define zf_ECDSIGValue      0x06054b50

/* Encode a major,minor version in a byte. */
#define zf_Vers(major,minor)    ((major) * 10 + (minor))

/* Compression values. */
#define zf_compNone     0

#endif // INCLUDED_FILTER_SOURCE_PLACEWARE_ZIPFILE_HXX

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/l10ntools/source/gRun.sh b/l10ntools/source/gRun.sh
index 121d152..88c5ca8 100755
--- a/l10ntools/source/gRun.sh
+++ b/l10ntools/source/gRun.sh
@@ -647,11 +647,11 @@ ${MYCMD} --files dictionaries/zu_ZA/dictionaries.xcu

${MYCMD} --base extensions/source/update/check/org/openoffice/Office --files Addons.xcu Jobs.xcu

${MYCMD} --base filter/source/config/fragments/filters --files AbiWord.xcu ADO_rowset_XML.xcu AppleKeynote.xcu AppleNumbers.xcu ApplePages.xcu BMP___MS_Windows.xcu BroadBand_eBook.xcu calc8.xcu calc8_template.xcu calc_Gnumeric.xcu calc_HTML_WebQuery.xcu calc_MS_Excel_2007_Binary.xcu calc_MS_Excel_2007_VBA_XML.xcu calc_MS_Excel_2007_XML.xcu calc_MS_Excel_2007_XML_Template.xcu calc_OOXML.xcu calc_OOXML_Template.xcu calc_pdf_Export.xcu calc_png_Export.xcu calc_StarOffice_XML_Calc_Template.xcu CGM___Computer_Graphics_Metafile.xcu chart8.xcu ClarisWorks.xcu ClarisWorks_Calc.xcu ClarisWorks_Draw.xcu ClarisWorks_Impress.xcu Claris_Resolve_Calc.xcu CorelDrawDocument.xcu CorelPresentationExchange.xcu dBase.xcu DIF.xcu DocBook_File.xcu DosWord.xcu draw8.xcu draw8_template.xcu draw_bmp_Export.xcu draw_emf_Export.xcu draw_eps_Export.xcu draw_flash_Export.xcu draw_gif_Export.xcu draw_html_Export.xcu draw_jpg_Export.xcu draw_PCD_Photo_CD_Base.xcu draw_PCD_Photo_CD_Base16.xcu draw_PCD_Photo_CD_Base4.xcu draw_pdf_Export.xcu draw_png_Export.xcu draw_StarOffice_XML_Draw_Template.xcu draw_svg_Export.xcu draw_tif_Export.xcu draw_wmf_Export.xcu DXF___AutoCAD_Interchange.xcu EMF___MS_Windows_Metafile.xcu EPS___Encapsulated_PostScript.xcu FictionBook_2.xcu FreehandDocument.xcu GIF___Graphics_Interchange.xcu HTML.xcu HTML_MasterDoc.xcu HTML__StarCalc_.xcu HTML__StarWriter_.xcu impress8.xcu impress8_draw.xcu impress8_template.xcu impress_bmp_Export.xcu impress_emf_Export.xcu impress_eps_Export.xcu impress_flash_Export.xcu impress_gif_Export.xcu impress_html_Export.xcu impress_jpg_Export.xcu impress_MS_PowerPoint_2007_XML.xcu impress_MS_PowerPoint_2007_XML_AutoPlay.xcu impress_MS_PowerPoint_2007_XML_Template.xcu impress_OOXML.xcu impress_OOXML_AutoPlay.xcu impress_OOXML_Template.xcu impress_pdf_Export.xcu impress_png_Export.xcu impress_StarOffice_XML_Draw.xcu impress_StarOffice_XML_Impress_Template.xcu impress_svg_Export.xcu impress_tif_Export.xcu impress_wmf_Export.xcu JPG___JPEG.xcu Lotus.xcu LotusWordPro.xcu MacWrite.xcu Mac_Word.xcu Mac_Works.xcu Mac_Works_Calc.xcu Mariner_Write.xcu math8.xcu MathML_XML__Math_.xcu MathType_3_x.xcu math_pdf_Export.xcu MET___OS_2_Metafile.xcu mov__MOV.xcu MS_Excel_2003_XML.xcu MS_Excel_4_0.xcu MS_Excel_4_0_Vorlage_Template.xcu MS_Excel_5_0_95.xcu MS_Excel_5_0_95_Vorlage_Template.xcu MS_Excel_95.xcu MS_Excel_95_Vorlage_Template.xcu MS_Excel_97.xcu MS_Excel_97_Vorlage_Template.xcu MS_PowerPoint_97.xcu MS_PowerPoint_97_AutoPlay.xcu MS_PowerPoint_97_Vorlage.xcu MS_WinWord_5.xcu MS_WinWord_6_0.xcu MS_Word_2003_XML.xcu MS_Word_2007_XML.xcu MS_Word_2007_XML_Template.xcu MS_Word_95.xcu MS_Word_95_Vorlage.xcu MS_Word_97.xcu MS_Word_97_Vorlage.xcu MS_Works.xcu MS_Works_Calc.xcu MS_Write.xcu MWAW_Bitmap.xcu MWAW_Database.xcu MWAW_Drawing.xcu MWAW_Presentation.xcu MWAW_Spreadsheet.xcu MWAW_Text_Document.xcu ODG_FlatXML.xcu ODP_FlatXML.xcu ODS_FlatXML.xcu ODT_FlatXML.xcu OOXML_Text.xcu OOXML_Text_Template.xcu PageMakerDocument.xcu PalmDoc.xcu Palm_Text_Document.xcu PBM___Portable_Bitmap.xcu PCT___Mac_Pict.xcu PCX___Zsoft_Paintbrush.xcu PGM___Portable_Graymap.xcu placeware_Export.xcu Plucker_eBook.xcu PNG___Portable_Network_Graphic.xcu PPM___Portable_Pixelmap.xcu PSD___Adobe_Photoshop.xcu PublisherDocument.xcu QPro.xcu RAS___Sun_Rasterfile.xcu Rich_Text_Format.xcu Rich_Text_Format__StarCalc_.xcu SGF___StarOffice_Writer_SGF.xcu SGV___StarDraw_2_0.xcu StarBaseReport.xcu StarBaseReportChart.xcu StarOffice_XML__Base_.xcu StarOffice_XML__Calc_.xcu StarOffice_XML__Chart_.xcu StarOffice_XML__Draw_.xcu StarOffice_XML__Impress_.xcu StarOffice_XML__Math_.xcu StarOffice_XML__Writer_.xcu SVG___Scalable_Vector_Graphics.xcu SVM___StarView_Metafile.xcu SYLK.xcu T602Document.xcu Text.xcu Text__encoded_.xcu Text__encoded___StarWriter_GlobalDocument_.xcu Text__encoded___StarWriter_Web_.xcu Text__StarWriter_Web_.xcu Text___txt___csv__StarCalc_.xcu TGA___Truevision_TARGA.xcu TIF___Tag_Image_File.xcu UOF_presentation.xcu UOF_spreadsheet.xcu UOF_text.xcu VisioDocument.xcu WMF___MS_Windows_Metafile.xcu WordPerfect.xcu WordPerfectGraphics.xcu WPS_Lotus_Calc.xcu WPS_QPro_Calc.xcu WriteNow.xcu writer8.xcu writer8_template.xcu writerglobal8.xcu writerglobal8_HTML.xcu writerglobal8_template.xcu writerglobal8_writer.xcu writerweb8_writer.xcu writerweb8_writer_template.xcu writer_globaldocument_pdf_Export.xcu writer_globaldocument_StarOffice_XML_Writer.xcu writer_globaldocument_StarOffice_XML_Writer_GlobalDocument.xcu writer_jpg_Export.xcu writer_layout_dump.xcu writer_MIZI_Hwp_97.xcu writer_pdf_Export.xcu writer_png_Export.xcu writer_StarOffice_XML_Writer_Template.xcu writer_web_HTML_help.xcu writer_web_jpg_Export.xcu writer_web_pdf_Export.xcu writer_web_png_Export.xcu writer_web_StarOffice_XML_Writer.xcu writer_web_StarOffice_XML_Writer_Web_Template.xcu XBM___X_Consortium.xcu XHTML_Calc_File.xcu XHTML_Draw_File.xcu XHTML_Impress_File.xcu XHTML_Writer_File.xcu XPM.xcu
${MYCMD} --base filter/source/config/fragments/filters --files AbiWord.xcu ADO_rowset_XML.xcu AppleKeynote.xcu AppleNumbers.xcu ApplePages.xcu BMP___MS_Windows.xcu BroadBand_eBook.xcu calc8.xcu calc8_template.xcu calc_Gnumeric.xcu calc_HTML_WebQuery.xcu calc_MS_Excel_2007_Binary.xcu calc_MS_Excel_2007_VBA_XML.xcu calc_MS_Excel_2007_XML.xcu calc_MS_Excel_2007_XML_Template.xcu calc_OOXML.xcu calc_OOXML_Template.xcu calc_pdf_Export.xcu calc_png_Export.xcu calc_StarOffice_XML_Calc_Template.xcu CGM___Computer_Graphics_Metafile.xcu chart8.xcu ClarisWorks.xcu ClarisWorks_Calc.xcu ClarisWorks_Draw.xcu ClarisWorks_Impress.xcu Claris_Resolve_Calc.xcu CorelDrawDocument.xcu CorelPresentationExchange.xcu dBase.xcu DIF.xcu DocBook_File.xcu DosWord.xcu draw8.xcu draw8_template.xcu draw_bmp_Export.xcu draw_emf_Export.xcu draw_eps_Export.xcu draw_flash_Export.xcu draw_gif_Export.xcu draw_html_Export.xcu draw_jpg_Export.xcu draw_PCD_Photo_CD_Base.xcu draw_PCD_Photo_CD_Base16.xcu draw_PCD_Photo_CD_Base4.xcu draw_pdf_Export.xcu draw_png_Export.xcu draw_StarOffice_XML_Draw_Template.xcu draw_svg_Export.xcu draw_tif_Export.xcu draw_wmf_Export.xcu DXF___AutoCAD_Interchange.xcu EMF___MS_Windows_Metafile.xcu EPS___Encapsulated_PostScript.xcu FictionBook_2.xcu FreehandDocument.xcu GIF___Graphics_Interchange.xcu HTML.xcu HTML_MasterDoc.xcu HTML__StarCalc_.xcu HTML__StarWriter_.xcu impress8.xcu impress8_draw.xcu impress8_template.xcu impress_bmp_Export.xcu impress_emf_Export.xcu impress_eps_Export.xcu impress_flash_Export.xcu impress_gif_Export.xcu impress_html_Export.xcu impress_jpg_Export.xcu impress_MS_PowerPoint_2007_XML.xcu impress_MS_PowerPoint_2007_XML_AutoPlay.xcu impress_MS_PowerPoint_2007_XML_Template.xcu impress_OOXML.xcu impress_OOXML_AutoPlay.xcu impress_OOXML_Template.xcu impress_pdf_Export.xcu impress_png_Export.xcu impress_StarOffice_XML_Draw.xcu impress_StarOffice_XML_Impress_Template.xcu impress_svg_Export.xcu impress_tif_Export.xcu impress_wmf_Export.xcu JPG___JPEG.xcu Lotus.xcu LotusWordPro.xcu MacWrite.xcu Mac_Word.xcu Mac_Works.xcu Mac_Works_Calc.xcu Mariner_Write.xcu math8.xcu MathML_XML__Math_.xcu MathType_3_x.xcu math_pdf_Export.xcu MET___OS_2_Metafile.xcu mov__MOV.xcu MS_Excel_2003_XML.xcu MS_Excel_4_0.xcu MS_Excel_4_0_Vorlage_Template.xcu MS_Excel_5_0_95.xcu MS_Excel_5_0_95_Vorlage_Template.xcu MS_Excel_95.xcu MS_Excel_95_Vorlage_Template.xcu MS_Excel_97.xcu MS_Excel_97_Vorlage_Template.xcu MS_PowerPoint_97.xcu MS_PowerPoint_97_AutoPlay.xcu MS_PowerPoint_97_Vorlage.xcu MS_WinWord_5.xcu MS_WinWord_6_0.xcu MS_Word_2003_XML.xcu MS_Word_2007_XML.xcu MS_Word_2007_XML_Template.xcu MS_Word_95.xcu MS_Word_95_Vorlage.xcu MS_Word_97.xcu MS_Word_97_Vorlage.xcu MS_Works.xcu MS_Works_Calc.xcu MS_Write.xcu MWAW_Bitmap.xcu MWAW_Database.xcu MWAW_Drawing.xcu MWAW_Presentation.xcu MWAW_Spreadsheet.xcu MWAW_Text_Document.xcu ODG_FlatXML.xcu ODP_FlatXML.xcu ODS_FlatXML.xcu ODT_FlatXML.xcu OOXML_Text.xcu OOXML_Text_Template.xcu PageMakerDocument.xcu PalmDoc.xcu Palm_Text_Document.xcu PBM___Portable_Bitmap.xcu PCT___Mac_Pict.xcu PCX___Zsoft_Paintbrush.xcu PGM___Portable_Graymap.xcu Plucker_eBook.xcu PNG___Portable_Network_Graphic.xcu PPM___Portable_Pixelmap.xcu PSD___Adobe_Photoshop.xcu PublisherDocument.xcu QPro.xcu RAS___Sun_Rasterfile.xcu Rich_Text_Format.xcu Rich_Text_Format__StarCalc_.xcu SGF___StarOffice_Writer_SGF.xcu SGV___StarDraw_2_0.xcu StarBaseReport.xcu StarBaseReportChart.xcu StarOffice_XML__Base_.xcu StarOffice_XML__Calc_.xcu StarOffice_XML__Chart_.xcu StarOffice_XML__Draw_.xcu StarOffice_XML__Impress_.xcu StarOffice_XML__Math_.xcu StarOffice_XML__Writer_.xcu SVG___Scalable_Vector_Graphics.xcu SVM___StarView_Metafile.xcu SYLK.xcu T602Document.xcu Text.xcu Text__encoded_.xcu Text__encoded___StarWriter_GlobalDocument_.xcu Text__encoded___StarWriter_Web_.xcu Text__StarWriter_Web_.xcu Text___txt___csv__StarCalc_.xcu TGA___Truevision_TARGA.xcu TIF___Tag_Image_File.xcu UOF_presentation.xcu UOF_spreadsheet.xcu UOF_text.xcu VisioDocument.xcu WMF___MS_Windows_Metafile.xcu WordPerfect.xcu WordPerfectGraphics.xcu WPS_Lotus_Calc.xcu WPS_QPro_Calc.xcu WriteNow.xcu writer8.xcu writer8_template.xcu writerglobal8.xcu writerglobal8_HTML.xcu writerglobal8_template.xcu writerglobal8_writer.xcu writerweb8_writer.xcu writerweb8_writer_template.xcu writer_globaldocument_pdf_Export.xcu writer_globaldocument_StarOffice_XML_Writer.xcu writer_globaldocument_StarOffice_XML_Writer_GlobalDocument.xcu writer_jpg_Export.xcu writer_layout_dump.xcu writer_MIZI_Hwp_97.xcu writer_pdf_Export.xcu writer_png_Export.xcu writer_StarOffice_XML_Writer_Template.xcu writer_web_HTML_help.xcu writer_web_jpg_Export.xcu writer_web_pdf_Export.xcu writer_web_png_Export.xcu writer_web_StarOffice_XML_Writer.xcu writer_web_StarOffice_XML_Writer_Web_Template.xcu XBM___X_Consortium.xcu XHTML_Calc_File.xcu XHTML_Draw_File.xcu XHTML_Impress_File.xcu XHTML_Writer_File.xcu XPM.xcu

${MYCMD} --base filter/source/config/fragments/internalgraphicfilters --files bmp_Export.xcu bmp_Import.xcu dxf_Import.xcu emf_Export.xcu emf_Import.xcu eps_Export.xcu eps_Import.xcu gif_Export.xcu gif_Import.xcu jpg_Export.xcu jpg_Import.xcu met_Import.xcu mov_Import.xcu pbm_Import.xcu pcd_Import_Base.xcu pcd_Import_Base16.xcu pcd_Import_Base4.xcu pct_Import.xcu pcx_Import.xcu pgm_Import.xcu png_Export.xcu png_Import.xcu ppm_Import.xcu psd_Import.xcu ras_Import.xcu sgf_Import.xcu sgv_Import.xcu svg_Export.xcu svg_Import.xcu svm_Export.xcu svm_Import.xcu tga_Import.xcu tif_Export.xcu tif_Import.xcu wmf_Export.xcu wmf_Import.xcu xbm_Import.xcu xpm_Import.xcu

${MYCMD} --base filter/source/config/fragments/types --files bmp_MS_Windows.xcu calc8.xcu calc8_template.xcu calc_ADO_rowset_XML.xcu calc_AppleNumbers.xcu calc_ClarisWorks.xcu calc_Claris_Resolve.xcu calc_dBase.xcu calc_DIF.xcu calc_Gnumeric.xcu calc_HTML.xcu calc_Lotus.xcu calc_Mac_Works.xcu calc_MS_Excel_2003_XML.xcu calc_MS_Excel_40.xcu calc_MS_Excel_40_VorlageTemplate.xcu calc_MS_Excel_5095.xcu calc_MS_Excel_5095_VorlageTemplate.xcu calc_MS_Excel_95.xcu calc_MS_Excel_95_VorlageTemplate.xcu calc_MS_Excel_97.xcu calc_MS_Excel_97_VorlageTemplate.xcu calc_MS_Works_Document.xcu calc_ODS_FlatXML.xcu calc_OOXML.xcu calc_OOXML_Template.xcu calc_QPro.xcu calc_StarOffice_XML_Calc.xcu calc_StarOffice_XML_Calc_Template.xcu calc_SYLK.xcu calc_WPS_Lotus_Document.xcu calc_WPS_QPro_Document.xcu chart8.xcu chart_StarOffice_XML_Chart.xcu component_Bibliography.xcu component_DB.xcu draw8.xcu draw8_template.xcu draw_ClarisWorks.xcu draw_CorelDraw_Document.xcu draw_Corel_Presentation_Exchange.xcu draw_Freehand_Document.xcu draw_ODG_FlatXML.xcu draw_PageMaker_Document.xcu draw_Publisher_Document.xcu draw_StarOffice_XML_Draw.xcu draw_StarOffice_XML_Draw_Template.xcu draw_Visio_Document.xcu draw_WordPerfect_Graphics.xcu dxf_AutoCAD_Interchange.xcu emf_MS_Windows_Metafile.xcu eps_Encapsulated_PostScript.xcu generic_HTML.xcu generic_Text.xcu gif_Graphics_Interchange.xcu graphic_HTML.xcu graphic_SWF.xcu impress8.xcu impress8_template.xcu impress_AppleKeynote.xcu impress_CGM_Computer_Graphics_Metafile.xcu impress_ClarisWorks.xcu impress_MS_PowerPoint_97.xcu impress_MS_PowerPoint_97_AutoPlay.xcu impress_MS_PowerPoint_97_Vorlage.xcu impress_ODP_FlatXML.xcu impress_OOXML_Presentation.xcu impress_OOXML_Presentation_AutoPlay.xcu impress_OOXML_Presentation_Template.xcu impress_StarOffice_XML_Impress.xcu impress_StarOffice_XML_Impress_Template.xcu jpg_JPEG.xcu math8.xcu math_MathML_XML_Math.xcu math_MathType_3x.xcu math_StarOffice_XML_Math.xcu met_OS2_Metafile.xcu mov_MOV.xcu MS_Excel_2007_Binary.xcu MS_Excel_2007_VBA_XML.xcu MS_Excel_2007_XML.xcu MS_Excel_2007_XML_Template.xcu MS_PowerPoint_2007_XML.xcu MS_PowerPoint_2007_XML_AutoPlay.xcu MS_PowerPoint_2007_XML_Template.xcu MWAW_Bitmap.xcu MWAW_Database.xcu MWAW_Drawing.xcu MWAW_Presentation.xcu MWAW_Spreadsheet.xcu MWAW_Text_Document.xcu oxt_OpenOffice_Extension.xcu Palm_Text_Document.xcu pbm_Portable_Bitmap.xcu pcd_Photo_CD_Base.xcu pcd_Photo_CD_Base16.xcu pcd_Photo_CD_Base4.xcu pct_Mac_Pict.xcu pcx_Zsoft_Paintbrush.xcu pdf_Portable_Document_Format.xcu pgm_Portable_Graymap.xcu png_Portable_Network_Graphic.xcu ppm_Portable_Pixelmap.xcu psd_Adobe_Photoshop.xcu pwp_PlaceWare.xcu ras_Sun_Rasterfile.xcu sgf_StarOffice_Writer_SGF.xcu sgv_StarDraw_20.xcu StarBase.xcu StarBaseReport.xcu StarBaseReportChart.xcu svg_Scalable_Vector_Graphics.xcu svm_StarView_Metafile.xcu tga_Truevision_TARGA.xcu tif_Tag_Image_File.xcu Unified_Office_Format_presentation.xcu Unified_Office_Format_spreadsheet.xcu Unified_Office_Format_text.xcu wav_Wave_Audio_File.xcu wmf_MS_Windows_Metafile.xcu writer8.xcu writer8_template.xcu writerglobal8.xcu writerglobal8_template.xcu writerweb8_writer_template.xcu writer_AbiWord_Document.xcu writer_ApplePages.xcu writer_BroadBand_eBook.xcu writer_ClarisWorks.xcu writer_DocBook_File.xcu writer_DosWord.xcu writer_FictionBook_2.xcu writer_globaldocument_StarOffice_XML_Writer_GlobalDocument.xcu writer_layout_dump_xml.xcu writer_LotusWordPro_Document.xcu writer_MacWrite.xcu writer_Mac_Word.xcu writer_Mac_Works.xcu writer_Mariner_Write.xcu writer_MIZI_Hwp_97.xcu writer_MS_WinWord_5.xcu writer_MS_WinWord_60.xcu writer_MS_Word_2003_XML.xcu writer_MS_Word_2007_XML.xcu writer_MS_Word_2007_XML_Template.xcu writer_MS_Word_95.xcu writer_MS_Word_95_Vorlage.xcu writer_MS_Word_97.xcu writer_MS_Word_97_Vorlage.xcu writer_MS_Works_Document.xcu writer_MS_Write.xcu writer_ODT_FlatXML.xcu writer_OOXML.xcu writer_OOXML_Template.xcu writer_PalmDoc.xcu writer_Plucker_eBook.xcu writer_Rich_Text_Format.xcu writer_StarOffice_XML_Writer.xcu writer_StarOffice_XML_Writer_Template.xcu writer_T602_Document.xcu writer_web_HTML_help.xcu writer_web_StarOffice_XML_Writer_Web_Template.xcu writer_WordPerfect_Document.xcu writer_WriteNow.xcu xbm_X_Consortium.xcu XHTML_File.xcu xpm_XPM.xcu
${MYCMD} --base filter/source/config/fragments/types --files bmp_MS_Windows.xcu calc8.xcu calc8_template.xcu calc_ADO_rowset_XML.xcu calc_AppleNumbers.xcu calc_ClarisWorks.xcu calc_Claris_Resolve.xcu calc_dBase.xcu calc_DIF.xcu calc_Gnumeric.xcu calc_HTML.xcu calc_Lotus.xcu calc_Mac_Works.xcu calc_MS_Excel_2003_XML.xcu calc_MS_Excel_40.xcu calc_MS_Excel_40_VorlageTemplate.xcu calc_MS_Excel_5095.xcu calc_MS_Excel_5095_VorlageTemplate.xcu calc_MS_Excel_95.xcu calc_MS_Excel_95_VorlageTemplate.xcu calc_MS_Excel_97.xcu calc_MS_Excel_97_VorlageTemplate.xcu calc_MS_Works_Document.xcu calc_ODS_FlatXML.xcu calc_OOXML.xcu calc_OOXML_Template.xcu calc_QPro.xcu calc_StarOffice_XML_Calc.xcu calc_StarOffice_XML_Calc_Template.xcu calc_SYLK.xcu calc_WPS_Lotus_Document.xcu calc_WPS_QPro_Document.xcu chart8.xcu chart_StarOffice_XML_Chart.xcu component_Bibliography.xcu component_DB.xcu draw8.xcu draw8_template.xcu draw_ClarisWorks.xcu draw_CorelDraw_Document.xcu draw_Corel_Presentation_Exchange.xcu draw_Freehand_Document.xcu draw_ODG_FlatXML.xcu draw_PageMaker_Document.xcu draw_Publisher_Document.xcu draw_StarOffice_XML_Draw.xcu draw_StarOffice_XML_Draw_Template.xcu draw_Visio_Document.xcu draw_WordPerfect_Graphics.xcu dxf_AutoCAD_Interchange.xcu emf_MS_Windows_Metafile.xcu eps_Encapsulated_PostScript.xcu generic_HTML.xcu generic_Text.xcu gif_Graphics_Interchange.xcu graphic_HTML.xcu graphic_SWF.xcu impress8.xcu impress8_template.xcu impress_AppleKeynote.xcu impress_CGM_Computer_Graphics_Metafile.xcu impress_ClarisWorks.xcu impress_MS_PowerPoint_97.xcu impress_MS_PowerPoint_97_AutoPlay.xcu impress_MS_PowerPoint_97_Vorlage.xcu impress_ODP_FlatXML.xcu impress_OOXML_Presentation.xcu impress_OOXML_Presentation_AutoPlay.xcu impress_OOXML_Presentation_Template.xcu impress_StarOffice_XML_Impress.xcu impress_StarOffice_XML_Impress_Template.xcu jpg_JPEG.xcu math8.xcu math_MathML_XML_Math.xcu math_MathType_3x.xcu math_StarOffice_XML_Math.xcu met_OS2_Metafile.xcu mov_MOV.xcu MS_Excel_2007_Binary.xcu MS_Excel_2007_VBA_XML.xcu MS_Excel_2007_XML.xcu MS_Excel_2007_XML_Template.xcu MS_PowerPoint_2007_XML.xcu MS_PowerPoint_2007_XML_AutoPlay.xcu MS_PowerPoint_2007_XML_Template.xcu MWAW_Bitmap.xcu MWAW_Database.xcu MWAW_Drawing.xcu MWAW_Presentation.xcu MWAW_Spreadsheet.xcu MWAW_Text_Document.xcu oxt_OpenOffice_Extension.xcu Palm_Text_Document.xcu pbm_Portable_Bitmap.xcu pcd_Photo_CD_Base.xcu pcd_Photo_CD_Base16.xcu pcd_Photo_CD_Base4.xcu pct_Mac_Pict.xcu pcx_Zsoft_Paintbrush.xcu pdf_Portable_Document_Format.xcu pgm_Portable_Graymap.xcu png_Portable_Network_Graphic.xcu ppm_Portable_Pixelmap.xcu psd_Adobe_Photoshop.xcu ras_Sun_Rasterfile.xcu sgf_StarOffice_Writer_SGF.xcu sgv_StarDraw_20.xcu StarBase.xcu StarBaseReport.xcu StarBaseReportChart.xcu svg_Scalable_Vector_Graphics.xcu svm_StarView_Metafile.xcu tga_Truevision_TARGA.xcu tif_Tag_Image_File.xcu Unified_Office_Format_presentation.xcu Unified_Office_Format_spreadsheet.xcu Unified_Office_Format_text.xcu wav_Wave_Audio_File.xcu wmf_MS_Windows_Metafile.xcu writer8.xcu writer8_template.xcu writerglobal8.xcu writerglobal8_template.xcu writerweb8_writer_template.xcu writer_AbiWord_Document.xcu writer_ApplePages.xcu writer_BroadBand_eBook.xcu writer_ClarisWorks.xcu writer_DocBook_File.xcu writer_DosWord.xcu writer_FictionBook_2.xcu writer_globaldocument_StarOffice_XML_Writer_GlobalDocument.xcu writer_layout_dump_xml.xcu writer_LotusWordPro_Document.xcu writer_MacWrite.xcu writer_Mac_Word.xcu writer_Mac_Works.xcu writer_Mariner_Write.xcu writer_MIZI_Hwp_97.xcu writer_MS_WinWord_5.xcu writer_MS_WinWord_60.xcu writer_MS_Word_2003_XML.xcu writer_MS_Word_2007_XML.xcu writer_MS_Word_2007_XML_Template.xcu writer_MS_Word_95.xcu writer_MS_Word_95_Vorlage.xcu writer_MS_Word_97.xcu writer_MS_Word_97_Vorlage.xcu writer_MS_Works_Document.xcu writer_MS_Write.xcu writer_ODT_FlatXML.xcu writer_OOXML.xcu writer_OOXML_Template.xcu writer_PalmDoc.xcu writer_Plucker_eBook.xcu writer_Rich_Text_Format.xcu writer_StarOffice_XML_Writer.xcu writer_StarOffice_XML_Writer_Template.xcu writer_T602_Document.xcu writer_web_HTML_help.xcu writer_web_StarOffice_XML_Writer_Web_Template.xcu writer_WordPerfect_Document.xcu writer_WriteNow.xcu xbm_X_Consortium.xcu XHTML_File.xcu xpm_XPM.xcu

${MYCMD} --files mysqlc/source/DataAccess.xcu

diff --git a/postprocess/Rdb_services.mk b/postprocess/Rdb_services.mk
index a75315a..93f4743 100644
--- a/postprocess/Rdb_services.mk
+++ b/postprocess/Rdb_services.mk
@@ -32,7 +32,6 @@ $(eval $(call gb_Rdb_add_components,services,\
	filter/source/msfilter/msfilter \
	filter/source/odfflatxml/odfflatxml \
	filter/source/pdf/pdffilter \
	filter/source/placeware/placeware \
	filter/source/storagefilterdetect/storagefd \
	filter/source/svg/svgfilter \
	filter/source/t602/t602filter \