LCOV - code coverage report
Current view: top level - sot/source/base - exchange.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 253 277 91.3 %
Date: 2015-06-13 12:38:46 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         118 :         const DataFlavorRepresentation* operator()()
      58             :         {
      59             :             static const DataFlavorRepresentation aInstance[] =
      60             :             {
      61         118 :             /*  0 SOT_FORMAT_SYSTEM_START*/                 { "", "", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      62         118 :             /*  1 SotClipboardFormatId::STRING*/                       { "text/plain;charset=utf-16", "Text", &cppu::UnoType<OUString>::get()},
      63         118 :             /*  2 SotClipboardFormatId::BITMAP*/                       { "application/x-openoffice-bitmap;windows_formatname=\"Bitmap\"", "Bitmap", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      64         118 :             /*  3 SotClipboardFormatId::GDIMETAFILE*/                  { "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"", "GDIMetaFile", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      65         118 :             /*  4 SotClipboardFormatId::PRIVATE*/                      { "application/x-openoffice-private;windows_formatname=\"Private\"", "Private", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      66         118 :             /*  5 SotClipboardFormatId::SIMPLE_FILE*/                         { "application/x-openoffice-file;windows_formatname=\"FileName\"", "FileName", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      67         118 :             /*  6 SotClipboardFormatId::FILE_LIST*/                    { "application/x-openoffice-filelist;windows_formatname=\"FileList\"", "FileList", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      68         118 :             /*  7 EMPTY*/                                   { "", "", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      69         118 :             /*  8 EMPTY*/                                   { "", "", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      70         118 :             /*  9 EMPTY*/                                   { "", "", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      71         118 :             /* 10 SotClipboardFormatId::RTF*/                          { "text/richtext", "Rich Text Format", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      72         118 :             /* 11 SotClipboardFormatId::DRAWING*/                { "application/x-openoffice-drawing;windows_formatname=\"Drawing Format\"", "Drawing Format", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      73         118 :             /* 12 SotClipboardFormatId::SVXB*/                   { "application/x-openoffice-svxb;windows_formatname=\"SVXB (StarView Bitmap/Animation)\"", "SVXB (StarView Bitmap/Animation)", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      74         118 :             /* 13 SotClipboardFormatId::SVIM*/                   { "application/x-openoffice-svim;windows_formatname=\"SVIM (StarView ImageMap)\"", "SVIM (StarView ImageMap)", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      75         118 :             /* 14 SotClipboardFormatId::XFA*/                    { "application/x-openoffice-xfa;windows_formatname=\"XFA (XOutDev FillAttr)\"", "XFA (XOutDev FillAttr)", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      76         118 :             /* 15 SotClipboardFormatId::EDITENGINE*/             { "application/x-openoffice-editengine;windows_formatname=\"EditEngineFormat\"", "EditEngineFormat", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      77         118 :             /* 16 SotClipboardFormatId::INTERNALLINK_STATE*/     { "application/x-openoffice-internallink-state;windows_formatname=\"StatusInfo vom SvxInternalLink\"", "StatusInfo vom SvxInternalLink", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      78         118 :             /* 17 SotClipboardFormatId::SOLK*/                   { "application/x-openoffice-solk;windows_formatname=\"SOLK (StarOffice Link)\"", "SOLK (StarOffice Link)", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      79         118 :             /* 18 SotClipboardFormatId::NETSCAPE_BOOKMARK*/      { "application/x-openoffice-netscape-bookmark;windows_formatname=\"Netscape Bookmark\"", "Netscape Bookmark", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      80         118 :             /* 19 SotClipboardFormatId::TREELISTBOX*/            { "application/x-openoffice-treelistbox;windows_formatname=\"SV_LBOX_DD_FORMAT\"", "SV_LBOX_DD_FORMAT", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      81         118 :             /* 20 SotClipboardFormatId::NATIVE*/                 { "application/x-openoffice-native;windows_formatname=\"Native\"", "Native", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      82         118 :             /* 21 SotClipboardFormatId::OWNERLINK*/              { "application/x-openoffice-ownerlink;windows_formatname=\"OwnerLink\"", "OwnerLink", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      83         118 :             /* 22 SotClipboardFormatId::STARSERVER*/             { "application/x-openoffice-starserver;windows_formatname=\"StarServerFormat\"", "StarServerFormat", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      84         118 :             /* 23 SotClipboardFormatId::STAROBJECT*/             { "application/x-openoffice-starobject;windows_formatname=\"StarObjectFormat\"", "StarObjectFormat", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      85         118 :             /* 24 SotClipboardFormatId::APPLETOBJECT*/           { "application/x-openoffice-appletobject;windows_formatname=\"Applet Object\"", "Applet Object", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      86         118 :             /* 25 SotClipboardFormatId::PLUGIN_OBJECT*/          { "application/x-openoffice-plugin-object;windows_formatname=\"PlugIn Object\"", "PlugIn Object", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      87         118 :             /* 26 SotClipboardFormatId::STARWRITER_30*/          { "application/x-openoffice-starwriter-30;windows_formatname=\"StarWriter 3.0\"", "StarWriter 3.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      88         118 :             /* 27 SotClipboardFormatId::STARWRITER_40*/          { "application/x-openoffice-starwriter-40;windows_formatname=\"StarWriter 4.0\"", "StarWriter 4.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      89         118 :             /* 28 SotClipboardFormatId::STARWRITER_50*/          { "application/x-openoffice-starwriter-50;windows_formatname=\"StarWriter 5.0\"", "StarWriter 5.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      90         118 :             /* 29 SotClipboardFormatId::STARWRITERWEB_40*/       { "application/x-openoffice-starwriterweb-40;windows_formatname=\"StarWriter/Web 4.0\"", "StarWriter/Web 4.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      91         118 :             /* 30 SotClipboardFormatId::STARWRITERWEB_50*/       { "application/x-openoffice-starwriterweb-50;windows_formatname=\"StarWriter/Web 5.0\"", "StarWriter/Web 5.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      92         118 :             /* 31 SotClipboardFormatId::STARWRITERGLOB_40*/      { "application/x-openoffice-starwriterglob-40;windows_formatname=\"StarWriter/Global 4.0\"", "StarWriter/Global 4.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      93         118 :             /* 32 SotClipboardFormatId::STARWRITERGLOB_50*/      { "application/x-openoffice-starwriterglob-50;windows_formatname=\"StarWriter/Global 5.0\"", "StarWriter/Global 5.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      94         118 :             /* 33 SotClipboardFormatId::STARDRAW*/               { "application/x-openoffice-stardraw;windows_formatname=\"StarDrawDocument\"", "StarDrawDocument", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      95         118 :             /* 34 SotClipboardFormatId::STARDRAW_40*/            { "application/x-openoffice-stardraw-40;windows_formatname=\"StarDrawDocument 4.0\"", "StarDrawDocument 4.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      96         118 :             /* 35 SotClipboardFormatId::STARIMPRESS_50*/         { "application/x-openoffice-starimpress-50;windows_formatname=\"StarImpress 5.0\"", "StarImpress 5.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      97         118 :             /* 36 SotClipboardFormatId::STARDRAW_50*/            { "application/x-openoffice-stardraw-50;windows_formatname=\"StarDraw 5.0\"", "StarDraw 5.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      98         118 :             /* 37 SotClipboardFormatId::STARCALC*/               { "application/x-openoffice-starcalc;windows_formatname=\"StarCalcDocument\"", "StarCalcDocument", &cppu::UnoType<Sequence<sal_Int8>>::get() },
      99         118 :             /* 38 SotClipboardFormatId::STARCALC_40*/            { "application/x-openoffice-starcalc-40;windows_formatname=\"StarCalc 4.0\"", "StarCalc 4.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     100         118 :             /* 39 SotClipboardFormatId::STARCALC_50*/            { "application/x-openoffice-starcalc-50;windows_formatname=\"StarCalc 5.0\"", "StarCalc 5.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     101         118 :             /* 40 SotClipboardFormatId::STARCHART*/              { "application/x-openoffice-starchart;windows_formatname=\"StarChartDocument\"", "StarChartDocument", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     102         118 :             /* 41 SotClipboardFormatId::STARCHART_40*/           { "application/x-openoffice-starchart-40;windows_formatname=\"StarChartDocument 4.0\"", "StarChartDocument 4.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     103         118 :             /* 42 SotClipboardFormatId::STARCHART_50*/           { "application/x-openoffice-starchart-50;windows_formatname=\"StarChart 5.0\"", "StarChart 5.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     104         118 :             /* 43 SotClipboardFormatId::STARIMAGE*/              { "application/x-openoffice-starimage;windows_formatname=\"StarImageDocument\"", "StarImageDocument", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     105         118 :             /* 44 SotClipboardFormatId::STARIMAGE_40*/           { "application/x-openoffice-starimage-40;windows_formatname=\"StarImageDocument 4.0\"", "StarImageDocument 4.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     106         118 :             /* 45 SotClipboardFormatId::STARIMAGE_50*/           { "application/x-openoffice-starimage-50;windows_formatname=\"StarImage 5.0\"", "StarImage 5.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     107         118 :             /* 46 SotClipboardFormatId::STARMATH*/               { "application/x-openoffice-starmath;windows_formatname=\"StarMath\"", "StarMath", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     108         118 :             /* 47 SotClipboardFormatId::STARMATH_40*/            { "application/x-openoffice-starmath-40;windows_formatname=\"StarMathDocument 4.0\"", "StarMathDocument 4.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     109         118 :             /* 48 SotClipboardFormatId::STARMATH_50*/            { "application/x-openoffice-starmath-50;windows_formatname=\"StarMath 5.0\"", "StarMath 5.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     110         118 :             /* 49 SotClipboardFormatId::STAROBJECT_PAINTDOC*/    { "application/x-openoffice-starobject-paintdoc;windows_formatname=\"StarObjectPaintDocument\"", "StarObjectPaintDocument", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     111         118 :             /* 50 SotClipboardFormatId::FILLED_AREA*/            { "application/x-openoffice-filled-area;windows_formatname=\"FilledArea\"", "FilledArea", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     112         118 :             /* 51 SotClipboardFormatId::HTML*/                   { "text/html", "HTML (HyperText Markup Language)", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     113         118 :             /* 52 SotClipboardFormatId::HTML_SIMPLE*/            { "application/x-openoffice-html-simple;windows_formatname=\"HTML Format\"", "HTML Format", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     114         118 :             /* 53 SotClipboardFormatId::CHAOS*/                  { "application/x-openoffice-chaos;windows_formatname=\"FORMAT_CHAOS\"", "FORMAT_CHAOS", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     115         118 :             /* 54 SotClipboardFormatId::CNT_MSGATTACHFILE*/      { "application/x-openoffice-cnt-msgattachfile;windows_formatname=\"CNT_MSGATTACHFILE_FORMAT\"", "CNT_MSGATTACHFILE_FORMAT", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     116         118 :             /* 55 SotClipboardFormatId::BIFF_5*/                 { "application/x-openoffice-biff5;windows_formatname=\"Biff5\"", "Biff5", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     117         118 :             /* 56 SotClipboardFormatId::BIFF__5*/                { "application/x-openoffice-biff-5;windows_formatname=\"Biff 5\"", "Biff 5", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     118         118 :             /* 57 SotClipboardFormatId::SYLK*/                   { "application/x-openoffice-sylk;windows_formatname=\"Sylk\"", "Sylk", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     119         118 :             /* 58 SotClipboardFormatId::SYLK_BIGCAPS*/           { "application/x-openoffice-sylk-bigcaps;windows_formatname=\"SYLK\"", "SYLK", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     120         118 :             /* 59 SotClipboardFormatId::LINK*/                   { "application/x-openoffice-link;windows_formatname=\"Link\"", "Link", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     121         118 :             /* 60 SotClipboardFormatId::DIF*/                    { "application/x-openoffice-dif;windows_formatname=\"DIF\"", "DIF", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     122         118 :             /* 61 SotClipboardFormatId::STARDRAW_TABBAR*/        { "application/x-openoffice-stardraw-tabbar;windows_formatname=\"StarDraw TabBar\"", "StarDraw TabBar", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     123         118 :             /* 62 SotClipboardFormatId::SONLK*/                  { "application/x-openoffice-sonlk;windows_formatname=\"SONLK (StarOffice Navi Link)\"", "SONLK (StarOffice Navi Link)", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     124         118 :             /* 63 SotClipboardFormatId::MSWORD_DOC*/             { "application/msword", "MSWordDoc", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     125         118 :             /* 64 SotClipboardFormatId::STAR_FRAMESET_DOC*/      { "application/x-openoffice-star-frameset-doc;windows_formatname=\"StarFrameSetDocument\"", "StarFrameSetDocument", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     126         118 :             /* 65 SotClipboardFormatId::OFFICE_DOC*/             { "application/x-openoffice-office-doc;windows_formatname=\"OfficeDocument\"", "OfficeDocument", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     127         118 :             /* 66 SotClipboardFormatId::NOTES_DOCINFO*/          { "application/x-openoffice-notes-docinfo;windows_formatname=\"NotesDocInfo\"", "NotesDocInfo", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     128         118 :             /* 67 SotClipboardFormatId::NOTES_HNOTE*/            { "application/x-openoffice-notes-hnote;windows_formatname=\"NoteshNote\"", "NoteshNote", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     129         118 :             /* 68 SotClipboardFormatId::NOTES_NATIVE*/           { "application/x-openoffice-notes-native;windows_formatname=\"Native\"", "Native", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     130         118 :             /* 69 SotClipboardFormatId::SFX_DOC*/                { "application/x-openoffice-sfx-doc;windows_formatname=\"SfxDocument\"", "SfxDocument", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     131         118 :             /* 70 SotClipboardFormatId::EVDF*/                   { "application/x-openoffice-evdf;windows_formatname=\"EVDF (Explorer View Dummy Format)\"", "EVDF (Explorer View Dummy Format)", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     132         118 :             /* 71 SotClipboardFormatId::ESDF*/                   { "application/x-openoffice-esdf;windows_formatname=\"ESDF (Explorer Search Dummy Format)\"", "ESDF (Explorer Search Dummy Format)", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     133         118 :             /* 72 SotClipboardFormatId::IDF*/                    { "application/x-openoffice-idf;windows_formatname=\"IDF (Iconview Dummy Format)\"", "IDF (Iconview Dummy Format)", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     134         118 :             /* 73 SotClipboardFormatId::EFTP*/                   { "application/x-openoffice-eftp;windows_formatname=\"EFTP (Explorer Ftp File)\"", "EFTP (Explorer Ftp File)", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     135         118 :             /* 74 SotClipboardFormatId::EFD*/                    { "application/x-openoffice-efd;windows_formatname=\"EFD (Explorer Ftp Dir)\"", "EFD (Explorer Ftp Dir)", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     136         118 :             /* 75 SotClipboardFormatId::SVX_FORMFIELDEXCH*/      { "application/x-openoffice-svx-formfieldexch;windows_formatname=\"SvxFormFieldExch\"", "SvxFormFieldExch", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     137         118 :             /* 76 SotClipboardFormatId::EXTENDED_TABBAR*/        { "application/x-openoffice-extended-tabbar;windows_formatname=\"ExtendedTabBar\"", "ExtendedTabBar", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     138         118 :             /* 77 SotClipboardFormatId::SBA_DATAEXCHANGE*/       { "application/x-openoffice-sba-dataexchange;windows_formatname=\"SBA-DATAFORMAT\"", "SBA-DATAFORMAT", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     139         118 :             /* 78 SotClipboardFormatId::SBA_FIELDDATAEXCHANGE*/  { "application/x-openoffice-sba-fielddataexchange;windows_formatname=\"SBA-FIELDFORMAT\"", "SBA-FIELDFORMAT", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     140         118 :             /* 79 SotClipboardFormatId::SBA_PRIVATE_URL*/        { "application/x-openoffice-sba-private-url;windows_formatname=\"SBA-PRIVATEURLFORMAT\"", "SBA-PRIVATEURLFORMAT", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     141         118 :             /* 80 SotClipboardFormatId::SBA_TABED*/              { "application/x-openofficesba-tabed;windows_formatname=\"Tabed\"", "Tabed", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     142         118 :             /* 81 SotClipboardFormatId::SBA_TABID*/              { "application/x-openoffice-sba-tabid;windows_formatname=\"Tabid\"", "Tabid", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     143         118 :             /* 82 SotClipboardFormatId::SBA_JOIN*/               { "application/x-openoffice-sba-join;windows_formatname=\"SBA-JOINFORMAT\"", "SBA-JOINFORMAT", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     144         118 :             /* 83 SotClipboardFormatId::OBJECTDESCRIPTOR*/       { "application/x-openoffice-objectdescriptor-xml;windows_formatname=\"Star Object Descriptor (XML)\"", "Star Object Descriptor (XML)", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     145         118 :             /* 84 SotClipboardFormatId::LINKSRCDESCRIPTOR*/      { "application/x-openoffice-linksrcdescriptor-xml;windows_formatname=\"Star Link Source Descriptor (XML)\"", "Star Link Source Descriptor (XML)", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     146         118 :             /* 85 SotClipboardFormatId::EMBED_SOURCE*/           { "application/x-openoffice-embed-source-xml;windows_formatname=\"Star Embed Source (XML)\"", "Star Embed Source (XML)", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     147         118 :             /* 86 SotClipboardFormatId::LINK_SOURCE*/            { "application/x-openoffice-link-source-xml;windows_formatname=\"Star Link Source (XML)\"", "Star Link Source (XML)", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     148         118 :             /* 87 SotClipboardFormatId::EMBEDDED_OBJ*/           { "application/x-openoffice-embedded-obj-xml;windows_formatname=\"Star Embedded Object (XML)\"", "Star Embedded Object (XML)", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     149         118 :             /* 88 SotClipboardFormatId::FILECONTENT*/            { "application/x-openoffice-filecontent;windows_formatname=\"FileContents\"", "FileContents", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     150         118 :             /* 89 SotClipboardFormatId::FILEGRPDESCRIPTOR*/      { "application/x-openoffice-filegrpdescriptor;windows_formatname=\"FileGroupDescriptor\"", "FileGroupDescriptor", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     151         118 :             /* 90 SotClipboardFormatId::FILENAME*/               { "application/x-openoffice-filename;windows_formatname=\"FileName\"", "FileName", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     152         118 :             /* 91 SotClipboardFormatId::SD_OLE*/                 { "application/x-openoffice-sd-ole;windows_formatname=\"SD-OLE\"", "SD-OLE", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     153         118 :             /* 92 SotClipboardFormatId::EMBEDDED_OBJ_OLE*/       { "application/x-openoffice-embedded-obj-ole;windows_formatname=\"Embedded Object\"", "Embedded Object", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     154         118 :             /* 93 SotClipboardFormatId::EMBED_SOURCE_OLE*/       { "application/x-openoffice-embed-source-ole;windows_formatname=\"Embed Source\"", "Embed Source", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     155         118 :             /* 94 SotClipboardFormatId::OBJECTDESCRIPTOR_OLE*/   { "application/x-openoffice-objectdescriptor-ole;windows_formatname=\"Object Descriptor\"", "Object Descriptor", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     156         118 :             /* 95 SotClipboardFormatId::LINKSRCDESCRIPTOR_OLE*/  { "application/x-openoffice-linkdescriptor-ole;windows_formatname=\"Link Source Descriptor\"", "Link Source Descriptor", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     157         118 :             /* 96 SotClipboardFormatId::LINK_SOURCE_OLE*/        { "application/x-openoffice-link-source-ole;windows_formatname=\"Link Source\"", "Link Source", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     158         118 :             /* 97 SotClipboardFormatId::SBA_CTRLDATAEXCHANGE*/   { "application/x-openoffice-sba-ctrldataexchange;windows_formatname=\"SBA-CTRLFORMAT\"", "SBA-CTRLFORMAT", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     159         118 :             /* 98 SotClipboardFormatId::OUTPLACE_OBJ*/           { "application/x-openoffice-outplace-obj;windows_formatname=\"OutPlace Object\"", "OutPlace Object", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     160         118 :             /* 99 SotClipboardFormatId::CNT_OWN_CLIP*/           { "application/x-openoffice-cnt-own-clip;windows_formatname=\"CntOwnClipboard\"", "CntOwnClipboard", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     161         118 :             /*100 SotClipboardFormatId::INET_IMAGE*/             { "application/x-openoffice-inet-image;windows_formatname=\"SO-INet-Image\"", "SO-INet-Image", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     162         118 :             /*101 SotClipboardFormatId::NETSCAPE_IMAGE*/         { "application/x-openoffice-netscape-image;windows_formatname=\"Netscape Image Format\"", "Netscape Image Format", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     163         118 :             /*102 SotClipboardFormatId::SBA_FORMEXCHANGE*/       { "application/x-openoffice-sba-formexchange;windows_formatname=\"SBA_FORMEXCHANGE\"", "SBA_FORMEXCHANGE", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     164         118 :             /*103 SotClipboardFormatId::SBA_REPORTEXCHANGE*/     { "application/x-openoffice-sba-reportexchange;windows_formatname=\"SBA_REPORTEXCHANGE\"", "SBA_REPORTEXCHANGE", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     165         118 :             /*104 SotClipboardFormatId::UNIFORMRESOURCELOCATOR*/ { "application/x-openoffice-uniformresourcelocator;windows_formatname=\"UniformResourceLocator\"", "UniformResourceLocator", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     166         118 :             /*105 SotClipboardFormatId::STARCHARTDOCUMENT_50*/   { "application/x-openoffice-starchartdocument-50;windows_formatname=\"StarChartDocument 5.0\"", "StarChartDocument 5.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     167         118 :             /*106 SotClipboardFormatId::GRAPHOBJ*/               { "application/x-openoffice-graphobj;windows_formatname=\"Graphic Object\"", "Graphic Object", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     168         118 :             /*107 SotClipboardFormatId::STARWRITER_60*/          { MIMETYPE_VND_SUN_XML_WRITER_ASCII, "Writer 6.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     169         118 :             /*108 SotClipboardFormatId::STARWRITERWEB_60*/       { MIMETYPE_VND_SUN_XML_WRITER_WEB_ASCII, "Writer/Web 6.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     170         118 :             /*109 SotClipboardFormatId::STARWRITERGLOB_60*/      { MIMETYPE_VND_SUN_XML_WRITER_GLOBAL_ASCII, "Writer/Global 6.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     171         118 :             /*110 SotClipboardFormatId::STARWDRAW_60*/           { MIMETYPE_VND_SUN_XML_DRAW_ASCII, "Draw 6.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     172         118 :             /*111 SotClipboardFormatId::STARIMPRESS_60*/         { MIMETYPE_VND_SUN_XML_IMPRESS_ASCII, "Impress 6.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     173         118 :             /*112 SotClipboardFormatId::STARCALC_60*/            { MIMETYPE_VND_SUN_XML_CALC_ASCII, "Calc 6.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     174         118 :             /*113 SotClipboardFormatId::STARCHART_60*/           { MIMETYPE_VND_SUN_XML_CHART_ASCII, "Chart 6.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     175         118 :             /*114 SotClipboardFormatId::STARMATH_60*/            { MIMETYPE_VND_SUN_XML_MATH_ASCII, "Math 6.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     176         118 :             /*115 SotClipboardFormatId::WMF*/                    { "application/x-openoffice-wmf;windows_formatname=\"Image WMF\"", "Windows MetaFile", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     177         118 :             /*116 SotClipboardFormatId::DBACCESS_QUERY*/         { "application/x-openoffice-dbaccess-query;windows_formatname=\"Data source Query Object\"", "Data source Query Object", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     178         118 :             /*117 SotClipboardFormatId::DBACCESS_TABLE*/         { "application/x-openoffice-dbaccess-table;windows_formatname=\"Data source Table\"", "Data source Table", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     179         118 :             /*118 SotClipboardFormatId::DBACCESS_COMMAND*/       { "application/x-openoffice-dbaccess-command;windows_formatname=\"SQL query\"", "SQL query", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     180         118 :             /*119 SotClipboardFormatId::DIALOG_60*/              { "application/vnd.sun.xml.dialog", "Dialog 6.0", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     181         118 :             /*120 SotClipboardFormatId::EMF*/                    { "application/x-openoffice-emf;windows_formatname=\"Image EMF\"", "Windows Enhanced MetaFile", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     182         118 :             /*121 SotClipboardFormatId::BIFF_8*/                 { "application/x-openoffice-biff-8;windows_formatname=\"Biff8\"", "Biff8", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     183         118 :             /*122 SotClipboardFormatId::BMP*/                    { "image/bmp", "Windows Bitmap", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     184         118 :             /*123 SotClipboardFormatId::HTML_NO_COMMENT */       { "application/x-openoffice-html-no-comment;windows_formatname=\"HTML Format\"", "HTML (no comment)", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     185         118 :             /*124 SotClipboardFormatId::STARWRITER_8*/          { MIMETYPE_OASIS_OPENDOCUMENT_TEXT_ASCII, "Writer 8", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     186         118 :             /*125 SotClipboardFormatId::STARWRITERWEB_8*/       { MIMETYPE_OASIS_OPENDOCUMENT_TEXT_WEB_ASCII, "Writer/Web 8", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     187         118 :             /*126 SotClipboardFormatId::STARWRITERGLOB_8*/      { MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_ASCII, "Writer/Global 8", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     188         118 :             /*127 SotClipboardFormatId::STARWDRAW_8*/           { MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_ASCII, "Draw 8", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     189         118 :             /*128 SotClipboardFormatId::STARIMPRESS_8*/         { MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_ASCII, "Impress 8", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     190         118 :             /*129 SotClipboardFormatId::STARCALC_8*/            { MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_ASCII, "Calc 8", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     191         118 :             /*130 SotClipboardFormatId::STARCHART_8*/           { MIMETYPE_OASIS_OPENDOCUMENT_CHART_ASCII, "Chart 8", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     192         118 :             /*131 SotClipboardFormatId::STARMATH_8*/            { MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_ASCII, "Math 8", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     193         118 :             /*132 SotClipboardFormatId::XFORMS */               { "application/x-openoffice-xforms;windows_formatname=\"??? Format\"", "???", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     194         118 :             /*133 SotClipboardFormatId::STARWRITER_8_TEMPLATE*/          { MIMETYPE_OASIS_OPENDOCUMENT_TEXT_TEMPLATE_ASCII, "Writer 8 Template", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     195         118 :             /*134 SotClipboardFormatId::STARWDRAW_8_TEMPLATE*/           { MIMETYPE_OASIS_OPENDOCUMENT_DRAWING_TEMPLATE_ASCII, "Draw 8 Template", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     196         118 :             /*135 SotClipboardFormatId::STARIMPRESS_8_TEMPLATE*/         { MIMETYPE_OASIS_OPENDOCUMENT_PRESENTATION_TEMPLATE_ASCII, "Impress 8 Template", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     197         118 :             /*136 SotClipboardFormatId::STARCALC_8_TEMPLATE*/            { MIMETYPE_OASIS_OPENDOCUMENT_SPREADSHEET_TEMPLATE_ASCII, "Calc 8 Template", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     198         118 :             /*137 SotClipboardFormatId::STARCHART_8_TEMPLATE*/           { MIMETYPE_OASIS_OPENDOCUMENT_CHART_TEMPLATE_ASCII, "Chart 8 Template", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     199         118 :             /*138 SotClipboardFormatId::STARMATH_8_TEMPLATE*/            { MIMETYPE_OASIS_OPENDOCUMENT_FORMULA_TEMPLATE_ASCII, "Math 8 Template", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     200         118 :             /*139 SotClipboardFormatId::STARBASE_8*/             { MIMETYPE_OASIS_OPENDOCUMENT_DATABASE_ASCII, "StarBase 8", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     201         118 :             /*140 SotClipboardFormatId::GDIMETAFILE*/                  { "application/x-openoffice-highcontrast-gdimetafile;windows_formatname=\"GDIMetaFile\"", "High Contrast GDIMetaFile", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     202         118 :             /*141 SotClipboardFormatId::PNG*/                    { "image/png", "PNG Bitmap", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     203         118 :             /*142 SotClipboardFormatId::STARWRITERGLOB_8_TEMPLATE*/      { MIMETYPE_OASIS_OPENDOCUMENT_TEXT_GLOBAL_TEMPLATE_ASCII, "Writer/Global 8 Template", &cppu::UnoType<Sequence<sal_Int8>>::get() },
     204       16992 :             };
     205         118 :         return &aInstance[0];
     206             :         }
     207             :     };
     208             : 
     209             :     struct FormatArray_Impl
     210             :         : public rtl::StaticAggregate<
     211             :             const DataFlavorRepresentation, ImplFormatArray_Impl > {};
     212             : }
     213             : 
     214         155 : static tDataFlavorList& InitFormats_Impl()
     215             : {
     216         155 :     SotData_Impl * pSotData = SOTDATA();
     217         155 :     if( !pSotData->pDataFlavorList )
     218          27 :         pSotData->pDataFlavorList = new tDataFlavorList();
     219         155 :     return *pSotData->pDataFlavorList;
     220             : }
     221             : 
     222             : /*************************************************************************
     223             : |*
     224             : |*    SotExchange::RegisterFormatName()
     225             : |*
     226             : |*    Beschreibung      CLIP.SDW
     227             : *************************************************************************/
     228         282 : SotClipboardFormatId SotExchange::RegisterFormatName( const OUString& rName )
     229             : {
     230         282 :     const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get();
     231             :     // teste zuerst die Standard - Name
     232         282 :     SotClipboardFormatId nMax = SotClipboardFormatId::FILE_LIST;
     233        1974 :     for( SotClipboardFormatId i = SotClipboardFormatId::STRING; i <= nMax;  ++i )
     234        1692 :         if( rName.equalsAscii( pFormatArray_Impl[ static_cast<int>(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         282 :     nMax = SotClipboardFormatId::USER_END;
     241       29521 :     for( SotClipboardFormatId i = SotClipboardFormatId::RTF; i <= nMax;  ++i )
     242       29492 :         if( rName.equalsAscii( pFormatArray_Impl[ static_cast<int>(i) ].pName ) )
     243         253 :             return ( (i == SotClipboardFormatId::STARCHARTDOCUMENT_50)
     244             :                      ? SotClipboardFormatId::STARCHART_50
     245         253 :                      : i );
     246             : 
     247             :     // dann in der dynamischen Liste
     248          29 :     tDataFlavorList& rL = InitFormats_Impl();
     249          97 :     for( tDataFlavorList::size_type i = 0; i < rL.size(); i++ )
     250             :     {
     251          68 :         DataFlavor* pFlavor = rL[ i ];
     252          68 :         if( pFlavor && rName == pFlavor->HumanPresentableName )
     253           0 :             return static_cast<SotClipboardFormatId>(i + static_cast<int>(SotClipboardFormatId::USER_END) + 1);
     254             :     }
     255             : 
     256             :     // nMax ist der neue Platz
     257          29 :     DataFlavor* pNewFlavor = new DataFlavor;
     258             : 
     259          29 :     pNewFlavor->MimeType = rName;
     260          29 :     pNewFlavor->HumanPresentableName = rName;
     261          29 :     pNewFlavor->DataType = cppu::UnoType<OUString>::get();
     262             : 
     263          29 :     rL.push_back( pNewFlavor );
     264             : 
     265          29 :     return static_cast<SotClipboardFormatId>(static_cast<int>(nMax) + static_cast<int>(SotClipboardFormatId::USER_END) + 1);
     266             : }
     267             : 
     268          69 : SotClipboardFormatId SotExchange::RegisterFormatMimeType( const OUString& rMimeType )
     269             : {
     270          69 :     const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get();
     271             :     // teste zuerst die Standard - Name
     272          69 :     SotClipboardFormatId nMax = SotClipboardFormatId::FILE_LIST;
     273         421 :     for( SotClipboardFormatId i = SotClipboardFormatId::STRING; i <= nMax;  ++i )
     274         383 :         if( rMimeType.equalsAscii( pFormatArray_Impl[ static_cast<int>(i) ].pMimeType ) )
     275          31 :             return i;
     276             : 
     277          38 :     nMax = SotClipboardFormatId::USER_END;
     278         114 :     for( SotClipboardFormatId i = SotClipboardFormatId::RTF; i <= nMax;  ++i )
     279         114 :         if( rMimeType.equalsAscii( pFormatArray_Impl[ static_cast<int>(i) ].pMimeType ) )
     280          38 :             return i;
     281             : 
     282             :     // dann in der dynamischen Liste
     283           0 :     tDataFlavorList& rL = InitFormats_Impl();
     284           0 :     for( tDataFlavorList::size_type i = 0; i < rL.size(); i++ )
     285             :     {
     286           0 :         DataFlavor* pFlavor = rL[ i ];
     287           0 :         if( pFlavor && rMimeType == pFlavor->MimeType )
     288           0 :             return static_cast<SotClipboardFormatId>(i + static_cast<int>(SotClipboardFormatId::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 static_cast<SotClipboardFormatId>(static_cast<int>(nMax) + static_cast<int>(SotClipboardFormatId::USER_END) + 1);
     301             : }
     302             : 
     303             : /*************************************************************************
     304             : |*
     305             : |*    SotExchange::RegisterFormatName()
     306             : |*
     307             : |*    Beschreibung      CLIP.SDW
     308             : *************************************************************************/
     309           6 : SotClipboardFormatId SotExchange::RegisterFormat( const DataFlavor& rFlavor )
     310             : {
     311           6 :     SotClipboardFormatId nRet = GetFormat( rFlavor );
     312             : 
     313           6 :     if( nRet == SotClipboardFormatId::NONE )
     314             :     {
     315           0 :         tDataFlavorList& rL = InitFormats_Impl();
     316           0 :         nRet = static_cast<SotClipboardFormatId>(rL.size() + static_cast<int>(SotClipboardFormatId::USER_END) + 1);
     317           0 :         rL.push_back( new DataFlavor( rFlavor ) );
     318             :     }
     319             : 
     320           6 :     return nRet;
     321             : }
     322             : 
     323             : /*************************************************************************
     324             : |*
     325             : |*    SotExchange::GetFormatDataFlavor()
     326             : |*
     327             : *************************************************************************/
     328             : 
     329        6052 : bool SotExchange::GetFormatDataFlavor( SotClipboardFormatId nFormat, DataFlavor& rFlavor )
     330             : {
     331             :     bool bRet;
     332             : 
     333        6052 :     if( SotClipboardFormatId::USER_END >= nFormat )
     334             :     {
     335        6038 :         const DataFlavorRepresentation& rData = FormatArray_Impl::get()[static_cast<int>(nFormat)];
     336        6038 :         rFlavor.MimeType = OUString::createFromAscii( rData.pMimeType );
     337        6038 :         rFlavor.HumanPresentableName = OUString::createFromAscii( rData.pName );
     338        6038 :         rFlavor.DataType = *rData.pType;
     339             : 
     340        6038 :         bRet = true;
     341             :     }
     342             :     else
     343             :     {
     344          14 :         tDataFlavorList& rL = InitFormats_Impl();
     345             : 
     346          14 :         unsigned i = static_cast<int>(nFormat) - static_cast<int>(SotClipboardFormatId::USER_END) + 1;
     347             : 
     348          14 :         if( rL.size() > i )
     349             :         {
     350           0 :             rFlavor = *rL[ i ];
     351           0 :             bRet = true;
     352             :         }
     353             :         else
     354             :         {
     355          14 :             rFlavor = DataFlavor();
     356          14 :             bRet = false;
     357             :         }
     358             :     }
     359             : 
     360             :     DBG_ASSERT( bRet, "SotExchange::GetFormatDataFlavor(): DataFlavor not initialized" );
     361             : 
     362        6052 :     return bRet;
     363             : }
     364             : 
     365             : /*************************************************************************
     366             : |*
     367             : |*    SotExchange::GetFormatMimeType( sal_uLong nFormat )
     368             : |*
     369             : *************************************************************************/
     370             : 
     371         136 : OUString SotExchange::GetFormatMimeType( SotClipboardFormatId nFormat )
     372             : {
     373         136 :     OUString sMimeType;
     374         136 :     if( SotClipboardFormatId::USER_END >= nFormat )
     375         136 :         sMimeType = OUString::createFromAscii( FormatArray_Impl::get()[static_cast<int>(nFormat)].pMimeType );
     376             :     else
     377             :     {
     378           0 :         tDataFlavorList& rL = InitFormats_Impl();
     379             : 
     380           0 :         unsigned i = static_cast<int>(nFormat) - static_cast<int>(SotClipboardFormatId::USER_END) + 1;
     381             : 
     382           0 :         if( rL.size() > i )
     383           0 :             sMimeType = rL[ i ]->MimeType;
     384             :     }
     385             : 
     386             :     DBG_ASSERT( !sMimeType.isEmpty(), "SotExchange::GetFormatMimeType(): DataFlavor not initialized" );
     387             : 
     388         136 :     return sMimeType;
     389             : }
     390             : 
     391             : /*************************************************************************
     392             : |*
     393             : |*    SotExchange::GetFormatIdFromMimeType( const String& rMimeType )
     394             : |*
     395             : *************************************************************************/
     396             : 
     397          77 : SotClipboardFormatId SotExchange::GetFormatIdFromMimeType( const OUString& rMimeType )
     398             : {
     399          77 :     const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get();
     400          77 :     SotClipboardFormatId nMax = SotClipboardFormatId::FILE_LIST;
     401         449 :     for( SotClipboardFormatId i = SotClipboardFormatId::STRING; i <= nMax;  ++i )
     402         387 :         if( rMimeType.equalsAscii( pFormatArray_Impl[ static_cast<int>(i) ].pMimeType ) )
     403          15 :             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          62 :     nMax = SotClipboardFormatId::USER_END;
     409        2020 :     for( SotClipboardFormatId i = SotClipboardFormatId::RTF; i <= nMax;  ++i )
     410        2006 :         if( rMimeType.equalsAscii( pFormatArray_Impl[ static_cast<int>(i) ].pMimeType ) )
     411          48 :             return ( (i == SotClipboardFormatId::STARCHARTDOCUMENT_50)
     412             :                      ? SotClipboardFormatId::STARCHART_50
     413          48 :                      : i );
     414             : 
     415             :     // dann in der dynamischen Liste
     416          14 :     tDataFlavorList& rL = InitFormats_Impl();
     417             : 
     418          32 :     for( tDataFlavorList::size_type i = 0; i < rL.size(); i++ )
     419             :     {
     420          18 :         DataFlavor* pFlavor = rL[ i ];
     421          18 :         if( pFlavor && rMimeType == pFlavor->MimeType )
     422           0 :             return static_cast<SotClipboardFormatId>(i + static_cast<int>(SotClipboardFormatId::USER_END) + 1);
     423             :     }
     424             : 
     425          14 :     return SotClipboardFormatId::NONE;
     426             : }
     427             : 
     428             : /*************************************************************************
     429             : |*
     430             : |*    SotExchange::GetFormatName()
     431             : |*
     432             : |*    Beschreibung      CLIP.SDW
     433             : *************************************************************************/
     434        3783 : SotClipboardFormatId SotExchange::GetFormat( const DataFlavor& rFlavor )
     435             : {
     436             :     // teste zuerst die Standard - Name
     437        3783 :     const OUString& rMimeType = rFlavor.MimeType;
     438             : 
     439        3783 :     SotClipboardFormatId nMax = SotClipboardFormatId::FILE_LIST;
     440        3783 :     const DataFlavorRepresentation *pFormatArray_Impl = FormatArray_Impl::get();
     441       26475 :     for( SotClipboardFormatId i = SotClipboardFormatId::STRING; i <= nMax;  ++i )
     442       22693 :         if( rMimeType.equalsAscii( pFormatArray_Impl[ static_cast<int>(i) ].pMimeType ) )
     443           1 :             return static_cast<SotClipboardFormatId>(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        3782 :     nMax = SotClipboardFormatId::USER_END;
     449      457542 :     for( SotClipboardFormatId i = SotClipboardFormatId::RTF; i <= nMax;  ++i )
     450      457444 :         if( rMimeType.equalsAscii( pFormatArray_Impl[ static_cast<int>(i) ].pMimeType ) )
     451        3684 :             return ( (i == SotClipboardFormatId::STARCHARTDOCUMENT_50)
     452             :                      ? static_cast<SotClipboardFormatId>(SotClipboardFormatId::STARCHART_50)
     453        3684 :                      : static_cast<SotClipboardFormatId>(i) );
     454             : 
     455             :     // dann in der dynamischen Liste
     456          98 :     tDataFlavorList& rL = InitFormats_Impl();
     457         464 :     for( tDataFlavorList::size_type i = 0; i < rL.size(); i++ )
     458             :     {
     459         366 :         DataFlavor* pFlavor = rL[ i ];
     460         366 :         if( pFlavor && rMimeType == pFlavor->MimeType )
     461           0 :             return static_cast<SotClipboardFormatId>(i + static_cast<int>(SotClipboardFormatId::USER_END) + 1);
     462             :     }
     463             : 
     464          98 :     return SotClipboardFormatId::NONE;
     465             : }
     466             : 
     467             : /*************************************************************************
     468             : |*
     469             : |*    SotExchange::GetFormatName()
     470             : |*
     471             : |*    Beschreibung      CLIP.SDW
     472             : *************************************************************************/
     473        1275 : OUString SotExchange::GetFormatName( SotClipboardFormatId nFormat )
     474             : {
     475        1275 :     DataFlavor  aFlavor;
     476        1275 :     OUString      aRet;
     477             : 
     478        1275 :     if( GetFormatDataFlavor( nFormat, aFlavor ) )
     479        1261 :         aRet = aFlavor.HumanPresentableName;
     480             : 
     481        1275 :     return aRet;
     482             : }
     483             : 
     484          26 : bool SotExchange::IsInternal( const SvGlobalName& rName )
     485             : {
     486         156 :     if ( rName == SvGlobalName(SO3_SW_CLASSID_60) ||
     487         130 :          rName == SvGlobalName(SO3_SC_CLASSID_60) ||
     488         130 :          rName == SvGlobalName(SO3_SIMPRESS_CLASSID_60) ||
     489         130 :          rName == SvGlobalName(SO3_SDRAW_CLASSID_60) ||
     490         110 :          rName == SvGlobalName(SO3_SCH_CLASSID_60) ||
     491          82 :          rName == SvGlobalName(SO3_SM_CLASSID_60) ||
     492         152 :          rName == SvGlobalName(SO3_SWWEB_CLASSID_60) ||
     493          50 :          rName == SvGlobalName(SO3_SWGLOB_CLASSID_60) )
     494          14 :         return true;
     495          12 :     return false;
     496             : }
     497             : 
     498             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11