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

Generated by: LCOV version 1.10