LCOV - code coverage report
Current view: top level - chart2/source/view/main - PropertyMapper.cxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 229 241 95.0 %
Date: 2015-06-13 12:38:46 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         112 : void lcl_overwriteOrAppendValues(
      39             :     tPropertyNameValueMap &rMap, const tPropertyNameValueMap& rOverwriteMap )
      40             : {
      41         112 :     tPropertyNameValueMap::const_iterator aIt( rOverwriteMap.begin() );
      42         112 :     tPropertyNameValueMap::const_iterator aEnd( rOverwriteMap.end() );
      43             : 
      44         224 :     for( ; aIt != aEnd; ++aIt )
      45         112 :         rMap[ aIt->first ] = aIt->second;
      46         112 : }
      47             : 
      48             : } // anonymous namespace
      49             : 
      50       13746 : 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       13746 :     if( !xTarget.is() || !xSource.is() )
      57       13746 :         return;
      58             : 
      59       13746 :     tNameSequence aNames;
      60       27492 :     tAnySequence  aValues;
      61       13746 :     getMultiPropertyLists(aNames, aValues, xSource, rMap );
      62       13746 :     if(pOverwriteMap && (aNames.getLength() == aValues.getLength()))
      63             :     {
      64         112 :         tPropertyNameValueMap aNewMap;
      65        2016 :         for( sal_Int32 nI=0; nI<aNames.getLength(); ++nI )
      66        1904 :             aNewMap[ aNames[nI] ] = aValues[nI];
      67         112 :         lcl_overwriteOrAppendValues( aNewMap, *pOverwriteMap );
      68         112 :         aNames = ContainerHelper::MapKeysToSequence( aNewMap );
      69         112 :         aValues = ContainerHelper::MapValuesToSequence( aNewMap );
      70             :     }
      71             : 
      72       27492 :     PropertyMapper::setMultiProperties( aNames, aValues, xTarget );
      73             : }
      74             : 
      75       24712 : void PropertyMapper::getValueMap(
      76             :                   tPropertyNameValueMap& rValueMap
      77             :                 , const tPropertyNameMap& rNameMap
      78             :                 , const uno::Reference< beans::XPropertySet >& xSourceProp
      79             :                 )
      80             : {
      81       24712 :     tPropertyNameMap::const_iterator aIt( rNameMap.begin() );
      82       24712 :     tPropertyNameMap::const_iterator aEnd( rNameMap.end() );
      83             : 
      84       24712 :     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      729583 :         for( ; aIt != aEnd; ++aIt )
     106             :         {
     107      704871 :             OUString aTarget = aIt->first;
     108     1409742 :             OUString aSource = aIt->second;
     109             :             try
     110             :             {
     111      704871 :                 uno::Any aAny( xSourceProp->getPropertyValue(aSource) );
     112      689775 :                 if( aAny.hasValue() )
     113      589317 :                     rValueMap.insert( tPropertyNameValueMap::value_type( aTarget, aAny ) );
     114             :             }
     115       15096 :             catch( const uno::Exception& e )
     116             :             {
     117             :                 ASSERT_EXCEPTION( e );
     118             :             }
     119      704871 :         }
     120       24712 :     }
     121       24712 : }
     122             : 
     123       13746 : void PropertyMapper::getMultiPropertyLists(
     124             :                   tNameSequence& rNames
     125             :                 , tAnySequence&  rValues
     126             :                 , const uno::Reference< beans::XPropertySet >& xSourceProp
     127             :                 , const tPropertyNameMap& rNameMap
     128             :                 )
     129             : {
     130       13746 :     tPropertyNameValueMap aValueMap;
     131       13746 :     getValueMap( aValueMap, rNameMap, xSourceProp );
     132       13746 :     getMultiPropertyListsFromValueMap( rNames, rValues, aValueMap );
     133       13746 : }
     134             : 
     135       24712 : void PropertyMapper::getMultiPropertyListsFromValueMap(
     136             :                   tNameSequence& rNames
     137             :                 , tAnySequence&  rValues
     138             :                 , const tPropertyNameValueMap& rValueMap
     139             :                 )
     140             : {
     141       24712 :     sal_Int32 nPropertyCount = rValueMap.size();
     142       24712 :     rNames.realloc(nPropertyCount);
     143       24712 :     rValues.realloc(nPropertyCount);
     144             : 
     145             :     //fill sequences
     146       24712 :     tPropertyNameValueMap::const_iterator aValueIt(  rValueMap.begin() );
     147       24712 :     tPropertyNameValueMap::const_iterator aValueEnd( rValueMap.end()   );
     148       24712 :     sal_Int32 nN=0;
     149      641296 :     for( ; aValueIt != aValueEnd; ++aValueIt )
     150             :     {
     151      616584 :         const uno::Any& rAny = aValueIt->second;
     152      616584 :         if( rAny.hasValue() )
     153             :         {
     154             :             //do not set empty anys because of performance (otherwise SdrAttrObj::ItemChange will take much longer)
     155      616584 :             rNames[nN]  = aValueIt->first;
     156      616584 :             rValues[nN] = rAny;
     157      616584 :             ++nN;
     158             :         }
     159             :     }
     160             :     //reduce to real property count
     161       24712 :     rNames.realloc(nN);
     162       24712 :     rValues.realloc(nN);
     163       24712 : }
     164             : 
     165       22168 : uno::Any* PropertyMapper::getValuePointer( tAnySequence& rPropValues
     166             :                          , const tNameSequence& rPropNames
     167             :                          , const OUString& rPropName )
     168             : {
     169       22168 :     sal_Int32 nCount = rPropNames.getLength();
     170      785561 :     for( sal_Int32 nN = 0; nN < nCount; nN++ )
     171             :     {
     172      781860 :         if(rPropNames[nN].equals(rPropName))
     173       18467 :             return &rPropValues[nN];
     174             :     }
     175        3701 :     return NULL;
     176             : }
     177             : 
     178        3766 : uno::Any* PropertyMapper::getValuePointerForLimitedSpace( tAnySequence& rPropValues
     179             :                          , const tNameSequence& rPropNames
     180             :                          , bool bLimitedHeight)
     181             : {
     182             :     return PropertyMapper::getValuePointer( rPropValues, rPropNames
     183        3766 :         , bLimitedHeight ? OUString("TextMaximumFrameHeight") : OUString("TextMaximumFrameWidth") );
     184             : }
     185             : 
     186        1848 : const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForCharacterProperties()
     187             : {
     188             :     //shape property -- chart model object property
     189             :     static tMakePropertyNameMap m_aShapePropertyMapForCharacterProperties =
     190             :         tMakePropertyNameMap
     191             :         ( "CharColor",                "CharColor" )
     192          24 :         ( "CharContoured",            "CharContoured" )
     193          36 :         ( "CharEmphasis",             "CharEmphasis" )//the service style::CharacterProperties  describes a property called 'CharEmphasize' which is nowhere implemented
     194             : 
     195          36 :         ( "CharFontFamily",           "CharFontFamily" )
     196          36 :         ( "CharFontFamilyAsian",      "CharFontFamilyAsian" )
     197          36 :         ( "CharFontFamilyComplex",    "CharFontFamilyComplex" )
     198          36 :         ( "CharFontCharSet",          "CharFontCharSet" )
     199          36 :         ( "CharFontCharSetAsian",     "CharFontCharSetAsian" )
     200          36 :         ( "CharFontCharSetComplex",   "CharFontCharSetComplex" )
     201          36 :         ( "CharFontName",             "CharFontName" )
     202          36 :         ( "CharFontNameAsian",        "CharFontNameAsian" )
     203          36 :         ( "CharFontNameComplex",      "CharFontNameComplex" )
     204          36 :         ( "CharFontPitch",            "CharFontPitch" )
     205          36 :         ( "CharFontPitchAsian",       "CharFontPitchAsian" )
     206          36 :         ( "CharFontPitchComplex",     "CharFontPitchComplex" )
     207          36 :         ( "CharFontStyleName",        "CharFontStyleName" )
     208          36 :         ( "CharFontStyleNameAsian",   "CharFontStyleNameAsian" )
     209          36 :         ( "CharFontStyleNameComplex", "CharFontStyleNameComplex" )
     210             : 
     211          36 :         ( "CharHeight",               "CharHeight" )
     212          36 :         ( "CharHeightAsian",          "CharHeightAsian" )
     213          36 :         ( "CharHeightComplex",        "CharHeightComplex" )
     214          36 :         ( "CharKerning",              "CharKerning" )
     215          36 :         ( "CharLocale",               "CharLocale" )
     216          36 :         ( "CharLocaleAsian",          "CharLocaleAsian" )
     217          36 :         ( "CharLocaleComplex",        "CharLocaleComplex" )
     218          36 :         ( "CharPosture",              "CharPosture" )
     219          36 :         ( "CharPostureAsian",         "CharPostureAsian" )
     220          36 :         ( "CharPostureComplex",       "CharPostureComplex" )
     221          36 :         ( "CharRelief",               "CharRelief" )
     222          36 :         ( "CharShadowed",             "CharShadowed" )
     223          36 :         ( "CharStrikeout",            "CharStrikeout" )
     224          36 :         ( "CharUnderline",            "CharUnderline" )
     225          36 :         ( "CharUnderlineColor",       "CharUnderlineColor" )
     226          36 :         ( "CharUnderlineHasColor",    "CharUnderlineHasColor" )
     227          36 :         ( "CharOverline",             "CharOverline" )
     228          36 :         ( "CharOverlineColor",        "CharOverlineColor" )
     229          36 :         ( "CharOverlineHasColor",     "CharOverlineHasColor" )
     230          36 :         ( "CharWeight",               "CharWeight" )
     231          36 :         ( "CharWeightAsian",          "CharWeightAsian" )
     232          36 :         ( "CharWeightComplex",        "CharWeightComplex" )
     233          36 :         ( "CharWordMode",             "CharWordMode" )
     234             : 
     235          36 :         ( "WritingMode",              "WritingMode" )
     236             : 
     237        1872 :         ( "ParaIsCharacterDistance",  "ParaIsCharacterDistance" )
     238             :         ;
     239        1848 :     return m_aShapePropertyMapForCharacterProperties;
     240             : }
     241             : 
     242         905 : const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForParagraphProperties()
     243             : {
     244             :     //shape property -- chart model object property
     245             :     static tMakePropertyNameMap m_aShapePropertyMapForParagraphProperties =
     246             :         tMakePropertyNameMap
     247             :         ( "ParaAdjust",          "ParaAdjust" )
     248           8 :         ( "ParaBottomMargin",    "ParaBottomMargin" )
     249          12 :         ( "ParaIsHyphenation",   "ParaIsHyphenation" )
     250          12 :         ( "ParaLastLineAdjust",  "ParaLastLineAdjust" )
     251          12 :         ( "ParaLeftMargin",      "ParaLeftMargin" )
     252          12 :         ( "ParaRightMargin",     "ParaRightMargin" )
     253         913 :         ( "ParaTopMargin",       "ParaTopMargin" )
     254             :         ;
     255         905 :     return m_aShapePropertyMapForParagraphProperties;
     256             : }
     257             : 
     258        2742 : const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForFillProperties()
     259             : {
     260             :     //shape property -- chart model object property
     261             :     static tMakePropertyNameMap m_aShapePropertyMapForFillProperties =
     262             :         tMakePropertyNameMap
     263             :         ( "FillBackground",               "FillBackground" )
     264          32 :         ( "FillBitmapName",               "FillBitmapName" )
     265          48 :         ( "FillColor",                    "FillColor" )
     266          48 :         ( "FillGradientName",             "FillGradientName" )
     267          48 :         ( "FillGradientStepCount",        "FillGradientStepCount" )
     268          48 :         ( "FillHatchName",                "FillHatchName" )
     269          48 :         ( "FillStyle",                    "FillStyle" )
     270          48 :         ( "FillTransparence",             "FillTransparence" )
     271          48 :         ( "FillTransparenceGradientName", "FillTransparenceGradientName" )
     272             :         //bitmap properties
     273          48 :         ( "FillBitmapMode",               "FillBitmapMode" )
     274          48 :         ( "FillBitmapSizeX",              "FillBitmapSizeX" )
     275          48 :         ( "FillBitmapSizeY",              "FillBitmapSizeY" )
     276          48 :         ( "FillBitmapLogicalSize",        "FillBitmapLogicalSize" )
     277          48 :         ( "FillBitmapOffsetX",            "FillBitmapOffsetX" )
     278          48 :         ( "FillBitmapOffsetY",            "FillBitmapOffsetY" )
     279          48 :         ( "FillBitmapRectanglePoint",     "FillBitmapRectanglePoint" )
     280          48 :         ( "FillBitmapPositionOffsetX",    "FillBitmapPositionOffsetX" )
     281        2774 :         ( "FillBitmapPositionOffsetY",    "FillBitmapPositionOffsetY" )
     282             :         ;
     283        2742 :     return m_aShapePropertyMapForFillProperties;
     284             : }
     285             : 
     286        2991 : const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForLineProperties()
     287             : {
     288             :     //shape property -- chart model object property
     289             :     static tMakePropertyNameMap m_aShapePropertyMapForLineProperties =
     290             :         tMakePropertyNameMap
     291             :         ( "LineColor",              "LineColor" )
     292          32 :         ( "LineDashName",           "LineDashName" )
     293          48 :         ( "LineJoint",              "LineJoint" )
     294          48 :         ( "LineStyle",              "LineStyle" )
     295          48 :         ( "LineTransparence",       "LineTransparence" )
     296        3023 :         ( "LineWidth",              "LineWidth" )
     297             :         ;
     298        2991 :     return m_aShapePropertyMapForLineProperties;
     299             : }
     300             : 
     301        6910 : const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForFillAndLineProperties()
     302             : {
     303             :     static tMakePropertyNameMap m_aShapePropertyMapForFillAndLineProperties =
     304             :         tMakePropertyNameMap
     305          16 :         ( PropertyMapper::getPropertyNameMapForFillProperties() )
     306        6926 :         ( PropertyMapper::getPropertyNameMapForLineProperties() )
     307             :         ;
     308             : 
     309        6910 :     return m_aShapePropertyMapForFillAndLineProperties;
     310             : }
     311             : 
     312          15 : const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForTextShapeProperties()
     313             : {
     314             :     static tMakePropertyNameMap m_aShapePropertyMapForTextShapeProperties =
     315             :         tMakePropertyNameMap
     316           2 :         ( PropertyMapper::getPropertyNameMapForCharacterProperties() )
     317           6 :         ( PropertyMapper::getPropertyNameMapForFillProperties() )
     318          17 :         ( PropertyMapper::getPropertyNameMapForLineProperties() );
     319             : 
     320          15 :     return m_aShapePropertyMapForTextShapeProperties;
     321             : }
     322             : 
     323        3087 : 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        3103 :         ( "LineWidth",           "LineWidth" )
     333             : 
     334             :         ;
     335        3087 :     return m_aShapePropertyMapForLineSeriesProperties;
     336             : }
     337             : 
     338        4274 : const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForTextLabelProperties()
     339             : {
     340             :     // target name (drawing layer) : source name (chart model)
     341             :     static tMakePropertyNameMap aMap = tMakePropertyNameMap
     342          11 :         ( getPropertyNameMapForCharacterProperties() )
     343          33 :         ( "LineStyle", CHART_UNONAME_LABEL_BORDER_STYLE )
     344          33 :         ( "LineWidth", CHART_UNONAME_LABEL_BORDER_WIDTH )
     345          33 :         ( "LineColor", CHART_UNONAME_LABEL_BORDER_COLOR )
     346        4296 :         ( "LineTransparence", CHART_UNONAME_LABEL_BORDER_TRANS ) // fix the spelling!
     347             :         ;
     348        4274 :     return aMap;
     349             : }
     350             : 
     351       13790 : const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForFilledSeriesProperties()
     352             : {
     353             :     //shape property -- chart model object property
     354             :     static tMakePropertyNameMap m_aShapePropertyMapForFilledSeriesProperties =
     355             :         tMakePropertyNameMap
     356             :         ( "FillBackground",               "FillBackground" )
     357          22 :         ( "FillBitmapName",               "FillBitmapName" )
     358          33 :         ( "FillColor",                    "Color" )
     359          33 :         ( "FillGradientName",             "GradientName" )
     360          33 :         ( "FillGradientStepCount",        "GradientStepCount" )
     361          33 :         ( "FillHatchName",                "HatchName" )
     362          33 :         ( "FillStyle",                    "FillStyle" )
     363          33 :         ( "FillTransparence",             "Transparency" )
     364          33 :         ( "FillTransparenceGradientName", "TransparencyGradientName" )
     365             :         //bitmap properties
     366          33 :         ( "FillBitmapMode",               "FillBitmapMode" )
     367          33 :         ( "FillBitmapSizeX",              "FillBitmapSizeX" )
     368          33 :         ( "FillBitmapSizeY",              "FillBitmapSizeY" )
     369          33 :         ( "FillBitmapLogicalSize",        "FillBitmapLogicalSize" )
     370          33 :         ( "FillBitmapOffsetX",            "FillBitmapOffsetX" )
     371          33 :         ( "FillBitmapOffsetY",            "FillBitmapOffsetY" )
     372          33 :         ( "FillBitmapRectanglePoint",     "FillBitmapRectanglePoint" )
     373          33 :         ( "FillBitmapPositionOffsetX",    "FillBitmapPositionOffsetX" )
     374          33 :         ( "FillBitmapPositionOffsetY",    "FillBitmapPositionOffsetY" )
     375             :         //line properties
     376          33 :         ( "LineColor",                    "BorderColor" )
     377          33 :         ( "LineDashName",                 "BorderDashName" )
     378          33 :         ( "LineStyle",                    "BorderStyle" )
     379          33 :         ( "LineTransparence",             "BorderTransparency" )
     380       13812 :         ( "LineWidth",                    "BorderWidth" )
     381             :         ;
     382       13790 :     return m_aShapePropertyMapForFilledSeriesProperties;
     383             : }
     384             : 
     385       40173 : 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       40173 :     bool bSuccess = false;
     392             :     try
     393             :     {
     394       40173 :         uno::Reference< beans::XMultiPropertySet > xShapeMultiProp( xTarget, uno::UNO_QUERY );
     395       40173 :         if( xShapeMultiProp.is() )
     396             :         {
     397       40173 :             xShapeMultiProp->setPropertyValues( rNames, rValues );
     398       40173 :             bSuccess = true;
     399       40173 :         }
     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       40173 :     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       40173 : }
     432             : 
     433        4274 : 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        4274 :     tPropertyNameValueMap aValueMap;
     442        8548 :     tMakePropertyNameMap aNameMap = PropertyMapper::getPropertyNameMapForTextLabelProperties();
     443             : 
     444        4274 :     PropertyMapper::getValueMap(aValueMap, aNameMap, xSourceProp);
     445             : 
     446             :     //some more shape properties apart from character properties, position-matrix and label string
     447        4274 :     aValueMap.insert( tPropertyNameValueMap::value_type( "TextHorizontalAdjust", uno::makeAny(drawing::TextHorizontalAdjust_CENTER) ) ); // drawing::TextHorizontalAdjust - needs to be overwritten
     448        4274 :     aValueMap.insert( tPropertyNameValueMap::value_type( "TextVerticalAdjust", uno::makeAny(drawing::TextVerticalAdjust_CENTER) ) ); //drawing::TextVerticalAdjust - needs to be overwritten
     449        4274 :     aValueMap.insert( tPropertyNameValueMap::value_type( "TextAutoGrowHeight", uno::makeAny(sal_True) ) ); // sal_Bool
     450        4274 :     aValueMap.insert( tPropertyNameValueMap::value_type( "TextAutoGrowWidth", uno::makeAny(sal_True) ) ); // sal_Bool
     451        4274 :     if( bName )
     452         500 :         aValueMap.insert( tPropertyNameValueMap::value_type( "Name", uno::makeAny( OUString() ) ) ); //CID OUString - needs to be overwritten for each point
     453             : 
     454        4274 :     if( nLimitedSpace > 0 )
     455             :     {
     456          65 :         if(bLimitedHeight)
     457           0 :             aValueMap.insert( tPropertyNameValueMap::value_type( "TextMaximumFrameHeight", uno::makeAny(nLimitedSpace) ) ); //sal_Int32
     458             :         else
     459          65 :             aValueMap.insert( tPropertyNameValueMap::value_type( "TextMaximumFrameWidth", uno::makeAny(nLimitedSpace) ) ); //sal_Int32
     460          65 :         aValueMap.insert( tPropertyNameValueMap::value_type( "ParaIsHyphenation", uno::makeAny(sal_True) ) );
     461             :     }
     462             : 
     463        8548 :     PropertyMapper::getMultiPropertyListsFromValueMap( rPropNames, rPropValues, aValueMap );
     464        4274 : }
     465             : 
     466          15 : 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          15 :     tPropertyNameValueMap aValueMap;
     472             :     PropertyMapper::getValueMap( aValueMap
     473          15 :             , PropertyMapper::getPropertyNameMapForTextShapeProperties()
     474          15 :             , xSourceProp );
     475             : 
     476             :     // auto-grow makes sure the shape has the correct size after setting text
     477          15 :     aValueMap.insert( tPropertyNameValueMap::value_type( "TextHorizontalAdjust", uno::makeAny( drawing::TextHorizontalAdjust_CENTER )));
     478          15 :     aValueMap.insert( tPropertyNameValueMap::value_type( "TextVerticalAdjust", uno::makeAny( drawing::TextVerticalAdjust_CENTER )));
     479          15 :     aValueMap.insert( tPropertyNameValueMap::value_type( "TextAutoGrowHeight", uno::makeAny( true )));
     480          15 :     aValueMap.insert( tPropertyNameValueMap::value_type( "TextAutoGrowWidth", uno::makeAny( true )));
     481             : 
     482             :     // set some distance to the border, in case it is shown
     483          15 :     const sal_Int32 nWidthDist  = 250;
     484          15 :     const sal_Int32 nHeightDist = 125;
     485          15 :     aValueMap.insert( tPropertyNameValueMap::value_type( "TextLeftDistance",  uno::makeAny( nWidthDist )));
     486          15 :     aValueMap.insert( tPropertyNameValueMap::value_type( "TextRightDistance", uno::makeAny( nWidthDist )));
     487          15 :     aValueMap.insert( tPropertyNameValueMap::value_type( "TextUpperDistance", uno::makeAny( nHeightDist )));
     488          15 :     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          15 :     aValueMap["LineJoint"] <<= drawing::LineJoint_ROUND;
     493             : 
     494          15 :     PropertyMapper::getMultiPropertyListsFromValueMap( rPropNames, rPropValues, aValueMap );
     495          15 : }
     496             : 
     497             : } //namespace chart
     498             : 
     499             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11