LCOV - code coverage report
Current view: top level - xmloff/source/text - txtprhdl.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 254 454 55.9 %
Date: 2012-08-25 Functions: 61 88 69.3 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 194 533 36.4 %

           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                 :            : 
      29                 :            : #include <tools/debug.hxx>
      30                 :            : #include <rtl/ustrbuf.hxx>
      31                 :            : #include <tools/fontenum.hxx>
      32                 :            : #include <com/sun/star/uno/Any.hxx>
      33                 :            : #include <com/sun/star/style/DropCapFormat.hpp>
      34                 :            : #include <com/sun/star/text/FontRelief.hpp>
      35                 :            : #include <com/sun/star/text/WrapTextMode.hpp>
      36                 :            : #include <com/sun/star/text/XTextColumns.hpp>
      37                 :            : #include <com/sun/star/text/TextColumn.hpp>
      38                 :            : #include <com/sun/star/text/RelOrientation.hpp>
      39                 :            : #include <com/sun/star/text/HoriOrientation.hpp>
      40                 :            : #include <com/sun/star/text/VertOrientation.hpp>
      41                 :            : #include <com/sun/star/text/RubyAdjust.hpp>
      42                 :            : #include <com/sun/star/text/FontEmphasis.hpp>
      43                 :            : #include <com/sun/star/text/ParagraphVertAlign.hpp>
      44                 :            : #include <sax/tools/converter.hxx>
      45                 :            : #include <xmloff/xmltypes.hxx>
      46                 :            : #include <xmloff/xmluconv.hxx>
      47                 :            : #include <xmloff/xmltoken.hxx>
      48                 :            : #include "XMLAnchorTypePropHdl.hxx"
      49                 :            : #include <xmloff/XMLConstantsPropertyHandler.hxx>
      50                 :            : #include "XMLClipPropertyHandler.hxx"
      51                 :            : #include "XMLTextColumnsPropertyHandler.hxx"
      52                 :            : #include <xmloff/NamedBoolPropertyHdl.hxx>
      53                 :            : #include "txtprhdl.hxx"
      54                 :            : // OD 2004-05-05 #i28701#
      55                 :            : #include <com/sun/star/text/WrapInfluenceOnPosition.hpp>
      56                 :            : 
      57                 :            : 
      58                 :            : using ::rtl::OUString;
      59                 :            : using ::rtl::OUStringBuffer;
      60                 :            : 
      61                 :            : using namespace ::com::sun::star::uno;
      62                 :            : using namespace ::com::sun::star::style;
      63                 :            : using namespace ::com::sun::star::text;
      64                 :            : using namespace ::xmloff::token;
      65                 :            : 
      66                 :            : // ---------------------------------------------------------------------------
      67                 :            : 
      68                 :            : SvXMLEnumMapEntry const pXML_HoriPos_Enum[] =
      69                 :            : {
      70                 :            :     { XML_FROM_LEFT,        HoriOrientation::NONE   },
      71                 :            :     { XML_FROM_INSIDE,      HoriOrientation::NONE   },  // import only
      72                 :            :     { XML_LEFT,             HoriOrientation::LEFT   },
      73                 :            :     { XML_INSIDE,           HoriOrientation::LEFT   },  // import only
      74                 :            :     { XML_CENTER,           HoriOrientation::CENTER },
      75                 :            :     { XML_RIGHT,            HoriOrientation::RIGHT  },
      76                 :            :     { XML_OUTSIDE,          HoriOrientation::RIGHT  },  // import only
      77                 :            :     { XML_TOKEN_INVALID, 0 }
      78                 :            : };
      79                 :            : 
      80                 :            : SvXMLEnumMapEntry const pXML_HoriPosMirrored_Enum[] =
      81                 :            : {
      82                 :            :     { XML_FROM_INSIDE,      HoriOrientation::NONE   },
      83                 :            :     { XML_INSIDE,           HoriOrientation::LEFT   },
      84                 :            :     { XML_CENTER,           HoriOrientation::CENTER },
      85                 :            :     { XML_OUTSIDE,          HoriOrientation::RIGHT  },
      86                 :            :     { XML_TOKEN_INVALID, 0 }
      87                 :            : };
      88                 :            : 
      89                 :            : SvXMLEnumMapEntry const pXML_HoriRel_Enum[] =
      90                 :            : {
      91                 :            :     { XML_PARAGRAPH,            RelOrientation::FRAME   },
      92                 :            :     { XML_PARAGRAPH_CONTENT,    RelOrientation::PRINT_AREA  },
      93                 :            :     { XML_PAGE,                 RelOrientation::PAGE_FRAME  },
      94                 :            :     { XML_PAGE_CONTENT,         RelOrientation::PAGE_PRINT_AREA },
      95                 :            :     { XML_PARAGRAPH_START_MARGIN,   RelOrientation::FRAME_LEFT  },
      96                 :            :     { XML_PARAGRAPH_END_MARGIN, RelOrientation::FRAME_RIGHT },
      97                 :            :     { XML_PAGE_START_MARGIN,    RelOrientation::PAGE_LEFT   },
      98                 :            :     { XML_PAGE_END_MARGIN,      RelOrientation::PAGE_RIGHT  },
      99                 :            :     { XML_CHAR,                 RelOrientation::CHAR    },
     100                 :            :     { XML_FRAME,                RelOrientation::FRAME   },      // import only
     101                 :            :     { XML_FRAME_CONTENT,        RelOrientation::PRINT_AREA  },  // import only
     102                 :            :     { XML_FRAME_START_MARGIN,   RelOrientation::FRAME_LEFT  },  // import only
     103                 :            :     { XML_FRAME_END_MARGIN,     RelOrientation::FRAME_RIGHT },  // import only
     104                 :            :     { XML_TOKEN_INVALID, 0 }
     105                 :            : };
     106                 :            : 
     107                 :            : SvXMLEnumMapEntry const pXML_HoriRelFrame_Enum[] =
     108                 :            : {
     109                 :            :     { XML_FRAME,                RelOrientation::FRAME   },
     110                 :            :     { XML_FRAME_CONTENT,        RelOrientation::PRINT_AREA  },
     111                 :            :     { XML_PAGE,                 RelOrientation::PAGE_FRAME  },
     112                 :            :     { XML_PAGE_CONTENT,         RelOrientation::PAGE_PRINT_AREA },
     113                 :            :     { XML_FRAME_START_MARGIN,   RelOrientation::FRAME_LEFT  },
     114                 :            :     { XML_FRAME_END_MARGIN,     RelOrientation::FRAME_RIGHT },
     115                 :            :     { XML_PAGE_START_MARGIN,    RelOrientation::PAGE_LEFT   },
     116                 :            :     { XML_PAGE_END_MARGIN,      RelOrientation::PAGE_RIGHT  },
     117                 :            :     { XML_CHAR,                 RelOrientation::CHAR    },
     118                 :            :     { XML_TOKEN_INVALID, 0 }
     119                 :            : };
     120                 :            : 
     121                 :            : SvXMLEnumMapEntry const pXML_HoriMirror_Enum[] =
     122                 :            : {
     123                 :            :     { XML_FROM_LEFT,        sal_False   },
     124                 :            :     { XML_FROM_INSIDE,      sal_True    },
     125                 :            :     { XML_LEFT,             sal_False   },
     126                 :            :     { XML_INSIDE,           sal_True    },
     127                 :            :     { XML_CENTER,           sal_False   },
     128                 :            :     { XML_RIGHT,            sal_False   },
     129                 :            :     { XML_OUTSIDE,          sal_True    },
     130                 :            :     { XML_TOKEN_INVALID, 0 }
     131                 :            : };
     132                 :            : 
     133                 :            : SvXMLEnumMapEntry const pXML_VertPos_Enum[] =
     134                 :            : {
     135                 :            :     { XML_FROM_TOP,         VertOrientation::NONE       },
     136                 :            :     { XML_TOP,              VertOrientation::TOP        },
     137                 :            :     { XML_TOP,              VertOrientation::CHAR_TOP   },  // export only
     138                 :            :     { XML_TOP,              VertOrientation::LINE_TOP   },  // export only
     139                 :            :     { XML_MIDDLE,           VertOrientation::CENTER     },
     140                 :            :     { XML_MIDDLE,           VertOrientation::CHAR_CENTER    },  // export only
     141                 :            :     { XML_MIDDLE,           VertOrientation::LINE_CENTER    },  // export only
     142                 :            :     { XML_BOTTOM,           VertOrientation::BOTTOM     },
     143                 :            :     { XML_BOTTOM,           VertOrientation::CHAR_BOTTOM    },  // export only
     144                 :            :     { XML_BOTTOM,           VertOrientation::LINE_BOTTOM    },  // export only
     145                 :            :     { XML_BELOW,            VertOrientation::CHAR_BOTTOM    },  // import only
     146                 :            :     { XML_TOKEN_INVALID, 0 }
     147                 :            : };
     148                 :            : 
     149                 :            : SvXMLEnumMapEntry const pXML_VertPosAtChar_Enum[] =
     150                 :            : {
     151                 :            :     { XML_FROM_TOP,         VertOrientation::NONE       },
     152                 :            :     { XML_TOP,              VertOrientation::TOP        },
     153                 :            :     { XML_TOP,              VertOrientation::CHAR_TOP   },  // export only
     154                 :            :     { XML_TOP,              VertOrientation::LINE_TOP   },  // export only
     155                 :            :     { XML_MIDDLE,           VertOrientation::CENTER     },
     156                 :            :     { XML_MIDDLE,           VertOrientation::CHAR_CENTER    },  // export only
     157                 :            :     { XML_MIDDLE,           VertOrientation::LINE_CENTER    },  // export only
     158                 :            :     { XML_BOTTOM,           VertOrientation::BOTTOM     },
     159                 :            :     { XML_BELOW,            VertOrientation::CHAR_BOTTOM    },  // export only
     160                 :            :     { XML_BOTTOM,           VertOrientation::LINE_BOTTOM    },  // export only
     161                 :            :     { XML_TOKEN_INVALID, 0 }
     162                 :            : };
     163                 :            : 
     164                 :            : SvXMLEnumMapEntry const pXML_VertRel_Enum[] =
     165                 :            : {
     166                 :            :     { XML_PARAGRAPH,            RelOrientation::FRAME   },
     167                 :            :     { XML_PARAGRAPH_CONTENT,    RelOrientation::PRINT_AREA  },
     168                 :            :     { XML_CHAR,                 RelOrientation::CHAR    },
     169                 :            :     // DVO, OD 17.09.2003 #i18732# - allow vertical alignment at page
     170                 :            :     { XML_PAGE,                 RelOrientation::PAGE_FRAME  },
     171                 :            :     { XML_PAGE_CONTENT,         RelOrientation::PAGE_PRINT_AREA },
     172                 :            :     { XML_FRAME,                RelOrientation::FRAME   },      // import only
     173                 :            :     { XML_FRAME_CONTENT,        RelOrientation::PRINT_AREA  },  // import only
     174                 :            :     // OD 13.11.2003 #i22341# - new vertical alignment at top of line
     175                 :            :     { XML_LINE,                 RelOrientation::TEXT_LINE },
     176                 :            :     { XML_TOKEN_INVALID, 0 }
     177                 :            : };
     178                 :            : 
     179                 :            : SvXMLEnumMapEntry const pXML_VertRelPage_Enum[] =
     180                 :            : {
     181                 :            :     { XML_PAGE,         RelOrientation::FRAME   },
     182                 :            :     { XML_PAGE_CONTENT, RelOrientation::PRINT_AREA  },
     183                 :            :     { XML_PAGE,         RelOrientation::PAGE_FRAME  },
     184                 :            :     { XML_PAGE_CONTENT, RelOrientation::PAGE_PRINT_AREA },
     185                 :            :     { XML_TOKEN_INVALID, 0 }
     186                 :            : };
     187                 :            : 
     188                 :            : SvXMLEnumMapEntry const pXML_VertRelFrame_Enum[] =
     189                 :            : {
     190                 :            :     { XML_FRAME,            RelOrientation::FRAME   },
     191                 :            :     { XML_FRAME_CONTENT,    RelOrientation::PRINT_AREA  },
     192                 :            :     { XML_TOKEN_INVALID, 0 }
     193                 :            : };
     194                 :            : 
     195                 :            : SvXMLEnumMapEntry const pXML_VertRelAsChar_Enum[] =
     196                 :            : {
     197                 :            :     { XML_BASELINE,     VertOrientation::TOP        },
     198                 :            :     { XML_BASELINE,     VertOrientation::CENTER     },  // export only
     199                 :            :     { XML_BASELINE,     VertOrientation::BOTTOM     },  // export only
     200                 :            :     { XML_TEXT,         VertOrientation::CHAR_TOP   },
     201                 :            :     { XML_TEXT,         VertOrientation::CHAR_CENTER    },  // export only
     202                 :            :     { XML_TEXT,         VertOrientation::CHAR_BOTTOM    },  // export only
     203                 :            :     { XML_LINE,         VertOrientation::LINE_TOP   },
     204                 :            :     { XML_LINE,         VertOrientation::LINE_CENTER    },  // export only
     205                 :            :     { XML_LINE,         VertOrientation::LINE_BOTTOM    },  // export only
     206                 :            :     { XML_TOKEN_INVALID, 0 }
     207                 :            : };
     208                 :            : 
     209                 :            : SvXMLEnumMapEntry const pXML_RubyAdjust_Enum[] =
     210                 :            : {
     211                 :            :     { XML_LEFT,                 RubyAdjust_LEFT },
     212                 :            :     { XML_CENTER,               RubyAdjust_CENTER },
     213                 :            :     { XML_RIGHT,                RubyAdjust_RIGHT },
     214                 :            :     { XML_DISTRIBUTE_LETTER,    RubyAdjust_BLOCK },
     215                 :            :     { XML_DISTRIBUTE_SPACE,     RubyAdjust_INDENT_BLOCK },
     216                 :            :     { XML_TOKEN_INVALID, 0 }
     217                 :            : };
     218                 :            : 
     219                 :            : SvXMLEnumMapEntry const pXML_FontRelief_Enum[] =
     220                 :            : {
     221                 :            :     { XML_NONE,             FontRelief::NONE        },
     222                 :            :     { XML_ENGRAVED,         FontRelief::ENGRAVED    },
     223                 :            :     { XML_EMBOSSED,         FontRelief::EMBOSSED    },
     224                 :            :     { XML_TOKEN_INVALID, 0 }
     225                 :            : };
     226                 :            : 
     227                 :            : SvXMLEnumMapEntry const pXML_VerticalAlign_Enum[] =
     228                 :            : {
     229                 :            :     { XML_TOP,          ParagraphVertAlign::TOP     },
     230                 :            :     { XML_MIDDLE,       ParagraphVertAlign::CENTER  },
     231                 :            :     { XML_BOTTOM,       ParagraphVertAlign::BOTTOM  },
     232                 :            :     { XML_BASELINE,     ParagraphVertAlign::BASELINE    },
     233                 :            :     { XML_AUTO,         ParagraphVertAlign::AUTOMATIC   },
     234                 :            :     { XML_TOKEN_INVALID, 0 }
     235                 :            : };
     236                 :            : 
     237                 :            : // OD 2004-05-05 #i28701#
     238                 :            : SvXMLEnumMapEntry const pXML_WrapInfluenceOnPosition_Enum[] =
     239                 :            : {
     240                 :            :     // Tokens have been renamed and <XML_ITERATIVE> has been added (#i35017#)
     241                 :            :     { XML_ONCE_SUCCESSIVE, WrapInfluenceOnPosition::ONCE_SUCCESSIVE },
     242                 :            :     { XML_ONCE_CONCURRENT, WrapInfluenceOnPosition::ONCE_CONCURRENT },
     243                 :            :     { XML_ITERATIVE,       WrapInfluenceOnPosition::ITERATIVE },
     244                 :            :     { XML_TOKEN_INVALID, 0 }
     245                 :            : };
     246                 :            : 
     247                 :            : // ---------------------------------------------------------------------------
     248                 :            : 
     249                 :       1732 : class XMLDropCapPropHdl_Impl : public XMLPropertyHandler
     250                 :            : {
     251                 :            : public:
     252                 :            :     virtual ~XMLDropCapPropHdl_Impl ();
     253                 :            : 
     254                 :            :     virtual bool equals(
     255                 :            :             const ::com::sun::star::uno::Any& r1,
     256                 :            :             const ::com::sun::star::uno::Any& r2 ) const;
     257                 :            : 
     258                 :            :     /// TabStops will be imported/exported as XML-Elements. So the Import/Export-work must be done at another place.
     259                 :            :     virtual sal_Bool importXML(
     260                 :            :             const ::rtl::OUString& rStrImpValue,
     261                 :            :             ::com::sun::star::uno::Any& rValue,
     262                 :            :             const SvXMLUnitConverter& ) const;
     263                 :            :     virtual sal_Bool exportXML(
     264                 :            :             ::rtl::OUString& rStrExpValue,
     265                 :            :             const ::com::sun::star::uno::Any& rValue,
     266                 :            :             const SvXMLUnitConverter& ) const;
     267                 :            : };
     268                 :            : 
     269                 :       1722 : XMLDropCapPropHdl_Impl::~XMLDropCapPropHdl_Impl ()
     270                 :            : {
     271         [ -  + ]:       3444 : }
     272                 :            : 
     273                 :          0 : bool XMLDropCapPropHdl_Impl::equals(
     274                 :            :         const Any& r1,
     275                 :            :         const Any& r2 ) const
     276                 :            : {
     277                 :          0 :     DropCapFormat aFormat1, aFormat2;
     278         [ #  # ]:          0 :     r1 >>= aFormat1;
     279         [ #  # ]:          0 :     r2 >>= aFormat2;
     280                 :            : 
     281                 :            :     return  (aFormat1.Lines <=1 && aFormat2.Lines <=1) ||
     282                 :            :             (aFormat1.Lines == aFormat2.Lines &&
     283                 :            :              aFormat1.Count == aFormat2.Count &&
     284 [ #  # ][ #  # ]:          0 :              aFormat1.Distance == aFormat2.Distance);
         [ #  # ][ #  # ]
                 [ #  # ]
     285                 :            : }
     286                 :            : 
     287                 :          0 : sal_Bool XMLDropCapPropHdl_Impl::importXML(
     288                 :            :         const OUString&,
     289                 :            :            Any&,
     290                 :            :         const SvXMLUnitConverter& ) const
     291                 :            : {
     292                 :            :     DBG_ASSERT( !this, "drop caps are an element import property" );
     293                 :          0 :     return sal_False;
     294                 :            : }
     295                 :            : 
     296                 :          0 : sal_Bool XMLDropCapPropHdl_Impl::exportXML(
     297                 :            :         OUString&,
     298                 :            :         const Any&,
     299                 :            :         const SvXMLUnitConverter& ) const
     300                 :            : {
     301                 :            :     DBG_ASSERT( !this, "drop caps are an element export property" );
     302                 :          0 :     return sal_False;
     303                 :            : }
     304                 :            : 
     305                 :            : // ---------------------------------------------------------------------------
     306                 :            : 
     307                 :        804 : class XMLOpaquePropHdl_Impl : public XMLPropertyHandler
     308                 :            : {
     309                 :            : public:
     310                 :            :     virtual ~XMLOpaquePropHdl_Impl ();
     311                 :            : 
     312                 :            :     virtual sal_Bool importXML(
     313                 :            :             const ::rtl::OUString& rStrImpValue,
     314                 :            :             ::com::sun::star::uno::Any& rValue,
     315                 :            :             const SvXMLUnitConverter& ) const;
     316                 :            :     virtual sal_Bool exportXML(
     317                 :            :             ::rtl::OUString& rStrExpValue,
     318                 :            :             const ::com::sun::star::uno::Any& rValue,
     319                 :            :             const SvXMLUnitConverter& ) const;
     320                 :            : };
     321                 :            : 
     322                 :          3 : sal_Bool XMLOpaquePropHdl_Impl::importXML(
     323                 :            :         const OUString& rStrImpValue,
     324                 :            :            Any& rValue,
     325                 :            :         const SvXMLUnitConverter& ) const
     326                 :            : {
     327                 :          3 :     sal_Bool bRet = sal_True;
     328                 :          3 :     sal_Bool bVal = sal_False;
     329 [ +  - ][ +  - ]:          3 :     if( IsXMLToken( rStrImpValue, XML_FOREGROUND ) )
     330                 :          3 :         bVal = sal_True;
     331 [ #  # ][ #  # ]:          0 :     else if( !IsXMLToken( rStrImpValue, XML_BACKGROUND ) )
     332                 :          0 :         bRet = sal_False;
     333                 :            : 
     334         [ +  - ]:          3 :     if( bRet )
     335         [ +  - ]:          3 :         rValue.setValue( &bVal, ::getBooleanCppuType() );
     336                 :            : 
     337                 :          3 :     return bRet;
     338                 :            : }
     339                 :            : 
     340                 :          0 : sal_Bool XMLOpaquePropHdl_Impl::exportXML(
     341                 :            :         OUString& rStrExpValue,
     342                 :            :         const Any& rValue,
     343                 :            :         const SvXMLUnitConverter& ) const
     344                 :            : {
     345         [ #  # ]:          0 :     if( *(sal_Bool *)rValue.getValue() )
     346                 :          0 :            rStrExpValue = GetXMLToken( XML_FOREGROUND );
     347                 :            :     else
     348                 :          0 :            rStrExpValue = GetXMLToken( XML_BACKGROUND );
     349                 :            : 
     350                 :          0 :     return sal_True;
     351                 :            : }
     352                 :            : 
     353                 :        804 : XMLOpaquePropHdl_Impl::~XMLOpaquePropHdl_Impl ()
     354                 :            : {
     355         [ -  + ]:       1608 : }
     356                 :            : 
     357                 :            : // ---------------------------------------------------------------------------
     358                 :            : 
     359                 :        804 : class XMLContourModePropHdl_Impl : public XMLPropertyHandler
     360                 :            : {
     361                 :            : public:
     362                 :            :     virtual ~XMLContourModePropHdl_Impl ();
     363                 :            : 
     364                 :            :     virtual sal_Bool importXML(
     365                 :            :             const ::rtl::OUString& rStrImpValue,
     366                 :            :             ::com::sun::star::uno::Any& rValue,
     367                 :            :             const SvXMLUnitConverter& ) const;
     368                 :            :     virtual sal_Bool exportXML(
     369                 :            :             ::rtl::OUString& rStrExpValue,
     370                 :            :             const ::com::sun::star::uno::Any& rValue,
     371                 :            :             const SvXMLUnitConverter& ) const;
     372                 :            : };
     373                 :            : 
     374                 :          0 : sal_Bool XMLContourModePropHdl_Impl::importXML(
     375                 :            :         const OUString& rStrImpValue,
     376                 :            :            Any& rValue,
     377                 :            :         const SvXMLUnitConverter& ) const
     378                 :            : {
     379                 :          0 :     sal_Bool bRet = sal_True;
     380                 :          0 :     sal_Bool bVal = sal_False;
     381 [ #  # ][ #  # ]:          0 :     if( IsXMLToken( rStrImpValue, XML_OUTSIDE ) )
     382                 :          0 :         bVal = sal_True;
     383 [ #  # ][ #  # ]:          0 :     else if( ! IsXMLToken( rStrImpValue, XML_FULL ) )
     384                 :          0 :         bRet = sal_False;
     385                 :            : 
     386         [ #  # ]:          0 :     if( bRet )
     387         [ #  # ]:          0 :         rValue.setValue( &bVal, ::getBooleanCppuType() );
     388                 :            : 
     389                 :          0 :     return bRet;
     390                 :            : }
     391                 :            : 
     392                 :          0 : sal_Bool XMLContourModePropHdl_Impl::exportXML(
     393                 :            :         OUString& rStrExpValue,
     394                 :            :         const Any& rValue,
     395                 :            :         const SvXMLUnitConverter& ) const
     396                 :            : {
     397         [ #  # ]:          0 :     if( *(sal_Bool *)rValue.getValue() )
     398                 :          0 :            rStrExpValue = GetXMLToken( XML_OUTSIDE );
     399                 :            :     else
     400                 :          0 :            rStrExpValue = GetXMLToken( XML_FULL );
     401                 :            : 
     402                 :          0 :     return sal_True;
     403                 :            : }
     404                 :            : 
     405                 :        804 : XMLContourModePropHdl_Impl::~XMLContourModePropHdl_Impl()
     406                 :            : {
     407         [ -  + ]:       1608 : }
     408                 :            : 
     409                 :            : // ---------------------------------------------------------------------------
     410                 :            : 
     411                 :        804 : class XMLParagraphOnlyPropHdl_Impl : public XMLPropertyHandler
     412                 :            : {
     413                 :            : public:
     414                 :            :     virtual ~XMLParagraphOnlyPropHdl_Impl ();
     415                 :            : 
     416                 :            :     virtual sal_Bool importXML(
     417                 :            :             const ::rtl::OUString& rStrImpValue,
     418                 :            :             ::com::sun::star::uno::Any& rValue,
     419                 :            :             const SvXMLUnitConverter& ) const;
     420                 :            :     virtual sal_Bool exportXML(
     421                 :            :             ::rtl::OUString& rStrExpValue,
     422                 :            :             const ::com::sun::star::uno::Any& rValue,
     423                 :            :             const SvXMLUnitConverter& ) const;
     424                 :            : };
     425                 :            : 
     426                 :         21 : sal_Bool XMLParagraphOnlyPropHdl_Impl::importXML(
     427                 :            :         const OUString& rStrImpValue,
     428                 :            :            Any& rValue,
     429                 :            :         const SvXMLUnitConverter& ) const
     430                 :            : {
     431                 :         21 :     sal_Bool bRet = sal_True;
     432                 :         21 :     sal_Bool bVal = sal_False;
     433                 :            : 
     434 [ +  - ][ -  + ]:         21 :     if( ! IsXMLToken( rStrImpValue, XML_NO_LIMIT ) )
     435                 :            :     {
     436                 :          0 :         sal_Int32 nValue = 0;
     437         [ #  # ]:          0 :         bRet = ::sax::Converter::convertNumber( nValue, rStrImpValue );
     438                 :          0 :         bVal = 1 == nValue;
     439                 :            :     }
     440                 :            : 
     441         [ +  - ]:         21 :     if( bRet )
     442         [ +  - ]:         21 :         rValue.setValue( &bVal, ::getBooleanCppuType() );
     443                 :            : 
     444                 :         21 :     return bRet;
     445                 :            : }
     446                 :            : 
     447                 :          0 : sal_Bool XMLParagraphOnlyPropHdl_Impl::exportXML(
     448                 :            :         OUString& rStrExpValue,
     449                 :            :         const Any& rValue,
     450                 :            :         const SvXMLUnitConverter& ) const
     451                 :            : {
     452         [ #  # ]:          0 :     if( *(sal_Bool *)rValue.getValue() )
     453                 :          0 :            rStrExpValue = GetXMLToken( XML_1 );
     454                 :            :     else
     455                 :          0 :            rStrExpValue = GetXMLToken( XML_NO_LIMIT );
     456                 :            : 
     457                 :          0 :     return sal_True;
     458                 :            : }
     459                 :            : 
     460                 :        804 : XMLParagraphOnlyPropHdl_Impl::~XMLParagraphOnlyPropHdl_Impl()
     461                 :            : {
     462         [ -  + ]:       1608 : }
     463                 :            : 
     464                 :            : // ---------------------------------------------------------------------------
     465                 :            : 
     466                 :            : SvXMLEnumMapEntry const pXML_Wrap_Enum[] =
     467                 :            : {
     468                 :            :     { XML_NONE,         WrapTextMode_NONE },
     469                 :            :     { XML_RUN_THROUGH,  WrapTextMode_THROUGHT },
     470                 :            :     { XML_PARALLEL,     WrapTextMode_PARALLEL },
     471                 :            :     { XML_DYNAMIC,      WrapTextMode_DYNAMIC },
     472                 :            :     { XML_LEFT,         WrapTextMode_LEFT },
     473                 :            :     { XML_RIGHT,        WrapTextMode_RIGHT },
     474                 :            :     { XML_TOKEN_INVALID, 0 }
     475                 :            : };
     476                 :            : 
     477                 :        804 : class XMLWrapPropHdl_Impl : public XMLPropertyHandler
     478                 :            : {
     479                 :            : public:
     480                 :            :     virtual ~XMLWrapPropHdl_Impl ();
     481                 :            : 
     482                 :            :     virtual sal_Bool importXML(
     483                 :            :             const ::rtl::OUString& rStrImpValue,
     484                 :            :             ::com::sun::star::uno::Any& rValue,
     485                 :            :             const SvXMLUnitConverter& ) const;
     486                 :            :     virtual sal_Bool exportXML(
     487                 :            :             ::rtl::OUString& rStrExpValue,
     488                 :            :             const ::com::sun::star::uno::Any& rValue,
     489                 :            :             const SvXMLUnitConverter& ) const;
     490                 :            : };
     491                 :            : 
     492                 :         30 : sal_Bool XMLWrapPropHdl_Impl::importXML(
     493                 :            :         const OUString& rStrImpValue,
     494                 :            :            Any& rValue,
     495                 :            :         const SvXMLUnitConverter& ) const
     496                 :            : {
     497                 :            :     sal_uInt16 nWrap;
     498                 :            :     sal_Bool bRet = SvXMLUnitConverter::convertEnum( nWrap, rStrImpValue,
     499         [ +  - ]:         30 :                                                 pXML_Wrap_Enum );
     500                 :            : 
     501         [ +  - ]:         30 :     if( bRet )
     502         [ +  - ]:         30 :         rValue <<= (WrapTextMode)nWrap;
     503                 :            : 
     504                 :         30 :     return bRet;
     505                 :            : }
     506                 :            : 
     507                 :          0 : sal_Bool XMLWrapPropHdl_Impl::exportXML(
     508                 :            :         OUString& rStrExpValue,
     509                 :            :         const Any& rValue,
     510                 :            :         const SvXMLUnitConverter& ) const
     511                 :            : {
     512                 :          0 :     OUStringBuffer aOut;
     513                 :            :     WrapTextMode eVal;
     514                 :            : 
     515         [ #  # ]:          0 :     rValue >>= eVal;
     516                 :            : 
     517         [ #  # ]:          0 :     sal_Bool bRet = SvXMLUnitConverter::convertEnum( aOut, eVal, pXML_Wrap_Enum, XML_NONE );
     518                 :            : 
     519         [ #  # ]:          0 :     rStrExpValue = aOut.makeStringAndClear();
     520                 :            : 
     521                 :          0 :     return bRet;
     522                 :            : }
     523                 :            : 
     524                 :        804 : XMLWrapPropHdl_Impl::~XMLWrapPropHdl_Impl ()
     525                 :            : {
     526         [ -  + ]:       1608 : }
     527                 :            : 
     528                 :            : // ---------------------------------------------------------------------------
     529                 :            : 
     530                 :            : class XMLFrameProtectPropHdl_Impl : public XMLPropertyHandler
     531                 :            : {
     532                 :            :     const OUString sVal;
     533                 :            : public:
     534                 :       2286 :     XMLFrameProtectPropHdl_Impl( enum XMLTokenEnum eVal ) :
     535         [ +  - ]:       2286 :            sVal( GetXMLToken(eVal) ) {}
     536                 :            :     virtual ~XMLFrameProtectPropHdl_Impl ();
     537                 :            : 
     538                 :            :     virtual sal_Bool importXML(
     539                 :            :             const ::rtl::OUString& rStrImpValue,
     540                 :            :             ::com::sun::star::uno::Any& rValue,
     541                 :            :             const SvXMLUnitConverter& ) const;
     542                 :            :     virtual sal_Bool exportXML(
     543                 :            :             ::rtl::OUString& rStrExpValue,
     544                 :            :             const ::com::sun::star::uno::Any& rValue,
     545                 :            :             const SvXMLUnitConverter& ) const;
     546                 :            : };
     547                 :            : 
     548                 :          0 : sal_Bool XMLFrameProtectPropHdl_Impl::importXML(
     549                 :            :         const OUString& rStrImpValue,
     550                 :            :            Any& rValue,
     551                 :            :         const SvXMLUnitConverter& ) const
     552                 :            : {
     553                 :          0 :     sal_Bool bRet = sal_True;
     554                 :          0 :     sal_Bool bVal = sal_False;
     555 [ #  # ][ #  # ]:          0 :     if( ! IsXMLToken( rStrImpValue, XML_NONE ) )
     556                 :            :     {
     557                 :          0 :         bRet = sal_False;
     558         [ #  # ]:          0 :         SvXMLTokenEnumerator aTokenEnum( rStrImpValue );
     559                 :          0 :         OUString aToken;
     560 [ #  # ][ #  # ]:          0 :         while( aTokenEnum.getNextToken( aToken ) )
     561                 :            :         {
     562                 :          0 :             bRet = sal_True;
     563         [ #  # ]:          0 :             if( aToken == sVal )
     564                 :            :             {
     565                 :          0 :                 bVal = sal_True;
     566                 :          0 :                 break;
     567                 :            :             }
     568                 :          0 :         }
     569                 :            :     }
     570                 :            : 
     571         [ #  # ]:          0 :     if( bRet )
     572         [ #  # ]:          0 :         rValue.setValue( &bVal, ::getBooleanCppuType() );
     573                 :            : 
     574                 :          0 :     return bRet;
     575                 :            : }
     576                 :            : 
     577                 :          0 : sal_Bool XMLFrameProtectPropHdl_Impl::exportXML(
     578                 :            :         OUString& rStrExpValue,
     579                 :            :         const Any& rValue,
     580                 :            :         const SvXMLUnitConverter& ) const
     581                 :            : {
     582         [ #  # ]:          0 :     if( *(sal_Bool *)rValue.getValue() )
     583                 :            :     {
     584   [ #  #  #  # ]:          0 :         if( rStrExpValue.isEmpty() ||
                 [ #  # ]
     585                 :          0 :             IsXMLToken( rStrExpValue, XML_NONE ) )
     586                 :            :         {
     587                 :          0 :                rStrExpValue = sVal;
     588                 :            :         }
     589                 :            :         else
     590                 :            :         {
     591                 :          0 :             OUStringBuffer aOut( rStrExpValue.getLength() + 1 +
     592                 :          0 :                                  sVal.getLength() );
     593         [ #  # ]:          0 :             aOut.append( rStrExpValue );
     594         [ #  # ]:          0 :             aOut.append( (sal_Unicode)' ' );
     595         [ #  # ]:          0 :             aOut.append( sVal );
     596         [ #  # ]:          0 :             rStrExpValue = aOut.makeStringAndClear();
     597                 :            :         }
     598                 :            :     }
     599         [ #  # ]:          0 :     else if( rStrExpValue.isEmpty() )
     600                 :            :     {
     601                 :          0 :            rStrExpValue = GetXMLToken( XML_NONE );
     602                 :            :     }
     603                 :            : 
     604                 :          0 :     return sal_True;
     605                 :            : }
     606                 :            : 
     607                 :       2286 : XMLFrameProtectPropHdl_Impl::~XMLFrameProtectPropHdl_Impl()
     608                 :            : {
     609         [ -  + ]:       4572 : }
     610                 :            : 
     611                 :            : // ---------------------------------------------------------------------------
     612                 :            : 
     613                 :            : SvXMLEnumMapEntry const pXML_Anchor_Enum[] =
     614                 :            : {
     615                 :            :     { XML_CHAR,         TextContentAnchorType_AT_CHARACTER },
     616                 :            :     { XML_PAGE,         TextContentAnchorType_AT_PAGE },
     617                 :            :     { XML_FRAME,        TextContentAnchorType_AT_FRAME },
     618                 :            :     { XML_PARAGRAPH,        TextContentAnchorType_AT_PARAGRAPH },
     619                 :            :     { XML_AS_CHAR,      TextContentAnchorType_AS_CHARACTER },
     620                 :            :     { XML_TOKEN_INVALID, 0 }
     621                 :            : };
     622                 :            : 
     623                 :            : 
     624                 :         20 : sal_Bool XMLAnchorTypePropHdl::importXML(
     625                 :            :         const OUString& rStrImpValue,
     626                 :            :            Any& rValue,
     627                 :            :         const SvXMLUnitConverter& ) const
     628                 :            : {
     629                 :            :     sal_uInt16 nAnchor;
     630                 :            :     sal_Bool bRet = SvXMLUnitConverter::convertEnum( nAnchor, rStrImpValue,
     631         [ +  - ]:         20 :                                                 pXML_Anchor_Enum );
     632                 :            : 
     633         [ +  - ]:         20 :     if( bRet )
     634         [ +  - ]:         20 :         rValue <<= (TextContentAnchorType)nAnchor;
     635                 :            : 
     636                 :         20 :     return bRet;
     637                 :            : }
     638                 :            : 
     639                 :          0 : sal_Bool XMLAnchorTypePropHdl::exportXML(
     640                 :            :         OUString& rStrExpValue,
     641                 :            :         const Any& rValue,
     642                 :            :         const SvXMLUnitConverter& ) const
     643                 :            : {
     644                 :          0 :     OUStringBuffer aOut;
     645                 :            :     TextContentAnchorType eVal;
     646                 :            : 
     647         [ #  # ]:          0 :     rValue >>= eVal;
     648                 :            : 
     649         [ #  # ]:          0 :     sal_Bool bRet = SvXMLUnitConverter::convertEnum( aOut, eVal, pXML_Anchor_Enum, XML_PARAGRAPH );
     650                 :            : 
     651         [ #  # ]:          0 :     rStrExpValue = aOut.makeStringAndClear();
     652                 :            : 
     653                 :          0 :     return bRet;
     654                 :            : }
     655                 :            : 
     656                 :        685 : XMLAnchorTypePropHdl::~XMLAnchorTypePropHdl()
     657                 :            : {
     658         [ -  + ]:       1370 : }
     659                 :            : 
     660                 :         34 : sal_Bool XMLAnchorTypePropHdl::convert( const OUString& rStrImpValue,
     661                 :            :                  TextContentAnchorType& rType )
     662                 :            : {
     663                 :            :     sal_uInt16 nAnchor;
     664                 :            :     sal_Bool bRet = SvXMLUnitConverter::convertEnum( nAnchor, rStrImpValue,
     665         [ +  - ]:         34 :                                                 pXML_Anchor_Enum );
     666         [ +  - ]:         34 :     if( bRet )
     667                 :         34 :         rType = (TextContentAnchorType)nAnchor;
     668                 :         34 :     return bRet;
     669                 :            : }
     670                 :            : 
     671                 :            : // ---------------------------------------------------------------------------
     672                 :            : 
     673                 :            : 
     674                 :       1508 : XMLTextColumnsPropertyHandler::~XMLTextColumnsPropertyHandler ()
     675                 :            : {
     676         [ -  + ]:       3016 : }
     677                 :            : 
     678                 :        148 : bool XMLTextColumnsPropertyHandler::equals(
     679                 :            :         const Any& r1,
     680                 :            :         const Any& r2 ) const
     681                 :            : {
     682                 :        148 :     Reference < XTextColumns > xColumns1;
     683         [ +  - ]:        148 :     r1 >>= xColumns1;
     684                 :            : 
     685                 :        148 :     Reference < XTextColumns > xColumns2;
     686         [ +  - ]:        148 :     r2 >>= xColumns2;
     687                 :            : 
     688 [ +  - ][ +  - ]:        204 :     if( xColumns1->getColumnCount() != xColumns2->getColumnCount() ||
         [ +  - ][ +  - ]
         [ +  + ][ -  + ]
                 [ +  + ]
     689 [ +  - ][ +  - ]:         56 :           xColumns1->getReferenceValue() != xColumns2->getReferenceValue() )
         [ +  - ][ +  - ]
     690                 :         92 :         return sal_False;
     691                 :            : 
     692 [ +  - ][ +  - ]:         56 :     Sequence < TextColumn > aColumns1 = xColumns1->getColumns();
     693 [ +  - ][ +  - ]:         56 :     Sequence < TextColumn > aColumns2 = xColumns2->getColumns();
     694                 :         56 :     sal_Int32 nCount = aColumns1.getLength();
     695         [ -  + ]:         56 :     if( aColumns2.getLength() != nCount )
     696                 :          0 :         return sal_False;
     697                 :            : 
     698         [ +  - ]:         56 :     const TextColumn *pColumns1 = aColumns1.getArray();
     699         [ +  - ]:         56 :     const TextColumn *pColumns2 = aColumns2.getArray();
     700                 :            : 
     701         [ +  + ]:         68 :     while( nCount-- )
     702                 :            :     {
     703 [ +  - ][ +  - ]:         12 :         if( pColumns1->Width != pColumns2->Width ||
                 [ -  + ]
     704                 :            :              pColumns1->LeftMargin != pColumns2->LeftMargin ||
     705                 :            :              pColumns1->RightMargin != pColumns2->RightMargin )
     706                 :          0 :             return sal_False;
     707                 :            : 
     708                 :         12 :         pColumns1++;
     709                 :         12 :         pColumns2++;
     710                 :            :     }
     711                 :            : 
     712 [ +  - ][ +  - ]:        148 :     return sal_True;
     713                 :            : }
     714                 :            : 
     715                 :          0 : sal_Bool XMLTextColumnsPropertyHandler::importXML(
     716                 :            :         const OUString&,
     717                 :            :            Any&,
     718                 :            :         const SvXMLUnitConverter& ) const
     719                 :            : {
     720                 :            :     DBG_ASSERT( !this, "columns are an element import property" );
     721                 :          0 :     return sal_False;
     722                 :            : }
     723                 :            : 
     724                 :          0 : sal_Bool XMLTextColumnsPropertyHandler::exportXML(
     725                 :            :         OUString&,
     726                 :            :         const Any&,
     727                 :            :         const SvXMLUnitConverter& ) const
     728                 :            : {
     729                 :            :     DBG_ASSERT( !this, "columns are an element export property" );
     730                 :          0 :     return sal_False;
     731                 :            : }
     732                 :            : 
     733                 :            : // ---------------------------------------------------------------------------
     734                 :            : 
     735                 :        804 : class XMLHoriMirrorPropHdl_Impl : public XMLPropertyHandler
     736                 :            : {
     737                 :            : public:
     738                 :            :     virtual ~XMLHoriMirrorPropHdl_Impl ();
     739                 :            : 
     740                 :            :     virtual sal_Bool importXML(
     741                 :            :             const ::rtl::OUString& rStrImpValue,
     742                 :            :             ::com::sun::star::uno::Any& rValue,
     743                 :            :             const SvXMLUnitConverter& ) const;
     744                 :            :     virtual sal_Bool exportXML(
     745                 :            :             ::rtl::OUString& rStrExpValue,
     746                 :            :             const ::com::sun::star::uno::Any& rValue,
     747                 :            :             const SvXMLUnitConverter& ) const;
     748                 :            : };
     749                 :            : 
     750                 :         40 : sal_Bool XMLHoriMirrorPropHdl_Impl::importXML(
     751                 :            :         const OUString& rStrImpValue,
     752                 :            :            Any& rValue,
     753                 :            :         const SvXMLUnitConverter& ) const
     754                 :            : {
     755                 :            :     sal_uInt16 nHoriMirror;
     756                 :            :     sal_Bool bRet = SvXMLUnitConverter::convertEnum( nHoriMirror, rStrImpValue,
     757         [ +  - ]:         40 :                                                 pXML_HoriMirror_Enum );
     758                 :            : 
     759         [ +  - ]:         40 :     if( bRet )
     760                 :            :     {
     761                 :         40 :         sal_Bool bTmp = nHoriMirror != 0;
     762         [ +  - ]:         40 :         rValue.setValue( &bTmp, ::getBooleanCppuType() );
     763                 :            :     }
     764                 :            : 
     765                 :         40 :     return bRet;
     766                 :            : }
     767                 :            : 
     768                 :          0 : sal_Bool XMLHoriMirrorPropHdl_Impl::exportXML(
     769                 :            :         OUString&,
     770                 :            :         const Any&,
     771                 :            :         const SvXMLUnitConverter& ) const
     772                 :            : {
     773                 :            :     DBG_ASSERT( !this, "HorMirror properyt shouldn't be exported" );
     774                 :            : 
     775                 :          0 :     return sal_False;
     776                 :            : }
     777                 :            : 
     778                 :        804 : XMLHoriMirrorPropHdl_Impl::~XMLHoriMirrorPropHdl_Impl ()
     779                 :            : {
     780         [ -  + ]:       1608 : }
     781                 :            : 
     782                 :            : // ---------------------------------------------------------------------------
     783                 :            : 
     784                 :            : class XMLGrfMirrorPropHdl_Impl : public XMLPropertyHandler
     785                 :            : {
     786                 :            :     const OUString sVal;
     787                 :            :     sal_Bool bHori;
     788                 :            : 
     789                 :            : public:
     790                 :       2286 :     XMLGrfMirrorPropHdl_Impl( enum XMLTokenEnum eVal, sal_Bool bH ) :
     791         [ +  - ]:       2286 :            sVal( GetXMLToken( eVal ) ),
     792                 :       4572 :         bHori( bH ) {}
     793                 :            :     virtual ~XMLGrfMirrorPropHdl_Impl ();
     794                 :            : 
     795                 :            :     virtual sal_Bool importXML(
     796                 :            :             const ::rtl::OUString& rStrImpValue,
     797                 :            :             ::com::sun::star::uno::Any& rValue,
     798                 :            :             const SvXMLUnitConverter& ) const;
     799                 :            :     virtual sal_Bool exportXML(
     800                 :            :             ::rtl::OUString& rStrExpValue,
     801                 :            :             const ::com::sun::star::uno::Any& rValue,
     802                 :            :             const SvXMLUnitConverter& ) const;
     803                 :            : };
     804                 :            : 
     805                 :         12 : sal_Bool XMLGrfMirrorPropHdl_Impl::importXML(
     806                 :            :         const OUString& rStrImpValue,
     807                 :            :            Any& rValue,
     808                 :            :         const SvXMLUnitConverter& ) const
     809                 :            : {
     810                 :         12 :     sal_Bool bRet = sal_True;
     811                 :         12 :     sal_Bool bVal = sal_False;
     812 [ +  - ][ -  + ]:         12 :     if( ! IsXMLToken( rStrImpValue, XML_NONE ) )
     813                 :            :     {
     814                 :          0 :         bRet = sal_False;
     815         [ #  # ]:          0 :         SvXMLTokenEnumerator aTokenEnum( rStrImpValue );
     816                 :          0 :         OUString aToken;
     817 [ #  # ][ #  # ]:          0 :         while( aTokenEnum.getNextToken( aToken ) )
     818                 :            :         {
     819                 :          0 :             bRet = sal_True;
     820 [ #  # ][ #  # ]:          0 :             if( aToken == sVal ||
         [ #  # ][ #  # ]
     821         [ #  # ]:          0 :                  (bHori && IsXMLToken( aToken, XML_HORIZONTAL ) ) )
     822                 :            :             {
     823                 :          0 :                 bVal = sal_True;
     824                 :          0 :                 break;
     825                 :            :             }
     826                 :          0 :         }
     827                 :            :     }
     828                 :            : 
     829         [ +  - ]:         12 :     if( bRet )
     830         [ +  - ]:         12 :         rValue.setValue( &bVal, ::getBooleanCppuType() );
     831                 :            : 
     832                 :         12 :     return bRet;
     833                 :            : }
     834                 :            : 
     835                 :          0 : sal_Bool XMLGrfMirrorPropHdl_Impl::exportXML(
     836                 :            :         OUString& rStrExpValue,
     837                 :            :         const Any& rValue,
     838                 :            :         const SvXMLUnitConverter& ) const
     839                 :            : {
     840         [ #  # ]:          0 :     if( *(sal_Bool *)rValue.getValue() )
     841                 :            :     {
     842   [ #  #  #  # ]:          0 :         if( rStrExpValue.isEmpty() ||
                 [ #  # ]
     843                 :          0 :             IsXMLToken( rStrExpValue, XML_NONE ) )
     844                 :            :         {
     845                 :          0 :                rStrExpValue = sVal;
     846                 :            :         }
     847   [ #  #  #  #  :          0 :         else if( bHori &&
           #  # ][ #  # ]
     848                 :            :                  /* XML_HORIZONTAL_ON_LEFT_PAGES and XML_HORIZONTAL_ON_RIGHT_PAGES
     849                 :            :                     are replaced by XML_HORIZONTAL_ON_EVEN and XML_HORIZONTAL_ON_ODD.
     850                 :            :                     (#i49139#)
     851                 :            :                  */
     852                 :          0 :                  ( IsXMLToken( rStrExpValue, XML_HORIZONTAL_ON_EVEN ) ||
     853                 :          0 :                    IsXMLToken( rStrExpValue, XML_HORIZONTAL_ON_ODD ) ))
     854                 :            :         {
     855                 :          0 :             rStrExpValue = GetXMLToken( XML_HORIZONTAL );
     856                 :            :         }
     857                 :            :         else
     858                 :            :         {
     859                 :          0 :             OUStringBuffer aOut( rStrExpValue.getLength() + 1 +
     860                 :          0 :                                  sVal.getLength() );
     861         [ #  # ]:          0 :             aOut.append( rStrExpValue );
     862         [ #  # ]:          0 :             aOut.append( (sal_Unicode)' ' );
     863         [ #  # ]:          0 :             aOut.append( sVal );
     864         [ #  # ]:          0 :             rStrExpValue = aOut.makeStringAndClear();
     865                 :            :         }
     866                 :            :     }
     867         [ #  # ]:          0 :     else if( rStrExpValue.isEmpty() )
     868                 :            :     {
     869                 :          0 :            rStrExpValue = GetXMLToken( XML_NONE );
     870                 :            :     }
     871                 :            : 
     872                 :          0 :     return sal_True;
     873                 :            : }
     874                 :            : 
     875                 :       2286 : XMLGrfMirrorPropHdl_Impl::~XMLGrfMirrorPropHdl_Impl()
     876                 :            : {
     877         [ -  + ]:       4572 : }
     878                 :            : 
     879                 :            : // ---------------------------------------------------------------------------
     880                 :            : 
     881                 :            : SvXMLEnumMapEntry const pXML_Emphasize_Enum[] =
     882                 :            : {
     883                 :            :     { XML_NONE,     FontEmphasis::NONE },
     884                 :            :     { XML_DOT,      FontEmphasis::DOT_ABOVE },
     885                 :            :     { XML_CIRCLE,   FontEmphasis::CIRCLE_ABOVE },
     886                 :            :     { XML_DISC,     FontEmphasis::DISK_ABOVE },
     887                 :            :     { XML_ACCENT,   FontEmphasis::ACCENT_ABOVE },
     888                 :            :     { XML_TOKEN_INVALID, 0 }
     889                 :            : };
     890                 :            : class XMLTextEmphasizePropHdl_Impl : public XMLPropertyHandler
     891                 :            : {
     892                 :            : public:
     893                 :       2295 :     XMLTextEmphasizePropHdl_Impl() {}
     894                 :            :     virtual ~XMLTextEmphasizePropHdl_Impl();
     895                 :            : 
     896                 :            :     virtual sal_Bool importXML(
     897                 :            :             const ::rtl::OUString& rStrImpValue,
     898                 :            :             ::com::sun::star::uno::Any& rValue,
     899                 :            :             const SvXMLUnitConverter& ) const;
     900                 :            :     virtual sal_Bool exportXML(
     901                 :            :             ::rtl::OUString& rStrExpValue,
     902                 :            :             const ::com::sun::star::uno::Any& rValue,
     903                 :            :             const SvXMLUnitConverter& ) const;
     904                 :            : };
     905                 :            : 
     906                 :         44 : sal_Bool XMLTextEmphasizePropHdl_Impl::importXML(
     907                 :            :         const OUString& rStrImpValue,
     908                 :            :            Any& rValue,
     909                 :            :         const SvXMLUnitConverter& ) const
     910                 :            : {
     911                 :         44 :     sal_Bool bRet = sal_True;
     912                 :         44 :     sal_uInt16 nVal = FontEmphasis::NONE;
     913                 :         44 :     sal_Bool bBelow = sal_False;
     914                 :         44 :     sal_Bool bHasPos = sal_False, bHasType = sal_False;
     915                 :         44 :     OUString aToken;
     916                 :            : 
     917         [ +  - ]:         44 :     SvXMLTokenEnumerator aTokenEnum( rStrImpValue );
     918 [ +  - ][ +  + ]:         88 :     while( aTokenEnum.getNextToken( aToken ) )
     919                 :            :     {
     920 [ +  - ][ +  - ]:         44 :         if( !bHasPos && IsXMLToken( aToken, XML_ABOVE ) )
         [ -  + ][ -  + ]
     921                 :            :         {
     922                 :          0 :             bBelow = sal_False;
     923                 :          0 :             bHasPos = sal_True;
     924                 :            :         }
     925 [ +  - ][ +  - ]:         44 :         else if( !bHasPos && IsXMLToken( aToken, XML_BELOW ) )
         [ -  + ][ -  + ]
     926                 :            :         {
     927                 :          0 :             bBelow = sal_True;
     928                 :          0 :             bHasPos = sal_True;
     929                 :            :         }
     930 [ +  - ][ +  - ]:         88 :         else if( !bHasType &&
                 [ +  - ]
     931                 :            :                   SvXMLUnitConverter::convertEnum( nVal, aToken,
     932         [ +  - ]:         44 :                                              pXML_Emphasize_Enum ))
     933                 :            :         {
     934                 :         44 :             bHasType = sal_True;
     935                 :            :         }
     936                 :            :         else
     937                 :            :         {
     938                 :          0 :             bRet = sal_False;
     939                 :          0 :             break;
     940                 :            :         }
     941                 :            :     }
     942                 :            : 
     943         [ +  - ]:         44 :     if( bRet )
     944                 :            :     {
     945 [ -  + ][ #  # ]:         44 :         if( FontEmphasis::NONE != nVal && bBelow )
     946                 :          0 :             nVal += 10;
     947         [ +  - ]:         44 :         rValue <<= (sal_Int16)nVal;
     948                 :            :     }
     949                 :            : 
     950                 :         44 :     return bRet;
     951                 :            : }
     952                 :            : 
     953                 :         30 : sal_Bool XMLTextEmphasizePropHdl_Impl::exportXML(
     954                 :            :         OUString& rStrExpValue,
     955                 :            :         const Any& rValue,
     956                 :            :         const SvXMLUnitConverter& ) const
     957                 :            : {
     958                 :         30 :     OUStringBuffer aOut( 15 );
     959                 :         30 :     sal_Bool bRet = sal_True;
     960                 :         30 :     sal_Int16 nType = sal_Int16();
     961         [ +  - ]:         30 :     if( rValue >>= nType )
     962                 :            :     {
     963                 :         30 :         sal_Bool bBelow = sal_False;
     964         [ -  + ]:         30 :         if( nType > 10 )
     965                 :            :         {
     966                 :          0 :             bBelow = sal_True;
     967                 :          0 :             nType -= 10;
     968                 :            :         }
     969                 :            :         bRet = SvXMLUnitConverter::convertEnum( aOut, nType,
     970                 :            :                                            pXML_Emphasize_Enum,
     971         [ +  - ]:         30 :                                            XML_DOT );
     972         [ +  - ]:         30 :         if( bRet )
     973                 :            :         {
     974         [ -  + ]:         30 :             if( nType != 0 )
     975                 :            :             {
     976         [ #  # ]:          0 :                 enum XMLTokenEnum ePos = bBelow ? XML_BELOW : XML_ABOVE;
     977         [ #  # ]:          0 :                 aOut.append( (sal_Unicode)' ' );
     978 [ #  # ][ #  # ]:          0 :                 aOut.append( GetXMLToken(ePos) );
     979                 :            :             }
     980         [ +  - ]:         30 :             rStrExpValue = aOut.makeStringAndClear();
     981                 :            :         }
     982                 :            :     }
     983                 :            : 
     984                 :         30 :     return bRet;
     985                 :            : }
     986                 :            : 
     987                 :       2285 : XMLTextEmphasizePropHdl_Impl::~XMLTextEmphasizePropHdl_Impl()
     988                 :            : {
     989         [ -  + ]:       4570 : }
     990                 :            : 
     991                 :            : 
     992                 :            : // ---------------------------------------------------------------------------
     993                 :            : 
     994                 :            : class XMLTextCombineCharPropHdl_Impl : public XMLPropertyHandler
     995                 :            : {
     996                 :            : public:
     997                 :       2295 :     XMLTextCombineCharPropHdl_Impl() {}
     998                 :            :     virtual ~XMLTextCombineCharPropHdl_Impl();
     999                 :            : 
    1000                 :            :     virtual sal_Bool importXML(
    1001                 :            :             const ::rtl::OUString& rStrImpValue,
    1002                 :            :             ::com::sun::star::uno::Any& rValue,
    1003                 :            :             const SvXMLUnitConverter& ) const;
    1004                 :            :     virtual sal_Bool exportXML(
    1005                 :            :             ::rtl::OUString& rStrExpValue,
    1006                 :            :             const ::com::sun::star::uno::Any& rValue,
    1007                 :            :             const SvXMLUnitConverter& ) const;
    1008                 :            : };
    1009                 :            : 
    1010                 :          0 : sal_Bool XMLTextCombineCharPropHdl_Impl::importXML(
    1011                 :            :         const OUString& rStrImpValue,
    1012                 :            :            Any& rValue,
    1013                 :            :         const SvXMLUnitConverter& ) const
    1014                 :            : {
    1015         [ #  # ]:          0 :     if( !rStrImpValue.isEmpty() )
    1016         [ #  # ]:          0 :         rValue <<= rStrImpValue.copy( 0, 1 );
    1017                 :            :     else
    1018                 :          0 :         rValue <<= rStrImpValue;
    1019                 :            : 
    1020                 :          0 :     return sal_True;
    1021                 :            : }
    1022                 :            : 
    1023                 :          0 : sal_Bool XMLTextCombineCharPropHdl_Impl::exportXML(
    1024                 :            :         OUString& rStrExpValue,
    1025                 :            :         const Any& rValue,
    1026                 :            :         const SvXMLUnitConverter& ) const
    1027                 :            : {
    1028                 :          0 :     rValue >>= rStrExpValue;
    1029                 :            : 
    1030                 :            :     // #i114107# attribute of type "character": export only if length is 1
    1031         [ #  # ]:          0 :     return (1 == rStrExpValue.getLength())  ? sal_True : sal_False;
    1032                 :            : }
    1033                 :            : 
    1034                 :       2285 : XMLTextCombineCharPropHdl_Impl::~XMLTextCombineCharPropHdl_Impl()
    1035                 :            : {
    1036         [ -  + ]:       4570 : }
    1037                 :            : 
    1038                 :            : // ---------------------------------------------------------------------------
    1039                 :            : 
    1040                 :            : class XMLTextRelWidthHeightPropHdl_Impl : public XMLPropertyHandler
    1041                 :            : {
    1042                 :            : public:
    1043                 :        685 :     XMLTextRelWidthHeightPropHdl_Impl() {}
    1044                 :            :     virtual ~XMLTextRelWidthHeightPropHdl_Impl();
    1045                 :            : 
    1046                 :            :     virtual sal_Bool importXML(
    1047                 :            :             const ::rtl::OUString& rStrImpValue,
    1048                 :            :             ::com::sun::star::uno::Any& rValue,
    1049                 :            :             const SvXMLUnitConverter& ) const;
    1050                 :            :     virtual sal_Bool exportXML(
    1051                 :            :             ::rtl::OUString& rStrExpValue,
    1052                 :            :             const ::com::sun::star::uno::Any& rValue,
    1053                 :            :             const SvXMLUnitConverter& ) const;
    1054                 :            : };
    1055                 :            : 
    1056                 :          6 : sal_Bool XMLTextRelWidthHeightPropHdl_Impl::importXML(
    1057                 :            :         const OUString& rStrImpValue,
    1058                 :            :            Any& rValue,
    1059                 :            :         const SvXMLUnitConverter& ) const
    1060                 :            : {
    1061                 :            :     sal_Int32 nValue;
    1062         [ +  - ]:          6 :     bool const bRet = ::sax::Converter::convertPercent( nValue, rStrImpValue );
    1063         [ -  + ]:          6 :     if( bRet )
    1064         [ #  # ]:          0 :         rValue <<= (sal_Int16)nValue;
    1065                 :            : 
    1066                 :          6 :     return bRet;
    1067                 :            : }
    1068                 :            : 
    1069                 :          0 : sal_Bool XMLTextRelWidthHeightPropHdl_Impl::exportXML(
    1070                 :            :         OUString& rStrExpValue,
    1071                 :            :         const Any& rValue,
    1072                 :            :         const SvXMLUnitConverter& ) const
    1073                 :            : {
    1074                 :          0 :     sal_Bool bRet = sal_False;
    1075                 :          0 :     sal_Int16 nValue = sal_Int16();
    1076 [ #  # ][ #  # ]:          0 :     if( (rValue >>= nValue) && nValue > 0 )
                 [ #  # ]
    1077                 :            :     {
    1078                 :          0 :         OUStringBuffer aOut;
    1079         [ #  # ]:          0 :         ::sax::Converter::convertPercent( aOut, nValue );
    1080         [ #  # ]:          0 :         rStrExpValue = aOut.makeStringAndClear();
    1081                 :            : 
    1082                 :          0 :         bRet = sal_True;
    1083                 :            :     }
    1084                 :            : 
    1085                 :          0 :     return bRet;
    1086                 :            : }
    1087                 :            : 
    1088                 :        685 : XMLTextRelWidthHeightPropHdl_Impl::~XMLTextRelWidthHeightPropHdl_Impl()
    1089                 :            : {
    1090         [ -  + ]:       1370 : }
    1091                 :            : 
    1092                 :            : // ---------------------------------------------------------------------------
    1093                 :            : 
    1094                 :            : class XMLTextSyncWidthHeightPropHdl_Impl : public XMLPropertyHandler
    1095                 :            : {
    1096                 :            :     const OUString sValue;
    1097                 :            : 
    1098                 :            : public:
    1099                 :          0 :     XMLTextSyncWidthHeightPropHdl_Impl( enum XMLTokenEnum eValue ) :
    1100         [ #  # ]:          0 :            sValue( GetXMLToken(eValue) )    {}
    1101                 :            :     virtual ~XMLTextSyncWidthHeightPropHdl_Impl();
    1102                 :            : 
    1103                 :            :     virtual sal_Bool importXML(
    1104                 :            :             const ::rtl::OUString& rStrImpValue,
    1105                 :            :             ::com::sun::star::uno::Any& rValue,
    1106                 :            :             const SvXMLUnitConverter& ) const;
    1107                 :            :     virtual sal_Bool exportXML(
    1108                 :            :             ::rtl::OUString& rStrExpValue,
    1109                 :            :             const ::com::sun::star::uno::Any& rValue,
    1110                 :            :             const SvXMLUnitConverter& ) const;
    1111                 :            : };
    1112                 :            : 
    1113                 :          0 : sal_Bool XMLTextSyncWidthHeightPropHdl_Impl::importXML(
    1114                 :            :         const OUString& rStrImpValue,
    1115                 :            :            Any& rValue,
    1116                 :            :         const SvXMLUnitConverter& ) const
    1117                 :            : {
    1118                 :          0 :     sal_Bool bValue = (rStrImpValue == sValue );
    1119         [ #  # ]:          0 :     rValue.setValue( &bValue, ::getBooleanCppuType() );
    1120                 :            : 
    1121                 :          0 :     return sal_True;
    1122                 :            : }
    1123                 :            : 
    1124                 :          0 : sal_Bool XMLTextSyncWidthHeightPropHdl_Impl::exportXML(
    1125                 :            :         OUString& rStrExpValue,
    1126                 :            :         const Any& rValue,
    1127                 :            :         const SvXMLUnitConverter& ) const
    1128                 :            : {
    1129                 :          0 :     sal_Bool bRet = sal_False;
    1130         [ #  # ]:          0 :     if( *(sal_Bool *)rValue.getValue() )
    1131                 :            :     {
    1132                 :          0 :         rStrExpValue = sValue;
    1133                 :          0 :         bRet = sal_True;
    1134                 :            :     }
    1135                 :            : 
    1136                 :          0 :     return bRet;
    1137                 :            : }
    1138                 :            : 
    1139                 :          0 : XMLTextSyncWidthHeightPropHdl_Impl::~XMLTextSyncWidthHeightPropHdl_Impl()
    1140                 :            : {
    1141         [ #  # ]:          0 : }
    1142                 :            : 
    1143                 :            : // ---------------------------------------------------------------------------
    1144                 :            : 
    1145                 :            : class XMLTextRotationAnglePropHdl_Impl : public XMLPropertyHandler
    1146                 :            : {
    1147                 :            : 
    1148                 :            : public:
    1149                 :       2295 :     XMLTextRotationAnglePropHdl_Impl()  {}
    1150                 :            :     virtual ~XMLTextRotationAnglePropHdl_Impl();
    1151                 :            : 
    1152                 :            :     virtual sal_Bool importXML(
    1153                 :            :             const ::rtl::OUString& rStrImpValue,
    1154                 :            :             ::com::sun::star::uno::Any& rValue,
    1155                 :            :             const SvXMLUnitConverter& ) const;
    1156                 :            :     virtual sal_Bool exportXML(
    1157                 :            :             ::rtl::OUString& rStrExpValue,
    1158                 :            :             const ::com::sun::star::uno::Any& rValue,
    1159                 :            :             const SvXMLUnitConverter& ) const;
    1160                 :            : };
    1161                 :            : 
    1162                 :          0 : sal_Bool XMLTextRotationAnglePropHdl_Impl::importXML(
    1163                 :            :         const OUString& rStrImpValue,
    1164                 :            :            Any& rValue,
    1165                 :            :         const SvXMLUnitConverter& ) const
    1166                 :            : {
    1167                 :            :     sal_Int32 nValue;
    1168         [ #  # ]:          0 :     bool const bRet = ::sax::Converter::convertNumber( nValue, rStrImpValue );
    1169         [ #  # ]:          0 :     if( bRet )
    1170                 :            :     {
    1171                 :          0 :         nValue = (nValue % 360 );
    1172         [ #  # ]:          0 :         if( nValue < 0 )
    1173                 :          0 :             nValue = 360 + nValue;
    1174                 :            :         sal_Int16 nAngle;
    1175 [ #  # ][ #  # ]:          0 :         if( nValue < 45 || nValue > 315 )
    1176                 :          0 :             nAngle = 0;
    1177         [ #  # ]:          0 :         else if( nValue < 180 )
    1178                 :          0 :             nAngle = 900;
    1179                 :            :         else /* if nValalue <= 315 ) */
    1180                 :          0 :             nAngle = 2700;
    1181         [ #  # ]:          0 :         rValue <<= nAngle;
    1182                 :            :     }
    1183                 :            : 
    1184                 :          0 :     return bRet;
    1185                 :            : }
    1186                 :            : 
    1187                 :          0 : sal_Bool XMLTextRotationAnglePropHdl_Impl::exportXML(
    1188                 :            :         OUString& rStrExpValue,
    1189                 :            :         const Any& rValue,
    1190                 :            :         const SvXMLUnitConverter& ) const
    1191                 :            : {
    1192                 :          0 :     sal_Int16 nAngle = sal_Int16();
    1193                 :          0 :     sal_Bool bRet = ( rValue >>= nAngle );
    1194         [ #  # ]:          0 :     if( bRet )
    1195                 :            :     {
    1196                 :          0 :         OUStringBuffer aOut;
    1197         [ #  # ]:          0 :         ::sax::Converter::convertNumber( aOut, nAngle / 10 );
    1198         [ #  # ]:          0 :         rStrExpValue = aOut.makeStringAndClear();
    1199                 :            :     }
    1200                 :            :     OSL_ENSURE( bRet, "illegal rotation angle" );
    1201                 :            : 
    1202                 :          0 :     return bRet;
    1203                 :            : }
    1204                 :            : 
    1205                 :       2285 : XMLTextRotationAnglePropHdl_Impl::~XMLTextRotationAnglePropHdl_Impl()
    1206                 :            : {
    1207         [ -  + ]:       4570 : }
    1208                 :            : // ---------------------------------------------------------------------------
    1209                 :            : class XMLNumber8OneBasedHdl : public XMLPropertyHandler
    1210                 :            : {
    1211                 :            : 
    1212                 :            : public:
    1213                 :       1732 :     XMLNumber8OneBasedHdl() {}
    1214         [ -  + ]:       3444 :     virtual ~XMLNumber8OneBasedHdl() {};
    1215                 :            : 
    1216                 :            :     virtual sal_Bool importXML(
    1217                 :            :             const ::rtl::OUString& rStrImpValue,
    1218                 :            :             ::com::sun::star::uno::Any& rValue,
    1219                 :            :             const SvXMLUnitConverter& ) const;
    1220                 :            :     virtual sal_Bool exportXML(
    1221                 :            :             ::rtl::OUString& rStrExpValue,
    1222                 :            :             const ::com::sun::star::uno::Any& rValue,
    1223                 :            :             const SvXMLUnitConverter& ) const;
    1224                 :            : };
    1225                 :            : 
    1226                 :          0 : sal_Bool XMLNumber8OneBasedHdl::importXML(
    1227                 :            :         const OUString& rStrImpValue,
    1228                 :            :            Any& rValue,
    1229                 :            :         const SvXMLUnitConverter& ) const
    1230                 :            : {
    1231                 :          0 :     sal_Int32 nValue = 0;
    1232         [ #  # ]:          0 :     bool const bRet = ::sax::Converter::convertNumber(nValue, rStrImpValue);
    1233         [ #  # ]:          0 :     if( bRet )
    1234         [ #  # ]:          0 :         rValue <<= static_cast<sal_Int8>( nValue - 1 );
    1235                 :          0 :     return bRet;
    1236                 :            : }
    1237                 :            : 
    1238                 :          0 : sal_Bool XMLNumber8OneBasedHdl::exportXML(
    1239                 :            :         OUString& rStrExpValue,
    1240                 :            :         const Any& rValue,
    1241                 :            :         const SvXMLUnitConverter& ) const
    1242                 :            : {
    1243                 :          0 :     sal_Int8 nValue = sal_Int8();
    1244                 :          0 :     sal_Bool bRet = ( rValue >>= nValue );
    1245         [ #  # ]:          0 :     if( bRet )
    1246                 :            :     {
    1247                 :          0 :         OUStringBuffer aOut;
    1248         [ #  # ]:          0 :         ::sax::Converter::convertNumber( aOut, nValue + 1 );
    1249         [ #  # ]:          0 :         rStrExpValue = aOut.makeStringAndClear();
    1250                 :            :     }
    1251                 :          0 :     return bRet;
    1252                 :            : }
    1253                 :            : // ---------------------------------------------------------------------------
    1254                 :            : class XMLTextPropertyHandlerFactory_Impl
    1255                 :            : {
    1256                 :            : public:
    1257                 :            :     const XMLPropertyHandler *GetPropertyHandler( sal_Int32 nType ) const;
    1258                 :            : 
    1259                 :            :     XMLTextPropertyHandlerFactory_Impl();
    1260                 :            :     ~XMLTextPropertyHandlerFactory_Impl();
    1261                 :            : };
    1262                 :            : 
    1263                 :      53925 : const XMLPropertyHandler *XMLTextPropertyHandlerFactory_Impl::GetPropertyHandler
    1264                 :            :     ( sal_Int32 nType ) const
    1265                 :            : {
    1266                 :      53925 :     const XMLPropertyHandler* pHdl = 0;
    1267   [ +  +  +  +  :      53925 :     switch( nType )
          +  +  +  +  +  
          +  +  +  +  +  
          +  +  +  +  +  
          +  +  +  +  +  
          +  +  +  +  +  
          +  +  +  +  +  
          -  -  +  +  +  
          +  +  +  +  +  
             +  +  +  +  
                      - ]
    1268                 :            :     {
    1269                 :            :     case XML_TYPE_TEXT_DROPCAP:
    1270         [ +  - ]:       1732 :         pHdl = new XMLDropCapPropHdl_Impl;
    1271                 :       1732 :         break;
    1272                 :            :     case XML_TYPE_TEXT_WRAP:
    1273         [ +  - ]:        804 :         pHdl = new XMLWrapPropHdl_Impl;
    1274                 :        804 :         break;
    1275                 :            :     case XML_TYPE_TEXT_PARAGRAPH_ONLY:
    1276         [ +  - ]:        804 :         pHdl = new XMLParagraphOnlyPropHdl_Impl;
    1277                 :        804 :         break;
    1278                 :            :     case XML_TYPE_TEXT_WRAP_OUTSIDE:
    1279         [ +  - ]:        804 :         pHdl = new XMLContourModePropHdl_Impl;
    1280                 :        804 :         break;
    1281                 :            :     case XML_TYPE_TEXT_OPAQUE:
    1282         [ +  - ]:        804 :         pHdl = new XMLOpaquePropHdl_Impl;
    1283                 :        804 :         break;
    1284                 :            :     case XML_TYPE_TEXT_PROTECT_CONTENT:
    1285         [ +  - ]:        762 :         pHdl = new XMLFrameProtectPropHdl_Impl( XML_CONTENT );
    1286                 :        762 :         break;
    1287                 :            :     case XML_TYPE_TEXT_PROTECT_SIZE:
    1288         [ +  - ]:        762 :         pHdl = new XMLFrameProtectPropHdl_Impl( XML_SIZE );
    1289                 :        762 :         break;
    1290                 :            :     case XML_TYPE_TEXT_PROTECT_POSITION:
    1291         [ +  - ]:        762 :         pHdl = new XMLFrameProtectPropHdl_Impl( XML_POSITION );
    1292                 :        762 :         break;
    1293                 :            :     case XML_TYPE_TEXT_ANCHOR_TYPE:
    1294         [ +  - ]:        685 :         pHdl = new XMLAnchorTypePropHdl;
    1295                 :        685 :         break;
    1296                 :            :     case XML_TYPE_TEXT_COLUMNS:
    1297         [ +  - ]:       1321 :         pHdl = new XMLTextColumnsPropertyHandler;
    1298                 :       1321 :         break;
    1299                 :            :     case XML_TYPE_TEXT_HORIZONTAL_POS:
    1300         [ +  - ]:        804 :         pHdl = new XMLConstantsPropertyHandler( pXML_HoriPos_Enum, XML_TOKEN_INVALID );
    1301                 :        804 :         break;
    1302                 :            :     case XML_TYPE_TEXT_HORIZONTAL_POS_MIRRORED:
    1303         [ +  - ]:        804 :         pHdl = new XMLConstantsPropertyHandler( pXML_HoriPosMirrored_Enum, XML_TOKEN_INVALID );
    1304                 :        804 :         break;
    1305                 :            :     case XML_TYPE_TEXT_HORIZONTAL_REL:
    1306         [ +  - ]:        804 :         pHdl = new XMLConstantsPropertyHandler( pXML_HoriRel_Enum, XML_TOKEN_INVALID );
    1307                 :        804 :         break;
    1308                 :            :     case XML_TYPE_TEXT_HORIZONTAL_REL_FRAME:
    1309         [ +  - ]:        804 :         pHdl = new XMLConstantsPropertyHandler( pXML_HoriRelFrame_Enum, XML_TOKEN_INVALID );
    1310                 :        804 :         break;
    1311                 :            :     case XML_TYPE_TEXT_HORIZONTAL_MIRROR:
    1312         [ +  - ]:        804 :         pHdl = new XMLHoriMirrorPropHdl_Impl;
    1313                 :        804 :         break;
    1314                 :            :     case XML_TYPE_TEXT_VERTICAL_POS:
    1315         [ +  - ]:        804 :         pHdl = new XMLConstantsPropertyHandler( pXML_VertPos_Enum, XML_TOKEN_INVALID );
    1316                 :        804 :         break;
    1317                 :            :     case XML_TYPE_TEXT_VERTICAL_POS_AT_CHAR:
    1318         [ +  - ]:        804 :         pHdl = new XMLConstantsPropertyHandler( pXML_VertPosAtChar_Enum, XML_TOKEN_INVALID );
    1319                 :        804 :         break;
    1320                 :            :     case XML_TYPE_TEXT_VERTICAL_REL:
    1321         [ +  - ]:        804 :         pHdl = new XMLConstantsPropertyHandler( pXML_VertRel_Enum, XML_TOKEN_INVALID );
    1322                 :        804 :         break;
    1323                 :            :     case XML_TYPE_TEXT_VERTICAL_REL_PAGE:
    1324         [ +  - ]:        804 :         pHdl = new XMLConstantsPropertyHandler( pXML_VertRelPage_Enum, XML_TOKEN_INVALID );
    1325                 :        804 :         break;
    1326                 :            :     case XML_TYPE_TEXT_VERTICAL_REL_FRAME:
    1327         [ +  - ]:        804 :         pHdl = new XMLConstantsPropertyHandler( pXML_VertRelFrame_Enum, XML_TOKEN_INVALID );
    1328                 :        804 :         break;
    1329                 :            :     case XML_TYPE_TEXT_VERTICAL_REL_AS_CHAR:
    1330         [ +  - ]:        804 :         pHdl = new XMLConstantsPropertyHandler( pXML_VertRelAsChar_Enum, XML_TOKEN_INVALID );
    1331                 :        804 :         break;
    1332                 :            :     case XML_TYPE_TEXT_MIRROR_VERTICAL:
    1333         [ +  - ]:        762 :         pHdl = new XMLGrfMirrorPropHdl_Impl( XML_VERTICAL, sal_False );
    1334                 :        762 :         break;
    1335                 :            :     case XML_TYPE_TEXT_MIRROR_HORIZONTAL_LEFT:
    1336                 :            :         // XML_HORIZONTAL_ON_LEFT_PAGES is replaced by XML_HORIZONTAL_ON_EVEN. (#i49139#)
    1337         [ +  - ]:        762 :         pHdl = new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_EVEN, sal_True );
    1338                 :        762 :         break;
    1339                 :            :     case XML_TYPE_TEXT_MIRROR_HORIZONTAL_RIGHT:
    1340                 :            :         // XML_HORIZONTAL_ON_RIGHT_PAGES is replaced by XML_HORIZONTAL_ON_ODD. (#i49139#)
    1341         [ +  - ]:        762 :         pHdl = new XMLGrfMirrorPropHdl_Impl( XML_HORIZONTAL_ON_ODD, sal_True );
    1342                 :        762 :         break;
    1343                 :            :     case XML_TYPE_TEXT_CLIP:
    1344         [ +  - ]:        762 :         pHdl = new XMLClipPropertyHandler( sal_False );
    1345                 :        762 :         break;
    1346                 :            :     case XML_TYPE_TEXT_CLIP11:
    1347         [ +  - ]:        762 :         pHdl = new XMLClipPropertyHandler( sal_True );
    1348                 :        762 :         break;
    1349                 :            :     case XML_TYPE_TEXT_EMPHASIZE:
    1350         [ +  - ]:       2295 :         pHdl = new XMLTextEmphasizePropHdl_Impl;
    1351                 :       2295 :         break;
    1352                 :            :     case XML_TYPE_TEXT_COMBINE:
    1353                 :            :         pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_LINES ),
    1354         [ +  - ]:       2295 :                                             GetXMLToken( XML_NONE ) );
    1355                 :       2295 :         break;
    1356                 :            :     case XML_TYPE_TEXT_COMBINE_CHARACTERS:
    1357                 :            :         pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_LETTERS ),
    1358         [ +  - ]:        563 :                                             GetXMLToken( XML_NONE ) );
    1359                 :        563 :         break;
    1360                 :            :     case XML_TYPE_TEXT_COMBINECHAR:
    1361         [ +  - ]:       2295 :         pHdl = new XMLTextCombineCharPropHdl_Impl;
    1362                 :       2295 :         break;
    1363                 :            :     case XML_TYPE_TEXT_AUTOSPACE:
    1364                 :            :         pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_IDEOGRAPH_ALPHA ),
    1365         [ +  - ]:       2295 :                                             GetXMLToken( XML_NONE ) );
    1366                 :       2295 :         break;
    1367                 :            :     case XML_TYPE_TEXT_PUNCTUATION_WRAP:
    1368                 :            :         pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_HANGING ),
    1369         [ +  - ]:       2295 :                                             GetXMLToken( XML_SIMPLE ) );
    1370                 :       2295 :         break;
    1371                 :            :     case XML_TYPE_TEXT_LINE_BREAK:
    1372                 :            :         pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_STRICT ),
    1373         [ +  - ]:       2295 :                                             GetXMLToken( XML_NORMAL ) );
    1374                 :       2295 :         break;
    1375                 :            :     case XML_TYPE_TEXT_REL_WIDTH_HEIGHT:
    1376         [ +  - ]:        685 :         pHdl = new XMLTextRelWidthHeightPropHdl_Impl;
    1377                 :        685 :         break;
    1378                 :            :     case XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT:
    1379         [ #  # ]:          0 :         pHdl = new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE );
    1380                 :          0 :         break;
    1381                 :            :     case XML_TYPE_TEXT_SYNC_WIDTH_HEIGHT_MIN:
    1382         [ #  # ]:          0 :         pHdl = new XMLTextSyncWidthHeightPropHdl_Impl( XML_SCALE_MIN );
    1383                 :          0 :         break;
    1384                 :            :     case XML_TYPE_TEXT_RUBY_ADJUST:
    1385         [ +  - ]:        559 :         pHdl = new XMLConstantsPropertyHandler( pXML_RubyAdjust_Enum, XML_TOKEN_INVALID );
    1386                 :        559 :         break;
    1387                 :            :     case XML_TYPE_TEXT_FONT_RELIEF:
    1388         [ +  - ]:       2295 :         pHdl = new XMLConstantsPropertyHandler( pXML_FontRelief_Enum, XML_TOKEN_INVALID );
    1389                 :       2295 :         break;
    1390                 :            :     case XML_TYPE_TEXT_ROTATION_ANGLE:
    1391         [ +  - ]:       2295 :         pHdl = new XMLTextRotationAnglePropHdl_Impl;
    1392                 :       2295 :         break;
    1393                 :            :     case XML_TYPE_TEXT_ROTATION_SCALE:
    1394                 :            :         pHdl = new XMLNamedBoolPropertyHdl( GetXMLToken( XML_FIXED ),
    1395         [ +  - ]:       2295 :                                             GetXMLToken( XML_LINE_HEIGHT ) );
    1396                 :       2295 :         break;
    1397                 :            :     case XML_TYPE_TEXT_VERTICAL_ALIGN:
    1398         [ +  - ]:       1732 :         pHdl = new XMLConstantsPropertyHandler( pXML_VerticalAlign_Enum, XML_TOKEN_INVALID );
    1399                 :       1732 :         break;
    1400                 :            :     case XML_TYPE_TEXT_RUBY_POSITION:
    1401                 :            :         pHdl = new XMLNamedBoolPropertyHdl( ::xmloff::token::XML_ABOVE,
    1402         [ +  - ]:        559 :                                             ::xmloff::token::XML_BELOW );
    1403                 :        559 :         break;
    1404                 :            :     // OD 2004-05-05 #i28701#
    1405                 :            :     case XML_TYPE_WRAP_INFLUENCE_ON_POSITION:
    1406                 :            :         pHdl = new XMLConstantsPropertyHandler( pXML_WrapInfluenceOnPosition_Enum,
    1407         [ +  - ]:       1225 :                                                 XML_TOKEN_INVALID );
    1408                 :       1225 :         break;
    1409                 :            :     case XML_TYPE_BORDER_MODEL:
    1410                 :            :         pHdl = new XMLNamedBoolPropertyHdl( xmloff::token::XML_COLLAPSING,
    1411         [ +  - ]:        147 :                                             xmloff::token::XML_SEPARATING );
    1412                 :        147 :         break;
    1413                 :            :     case XML_TYPE_TEXT_LINE_MODE:
    1414                 :            :         pHdl = new XMLNamedBoolPropertyHdl(
    1415                 :            :                                     ::xmloff::token::XML_SKIP_WHITE_SPACE,
    1416         [ +  - ]:       2295 :                                     ::xmloff::token::XML_CONTINUOUS);
    1417                 :       2295 :         break;
    1418                 :            :     case XML_TYPE_TEXT_KEEP:
    1419                 :            :         pHdl = new XMLNamedBoolPropertyHdl(
    1420                 :            :                                     ::xmloff::token::XML_ALWAYS,
    1421         [ +  - ]:       1732 :                                     ::xmloff::token::XML_AUTO);
    1422                 :       1732 :         break;
    1423                 :            :     case XML_TYPE_TEXT_NKEEP:
    1424                 :            :         pHdl = new XMLNamedBoolPropertyHdl(
    1425                 :            :                                     ::xmloff::token::XML_AUTO,
    1426         [ +  - ]:        147 :                                     ::xmloff::token::XML_ALWAYS);
    1427                 :        147 :         break;
    1428                 :            :     case XML_TYPE_TEXT_NUMBER8_ONE_BASED:
    1429         [ +  - ]:       1732 :         pHdl = new XMLNumber8OneBasedHdl();
    1430                 :       1732 :         break;
    1431                 :            :     }
    1432                 :            : 
    1433                 :      53925 :     return pHdl;
    1434                 :            : }
    1435                 :            : 
    1436                 :       4932 : XMLTextPropertyHandlerFactory_Impl::XMLTextPropertyHandlerFactory_Impl()
    1437                 :            : {
    1438                 :       4932 : }
    1439                 :            : 
    1440                 :       4922 : XMLTextPropertyHandlerFactory_Impl::~XMLTextPropertyHandlerFactory_Impl()
    1441                 :            : {
    1442                 :       4922 : }
    1443                 :            : 
    1444                 :            : // ----------------------------------------------------------------------------
    1445                 :            : 
    1446                 :       4932 : XMLTextPropertyHandlerFactory::XMLTextPropertyHandlerFactory() :
    1447                 :            :     XMLPropertyHandlerFactory(),
    1448         [ +  - ]:       4932 :    pImpl( new XMLTextPropertyHandlerFactory_Impl )
    1449                 :            : {
    1450                 :       4932 : }
    1451                 :            : 
    1452                 :       4922 : XMLTextPropertyHandlerFactory::~XMLTextPropertyHandlerFactory()
    1453                 :            : {
    1454         [ +  - ]:       4922 :     delete pImpl;
    1455         [ -  + ]:       9844 : }
    1456                 :            : 
    1457                 :     401715 : const XMLPropertyHandler *XMLTextPropertyHandlerFactory::GetPropertyHandler(
    1458                 :            :         sal_Int32 nType ) const
    1459                 :            : {
    1460                 :            :     const XMLPropertyHandler *pHdl =
    1461                 :     401715 :         XMLPropertyHandlerFactory::GetPropertyHandler( nType );
    1462                 :            : 
    1463         [ +  + ]:     401715 :     if( !pHdl )
    1464                 :            :     {
    1465                 :      53925 :         const XMLPropertyHandler *pNewHdl = pImpl->GetPropertyHandler( nType );
    1466                 :            : 
    1467         [ +  - ]:      53925 :         if( pNewHdl )
    1468                 :      53925 :             PutHdlCache( nType, pNewHdl );
    1469                 :            : 
    1470                 :      53925 :         pHdl = pNewHdl;
    1471                 :            :     }
    1472                 :            : 
    1473                 :     401715 :     return pHdl;
    1474                 :            : }
    1475                 :            : 
    1476                 :            : 
    1477                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10