LCOV - code coverage report
Current view: top level - libreoffice/chart2/source/tools - MediaDescriptorHelper.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 119 0.0 %
Date: 2012-12-27 Functions: 0 3 0.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             : #include "MediaDescriptorHelper.hxx"
      21             : 
      22             : using namespace ::com::sun::star;
      23             : 
      24             : namespace apphelper
      25             : {
      26             : 
      27             : 
      28             : const short FLAG_DEPRECATED =1;
      29             : const short FLAG_MODEL      =2;
      30             : 
      31             : #define WRITE_PROPERTY( MediaName, nFlags )             \
      32             : if(rProp.Name.equals(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(#MediaName)))) \
      33             : {                                                       \
      34             :     if( rProp.Value >>= MediaName )                     \
      35             :         ISSET_##MediaName = sal_True;                   \
      36             :     if(nFlags & FLAG_DEPRECATED)                        \
      37             :     {                                                   \
      38             :         m_aDeprecatedProperties[nDeprecatedCount]=rProp;\
      39             :         nDeprecatedCount++;                             \
      40             :     }                                                   \
      41             :     else                                                \
      42             :     {                                                   \
      43             :         m_aRegularProperties[nRegularCount]=rProp;      \
      44             :         nRegularCount++;                                \
      45             :         if( nFlags & FLAG_MODEL)                        \
      46             :         {                                               \
      47             :             m_aModelProperties[nModelCount]=rProp;      \
      48             :             nModelCount++;                              \
      49             :         }                                               \
      50             :     }                                                   \
      51             : }
      52             : 
      53           0 : MediaDescriptorHelper::MediaDescriptorHelper( const uno::Sequence<
      54           0 :                         beans::PropertyValue > & rMediaDescriptor )
      55             : {
      56           0 :     impl_init();
      57             : 
      58           0 :     m_aRegularProperties.realloc(0);
      59           0 :     m_aRegularProperties.realloc(rMediaDescriptor.getLength());
      60           0 :     sal_Int32 nRegularCount = 0;
      61             : 
      62           0 :     m_aDeprecatedProperties.realloc(0);
      63           0 :     m_aDeprecatedProperties.realloc(rMediaDescriptor.getLength());
      64           0 :     sal_Int32 nDeprecatedCount = 0;
      65             : 
      66           0 :     m_aAdditionalProperties.realloc(0);
      67           0 :     m_aAdditionalProperties.realloc(rMediaDescriptor.getLength());
      68           0 :     sal_Int32 nAdditionalCount = 0;
      69             : 
      70           0 :     m_aModelProperties.realloc(0);
      71           0 :     m_aModelProperties.realloc(rMediaDescriptor.getLength());
      72           0 :     sal_Int32 nModelCount = 0;
      73             : 
      74             : 
      75             :     //read given rMediaDescriptor and store in internal structures:
      76           0 :     for( sal_Int32 i= rMediaDescriptor.getLength();i--;)
      77             :     {
      78           0 :         const beans::PropertyValue& rProp = rMediaDescriptor[i];
      79           0 :         WRITE_PROPERTY( AsTemplate, FLAG_MODEL )
      80           0 :         else WRITE_PROPERTY( Author, FLAG_MODEL )
      81           0 :         else WRITE_PROPERTY( CharacterSet, FLAG_MODEL )
      82           0 :         else WRITE_PROPERTY( Comment, FLAG_MODEL )
      83           0 :         else WRITE_PROPERTY( ComponentData, FLAG_MODEL )
      84           0 :         else WRITE_PROPERTY( FileName, FLAG_DEPRECATED )
      85           0 :         else WRITE_PROPERTY( FilterData, FLAG_MODEL )
      86           0 :         else WRITE_PROPERTY( FilterName, FLAG_MODEL )
      87           0 :         else WRITE_PROPERTY( FilterFlags, FLAG_DEPRECATED)
      88           0 :         else WRITE_PROPERTY( FilterOptions, FLAG_MODEL )
      89           0 :         else WRITE_PROPERTY( FrameName, FLAG_MODEL )
      90           0 :         else WRITE_PROPERTY( Hidden, FLAG_MODEL )
      91           0 :         else WRITE_PROPERTY( HierarchicalDocumentName, FLAG_MODEL )
      92           0 :         else WRITE_PROPERTY( OutputStream, 0 )
      93           0 :         else WRITE_PROPERTY( InputStream, 0 )
      94           0 :         else WRITE_PROPERTY( InteractionHandler, 0 )
      95           0 :         else WRITE_PROPERTY( JumpMark, 0 )
      96           0 :         else WRITE_PROPERTY( MediaType, FLAG_MODEL )
      97           0 :         else WRITE_PROPERTY( OpenFlags, FLAG_DEPRECATED )
      98           0 :         else WRITE_PROPERTY( OpenNewView, 0 )
      99           0 :         else WRITE_PROPERTY( Overwrite, FLAG_MODEL )
     100           0 :         else WRITE_PROPERTY( Password, FLAG_MODEL )
     101           0 :         else WRITE_PROPERTY( PosSize, 0 )
     102           0 :         else WRITE_PROPERTY( PostData, 0 )
     103           0 :         else WRITE_PROPERTY( PostString, FLAG_DEPRECATED )
     104           0 :         else WRITE_PROPERTY( Preview, FLAG_MODEL )
     105           0 :         else WRITE_PROPERTY( ReadOnly, 0 )
     106           0 :         else WRITE_PROPERTY( Referer, FLAG_MODEL )
     107           0 :         else WRITE_PROPERTY( SetEmbedded, 0 )
     108           0 :         else WRITE_PROPERTY( Silent, 0 )
     109           0 :         else WRITE_PROPERTY( StatusIndicator, 0 )
     110           0 :         else WRITE_PROPERTY( Storage, FLAG_MODEL )
     111           0 :         else WRITE_PROPERTY( Stream, FLAG_MODEL )
     112           0 :         else WRITE_PROPERTY( TemplateName, FLAG_DEPRECATED )
     113           0 :         else WRITE_PROPERTY( TemplateRegionName, FLAG_DEPRECATED )
     114           0 :         else WRITE_PROPERTY( Unpacked, FLAG_MODEL )
     115           0 :         else WRITE_PROPERTY( URL, FLAG_MODEL )
     116           0 :         else WRITE_PROPERTY( Version, FLAG_MODEL )
     117           0 :         else WRITE_PROPERTY( ViewData, FLAG_MODEL )
     118           0 :         else WRITE_PROPERTY( ViewId, FLAG_MODEL )
     119           0 :         else WRITE_PROPERTY( WinExtent, FLAG_DEPRECATED )
     120             :         else
     121             :         {
     122           0 :             m_aAdditionalProperties[nAdditionalCount]=rProp;
     123           0 :             nAdditionalCount++;
     124             :         }
     125             :     }
     126             : 
     127           0 :     m_aRegularProperties.realloc(nRegularCount);
     128           0 :     m_aDeprecatedProperties.realloc(nDeprecatedCount);
     129           0 :     m_aAdditionalProperties.realloc(nAdditionalCount);
     130           0 :     m_aModelProperties.realloc(nModelCount);
     131           0 : }
     132             : 
     133           0 : void MediaDescriptorHelper::impl_init()
     134             : {
     135           0 :     AsTemplate = sal_False;
     136           0 :     ISSET_AsTemplate = sal_False;
     137             : 
     138           0 :     ISSET_Author = sal_False;
     139           0 :     ISSET_CharacterSet = sal_False;
     140           0 :     ISSET_Comment = sal_False;
     141             : 
     142             : //  ::com::sun::star::uno::Any  ComponentData;
     143           0 :     ISSET_ComponentData = sal_False;
     144           0 :     ISSET_FileName = sal_False;
     145             : 
     146             : //  ::com::sun::star::uno::Any  FilterData;
     147           0 :     ISSET_FilterData = sal_False;
     148           0 :     ISSET_FilterName = sal_False;
     149           0 :     ISSET_FilterFlags = sal_False;
     150           0 :     ISSET_FilterOptions = sal_False;
     151           0 :     ISSET_FrameName = sal_False;
     152             : 
     153           0 :     Hidden = sal_False;
     154           0 :     ISSET_Hidden = sal_False;
     155           0 :     ISSET_HierarchicalDocumentName = sal_False;
     156           0 :     ISSET_OutputStream = sal_False;
     157           0 :     ISSET_InputStream = sal_False;
     158           0 :     ISSET_InteractionHandler = sal_False;
     159           0 :     ISSET_JumpMark = sal_False;
     160           0 :     ISSET_MediaType = sal_False;
     161           0 :     ISSET_OpenFlags = sal_False;
     162           0 :     OpenNewView = sal_False;
     163           0 :     ISSET_OpenNewView = sal_False;
     164           0 :     Overwrite = sal_False;
     165           0 :     ISSET_Overwrite = sal_False;
     166           0 :     ISSET_Password = sal_False;
     167             : 
     168             : //  ::com::sun::star::awt::Rectangle PosSize;
     169           0 :     ISSET_PosSize = sal_False;
     170             : 
     171             : //  ::com::sun::star::uno::Sequence< sal_Int8 > PostData;
     172           0 :     ISSET_PostData = sal_False;
     173           0 :     ISSET_PostString = sal_False;
     174           0 :     Preview = sal_False;
     175           0 :     ISSET_Preview = sal_False;
     176           0 :     ReadOnly = sal_False;
     177           0 :     ISSET_ReadOnly = sal_False;
     178           0 :     ISSET_Referer = sal_False;
     179           0 :     ISSET_StatusIndicator = sal_False;
     180           0 :     Silent = sal_False;
     181           0 :     ISSET_Silent = sal_False;
     182           0 :     ISSET_TemplateName = sal_False;
     183           0 :     ISSET_TemplateRegionName = sal_False;
     184           0 :     Unpacked = sal_False;
     185           0 :     ISSET_Unpacked = sal_False;
     186           0 :     ISSET_URL = sal_False;
     187           0 :     Version = 0;
     188           0 :     ISSET_Version = sal_False;
     189             : 
     190             : //  ::com::sun::star::uno::Any ViewData;
     191           0 :     ISSET_ViewData = sal_False;
     192           0 :     ViewId = 0;
     193           0 :     ISSET_ViewId = sal_False;
     194             : 
     195           0 :     ISSET_WinExtent = sal_False;
     196             : 
     197           0 :     ISSET_Storage = sal_False;
     198           0 :     ISSET_Stream = sal_False;
     199           0 : }
     200             : 
     201           0 :     uno::Sequence< beans::PropertyValue > MediaDescriptorHelper
     202             : ::getReducedForModel()
     203             : {
     204           0 :     return m_aModelProperties;
     205             : }
     206             : }
     207             : 
     208             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10