LCOV - code coverage report
Current view: top level - sot/source/base - exchange.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 251 274 91.6 %
Date: 2014-11-03 Functions: 11 11 100.0 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.10