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

Generated by: LCOV version 1.10