LCOV - code coverage report
Current view: top level - chart2/source/view/main - PropertyMapper.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 235 0.0 %
Date: 2014-04-14 Functions: 0 18 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #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           0 : void lcl_overwriteOrAppendValues(
      38             :     tPropertyNameValueMap &rMap, const tPropertyNameValueMap& rOverwriteMap )
      39             : {
      40           0 :     tPropertyNameValueMap::const_iterator aIt( rOverwriteMap.begin() );
      41           0 :     tPropertyNameValueMap::const_iterator aEnd( rOverwriteMap.end() );
      42             : 
      43           0 :     for( ; aIt != aEnd; ++aIt )
      44           0 :         rMap[ aIt->first ] = aIt->second;
      45           0 : }
      46             : 
      47             : } // anonymous namespace
      48             : 
      49           0 : 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           0 :     if( !xTarget.is() || !xSource.is() )
      56           0 :         return;
      57             : 
      58           0 :     tNameSequence aNames;
      59           0 :     tAnySequence  aValues;
      60           0 :     getMultiPropertyLists(aNames, aValues, xSource, rMap );
      61           0 :     if(pOverwriteMap && (aNames.getLength() == aValues.getLength()))
      62             :     {
      63           0 :         tPropertyNameValueMap aNewMap;
      64           0 :         for( sal_Int32 nI=0; nI<aNames.getLength(); ++nI )
      65           0 :             aNewMap[ aNames[nI] ] = aValues[nI];
      66           0 :         lcl_overwriteOrAppendValues( aNewMap, *pOverwriteMap );
      67           0 :         aNames = ContainerHelper::MapKeysToSequence( aNewMap );
      68           0 :         aValues = ContainerHelper::MapValuesToSequence( aNewMap );
      69             :     }
      70             : 
      71           0 :     PropertyMapper::setMultiProperties( aNames, aValues, xTarget );
      72             : }
      73             : 
      74           0 : void PropertyMapper::getValueMap(
      75             :                   tPropertyNameValueMap& rValueMap
      76             :                 , const tPropertyNameMap& rNameMap
      77             :                 , const uno::Reference< beans::XPropertySet >& xSourceProp
      78             :                 )
      79             : {
      80           0 :     tPropertyNameMap::const_iterator aIt( rNameMap.begin() );
      81           0 :     tPropertyNameMap::const_iterator aEnd( rNameMap.end() );
      82             : 
      83           0 :     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           0 :         for( ; aIt != aEnd; ++aIt )
     105             :         {
     106           0 :             OUString aTarget = aIt->first;
     107           0 :             OUString aSource = aIt->second;
     108             :             try
     109             :             {
     110           0 :                 uno::Any aAny( xSourceProp->getPropertyValue(aSource) );
     111           0 :                 if( aAny.hasValue() )
     112           0 :                     rValueMap.insert( tPropertyNameValueMap::value_type( aTarget, aAny ) );
     113             :             }
     114           0 :             catch( const uno::Exception& e )
     115             :             {
     116             :                 ASSERT_EXCEPTION( e );
     117             :             }
     118           0 :         }
     119           0 :     }
     120           0 : }
     121             : 
     122           0 : void PropertyMapper::getMultiPropertyLists(
     123             :                   tNameSequence& rNames
     124             :                 , tAnySequence&  rValues
     125             :                 , const uno::Reference< beans::XPropertySet >& xSourceProp
     126             :                 , const tPropertyNameMap& rNameMap
     127             :                 )
     128             : {
     129           0 :     tPropertyNameValueMap aValueMap;
     130           0 :     getValueMap( aValueMap, rNameMap, xSourceProp );
     131           0 :     getMultiPropertyListsFromValueMap( rNames, rValues, aValueMap );
     132           0 : }
     133             : 
     134           0 : void PropertyMapper::getMultiPropertyListsFromValueMap(
     135             :                   tNameSequence& rNames
     136             :                 , tAnySequence&  rValues
     137             :                 , const tPropertyNameValueMap& rValueMap
     138             :                 )
     139             : {
     140           0 :     sal_Int32 nPropertyCount = rValueMap.size();
     141           0 :     rNames.realloc(nPropertyCount);
     142           0 :     rValues.realloc(nPropertyCount);
     143             : 
     144             :     //fill sequences
     145           0 :     tPropertyNameValueMap::const_iterator aValueIt(  rValueMap.begin() );
     146           0 :     tPropertyNameValueMap::const_iterator aValueEnd( rValueMap.end()   );
     147           0 :     sal_Int32 nN=0;
     148           0 :     for( ; aValueIt != aValueEnd; ++aValueIt )
     149             :     {
     150           0 :         const uno::Any& rAny = aValueIt->second;
     151           0 :         if( rAny.hasValue() )
     152             :         {
     153             :             //do not set empty anys because of performance (otherwise SdrAttrObj::ItemChange will take much longer)
     154           0 :             rNames[nN]  = aValueIt->first;
     155           0 :             rValues[nN] = rAny;
     156           0 :             ++nN;
     157             :         }
     158             :     }
     159             :     //reduce to real property count
     160           0 :     rNames.realloc(nN);
     161           0 :     rValues.realloc(nN);
     162           0 : }
     163             : 
     164           0 : uno::Any* PropertyMapper::getValuePointer( tAnySequence& rPropValues
     165             :                          , const tNameSequence& rPropNames
     166             :                          , const OUString& rPropName )
     167             : {
     168           0 :     sal_Int32 nCount = rPropNames.getLength();
     169           0 :     for( sal_Int32 nN = 0; nN < nCount; nN++ )
     170             :     {
     171           0 :         if(rPropNames[nN].equals(rPropName))
     172           0 :             return &rPropValues[nN];
     173             :     }
     174           0 :     return NULL;
     175             : }
     176             : 
     177           0 : uno::Any* PropertyMapper::getValuePointerForLimitedSpace( tAnySequence& rPropValues
     178             :                          , const tNameSequence& rPropNames
     179             :                          , bool bLimitedHeight)
     180             : {
     181             :     return PropertyMapper::getValuePointer( rPropValues, rPropNames
     182           0 :         , bLimitedHeight ? OUString("TextMaximumFrameHeight") : OUString("TextMaximumFrameWidth") );
     183             : }
     184             : 
     185           0 : const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForCharacterProperties()
     186             : {
     187             :     //shape property -- chart model object property
     188             :     static tMakePropertyNameMap m_aShapePropertyMapForCharacterProperties =
     189             :         tMakePropertyNameMap
     190             :         ( "CharColor",                "CharColor" )
     191           0 :         ( "CharContoured",            "CharContoured" )
     192           0 :         ( "CharEmphasis",             "CharEmphasis" )//the service style::CharacterProperties  describes a property called 'CharEmphasize' which is nowhere implemented
     193             : 
     194           0 :         ( "CharFontFamily",           "CharFontFamily" )
     195           0 :         ( "CharFontFamilyAsian",      "CharFontFamilyAsian" )
     196           0 :         ( "CharFontFamilyComplex",    "CharFontFamilyComplex" )
     197           0 :         ( "CharFontCharSet",          "CharFontCharSet" )
     198           0 :         ( "CharFontCharSetAsian",     "CharFontCharSetAsian" )
     199           0 :         ( "CharFontCharSetComplex",   "CharFontCharSetComplex" )
     200           0 :         ( "CharFontName",             "CharFontName" )
     201           0 :         ( "CharFontNameAsian",        "CharFontNameAsian" )
     202           0 :         ( "CharFontNameComplex",      "CharFontNameComplex" )
     203           0 :         ( "CharFontPitch",            "CharFontPitch" )
     204           0 :         ( "CharFontPitchAsian",       "CharFontPitchAsian" )
     205           0 :         ( "CharFontPitchComplex",     "CharFontPitchComplex" )
     206           0 :         ( "CharFontStyleName",        "CharFontStyleName" )
     207           0 :         ( "CharFontStyleNameAsian",   "CharFontStyleNameAsian" )
     208           0 :         ( "CharFontStyleNameComplex", "CharFontStyleNameComplex" )
     209             : 
     210           0 :         ( "CharHeight",               "CharHeight" )
     211           0 :         ( "CharHeightAsian",          "CharHeightAsian" )
     212           0 :         ( "CharHeightComplex",        "CharHeightComplex" )
     213           0 :         ( "CharKerning",              "CharKerning" )
     214           0 :         ( "CharLocale",               "CharLocale" )
     215           0 :         ( "CharLocaleAsian",          "CharLocaleAsian" )
     216           0 :         ( "CharLocaleComplex",        "CharLocaleComplex" )
     217           0 :         ( "CharPosture",              "CharPosture" )
     218           0 :         ( "CharPostureAsian",         "CharPostureAsian" )
     219           0 :         ( "CharPostureComplex",       "CharPostureComplex" )
     220           0 :         ( "CharRelief",               "CharRelief" )
     221           0 :         ( "CharShadowed",             "CharShadowed" )
     222           0 :         ( "CharStrikeout",            "CharStrikeout" )
     223           0 :         ( "CharUnderline",            "CharUnderline" )
     224           0 :         ( "CharUnderlineColor",       "CharUnderlineColor" )
     225           0 :         ( "CharUnderlineHasColor",    "CharUnderlineHasColor" )
     226           0 :         ( "CharOverline",             "CharOverline" )
     227           0 :         ( "CharOverlineColor",        "CharOverlineColor" )
     228           0 :         ( "CharOverlineHasColor",     "CharOverlineHasColor" )
     229           0 :         ( "CharWeight",               "CharWeight" )
     230           0 :         ( "CharWeightAsian",          "CharWeightAsian" )
     231           0 :         ( "CharWeightComplex",        "CharWeightComplex" )
     232           0 :         ( "CharWordMode",             "CharWordMode" )
     233             : 
     234           0 :         ( "WritingMode",              "WritingMode" )
     235             : 
     236           0 :         ( "ParaIsCharacterDistance",  "ParaIsCharacterDistance" )
     237             :         ;
     238           0 :     return m_aShapePropertyMapForCharacterProperties;
     239             : }
     240             : 
     241           0 : const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForParagraphProperties()
     242             : {
     243             :     //shape property -- chart model object property
     244             :     static tMakePropertyNameMap m_aShapePropertyMapForParagraphProperties =
     245             :         tMakePropertyNameMap
     246             :         ( "ParaAdjust",          "ParaAdjust" )
     247           0 :         ( "ParaBottomMargin",    "ParaBottomMargin" )
     248           0 :         ( "ParaIsHyphenation",   "ParaIsHyphenation" )
     249           0 :         ( "ParaLastLineAdjust",  "ParaLastLineAdjust" )
     250           0 :         ( "ParaLeftMargin",      "ParaLeftMargin" )
     251           0 :         ( "ParaRightMargin",     "ParaRightMargin" )
     252           0 :         ( "ParaTopMargin",       "ParaTopMargin" )
     253             :         ;
     254           0 :     return m_aShapePropertyMapForParagraphProperties;
     255             : }
     256             : 
     257           0 : const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForFillProperties()
     258             : {
     259             :     //shape property -- chart model object property
     260             :     static tMakePropertyNameMap m_aShapePropertyMapForFillProperties =
     261             :         tMakePropertyNameMap
     262             :         ( "FillBackground",               "FillBackground" )
     263           0 :         ( "FillBitmapName",               "FillBitmapName" )
     264           0 :         ( "FillColor",                    "FillColor" )
     265           0 :         ( "FillGradientName",             "FillGradientName" )
     266           0 :         ( "FillGradientStepCount",        "FillGradientStepCount" )
     267           0 :         ( "FillHatchName",                "FillHatchName" )
     268           0 :         ( "FillStyle",                    "FillStyle" )
     269           0 :         ( "FillTransparence",             "FillTransparence" )
     270           0 :         ( "FillTransparenceGradientName", "FillTransparenceGradientName" )
     271             :         //bitmap properties
     272           0 :         ( "FillBitmapMode",               "FillBitmapMode" )
     273           0 :         ( "FillBitmapSizeX",              "FillBitmapSizeX" )
     274           0 :         ( "FillBitmapSizeY",              "FillBitmapSizeY" )
     275           0 :         ( "FillBitmapLogicalSize",        "FillBitmapLogicalSize" )
     276           0 :         ( "FillBitmapOffsetX",            "FillBitmapOffsetX" )
     277           0 :         ( "FillBitmapOffsetY",            "FillBitmapOffsetY" )
     278           0 :         ( "FillBitmapRectanglePoint",     "FillBitmapRectanglePoint" )
     279           0 :         ( "FillBitmapPositionOffsetX",    "FillBitmapPositionOffsetX" )
     280           0 :         ( "FillBitmapPositionOffsetY",    "FillBitmapPositionOffsetY" )
     281             :         ;
     282           0 :     return m_aShapePropertyMapForFillProperties;
     283             : }
     284             : 
     285           0 : const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForLineProperties()
     286             : {
     287             :     //shape property -- chart model object property
     288             :     static tMakePropertyNameMap m_aShapePropertyMapForLineProperties =
     289             :         tMakePropertyNameMap
     290             :         ( "LineColor",              "LineColor" )
     291           0 :         ( "LineDashName",           "LineDashName" )
     292           0 :         ( "LineJoint",              "LineJoint" )
     293           0 :         ( "LineStyle",              "LineStyle" )
     294           0 :         ( "LineTransparence",       "LineTransparence" )
     295           0 :         ( "LineWidth",              "LineWidth" )
     296             :         ;
     297           0 :     return m_aShapePropertyMapForLineProperties;
     298             : }
     299             : 
     300           0 : const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForFillAndLineProperties()
     301             : {
     302             :     static tMakePropertyNameMap m_aShapePropertyMapForFillAndLineProperties =
     303             :         tMakePropertyNameMap
     304           0 :         ( PropertyMapper::getPropertyNameMapForFillProperties() )
     305           0 :         ( PropertyMapper::getPropertyNameMapForLineProperties() )
     306             :         ;
     307             : 
     308           0 :     return m_aShapePropertyMapForFillAndLineProperties;
     309             : }
     310             : 
     311           0 : const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForTextShapeProperties()
     312             : {
     313             :     static tMakePropertyNameMap m_aShapePropertyMapForTextShapeProperties =
     314             :         tMakePropertyNameMap
     315           0 :         ( PropertyMapper::getPropertyNameMapForCharacterProperties() )
     316           0 :         ( PropertyMapper::getPropertyNameMapForFillProperties() )
     317           0 :         ( PropertyMapper::getPropertyNameMapForLineProperties() );
     318             : 
     319           0 :     return m_aShapePropertyMapForTextShapeProperties;
     320             : }
     321             : 
     322           0 : const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForLineSeriesProperties()
     323             : {
     324             :     //shape property -- chart model object property
     325             :     static tMakePropertyNameMap m_aShapePropertyMapForLineSeriesProperties =
     326             :         tMakePropertyNameMap
     327             :         ( "LineColor",           "Color" )
     328           0 :         ( "LineDashName",        "LineDashName" )
     329           0 :         ( "LineStyle",           "LineStyle" )
     330           0 :         ( "LineTransparence",    "Transparency" )
     331           0 :         ( "LineWidth",           "LineWidth" )
     332             : 
     333             :         ;
     334           0 :     return m_aShapePropertyMapForLineSeriesProperties;
     335             : }
     336             : 
     337           0 : const tMakePropertyNameMap& PropertyMapper::getPropertyNameMapForFilledSeriesProperties()
     338             : {
     339             :     //shape property -- chart model object property
     340             :     static tMakePropertyNameMap m_aShapePropertyMapForFilledSeriesProperties =
     341             :         tMakePropertyNameMap
     342             :         ( "FillBackground",               "FillBackground" )
     343           0 :         ( "FillBitmapName",               "FillBitmapName" )
     344           0 :         ( "FillColor",                    "Color" )
     345           0 :         ( "FillGradientName",             "GradientName" )
     346           0 :         ( "FillGradientStepCount",        "GradientStepCount" )
     347           0 :         ( "FillHatchName",                "HatchName" )
     348           0 :         ( "FillStyle",                    "FillStyle" )
     349           0 :         ( "FillTransparence",             "Transparency" )
     350           0 :         ( "FillTransparenceGradientName", "TransparencyGradientName" )
     351             :         //bitmap properties
     352           0 :         ( "FillBitmapMode",               "FillBitmapMode" )
     353           0 :         ( "FillBitmapSizeX",              "FillBitmapSizeX" )
     354           0 :         ( "FillBitmapSizeY",              "FillBitmapSizeY" )
     355           0 :         ( "FillBitmapLogicalSize",        "FillBitmapLogicalSize" )
     356           0 :         ( "FillBitmapOffsetX",            "FillBitmapOffsetX" )
     357           0 :         ( "FillBitmapOffsetY",            "FillBitmapOffsetY" )
     358           0 :         ( "FillBitmapRectanglePoint",     "FillBitmapRectanglePoint" )
     359           0 :         ( "FillBitmapPositionOffsetX",    "FillBitmapPositionOffsetX" )
     360           0 :         ( "FillBitmapPositionOffsetY",    "FillBitmapPositionOffsetY" )
     361             :         //line properties
     362           0 :         ( "LineColor",                    "BorderColor" )
     363           0 :         ( "LineDashName",                 "BorderDashName" )
     364           0 :         ( "LineStyle",                    "BorderStyle" )
     365           0 :         ( "LineTransparence",             "BorderTransparency" )
     366           0 :         ( "LineWidth",                    "BorderWidth" )
     367             :         ;
     368           0 :     return m_aShapePropertyMapForFilledSeriesProperties;
     369             : }
     370             : 
     371           0 : 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           0 :     bool bSuccess = false;
     378             :     try
     379             :     {
     380           0 :         uno::Reference< beans::XMultiPropertySet > xShapeMultiProp( xTarget, uno::UNO_QUERY );
     381           0 :         if( xShapeMultiProp.is() )
     382             :         {
     383           0 :             xShapeMultiProp->setPropertyValues( rNames, rValues );
     384           0 :             bSuccess = true;
     385           0 :         }
     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           0 :     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           0 : }
     418             : 
     419           0 : 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           0 :     tPropertyNameValueMap aValueMap;
     428             :     PropertyMapper::getValueMap( aValueMap
     429           0 :             , PropertyMapper::getPropertyNameMapForCharacterProperties()
     430           0 :             , xSourceProp );
     431             : 
     432             :     //some more shape properties apart from character properties, position-matrix and label string
     433           0 :     aValueMap.insert( tPropertyNameValueMap::value_type( "LineStyle", uno::makeAny(drawing::LineStyle_NONE) ) ); // drawing::LineStyle
     434           0 :     aValueMap.insert( tPropertyNameValueMap::value_type( "TextHorizontalAdjust", uno::makeAny(drawing::TextHorizontalAdjust_CENTER) ) ); // drawing::TextHorizontalAdjust - needs to be overwritten
     435           0 :     aValueMap.insert( tPropertyNameValueMap::value_type( "TextVerticalAdjust", uno::makeAny(drawing::TextVerticalAdjust_CENTER) ) ); //drawing::TextVerticalAdjust - needs to be overwritten
     436           0 :     aValueMap.insert( tPropertyNameValueMap::value_type( "TextAutoGrowHeight", uno::makeAny(sal_True) ) ); // sal_Bool
     437           0 :     aValueMap.insert( tPropertyNameValueMap::value_type( "TextAutoGrowWidth", uno::makeAny(sal_True) ) ); // sal_Bool
     438           0 :     if( bName )
     439           0 :         aValueMap.insert( tPropertyNameValueMap::value_type( "Name", uno::makeAny( OUString() ) ) ); //CID OUString - needs to be overwritten for each point
     440             : 
     441           0 :     if( nLimitedSpace > 0 )
     442             :     {
     443           0 :         if(bLimitedHeight)
     444           0 :             aValueMap.insert( tPropertyNameValueMap::value_type( "TextMaximumFrameHeight", uno::makeAny(nLimitedSpace) ) ); //sal_Int32
     445             :         else
     446           0 :             aValueMap.insert( tPropertyNameValueMap::value_type( "TextMaximumFrameWidth", uno::makeAny(nLimitedSpace) ) ); //sal_Int32
     447           0 :         aValueMap.insert( tPropertyNameValueMap::value_type( "ParaIsHyphenation", uno::makeAny(sal_True) ) );
     448             :     }
     449             : 
     450           0 :     PropertyMapper::getMultiPropertyListsFromValueMap( rPropNames, rPropValues, aValueMap );
     451           0 : }
     452             : 
     453           0 : 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           0 :     tPropertyNameValueMap aValueMap;
     459             :     PropertyMapper::getValueMap( aValueMap
     460           0 :             , PropertyMapper::getPropertyNameMapForTextShapeProperties()
     461           0 :             , xSourceProp );
     462             : 
     463             :     // auto-grow makes sure the shape has the correct size after setting text
     464           0 :     aValueMap.insert( tPropertyNameValueMap::value_type( "TextHorizontalAdjust", uno::makeAny( drawing::TextHorizontalAdjust_CENTER )));
     465           0 :     aValueMap.insert( tPropertyNameValueMap::value_type( "TextVerticalAdjust", uno::makeAny( drawing::TextVerticalAdjust_CENTER )));
     466           0 :     aValueMap.insert( tPropertyNameValueMap::value_type( "TextAutoGrowHeight", uno::makeAny( true )));
     467           0 :     aValueMap.insert( tPropertyNameValueMap::value_type( "TextAutoGrowWidth", uno::makeAny( true )));
     468             : 
     469             :     // set some distance to the border, in case it is shown
     470           0 :     const sal_Int32 nWidthDist  = 250;
     471           0 :     const sal_Int32 nHeightDist = 125;
     472           0 :     aValueMap.insert( tPropertyNameValueMap::value_type( "TextLeftDistance",  uno::makeAny( nWidthDist )));
     473           0 :     aValueMap.insert( tPropertyNameValueMap::value_type( "TextRightDistance", uno::makeAny( nWidthDist )));
     474           0 :     aValueMap.insert( tPropertyNameValueMap::value_type( "TextUpperDistance", uno::makeAny( nHeightDist )));
     475           0 :     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           0 :     aValueMap["LineJoint"] <<= drawing::LineJoint_ROUND;
     480             : 
     481           0 :     PropertyMapper::getMultiPropertyListsFromValueMap( rPropNames, rPropValues, aValueMap );
     482           0 : }
     483             : 
     484             : } //namespace chart
     485             : 
     486             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10