diff options
Diffstat (limited to 'sd/source/ui/app/sddll.cxx')
-rw-r--r-- | sd/source/ui/app/sddll.cxx | 191 |
1 files changed, 3 insertions, 188 deletions
diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx index 7cdec8c9f36b..02945586d013 100644 --- a/sd/source/ui/app/sddll.cxx +++ b/sd/source/ui/app/sddll.cxx @@ -2,13 +2,10 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2008 by Sun Microsystems, Inc. + * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite * - * $RCSfile: sddll.cxx,v $ - * $Revision: 1.17 $ - * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -30,18 +27,15 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sd.hxx" -#include <svx/eeitem.hxx> +#include <editeng/eeitem.hxx> -#include <svx/editeng.hxx> +#include <editeng/editeng.hxx> #include <svx/svdobj.hxx> #include <unotools/moduleoptions.hxx> -#ifndef _FM_FMOBJFAC_HXX #include <svx/fmobjfac.hxx> -#endif #include <svx/svdfield.hxx> #include <svx/objfac3d.hxx> - #include "sddll.hxx" #include "DrawDocShell.hxx" #include "GraphicDocShell.hxx" @@ -56,7 +50,6 @@ #include <sfx2/docfile.hxx> #include <sfx2/fcontnr.hxx> #include <tools/urlobj.hxx> -#include <svx/impgrf.hxx> #include <svtools/FilterConfigItem.hxx> #include <com/sun/star/util/XArchiver.hpp> #include <comphelper/processfactory.hxx> @@ -156,181 +149,3 @@ void SdDLL::Exit() (*ppShlPtr) = NULL; } -/* -ULONG SdDLL::DetectFilter(SfxMedium& rMedium, const SfxFilter** ppFilter, - SfxFilterFlags nMust, SfxFilterFlags nDont) -{ - ULONG nReturn = ERRCODE_ABORT; // Erkennung fehlgeschlagen, Filter ungueltig - BOOL bStorage = FALSE; - - if( *ppFilter && (*ppFilter)->GetFilterFlags() & SFX_FILTER_PACKED ) - { - uno::Reference< lang::XMultiServiceFactory > xSMgr( ::comphelper::getProcessServiceFactory() ); - uno::Reference< util::XArchiver > xPacker( xSMgr->createInstance( OUString::createFromAscii( "com.sun.star.util.Archiver" ) ), uno::UNO_QUERY ); - if( xPacker.is() ) - { - // extract extra data - OUString aPath( rMedium.GetOrigURL() ); - OUString aExtraData( xPacker->getExtraData( aPath ) ); - const OUString aSig1= OUString::createFromAscii( "private:" ); - String aTmp; - aTmp += sal_Unicode( '?' ); - aTmp += String::CreateFromAscii("simpress"); - const OUString aSig2( aTmp ); - INT32 nIndex1 = aExtraData.indexOf( aSig1 ); - INT32 nIndex2 = aExtraData.indexOf( aSig2 ); - if( nIndex1 == 0 && nIndex2 != -1 ) - return ERRCODE_NONE; - } - } - else if (rMedium.GetError() == SVSTREAM_OK) - { - if ( rMedium.IsStorage() ) - { - bStorage = TRUE; - SotStorageRef xStorage = rMedium.GetStorage(); - if ( !xStorage.Is() ) - return ULONG_MAX; - - if( SvtModuleOptions().IsImpress() ) - { - // Erkennung ueber contained streams (PowerPoint 97-Filter) - String aStreamName = UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "PowerPoint Document" ) ); - if ( xStorage->IsContained( aStreamName ) && xStorage->IsStream( aStreamName ) ) - { - String aFileName(rMedium.GetName()); - aFileName.ToUpperAscii(); - - if( aFileName.SearchAscii( ".POT" ) == STRING_NOTFOUND ) - *ppFilter = SfxFilter::GetFilterByName( pFilterPowerPoint97); - else - *ppFilter = SfxFilter::GetFilterByName( pFilterPowerPoint97Template ); - - return ERRCODE_NONE; - } - } - - const SfxFilter* pFilter = *ppFilter; - if ( *ppFilter ) - { - if ( (*ppFilter)->GetFormat() == xStorage->GetFormat() ) - pFilter = *ppFilter; - } - - if( !pFilter && SvtModuleOptions().IsImpress() ) - { - SfxFilterMatcher aMatcher( String::CreateFromAscii("simpress") ); - pFilter = aMatcher.GetFilter4ClipBoardId( xStorage->GetFormat() ); - if ( pFilter ) - *ppFilter = pFilter; - } - - if( !pFilter && SvtModuleOptions().IsDraw() ) - { - SfxFilterMatcher aMatcher( String::CreateFromAscii("sdraw") ); - pFilter = aMatcher.GetFilter4ClipBoardId( xStorage->GetFormat() ); - if ( pFilter ) - *ppFilter = pFilter; - } - - if ( pFilter && - ( pFilter->GetFilterFlags() & nMust ) == nMust && - ( pFilter->GetFilterFlags() & nDont ) == 0 ) - { - *ppFilter = pFilter; - nReturn = ERRCODE_NONE; - } - else - { - *ppFilter = NULL; - nReturn = ERRCODE_NONE; - } - } - - String aFileName( rMedium.GetName() ); - aFileName.ToUpperAscii(); - - if ( nReturn == ERRCODE_ABORT ) - { - if( bStorage ) // aber keine Clipboard-Id #55337# - { - *ppFilter = NULL; - } - else - { - // Vektorgraphik? - SvStream* pStm = rMedium.GetInStream(); - - if( !pStm ) - nReturn = ERRCODE_IO_GENERAL; - else - { - pStm->Seek( STREAM_SEEK_TO_BEGIN ); - - const String aFileName( rMedium.GetURLObject().GetMainURL( INetURLObject::NO_DECODE ) ); - GraphicDescriptor aDesc( *pStm, &aFileName ); - GraphicFilter* pGrfFilter = GetGrfFilter(); - - if( !aDesc.Detect( FALSE ) ) - { - if( SvtModuleOptions().IsImpress() ) - { - *ppFilter = NULL; - nReturn = ERRCODE_ABORT; - INetURLObject aURL( aFileName ); - if( aURL.getExtension().equalsIgnoreAsciiCaseAscii( "cgm" ) ) - { - sal_uInt8 n8; - pStm->Seek( STREAM_SEEK_TO_BEGIN ); - *pStm >> n8; - if ( ( n8 & 0xf0 ) == 0 ) // we are supporting binary cgm format only, so - { // this is a small test to exclude cgm text - const String aName = UniString::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "CGM - Computer Graphics Metafile" ) ); - SfxFilterMatcher aMatch( String::CreateFromAscii("simpress") ); - *ppFilter = aMatch.GetFilter4FilterName( aName ); - nReturn = ERRCODE_NONE; - } - } - } - } - else - { - if( SvtModuleOptions().IsDraw() ) - { - String aShortName( aDesc.GetImportFormatShortName( aDesc.GetFileFormat() ) ); - const String aName( pGrfFilter->GetImportFormatTypeName( pGrfFilter->GetImportFormatNumberForShortName( aShortName ) ) ); - - if ( *ppFilter && aShortName.EqualsIgnoreCaseAscii( "PCD" ) ) // there is a multiple pcd selection possible - { - sal_Int32 nBase = 2; // default Base0 - String aFilterTypeName( (*ppFilter)->GetRealTypeName() ); - if ( aFilterTypeName.CompareToAscii( "pcd_Photo_CD_Base4" ) == COMPARE_EQUAL ) - nBase = 1; - else if ( aFilterTypeName.CompareToAscii( "pcd_Photo_CD_Base16" ) == COMPARE_EQUAL ) - nBase = 0; - String aFilterConfigPath( RTL_CONSTASCII_USTRINGPARAM( "Office.Common/Filter/Graphic/Import/PCD" ) ); - FilterConfigItem aFilterConfigItem( aFilterConfigPath ); - aFilterConfigItem.WriteInt32( String( RTL_CONSTASCII_USTRINGPARAM( "Resolution" ) ), nBase ); - } - - SfxFilterMatcher aMatch( String::CreateFromAscii("draw") ); - *ppFilter = aMatch.GetFilter4FilterName( aName ); - nReturn = ERRCODE_NONE; - } - else - { - nReturn = ERRCODE_ABORT; - *ppFilter = NULL; - } - } - } - } - } - } - else - { - nReturn = rMedium.GetError(); - } - - return nReturn; -} */ |