1*046d9d1fSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*046d9d1fSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*046d9d1fSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*046d9d1fSAndrew Rist * distributed with this work for additional information 6*046d9d1fSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*046d9d1fSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*046d9d1fSAndrew Rist * "License"); you may not use this file except in compliance 9*046d9d1fSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*046d9d1fSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*046d9d1fSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*046d9d1fSAndrew Rist * software distributed under the License is distributed on an 15*046d9d1fSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*046d9d1fSAndrew Rist * KIND, either express or implied. See the License for the 17*046d9d1fSAndrew Rist * specific language governing permissions and limitations 18*046d9d1fSAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*046d9d1fSAndrew Rist *************************************************************/ 21*046d9d1fSAndrew Rist 22*046d9d1fSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 25cdf0e10cSrcweir #include "precompiled_sot.hxx" 26cdf0e10cSrcweir #define _SOT_EXCHANGE_CXX 27cdf0e10cSrcweir #define SOT_STRING_LIST 28cdf0e10cSrcweir #define _SOT_FORMATS_INCLUDE_SYSTEMFORMATS 29cdf0e10cSrcweir #include <tools/debug.hxx> 30cdf0e10cSrcweir #include <tools/solar.h> 31cdf0e10cSrcweir #include <tools/globname.hxx> 32cdf0e10cSrcweir #include <tools/string.hxx> 33cdf0e10cSrcweir #include <sot/sotdata.hxx> 34cdf0e10cSrcweir #include <sot/exchange.hxx> 35cdf0e10cSrcweir #include <sot/formats.hxx> 36cdf0e10cSrcweir #include <sot/clsids.hxx> 37cdf0e10cSrcweir #include <rtl/instance.hxx> 38cdf0e10cSrcweir #include <com/sun/star/uno/Sequence.hxx> 39cdf0e10cSrcweir #include <com/sun/star/datatransfer/DataFlavor.hpp> 40cdf0e10cSrcweir #include <comphelper/documentconstants.hxx> 41cdf0e10cSrcweir 42cdf0e10cSrcweir using namespace::com::sun::star::uno; 43cdf0e10cSrcweir using namespace::com::sun::star::datatransfer; 44cdf0e10cSrcweir 45cdf0e10cSrcweir /* 46cdf0e10cSrcweir In diesen Tabellen stehen alle im Office verwendeten MimeTypes, 47cdf0e10cSrcweir Format-Bezeichner und Types. 48cdf0e10cSrcweir Die Tabelle ist nach den Formatstring-Ids sortiert und jede Id 49cdf0e10cSrcweir ist um genau 1 groesser als ihre Vorgaenger-Id, damit die Id als 50cdf0e10cSrcweir Tabellenindex benutzt werden kann. 51cdf0e10cSrcweir */ 52cdf0e10cSrcweir struct DataFlavorRepresentation 53cdf0e10cSrcweir { 54cdf0e10cSrcweir const char* pMimeType; 55cdf0e10cSrcweir const char* pName; 56cdf0e10cSrcweir const ::com::sun::star::uno::Type* pType; 57cdf0e10cSrcweir }; 58cdf0e10cSrcweir 59cdf0e10cSrcweir // ----------------------------------------------------------------------------- 60cdf0e10cSrcweir 61cdf0e10cSrcweir namespace 62cdf0e10cSrcweir { 63cdf0e10cSrcweir struct ImplFormatArray_Impl 64cdf0e10cSrcweir { 65cdf0e10cSrcweir const DataFlavorRepresentation* operator()() 66cdf0e10cSrcweir { 67cdf0e10cSrcweir static const DataFlavorRepresentation aInstance[] = 68cdf0e10cSrcweir { 69cdf0e10cSrcweir /* 0 SOT_FORMAT_SYSTEM_START*/ { "", "", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 70cdf0e10cSrcweir /* 1 SOT_FORMAT_STRING*/ { "text/plain;charset=utf-16", "Text", &::getCppuType( (const ::rtl::OUString*) 0 ) }, 71cdf0e10cSrcweir /* 2 SOT_FORMAT_BITMAP*/ { "application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"", "Bitmap", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 72cdf0e10cSrcweir /* 3 SOT_FORMAT_GDIMETAFILE*/ { "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"", "GDIMetaFile", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 73cdf0e10cSrcweir /* 4 SOT_FORMAT_PRIVATE*/ { "application/x-openoffice-private;windows_formatname=\"Private\"", "Private", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 74cdf0e10cSrcweir /* 5 SOT_FORMAT_FILE*/ { "application/x-openoffice-file;windows_formatname=\"FileName\"", "FileName", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 75cdf0e10cSrcweir /* 6 SOT_FORMAT_FILE_LIST*/ { "application/x-openoffice-filelist;windows_formatname=\"FileList\"", "FileList", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 76cdf0e10cSrcweir /* 7 EMPTY*/ { "", "", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 77cdf0e10cSrcweir /* 8 EMPTY*/ { "", "", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 78cdf0e10cSrcweir /* 9 EMPTY*/ { "", "", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 79cdf0e10cSrcweir /* 10 SOT_FORMAT_RTF*/ { "text/richtext", "Rich Text Format", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 80cdf0e10cSrcweir /* 11 SOT_FORMATSTR_ID_DRAWING*/ { "application/x-openoffice-drawing;windows_formatname=\"Drawing Format\"", "Drawing Format", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 81cdf0e10cSrcweir /* 12 SOT_FORMATSTR_ID_SVXB*/ { "application/x-openoffice-svxb;windows_formatname=\"SVXB (StarView Bitmap/Animation)\"", "SVXB (StarView Bitmap/Animation)", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 82cdf0e10cSrcweir /* 13 SOT_FORMATSTR_ID_SVIM*/ { "application/x-openoffice-svim;windows_formatname=\"SVIM (StarView ImageMap)\"", "SVIM (StarView ImageMap)", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 83cdf0e10cSrcweir /* 14 SOT_FORMATSTR_ID_XFA*/ { "application/x-openoffice-xfa;windows_formatname=\"XFA (XOutDev FillAttr)\"", "XFA (XOutDev FillAttr)", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 84cdf0e10cSrcweir /* 15 SOT_FORMATSTR_ID_EDITENGINE*/ { "application/x-openoffice-editengine;windows_formatname=\"EditEngineFormat\"", "EditEngineFormat", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 85cdf0e10cSrcweir /* 16 SOT_FORMATSTR_ID_INTERNALLINK_STATE*/ { "application/x-openoffice-internallink-state;windows_formatname=\"StatusInfo vom SvxInternalLink\"", "StatusInfo vom SvxInternalLink", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 86cdf0e10cSrcweir /* 17 SOT_FORMATSTR_ID_SOLK*/ { "application/x-openoffice-solk;windows_formatname=\"SOLK (StarOffice Link)\"", "SOLK (StarOffice Link)", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 87cdf0e10cSrcweir /* 18 SOT_FORMATSTR_ID_NETSCAPE_BOOKMARK*/ { "application/x-openoffice-netscape-bookmark;windows_formatname=\"Netscape Bookmark\"", "Netscape Bookmark", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 88cdf0e10cSrcweir /* 19 SOT_FORMATSTR_ID_TREELISTBOX*/ { "application/x-openoffice-treelistbox;windows_formatname=\"SV_LBOX_DD_FORMAT\"", "SV_LBOX_DD_FORMAT", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 89cdf0e10cSrcweir /* 20 SOT_FORMATSTR_ID_NATIVE*/ { "application/x-openoffice-native;windows_formatname=\"Native\"", "Native", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 90cdf0e10cSrcweir /* 21 SOT_FORMATSTR_ID_OWNERLINK*/ { "application/x-openoffice-ownerlink;windows_formatname=\"OwnerLink\"", "OwnerLink", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 91cdf0e10cSrcweir /* 22 SOT_FORMATSTR_ID_STARSERVER*/ { "application/x-openoffice-starserver;windows_formatname=\"StarServerFormat\"", "StarServerFormat", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 92cdf0e10cSrcweir /* 23 SOT_FORMATSTR_ID_STAROBJECT*/ { "application/x-openoffice-starobject;windows_formatname=\"StarObjectFormat\"", "StarObjectFormat", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 93cdf0e10cSrcweir /* 24 SOT_FORMATSTR_ID_APPLETOBJECT*/ { "application/x-openoffice-appletobject;windows_formatname=\"Applet Object\"", "Applet Object", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 94cdf0e10cSrcweir /* 25 SOT_FORMATSTR_ID_PLUGIN_OBJECT*/ { "application/x-openoffice-plugin-object;windows_formatname=\"PlugIn Object\"", "PlugIn Object", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 95cdf0e10cSrcweir /* 26 SOT_FORMATSTR_ID_STARWRITER_30*/ { "application/x-openoffice-starwriter-30;windows_formatname=\"StarWriter 3.0\"", "StarWriter 3.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 96cdf0e10cSrcweir /* 27 SOT_FORMATSTR_ID_STARWRITER_40*/ { "application/x-openoffice-starwriter-40;windows_formatname=\"StarWriter 4.0\"", "StarWriter 4.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 97cdf0e10cSrcweir /* 28 SOT_FORMATSTR_ID_STARWRITER_50*/ { "application/x-openoffice-starwriter-50;windows_formatname=\"StarWriter 5.0\"", "StarWriter 5.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 98cdf0e10cSrcweir /* 29 SOT_FORMATSTR_ID_STARWRITERWEB_40*/ { "application/x-openoffice-starwriterweb-40;windows_formatname=\"StarWriter/Web 4.0\"", "StarWriter/Web 4.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 99cdf0e10cSrcweir /* 30 SOT_FORMATSTR_ID_STARWRITERWEB_50*/ { "application/x-openoffice-starwriterweb-50;windows_formatname=\"StarWriter/Web 5.0\"", "StarWriter/Web 5.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 100cdf0e10cSrcweir /* 31 SOT_FORMATSTR_ID_STARWRITERGLOB_40*/ { "application/x-openoffice-starwriterglob-40;windows_formatname=\"StarWriter/Global 4.0\"", "StarWriter/Global 4.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 101cdf0e10cSrcweir /* 32 SOT_FORMATSTR_ID_STARWRITERGLOB_50*/ { "application/x-openoffice-starwriterglob-50;windows_formatname=\"StarWriter/Global 5.0\"", "StarWriter/Global 5.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 102cdf0e10cSrcweir /* 33 SOT_FORMATSTR_ID_STARDRAW*/ { "application/x-openoffice-stardraw;windows_formatname=\"StarDrawDocument\"", "StarDrawDocument", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 103cdf0e10cSrcweir /* 34 SOT_FORMATSTR_ID_STARDRAW_40*/ { "application/x-openoffice-stardraw-40;windows_formatname=\"StarDrawDocument 4.0\"", "StarDrawDocument 4.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 104cdf0e10cSrcweir /* 35 SOT_FORMATSTR_ID_STARIMPRESS_50*/ { "application/x-openoffice-starimpress-50;windows_formatname=\"StarImpress 5.0\"", "StarImpress 5.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 105cdf0e10cSrcweir /* 36 SOT_FORMATSTR_ID_STARDRAW_50*/ { "application/x-openoffice-stardraw-50;windows_formatname=\"StarDraw 5.0\"", "StarDraw 5.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 106cdf0e10cSrcweir /* 37 SOT_FORMATSTR_ID_STARCALC*/ { "application/x-openoffice-starcalc;windows_formatname=\"StarCalcDocument\"", "StarCalcDocument", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 107cdf0e10cSrcweir /* 38 SOT_FORMATSTR_ID_STARCALC_40*/ { "application/x-openoffice-starcalc-40;windows_formatname=\"StarCalc 4.0\"", "StarCalc 4.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 108cdf0e10cSrcweir /* 39 SOT_FORMATSTR_ID_STARCALC_50*/ { "application/x-openoffice-starcalc-50;windows_formatname=\"StarCalc 5.0\"", "StarCalc 5.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 109cdf0e10cSrcweir /* 40 SOT_FORMATSTR_ID_STARCHART*/ { "application/x-openoffice-starchart;windows_formatname=\"StarChartDocument\"", "StarChartDocument", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 110cdf0e10cSrcweir /* 41 SOT_FORMATSTR_ID_STARCHART_40*/ { "application/x-openoffice-starchart-40;windows_formatname=\"StarChartDocument 4.0\"", "StarChartDocument 4.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 111cdf0e10cSrcweir /* 42 SOT_FORMATSTR_ID_STARCHART_50*/ { "application/x-openoffice-starchart-50;windows_formatname=\"StarChart 5.0\"", "StarChart 5.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 112cdf0e10cSrcweir /* 43 SOT_FORMATSTR_ID_STARIMAGE*/ { "application/x-openoffice-starimage;windows_formatname=\"StarImageDocument\"", "StarImageDocument", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 113cdf0e10cSrcweir /* 44 SOT_FORMATSTR_ID_STARIMAGE_40*/ { "application/x-openoffice-starimage-40;windows_formatname=\"StarImageDocument 4.0\"", "StarImageDocument 4.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 114cdf0e10cSrcweir /* 45 SOT_FORMATSTR_ID_STARIMAGE_50*/ { "application/x-openoffice-starimage-50;windows_formatname=\"StarImage 5.0\"", "StarImage 5.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 115cdf0e10cSrcweir /* 46 SOT_FORMATSTR_ID_STARMATH*/ { "application/x-openoffice-starmath;windows_formatname=\"StarMath\"", "StarMath", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 116cdf0e10cSrcweir /* 47 SOT_FORMATSTR_ID_STARMATH_40*/ { "application/x-openoffice-starmath-40;windows_formatname=\"StarMathDocument 4.0\"", "StarMathDocument 4.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 117cdf0e10cSrcweir /* 48 SOT_FORMATSTR_ID_STARMATH_50*/ { "application/x-openoffice-starmath-50;windows_formatname=\"StarMath 5.0\"", "StarMath 5.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 118cdf0e10cSrcweir /* 49 SOT_FORMATSTR_ID_STAROBJECT_PAINTDOC*/ { "application/x-openoffice-starobject-paintdoc;windows_formatname=\"StarObjectPaintDocument\"", "StarObjectPaintDocument", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 119cdf0e10cSrcweir /* 50 SOT_FORMATSTR_ID_FILLED_AREA*/ { "application/x-openoffice-filled-area;windows_formatname=\"FilledArea\"", "FilledArea", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 120cdf0e10cSrcweir /* 51 SOT_FORMATSTR_ID_HTML*/ { "text/html", "HTML (HyperText Markup Language)", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 121cdf0e10cSrcweir /* 52 SOT_FORMATSTR_ID_HTML_SIMPLE*/ { "application/x-openoffice-html-simple;windows_formatname=\"HTML Format\"", "HTML Format", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 122cdf0e10cSrcweir /* 53 SOT_FORMATSTR_ID_CHAOS*/ { "application/x-openoffice-chaos;windows_formatname=\"FORMAT_CHAOS\"", "FORMAT_CHAOS", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 123cdf0e10cSrcweir /* 54 SOT_FORMATSTR_ID_CNT_MSGATTACHFILE*/ { "application/x-openoffice-cnt-msgattachfile;windows_formatname=\"CNT_MSGATTACHFILE_FORMAT\"", "CNT_MSGATTACHFILE_FORMAT", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 124cdf0e10cSrcweir /* 55 SOT_FORMATSTR_ID_BIFF_5*/ { "application/x-openoffice-biff5;windows_formatname=\"Biff5\"", "Biff5", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 125cdf0e10cSrcweir /* 56 SOT_FORMATSTR_ID_BIFF__5*/ { "application/x-openoffice-biff-5;windows_formatname=\"Biff 5\"", "Biff 5", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 126cdf0e10cSrcweir /* 57 SOT_FORMATSTR_ID_SYLK*/ { "application/x-openoffice-sylk;windows_formatname=\"Sylk\"", "Sylk", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 127cdf0e10cSrcweir /* 58 SOT_FORMATSTR_ID_SYLK_BIGCAPS*/ { "application/x-openoffice-sylk-bigcaps;windows_formatname=\"SYLK\"", "SYLK", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 128cdf0e10cSrcweir /* 59 SOT_FORMATSTR_ID_LINK*/ { "application/x-openoffice-link;windows_formatname=\"Link\"", "Link", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 129cdf0e10cSrcweir /* 60 SOT_FORMATSTR_ID_DIF*/ { "application/x-openoffice-dif;windows_formatname=\"DIF\"", "DIF", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 130cdf0e10cSrcweir /* 61 SOT_FORMATSTR_ID_STARDRAW_TABBAR*/ { "application/x-openoffice-stardraw-tabbar;windows_formatname=\"StarDraw TabBar\"", "StarDraw TabBar", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 131cdf0e10cSrcweir /* 62 SOT_FORMATSTR_ID_SONLK*/ { "application/x-openoffice-sonlk;windows_formatname=\"SONLK (StarOffice Navi Link)\"", "SONLK (StarOffice Navi Link)", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 132cdf0e10cSrcweir /* 63 SOT_FORMATSTR_ID_MSWORD_DOC*/ { "application/msword", "MSWordDoc", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 133cdf0e10cSrcweir /* 64 SOT_FORMATSTR_ID_STAR_FRAMESET_DOC*/ { "application/x-openoffice-star-frameset-doc;windows_formatname=\"StarFrameSetDocument\"", "StarFrameSetDocument", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 134cdf0e10cSrcweir /* 65 SOT_FORMATSTR_ID_OFFICE_DOC*/ { "application/x-openoffice-office-doc;windows_formatname=\"OfficeDocument\"", "OfficeDocument", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 135cdf0e10cSrcweir /* 66 SOT_FORMATSTR_ID_NOTES_DOCINFO*/ { "application/x-openoffice-notes-docinfo;windows_formatname=\"NotesDocInfo\"", "NotesDocInfo", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 136cdf0e10cSrcweir /* 67 SOT_FORMATSTR_ID_NOTES_HNOTE*/ { "application/x-openoffice-notes-hnote;windows_formatname=\"NoteshNote\"", "NoteshNote", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 137cdf0e10cSrcweir /* 68 SOT_FORMATSTR_ID_NOTES_NATIVE*/ { "application/x-openoffice-notes-native;windows_formatname=\"Native\"", "Native", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 138cdf0e10cSrcweir /* 69 SOT_FORMATSTR_ID_SFX_DOC*/ { "application/x-openoffice-sfx-doc;windows_formatname=\"SfxDocument\"", "SfxDocument", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 139cdf0e10cSrcweir /* 70 SOT_FORMATSTR_ID_EVDF*/ { "application/x-openoffice-evdf;windows_formatname=\"EVDF (Explorer View Dummy Format)\"", "EVDF (Explorer View Dummy Format)", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 140cdf0e10cSrcweir /* 71 SOT_FORMATSTR_ID_ESDF*/ { "application/x-openoffice-esdf;windows_formatname=\"ESDF (Explorer Search Dummy Format)\"", "ESDF (Explorer Search Dummy Format)", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 141cdf0e10cSrcweir /* 72 SOT_FORMATSTR_ID_IDF*/ { "application/x-openoffice-idf;windows_formatname=\"IDF (Iconview Dummy Format)\"", "IDF (Iconview Dummy Format)", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 142cdf0e10cSrcweir /* 73 SOT_FORMATSTR_ID_EFTP*/ { "application/x-openoffice-eftp;windows_formatname=\"EFTP (Explorer Ftp File)\"", "EFTP (Explorer Ftp File)", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 143cdf0e10cSrcweir /* 74 SOT_FORMATSTR_ID_EFD*/ { "application/x-openoffice-efd;windows_formatname=\"EFD (Explorer Ftp Dir)\"", "EFD (Explorer Ftp Dir)", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 144cdf0e10cSrcweir /* 75 SOT_FORMATSTR_ID_SVX_FORMFIELDEXCH*/ { "application/x-openoffice-svx-formfieldexch;windows_formatname=\"SvxFormFieldExch\"", "SvxFormFieldExch", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 145cdf0e10cSrcweir /* 76 SOT_FORMATSTR_ID_EXTENDED_TABBAR*/ { "application/x-openoffice-extended-tabbar;windows_formatname=\"ExtendedTabBar\"", "ExtendedTabBar", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 146cdf0e10cSrcweir /* 77 SOT_FORMATSTR_ID_SBA_DATAEXCHANGE*/ { "application/x-openoffice-sba-dataexchange;windows_formatname=\"SBA-DATAFORMAT\"", "SBA-DATAFORMAT", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 147cdf0e10cSrcweir /* 78 SOT_FORMATSTR_ID_SBA_FIELDDATAEXCHANGE*/ { "application/x-openoffice-sba-fielddataexchange;windows_formatname=\"SBA-FIELDFORMAT\"", "SBA-FIELDFORMAT", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 148cdf0e10cSrcweir /* 79 SOT_FORMATSTR_ID_SBA_PRIVATE_URL*/ { "application/x-openoffice-sba-private-url;windows_formatname=\"SBA-PRIVATEURLFORMAT\"", "SBA-PRIVATEURLFORMAT", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 149cdf0e10cSrcweir /* 80 SOT_FORMATSTR_ID_SBA_TABED*/ { "application/x-openofficesba-tabed;windows_formatname=\"Tabed\"", "Tabed", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 150cdf0e10cSrcweir /* 81 SOT_FORMATSTR_ID_SBA_TABID*/ { "application/x-openoffice-sba-tabid;windows_formatname=\"Tabid\"", "Tabid", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 151cdf0e10cSrcweir /* 82 SOT_FORMATSTR_ID_SBA_JOIN*/ { "application/x-openoffice-sba-join;windows_formatname=\"SBA-JOINFORMAT\"", "SBA-JOINFORMAT", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 152cdf0e10cSrcweir /* 83 SOT_FORMATSTR_ID_OBJECTDESCRIPTOR*/ { "application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"", "Star Object Descriptor (XML)", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 153cdf0e10cSrcweir /* 84 SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR*/ { "application/x-openoffice-linksrcdescriptor-xml;windows_formatname=\"Star Link Source Descriptor (XML)\"", "Star Link Source Descriptor (XML)", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 154cdf0e10cSrcweir /* 85 SOT_FORMATSTR_ID_EMBED_SOURCE*/ { "application/x-openoffice-embed-source-xml;windows_formatname=\"Star Embed Source (XML)\"", "Star Embed Source (XML)", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 155cdf0e10cSrcweir /* 86 SOT_FORMATSTR_ID_LINK_SOURCE*/ { "application/x-openoffice-link-source-xml;windows_formatname=\"Star Link Source (XML)\"", "Star Link Source (XML)", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 156cdf0e10cSrcweir /* 87 SOT_FORMATSTR_ID_EMBEDDED_OBJ*/ { "application/x-openoffice-embedded-obj-xml;windows_formatname=\"Star Embedded Object (XML)\"", "Star Embedded Object (XML)", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 157cdf0e10cSrcweir /* 88 SOT_FORMATSTR_ID_FILECONTENT*/ { "application/x-openoffice-filecontent;windows_formatname=\"FileContents\"", "FileContents", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 158cdf0e10cSrcweir /* 89 SOT_FORMATSTR_ID_FILEGRPDESCRIPTOR*/ { "application/x-openoffice-filegrpdescriptor;windows_formatname=\"FileGroupDescriptor\"", "FileGroupDescriptor", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 159cdf0e10cSrcweir /* 90 SOT_FORMATSTR_ID_FILENAME*/ { "application/x-openoffice-filename;windows_formatname=\"FileName\"", "FileName", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 160cdf0e10cSrcweir /* 91 SOT_FORMATSTR_ID_SD_OLE*/ { "application/x-openoffice-sd-ole;windows_formatname=\"SD-OLE\"", "SD-OLE", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 161cdf0e10cSrcweir /* 92 SOT_FORMATSTR_ID_EMBEDDED_OBJ_OLE*/ { "application/x-openoffice-embedded-obj-ole;windows_formatname=\"Embedded Object\"", "Embedded Object", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 162cdf0e10cSrcweir /* 93 SOT_FORMATSTR_ID_EMBED_SOURCE_OLE*/ { "application/x-openoffice-embed-source-ole;windows_formatname=\"Embed Source\"", "Embed Source", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 163cdf0e10cSrcweir /* 94 SOT_FORMATSTR_ID_OBJECTDESCRIPTOR_OLE*/ { "application/x-openoffice-objectdescriptor-ole;windows_formatname=\"Object Descriptor\"", "Object Descriptor", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 164cdf0e10cSrcweir /* 95 SOT_FORMATSTR_ID_LINKSRCDESCRIPTOR_OLE*/ { "application/x-openoffice-linkdescriptor-ole;windows_formatname=\"Link Source Descriptor\"", "Link Source Descriptor", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 165cdf0e10cSrcweir /* 96 SOT_FORMATSTR_ID_LINK_SOURCE_OLE*/ { "application/x-openoffice-link-source-ole;windows_formatname=\"Link Source\"", "Link Source", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 166cdf0e10cSrcweir /* 97 SOT_FORMATSTR_ID_SBA_CTRLDATAEXCHANGE*/ { "application/x-openoffice-sba-ctrldataexchange;windows_formatname=\"SBA-CTRLFORMAT\"", "SBA-CTRLFORMAT", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 167cdf0e10cSrcweir /* 98 SOT_FORMATSTR_ID_OUTPLACE_OBJ*/ { "application/x-openoffice-outplace-obj;windows_formatname=\"OutPlace Object\"", "OutPlace Object", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 168cdf0e10cSrcweir /* 99 SOT_FORMATSTR_ID_CNT_OWN_CLIP*/ { "application/x-openoffice-cnt-own-clip;windows_formatname=\"CntOwnClipboard\"", "CntOwnClipboard", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 169cdf0e10cSrcweir /*100 SOT_FORMATSTR_ID_INET_IMAGE*/ { "application/x-openoffice-inet-image;windows_formatname=\"SO-INet-Image\"", "SO-INet-Image", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 170cdf0e10cSrcweir /*101 SOT_FORMATSTR_ID_NETSCAPE_IMAGE*/ { "application/x-openoffice-netscape-image;windows_formatname=\"Netscape Image Format\"", "Netscape Image Format", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 171cdf0e10cSrcweir /*102 SOT_FORMATSTR_ID_SBA_FORMEXCHANGE*/ { "application/x-openoffice-sba-formexchange;windows_formatname=\"SBA_FORMEXCHANGE\"", "SBA_FORMEXCHANGE", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 172cdf0e10cSrcweir /*103 SOT_FORMATSTR_ID_SBA_REPORTEXCHANGE*/ { "application/x-openoffice-sba-reportexchange;windows_formatname=\"SBA_REPORTEXCHANGE\"", "SBA_REPORTEXCHANGE", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 173cdf0e10cSrcweir /*104 SOT_FORMATSTR_ID_UNIFORMRESOURCELOCATOR*/ { "application/x-openoffice-uniformresourcelocator;windows_formatname=\"UniformResourceLocator\"", "UniformResourceLocator", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 174cdf0e10cSrcweir /*105 SOT_FORMATSTR_ID_STARCHARTDOCUMENT_50*/ { "application/x-openoffice-starchartdocument-50;windows_formatname=\"StarChartDocument 5.0\"", "StarChartDocument 5.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 175cdf0e10cSrcweir /*106 SOT_FORMATSTR_ID_GRAPHOBJ*/ { "application/x-openoffice-graphobj;windows_formatname=\"Graphic Object\"", "Graphic Object", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 176cdf0e10cSrcweir /*107 SOT_FORMATSTR_ID_STARWRITER_60*/ { MIMETYPE_VND_SUN_XML_WRITER_ASCII, "Writer 6.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 177cdf0e10cSrcweir /*108 SOT_FORMATSTR_ID_STARWRITERWEB_60*/ { MIMETYPE_VND_SUN_XML_WRITER_WEB_ASCII, "Writer/Web 6.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 178cdf0e10cSrcweir /*109 SOT_FORMATSTR_ID_STARWRITERGLOB_60*/ { MIMETYPE_VND_SUN_XML_WRITER_GLOBAL_ASCII, "Writer/Global 6.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 179cdf0e10cSrcweir /*110 SOT_FORMATSTR_ID_STARWDRAW_60*/ { MIMETYPE_VND_SUN_XML_DRAW_ASCII, "Draw 6.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 180cdf0e10cSrcweir /*111 SOT_FORMATSTR_ID_STARIMPRESS_60*/ { MIMETYPE_VND_SUN_XML_IMPRESS_ASCII, "Impress 6.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 181cdf0e10cSrcweir /*112 SOT_FORMATSTR_ID_STARCALC_60*/ { MIMETYPE_VND_SUN_XML_CALC_ASCII, "Calc 6.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 182cdf0e10cSrcweir /*113 SOT_FORMATSTR_ID_STARCHART_60*/ { MIMETYPE_VND_SUN_XML_CHART_ASCII, "Chart 6.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 183cdf0e10cSrcweir /*114 SOT_FORMATSTR_ID_STARMATH_60*/ { MIMETYPE_VND_SUN_XML_MATH_ASCII, "Math 6.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 184cdf0e10cSrcweir /*115 SOT_FORMATSTR_ID_WMF*/ { "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"", "Windows MetaFile", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 185cdf0e10cSrcweir /*116 SOT_FORMATSTR_ID_DBACCESS_QUERY*/ { "application/x-openoffice-dbaccess-query;windows_formatname=\"Data source Query Object\"", "Data source Query Object", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 186cdf0e10cSrcweir /*117 SOT_FORMATSTR_ID_DBACCESS_TABLE*/ { "application/x-openoffice-dbaccess-table;windows_formatname=\"Data source Table\"", "Data source Table", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 187cdf0e10cSrcweir /*118 SOT_FORMATSTR_ID_DBACCESS_COMMAND*/ { "application/x-openoffice-dbaccess-command;windows_formatname=\"SQL query\"", "SQL query", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 188cdf0e10cSrcweir /*119 SOT_FORMATSTR_ID_DIALOG_60*/ { "application/vnd.sun.xml.dialog", "Dialog 6.0", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 189cdf0e10cSrcweir /*120 SOT_FORMATSTR_ID_EMF*/ { "application/x-openoffice-emf;windows_formatname=\"Image EMF\"", "Windows Enhanced MetaFile", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 190cdf0e10cSrcweir /*121 SOT_FORMATSTR_ID_BIFF_8*/ { "application/x-openoffice-biff-8;windows_formatname=\"Biff8\"", "Biff8", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 191cdf0e10cSrcweir /*122 SOT_FORMATSTR_ID_BMP*/ { "image/bmp", "Windows Bitmap", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 192cdf0e10cSrcweir /*123 SOT_FORMATSTR_ID_HTML_NO_COMMENT */ { "application/x-openoffice-html-no-comment;windows_formatname=\"HTML Format\"", "HTML (no comment)", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 193cdf0e10cSrcweir /*124 SOT_FORMATSTR_ID_STARWRITER_8*/ { MIMETYPE_OASIS_OPENDOCUMENT_TEXT_ASCII, "Writer 8", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 194cdf0e10cSrcweir /*125 SOT_FORMATSTR_ID_STARWRITERWEB_8*/ { MIMETYPE_OASIS_OPENDOCUMENT_TEXT_WEB_ASCII, "Writer/Web 8", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 195cdf0e10cSrcweir /*126 SOT_FORMATSTR_ID_STARWRITERGLOB_8*/ { MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_ASCII, "Writer/Global 8", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 196cdf0e10cSrcweir /*127 SOT_FORMATSTR_ID_STARWDRAW_8*/ { MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_ASCII, "Draw 8", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 197cdf0e10cSrcweir /*128 SOT_FORMATSTR_ID_STARIMPRESS_8*/ { MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_ASCII, "Impress 8", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 198cdf0e10cSrcweir /*129 SOT_FORMATSTR_ID_STARCALC_8*/ { MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_ASCII, "Calc 8", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 199cdf0e10cSrcweir /*130 SOT_FORMATSTR_ID_STARCHART_8*/ { MIMETYPE_OASIS_OPENDOCUMENT_CHART_ASCII, "Chart 8", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 200cdf0e10cSrcweir /*131 SOT_FORMATSTR_ID_STARMATH_8*/ { MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_ASCII, "Math 8", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 201cdf0e10cSrcweir /*132 SOT_FORMATSTR_ID_XFORMS */ { "application/x-openoffice-xforms;windows_formatname=\"??? Format\"", "???", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 202cdf0e10cSrcweir /*133 SOT_FORMATSTR_ID_STARWRITER_8_TEMPLATE*/ { MIMETYPE_OASIS_OPENDOCUMENT_TEXT_TEMPLATE_ASCII, "Writer 8 Template", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 203cdf0e10cSrcweir /*134 SOT_FORMATSTR_ID_STARWDRAW_8_TEMPLATE*/ { MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_TEMPLATE_ASCII, "Draw 8 Template", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 204cdf0e10cSrcweir /*135 SOT_FORMATSTR_ID_STARIMPRESS_8_TEMPLATE*/ { MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_TEMPLATE_ASCII, "Impress 8 Template", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 205cdf0e10cSrcweir /*136 SOT_FORMATSTR_ID_STARCALC_8_TEMPLATE*/ { MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_TEMPLATE_ASCII, "Calc 8 Template", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 206cdf0e10cSrcweir /*137 SOT_FORMATSTR_ID_STARCHART_8_TEMPLATE*/ { MIMETYPE_OASIS_OPENDOCUMENT_CHART_TEMPLATE_ASCII, "Chart 8 Template", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 207cdf0e10cSrcweir /*138 SOT_FORMATSTR_ID_STARMATH_8_TEMPLATE*/ { MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_TEMPLATE_ASCII, "Math 8 Template", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 208cdf0e10cSrcweir /*139 SOT_FORMATSTR_ID_STARBASE_8*/ { MIMETYPE_OASIS_OPENDOCUMENT_DATABASE_ASCII, "StarBase 8", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 209cdf0e10cSrcweir /*140 SOT_FORMAT_GDIMETAFILE*/ { "application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"", "High Contrast GDIMetaFile", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) }, 210cdf0e10cSrcweir }; 211cdf0e10cSrcweir return &aInstance[0]; 212cdf0e10cSrcweir } 213cdf0e10cSrcweir }; 214cdf0e10cSrcweir 215cdf0e10cSrcweir struct FormatArray_Impl 216cdf0e10cSrcweir : public rtl::StaticAggregate< 217cdf0e10cSrcweir const DataFlavorRepresentation, ImplFormatArray_Impl > {}; 218cdf0e10cSrcweir } 219cdf0e10cSrcweir 220cdf0e10cSrcweir //----------------------------------------------------------------------- 221cdf0e10cSrcweir 222cdf0e10cSrcweir static List& InitFormats_Impl() 223cdf0e10cSrcweir { 224cdf0e10cSrcweir SotData_Impl * pSotData = SOTDATA(); 225cdf0e10cSrcweir if( !pSotData->pDataFlavorList ) 226cdf0e10cSrcweir pSotData->pDataFlavorList = new List(); 227cdf0e10cSrcweir return *pSotData->pDataFlavorList; 228cdf0e10cSrcweir } 229cdf0e10cSrcweir 230cdf0e10cSrcweir /************************************************************************* 231cdf0e10cSrcweir |* 232cdf0e10cSrcweir |* SotExchange::RegisterFormatName() 233cdf0e10cSrcweir |* 234cdf0e10cSrcweir |* Beschreibung CLIP.SDW 235cdf0e10cSrcweir *************************************************************************/ 236cdf0e10cSrcweir sal_uLong SotExchange::RegisterFormatName( const String& rName ) 237cdf0e10cSrcweir { 238cdf0e10cSrcweir const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get(); 239cdf0e10cSrcweir // teste zuerst die Standard - Name 240cdf0e10cSrcweir sal_uLong i, nMax = SOT_FORMAT_FILE_LIST; 241cdf0e10cSrcweir for( i = SOT_FORMAT_STRING; i <= nMax; ++i ) 242cdf0e10cSrcweir if( COMPARE_EQUAL == rName.CompareToAscii( pFormatArray_Impl[ i ].pName ) ) 243cdf0e10cSrcweir return i; 244cdf0e10cSrcweir 245cdf0e10cSrcweir // BM: the chart format 105 ("StarChartDocument 5.0") was written 246cdf0e10cSrcweir // only into 5.1 chart documents - in 5.0 and 5.2 it was 42 ("StarChart 5.0") 247cdf0e10cSrcweir // The registry only contains the entry for the 42 format id. 248cdf0e10cSrcweir nMax = SOT_FORMATSTR_ID_USER_END; 249cdf0e10cSrcweir for( i = SOT_FORMAT_RTF; i <= nMax; ++i ) 250cdf0e10cSrcweir if( rName.EqualsAscii( pFormatArray_Impl[ i ].pName ) ) 251cdf0e10cSrcweir return ( (i == SOT_FORMATSTR_ID_STARCHARTDOCUMENT_50) 252cdf0e10cSrcweir ? SOT_FORMATSTR_ID_STARCHART_50 253cdf0e10cSrcweir : i ); 254cdf0e10cSrcweir 255cdf0e10cSrcweir // dann in der dynamischen Liste 256cdf0e10cSrcweir List& rL = InitFormats_Impl(); 257cdf0e10cSrcweir for( i = 0, nMax = rL.Count(); i < nMax; i++ ) 258cdf0e10cSrcweir { 259cdf0e10cSrcweir DataFlavor* pFlavor = (DataFlavor*) rL.GetObject( i ); 260cdf0e10cSrcweir if( pFlavor && rName == String( pFlavor->HumanPresentableName ) ) 261cdf0e10cSrcweir return i + SOT_FORMATSTR_ID_USER_END + 1; 262cdf0e10cSrcweir } 263cdf0e10cSrcweir 264cdf0e10cSrcweir // nMax ist der neue Platz 265cdf0e10cSrcweir DataFlavor* pNewFlavor = new DataFlavor; 266cdf0e10cSrcweir 267cdf0e10cSrcweir pNewFlavor->MimeType = rName; 268cdf0e10cSrcweir pNewFlavor->HumanPresentableName = rName; 269cdf0e10cSrcweir pNewFlavor->DataType = ::getCppuType( (const ::rtl::OUString*) 0 ); 270cdf0e10cSrcweir 271cdf0e10cSrcweir rL.Insert( pNewFlavor, LIST_APPEND ); 272cdf0e10cSrcweir 273cdf0e10cSrcweir return nMax + SOT_FORMATSTR_ID_USER_END + 1; 274cdf0e10cSrcweir } 275cdf0e10cSrcweir 276cdf0e10cSrcweir sal_uLong SotExchange::RegisterFormatMimeType( const String& rMimeType ) 277cdf0e10cSrcweir { 278cdf0e10cSrcweir const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get(); 279cdf0e10cSrcweir // teste zuerst die Standard - Name 280cdf0e10cSrcweir sal_uLong i, nMax = SOT_FORMAT_FILE_LIST; 281cdf0e10cSrcweir for( i = SOT_FORMAT_STRING; i <= nMax; ++i ) 282cdf0e10cSrcweir if( rMimeType.EqualsAscii( pFormatArray_Impl[ i ].pMimeType ) ) 283cdf0e10cSrcweir return i; 284cdf0e10cSrcweir 285cdf0e10cSrcweir nMax = SOT_FORMATSTR_ID_USER_END; 286cdf0e10cSrcweir for( i = SOT_FORMAT_RTF; i <= nMax; ++i ) 287cdf0e10cSrcweir if( rMimeType.EqualsAscii( pFormatArray_Impl[ i ].pMimeType ) ) 288cdf0e10cSrcweir return i; 289cdf0e10cSrcweir 290cdf0e10cSrcweir // dann in der dynamischen Liste 291cdf0e10cSrcweir List& rL = InitFormats_Impl(); 292cdf0e10cSrcweir for( i = 0, nMax = rL.Count(); i < nMax; i++ ) 293cdf0e10cSrcweir { 294cdf0e10cSrcweir DataFlavor* pFlavor = (DataFlavor*) rL.GetObject( i ); 295cdf0e10cSrcweir if( pFlavor && rMimeType == String( pFlavor->MimeType ) ) 296cdf0e10cSrcweir return i + SOT_FORMATSTR_ID_USER_END + 1; 297cdf0e10cSrcweir } 298cdf0e10cSrcweir 299cdf0e10cSrcweir // nMax ist der neue Platz 300cdf0e10cSrcweir DataFlavor* pNewFlavor = new DataFlavor; 301cdf0e10cSrcweir 302cdf0e10cSrcweir pNewFlavor->MimeType = rMimeType; 303cdf0e10cSrcweir pNewFlavor->HumanPresentableName = rMimeType; 304cdf0e10cSrcweir pNewFlavor->DataType = ::getCppuType( (const ::rtl::OUString*) 0 ); 305cdf0e10cSrcweir 306cdf0e10cSrcweir rL.Insert( pNewFlavor, LIST_APPEND ); 307cdf0e10cSrcweir 308cdf0e10cSrcweir return nMax + SOT_FORMATSTR_ID_USER_END + 1; 309cdf0e10cSrcweir } 310cdf0e10cSrcweir 311cdf0e10cSrcweir /************************************************************************* 312cdf0e10cSrcweir |* 313cdf0e10cSrcweir |* SotExchange::RegisterFormatName() 314cdf0e10cSrcweir |* 315cdf0e10cSrcweir |* Beschreibung CLIP.SDW 316cdf0e10cSrcweir *************************************************************************/ 317cdf0e10cSrcweir sal_uLong SotExchange::RegisterFormat( const DataFlavor& rFlavor ) 318cdf0e10cSrcweir { 319cdf0e10cSrcweir sal_uLong nRet = GetFormat( rFlavor ); 320cdf0e10cSrcweir 321cdf0e10cSrcweir if( !nRet ) 322cdf0e10cSrcweir { 323cdf0e10cSrcweir List& rL = InitFormats_Impl(); 324cdf0e10cSrcweir nRet = rL.Count() + SOT_FORMATSTR_ID_USER_END + 1; 325cdf0e10cSrcweir rL.Insert( new DataFlavor( rFlavor ), LIST_APPEND ); 326cdf0e10cSrcweir } 327cdf0e10cSrcweir 328cdf0e10cSrcweir return nRet; 329cdf0e10cSrcweir } 330cdf0e10cSrcweir 331cdf0e10cSrcweir /************************************************************************* 332cdf0e10cSrcweir |* 333cdf0e10cSrcweir |* SotExchange::GetFormatDataFlavor() 334cdf0e10cSrcweir |* 335cdf0e10cSrcweir *************************************************************************/ 336cdf0e10cSrcweir 337cdf0e10cSrcweir sal_Bool SotExchange::GetFormatDataFlavor( sal_uLong nFormat, DataFlavor& rFlavor ) 338cdf0e10cSrcweir { 339cdf0e10cSrcweir sal_Bool bRet; 340cdf0e10cSrcweir 341cdf0e10cSrcweir if( SOT_FORMATSTR_ID_USER_END >= nFormat ) 342cdf0e10cSrcweir { 343cdf0e10cSrcweir const DataFlavorRepresentation& rData = FormatArray_Impl::get()[nFormat]; 344cdf0e10cSrcweir rFlavor.MimeType = ::rtl::OUString::createFromAscii( rData.pMimeType ); 345cdf0e10cSrcweir rFlavor.HumanPresentableName = ::rtl::OUString::createFromAscii( rData.pName ); 346cdf0e10cSrcweir rFlavor.DataType = *rData.pType; 347cdf0e10cSrcweir 348cdf0e10cSrcweir bRet = sal_True; 349cdf0e10cSrcweir } 350cdf0e10cSrcweir else 351cdf0e10cSrcweir { 352cdf0e10cSrcweir List& rL = InitFormats_Impl(); 353cdf0e10cSrcweir 354cdf0e10cSrcweir nFormat -= SOT_FORMATSTR_ID_USER_END + 1; 355cdf0e10cSrcweir 356cdf0e10cSrcweir if( rL.Count() > nFormat ) 357cdf0e10cSrcweir { 358cdf0e10cSrcweir rFlavor = *(DataFlavor*) rL.GetObject( nFormat ); 359cdf0e10cSrcweir bRet = sal_True; 360cdf0e10cSrcweir } 361cdf0e10cSrcweir else 362cdf0e10cSrcweir { 363cdf0e10cSrcweir rFlavor = DataFlavor(); 364cdf0e10cSrcweir bRet = sal_False; 365cdf0e10cSrcweir } 366cdf0e10cSrcweir } 367cdf0e10cSrcweir 368cdf0e10cSrcweir DBG_ASSERT( bRet, "SotExchange::GetFormatDataFlavor(): DataFlavor not initialized" ); 369cdf0e10cSrcweir 370cdf0e10cSrcweir return bRet; 371cdf0e10cSrcweir } 372cdf0e10cSrcweir 373cdf0e10cSrcweir /************************************************************************* 374cdf0e10cSrcweir |* 375cdf0e10cSrcweir |* SotExchange::GetFormatMimeType( sal_uLong nFormat ) 376cdf0e10cSrcweir |* 377cdf0e10cSrcweir *************************************************************************/ 378cdf0e10cSrcweir 379cdf0e10cSrcweir String SotExchange::GetFormatMimeType( sal_uLong nFormat ) 380cdf0e10cSrcweir { 381cdf0e10cSrcweir String sMimeType; 382cdf0e10cSrcweir if( SOT_FORMATSTR_ID_USER_END >= nFormat ) 383cdf0e10cSrcweir sMimeType.AssignAscii( FormatArray_Impl::get()[nFormat].pMimeType ); 384cdf0e10cSrcweir else 385cdf0e10cSrcweir { 386cdf0e10cSrcweir List& rL = InitFormats_Impl(); 387cdf0e10cSrcweir 388cdf0e10cSrcweir nFormat -= SOT_FORMATSTR_ID_USER_END + 1; 389cdf0e10cSrcweir 390cdf0e10cSrcweir if( rL.Count() > nFormat ) 391cdf0e10cSrcweir sMimeType = ((DataFlavor*) rL.GetObject( nFormat ))->MimeType; 392cdf0e10cSrcweir } 393cdf0e10cSrcweir 394cdf0e10cSrcweir DBG_ASSERT( sMimeType.Len(), "SotExchange::GetFormatMimeType(): DataFlavor not initialized" ); 395cdf0e10cSrcweir 396cdf0e10cSrcweir return sMimeType; 397cdf0e10cSrcweir } 398cdf0e10cSrcweir 399cdf0e10cSrcweir /************************************************************************* 400cdf0e10cSrcweir |* 401cdf0e10cSrcweir |* SotExchange::GetFormatIdFromMimeType( const String& rMimeType ) 402cdf0e10cSrcweir |* 403cdf0e10cSrcweir *************************************************************************/ 404cdf0e10cSrcweir 405cdf0e10cSrcweir sal_uLong SotExchange::GetFormatIdFromMimeType( const String& rMimeType ) 406cdf0e10cSrcweir { 407cdf0e10cSrcweir const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get(); 408cdf0e10cSrcweir sal_uLong i, nMax = SOT_FORMAT_FILE_LIST; 409cdf0e10cSrcweir for( i = SOT_FORMAT_STRING; i <= nMax; ++i ) 410cdf0e10cSrcweir if( rMimeType.EqualsAscii( pFormatArray_Impl[ i ].pMimeType ) ) 411cdf0e10cSrcweir return i; 412cdf0e10cSrcweir 413cdf0e10cSrcweir // BM: the chart format 105 ("StarChartDocument 5.0") was written 414cdf0e10cSrcweir // only into 5.1 chart documents - in 5.0 and 5.2 it was 42 ("StarChart 5.0") 415cdf0e10cSrcweir // The registry only contains the entry for the 42 format id. 416cdf0e10cSrcweir nMax = SOT_FORMATSTR_ID_USER_END; 417cdf0e10cSrcweir for( i = SOT_FORMAT_RTF; i <= nMax; ++i ) 418cdf0e10cSrcweir if( rMimeType.EqualsAscii( pFormatArray_Impl[ i ].pMimeType ) ) 419cdf0e10cSrcweir return ( (i == SOT_FORMATSTR_ID_STARCHARTDOCUMENT_50) 420cdf0e10cSrcweir ? SOT_FORMATSTR_ID_STARCHART_50 421cdf0e10cSrcweir : i ); 422cdf0e10cSrcweir 423cdf0e10cSrcweir // dann in der dynamischen Liste 424cdf0e10cSrcweir List& rL = InitFormats_Impl(); 425cdf0e10cSrcweir ::rtl::OUString aMimeType( rMimeType ); 426cdf0e10cSrcweir for( i = 0, nMax = rL.Count(); i < nMax; i++ ) 427cdf0e10cSrcweir { 428cdf0e10cSrcweir DataFlavor* pFlavor = (DataFlavor*) rL.GetObject( i ); 429cdf0e10cSrcweir if( pFlavor && aMimeType == pFlavor->MimeType ) 430cdf0e10cSrcweir return i + SOT_FORMATSTR_ID_USER_END + 1; 431cdf0e10cSrcweir } 432cdf0e10cSrcweir 433cdf0e10cSrcweir return 0; 434cdf0e10cSrcweir } 435cdf0e10cSrcweir 436cdf0e10cSrcweir /************************************************************************* 437cdf0e10cSrcweir |* 438cdf0e10cSrcweir |* SotExchange::GetFormatName() 439cdf0e10cSrcweir |* 440cdf0e10cSrcweir |* Beschreibung CLIP.SDW 441cdf0e10cSrcweir *************************************************************************/ 442cdf0e10cSrcweir sal_uLong SotExchange::GetFormat( const DataFlavor& rFlavor ) 443cdf0e10cSrcweir { 444cdf0e10cSrcweir // teste zuerst die Standard - Name 445cdf0e10cSrcweir const ::rtl::OUString& rMimeType = rFlavor.MimeType; 446cdf0e10cSrcweir const String aMimeType( rMimeType ); 447cdf0e10cSrcweir sal_uLong i, nMax = SOT_FORMAT_FILE_LIST; 448cdf0e10cSrcweir const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get(); 449cdf0e10cSrcweir for( i = SOT_FORMAT_STRING; i <= nMax; ++i ) 450cdf0e10cSrcweir if( aMimeType.EqualsAscii( pFormatArray_Impl[ i ].pMimeType ) ) 451cdf0e10cSrcweir return i; 452cdf0e10cSrcweir 453cdf0e10cSrcweir // BM: the chart format 105 ("StarChartDocument 5.0") was written 454cdf0e10cSrcweir // only into 5.1 chart documents - in 5.0 and 5.2 it was 42 ("StarChart 5.0") 455cdf0e10cSrcweir // The registry only contains the entry for the 42 format id. 456cdf0e10cSrcweir nMax = SOT_FORMATSTR_ID_USER_END; 457cdf0e10cSrcweir for( i = SOT_FORMAT_RTF; i <= nMax; ++i ) 458cdf0e10cSrcweir if( aMimeType.EqualsAscii( pFormatArray_Impl[ i ].pMimeType ) ) 459cdf0e10cSrcweir return ( (i == SOT_FORMATSTR_ID_STARCHARTDOCUMENT_50) 460cdf0e10cSrcweir ? SOT_FORMATSTR_ID_STARCHART_50 461cdf0e10cSrcweir : i ); 462cdf0e10cSrcweir 463cdf0e10cSrcweir // dann in der dynamischen Liste 464cdf0e10cSrcweir List& rL = InitFormats_Impl(); 465cdf0e10cSrcweir for( i = 0, nMax = rL.Count(); i < nMax; i++ ) 466cdf0e10cSrcweir { 467cdf0e10cSrcweir DataFlavor* pFlavor = (DataFlavor*) rL.GetObject( i ); 468cdf0e10cSrcweir if( pFlavor && rMimeType == pFlavor->MimeType ) 469cdf0e10cSrcweir return i + SOT_FORMATSTR_ID_USER_END + 1; 470cdf0e10cSrcweir } 471cdf0e10cSrcweir 472cdf0e10cSrcweir return 0; 473cdf0e10cSrcweir } 474cdf0e10cSrcweir 475cdf0e10cSrcweir /************************************************************************* 476cdf0e10cSrcweir |* 477cdf0e10cSrcweir |* SotExchange::GetFormatName() 478cdf0e10cSrcweir |* 479cdf0e10cSrcweir |* Beschreibung CLIP.SDW 480cdf0e10cSrcweir *************************************************************************/ 481cdf0e10cSrcweir String SotExchange::GetFormatName( sal_uLong nFormat ) 482cdf0e10cSrcweir { 483cdf0e10cSrcweir DataFlavor aFlavor; 484cdf0e10cSrcweir String aRet; 485cdf0e10cSrcweir 486cdf0e10cSrcweir if( GetFormatDataFlavor( nFormat, aFlavor ) ) 487cdf0e10cSrcweir aRet = aFlavor.HumanPresentableName; 488cdf0e10cSrcweir 489cdf0e10cSrcweir return aRet; 490cdf0e10cSrcweir } 491cdf0e10cSrcweir 492cdf0e10cSrcweir sal_Bool SotExchange::IsInternal( const SvGlobalName& rName ) 493cdf0e10cSrcweir { 494cdf0e10cSrcweir if ( rName == SvGlobalName(SO3_SW_CLASSID_60) || 495cdf0e10cSrcweir rName == SvGlobalName(SO3_SC_CLASSID_60) || 496cdf0e10cSrcweir rName == SvGlobalName(SO3_SIMPRESS_CLASSID_60) || 497cdf0e10cSrcweir rName == SvGlobalName(SO3_SDRAW_CLASSID_60) || 498cdf0e10cSrcweir rName == SvGlobalName(SO3_SCH_CLASSID_60) || 499cdf0e10cSrcweir rName == SvGlobalName(SO3_SM_CLASSID_60) || 500cdf0e10cSrcweir rName == SvGlobalName(SO3_SWWEB_CLASSID_60) || 501cdf0e10cSrcweir rName == SvGlobalName(SO3_SWGLOB_CLASSID_60) ) 502cdf0e10cSrcweir return sal_True; 503cdf0e10cSrcweir return sal_False; 504cdf0e10cSrcweir } 505