LCOV - code coverage report
Current view: top level - libreoffice/chart2/source/view/main - PropertyMapper.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 174 233 74.7 %
Date: 2012-12-17 Functions: 14 18 77.8 %
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 "PropertyMapper.hxx"
      21             : #include "ContainerHelper.hxx"
      22             : #include "macros.hxx"
      23             : 
      24             : #include <com/sun/star/beans/XMultiPropertySet.hpp>
      25             : #include <com/sun/star/drawing/LineStyle.hpp>
      26             : #include <com/sun/star/drawing/TextVerticalAdjust.hpp>
      27             : #include <com/sun/star/drawing/TextHorizontalAdjust.hpp>
      28             : #include <com/sun/star/drawing/LineJoint.hpp>
      29             : 
      30             : //.............................................................................
      31             : namespace chart
      32             : {
      33             : //.............................................................................
      34             : using namespace ::com::sun::star;
      35             : 
      36             : namespace
      37             : {
      38             : 
      39           0 : void lcl_overwriteOrAppendValues(
      40             :     tPropertyNameValueMap &rMap, const tPropertyNameValueMap& rOverwriteMap )
      41             : {
      42           0 :     tPropertyNameValueMap::const_iterator aIt( rOverwriteMap.begin() );
      43           0 :     tPropertyNameValueMap::const_iterator aEnd( rOverwriteMap.end() );
      44             : 
      45           0 :     for( ; aIt != aEnd; ++aIt )
      46           0 :         rMap[ aIt->first ] = aIt->second;
      47           0 : }
      48             : 
      49             : } // anonymous namespace
      50             : 
      51        1066 : void PropertyMapper::setMappedProperties(
      52             :           const uno::Reference< beans::XPropertySet >& xTarget
      53             :         , const uno::Reference< beans::XPropertySet >& xSource
      54             :         , const tPropertyNameMap& rMap
      55             :         , tPropertyNameValueMap* pOverwriteMap )
      56             : {
      57        1066 :     if( !xTarget.is() || !xSource.is() )
      58        1066 :         return;
      59             : 
      60        1066 :     tNameSequence aNames;
      61        1066 :     tAnySequence  aValues;
      62        1066 :     getMultiPropertyLists(aNames, aValues, xSource, rMap );
      63        1066 :     if(pOverwriteMap && (aNames.getLength() == aValues.getLength()))
      64             :     {
      65           0 :         tPropertyNameValueMap aNewMap;
      66           0 :         for( sal_Int32 nI=0; nI<aNames.getLength(); ++nI )
      67           0 :             aNewMap[ aNames[nI] ] = aValues[nI];
      68           0 :         lcl_overwriteOrAppendValues( aNewMap, *pOverwriteMap );
      69           0 :         aNames = ContainerHelper::MapKeysToSequence( aNewMap );
      70           0 :         aValues = ContainerHelper::MapValuesToSequence( aNewMap );
      71             :     }
      72             : 
      73        1066 :     PropertyMapper::setMultiProperties( aNames, aValues, xTarget );
      74             : }
      75             : 
      76        1886 : void PropertyMapper::getValueMap(
      77             :                   tPropertyNameValueMap& rValueMap
      78             :                 , const tPropertyNameMap& rNameMap
      79             :                 , const uno::Reference< beans::XPropertySet >& xSourceProp
      80             :                 )
      81             : {
      82        1886 :     tPropertyNameMap::const_iterator aIt( rNameMap.begin() );
      83        1886 :     tPropertyNameMap::const_iterator aEnd( rNameMap.end() );
      84             : 
      85       53710 :     for( ; aIt != aEnd; ++aIt )
      86             :     {
      87       51824 :         rtl::OUString aTarget = aIt->first;
      88       51824 :         rtl::OUString aSource = aIt->second;
      89             :         try
      90             :         {
      91       51824 :             uno::Any aAny( xSourceProp->getPropertyValue(aSource) );
      92       51824 :             if( aAny.hasValue() )
      93       42968 :                 rValueMap.insert( tPropertyNameValueMap::value_type( aTarget, aAny ) );
      94             :         }
      95           0 :         catch( const uno::Exception& e )
      96             :         {
      97             :             ASSERT_EXCEPTION( e );
      98             :         }
      99       51824 :     }
     100        1886 : }
     101             : 
     102        1066 : void PropertyMapper::getMultiPropertyLists(
     103             :                   tNameSequence& rNames
     104             :                 , tAnySequence&  rValues
     105             :                 , const uno::Reference< beans::XPropertySet >& xSourceProp
     106             :                 , const tPropertyNameMap& rNameMap
     107             :                 )
     108             : {
     109        1066 :     tPropertyNameValueMap aValueMap;
     110        1066 :     getValueMap( aValueMap, rNameMap, xSourceProp );
     111        1066 :     getMultiPropertyListsFromValueMap( rNames, rValues, aValueMap );
     112        1066 : }
     113             : 
     114        1886 : void PropertyMapper::getMultiPropertyListsFromValueMap(
     115             :                   tNameSequence& rNames
     116             :                 , tAnySequence&  rValues
     117             :                 , const tPropertyNameValueMap& rValueMap
     118             :                 )
     119             : {
     120        1886 :     sal_Int32 nPropertyCount = rValueMap.size();
     121        1886 :     rNames.realloc(nPropertyCount);
     122        1886 :     rValues.realloc(nPropertyCount);
     123             : 
     124             :     //fill sequences
     125        1886 :     tPropertyNameValueMap::const_iterator aValueIt(  rValueMap.begin() );
     126        1886 :     tPropertyNameValueMap::const_iterator aValueEnd( rValueMap.end()   );
     127        1886 :     sal_Int32 nN=0;
     128       46904 :     for( ; aValueIt != aValueEnd; ++aValueIt )
     129             :     {
     130       45018 :         const uno::Any& rAny = aValueIt->second;
     131       45018 :         if( rAny.hasValue() )
     132             :         {
     133             :             //do not set empty anys because of performance (otherwise SdrAttrObj::ItemChange will take much longer)
     134       45018 :             rNames[nN]  = aValueIt->first;
     135       45018 :             rValues[nN] = rAny;
     136       45018 :             ++nN;
     137             :         }
     138             :     }
     139             :     //reduce to real property count
     140        1886 :     rNames.realloc(nN);
     141        1886 :     rValues.realloc(nN);
     142        1886 : }
     143             : 
     144        1640 : uno::Any* PropertyMapper::getValuePointer( tAnySequence& rPropValues
     145             :                          , const tNameSequence& rPropNames
     146             :                          , const rtl::OUString& rPropName )
     147             : {
     148        1640 :     sal_Int32 nCount = rPropNames.getLength();
     149       54858 :     for( sal_Int32 nN = 0; nN < nCount; nN++ )
     150             :     {
     151       54530 :         if(rPropNames[nN].equals(rPropName))
     152        1312 :             return &rPropValues[nN];
     153             :     }
     154         328 :     return NULL;
     155             : }
     156             : 
     157         328 : uno::Any* PropertyMapper::getValuePointerForLimitedSpace( tAnySequence& rPropValues
     158             :                          , const tNameSequence& rPropNames
     159             :                          , bool bLimitedHeight)
     160             : {
     161             :     return PropertyMapper::getValuePointer( rPropValues, rPropNames
     162         328 :         , bLimitedHeight ? C2U("TextMaximumFrameHeight") : C2U("TextMaximumFrameWidth") );
     163             : }
     164             : 
     165         410 : const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForCharacterProperties()
     166             : {
     167             :     //shape property -- chart model object property
     168             :     static tMakePropertyNameMap m_aShapePropertyMapForCharacterProperties =
     169             :         tMakePropertyNameMap
     170             :         ( "CharColor",                "CharColor" )
     171           4 :         ( "CharContoured",            "CharContoured" )
     172           6 :         ( "CharEmphasis",             "CharEmphasis" )//the service style::CharacterProperties  describes a property called 'CharEmphasize' wich is nowhere implemented
     173             : 
     174           6 :         ( "CharFontFamily",           "CharFontFamily" )
     175           6 :         ( "CharFontFamilyAsian",      "CharFontFamilyAsian" )
     176           6 :         ( "CharFontFamilyComplex",    "CharFontFamilyComplex" )
     177           6 :         ( "CharFontCharSet",          "CharFontCharSet" )
     178           6 :         ( "CharFontCharSetAsian",     "CharFontCharSetAsian" )
     179           6 :         ( "CharFontCharSetComplex",   "CharFontCharSetComplex" )
     180           6 :         ( "CharFontName",             "CharFontName" )
     181           6 :         ( "CharFontNameAsian",        "CharFontNameAsian" )
     182           6 :         ( "CharFontNameComplex",      "CharFontNameComplex" )
     183           6 :         ( "CharFontPitch",            "CharFontPitch" )
     184           6 :         ( "CharFontPitchAsian",       "CharFontPitchAsian" )
     185           6 :         ( "CharFontPitchComplex",     "CharFontPitchComplex" )
     186           6 :         ( "CharFontStyleName",        "CharFontStyleName" )
     187           6 :         ( "CharFontStyleNameAsian",   "CharFontStyleNameAsian" )
     188           6 :         ( "CharFontStyleNameComplex", "CharFontStyleNameComplex" )
     189             : 
     190           6 :         ( "CharHeight",               "CharHeight" )
     191           6 :         ( "CharHeightAsian",          "CharHeightAsian" )
     192           6 :         ( "CharHeightComplex",        "CharHeightComplex" )
     193           6 :         ( "CharKerning",              "CharKerning" )
     194           6 :         ( "CharLocale",               "CharLocale" )
     195           6 :         ( "CharLocaleAsian",          "CharLocaleAsian" )
     196           6 :         ( "CharLocaleComplex",        "CharLocaleComplex" )
     197           6 :         ( "CharPosture",              "CharPosture" )
     198           6 :         ( "CharPostureAsian",         "CharPostureAsian" )
     199           6 :         ( "CharPostureComplex",       "CharPostureComplex" )
     200           6 :         ( "CharRelief",               "CharRelief" )
     201           6 :         ( "CharShadowed",             "CharShadowed" )
     202           6 :         ( "CharStrikeout",            "CharStrikeout" )
     203           6 :         ( "CharUnderline",            "CharUnderline" )
     204           6 :         ( "CharUnderlineColor",       "CharUnderlineColor" )
     205           6 :         ( "CharUnderlineHasColor",    "CharUnderlineHasColor" )
     206           6 :         ( "CharOverline",             "CharOverline" )
     207           6 :         ( "CharOverlineColor",        "CharOverlineColor" )
     208           6 :         ( "CharOverlineHasColor",     "CharOverlineHasColor" )
     209           6 :         ( "CharWeight",               "CharWeight" )
     210           6 :         ( "CharWeightAsian",          "CharWeightAsian" )
     211           6 :         ( "CharWeightComplex",        "CharWeightComplex" )
     212           6 :         ( "CharWordMode",             "CharWordMode" )
     213             : 
     214           6 :         ( "WritingMode",              "WritingMode" )
     215             : 
     216         414 :         ( "ParaIsCharacterDistance",  "ParaIsCharacterDistance" )
     217             :         ;
     218         410 :     return m_aShapePropertyMapForCharacterProperties;
     219             : }
     220             : 
     221           0 : const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForParagraphProperties()
     222             : {
     223             :     //shape property -- chart model object property
     224             :     static tMakePropertyNameMap m_aShapePropertyMapForParagraphProperties =
     225             :         tMakePropertyNameMap
     226             :         ( "ParaAdjust",          "ParaAdjust" )
     227           0 :         ( "ParaBottomMargin",    "ParaBottomMargin" )
     228           0 :         ( "ParaIsHyphenation",   "ParaIsHyphenation" )
     229           0 :         ( "ParaLastLineAdjust",  "ParaLastLineAdjust" )
     230           0 :         ( "ParaLeftMargin",      "ParaLeftMargin" )
     231           0 :         ( "ParaRightMargin",     "ParaRightMargin" )
     232           0 :         ( "ParaTopMargin",       "ParaTopMargin" )
     233             :         ;
     234           0 :     return m_aShapePropertyMapForParagraphProperties;
     235             : }
     236             : 
     237         248 : const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForFillProperties()
     238             : {
     239             :     //shape property -- chart model object property
     240             :     static tMakePropertyNameMap m_aShapePropertyMapForFillProperties =
     241             :         tMakePropertyNameMap
     242             :         ( "FillBackground",               "FillBackground" )
     243           4 :         ( "FillBitmapName",               "FillBitmapName" )
     244           6 :         ( "FillColor",                    "FillColor" )
     245           6 :         ( "FillGradientName",             "FillGradientName" )
     246           6 :         ( "FillGradientStepCount",        "FillGradientStepCount" )
     247           6 :         ( "FillHatchName",                "FillHatchName" )
     248           6 :         ( "FillStyle",                    "FillStyle" )
     249           6 :         ( "FillTransparence",             "FillTransparence" )
     250           6 :         ( "FillTransparenceGradientName", "FillTransparenceGradientName" )
     251             :         //bitmap properties
     252           6 :         ( "FillBitmapMode",               "FillBitmapMode" )
     253           6 :         ( "FillBitmapSizeX",              "FillBitmapSizeX" )
     254           6 :         ( "FillBitmapSizeY",              "FillBitmapSizeY" )
     255           6 :         ( "FillBitmapLogicalSize",        "FillBitmapLogicalSize" )
     256           6 :         ( "FillBitmapOffsetX",            "FillBitmapOffsetX" )
     257           6 :         ( "FillBitmapOffsetY",            "FillBitmapOffsetY" )
     258           6 :         ( "FillBitmapRectanglePoint",     "FillBitmapRectanglePoint" )
     259           6 :         ( "FillBitmapPositionOffsetX",    "FillBitmapPositionOffsetX" )
     260         252 :         ( "FillBitmapPositionOffsetY",    "FillBitmapPositionOffsetY" )
     261             :         ;
     262         248 :     return m_aShapePropertyMapForFillProperties;
     263             : }
     264             : 
     265         248 : const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForLineProperties()
     266             : {
     267             :     //shape property -- chart model object property
     268             :     static tMakePropertyNameMap m_aShapePropertyMapForLineProperties =
     269             :         tMakePropertyNameMap
     270             :         ( "LineColor",              "LineColor" )
     271           4 :         ( "LineDashName",           "LineDashName" )
     272           6 :         ( "LineJoint",              "LineJoint" )
     273           6 :         ( "LineStyle",              "LineStyle" )
     274           6 :         ( "LineTransparence",       "LineTransparence" )
     275         252 :         ( "LineWidth",              "LineWidth" )
     276             :         ;
     277         248 :     return m_aShapePropertyMapForLineProperties;
     278             : }
     279             : 
     280         492 : const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForFillAndLineProperties()
     281             : {
     282             :     static tMakePropertyNameMap m_aShapePropertyMapForFillAndLineProperties =
     283             :         tMakePropertyNameMap
     284           2 :         ( PropertyMapper::getPropertyNameMapForFillProperties() )
     285         494 :         ( PropertyMapper::getPropertyNameMapForLineProperties() )
     286             :         ;
     287             : 
     288         492 :     return m_aShapePropertyMapForFillAndLineProperties;
     289             : }
     290             : 
     291           0 : const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForTextShapeProperties()
     292             : {
     293             :     static tMakePropertyNameMap m_aShapePropertyMapForTextShapeProperties =
     294             :         tMakePropertyNameMap
     295           0 :         ( PropertyMapper::getPropertyNameMapForCharacterProperties() )
     296           0 :         ( PropertyMapper::getPropertyNameMapForFillProperties() )
     297           0 :         ( PropertyMapper::getPropertyNameMapForLineProperties() );
     298             : 
     299           0 :     return m_aShapePropertyMapForTextShapeProperties;
     300             : }
     301             : 
     302         246 : const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForLineSeriesProperties()
     303             : {
     304             :     //shape property -- chart model object property
     305             :     static tMakePropertyNameMap m_aShapePropertyMapForLineSeriesProperties =
     306             :         tMakePropertyNameMap
     307             :         ( "LineColor",           "Color" )
     308           4 :         ( "LineDashName",        "LineDashName" )
     309           6 :         ( "LineStyle",           "LineStyle" )
     310           6 :         ( "LineTransparence",    "Transparency" )
     311         250 :         ( "LineWidth",           "LineWidth" )
     312             : 
     313             :         ;
     314         246 :     return m_aShapePropertyMapForLineSeriesProperties;
     315             : }
     316             : 
     317        1230 : const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForFilledSeriesProperties()
     318             : {
     319             :     //shape property -- chart model object property
     320             :     static tMakePropertyNameMap m_aShapePropertyMapForFilledSeriesProperties =
     321             :         tMakePropertyNameMap
     322             :         ( "FillBackground",               "FillBackground" )
     323           4 :         ( "FillBitmapName",               "FillBitmapName" )
     324           6 :         ( "FillColor",                    "Color" )
     325           6 :         ( "FillGradientName",             "GradientName" )
     326           6 :         ( "FillGradientStepCount",        "GradientStepCount" )
     327           6 :         ( "FillHatchName",                "HatchName" )
     328           6 :         ( "FillStyle",                    "FillStyle" )
     329           6 :         ( "FillTransparence",             "Transparency" )
     330           6 :         ( "FillTransparenceGradientName", "TransparencyGradientName" )
     331             :         //bitmap properties
     332           6 :         ( "FillBitmapMode",               "FillBitmapMode" )
     333           6 :         ( "FillBitmapSizeX",              "FillBitmapSizeX" )
     334           6 :         ( "FillBitmapSizeY",              "FillBitmapSizeY" )
     335           6 :         ( "FillBitmapLogicalSize",        "FillBitmapLogicalSize" )
     336           6 :         ( "FillBitmapOffsetX",            "FillBitmapOffsetX" )
     337           6 :         ( "FillBitmapOffsetY",            "FillBitmapOffsetY" )
     338           6 :         ( "FillBitmapRectanglePoint",     "FillBitmapRectanglePoint" )
     339           6 :         ( "FillBitmapPositionOffsetX",    "FillBitmapPositionOffsetX" )
     340           6 :         ( "FillBitmapPositionOffsetY",    "FillBitmapPositionOffsetY" )
     341             :         //line properties
     342           6 :         ( "LineColor",                    "BorderColor" )
     343           6 :         ( "LineDashName",                 "BorderDashName" )
     344           6 :         ( "LineStyle",                    "BorderStyle" )
     345           6 :         ( "LineTransparence",             "BorderTransparency" )
     346        1234 :         ( "LineWidth",                    "BorderWidth" )
     347             :         ;
     348        1230 :     return m_aShapePropertyMapForFilledSeriesProperties;
     349             : }
     350             : 
     351        3280 : void PropertyMapper::setMultiProperties(
     352             :                   const tNameSequence& rNames
     353             :                 , const tAnySequence&  rValues
     354             :                 , const ::com::sun::star::uno::Reference<
     355             :                   ::com::sun::star::beans::XPropertySet >& xTarget )
     356             : {
     357        3280 :     bool bSuccess = false;
     358             :     try
     359             :     {
     360        3280 :         uno::Reference< beans::XMultiPropertySet > xShapeMultiProp( xTarget, uno::UNO_QUERY );
     361        3280 :         if( xShapeMultiProp.is() )
     362             :         {
     363        3280 :             xShapeMultiProp->setPropertyValues( rNames, rValues );
     364        3280 :             bSuccess = true;
     365        3280 :         }
     366             :     }
     367           0 :     catch( const uno::Exception& e )
     368             :     {
     369             :         ASSERT_EXCEPTION( e ); //if this occurs more often think of removing the XMultiPropertySet completly for better performance
     370             :     }
     371             : 
     372        3280 :     if(!bSuccess)
     373             :     try
     374             :     {
     375           0 :         sal_Int32 nCount = std::max( rNames.getLength(), rValues.getLength() );
     376           0 :         rtl::OUString aPropName;
     377           0 :         uno::Any aValue;
     378           0 :         for( sal_Int32 nN = 0; nN < nCount; nN++ )
     379             :         {
     380           0 :             aPropName = rNames[nN];
     381           0 :             aValue = rValues[nN];
     382             : 
     383             :             try
     384             :             {
     385           0 :                 xTarget->setPropertyValue( aPropName, aValue );
     386             :             }
     387           0 :             catch( const uno::Exception& e )
     388             :             {
     389             :                 ASSERT_EXCEPTION( e );
     390             :             }
     391           0 :         }
     392             :     }
     393           0 :     catch( const uno::Exception& e )
     394             :     {
     395             :         ASSERT_EXCEPTION( e );
     396             :     }
     397        3280 : }
     398             : 
     399         328 : void PropertyMapper::getTextLabelMultiPropertyLists(
     400             :     const uno::Reference< beans::XPropertySet >& xSourceProp
     401             :     , tNameSequence& rPropNames, tAnySequence& rPropValues
     402             :     , bool bName
     403             :     , sal_Int32 nLimitedSpace
     404             :     , bool bLimitedHeight )
     405             : {
     406             :     //fill character properties into the ValueMap
     407         328 :     tPropertyNameValueMap aValueMap;
     408             :     PropertyMapper::getValueMap( aValueMap
     409         328 :             , PropertyMapper::getPropertyNameMapForCharacterProperties()
     410         328 :             , xSourceProp );
     411             : 
     412             :     //some more shape properties apart from character properties, position-matrix and label string
     413         328 :     aValueMap.insert( tPropertyNameValueMap::value_type( C2U("LineStyle"), uno::makeAny(drawing::LineStyle_NONE) ) ); // drawing::LineStyle
     414         328 :     aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextHorizontalAdjust"), uno::makeAny(drawing::TextHorizontalAdjust_CENTER) ) ); // drawing::TextHorizontalAdjust - needs to be overwritten
     415         328 :     aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextVerticalAdjust"), uno::makeAny(drawing::TextVerticalAdjust_CENTER) ) ); //drawing::TextVerticalAdjust - needs to be overwritten
     416         328 :     aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextAutoGrowHeight"), uno::makeAny(sal_True) ) ); // sal_Bool
     417         328 :     aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextAutoGrowWidth"), uno::makeAny(sal_True) ) ); // sal_Bool
     418         328 :     if( bName )
     419           0 :         aValueMap.insert( tPropertyNameValueMap::value_type( C2U("Name"), uno::makeAny( rtl::OUString() ) ) ); //CID rtl::OUString - needs to be overwritten for each point
     420             : 
     421         328 :     if( nLimitedSpace > 0 )
     422             :     {
     423           0 :         if(bLimitedHeight)
     424           0 :             aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextMaximumFrameHeight"), uno::makeAny(nLimitedSpace) ) ); //sal_Int32
     425             :         else
     426           0 :             aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextMaximumFrameWidth"), uno::makeAny(nLimitedSpace) ) ); //sal_Int32
     427           0 :         aValueMap.insert( tPropertyNameValueMap::value_type( C2U("ParaIsHyphenation"), uno::makeAny(sal_True) ) );
     428             :     }
     429             : 
     430         328 :     PropertyMapper::getMultiPropertyListsFromValueMap( rPropNames, rPropValues, aValueMap );
     431         328 : }
     432             : 
     433           0 : void PropertyMapper::getPreparedTextShapePropertyLists(
     434             :     const uno::Reference< beans::XPropertySet >& xSourceProp
     435             :     , tNameSequence& rPropNames, tAnySequence& rPropValues )
     436             : {
     437             :     //fill character, line and fill properties into the ValueMap
     438           0 :     tPropertyNameValueMap aValueMap;
     439             :     PropertyMapper::getValueMap( aValueMap
     440           0 :             , PropertyMapper::getPropertyNameMapForTextShapeProperties()
     441           0 :             , xSourceProp );
     442             : 
     443             :     // auto-grow makes sure the shape has the correct size after setting text
     444           0 :     aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextHorizontalAdjust"), uno::makeAny( drawing::TextHorizontalAdjust_CENTER )));
     445           0 :     aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextVerticalAdjust"), uno::makeAny( drawing::TextVerticalAdjust_CENTER )));
     446           0 :     aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextAutoGrowHeight"), uno::makeAny( true )));
     447           0 :     aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextAutoGrowWidth"), uno::makeAny( true )));
     448             : 
     449             :     // set some distance to the border, in case it is shown
     450           0 :     const sal_Int32 nWidthDist  = 250;
     451           0 :     const sal_Int32 nHeightDist = 125;
     452           0 :     aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextLeftDistance"),  uno::makeAny( nWidthDist )));
     453           0 :     aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextRightDistance"), uno::makeAny( nWidthDist )));
     454           0 :     aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextUpperDistance"), uno::makeAny( nHeightDist )));
     455           0 :     aValueMap.insert( tPropertyNameValueMap::value_type( C2U("TextLowerDistance"), uno::makeAny( nHeightDist )));
     456             : 
     457             :     // use a line-joint showing the border of thick lines like two rectangles
     458             :     // filled in between.
     459           0 :     aValueMap[C2U("LineJoint")] <<= drawing::LineJoint_ROUND;
     460             : 
     461           0 :     PropertyMapper::getMultiPropertyListsFromValueMap( rPropNames, rPropValues, aValueMap );
     462           0 : }
     463             : 
     464             : //.............................................................................
     465             : } //namespace chart
     466             : //.............................................................................
     467             : 
     468             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10