LCOV - code coverage report
Current view: top level - sdext/source/minimizer - configurationaccess.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 0 250 0.0 %
Date: 2015-06-13 12:38:46 Functions: 0 19 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             : 
      21             : #include "configurationaccess.hxx"
      22             : #include <com/sun/star/frame/XComponentLoader.hpp>
      23             : #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
      24             : #include <com/sun/star/configuration/theDefaultProvider.hpp>
      25             : #include <com/sun/star/util/XChangesBatch.hpp>
      26             : #include <com/sun/star/container/XNameContainer.hpp>
      27             : #include <com/sun/star/util/theMacroExpander.hpp>
      28             : #include <com/sun/star/lang/XSingleServiceFactory.hpp>
      29             : #include <sal/macros.h>
      30             : #include <osl/diagnose.h>
      31             : 
      32             : using namespace ::com::sun::star;
      33             : using namespace ::com::sun::star::uno;
      34             : using namespace ::com::sun::star::beans;
      35             : using namespace ::com::sun::star::container;
      36             : 
      37           0 : static OUString GetPathToConfigurationRoot()
      38             : {
      39           0 :     return OUString("org.openoffice.Office.PresentationMinimizer");
      40             : }
      41             : 
      42           0 : void OptimizerSettings::LoadSettingsFromConfiguration( const Reference< XNameAccess >& rSettings )
      43             : {
      44           0 :     if ( rSettings.is() )
      45             :     {
      46           0 :         const Sequence< OUString > aElements( rSettings->getElementNames() );
      47           0 :         for ( int i = 0; i < aElements.getLength(); i++ )
      48             :         {
      49             :             try
      50             :             {
      51           0 :                 const OUString aPropertyName( aElements[ i ] );
      52           0 :                 Any aValue( rSettings->getByName( aPropertyName ) );
      53           0 :                 switch( TKGet( aPropertyName ) )
      54             :                 {
      55           0 :                     case TK_Name :                      aValue >>= maName; break;
      56           0 :                     case TK_JPEGCompression :           aValue >>= mbJPEGCompression; break;
      57           0 :                     case TK_JPEGQuality :               aValue >>= mnJPEGQuality; break;
      58           0 :                     case TK_RemoveCropArea :            aValue >>= mbRemoveCropArea; break;
      59           0 :                     case TK_ImageResolution :           aValue >>= mnImageResolution; break;
      60           0 :                     case TK_EmbedLinkedGraphics :       aValue >>= mbEmbedLinkedGraphics; break;
      61           0 :                     case TK_OLEOptimization :           aValue >>= mbOLEOptimization; break;
      62           0 :                     case TK_OLEOptimizationType :       aValue >>= mnOLEOptimizationType; break;
      63           0 :                     case TK_DeleteUnusedMasterPages :   aValue >>= mbDeleteUnusedMasterPages; break;
      64           0 :                     case TK_DeleteHiddenSlides :        aValue >>= mbDeleteHiddenSlides; break;
      65           0 :                     case TK_DeleteNotesPages :          aValue >>= mbDeleteNotesPages ;break;
      66           0 :                     case TK_SaveAs :                    aValue >>= mbSaveAs; break;
      67             : //                  case TK_SaveAsURL :                 aValue >>= maSaveAsURL; break;      // URL is not saved to configuration
      68             : //                  case TK_FilterName :                aValue >>= maFilterName; break;     // URL is not saved to configuration
      69           0 :                     case TK_OpenNewDocument :           aValue >>= mbOpenNewDocument; break;
      70           0 :                     default: break;
      71           0 :                 }
      72             :             }
      73           0 :             catch (const Exception&)
      74             :             {
      75             :             }
      76           0 :         }
      77             :     }
      78           0 : }
      79             : 
      80           0 : void OptimizerSettings::SaveSettingsToConfiguration( const Reference< XNameReplace >& rSettings )
      81             : {
      82           0 :     if ( rSettings.is() )
      83             :     {
      84             :         OUString pNames[] = {
      85             :             OUString("Name"),
      86             :             OUString("JPEGCompression"),
      87             :             OUString("JPEGQuality"),
      88             :             OUString("RemoveCropArea"),
      89             :             OUString("ImageResolution"),
      90             :             OUString("EmbedLinkedGraphics"),
      91             :             OUString("OLEOptimization"),
      92             :             OUString("OLEOptimizationType"),
      93             :             OUString("DeleteUnusedMasterPages"),
      94             :             OUString("DeleteHiddenSlides"),
      95             :             OUString("DeleteNotesPages"),
      96             :             OUString("SaveAs"),
      97             : //          OUString("SaveAsURL"),
      98             : //          OUString("FilterName"),
      99           0 :             OUString("OpenNewDocument") };
     100             : 
     101             :         Any pValues[] = {
     102             :             Any( maName ),
     103             :             Any( mbJPEGCompression ),
     104             :             Any( mnJPEGQuality ),
     105             :             Any( mbRemoveCropArea ),
     106             :             Any( mnImageResolution ),
     107             :             Any( mbEmbedLinkedGraphics ),
     108             :             Any( mbOLEOptimization ),
     109             :             Any( mnOLEOptimizationType ),
     110             :             Any( mbDeleteUnusedMasterPages ),
     111             :             Any( mbDeleteHiddenSlides ),
     112             :             Any( mbDeleteNotesPages ),
     113             :             Any( mbSaveAs ),
     114             : //          Any( maSaveAsURL ),
     115             : //          Any( maFilterName ),
     116           0 :             Any( mbOpenNewDocument ) };
     117             : 
     118           0 :         sal_Int32 i, nCount = SAL_N_ELEMENTS( pNames );
     119             : 
     120           0 :         for ( i = 0; i < nCount; i++ )
     121             :         {
     122             :             try
     123             :             {
     124           0 :                 rSettings->replaceByName( pNames[ i ], pValues[ i ] );
     125             :             }
     126           0 :             catch (const Exception&)
     127             :             {
     128             :             }
     129           0 :         }
     130             :     }
     131           0 : }
     132             : 
     133           0 : bool OptimizerSettings::operator==( const OptimizerSettings& rOptimizerSettings ) const
     134             : {
     135           0 :     return ( rOptimizerSettings.mbJPEGCompression == mbJPEGCompression )
     136           0 :         && ( rOptimizerSettings.mnJPEGQuality == mnJPEGQuality )
     137           0 :         && ( rOptimizerSettings.mbRemoveCropArea == mbRemoveCropArea )
     138           0 :         && ( rOptimizerSettings.mnImageResolution == mnImageResolution )
     139           0 :         && ( rOptimizerSettings.mbEmbedLinkedGraphics == mbEmbedLinkedGraphics )
     140           0 :         && ( rOptimizerSettings.mbOLEOptimization == mbOLEOptimization )
     141           0 :         && ( rOptimizerSettings.mnOLEOptimizationType == mnOLEOptimizationType )
     142           0 :         && ( rOptimizerSettings.mbDeleteUnusedMasterPages == mbDeleteUnusedMasterPages )
     143           0 :         && ( rOptimizerSettings.mbDeleteHiddenSlides == mbDeleteHiddenSlides )
     144           0 :         && ( rOptimizerSettings.mbDeleteNotesPages == mbDeleteNotesPages );
     145             : //      && ( rOptimizerSettings.mbOpenNewDocument == mbOpenNewDocument );
     146             : }
     147             : 
     148             : 
     149           0 : ConfigurationAccess::ConfigurationAccess( const Reference< uno::XComponentContext >& rxContext, OptimizerSettings* pDefaultSettings ) :
     150           0 :     mxContext( rxContext )
     151             : {
     152           0 :     LoadStrings();
     153             :     maSettings.push_back( pDefaultSettings ?
     154           0 :         *pDefaultSettings : OptimizerSettings() );
     155           0 :     maSettings.back().maName = "LastUsedSettings";
     156           0 :     LoadConfiguration();
     157           0 :     maInitialSettings = maSettings;
     158           0 : };
     159             : 
     160           0 : ConfigurationAccess::~ConfigurationAccess()
     161             : {
     162           0 : }
     163             : 
     164           0 : OUString ConfigurationAccess::getString( const PPPOptimizerTokenEnum eToken ) const
     165             : {
     166           0 :     std::map< PPPOptimizerTokenEnum, OUString, Compare >::const_iterator aIter( maStrings.find( eToken ) );
     167           0 :     return aIter != maStrings.end() ? ((*aIter).second) : OUString();
     168             : }
     169             : 
     170           0 : void ConfigurationAccess::LoadStrings()
     171             : {
     172             :     try
     173             :     {
     174             :         do
     175             :         {
     176           0 :             Reference< XInterface > xRoot( OpenConfiguration( true ) );
     177           0 :             if ( !xRoot.is() )
     178           0 :                 break;
     179           0 :             Reference< container::XNameAccess > xSet( GetConfigurationNode( xRoot, "Strings" ), UNO_QUERY );
     180           0 :             if ( xSet.is() )
     181             :             {
     182           0 :                 const Sequence< OUString > aElements( xSet->getElementNames() );
     183           0 :                 for ( int i = 0; i < aElements.getLength(); i++ )
     184             :                 {
     185             :                     try
     186             :                     {
     187           0 :                         OUString aString, aPropertyName( aElements[ i ] );
     188           0 :                         if ( xSet->getByName( aPropertyName ) >>= aString )
     189           0 :                             maStrings[ TKGet( aPropertyName ) ] = aString;
     190             :                     }
     191           0 :                     catch (const Exception&)
     192             :                     {
     193             :                     }
     194           0 :                 }
     195           0 :             }
     196             :         }
     197             :         while( false );
     198             :     }
     199           0 :     catch (const Exception&)
     200             :     {
     201             :     }
     202           0 : }
     203             : 
     204           0 : void ConfigurationAccess::LoadConfiguration()
     205             : {
     206             :     try
     207             :     {
     208             :         do
     209             :         {
     210           0 :             Reference< XInterface > xRoot( OpenConfiguration( true ) );
     211           0 :             if ( !xRoot.is() )
     212           0 :                 break;
     213           0 :             Reference< container::XNameAccess > xSet( GetConfigurationNode( xRoot, "LastUsedSettings" ), UNO_QUERY );
     214           0 :             if ( xSet.is() )
     215             :             {
     216           0 :                 OptimizerSettings& rCurrent( maSettings.front() );
     217           0 :                 rCurrent.LoadSettingsFromConfiguration( xSet );
     218             :             }
     219           0 :             xSet = Reference< container::XNameAccess >( GetConfigurationNode( xRoot, "Settings/Templates" ), UNO_QUERY );
     220           0 :             if ( xSet.is() )
     221             :             {
     222           0 :                 const Sequence< OUString > aElements( xSet->getElementNames() );
     223           0 :                 for ( int i = 0; i < aElements.getLength(); i++ )
     224             :                 {
     225             :                     try
     226             :                     {
     227           0 :                         OUString aPath( "Settings/Templates/" + aElements[ i ] );
     228           0 :                         Reference< container::XNameAccess > xTemplates( GetConfigurationNode( xRoot, aPath ), UNO_QUERY );
     229           0 :                         if ( xTemplates.is() )
     230             :                         {
     231           0 :                             maSettings.push_back( OptimizerSettings() );
     232           0 :                             maSettings.back().LoadSettingsFromConfiguration( xTemplates );
     233           0 :                         }
     234             :                     }
     235           0 :                     catch (const Exception&)
     236             :                     {
     237             :                     }
     238           0 :                 }
     239           0 :             }
     240             :         }
     241             :         while( false );
     242             :     }
     243           0 :     catch (const Exception&)
     244             :     {
     245             :     }
     246           0 : }
     247             : 
     248           0 : void ConfigurationAccess::SaveConfiguration()
     249             : {
     250             :     try
     251             :     {
     252             :         do
     253             :         {
     254             :             int i;
     255             :             unsigned int k;
     256           0 :             Reference<util::XChangesBatch> xRoot( OpenConfiguration( false ), UNO_QUERY_THROW );
     257             : 
     258             :             // storing the last used settings
     259           0 :             Reference< container::XNameReplace > xSet( GetConfigurationNode( xRoot, "LastUsedSettings" ), UNO_QUERY_THROW );
     260           0 :             OptimizerSettings& rCurrent( maSettings.front() );
     261           0 :             rCurrent.SaveSettingsToConfiguration( xSet );
     262             : 
     263             :             // updating template elements
     264           0 :             xSet = Reference< container::XNameReplace >( GetConfigurationNode( xRoot, "Settings/Templates" ), UNO_QUERY_THROW );
     265           0 :             Reference< container::XNameContainer > xNameContainer( xSet, UNO_QUERY_THROW );
     266             : 
     267           0 :             const Sequence< OUString > aElements( xSet->getElementNames() );
     268           0 :             for( i = 0; i < aElements.getLength(); i++ )
     269           0 :                 xNameContainer->removeByName( aElements[ i ] );
     270             : 
     271           0 :             for( k = 1; k < maSettings.size(); k++ )
     272             :             {
     273           0 :                 OptimizerSettings& rSettings( maSettings[ k ] );
     274           0 :                 OUString aElementName( "Template" + OUString::number( k ) );
     275           0 :                 Reference< lang::XSingleServiceFactory > xChildFactory ( xSet, UNO_QUERY_THROW );
     276           0 :                 Reference< container::XNameReplace > xChild( xChildFactory->createInstance(), UNO_QUERY_THROW );
     277           0 :                 xNameContainer->insertByName( aElementName, Any( xChild ) );
     278             : 
     279           0 :                 OUString aPath( "Settings/Templates/" + aElementName );
     280           0 :                 Reference< container::XNameReplace > xTemplates( GetConfigurationNode( xRoot, aPath ), UNO_QUERY );
     281           0 :                 rSettings.SaveSettingsToConfiguration( xTemplates );
     282           0 :             }
     283           0 :             xRoot->commitChanges();
     284             :         }
     285             :         while( false );
     286             :     }
     287           0 :     catch (const Exception&)
     288             :     {
     289             :     }
     290           0 : }
     291             : 
     292           0 : Reference< XInterface > ConfigurationAccess::OpenConfiguration( bool bReadOnly )
     293             : {
     294           0 :     Reference< XInterface > xRoot;
     295             :     try
     296             :     {
     297           0 :         Reference< lang::XMultiServiceFactory > xProvider = configuration::theDefaultProvider::get( mxContext );
     298           0 :         Sequence< Any > aCreationArguments( 2 );
     299           0 :         aCreationArguments[0] = makeAny( PropertyValue(
     300             :             OUString( "nodepath" ), 0,
     301             :             makeAny( GetPathToConfigurationRoot() ),
     302           0 :             PropertyState_DIRECT_VALUE ) );
     303           0 :         aCreationArguments[1] = makeAny(beans::PropertyValue(
     304             :             OUString( "lazywrite" ), 0, makeAny( true ),
     305           0 :             PropertyState_DIRECT_VALUE ) );
     306           0 :         OUString sAccessService;
     307           0 :         if ( bReadOnly )
     308           0 :             sAccessService = "com.sun.star.configuration.ConfigurationAccess";
     309             :         else
     310             :             sAccessService =
     311           0 :                 "com.sun.star.configuration.ConfigurationUpdateAccess";
     312             : 
     313           0 :         xRoot = xProvider->createInstanceWithArguments(
     314           0 :             sAccessService, aCreationArguments );
     315             :     }
     316           0 :     catch (const Exception&)
     317             :     {
     318             :     }
     319           0 :     return xRoot;
     320             : }
     321             : 
     322           0 : Reference< XInterface > ConfigurationAccess::GetConfigurationNode(
     323             :     const Reference< XInterface >& xRoot,
     324             :     const OUString& sPathToNode )
     325             : {
     326           0 :     Reference< XInterface > xNode;
     327             :     try
     328             :     {
     329           0 :         if ( sPathToNode.isEmpty() )
     330           0 :             xNode = xRoot;
     331             :         else
     332             :         {
     333           0 :             Reference< XHierarchicalNameAccess > xHierarchy( xRoot, UNO_QUERY );
     334           0 :             if ( xHierarchy.is() )
     335             :             {
     336           0 :                 xHierarchy->getByHierarchicalName( sPathToNode ) >>= xNode;
     337           0 :             }
     338             :         }
     339             :     }
     340           0 :     catch (const Exception& rException)
     341             :     {
     342             :         OSL_TRACE ("caught exception while getting configuration node %s: %s",
     343             :             OUStringToOString(sPathToNode,
     344             :                 RTL_TEXTENCODING_UTF8).getStr(),
     345             :             OUStringToOString(rException.Message,
     346             :                 RTL_TEXTENCODING_UTF8).getStr());
     347             :         (void)rException;
     348             :     }
     349           0 :     return xNode;
     350             : }
     351             : 
     352           0 : com::sun::star::uno::Any ConfigurationAccess::GetConfigProperty( const PPPOptimizerTokenEnum ePropertyToken ) const
     353             : {
     354           0 :     Any aRetValue;
     355           0 :     const OptimizerSettings& rSettings( maSettings.front() );
     356             :     try
     357             :     {
     358           0 :         switch( ePropertyToken )
     359             :         {
     360           0 :             case TK_Name :                      aRetValue <<= rSettings.maName; break;
     361           0 :             case TK_JPEGCompression :           aRetValue <<= rSettings.mbJPEGCompression; break;
     362           0 :             case TK_JPEGQuality :               aRetValue <<= rSettings.mnJPEGQuality; break;
     363           0 :             case TK_RemoveCropArea :            aRetValue <<= rSettings.mbRemoveCropArea; break;
     364           0 :             case TK_ImageResolution :           aRetValue <<= rSettings.mnImageResolution; break;
     365           0 :             case TK_EmbedLinkedGraphics :       aRetValue <<= rSettings.mbEmbedLinkedGraphics; break;
     366           0 :             case TK_OLEOptimization :           aRetValue <<= rSettings.mbOLEOptimization; break;
     367           0 :             case TK_OLEOptimizationType :       aRetValue <<= rSettings.mnOLEOptimizationType; break;
     368           0 :             case TK_DeleteUnusedMasterPages :   aRetValue <<= rSettings.mbDeleteUnusedMasterPages; break;
     369           0 :             case TK_DeleteHiddenSlides :        aRetValue <<= rSettings.mbDeleteHiddenSlides; break;
     370           0 :             case TK_DeleteNotesPages :          aRetValue <<= rSettings.mbDeleteNotesPages; break;
     371           0 :             case TK_SaveAs :                    aRetValue <<= rSettings.mbSaveAs; break;
     372           0 :             case TK_SaveAsURL :                 aRetValue <<= rSettings.maSaveAsURL; break;
     373           0 :             case TK_FilterName :                aRetValue <<= rSettings.maFilterName; break;
     374           0 :             case TK_OpenNewDocument :           aRetValue <<= rSettings.mbOpenNewDocument; break;
     375           0 :             case TK_EstimatedFileSize :         aRetValue <<= rSettings.mnEstimatedFileSize; break;
     376             :             default:
     377           0 :                 break;
     378             :         }
     379             :     }
     380           0 :     catch (const Exception&)
     381             :     {
     382             :     }
     383           0 :     return aRetValue;
     384             : }
     385             : 
     386           0 : void ConfigurationAccess::SetConfigProperty( const PPPOptimizerTokenEnum ePropertyToken, const com::sun::star::uno::Any& rValue )
     387             : {
     388           0 :     OptimizerSettings& rSettings( maSettings.front() );
     389             :     try
     390             :     {
     391           0 :         switch( ePropertyToken )
     392             :         {
     393           0 :             case TK_Name :                      rValue >>= rSettings.maName; break;
     394           0 :             case TK_JPEGCompression :           rValue >>= rSettings.mbJPEGCompression; break;
     395           0 :             case TK_JPEGQuality :               rValue >>= rSettings.mnJPEGQuality; break;
     396           0 :             case TK_RemoveCropArea :            rValue >>= rSettings.mbRemoveCropArea; break;
     397           0 :             case TK_ImageResolution :           rValue >>= rSettings.mnImageResolution; break;
     398           0 :             case TK_EmbedLinkedGraphics :       rValue >>= rSettings.mbEmbedLinkedGraphics; break;
     399           0 :             case TK_OLEOptimization :           rValue >>= rSettings.mbOLEOptimization; break;
     400           0 :             case TK_OLEOptimizationType :       rValue >>= rSettings.mnOLEOptimizationType; break;
     401           0 :             case TK_DeleteUnusedMasterPages :   rValue >>= rSettings.mbDeleteUnusedMasterPages; break;
     402           0 :             case TK_DeleteHiddenSlides :        rValue >>= rSettings.mbDeleteHiddenSlides; break;
     403           0 :             case TK_DeleteNotesPages :          rValue >>= rSettings.mbDeleteNotesPages; break;
     404           0 :             case TK_CustomShowName :            rValue >>= rSettings.maCustomShowName; break;
     405           0 :             case TK_SaveAs :                    rValue >>= rSettings.mbSaveAs; break;
     406           0 :             case TK_SaveAsURL :                 rValue >>= rSettings.maSaveAsURL; break;
     407           0 :             case TK_FilterName :                rValue >>= rSettings.maFilterName; break;
     408           0 :             case TK_OpenNewDocument :           rValue >>= rSettings.mbOpenNewDocument; break;
     409           0 :             case TK_EstimatedFileSize :         rValue >>= rSettings.mnEstimatedFileSize; break;
     410             :             default:
     411           0 :                 break;
     412             :         }
     413             :     }
     414             :     catch (const Exception&)
     415             :     {
     416             :     }
     417           0 : }
     418             : 
     419           0 : bool ConfigurationAccess::GetConfigProperty( const PPPOptimizerTokenEnum ePropertyToken, const bool bDefault ) const
     420             : {
     421           0 :     bool bRetValue = bDefault;
     422           0 :     if ( ! ( GetConfigProperty( ePropertyToken ) >>= bRetValue ) )
     423           0 :         bRetValue = bDefault;
     424           0 :     return bRetValue;
     425             : }
     426             : 
     427           0 : sal_Int16 ConfigurationAccess::GetConfigProperty( const PPPOptimizerTokenEnum ePropertyToken, const sal_Int16 nDefault ) const
     428             : {
     429           0 :     sal_Int16 nRetValue = nDefault;
     430           0 :     if ( ! ( GetConfigProperty( ePropertyToken ) >>= nRetValue ) )
     431           0 :         nRetValue = nDefault;
     432           0 :     return nRetValue;
     433             : }
     434             : 
     435           0 : sal_Int32 ConfigurationAccess::GetConfigProperty( const PPPOptimizerTokenEnum ePropertyToken, const sal_Int32 nDefault ) const
     436             : {
     437           0 :     sal_Int32 nRetValue = nDefault;
     438           0 :     if ( ! ( GetConfigProperty( ePropertyToken ) >>= nRetValue ) )
     439           0 :         nRetValue = nDefault;
     440           0 :     return nRetValue;
     441             : }
     442             : 
     443           0 : Sequence< PropertyValue > ConfigurationAccess::GetConfigurationSequence()
     444             : {
     445           0 :     Sequence< PropertyValue > aRet( 15 );
     446           0 :     OptimizerSettings& rSettings( maSettings.front() );
     447           0 :     aRet[ 0 ].Name = "JPEGCompression";
     448           0 :     aRet[ 0 ].Value= Any( rSettings.mbJPEGCompression );
     449           0 :     aRet[ 1 ].Name = "JPEGQuality";
     450           0 :     aRet[ 1 ].Value= Any( rSettings.mnJPEGQuality );
     451           0 :     aRet[ 2 ].Name = "RemoveCropArea";
     452           0 :     aRet[ 2 ].Value= Any( rSettings.mbRemoveCropArea );
     453           0 :     aRet[ 3 ].Name = "ImageResolution";
     454           0 :     aRet[ 3 ].Value= Any( rSettings.mnImageResolution );
     455           0 :     aRet[ 4 ].Name = "EmbedLinkedGraphics";
     456           0 :     aRet[ 4 ].Value= Any( rSettings.mbEmbedLinkedGraphics );
     457           0 :     aRet[ 5 ].Name = "OLEOptimization";
     458           0 :     aRet[ 5 ].Value= Any( rSettings.mbOLEOptimization );
     459           0 :     aRet[ 6 ].Name = "OLEOptimizationType";
     460           0 :     aRet[ 6 ].Value= Any( rSettings.mnOLEOptimizationType );
     461           0 :     aRet[ 7 ].Name = "DeleteUnusedMasterPages";
     462           0 :     aRet[ 7 ].Value= Any( rSettings.mbDeleteUnusedMasterPages );
     463           0 :     aRet[ 8 ].Name = "DeleteHiddenSlides";
     464           0 :     aRet[ 8 ].Value= Any( rSettings.mbDeleteHiddenSlides );
     465           0 :     aRet[ 9 ].Name = "DeleteNotesPages";
     466           0 :     aRet[ 9 ].Value= Any( rSettings.mbDeleteNotesPages );
     467           0 :     aRet[ 10].Name = "CustomShowName";
     468           0 :     aRet[ 10].Value= Any( rSettings.maCustomShowName );
     469           0 :     aRet[ 11].Name = "SaveAsURL";
     470           0 :     aRet[ 11].Value= Any( rSettings.maSaveAsURL );
     471           0 :     aRet[ 12].Name = "FilterName";
     472           0 :     aRet[ 12].Value= Any( rSettings.maFilterName );
     473           0 :     aRet[ 13].Name = "OpenNewDocument";
     474           0 :     aRet[ 13].Value= Any( rSettings.mbOpenNewDocument );
     475           0 :     aRet[ 14].Name = "EstimatedFileSize";
     476           0 :     aRet[ 14].Value= Any( rSettings.mnEstimatedFileSize );
     477           0 :     return aRet;
     478             : }
     479             : 
     480           0 : std::vector< OptimizerSettings >::iterator ConfigurationAccess::GetOptimizerSettingsByName( const OUString& rName )
     481             : {
     482           0 :     std::vector< OptimizerSettings >::iterator aIter( maSettings.begin() + 1 );
     483           0 :     const std::vector< OptimizerSettings >::const_iterator aEnd( maSettings.end() );
     484           0 :     for ( ; aIter != aEnd; ++aIter )
     485             :     {
     486           0 :         if ( aIter->maName == rName )
     487           0 :             break;
     488             :     }
     489           0 :     return aIter;
     490             : }
     491             : 
     492             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11