summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2017-04-05 23:39:35 +0300
committerCaolán McNamara <caolanm@redhat.com>2017-04-11 13:37:17 +0200
commit036fcf2a4c0b630548a93bb20bd861940ba295f0 (patch)
tree8bdd9dd689f6bc0068a3f60825c7a67fdf577da2 /filter
parentf762a7772b1faa5855b07ca78b221edbaba53b59 (diff)
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>
Diffstat (limited to 'filter')
-rw-r--r--filter/Configuration_filter.mk2
-rw-r--r--filter/Library_placeware.mk45
-rw-r--r--filter/Module_filter.mk1
-rw-r--r--filter/source/config/cache/typedetection.cxx1
-rw-r--r--filter/source/config/fragments/filters/placeware_Export.xcu30
-rw-r--r--filter/source/config/fragments/types/pwp_PlaceWare.xcu29
-rw-r--r--filter/source/placeware/exporter.cxx497
-rw-r--r--filter/source/placeware/exporter.hxx53
-rw-r--r--filter/source/placeware/filter.cxx170
-rw-r--r--filter/source/placeware/filter.hxx55
-rw-r--r--filter/source/placeware/placeware.component25
-rw-r--r--filter/source/placeware/tempfile.cxx48
-rw-r--r--filter/source/placeware/tempfile.hxx42
-rw-r--r--filter/source/placeware/uno.cxx61
-rw-r--r--filter/source/placeware/zip.cxx318
-rw-r--r--filter/source/placeware/zip.hxx61
-rw-r--r--filter/source/placeware/zipfile.hxx38
17 files changed, 0 insertions, 1476 deletions
diff --git a/filter/Configuration_filter.mk b/filter/Configuration_filter.mk
index 4f0ef2ce6bb6..7f3843cd47fe 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 439293fb43c3..000000000000
--- 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 884ec28c0f38..45cd54501c03 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 b2778ebe981c..38065bce28e3 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 25aae5686006..000000000000
--- 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 70fc9adf4d13..000000000000
--- 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 d655890172b5..000000000000
--- 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 015c1a78740a..000000000000
--- 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 54f6d3539cd4..000000000000
--- 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 fc807cc17205..000000000000
--- 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 b852c2bd3457..000000000000
--- 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 6352418a1e42..000000000000
--- 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 e9608416e570..000000000000
--- 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 7f0a5eee5fc1..000000000000
--- 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 585d749fd529..000000000000
--- 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 99dc576e177f..000000000000
--- 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 92514c3ec61f..000000000000
--- 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: */