1*cde9e8dcSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*cde9e8dcSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*cde9e8dcSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*cde9e8dcSAndrew Rist * distributed with this work for additional information 6*cde9e8dcSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*cde9e8dcSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*cde9e8dcSAndrew Rist * "License"); you may not use this file except in compliance 9*cde9e8dcSAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*cde9e8dcSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*cde9e8dcSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*cde9e8dcSAndrew Rist * software distributed under the License is distributed on an 15*cde9e8dcSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*cde9e8dcSAndrew Rist * KIND, either express or implied. See the License for the 17*cde9e8dcSAndrew Rist * specific language governing permissions and limitations 18*cde9e8dcSAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*cde9e8dcSAndrew Rist *************************************************************/ 21*cde9e8dcSAndrew Rist 22*cde9e8dcSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 25cdf0e10cSrcweir #include "precompiled_chart2.hxx" 26cdf0e10cSrcweir #include "CharacterProperties.hxx" 27cdf0e10cSrcweir #include "ContainerHelper.hxx" 28cdf0e10cSrcweir #include "macros.hxx" 29cdf0e10cSrcweir 30cdf0e10cSrcweir #include <com/sun/star/beans/PropertyAttribute.hpp> 31cdf0e10cSrcweir #include <com/sun/star/style/XStyle.hpp> 32cdf0e10cSrcweir #include <com/sun/star/awt/FontSlant.hpp> 33cdf0e10cSrcweir #include <com/sun/star/lang/Locale.hpp> 34cdf0e10cSrcweir 35cdf0e10cSrcweir #include <com/sun/star/awt/FontFamily.hpp> 36cdf0e10cSrcweir #include <com/sun/star/awt/CharSet.hpp> 37cdf0e10cSrcweir #include <com/sun/star/awt/FontPitch.hpp> 38cdf0e10cSrcweir #include <com/sun/star/awt/FontUnderline.hpp> 39cdf0e10cSrcweir #include <com/sun/star/awt/FontWeight.hpp> 40cdf0e10cSrcweir #include <com/sun/star/awt/FontSlant.hpp> 41cdf0e10cSrcweir #include <com/sun/star/style/CaseMap.hpp> 42cdf0e10cSrcweir #include <com/sun/star/text/FontRelief.hpp> 43cdf0e10cSrcweir #include <com/sun/star/text/FontEmphasis.hpp> 44cdf0e10cSrcweir #include <com/sun/star/text/RubyAdjust.hpp> 45cdf0e10cSrcweir #include <com/sun/star/awt/FontStrikeout.hpp> 46cdf0e10cSrcweir #include <com/sun/star/text/WritingMode2.hpp> 47cdf0e10cSrcweir #include <com/sun/star/i18n/ScriptType.hpp> 48cdf0e10cSrcweir 49cdf0e10cSrcweir #include <comphelper/InlineContainer.hxx> 50cdf0e10cSrcweir 51cdf0e10cSrcweir 52cdf0e10cSrcweir // header for struct SvtLinguConfig 53cdf0e10cSrcweir #ifndef _SVTOOLS_LINGUCFG_HXX_ 54cdf0e10cSrcweir #include <unotools/lingucfg.hxx> 55cdf0e10cSrcweir #endif 56cdf0e10cSrcweir #ifndef INCLUDED_I18NPOOL_MSLANGID_HXX 57cdf0e10cSrcweir #include <i18npool/mslangid.hxx> 58cdf0e10cSrcweir #endif 59cdf0e10cSrcweir #ifndef _SV_OUTDEV_HXX 60cdf0e10cSrcweir #include <vcl/outdev.hxx> 61cdf0e10cSrcweir #endif 62cdf0e10cSrcweir 63cdf0e10cSrcweir using namespace ::com::sun::star; 64cdf0e10cSrcweir 65cdf0e10cSrcweir using ::com::sun::star::beans::Property; 66cdf0e10cSrcweir 67cdf0e10cSrcweir using ::rtl::OUString; 68cdf0e10cSrcweir 69cdf0e10cSrcweir namespace chart 70cdf0e10cSrcweir { 71cdf0e10cSrcweir 72cdf0e10cSrcweir void CharacterProperties::AddPropertiesToVector( 73cdf0e10cSrcweir ::std::vector< Property > & rOutProperties ) 74cdf0e10cSrcweir { 75cdf0e10cSrcweir // CharacterProperties 76cdf0e10cSrcweir rOutProperties.push_back( 77cdf0e10cSrcweir Property( C2U( "CharFontName" ), 78cdf0e10cSrcweir PROP_CHAR_FONT_NAME, 79cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const OUString * >(0)), 80cdf0e10cSrcweir beans::PropertyAttribute::BOUND 81cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 82cdf0e10cSrcweir rOutProperties.push_back( 83cdf0e10cSrcweir Property( C2U( "CharFontStyleName" ), 84cdf0e10cSrcweir PROP_CHAR_FONT_STYLE_NAME, 85cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const OUString * >(0)), 86cdf0e10cSrcweir beans::PropertyAttribute::BOUND 87cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT 88cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEVOID )); 89cdf0e10cSrcweir // CharFontFamily (see awt.FontFamily) 90cdf0e10cSrcweir rOutProperties.push_back( 91cdf0e10cSrcweir Property( C2U( "CharFontFamily" ), 92cdf0e10cSrcweir PROP_CHAR_FONT_FAMILY, 93cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), 94cdf0e10cSrcweir beans::PropertyAttribute::BOUND 95cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 96cdf0e10cSrcweir // CharFontCharSet (see awt.CharSet) 97cdf0e10cSrcweir rOutProperties.push_back( 98cdf0e10cSrcweir Property( C2U( "CharFontCharSet" ), 99cdf0e10cSrcweir PROP_CHAR_FONT_CHAR_SET, 100cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), 101cdf0e10cSrcweir beans::PropertyAttribute::BOUND 102cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 103cdf0e10cSrcweir // CharFontPitch (see awt.FontPitch) 104cdf0e10cSrcweir rOutProperties.push_back( 105cdf0e10cSrcweir Property( C2U( "CharFontPitch" ), 106cdf0e10cSrcweir PROP_CHAR_FONT_PITCH, 107cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), 108cdf0e10cSrcweir beans::PropertyAttribute::BOUND 109cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 110cdf0e10cSrcweir // CharColor 111cdf0e10cSrcweir rOutProperties.push_back( 112cdf0e10cSrcweir Property( C2U( "CharColor" ), 113cdf0e10cSrcweir PROP_CHAR_COLOR, 114cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)), 115cdf0e10cSrcweir beans::PropertyAttribute::BOUND 116cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 117cdf0e10cSrcweir // CharBackColor 118cdf0e10cSrcweir // rOutProperties.push_back( 119cdf0e10cSrcweir // Property( C2U( "CharBackColor" ), 120cdf0e10cSrcweir // PROP_CHAR_BACKGROUND_COLOR, 121cdf0e10cSrcweir // ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)), 122cdf0e10cSrcweir // beans::PropertyAttribute::BOUND 123cdf0e10cSrcweir // | beans::PropertyAttribute::MAYBEDEFAULT)); 124cdf0e10cSrcweir // CharEscapement 125cdf0e10cSrcweir rOutProperties.push_back( 126cdf0e10cSrcweir Property( C2U( "CharEscapement" ), 127cdf0e10cSrcweir PROP_CHAR_ESCAPEMENT, 128cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), 129cdf0e10cSrcweir beans::PropertyAttribute::BOUND 130cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEVOID )); 131cdf0e10cSrcweir // CharHeight 132cdf0e10cSrcweir rOutProperties.push_back( 133cdf0e10cSrcweir Property( C2U( "CharHeight" ), 134cdf0e10cSrcweir PROP_CHAR_CHAR_HEIGHT, 135cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const float * >(0)), 136cdf0e10cSrcweir beans::PropertyAttribute::BOUND 137cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 138cdf0e10cSrcweir // CharUnderline (see awt.FontUnderline) 139cdf0e10cSrcweir rOutProperties.push_back( 140cdf0e10cSrcweir Property( C2U( "CharUnderline" ), 141cdf0e10cSrcweir PROP_CHAR_UNDERLINE, 142cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), 143cdf0e10cSrcweir beans::PropertyAttribute::BOUND 144cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 145cdf0e10cSrcweir // CharUnderlineColor 146cdf0e10cSrcweir rOutProperties.push_back( 147cdf0e10cSrcweir Property( C2U( "CharUnderlineColor" ), 148cdf0e10cSrcweir PROP_CHAR_UNDERLINE_COLOR, 149cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const sal_Int32 * >(0)), 150cdf0e10cSrcweir beans::PropertyAttribute::BOUND 151cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT 152cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEVOID )); 153cdf0e10cSrcweir // CharUnderlineHasColor 154cdf0e10cSrcweir rOutProperties.push_back( 155cdf0e10cSrcweir Property( C2U( "CharUnderlineHasColor" ), 156cdf0e10cSrcweir PROP_CHAR_UNDERLINE_HAS_COLOR, 157cdf0e10cSrcweir ::getBooleanCppuType(), 158cdf0e10cSrcweir beans::PropertyAttribute::BOUND 159cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 160cdf0e10cSrcweir // CharOverline (see awt.FontUnderline) 161cdf0e10cSrcweir rOutProperties.push_back( 162cdf0e10cSrcweir Property( C2U( "CharOverline" ), 163cdf0e10cSrcweir PROP_CHAR_OVERLINE, 164cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const sal_Int16* >( 0 ) ), 165cdf0e10cSrcweir beans::PropertyAttribute::BOUND 166cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT ) ); 167cdf0e10cSrcweir // CharOverlineColor 168cdf0e10cSrcweir rOutProperties.push_back( 169cdf0e10cSrcweir Property( C2U( "CharOverlineColor" ), 170cdf0e10cSrcweir PROP_CHAR_OVERLINE_COLOR, 171cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const sal_Int32* >( 0 ) ), 172cdf0e10cSrcweir beans::PropertyAttribute::BOUND 173cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT 174cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEVOID ) ); 175cdf0e10cSrcweir // CharOverlineHasColor 176cdf0e10cSrcweir rOutProperties.push_back( 177cdf0e10cSrcweir Property( C2U( "CharOverlineHasColor" ), 178cdf0e10cSrcweir PROP_CHAR_OVERLINE_HAS_COLOR, 179cdf0e10cSrcweir ::getBooleanCppuType(), 180cdf0e10cSrcweir beans::PropertyAttribute::BOUND 181cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT ) ); 182cdf0e10cSrcweir // CharWeight (see awt.FontWeight) 183cdf0e10cSrcweir rOutProperties.push_back( 184cdf0e10cSrcweir Property( C2U( "CharWeight" ), 185cdf0e10cSrcweir PROP_CHAR_WEIGHT, 186cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const float * >(0)), 187cdf0e10cSrcweir beans::PropertyAttribute::BOUND 188cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 189cdf0e10cSrcweir // CharPosture 190cdf0e10cSrcweir rOutProperties.push_back( 191cdf0e10cSrcweir Property( C2U( "CharPosture" ), 192cdf0e10cSrcweir PROP_CHAR_POSTURE, 193cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const awt::FontSlant * >(0)), 194cdf0e10cSrcweir beans::PropertyAttribute::BOUND 195cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 196cdf0e10cSrcweir rOutProperties.push_back( 197cdf0e10cSrcweir Property( C2U( "CharAutoKerning" ), 198cdf0e10cSrcweir PROP_CHAR_AUTO_KERNING, 199cdf0e10cSrcweir ::getBooleanCppuType(), 200cdf0e10cSrcweir beans::PropertyAttribute::BOUND 201cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT 202cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEVOID )); 203cdf0e10cSrcweir rOutProperties.push_back( 204cdf0e10cSrcweir Property( C2U( "CharKerning" ), 205cdf0e10cSrcweir PROP_CHAR_KERNING, 206cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), 207cdf0e10cSrcweir beans::PropertyAttribute::BOUND 208cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT 209cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEVOID )); 210cdf0e10cSrcweir // CharCaseMap (see style.CaseMap) 211cdf0e10cSrcweir // rOutProperties.push_back( 212cdf0e10cSrcweir // Property( C2U( "CharCaseMap" ), 213cdf0e10cSrcweir // PROP_CHAR_CASE_MAPPING, 214cdf0e10cSrcweir // ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), 215cdf0e10cSrcweir // beans::PropertyAttribute::BOUND 216cdf0e10cSrcweir // | beans::PropertyAttribute::MAYBEDEFAULT )); 217cdf0e10cSrcweir 218cdf0e10cSrcweir 219cdf0e10cSrcweir // CharRotation 220cdf0e10cSrcweir // rOutProperties.push_back( 221cdf0e10cSrcweir // Property( C2U( "CharRotation" ), 222cdf0e10cSrcweir // PROP_CHAR_ROTATION, 223cdf0e10cSrcweir // ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), 224cdf0e10cSrcweir // beans::PropertyAttribute::BOUND 225cdf0e10cSrcweir // | beans::PropertyAttribute::MAYBEDEFAULT )); 226cdf0e10cSrcweir 227cdf0e10cSrcweir // // CharScaleWidth 228cdf0e10cSrcweir // rOutProperties.push_back( 229cdf0e10cSrcweir // Property( C2U( "CharScaleWidth" ), 230cdf0e10cSrcweir // PROP_CHAR_SCALE_WIDTH, 231cdf0e10cSrcweir // ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), 232cdf0e10cSrcweir // beans::PropertyAttribute::BOUND 233cdf0e10cSrcweir // | beans::PropertyAttribute::MAYBEDEFAULT )); 234cdf0e10cSrcweir // CharEscapementHeight 235cdf0e10cSrcweir rOutProperties.push_back( 236cdf0e10cSrcweir Property( C2U( "CharEscapementHeight" ), 237cdf0e10cSrcweir PROP_CHAR_ESCAPEMENT_HEIGHT, 238cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const sal_Int8 * >(0)), 239cdf0e10cSrcweir beans::PropertyAttribute::BOUND 240cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEVOID )); 241cdf0e10cSrcweir 242cdf0e10cSrcweir // CharCrossedOut 243cdf0e10cSrcweir // rOutProperties.push_back( 244cdf0e10cSrcweir // Property( C2U( "CharCrossedOut" ), 245cdf0e10cSrcweir // PROP_CHAR_CROSSED_OUT, 246cdf0e10cSrcweir // ::getBooleanCppuType(), 247cdf0e10cSrcweir // beans::PropertyAttribute::BOUND 248cdf0e10cSrcweir // | beans::PropertyAttribute::MAYBEDEFAULT )); 249cdf0e10cSrcweir // CharStrikeout (see awt.FontStrikeout) 250cdf0e10cSrcweir rOutProperties.push_back( 251cdf0e10cSrcweir Property( C2U( "CharStrikeout" ), 252cdf0e10cSrcweir PROP_CHAR_STRIKE_OUT, 253cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), 254cdf0e10cSrcweir beans::PropertyAttribute::BOUND 255cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 256cdf0e10cSrcweir // CharWordMode 257cdf0e10cSrcweir rOutProperties.push_back( 258cdf0e10cSrcweir Property( C2U( "CharWordMode" ), 259cdf0e10cSrcweir PROP_CHAR_WORD_MODE, 260cdf0e10cSrcweir ::getBooleanCppuType(), 261cdf0e10cSrcweir beans::PropertyAttribute::BOUND 262cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 263cdf0e10cSrcweir // CharFlash 264cdf0e10cSrcweir // rOutProperties.push_back( 265cdf0e10cSrcweir // Property( C2U( "CharFlash" ), 266cdf0e10cSrcweir // PROP_CHAR_FLASH, 267cdf0e10cSrcweir // ::getBooleanCppuType(), 268cdf0e10cSrcweir // beans::PropertyAttribute::BOUND 269cdf0e10cSrcweir // | beans::PropertyAttribute::MAYBEDEFAULT )); 270cdf0e10cSrcweir // CharLocale 271cdf0e10cSrcweir rOutProperties.push_back( 272cdf0e10cSrcweir Property( C2U( "CharLocale" ), 273cdf0e10cSrcweir PROP_CHAR_LOCALE, 274cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const lang::Locale * >(0)), 275cdf0e10cSrcweir //#i111967# no PropertyChangeEvent is fired on change so far 276cdf0e10cSrcweir beans::PropertyAttribute::MAYBEDEFAULT )); 277cdf0e10cSrcweir // CharShadowed 278cdf0e10cSrcweir rOutProperties.push_back( 279cdf0e10cSrcweir Property( C2U( "CharShadowed" ), 280cdf0e10cSrcweir PROP_CHAR_SHADOWED, 281cdf0e10cSrcweir ::getBooleanCppuType(), 282cdf0e10cSrcweir beans::PropertyAttribute::BOUND 283cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 284cdf0e10cSrcweir // CharContoured 285cdf0e10cSrcweir rOutProperties.push_back( 286cdf0e10cSrcweir Property( C2U( "CharContoured" ), 287cdf0e10cSrcweir PROP_CHAR_CONTOURED, 288cdf0e10cSrcweir ::getBooleanCppuType(), 289cdf0e10cSrcweir beans::PropertyAttribute::BOUND 290cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 291cdf0e10cSrcweir // CharRelief (see text.FontRelief) 292cdf0e10cSrcweir rOutProperties.push_back( 293cdf0e10cSrcweir Property( C2U( "CharRelief" ), 294cdf0e10cSrcweir PROP_CHAR_RELIEF, 295cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), 296cdf0e10cSrcweir beans::PropertyAttribute::BOUND 297cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 298cdf0e10cSrcweir 299cdf0e10cSrcweir // CharEmphasize (see text.FontEmphasis) 300cdf0e10cSrcweir rOutProperties.push_back( 301cdf0e10cSrcweir Property( C2U( "CharEmphasis" ), 302cdf0e10cSrcweir PROP_CHAR_EMPHASIS, 303cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), 304cdf0e10cSrcweir beans::PropertyAttribute::BOUND 305cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 306cdf0e10cSrcweir // // RubyText 307cdf0e10cSrcweir // rOutProperties.push_back( 308cdf0e10cSrcweir // Property( C2U( "RubyText" ), 309cdf0e10cSrcweir // PROP_CHAR_RUBY_TEXT, 310cdf0e10cSrcweir // ::getCppuType( reinterpret_cast< const OUString * >(0)), 311cdf0e10cSrcweir // beans::PropertyAttribute::BOUND 312cdf0e10cSrcweir // | beans::PropertyAttribute::MAYBEDEFAULT )); 313cdf0e10cSrcweir // // RubyAdjust (see text.RubyAdjust) 314cdf0e10cSrcweir // rOutProperties.push_back( 315cdf0e10cSrcweir // Property( C2U( "RubyAdjust" ), 316cdf0e10cSrcweir // PROP_CHAR_RUBY_ADJUST, 317cdf0e10cSrcweir // ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), 318cdf0e10cSrcweir // beans::PropertyAttribute::BOUND 319cdf0e10cSrcweir // | beans::PropertyAttribute::MAYBEDEFAULT )); 320cdf0e10cSrcweir // // RubyCharStyleName 321cdf0e10cSrcweir // rOutProperties.push_back( 322cdf0e10cSrcweir // Property( C2U( "RubyStyleName" ), 323cdf0e10cSrcweir // PROP_CHAR_RUBY_STYLE_NAME, 324cdf0e10cSrcweir // ::getCppuType( reinterpret_cast< const OUString * >(0)), 325cdf0e10cSrcweir // beans::PropertyAttribute::BOUND 326cdf0e10cSrcweir // | beans::PropertyAttribute::MAYBEDEFAULT )); 327cdf0e10cSrcweir // // RubyIsAbove 328cdf0e10cSrcweir // rOutProperties.push_back( 329cdf0e10cSrcweir // Property( C2U( "RubyIsAbove" ), 330cdf0e10cSrcweir // PROP_CHAR_RUBY_IS_ABOVE, 331cdf0e10cSrcweir // ::getBooleanCppuType(), 332cdf0e10cSrcweir // beans::PropertyAttribute::BOUND 333cdf0e10cSrcweir // | beans::PropertyAttribute::MAYBEDEFAULT )); 334cdf0e10cSrcweir // // CharNoHyphenation 335cdf0e10cSrcweir // rOutProperties.push_back( 336cdf0e10cSrcweir // Property( C2U( "InhibitHyphenation" ), 337cdf0e10cSrcweir // PROP_CHAR_INHIBIT_HYPHENATION, 338cdf0e10cSrcweir // ::getBooleanCppuType(), 339cdf0e10cSrcweir // beans::PropertyAttribute::BOUND 340cdf0e10cSrcweir // | beans::PropertyAttribute::MAYBEDEFAULT )); 341cdf0e10cSrcweir 342cdf0e10cSrcweir // CharacterPropertiesAsian 343cdf0e10cSrcweir // ===== 344cdf0e10cSrcweir // CharFontNameAsian 345cdf0e10cSrcweir rOutProperties.push_back( 346cdf0e10cSrcweir Property( C2U( "CharFontNameAsian" ), 347cdf0e10cSrcweir PROP_CHAR_ASIAN_FONT_NAME, 348cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const OUString * >(0)), 349cdf0e10cSrcweir beans::PropertyAttribute::BOUND 350cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 351cdf0e10cSrcweir // CharFontStyleNameAsian 352cdf0e10cSrcweir rOutProperties.push_back( 353cdf0e10cSrcweir Property( C2U( "CharFontStyleNameAsian" ), 354cdf0e10cSrcweir PROP_CHAR_ASIAN_FONT_STYLE_NAME, 355cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const OUString * >(0)), 356cdf0e10cSrcweir beans::PropertyAttribute::BOUND 357cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT 358cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEVOID )); 359cdf0e10cSrcweir // CharFontFamilyAsian (see awt.FontFamily) 360cdf0e10cSrcweir rOutProperties.push_back( 361cdf0e10cSrcweir Property( C2U( "CharFontFamilyAsian" ), 362cdf0e10cSrcweir PROP_CHAR_ASIAN_FONT_FAMILY, 363cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), 364cdf0e10cSrcweir beans::PropertyAttribute::BOUND 365cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 366cdf0e10cSrcweir // CharFontCharSetAsian (see awt.CharSet) 367cdf0e10cSrcweir rOutProperties.push_back( 368cdf0e10cSrcweir Property( C2U( "CharFontCharSetAsian" ), 369cdf0e10cSrcweir PROP_CHAR_ASIAN_CHAR_SET, 370cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), 371cdf0e10cSrcweir beans::PropertyAttribute::BOUND 372cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 373cdf0e10cSrcweir // CharFontPitchAsian (see awt.FontPitch) 374cdf0e10cSrcweir rOutProperties.push_back( 375cdf0e10cSrcweir Property( C2U( "CharFontPitchAsian" ), 376cdf0e10cSrcweir PROP_CHAR_ASIAN_FONT_PITCH, 377cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), 378cdf0e10cSrcweir beans::PropertyAttribute::BOUND 379cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 380cdf0e10cSrcweir // CharHeightAsian 381cdf0e10cSrcweir rOutProperties.push_back( 382cdf0e10cSrcweir Property( C2U( "CharHeightAsian" ), 383cdf0e10cSrcweir PROP_CHAR_ASIAN_CHAR_HEIGHT, 384cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const float * >(0)), 385cdf0e10cSrcweir beans::PropertyAttribute::BOUND 386cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 387cdf0e10cSrcweir // CharWeightAsian 388cdf0e10cSrcweir rOutProperties.push_back( 389cdf0e10cSrcweir Property( C2U( "CharWeightAsian" ), 390cdf0e10cSrcweir PROP_CHAR_ASIAN_WEIGHT, 391cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const float * >(0)), 392cdf0e10cSrcweir beans::PropertyAttribute::BOUND 393cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 394cdf0e10cSrcweir // CharPostureAsian 395cdf0e10cSrcweir rOutProperties.push_back( 396cdf0e10cSrcweir Property( C2U( "CharPostureAsian" ), 397cdf0e10cSrcweir PROP_CHAR_ASIAN_POSTURE, 398cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const awt::FontSlant * >(0)), 399cdf0e10cSrcweir beans::PropertyAttribute::BOUND 400cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 401cdf0e10cSrcweir // CharLocaleAsian 402cdf0e10cSrcweir rOutProperties.push_back( 403cdf0e10cSrcweir Property( C2U( "CharLocaleAsian" ), 404cdf0e10cSrcweir PROP_CHAR_ASIAN_LOCALE, 405cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const lang::Locale * >(0)), 406cdf0e10cSrcweir //#i111967# no PropertyChangeEvent is fired on change so far 407cdf0e10cSrcweir beans::PropertyAttribute::MAYBEDEFAULT )); 408cdf0e10cSrcweir 409cdf0e10cSrcweir // CharacterPropertiesComplex 410cdf0e10cSrcweir // === 411cdf0e10cSrcweir // CharFontNameComplex 412cdf0e10cSrcweir rOutProperties.push_back( 413cdf0e10cSrcweir Property( C2U( "CharFontNameComplex" ), 414cdf0e10cSrcweir PROP_CHAR_COMPLEX_FONT_NAME, 415cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const OUString * >(0)), 416cdf0e10cSrcweir beans::PropertyAttribute::BOUND 417cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 418cdf0e10cSrcweir // CharFontStyleNameComplex 419cdf0e10cSrcweir rOutProperties.push_back( 420cdf0e10cSrcweir Property( C2U( "CharFontStyleNameComplex" ), 421cdf0e10cSrcweir PROP_CHAR_COMPLEX_FONT_STYLE_NAME, 422cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const OUString * >(0)), 423cdf0e10cSrcweir beans::PropertyAttribute::BOUND 424cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT 425cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEVOID )); 426cdf0e10cSrcweir // CharFontFamilyComplex (see awt.FontFamily) 427cdf0e10cSrcweir rOutProperties.push_back( 428cdf0e10cSrcweir Property( C2U( "CharFontFamilyComplex" ), 429cdf0e10cSrcweir PROP_CHAR_COMPLEX_FONT_FAMILY, 430cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), 431cdf0e10cSrcweir beans::PropertyAttribute::BOUND 432cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 433cdf0e10cSrcweir // CharFontCharSetComplex (see awt.CharSet) 434cdf0e10cSrcweir rOutProperties.push_back( 435cdf0e10cSrcweir Property( C2U( "CharFontCharSetComplex" ), 436cdf0e10cSrcweir PROP_CHAR_COMPLEX_CHAR_SET, 437cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), 438cdf0e10cSrcweir beans::PropertyAttribute::BOUND 439cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 440cdf0e10cSrcweir // CharFontPitchComplex (see awt.FontPitch) 441cdf0e10cSrcweir rOutProperties.push_back( 442cdf0e10cSrcweir Property( C2U( "CharFontPitchComplex" ), 443cdf0e10cSrcweir PROP_CHAR_COMPLEX_FONT_PITCH, 444cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), 445cdf0e10cSrcweir beans::PropertyAttribute::BOUND 446cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 447cdf0e10cSrcweir // CharHeightComplex 448cdf0e10cSrcweir rOutProperties.push_back( 449cdf0e10cSrcweir Property( C2U( "CharHeightComplex" ), 450cdf0e10cSrcweir PROP_CHAR_COMPLEX_CHAR_HEIGHT, 451cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const float * >(0)), 452cdf0e10cSrcweir beans::PropertyAttribute::BOUND 453cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 454cdf0e10cSrcweir // CharWeightComplex 455cdf0e10cSrcweir rOutProperties.push_back( 456cdf0e10cSrcweir Property( C2U( "CharWeightComplex" ), 457cdf0e10cSrcweir PROP_CHAR_COMPLEX_WEIGHT, 458cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const float * >(0)), 459cdf0e10cSrcweir beans::PropertyAttribute::BOUND 460cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 461cdf0e10cSrcweir // CharPostureComplex 462cdf0e10cSrcweir rOutProperties.push_back( 463cdf0e10cSrcweir Property( C2U( "CharPostureComplex" ), 464cdf0e10cSrcweir PROP_CHAR_COMPLEX_POSTURE, 465cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const awt::FontSlant * >(0)), 466cdf0e10cSrcweir beans::PropertyAttribute::BOUND 467cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 468cdf0e10cSrcweir // CharLocaleComplex 469cdf0e10cSrcweir rOutProperties.push_back( 470cdf0e10cSrcweir Property( C2U( "CharLocaleComplex" ), 471cdf0e10cSrcweir PROP_CHAR_COMPLEX_LOCALE, 472cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const lang::Locale * >(0)), 473cdf0e10cSrcweir //#i111967# no PropertyChangeEvent is fired on change so far 474cdf0e10cSrcweir beans::PropertyAttribute::MAYBEDEFAULT )); 475cdf0e10cSrcweir 476cdf0e10cSrcweir // Writing Mode left to right vs right to left 477cdf0e10cSrcweir rOutProperties.push_back( 478cdf0e10cSrcweir Property( C2U( "WritingMode" ), 479cdf0e10cSrcweir PROP_WRITING_MODE, 480cdf0e10cSrcweir ::getCppuType( reinterpret_cast< const sal_Int16 * >(0)), /*com::sun::star::text::WritingMode2*/ 481cdf0e10cSrcweir beans::PropertyAttribute::BOUND 482cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 483cdf0e10cSrcweir 484cdf0e10cSrcweir rOutProperties.push_back( 485cdf0e10cSrcweir Property( C2U( "ParaIsCharacterDistance" ), 486cdf0e10cSrcweir PROP_PARA_IS_CHARACTER_DISTANCE, 487cdf0e10cSrcweir ::getBooleanCppuType(), 488cdf0e10cSrcweir beans::PropertyAttribute::BOUND 489cdf0e10cSrcweir | beans::PropertyAttribute::MAYBEDEFAULT )); 490cdf0e10cSrcweir } 491cdf0e10cSrcweir 492cdf0e10cSrcweir void CharacterProperties::AddDefaultsToMap( 493cdf0e10cSrcweir ::chart::tPropertyValueMap & rOutMap ) 494cdf0e10cSrcweir { 495cdf0e10cSrcweir const float fDefaultFontHeight = 13.0; 496cdf0e10cSrcweir 497cdf0e10cSrcweir SvtLinguConfig aLinguConfig; 498cdf0e10cSrcweir lang::Locale aDefaultLocale; 499cdf0e10cSrcweir aLinguConfig.GetProperty(C2U("DefaultLocale")) >>= aDefaultLocale; 500cdf0e10cSrcweir lang::Locale aDefaultLocale_CJK; 501cdf0e10cSrcweir aLinguConfig.GetProperty(C2U("DefaultLocale_CJK")) >>= aDefaultLocale_CJK; 502cdf0e10cSrcweir lang::Locale aDefaultLocale_CTL; 503cdf0e10cSrcweir aLinguConfig.GetProperty(C2U("DefaultLocale_CTL")) >>= aDefaultLocale_CTL; 504cdf0e10cSrcweir 505cdf0e10cSrcweir using namespace ::com::sun::star::i18n::ScriptType; 506cdf0e10cSrcweir LanguageType nLang; 507cdf0e10cSrcweir nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage(aDefaultLocale), LATIN); 508cdf0e10cSrcweir Font aFont = OutputDevice::GetDefaultFont( DEFAULTFONT_LATIN_SPREADSHEET, nLang, DEFAULTFONT_FLAGS_ONLYONE, 0 ); 509cdf0e10cSrcweir nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage( aDefaultLocale_CJK), ASIAN); 510cdf0e10cSrcweir Font aFontCJK = OutputDevice::GetDefaultFont( DEFAULTFONT_CJK_SPREADSHEET, nLang, DEFAULTFONT_FLAGS_ONLYONE, 0 ); 511cdf0e10cSrcweir nLang = MsLangId::resolveSystemLanguageByScriptType(MsLangId::convertLocaleToLanguage( aDefaultLocale_CTL), COMPLEX); 512cdf0e10cSrcweir Font aFontCTL = OutputDevice::GetDefaultFont( DEFAULTFONT_CTL_SPREADSHEET, nLang, DEFAULTFONT_FLAGS_ONLYONE, 0 ); 513cdf0e10cSrcweir 514cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_NAME, OUString( aFont.GetName() ) ); 515cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_STYLE_NAME, OUString(aFont.GetStyleName()) ); 516cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_FAMILY, sal_Int16(aFont.GetFamily()) );//awt::FontFamily::SWISS 517cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_CHAR_SET, sal_Int16(aFont.GetCharSet()) );//use awt::CharSet::DONTKNOW instead of SYSTEM to avoid assertion issue 50249 518cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FONT_PITCH, sal_Int16(aFont.GetPitch()) );//awt::FontPitch::VARIABLE 519cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_CHAR_COLOR, -1 ); //automatic color (COL_AUTO) 520cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_CHAR_HEIGHT, fDefaultFontHeight ); 521cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_UNDERLINE, awt::FontUnderline::NONE ); 522cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_CHAR_UNDERLINE_COLOR, -1 ); //automatic color (COL_AUTO) 523cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_UNDERLINE_HAS_COLOR, false ); 524cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_OVERLINE, awt::FontUnderline::NONE ); 525cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault< sal_Int32 >( rOutMap, PROP_CHAR_OVERLINE_COLOR, -1 ); //automatic color (COL_AUTO) 526cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_OVERLINE_HAS_COLOR, false ); 527cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_WEIGHT, awt::FontWeight::NORMAL ); 528cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_POSTURE, awt::FontSlant_NONE ); 529cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_AUTO_KERNING, true ); 530cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, PROP_CHAR_KERNING, 0 ); 531cdf0e10cSrcweir 532cdf0e10cSrcweir // ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_CASE_MAPPING, style::CaseMap::NONE ); 533cdf0e10cSrcweir // ::chart::PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, PROP_CHAR_ROTATION, 0 ); 534cdf0e10cSrcweir // ::chart::PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, PROP_CHAR_SCALE_WIDTH, 71 ); 535cdf0e10cSrcweir 536cdf0e10cSrcweir // ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_CROSSED_OUT, false ); 537cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault< sal_Int16 >( rOutMap, PROP_CHAR_STRIKE_OUT, awt::FontStrikeout::NONE ); 538cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_WORD_MODE, false ); 539cdf0e10cSrcweir // ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_FLASH, false ); 540cdf0e10cSrcweir 541cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_LOCALE, aDefaultLocale ); 542cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_SHADOWED, false ); 543cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_CONTOURED, false ); 544cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_RELIEF, text::FontRelief::NONE ); 545cdf0e10cSrcweir 546cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_EMPHASIS, text::FontEmphasis::NONE ); 547cdf0e10cSrcweir 548cdf0e10cSrcweir // ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_RUBY_ADJUST, text::RubyAdjust_INDENT_BLOCK ); 549cdf0e10cSrcweir // ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_RUBY_STYLE_NAME, ?? ); 550cdf0e10cSrcweir // ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_RUBY_IS_ABOVE, true ); 551cdf0e10cSrcweir // ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_INHIBIT_HYPHENATION, false ); 552cdf0e10cSrcweir 553cdf0e10cSrcweir // Asian (com.sun.star.style.CharacterPropertiesAsian) 554cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_CHAR_HEIGHT, fDefaultFontHeight ); 555cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_WEIGHT, awt::FontWeight::NORMAL ); 556cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_POSTURE, awt::FontSlant_NONE ); 557cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_LOCALE, aDefaultLocale_CJK ); 558cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_FONT_NAME, OUString( aFontCJK.GetName() ) ); 559cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_FONT_STYLE_NAME, OUString(aFontCJK.GetStyleName()) ); 560cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_FONT_FAMILY, sal_Int16(aFontCJK.GetFamily()) ); 561cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_CHAR_SET, sal_Int16(aFontCJK.GetCharSet()) ); 562cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_ASIAN_FONT_PITCH, sal_Int16(aFontCJK.GetPitch()) ); 563cdf0e10cSrcweir 564cdf0e10cSrcweir // Complex Text Layout (com.sun.star.style.CharacterPropertiesComplex) 565cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_CHAR_HEIGHT, fDefaultFontHeight ); 566cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_WEIGHT, awt::FontWeight::NORMAL ); 567cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_POSTURE, awt::FontSlant_NONE ); 568cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_LOCALE, aDefaultLocale_CTL ); 569cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_FONT_NAME, OUString( aFontCTL.GetName() ) ); 570cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_FONT_STYLE_NAME, OUString(aFontCTL.GetStyleName()) ); 571cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_FONT_FAMILY, sal_Int16(aFontCTL.GetFamily()) ); 572cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_CHAR_SET, sal_Int16(aFontCTL.GetCharSet()) ); 573cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_CHAR_COMPLEX_FONT_PITCH, sal_Int16(aFontCTL.GetPitch()) ); 574cdf0e10cSrcweir 575cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_WRITING_MODE, sal_Int16( com::sun::star::text::WritingMode2::PAGE ) ); 576cdf0e10cSrcweir ::chart::PropertyHelper::setPropertyValueDefault( rOutMap, PROP_PARA_IS_CHARACTER_DISTANCE, sal_True ); 577cdf0e10cSrcweir } 578cdf0e10cSrcweir 579cdf0e10cSrcweir bool CharacterProperties::IsCharacterPropertyHandle( sal_Int32 nHandle ) 580cdf0e10cSrcweir { 581cdf0e10cSrcweir return ( FAST_PROPERTY_ID_START_CHAR_PROP <= nHandle && 582cdf0e10cSrcweir nHandle < CharacterProperties::FAST_PROPERTY_ID_END_CHAR_PROP ); 583cdf0e10cSrcweir } 584cdf0e10cSrcweir 585cdf0e10cSrcweir awt::FontDescriptor CharacterProperties::createFontDescriptorFromPropertySet( 586cdf0e10cSrcweir const uno::Reference< beans::XMultiPropertySet > & xMultiPropSet ) 587cdf0e10cSrcweir { 588cdf0e10cSrcweir awt::FontDescriptor aResult; 589cdf0e10cSrcweir // Note: keep this sorted! 590cdf0e10cSrcweir ::comphelper::MakeVector< OUString > aPropNames 591cdf0e10cSrcweir ( C2U("CharFontCharSet")); // CharSet 592cdf0e10cSrcweir aPropNames 593cdf0e10cSrcweir ( C2U("CharFontFamily")) // Family 594cdf0e10cSrcweir ( C2U("CharFontName")) // Name 595cdf0e10cSrcweir ( C2U("CharFontPitch")) // Pitch 596cdf0e10cSrcweir ( C2U("CharFontStyleName")) // StyleName 597cdf0e10cSrcweir ( C2U("CharHeight")) // Height 598cdf0e10cSrcweir ( C2U("CharPosture")) // Slant 599cdf0e10cSrcweir ( C2U("CharStrikeout")) // Strikeout 600cdf0e10cSrcweir ( C2U("CharUnderline")) // Underline 601cdf0e10cSrcweir ( C2U("CharWeight")) // Weight 602cdf0e10cSrcweir ( C2U("CharWordMode")) // WordLineMode 603cdf0e10cSrcweir ; 604cdf0e10cSrcweir 605cdf0e10cSrcweir uno::Sequence< OUString > aPropNameSeq( ContainerHelper::ContainerToSequence( aPropNames )); 606cdf0e10cSrcweir uno::Sequence< uno::Any > aValues( xMultiPropSet->getPropertyValues( aPropNameSeq )); 607cdf0e10cSrcweir 608cdf0e10cSrcweir sal_Int32 i=0; 609cdf0e10cSrcweir // Note keep this sorted according to the list above (comments are the fieldnames) 610cdf0e10cSrcweir aValues[ i++ ] >>= aResult.CharSet; 611cdf0e10cSrcweir aValues[ i++ ] >>= aResult.Family; 612cdf0e10cSrcweir aValues[ i++ ] >>= aResult.Name; 613cdf0e10cSrcweir aValues[ i++ ] >>= aResult.Pitch; 614cdf0e10cSrcweir aValues[ i++ ] >>= aResult.StyleName; 615cdf0e10cSrcweir float fCharHeight = 0; 616cdf0e10cSrcweir aValues[ i++ ] >>= fCharHeight; 617cdf0e10cSrcweir aResult.Height = static_cast< sal_Int16 >( fCharHeight ); 618cdf0e10cSrcweir aValues[ i++ ] >>= aResult.Slant; 619cdf0e10cSrcweir aValues[ i++ ] >>= aResult.Strikeout; 620cdf0e10cSrcweir aValues[ i++ ] >>= aResult.Underline; 621cdf0e10cSrcweir aValues[ i++ ] >>= aResult.Weight; 622cdf0e10cSrcweir aValues[ i++ ] >>= aResult.WordLineMode; 623cdf0e10cSrcweir OSL_ASSERT( i == aValues.getLength()); 624cdf0e10cSrcweir 625cdf0e10cSrcweir return aResult; 626cdf0e10cSrcweir } 627cdf0e10cSrcweir 628cdf0e10cSrcweir } // namespace chart 629