LCOV - code coverage report
Current view: top level - reportdesign/source/filter/xml - xmlHelper.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 101 0.0 %
Date: 2012-08-25 Functions: 0 17 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 271 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : #include "xmlHelper.hxx"
      29                 :            : #include <xmloff/xmlnmspe.hxx>
      30                 :            : #include <xmloff/xmltoken.hxx>
      31                 :            : #include <xmloff/families.hxx>
      32                 :            : #include <xmloff/controlpropertyhdl.hxx>
      33                 :            : #include <connectivity/dbtools.hxx>
      34                 :            : #include <comphelper/propertysethelper.hxx>
      35                 :            : #include <comphelper/mediadescriptor.hxx>
      36                 :            : #include <comphelper/genericpropertyset.hxx>
      37                 :            : #include <com/sun/star/style/ParagraphAdjust.hpp>
      38                 :            : #include <com/sun/star/awt/TextAlign.hpp>
      39                 :            : #include <com/sun/star/beans/PropertyAttribute.hpp>
      40                 :            : #include <com/sun/star/awt/FontDescriptor.hpp>
      41                 :            : #include <com/sun/star/awt/TextAlign.hpp>
      42                 :            : #include <com/sun/star/awt/ImagePosition.hpp>
      43                 :            : #include <com/sun/star/awt/ImageScaleMode.hpp>
      44                 :            : #include <xmloff/prstylei.hxx>
      45                 :            : #include "xmlstrings.hrc"
      46                 :            : #include "xmlEnums.hxx"
      47                 :            : #include <xmloff/contextid.hxx>
      48                 :            : #include <xmloff/txtprmap.hxx>
      49                 :            : #include <com/sun/star/sdb/XOfficeDatabaseDocument.hpp>
      50                 :            : #include <com/sun/star/table/BorderLine.hpp>
      51                 :            : #include <xmloff/XMLConstantsPropertyHandler.hxx>
      52                 :            : #include <com/sun/star/report/ForceNewPage.hpp>
      53                 :            : #include <com/sun/star/report/ReportPrintOption.hpp>
      54                 :            : #include <com/sun/star/report/GroupOn.hpp>
      55                 :            : #include <com/sun/star/report/KeepTogether.hpp>
      56                 :            : #include <xmloff/xmlement.hxx>
      57                 :            : #include <com/sun/star/report/XReportControlFormat.hpp>
      58                 :            : #include <com/sun/star/form/ListSourceType.hpp>
      59                 :            : #include <com/sun/star/sdb/CommandType.hpp>
      60                 :            : #include <com/sun/star/style/VerticalAlignment.hpp>
      61                 :            : #include <xmloff/EnumPropertyHdl.hxx>
      62                 :            : 
      63                 :            : #define XML_RPT_ALGINMENT   (XML_DB_TYPES_START+1)
      64                 :            : namespace rptxml
      65                 :            : {
      66                 :            :     using namespace ::xmloff::token;
      67                 :            :     using namespace ::com::sun::star::awt;
      68                 :            :     using namespace ::com::sun::star;
      69                 :            :     using namespace ::com::sun::star::sdb;
      70                 :            :     using namespace ::com::sun::star::form;
      71                 :            :     using namespace ::com::sun::star::beans;
      72                 :            : DBG_NAME(rpt_OPropertyHandlerFactory)
      73                 :          0 : OPropertyHandlerFactory::OPropertyHandlerFactory()
      74                 :            : {
      75                 :            :     DBG_CTOR(rpt_OPropertyHandlerFactory,NULL);
      76                 :          0 : }
      77                 :            : // -----------------------------------------------------------------------------
      78 [ #  # ][ #  # ]:          0 : OPropertyHandlerFactory::~OPropertyHandlerFactory()
      79                 :            : {
      80                 :            :     DBG_DTOR(rpt_OPropertyHandlerFactory,NULL);
      81         [ #  # ]:          0 : }
      82                 :            : // -----------------------------------------------------------------------------
      83                 :          0 : const XMLPropertyHandler* OPropertyHandlerFactory::GetPropertyHandler(sal_Int32 _nType) const
      84                 :            : {
      85                 :          0 :     const XMLPropertyHandler* pHandler = NULL;
      86                 :          0 :     sal_Int32 nType = _nType;
      87                 :          0 :     nType &= MID_FLAG_MASK;
      88                 :            : 
      89      [ #  #  # ]:          0 :     switch(nType)
      90                 :            :     {
      91                 :            :         case XML_RPT_ALGINMENT:
      92                 :            :             {
      93                 :            :                 static SvXMLEnumMapEntry const pXML_VerticalAlign_Enum[] =
      94                 :            :                 {
      95                 :            :                     { XML_TOP,          style::VerticalAlignment_TOP },
      96                 :            :                     { XML_MIDDLE,       style::VerticalAlignment_MIDDLE },
      97                 :            :                     { XML_BOTTOM,       style::VerticalAlignment_BOTTOM },
      98                 :            :                     { XML_TOKEN_INVALID, 0 }
      99                 :            :                 };
     100                 :            : 
     101         [ #  # ]:          0 :                 pHandler = new XMLEnumPropertyHdl( pXML_VerticalAlign_Enum, ::getCppuType((const com::sun::star::style::VerticalAlignment*)0) );
     102                 :            :             }
     103                 :          0 :             break;
     104                 :            :         case (XML_SD_TYPES_START+34):
     105         [ #  # ]:          0 :             pHandler = new xmloff::ImageScaleModeHandler();
     106                 :            :         default:
     107                 :            :             ;
     108                 :            :     }
     109                 :            : 
     110         [ #  # ]:          0 :     if ( !pHandler )
     111                 :          0 :         pHandler = OControlPropertyHandlerFactory::GetPropertyHandler(_nType);
     112                 :            :     else
     113                 :          0 :         PutHdlCache(nType, pHandler);
     114                 :          0 :     return pHandler;
     115                 :            : }
     116                 :            : // -----------------------------------------------------------------------------
     117                 :            : #define MAP_CONST( name, prefix, token, type, context )  { name.ascii, name.length,     XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_TEXT,       context, SvtSaveOptions::ODFVER_010 }
     118                 :            : #define MAP_CONST_T( name, prefix, token, type, context )  { name.ascii, name.length,   XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_TABLE,      context, SvtSaveOptions::ODFVER_010 }
     119                 :            : #define MAP_CONST_ASCII_T( name, prefix, token, type, context )  { name, sizeof(name)-1,XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_TABLE,      context, SvtSaveOptions::ODFVER_010 }
     120                 :            : #define MAP_CONST_P( name, prefix, token, type, context )  { name.ascii, name.length,   XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_PARAGRAPH,  context, SvtSaveOptions::ODFVER_010 }
     121                 :            : #define MAP_CONST_S( name, prefix, token, type, context )  { name, sizeof(name)-1,      XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_SECTION,    context, SvtSaveOptions::ODFVER_010 }
     122                 :            : #define MAP_CONST_ASCII( name, prefix, token, type, context )  { name, sizeof(name)-1,  XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_TEXT,       context, SvtSaveOptions::ODFVER_010 }
     123                 :            : #define GMAP( name, prefix, token, type, context )  { name.ascii, name.length,          XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_GRAPHIC,    context, SvtSaveOptions::ODFVER_010 }
     124                 :            : #define MAP_CONST_C_ASCII( name, prefix, token, type, context ) { name, sizeof(name)-1, XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_TABLE_CELL, context, SvtSaveOptions::ODFVER_010 }
     125                 :            : #define MAP_CONST_C( name, prefix, token, type, context )  { name.ascii, name.length,         XML_NAMESPACE_##prefix, XML_##token, type|XML_TYPE_PROP_TABLE_CELL, context, SvtSaveOptions::ODFVER_010 }
     126                 :            : #define MAP_END() { NULL, 0, 0, XML_TOKEN_INVALID, 0 ,0, SvtSaveOptions::ODFVER_010}
     127                 :            : // -----------------------------------------------------------------------------
     128                 :          0 : UniReference < XMLPropertySetMapper > OXMLHelper::GetCellStylePropertyMap(bool _bOldFormat)
     129                 :            : {
     130         [ #  # ]:          0 :     if ( _bOldFormat )
     131                 :            :     {
     132                 :            :         static const XMLPropertyMapEntry s_aXMLCellStylesProperties[] =
     133                 :            :         {
     134                 :            :             MAP_CONST_C(      PROPERTY_FORMATKEY,      STYLE,     DATA_STYLE_NAME,        XML_TYPE_NUMBER | MID_FLAG_SPECIAL_ITEM, CTF_RPT_NUMBERFORMAT ),
     135                 :            : 
     136                 :            :             MAP_CONST_C(      PROPERTY_CONTROLBACKGROUND,
     137                 :            :                                                 FO,   BACKGROUND_COLOR,     XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ),
     138                 :            :             MAP_CONST_C(      PROPERTY_VERTICALALIGN,   STYLE,    VERTICAL_ALIGN,       XML_RPT_ALGINMENT, 0 ),
     139                 :            :             MAP_CONST_C(      PROPERTY_CONTROLBACKGROUNDTRANSPARENT,
     140                 :            :                                                 FO,   BACKGROUND_COLOR,     XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE, 0 ),
     141                 :            :             MAP_CONST_P(      PROPERTY_CONTROLBACKGROUND,
     142                 :            :                                                 FO,   BACKGROUND_COLOR,     XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ),
     143                 :            :             MAP_CONST_P(      PROPERTY_CONTROLBACKGROUNDTRANSPARENT,
     144                 :            :                                                 FO,   BACKGROUND_COLOR,     XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE, 0 ),
     145                 :            :             MAP_CONST_C_ASCII(      "BorderLeft",       FO,     BORDER_LEFT,           XML_TYPE_BORDER, 0 ),
     146                 :            :             MAP_CONST_C_ASCII(      "BorderRight",      FO,     BORDER_RIGHT,          XML_TYPE_BORDER, 0 ),
     147                 :            :             MAP_CONST_C_ASCII(      "BorderTop",        FO,     BORDER_TOP,            XML_TYPE_BORDER, 0 ),
     148                 :            :             MAP_CONST_C_ASCII(      "BorderBottom",     FO,     BORDER_BOTTOM,         XML_TYPE_BORDER, 0 ),
     149                 :            :             MAP_END()
     150 [ #  # ][ #  # ]:          0 :         };
     151 [ #  # ][ #  # ]:          0 :         return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aXMLCellStylesProperties,new OPropertyHandlerFactory());
         [ #  # ][ #  # ]
     152                 :            :     }
     153                 :            :     else
     154                 :            :     {
     155                 :            :         static const XMLPropertyMapEntry s_aXMLCellStylesProperties[] =
     156                 :            :         {
     157                 :            :             MAP_CONST_C(      PROPERTY_FORMATKEY,      STYLE,     DATA_STYLE_NAME,        XML_TYPE_NUMBER | MID_FLAG_SPECIAL_ITEM, CTF_RPT_NUMBERFORMAT ),
     158                 :            : 
     159                 :            :             MAP_CONST_C(      PROPERTY_CONTROLBACKGROUND,
     160                 :            :                                                 FO,   BACKGROUND_COLOR,     XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ),
     161                 :            :             MAP_CONST_C(      PROPERTY_CONTROLBACKGROUNDTRANSPARENT,
     162                 :            :                                                 FO,   BACKGROUND_COLOR,     XML_TYPE_ISTRANSPARENT|MID_FLAG_MERGE_ATTRIBUTE, 0 ),
     163                 :            :             MAP_CONST_C(      PROPERTY_VERTICALALIGN,
     164                 :            :                                                 STYLE,    VERTICAL_ALIGN,       XML_RPT_ALGINMENT, 0 ),
     165                 :            :             MAP_CONST_C_ASCII(      "BorderLeft",       FO,     BORDER_LEFT,           XML_TYPE_BORDER, 0 ),
     166                 :            :             MAP_CONST_C_ASCII(      "BorderRight",      FO,     BORDER_RIGHT,          XML_TYPE_BORDER, 0 ),
     167                 :            :             MAP_CONST_C_ASCII(      "BorderTop",        FO,     BORDER_TOP,            XML_TYPE_BORDER, 0 ),
     168                 :            :             MAP_CONST_C_ASCII(      "BorderBottom",     FO,     BORDER_BOTTOM,         XML_TYPE_BORDER, 0 ),
     169                 :            :             MAP_END()
     170 [ #  # ][ #  # ]:          0 :         };
     171 [ #  # ][ #  # ]:          0 :         return new XMLPropertySetMapper((XMLPropertyMapEntry*)s_aXMLCellStylesProperties,new OPropertyHandlerFactory());
         [ #  # ][ #  # ]
     172                 :            :     }
     173                 :            : }
     174                 :            : // -----------------------------------------------------------------------------
     175                 :          0 : const XMLPropertyMapEntry* OXMLHelper::GetTableStyleProps()
     176                 :            : {
     177                 :            :     static const XMLPropertyMapEntry aXMLTableStylesProperties[] =
     178                 :            :     {
     179                 :            :         MAP_CONST_T(  PROPERTY_BACKCOLOR,      FO,     BACKGROUND_COLOR,        XML_TYPE_COLORTRANSPARENT|MID_FLAG_MULTI_PROPERTY, 0 ),
     180                 :            :         MAP_CONST_T(  PROPERTY_BACKTRANSPARENT,FO,     BACKGROUND_COLOR,        XML_TYPE_ISTRANSPARENT | MID_FLAG_MERGE_ATTRIBUTE, 0 ),
     181                 :            :         MAP_END()
     182 [ #  # ][ #  # ]:          0 :     };
     183                 :          0 :     return aXMLTableStylesProperties;
     184                 :            : }
     185                 :            : // -----------------------------------------------------------------------------
     186                 :          0 : const XMLPropertyMapEntry* OXMLHelper::GetRowStyleProps()
     187                 :            : {
     188                 :            :     static const XMLPropertyMapEntry aXMLStylesProperties[] =
     189                 :            :     {
     190                 :            :         MAP_CONST_S( "Height", STYLE, ROW_HEIGHT, XML_TYPE_PROP_TABLE_ROW|XML_TYPE_MEASURE, 0),
     191                 :            :         MAP_END()
     192                 :            :     };
     193                 :          0 :     return aXMLStylesProperties;
     194                 :            : }
     195                 :            : // -----------------------------------------------------------------------------
     196                 :          0 : const XMLPropertyMapEntry* OXMLHelper::GetColumnStyleProps()
     197                 :            : {
     198                 :            :     static const XMLPropertyMapEntry aXMLColumnStylesProperties[] =
     199                 :            :     {
     200                 :            :         MAP_CONST_S(    "Width",                 STYLE,     COLUMN_WIDTH,           XML_TYPE_PROP_TABLE_COLUMN|XML_TYPE_MEASURE, 0 ),
     201                 :            :         MAP_END()
     202                 :            :     };
     203                 :          0 :     return aXMLColumnStylesProperties;
     204                 :            : }
     205                 :            : // -----------------------------------------------------------------------------
     206                 :          0 : const SvXMLEnumMapEntry* OXMLHelper::GetReportPrintOptions()
     207                 :            : {
     208                 :            :     static SvXMLEnumMapEntry s_aXML_EnumMap[] =
     209                 :            :     {
     210                 :            :         { XML_NOT_WITH_REPORT_HEADER,               report::ReportPrintOption::NOT_WITH_REPORT_HEADER },
     211                 :            :         { XML_NOT_WITH_REPORT_FOOTER,               report::ReportPrintOption::NOT_WITH_REPORT_FOOTER },
     212                 :            :         { XML_NOT_WITH_REPORT_HEADER_NOR_FOOTER,    report::ReportPrintOption::NOT_WITH_REPORT_HEADER_FOOTER },
     213                 :            :         { XML_TOKEN_INVALID, 0 }
     214                 :            :     };
     215                 :          0 :     return s_aXML_EnumMap;
     216                 :            : }
     217                 :            : // -----------------------------------------------------------------------------
     218                 :          0 : const SvXMLEnumMapEntry* OXMLHelper::GetForceNewPageOptions()
     219                 :            : {
     220                 :            :     static SvXMLEnumMapEntry s_aXML_EnumMap[] =
     221                 :            :     {
     222                 :            :         { XML_BEFORE_SECTION,       report::ForceNewPage::BEFORE_SECTION },
     223                 :            :         { XML_AFTER_SECTION,        report::ForceNewPage::AFTER_SECTION },
     224                 :            :         { XML_BEFORE_AFTER_SECTION, report::ForceNewPage::BEFORE_AFTER_SECTION },
     225                 :            :         { XML_TOKEN_INVALID, 0 }
     226                 :            :     };
     227                 :          0 :     return s_aXML_EnumMap;
     228                 :            : }
     229                 :            : // -----------------------------------------------------------------------------
     230                 :          0 : const SvXMLEnumMapEntry* OXMLHelper::GetKeepTogetherOptions()
     231                 :            : {
     232                 :            :     static SvXMLEnumMapEntry s_aXML_EnumMap[] =
     233                 :            :     {
     234                 :            :         { XML_WHOLE_GROUP,          report::KeepTogether::WHOLE_GROUP },
     235                 :            :         { XML_WITH_FIRST_DETAIL,    report::KeepTogether::WITH_FIRST_DETAIL },
     236                 :            :         { XML_TOKEN_INVALID, 0 }
     237                 :            :     };
     238                 :          0 :     return s_aXML_EnumMap;
     239                 :            : }
     240                 :            : // -----------------------------------------------------------------------------
     241                 :          0 : const SvXMLEnumMapEntry* OXMLHelper::GetCommandTypeOptions()
     242                 :            : {
     243                 :            :     static SvXMLEnumMapEntry s_aXML_EnumMap[] =
     244                 :            :     {
     245                 :            :         { XML_TABLE, CommandType::TABLE },
     246                 :            :         { XML_QUERY, CommandType::QUERY },
     247                 :            :         { XML_TOKEN_INVALID, 0 }
     248                 :            :     };
     249                 :          0 :     return s_aXML_EnumMap;
     250                 :            : }
     251                 :            : // -----------------------------------------------------------------------------
     252                 :            : #define PROPERTY_ID_FONTNAME         1
     253                 :            : #define PROPERTY_ID_FONTHEIGHT       2
     254                 :            : #define PROPERTY_ID_FONTWIDTH        3
     255                 :            : #define PROPERTY_ID_FONTSTYLENAME    4
     256                 :            : #define PROPERTY_ID_FONTFAMILY       5
     257                 :            : #define PROPERTY_ID_FONTCHARSET      6
     258                 :            : #define PROPERTY_ID_FONTPITCH        7
     259                 :            : #define PROPERTY_ID_FONTCHARWIDTH    8
     260                 :            : #define PROPERTY_ID_FONTWEIGHT       9
     261                 :            : #define PROPERTY_ID_FONTSLANT        10
     262                 :            : #define PROPERTY_ID_FONTUNDERLINE    11
     263                 :            : #define PROPERTY_ID_FONTSTRIKEOUT    12
     264                 :            : #define PROPERTY_ID_FONTORIENTATION  13
     265                 :            : #define PROPERTY_ID_FONTKERNING      14
     266                 :            : #define PROPERTY_ID_FONTWORDLINEMODE 15
     267                 :            : #define PROPERTY_ID_FONTTYPE         16
     268                 :          0 : void OXMLHelper::copyStyleElements(const bool _bOld,const ::rtl::OUString& _sStyleName,const SvXMLStylesContext* _pAutoStyles,const uno::Reference<beans::XPropertySet>& _xProp)
     269                 :            : {
     270 [ #  # ][ #  # ]:          0 :     if ( !_xProp.is() || _sStyleName.isEmpty() || !_pAutoStyles )
         [ #  # ][ #  # ]
     271                 :          0 :         return;
     272 [ #  # ][ #  # ]:          0 :     XMLPropStyleContext* pAutoStyle = PTR_CAST(XMLPropStyleContext,_pAutoStyles->FindStyleChildContext(XML_STYLE_FAMILY_TABLE_CELL,_sStyleName));
     273         [ #  # ]:          0 :     if ( pAutoStyle )
     274                 :            :     {
     275                 :          0 :         ::com::sun::star::awt::FontDescriptor aFont;
     276                 :            :         static comphelper::PropertyMapEntry pMap[] =
     277                 :            :         {
     278         [ #  # ]:          0 :             {PROPERTY_FONTNAME.ascii,         static_cast<sal_uInt16>(PROPERTY_FONTNAME.length),          PROPERTY_ID_FONTNAME,           &::getCppuType(&aFont.Name)         ,PropertyAttribute::BOUND,0},
     279         [ #  # ]:          0 :             {PROPERTY_CHARFONTHEIGHT.ascii,   static_cast<sal_uInt16>(PROPERTY_CHARFONTHEIGHT.length),    PROPERTY_ID_FONTHEIGHT,         &::getCppuType(&aFont.Height)       ,PropertyAttribute::BOUND,0},
     280         [ #  # ]:          0 :             {PROPERTY_FONTWIDTH.ascii,        static_cast<sal_uInt16>(PROPERTY_FONTWIDTH.length),         PROPERTY_ID_FONTWIDTH,          &::getCppuType(&aFont.Width)        ,PropertyAttribute::BOUND,0},
     281         [ #  # ]:          0 :             {PROPERTY_FONTSTYLENAME.ascii,    static_cast<sal_uInt16>(PROPERTY_FONTSTYLENAME.length),     PROPERTY_ID_FONTSTYLENAME,      &::getCppuType(&aFont.StyleName)    ,PropertyAttribute::BOUND,0},
     282         [ #  # ]:          0 :             {PROPERTY_FONTFAMILY.ascii,       static_cast<sal_uInt16>(PROPERTY_FONTFAMILY.length),        PROPERTY_ID_FONTFAMILY,         &::getCppuType(&aFont.Family)       ,PropertyAttribute::BOUND,0},
     283         [ #  # ]:          0 :             {PROPERTY_FONTCHARSET.ascii,      static_cast<sal_uInt16>(PROPERTY_FONTCHARSET.length),       PROPERTY_ID_FONTCHARSET,        &::getCppuType(&aFont.CharSet)      ,PropertyAttribute::BOUND,0},
     284         [ #  # ]:          0 :             {PROPERTY_FONTPITCH.ascii,        static_cast<sal_uInt16>(PROPERTY_FONTPITCH.length),         PROPERTY_ID_FONTPITCH,          &::getCppuType(&aFont.Pitch)        ,PropertyAttribute::BOUND,0},
     285         [ #  # ]:          0 :             {PROPERTY_FONTCHARWIDTH.ascii,    static_cast<sal_uInt16>(PROPERTY_FONTCHARWIDTH.length),     PROPERTY_ID_FONTCHARWIDTH,      &::getCppuType(&aFont.CharacterWidth),PropertyAttribute::BOUND,0},
     286         [ #  # ]:          0 :             {PROPERTY_FONTWEIGHT.ascii,       static_cast<sal_uInt16>(PROPERTY_FONTWEIGHT.length),        PROPERTY_ID_FONTWEIGHT,         &::getCppuType(&aFont.Weight)       ,PropertyAttribute::BOUND,0},
     287         [ #  # ]:          0 :             {PROPERTY_CHARPOSTURE.ascii,      static_cast<sal_uInt16>(PROPERTY_CHARPOSTURE.length),       PROPERTY_ID_FONTSLANT,          &::getCppuType(&aFont.Slant)        ,PropertyAttribute::BOUND,0},
     288         [ #  # ]:          0 :             {PROPERTY_FONTUNDERLINE.ascii,    static_cast<sal_uInt16>(PROPERTY_FONTUNDERLINE.length),     PROPERTY_ID_FONTUNDERLINE,      &::getCppuType(&aFont.Underline)    ,PropertyAttribute::BOUND,0},
     289         [ #  # ]:          0 :             {PROPERTY_CHARSTRIKEOUT.ascii,    static_cast<sal_uInt16>(PROPERTY_CHARSTRIKEOUT.length),     PROPERTY_ID_FONTSTRIKEOUT,      &::getCppuType(&aFont.Strikeout)    ,PropertyAttribute::BOUND,0},
     290         [ #  # ]:          0 :             {PROPERTY_FONTORIENTATION.ascii,  static_cast<sal_uInt16>(PROPERTY_FONTORIENTATION.length),   PROPERTY_ID_FONTORIENTATION,    &::getCppuType(&aFont.Orientation)  ,PropertyAttribute::BOUND,0},
     291         [ #  # ]:          0 :             {PROPERTY_FONTKERNING.ascii,      static_cast<sal_uInt16>(PROPERTY_FONTKERNING.length),       PROPERTY_ID_FONTKERNING,        &::getCppuType(&aFont.Kerning)      ,PropertyAttribute::BOUND,0},
     292         [ #  # ]:          0 :             {PROPERTY_CHARWORDMODE.ascii,     static_cast<sal_uInt16>(PROPERTY_CHARWORDMODE.length),      PROPERTY_ID_FONTWORDLINEMODE,   &::getCppuType(&aFont.WordLineMode) ,PropertyAttribute::BOUND,0},
     293         [ #  # ]:          0 :             {PROPERTY_FONTTYPE.ascii,         static_cast<sal_uInt16>(PROPERTY_FONTTYPE.length),          PROPERTY_ID_FONTTYPE,           &::getCppuType(&aFont.Type)         ,PropertyAttribute::BOUND,0},
     294                 :            :             { NULL, 0, 0, NULL, 0, 0 }
     295 [ #  # ][ #  # ]:          0 :         };
                 [ #  # ]
     296                 :            :         try
     297                 :            :         {
     298         [ #  # ]:          0 :             pAutoStyle->FillPropertySet(_xProp);
     299 [ #  # ][ #  # ]:          0 :             if ( _bOld && _xProp->getPropertySetInfo()->hasPropertyByName(PROPERTY_CHARHIDDEN) )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  #  
             #  #  #  # ]
     300 [ #  # ][ #  # ]:          0 :                 _xProp->setPropertyValue(PROPERTY_CHARHIDDEN,uno::makeAny(sal_False));
         [ #  # ][ #  # ]
     301                 :            : 
     302         [ #  # ]:          0 :             uno::Reference<beans::XPropertySet> xProp = comphelper::GenericPropertySet_CreateInstance(new comphelper::PropertySetInfo(pMap));
     303         [ #  # ]:          0 :             pAutoStyle->FillPropertySet(xProp);
     304 [ #  # ][ #  # ]:          0 :             xProp->getPropertyValue(PROPERTY_FONTNAME) >>=          aFont.Name;
                 [ #  # ]
     305 [ #  # ][ #  # ]:          0 :             xProp->getPropertyValue(PROPERTY_CHARFONTHEIGHT) >>=        aFont.Height;
                 [ #  # ]
     306 [ #  # ][ #  # ]:          0 :             xProp->getPropertyValue(PROPERTY_FONTWIDTH) >>=             aFont.Width;
                 [ #  # ]
     307 [ #  # ][ #  # ]:          0 :             xProp->getPropertyValue(PROPERTY_FONTSTYLENAME) >>=         aFont.StyleName;
                 [ #  # ]
     308 [ #  # ][ #  # ]:          0 :             xProp->getPropertyValue(PROPERTY_FONTFAMILY) >>=        aFont.Family;
                 [ #  # ]
     309 [ #  # ][ #  # ]:          0 :             xProp->getPropertyValue(PROPERTY_FONTCHARSET) >>=       aFont.CharSet;
                 [ #  # ]
     310 [ #  # ][ #  # ]:          0 :             xProp->getPropertyValue(PROPERTY_FONTPITCH) >>=             aFont.Pitch;
                 [ #  # ]
     311 [ #  # ][ #  # ]:          0 :             xProp->getPropertyValue(PROPERTY_FONTCHARWIDTH) >>=         aFont.CharacterWidth;
                 [ #  # ]
     312 [ #  # ][ #  # ]:          0 :             xProp->getPropertyValue(PROPERTY_FONTWEIGHT) >>=        aFont.Weight;
                 [ #  # ]
     313 [ #  # ][ #  # ]:          0 :             xProp->getPropertyValue(PROPERTY_CHARPOSTURE) >>=           aFont.Slant;
         [ #  # ][ #  # ]
     314 [ #  # ][ #  # ]:          0 :             xProp->getPropertyValue(PROPERTY_FONTUNDERLINE) >>=         aFont.Underline;
                 [ #  # ]
     315 [ #  # ][ #  # ]:          0 :             xProp->getPropertyValue(PROPERTY_CHARSTRIKEOUT) >>=         aFont.Strikeout;
                 [ #  # ]
     316 [ #  # ][ #  # ]:          0 :             xProp->getPropertyValue(PROPERTY_FONTORIENTATION) >>=   aFont.Orientation;
                 [ #  # ]
     317 [ #  # ][ #  # ]:          0 :             xProp->getPropertyValue(PROPERTY_FONTKERNING) >>=       aFont.Kerning;
                 [ #  # ]
     318 [ #  # ][ #  # ]:          0 :             xProp->getPropertyValue(PROPERTY_CHARWORDMODE) >>=  aFont.WordLineMode;
                 [ #  # ]
     319 [ #  # ][ #  # ]:          0 :             xProp->getPropertyValue(PROPERTY_FONTTYPE) >>=          aFont.Type;
         [ #  # ][ #  # ]
     320         [ #  # ]:          0 :             uno::Reference<report::XReportControlFormat> xReportControlModel(_xProp,uno::UNO_QUERY);
     321 [ #  # ][ #  # ]:          0 :             if ( xReportControlModel.is() && !aFont.Name.isEmpty() )
                 [ #  # ]
     322                 :            :             {
     323                 :            :                 try
     324                 :            :                 {
     325 [ #  # ][ #  # ]:          0 :                     xReportControlModel->setFontDescriptor(aFont);
     326                 :            :                 }
     327         [ #  # ]:          0 :                 catch(const beans::UnknownPropertyException &){}
     328         [ #  # ]:          0 :             }
     329                 :            :            }
     330         [ #  # ]:          0 :         catch(uno::Exception&)
     331                 :            :         {
     332                 :            :             OSL_FAIL("OXMLHelper::copyStyleElements -> exception catched");
     333                 :          0 :         }
     334                 :            :     }
     335                 :            : }
     336                 :            : // -----------------------------------------------------------------------------
     337                 :          0 : uno::Reference<beans::XPropertySet> OXMLHelper::createBorderPropertySet()
     338                 :            : {
     339                 :            :     static comphelper::PropertyMapEntry pMap[] =
     340                 :            :     {
     341         [ #  # ]:          0 :         {PROPERTY_BORDERLEFT.ascii,   static_cast<sal_uInt16>(PROPERTY_BORDERLEFT.length),        0,          &::getCppuType((const table::BorderLine*)0)         ,PropertyAttribute::BOUND,0},
     342         [ #  # ]:          0 :         {PROPERTY_BORDERRIGHT.ascii,  static_cast<sal_uInt16>(PROPERTY_BORDERRIGHT.length),       1,          &::getCppuType((const table::BorderLine*)0)         ,PropertyAttribute::BOUND,0},
     343         [ #  # ]:          0 :         {PROPERTY_BORDERTOP.ascii,    static_cast<sal_uInt16>(PROPERTY_BORDERTOP.length),         2,          &::getCppuType((const table::BorderLine*)0)         ,PropertyAttribute::BOUND,0},
     344         [ #  # ]:          0 :         {PROPERTY_BORDERBOTTOM.ascii, static_cast<sal_uInt16>(PROPERTY_BORDERBOTTOM.length),      3,          &::getCppuType((const table::BorderLine*)0)         ,PropertyAttribute::BOUND,0},
     345                 :            :         { NULL, 0, 0, NULL, 0, 0 }
     346 [ #  # ][ #  # ]:          0 :     };
                 [ #  # ]
     347                 :          0 :     return comphelper::GenericPropertySet_CreateInstance(new comphelper::PropertySetInfo(pMap));
     348                 :            : }
     349                 :            : // -----------------------------------------------------------------------------
     350                 :          0 : SvXMLTokenMap* OXMLHelper::GetReportElemTokenMap()
     351                 :            : {
     352                 :            :     static SvXMLTokenMapEntry aElemTokenMap[]=
     353                 :            :     {
     354                 :            :         { XML_NAMESPACE_REPORT, XML_REPORT_HEADER,              XML_TOK_REPORT_HEADER           },
     355                 :            :         { XML_NAMESPACE_REPORT, XML_PAGE_HEADER ,               XML_TOK_PAGE_HEADER             },
     356                 :            :         { XML_NAMESPACE_REPORT, XML_GROUP,                      XML_TOK_GROUP                   },
     357                 :            :         { XML_NAMESPACE_REPORT, XML_DETAIL      ,               XML_TOK_DETAIL                  },
     358                 :            :         { XML_NAMESPACE_REPORT, XML_PAGE_FOOTER ,               XML_TOK_PAGE_FOOTER             },
     359                 :            :         { XML_NAMESPACE_REPORT, XML_REPORT_FOOTER,              XML_TOK_REPORT_FOOTER           },
     360                 :            :         { XML_NAMESPACE_REPORT, XML_HEADER_ON_NEW_PAGE,         XML_TOK_HEADER_ON_NEW_PAGE      },
     361                 :            :         { XML_NAMESPACE_REPORT, XML_FOOTER_ON_NEW_PAGE,         XML_TOK_FOOTER_ON_NEW_PAGE      },
     362                 :            :         { XML_NAMESPACE_REPORT, XML_COMMAND_TYPE,               XML_TOK_COMMAND_TYPE            },
     363                 :            :         { XML_NAMESPACE_REPORT, XML_COMMAND,                    XML_TOK_COMMAND                 },
     364                 :            :         { XML_NAMESPACE_REPORT, XML_FILTER,                     XML_TOK_FILTER                  },
     365                 :            :         { XML_NAMESPACE_REPORT, XML_CAPTION,                    XML_TOK_CAPTION                 },
     366                 :            :         { XML_NAMESPACE_REPORT, XML_ESCAPE_PROCESSING,          XML_TOK_ESCAPE_PROCESSING       },
     367                 :            :         { XML_NAMESPACE_REPORT, XML_FUNCTION,                   XML_TOK_REPORT_FUNCTION         },
     368                 :            :         { XML_NAMESPACE_OFFICE, XML_MIMETYPE,                   XML_TOK_REPORT_MIMETYPE         },
     369                 :            :         { XML_NAMESPACE_DRAW,   XML_NAME,                       XML_TOK_REPORT_NAME             },
     370                 :            :         { XML_NAMESPACE_REPORT, XML_MASTER_DETAIL_FIELDS,       XML_TOK_MASTER_DETAIL_FIELDS    },
     371                 :            :         { XML_NAMESPACE_DRAW,   XML_FRAME,                      XML_TOK_SUB_FRAME               },
     372                 :            :         XML_TOKEN_MAP_END
     373                 :            :     };
     374         [ #  # ]:          0 :     return new SvXMLTokenMap( aElemTokenMap );
     375                 :            : }
     376                 :            : // -----------------------------------------------------------------------------
     377                 :          0 : SvXMLTokenMap* OXMLHelper::GetSubDocumentElemTokenMap()
     378                 :            : {
     379                 :            :     static SvXMLTokenMapEntry aElemTokenMap[]=
     380                 :            :     {
     381                 :            :         { XML_NAMESPACE_REPORT, XML_MASTER_DETAIL_FIELD,    XML_TOK_MASTER_DETAIL_FIELD},
     382                 :            :         { XML_NAMESPACE_REPORT, XML_MASTER,                 XML_TOK_MASTER},
     383                 :            :         { XML_NAMESPACE_REPORT, XML_DETAIL,                 XML_TOK_SUB_DETAIL},
     384                 :            :         XML_TOKEN_MAP_END
     385                 :            :     };
     386         [ #  # ]:          0 :     return new SvXMLTokenMap( aElemTokenMap );
     387                 :            : }
     388                 :            : // -----------------------------------------------------------------------------
     389                 :          0 : const SvXMLEnumMapEntry* OXMLHelper::GetImageScaleOptions()
     390                 :            : {
     391                 :            :        static SvXMLEnumMapEntry s_aXML_EnumMap[] =
     392                 :            :        {
     393                 :            :                { XML_ISOTROPIC,        awt::ImageScaleMode::Isotropic },
     394                 :            :                { XML_ANISOTROPIC,      awt::ImageScaleMode::Anisotropic },
     395                 :            :                { XML_TOKEN_INVALID, 0 }
     396                 :            :        };
     397                 :          0 :        return s_aXML_EnumMap;
     398                 :            : }
     399                 :            : // -----------------------------------------------------------------------------
     400                 :            : // -----------------------------------------------------------------------------
     401                 :            : } // rptxml
     402                 :            : // -----------------------------------------------------------------------------
     403                 :            : 
     404                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10