summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Quigley <gquigs@gmail.com>2015-12-01 16:46:11 -0500
committerNoel Grandin <noelgrandin@gmail.com>2015-12-02 06:34:54 +0000
commit630ec7110ec822d1d380d5181bcbb2570a129a21 (patch)
treec464683ce9ed60826e926a3370c420047398978d
parenta454a9b3ae0f6ab81012fbef7b3ff6f0f44bf6cb (diff)
tdf#92925 Remove XPM export
XPM was used to create icons but isn't used much anymore. Import supoort was tested and still works. Change-Id: I50b15bc0938c114a432e93781a92e9db38810f49 Reviewed-on: https://gerrit.libreoffice.org/20341 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--filter/Configuration_filter.mk3
-rw-r--r--filter/Library_gie.mk1
-rw-r--r--filter/source/config/fragments/filters/draw_xpm_Export.xcu30
-rw-r--r--filter/source/config/fragments/filters/impress_xpm_Export.xcu30
-rw-r--r--filter/source/config/fragments/internalgraphicfilters/xpm_Export.xcu27
-rw-r--r--filter/source/graphicfilter/expm/expm.cxx261
-rw-r--r--svtools/source/filter/exportdialog.cxx3
7 files changed, 0 insertions, 355 deletions
diff --git a/filter/Configuration_filter.mk b/filter/Configuration_filter.mk
index 759787f9cec0..a2a3cd187017 100644
--- a/filter/Configuration_filter.mk
+++ b/filter/Configuration_filter.mk
@@ -784,7 +784,6 @@ $(eval $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_drawgraphics_f
draw_svm_Export \
draw_tif_Export \
draw_wmf_Export \
- draw_xpm_Export \
))
# fcfg_impressgraphics
@@ -829,7 +828,6 @@ $(eval $(call filter_Configuration_add_filters,fcfg_langpack,fcfg_impressgraphic
impress_svm_Export \
impress_tif_Export \
impress_wmf_Export \
- impress_xpm_Export \
))
# fcfg_writergraphics
@@ -925,7 +923,6 @@ $(eval $(call filter_Configuration_add_internal_filters,fcfg_langpack,fcfg_inter
wmf_Export \
wmf_Import \
xbm_Import \
- xpm_Export \
xpm_Import \
mov_Import \
))
diff --git a/filter/Library_gie.mk b/filter/Library_gie.mk
index 8ca4f7ac6055..1bbe38157880 100644
--- a/filter/Library_gie.mk
+++ b/filter/Library_gie.mk
@@ -39,7 +39,6 @@ $(eval $(call gb_Library_use_libraries,gie,\
$(eval $(call gb_Library_add_exception_objects,gie,\
filter/source/graphicfilter/egif/egif \
- filter/source/graphicfilter/expm/expm \
filter/source/graphicfilter/etiff/etiff \
filter/source/graphicfilter/eos2met/eos2met \
filter/source/graphicfilter/epbm/epbm \
diff --git a/filter/source/config/fragments/filters/draw_xpm_Export.xcu b/filter/source/config/fragments/filters/draw_xpm_Export.xcu
deleted file mode 100644
index 5047166d9a00..000000000000
--- a/filter/source/config/fragments/filters/draw_xpm_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="draw_xpm_Export" oor:op="replace">
- <prop oor:name="Flags"><value>EXPORT ALIEN SUPPORTSSELECTION</value></prop>
- <prop oor:name="UIComponent"/>
- <prop oor:name="FilterService"/>
- <prop oor:name="UserData"><value></value></prop>
- <prop oor:name="UIName">
- <value xml:lang="en-US">XPM - X PixMap</value>
- </prop>
- <prop oor:name="FileFormatVersion"><value>0</value></prop>
- <prop oor:name="Type"><value>xpm_XPM</value></prop>
- <prop oor:name="TemplateName"/>
- <prop oor:name="DocumentService"><value>com.sun.star.drawing.DrawingDocument</value></prop>
- </node>
diff --git a/filter/source/config/fragments/filters/impress_xpm_Export.xcu b/filter/source/config/fragments/filters/impress_xpm_Export.xcu
deleted file mode 100644
index acbd457c3e31..000000000000
--- a/filter/source/config/fragments/filters/impress_xpm_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="impress_xpm_Export" oor:op="replace">
- <prop oor:name="Flags"><value>EXPORT ALIEN SUPPORTSSELECTION</value></prop>
- <prop oor:name="UIComponent"/>
- <prop oor:name="FilterService"/>
- <prop oor:name="UserData"><value></value></prop>
- <prop oor:name="UIName">
- <value xml:lang="en-US">XPM - X PixMap</value>
- </prop>
- <prop oor:name="FileFormatVersion"><value>0</value></prop>
- <prop oor:name="Type"><value>xpm_XPM</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/internalgraphicfilters/xpm_Export.xcu b/filter/source/config/fragments/internalgraphicfilters/xpm_Export.xcu
deleted file mode 100644
index c10a67083a66..000000000000
--- a/filter/source/config/fragments/internalgraphicfilters/xpm_Export.xcu
+++ /dev/null
@@ -1,27 +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="xpm_Export" oor:op="replace" >
- <prop oor:name="Type"><value>xpm_XPM</value></prop>
- <prop oor:name="FormatName"><value>exp</value></prop>
- <prop oor:name="RealFilterName"/>
- <prop oor:name="UIComponent"><value>com.sun.star.svtools.SvFilterOptionsDialog</value></prop>
- <prop oor:name="UIName">
- <value xml:lang="en-US">XPM - X PixMap</value>
- </prop>
- <prop oor:name="Flags"><value>EXPORT</value></prop>
- </node>
diff --git a/filter/source/graphicfilter/expm/expm.cxx b/filter/source/graphicfilter/expm/expm.cxx
deleted file mode 100644
index 524f1ddac9c0..000000000000
--- a/filter/source/graphicfilter/expm/expm.cxx
+++ /dev/null
@@ -1,261 +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 <vcl/graph.hxx>
-#include <vcl/bmpacc.hxx>
-#include <vcl/fltcall.hxx>
-
-//============================ XPMWriter ==================================
-
-class XPMWriter {
-
-private:
-
- SvStream& m_rOStm; // the output XPM file
-
- bool mbStatus;
- bool mbTrans;
- BitmapReadAccess* mpAcc;
- sal_uLong mnWidth, mnHeight; // size in Pixel
- sal_uInt16 mnColors;
-
- css::uno::Reference< css::task::XStatusIndicator > xStatusIndicator;
-
- void ImplCallback( sal_uInt16 nPercent );
- bool ImplWriteHeader();
- void ImplWritePalette();
- void ImplWriteColor( sal_uInt16 );
- void ImplWriteBody();
- void ImplWriteNumber( sal_Int32 );
- void ImplWritePixel( sal_uLong ) const;
-
-public:
- explicit XPMWriter(SvStream& rOStm);
- ~XPMWriter();
-
- bool WriteXPM( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem );
-};
-
-//=================== Methoden von XPMWriter ==============================
-
-XPMWriter::XPMWriter(SvStream& rOStm)
- : m_rOStm(rOStm)
- , mbStatus(true)
- , mbTrans(false)
- , mpAcc(nullptr)
- , mnWidth(0)
- , mnHeight(0)
- , mnColors(0)
-{
-}
-
-
-
-XPMWriter::~XPMWriter()
-{
-}
-
-
-
-void XPMWriter::ImplCallback( sal_uInt16 nPercent )
-{
- if ( xStatusIndicator.is() )
- {
- if ( nPercent <= 100 )
- xStatusIndicator->setValue( nPercent );
- }
-}
-
-
-
-bool XPMWriter::WriteXPM( const Graphic& rGraphic, FilterConfigItem* pFilterConfigItem)
-{
- Bitmap aBmp;
-
- if ( pFilterConfigItem )
- {
- xStatusIndicator = pFilterConfigItem->GetStatusIndicator();
- if ( xStatusIndicator.is() )
- {
- OUString aMsg;
- xStatusIndicator->start( aMsg, 100 );
- }
- }
-
- BitmapEx aBmpEx( rGraphic.GetBitmapEx() );
- aBmp = aBmpEx.GetBitmap();
-
- if ( rGraphic.IsTransparent() ) // possibly create transparent color
- {
- mbTrans = true;
- if ( aBmp.GetBitCount() >= 8 ) // if necessary convert image to 8 bit
- aBmp.Convert( BMP_CONVERSION_8BIT_TRANS );
- else
- aBmp.Convert( BMP_CONVERSION_4BIT_TRANS );
- aBmp.Replace( aBmpEx.GetMask(), BMP_COL_TRANS );
- }
- else
- {
- if ( aBmp.GetBitCount() > 8 ) // if necessary convert image to 8 bit
- aBmp.Convert( BMP_CONVERSION_8BIT_COLORS );
- }
- mpAcc = aBmp.AcquireReadAccess();
- if ( mpAcc )
- {
- SvStreamEndian nOStmOldModus = m_rOStm.GetEndian();
- m_rOStm.SetEndian( SvStreamEndian::BIG );
-
- mnColors = mpAcc->GetPaletteEntryCount();
- if ( ImplWriteHeader() )
- {
- ImplWritePalette();
- ImplWriteBody();
- m_rOStm.WriteCharPtr( "\x22XPMENDEXT\x22\x0a};" );
- }
-
- m_rOStm.SetEndian(nOStmOldModus);
-
- Bitmap::ReleaseAccess( mpAcc );
- }
- else
- mbStatus = false;
-
-
- if ( xStatusIndicator.is() )
- xStatusIndicator->end();
-
- return mbStatus;
-}
-
-
-
-bool XPMWriter::ImplWriteHeader()
-{
- mnWidth = mpAcc->Width();
- mnHeight = mpAcc->Height();
- if ( mnWidth && mnHeight && mnColors )
- {
- m_rOStm.WriteCharPtr( "/* XPM */\x0astatic char * image[] = \x0a{\x0a\x22" );
- ImplWriteNumber( mnWidth );
- m_rOStm.WriteUChar( 32 );
- ImplWriteNumber( mnHeight );
- m_rOStm.WriteUChar( 32 );
- ImplWriteNumber( mnColors );
- m_rOStm.WriteUChar( 32 );
- ImplWriteNumber( ( mnColors > 26 ) ? 2 : 1 );
- m_rOStm.WriteCharPtr( "\x22,\x0a" );
- }
- else mbStatus = false;
- return mbStatus;
-}
-
-
-
-void XPMWriter::ImplWritePalette()
-{
- sal_uInt16 nTransIndex = 0xffff;
-
- if ( mbTrans )
- nTransIndex = mpAcc->GetBestPaletteIndex( BMP_COL_TRANS );
- for ( sal_uInt16 i = 0; i < mnColors; i++ )
- {
- m_rOStm.WriteCharPtr( "\x22" );
- ImplWritePixel( i );
- m_rOStm.WriteUChar( 32 );
- if ( nTransIndex != i )
- {
- ImplWriteColor( i );
- m_rOStm.WriteCharPtr( "\x22,\x0a" );
- }
- else
- m_rOStm.WriteCharPtr( "c none\x22,\x0a" );
- }
-}
-
-
-
-void XPMWriter::ImplWriteBody()
-{
- for ( sal_uLong y = 0; y < mnHeight; y++ )
- {
- ImplCallback( (sal_uInt16)( ( 100 * y ) / mnHeight ) ); // processing output in percent
- m_rOStm.WriteUChar( 0x22 );
- for ( sal_uLong x = 0; x < mnWidth; x++ )
- {
- ImplWritePixel( mpAcc->GetPixelIndex( y, x ) );
- }
- m_rOStm.WriteCharPtr( "\x22,\x0a" );
- }
-}
-
-
-// write a decimal number in ascii format into the stream
-
-void XPMWriter::ImplWriteNumber(sal_Int32 nNumber)
-{
- const OString aNum(OString::number(nNumber));
- m_rOStm.WriteCharPtr( aNum.getStr() );
-}
-
-
-
-void XPMWriter::ImplWritePixel( sal_uLong nCol ) const
-{
- if ( mnColors > 26 )
- {
- sal_uInt8 nDiff = (sal_uInt8) ( nCol / 26 );
- m_rOStm.WriteUChar( nDiff + 'A' );
- m_rOStm.WriteUChar( nCol - ( nDiff*26 ) + 'A' );
- }
- else
- m_rOStm.WriteUChar( nCol + 'A' );
-}
-
-
-// write a color value in hex format into the stream
-void XPMWriter::ImplWriteColor( sal_uInt16 nNumber )
-{
- sal_uLong nTmp;
- sal_uInt8 j;
-
- m_rOStm.WriteCharPtr( "c #" ); // # indicates a following hex value
- const BitmapColor& rColor = mpAcc->GetPaletteColor( nNumber );
- nTmp = ( rColor.GetRed() << 16 ) | ( rColor.GetGreen() << 8 ) | rColor.GetBlue();
- for ( signed char i = 20; i >= 0 ; i-=4 )
- {
- if ( ( j = (sal_uInt8)( nTmp >> i ) & 0xf ) > 9 )
- j += 'A' - 10;
- else
- j += '0';
- m_rOStm.WriteUChar( j );
- }
-}
-
-
-extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL
-expGraphicExport( SvStream& rStream, Graphic& rGraphic, FilterConfigItem* pFilterConfigItem )
-{
- XPMWriter aXPMWriter(rStream);
-
- return aXPMWriter.WriteXPM( rGraphic, pFilterConfigItem );
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/source/filter/exportdialog.cxx b/svtools/source/filter/exportdialog.cxx
index ae331cce6c5e..6ab5ab82b7f4 100644
--- a/svtools/source/filter/exportdialog.cxx
+++ b/svtools/source/filter/exportdialog.cxx
@@ -52,7 +52,6 @@
#define FORMAT_PGM 6
#define FORMAT_PPM 7
#define FORMAT_TIF 10
-#define FORMAT_XPM 11
#define FORMAT_WMF 12
#define FORMAT_EMF 13
#define FORMAT_EPS 14
@@ -89,8 +88,6 @@ static sal_Int16 GetFilterFormat(const OUString& rExt)
nFormat = FORMAT_PPM;
else if ( rExt == "TIF" )
nFormat = FORMAT_TIF;
- else if ( rExt == "XPM" )
- nFormat = FORMAT_XPM;
else if ( rExt == "WMF" )
nFormat = FORMAT_WMF;
else if ( rExt == "EMF" )