diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2008-07-08 07:27:11 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2008-07-08 07:27:11 +0000 |
commit | a305501c7c4fd0c40121c14c62eb3cd135fa4f76 (patch) | |
tree | 4b3e7d306060ff6e25f21b128b8ae865836c02b0 /sfx2 | |
parent | ebecdd45588ec20f8db4019cefac09692dc9f828 (diff) |
INTEGRATION: CWS fwk90 (1.29.56); FILE MERGED
2008/06/12 04:42:00 pb 1.29.56.1: fix: #89678# added XHTML to the important export filters
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/dialog/filtergrouping.cxx | 50 |
1 files changed, 29 insertions, 21 deletions
diff --git a/sfx2/source/dialog/filtergrouping.cxx b/sfx2/source/dialog/filtergrouping.cxx index f6fe1a98fa..ef9de0aea9 100644 --- a/sfx2/source/dialog/filtergrouping.cxx +++ b/sfx2/source/dialog/filtergrouping.cxx @@ -1,13 +1,13 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: filtergrouping.cxx,v $ - * $Revision: 1.29 $ + * $Revision: 1.30 $ * * This file is part of OpenOffice.org. * @@ -1042,58 +1042,66 @@ namespace sfx2 if ( !_rxFilterManager.is() ) return; - sal_Int32 nPDFIndex = -1; - sal_Int32 nHTMLIndex = -1; + sal_Int32 nHTMLIndex = -1; + sal_Int32 nXHTMLIndex = -1; + sal_Int32 nPDFIndex = -1; sal_Int32 nFlashIndex = -1; - sal_Int32 nCount = 0; - String sPDFExtension = String::CreateFromAscii( "*.pdf" ); - String sHTMLExtension = String::CreateFromAscii( "*.htm*" ); - String sFlashExtension = String::CreateFromAscii( "*.swf" ); - WildCard aHTMLWildcardMatcher( sHTMLExtension, ';' ); - WildCard aPDFWildcardMatcher( sPDFExtension, ';' ); - WildCard aFlashWildcardMatcher( sFlashExtension, ';' ); ::rtl::OUString sUIName; ::rtl::OUString sExtensions; std::vector< ExportFilter > aImportantFilterGroup; std::vector< ExportFilter > aFilterGroup; Reference< XFilterGroupManager > xFilterGroupManager( _rxFilterManager, UNO_QUERY ); + ::rtl::OUString sTypeName; + const ::rtl::OUString sWriterHTMLType( DEFINE_CONST_OUSTRING("writer_web_HTML") ); + const ::rtl::OUString sGraphicHTMLType( DEFINE_CONST_OUSTRING("graphic_HTML") ); + const ::rtl::OUString sXHTMLType( DEFINE_CONST_OUSTRING("XHTML_File") ); + const ::rtl::OUString sPDFType( DEFINE_CONST_OUSTRING("pdf_Portable_Document_Format") ); + const ::rtl::OUString sFlashType( DEFINE_CONST_OUSTRING("graphic_SWF") ); for ( const SfxFilter* pFilter = _rFilterMatcher.First(); pFilter; pFilter = _rFilterMatcher.Next() ) { + sTypeName = pFilter->GetTypeName(); sUIName = pFilter->GetUIName(); sExtensions = pFilter->GetWildcard().GetWildCard(); - ExportFilter aExportFilter( sUIName, sExtensions ); - String aExt = sExtensions; - if ( nHTMLIndex == -1 && aHTMLWildcardMatcher.Matches( aExt )) + + if ( nHTMLIndex == -1 && + ( sTypeName.equals( sWriterHTMLType ) || sTypeName.equals( sGraphicHTMLType ) ) ) { aImportantFilterGroup.insert( aImportantFilterGroup.begin(), aExportFilter ); nHTMLIndex = 0; - nCount++; } - else if ( nPDFIndex == -1 && aPDFWildcardMatcher.Matches( aExt )) + else if ( nXHTMLIndex == -1 && sTypeName.equals( sXHTMLType ) ) { std::vector< ExportFilter >::iterator aIter = aImportantFilterGroup.begin(); if ( nHTMLIndex == -1 ) aImportantFilterGroup.insert( aIter, aExportFilter ); else aImportantFilterGroup.insert( ++aIter, aExportFilter ); + nXHTMLIndex = 0; + } + else if ( nPDFIndex == -1 && sTypeName.equals( sPDFType ) ) + { + std::vector< ExportFilter >::iterator aIter = aImportantFilterGroup.begin(); + if ( nHTMLIndex != -1 ) + aIter++; + if ( nXHTMLIndex != -1 ) + aIter++; + aImportantFilterGroup.insert( aIter, aExportFilter ); nPDFIndex = 0; - nCount++; } - else if ( nFlashIndex == -1 && aFlashWildcardMatcher.Matches( aExt )) + else if ( nFlashIndex == -1 && sTypeName.equals( sFlashType ) ) { std::vector< ExportFilter >::iterator aIter = aImportantFilterGroup.begin(); if ( nHTMLIndex != -1 ) aIter++; - + if ( nXHTMLIndex != -1 ) + aIter++; if ( nPDFIndex != -1 ) aIter++; - aImportantFilterGroup.insert( aIter, aExportFilter ); nFlashIndex = 0; - nCount++; } else aFilterGroup.push_back( aExportFilter ); |