LCOV - code coverage report
Current view: top level - xmloff/source/style - XMLBackgroundImageContext.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 32 140 22.9 %
Date: 2012-08-25 Functions: 6 14 42.9 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 14 177 7.9 %

           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                 :            : 
      30                 :            : #include <com/sun/star/io/XOutputStream.hpp>
      31                 :            : 
      32                 :            : #include <tools/debug.hxx>
      33                 :            : 
      34                 :            : #include <sax/tools/converter.hxx>
      35                 :            : 
      36                 :            : #include <xmloff/xmltkmap.hxx>
      37                 :            : #include <xmloff/xmluconv.hxx>
      38                 :            : #include "xmloff/xmlnmspe.hxx"
      39                 :            : #include <xmloff/xmltoken.hxx>
      40                 :            : #include <xmloff/xmlimp.hxx>
      41                 :            : #include <xmloff/nmspmap.hxx>
      42                 :            : #include <xmloff/XMLBase64ImportContext.hxx>
      43                 :            : #include "XMLBackgroundImageContext.hxx"
      44                 :            : 
      45                 :            : using ::rtl::OUString;
      46                 :            : using ::rtl::OUStringBuffer;
      47                 :            : 
      48                 :            : using namespace ::com::sun::star;
      49                 :            : using namespace ::com::sun::star::uno;
      50                 :            : using namespace ::com::sun::star::style;
      51                 :            : using namespace ::com::sun::star::io;
      52                 :            : using namespace ::xmloff::token;
      53                 :            : 
      54                 :            : enum SvXMLTokenMapAttrs
      55                 :            : {
      56                 :            :     XML_TOK_BGIMG_HREF,
      57                 :            :     XML_TOK_BGIMG_TYPE,
      58                 :            :     XML_TOK_BGIMG_ACTUATE,
      59                 :            :     XML_TOK_BGIMG_SHOW,
      60                 :            :     XML_TOK_BGIMG_POSITION,
      61                 :            :     XML_TOK_BGIMG_REPEAT,
      62                 :            :     XML_TOK_BGIMG_FILTER,
      63                 :            :     XML_TOK_BGIMG_OPACITY,
      64                 :            :     XML_TOK_NGIMG_END=XML_TOK_UNKNOWN
      65                 :            : };
      66                 :        202 : const SvXMLTokenMapEntry* lcl_getBGImgAttributesAttrTokenMap()
      67                 :            : {
      68                 :            :     static SvXMLTokenMapEntry aBGImgAttributesAttrTokenMap[] =
      69                 :            :     {
      70                 :            :         { XML_NAMESPACE_XLINK, XML_HREF,        XML_TOK_BGIMG_HREF      },
      71                 :            :         { XML_NAMESPACE_XLINK, XML_TYPE,        XML_TOK_BGIMG_TYPE      },
      72                 :            :         { XML_NAMESPACE_XLINK, XML_ACTUATE,     XML_TOK_BGIMG_ACTUATE   },
      73                 :            :         { XML_NAMESPACE_XLINK, XML_SHOW,        XML_TOK_BGIMG_SHOW      },
      74                 :            :         { XML_NAMESPACE_STYLE, XML_POSITION,    XML_TOK_BGIMG_POSITION  },
      75                 :            :         { XML_NAMESPACE_STYLE, XML_REPEAT,      XML_TOK_BGIMG_REPEAT    },
      76                 :            :         { XML_NAMESPACE_STYLE, XML_FILTER_NAME, XML_TOK_BGIMG_FILTER    },
      77                 :            :         { XML_NAMESPACE_DRAW,  XML_OPACITY,     XML_TOK_BGIMG_OPACITY   },
      78                 :            :         XML_TOKEN_MAP_END
      79                 :            :     };
      80                 :        202 :     return aBGImgAttributesAttrTokenMap;
      81                 :            : }
      82                 :            : 
      83                 :            : 
      84                 :            : 
      85                 :            : SvXMLEnumMapEntry psXML_BrushHoriPos[] =
      86                 :            : {
      87                 :            :     { XML_LEFT,         GraphicLocation_LEFT_MIDDLE },
      88                 :            :     { XML_RIGHT,        GraphicLocation_RIGHT_MIDDLE    },
      89                 :            :     { XML_TOKEN_INVALID,                    0           }
      90                 :            : };
      91                 :            : 
      92                 :            : SvXMLEnumMapEntry psXML_BrushVertPos[] =
      93                 :            : {
      94                 :            :     { XML_TOP,          GraphicLocation_MIDDLE_TOP  },
      95                 :            :     { XML_BOTTOM,       GraphicLocation_MIDDLE_BOTTOM   },
      96                 :            :     { XML_TOKEN_INVALID,                    0           }
      97                 :            : };
      98                 :            : 
      99                 :          0 : void lcl_xmlbic_MergeHoriPos( GraphicLocation& ePos,
     100                 :            :                                    GraphicLocation eHori )
     101                 :            : {
     102                 :            :     DBG_ASSERT( GraphicLocation_LEFT_MIDDLE==eHori ||
     103                 :            :                 GraphicLocation_MIDDLE_MIDDLE==eHori ||
     104                 :            :                 GraphicLocation_RIGHT_MIDDLE==eHori,
     105                 :            :                 "lcl_xmlbic_MergeHoriPos: vertical pos must be middle" );
     106                 :            : 
     107   [ #  #  #  # ]:          0 :     switch( ePos )
     108                 :            :     {
     109                 :            :     case GraphicLocation_LEFT_TOP:
     110                 :            :     case GraphicLocation_MIDDLE_TOP:
     111                 :            :     case GraphicLocation_RIGHT_TOP:
     112                 :            :         ePos = GraphicLocation_LEFT_MIDDLE==eHori
     113                 :            :                 ? GraphicLocation_LEFT_TOP
     114                 :            :                 : (GraphicLocation_MIDDLE_MIDDLE==eHori
     115                 :            :                         ? GraphicLocation_MIDDLE_TOP
     116 [ #  # ][ #  # ]:          0 :                         : GraphicLocation_RIGHT_TOP);
     117                 :          0 :         break;
     118                 :            : 
     119                 :            :     case GraphicLocation_LEFT_MIDDLE:
     120                 :            :     case GraphicLocation_MIDDLE_MIDDLE:
     121                 :            :     case GraphicLocation_RIGHT_MIDDLE:
     122                 :          0 :         ePos = eHori;
     123                 :          0 :         break;
     124                 :            : 
     125                 :            :     case GraphicLocation_LEFT_BOTTOM:
     126                 :            :     case GraphicLocation_MIDDLE_BOTTOM:
     127                 :            :     case GraphicLocation_RIGHT_BOTTOM:
     128                 :            :         ePos = GraphicLocation_LEFT_MIDDLE==eHori
     129                 :            :                 ? GraphicLocation_LEFT_BOTTOM
     130                 :            :                 : (GraphicLocation_MIDDLE_MIDDLE==eHori
     131                 :            :                         ? GraphicLocation_MIDDLE_BOTTOM
     132 [ #  # ][ #  # ]:          0 :                         : GraphicLocation_RIGHT_BOTTOM);
     133                 :          0 :         break;
     134                 :            :     default:
     135                 :          0 :         break;
     136                 :            :     }
     137                 :          0 : }
     138                 :            : 
     139                 :          0 : void lcl_xmlbic_MergeVertPos( GraphicLocation& ePos,
     140                 :            :                                                    GraphicLocation eVert )
     141                 :            : {
     142                 :            :     DBG_ASSERT( GraphicLocation_MIDDLE_TOP==eVert ||
     143                 :            :                 GraphicLocation_MIDDLE_MIDDLE==eVert ||
     144                 :            :                 GraphicLocation_MIDDLE_BOTTOM==eVert,
     145                 :            :                 "lcl_xmlbic_MergeVertPos: horizontal pos must be middle" );
     146                 :            : 
     147   [ #  #  #  # ]:          0 :     switch( ePos )
     148                 :            :     {
     149                 :            :     case GraphicLocation_LEFT_TOP:
     150                 :            :     case GraphicLocation_LEFT_MIDDLE:
     151                 :            :     case GraphicLocation_LEFT_BOTTOM:
     152                 :            :         ePos = GraphicLocation_MIDDLE_TOP==eVert
     153                 :            :                 ? GraphicLocation_LEFT_TOP
     154                 :            :                 : (GraphicLocation_MIDDLE_MIDDLE==eVert
     155                 :            :                         ? GraphicLocation_LEFT_MIDDLE
     156 [ #  # ][ #  # ]:          0 :                         : GraphicLocation_LEFT_BOTTOM);
     157                 :          0 :         ePos = eVert;
     158                 :          0 :         break;
     159                 :            : 
     160                 :            :     case GraphicLocation_MIDDLE_TOP:
     161                 :            :     case GraphicLocation_MIDDLE_MIDDLE:
     162                 :            :     case GraphicLocation_MIDDLE_BOTTOM:
     163                 :          0 :         ePos = eVert;
     164                 :          0 :         break;
     165                 :            : 
     166                 :            :     case GraphicLocation_RIGHT_TOP:
     167                 :            :     case GraphicLocation_RIGHT_MIDDLE:
     168                 :            :     case GraphicLocation_RIGHT_BOTTOM:
     169                 :            :         ePos = GraphicLocation_MIDDLE_TOP==eVert
     170                 :            :                 ? GraphicLocation_RIGHT_TOP
     171                 :            :                 : (GraphicLocation_MIDDLE_MIDDLE==eVert
     172                 :            :                         ? GraphicLocation_RIGHT_MIDDLE
     173 [ #  # ][ #  # ]:          0 :                         : GraphicLocation_RIGHT_BOTTOM);
     174                 :          0 :         break;
     175                 :            :     default:
     176                 :          0 :         break;
     177                 :            :     }
     178                 :          0 : }
     179                 :            : 
     180 [ #  # ][ #  # ]:          0 : TYPEINIT1( XMLBackgroundImageContext, XMLElementPropertyContext );
     181                 :            : 
     182                 :        202 : void XMLBackgroundImageContext::ProcessAttrs(
     183                 :            :         const Reference< xml::sax::XAttributeList >& xAttrList )
     184                 :            : {
     185         [ +  - ]:        202 :     SvXMLTokenMap aTokenMap( lcl_getBGImgAttributesAttrTokenMap() );
     186                 :            : 
     187                 :        202 :     ePos = GraphicLocation_NONE;
     188                 :            : 
     189 [ +  - ][ +  - ]:        202 :     sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0;
                 [ +  - ]
     190         [ -  + ]:        202 :     for( sal_Int16 i=0; i < nAttrCount; i++ )
     191                 :            :     {
     192 [ #  # ][ #  # ]:          0 :         const OUString& rAttrName = xAttrList->getNameByIndex( i );
     193                 :          0 :         OUString aLocalName;
     194                 :            :         sal_uInt16 nPrefix =
     195                 :          0 :             GetImport().GetNamespaceMap().GetKeyByAttrName( rAttrName,
     196         [ #  # ]:          0 :                                                             &aLocalName );
     197 [ #  # ][ #  # ]:          0 :         const OUString& rValue = xAttrList->getValueByIndex( i );
     198                 :            : 
     199 [ #  # ][ #  #  :          0 :         switch( aTokenMap.Get( nPrefix, aLocalName ) )
             #  #  #  #  
                      # ]
     200                 :            :         {
     201                 :            :         case XML_TOK_BGIMG_HREF:
     202                 :          0 :             sURL = rValue;
     203         [ #  # ]:          0 :             if( GraphicLocation_NONE == ePos )
     204                 :          0 :                 ePos = GraphicLocation_TILED;
     205                 :          0 :             break;
     206                 :            :         case XML_TOK_BGIMG_TYPE:
     207                 :            :         case XML_TOK_BGIMG_ACTUATE:
     208                 :            :         case XML_TOK_BGIMG_SHOW:
     209                 :          0 :             break;
     210                 :            :         case XML_TOK_BGIMG_POSITION:
     211                 :            :             {
     212                 :          0 :                 GraphicLocation eNewPos = GraphicLocation_NONE, eTmp;
     213                 :            :                 sal_uInt16 nTmp;
     214         [ #  # ]:          0 :                 SvXMLTokenEnumerator aTokenEnum( rValue );
     215                 :          0 :                 OUString aToken;
     216                 :          0 :                 sal_Bool bHori = sal_False, bVert = sal_False;
     217                 :          0 :                 sal_Bool bOK = sal_True;
     218 [ #  # ][ #  # ]:          0 :                 while( bOK && aTokenEnum.getNextToken( aToken ) )
         [ #  # ][ #  # ]
     219                 :            :                 {
     220 [ #  # ][ #  # ]:          0 :                     if( bHori && bVert )
     221                 :            :                     {
     222                 :          0 :                         bOK = sal_False;
     223                 :            :                     }
     224         [ #  # ]:          0 :                     else if( -1 != aToken.indexOf( sal_Unicode('%') ) )
     225                 :            :                     {
     226                 :          0 :                         sal_Int32 nPrc = 50;
     227 [ #  # ][ #  # ]:          0 :                         if (::sax::Converter::convertPercent( nPrc, aToken ))
     228                 :            :                         {
     229         [ #  # ]:          0 :                             if( !bHori )
     230                 :            :                             {
     231                 :            :                                 eNewPos = nPrc < 25
     232                 :            :                                     ? GraphicLocation_LEFT_TOP
     233                 :            :                                     : (nPrc < 75 ? GraphicLocation_MIDDLE_MIDDLE
     234 [ #  # ][ #  # ]:          0 :                                                 : GraphicLocation_RIGHT_BOTTOM);
     235                 :          0 :                                 bHori = sal_True;
     236                 :            :                             }
     237                 :            :                             else
     238                 :            :                             {
     239                 :            :                                 eTmp = nPrc < 25
     240                 :            :                                     ? GraphicLocation_LEFT_TOP
     241                 :            :                                     : (nPrc < 75 ? GraphicLocation_LEFT_MIDDLE
     242 [ #  # ][ #  # ]:          0 :                                                  : GraphicLocation_LEFT_BOTTOM);
     243                 :          0 :                                 lcl_xmlbic_MergeVertPos( eNewPos, eTmp );
     244                 :          0 :                                 bVert = sal_True;
     245                 :            :                             }
     246                 :            :                         }
     247                 :            :                         else
     248                 :            :                         {
     249                 :            :                             // wrong percentage
     250                 :          0 :                             bOK = sal_False;
     251                 :            :                         }
     252                 :            :                     }
     253 [ #  # ][ #  # ]:          0 :                     else if( IsXMLToken( aToken, XML_CENTER ) )
     254                 :            :                     {
     255         [ #  # ]:          0 :                         if( bHori )
     256                 :            :                             lcl_xmlbic_MergeVertPos( eNewPos,
     257                 :          0 :                                           GraphicLocation_MIDDLE_MIDDLE );
     258         [ #  # ]:          0 :                         else if ( bVert )
     259                 :            :                             lcl_xmlbic_MergeHoriPos( eNewPos,
     260                 :          0 :                                           GraphicLocation_MIDDLE_MIDDLE );
     261                 :            :                         else
     262                 :          0 :                             eNewPos = GraphicLocation_MIDDLE_MIDDLE;
     263                 :            :                     }
     264         [ #  # ]:          0 :                     else if( SvXMLUnitConverter::convertEnum( nTmp, aToken,
     265         [ #  # ]:          0 :                                                          psXML_BrushHoriPos ) )
     266                 :            :                     {
     267         [ #  # ]:          0 :                         if( bVert )
     268                 :            :                             lcl_xmlbic_MergeHoriPos( eNewPos,
     269                 :          0 :                                         (GraphicLocation)nTmp );
     270         [ #  # ]:          0 :                         else if( !bHori )
     271                 :          0 :                             eNewPos = (GraphicLocation)nTmp;
     272                 :            :                         else
     273                 :          0 :                             bOK = sal_False;
     274                 :          0 :                         bHori = sal_True;
     275                 :            :                     }
     276         [ #  # ]:          0 :                     else if( SvXMLUnitConverter::convertEnum( nTmp, aToken,
     277         [ #  # ]:          0 :                                                          psXML_BrushVertPos ) )
     278                 :            :                     {
     279         [ #  # ]:          0 :                         if( bHori )
     280                 :            :                             lcl_xmlbic_MergeVertPos( eNewPos,
     281                 :          0 :                                             (GraphicLocation)nTmp );
     282         [ #  # ]:          0 :                         else if( !bVert )
     283                 :          0 :                             eNewPos = (GraphicLocation)nTmp;
     284                 :            :                         else
     285                 :          0 :                             bOK = sal_False;
     286                 :          0 :                         bVert = sal_True;
     287                 :            :                     }
     288                 :            :                     else
     289                 :            :                     {
     290                 :          0 :                         bOK = sal_False;
     291                 :            :                     }
     292                 :            :                 }
     293                 :            : 
     294                 :          0 :                 bOK &= GraphicLocation_NONE != eNewPos;
     295         [ #  # ]:          0 :                 if( bOK )
     296                 :          0 :                     ePos = eNewPos;
     297                 :            :             }
     298                 :          0 :             break;
     299                 :            :         case XML_TOK_BGIMG_REPEAT:
     300                 :            :             {
     301                 :          0 :                 sal_uInt16 nPos = GraphicLocation_NONE;
     302                 :            :                 static SvXMLEnumMapEntry psXML_BrushRepeat[] =
     303                 :            :                 {
     304                 :            :                     { XML_BACKGROUND_REPEAT,        GraphicLocation_TILED   },
     305                 :            :                     { XML_BACKGROUND_NO_REPEAT,     GraphicLocation_MIDDLE_MIDDLE       },
     306                 :            :                     { XML_BACKGROUND_STRETCH,       GraphicLocation_AREA    },
     307                 :            :                     { XML_TOKEN_INVALID,            0           }
     308                 :            :                 };
     309         [ #  # ]:          0 :                 if( SvXMLUnitConverter::convertEnum( nPos, rValue,
     310         [ #  # ]:          0 :                                                 psXML_BrushRepeat ) )
     311                 :            :                 {
     312 [ #  # ][ #  # ]:          0 :                     if( GraphicLocation_MIDDLE_MIDDLE != nPos ||
         [ #  # ][ #  # ]
     313                 :            :                         GraphicLocation_NONE == ePos ||
     314                 :            :                         GraphicLocation_AREA == ePos ||
     315                 :            :                         GraphicLocation_TILED == ePos )
     316                 :          0 :                         ePos = (GraphicLocation)nPos;
     317                 :            :                 }
     318                 :            :             }
     319                 :          0 :             break;
     320                 :            :         case XML_TOK_BGIMG_FILTER:
     321                 :          0 :             sFilter = rValue;
     322                 :          0 :             break;
     323                 :            :         case XML_TOK_BGIMG_OPACITY:
     324                 :            :             {
     325                 :            :                 sal_Int32 nTmp;
     326                 :            :                 // convert from percent and clip
     327 [ #  # ][ #  # ]:          0 :                 if (::sax::Converter::convertPercent( nTmp, rValue ))
     328                 :            :                 {
     329 [ #  # ][ #  # ]:          0 :                     if( (nTmp >= 0) && (nTmp <= 100) )
     330                 :          0 :                         nTransparency = static_cast<sal_Int8>( 100-nTmp );
     331                 :            :                 }
     332                 :            :             }
     333                 :          0 :             break;
     334                 :            :         }
     335         [ +  - ]:        202 :     }
     336                 :            : 
     337                 :        202 : }
     338                 :            : 
     339                 :        202 : XMLBackgroundImageContext::XMLBackgroundImageContext(
     340                 :            :         SvXMLImport& rImport, sal_uInt16 nPrfx,
     341                 :            :         const OUString& rLName,
     342                 :            :         const Reference< xml::sax::XAttributeList > & xAttrList,
     343                 :            :         const XMLPropertyState& rProp,
     344                 :            :         sal_Int32 nPosIdx,
     345                 :            :         sal_Int32 nFilterIdx,
     346                 :            :         sal_Int32 nTransparencyIdx,
     347                 :            :         ::std::vector< XMLPropertyState > &rProps ) :
     348                 :            :     XMLElementPropertyContext( rImport, nPrfx, rLName, rProp, rProps ),
     349                 :            :     aPosProp( nPosIdx ),
     350                 :            :     aFilterProp( nFilterIdx ),
     351                 :            :     aTransparencyProp( nTransparencyIdx ),
     352                 :        202 :     nTransparency( 0 )
     353                 :            : {
     354         [ +  - ]:        202 :     ProcessAttrs( xAttrList );
     355                 :        202 : }
     356                 :            : 
     357                 :        202 : XMLBackgroundImageContext::~XMLBackgroundImageContext()
     358                 :            : {
     359         [ -  + ]:        404 : }
     360                 :            : 
     361                 :          0 : SvXMLImportContext *XMLBackgroundImageContext::CreateChildContext(
     362                 :            :         sal_uInt16 nPrefix, const OUString& rLocalName,
     363                 :            :         const Reference< xml::sax::XAttributeList > & xAttrList )
     364                 :            : {
     365                 :          0 :     SvXMLImportContext *pContext = NULL;
     366   [ #  #  #  # ]:          0 :     if( (XML_NAMESPACE_OFFICE == nPrefix) &&
                 [ #  # ]
     367                 :            :         xmloff::token::IsXMLToken( rLocalName,
     368                 :          0 :                                         xmloff::token::XML_BINARY_DATA ) )
     369                 :            :     {
     370 [ #  # ][ #  # ]:          0 :         if( sURL.isEmpty() && !xBase64Stream.is() )
                 [ #  # ]
     371                 :            :         {
     372         [ #  # ]:          0 :             xBase64Stream = GetImport().GetStreamForGraphicObjectURLFromBase64();
     373         [ #  # ]:          0 :             if( xBase64Stream.is() )
     374                 :          0 :                 pContext = new XMLBase64ImportContext( GetImport(), nPrefix,
     375                 :            :                                                     rLocalName, xAttrList,
     376         [ #  # ]:          0 :                                                     xBase64Stream );
     377                 :            :         }
     378                 :            :     }
     379         [ #  # ]:          0 :     if( !pContext )
     380                 :            :     {
     381         [ #  # ]:          0 :         pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
     382                 :            :     }
     383                 :            : 
     384                 :          0 :     return pContext;
     385                 :            : }
     386                 :            : 
     387                 :        202 : void XMLBackgroundImageContext::EndElement()
     388                 :            : {
     389         [ -  + ]:        202 :     if( !sURL.isEmpty() )
     390                 :            :     {
     391                 :          0 :         sURL = GetImport().ResolveGraphicObjectURL( sURL, sal_False );
     392                 :            :     }
     393         [ -  + ]:        202 :     else if( xBase64Stream.is() )
     394                 :            :     {
     395                 :          0 :         sURL = GetImport().ResolveGraphicObjectURLFromBase64( xBase64Stream );
     396                 :          0 :         xBase64Stream = 0;
     397                 :            :     }
     398                 :            : 
     399         [ +  - ]:        202 :     if( sURL.isEmpty() )
     400                 :        202 :         ePos = GraphicLocation_NONE;
     401         [ #  # ]:          0 :     else if( GraphicLocation_NONE == ePos )
     402                 :          0 :         ePos = GraphicLocation_TILED;
     403                 :            : 
     404                 :        202 :     aProp.maValue <<= sURL;
     405                 :        202 :     aPosProp.maValue <<= ePos;
     406                 :        202 :     aFilterProp.maValue <<= sFilter;
     407                 :        202 :     aTransparencyProp.maValue <<= nTransparency;
     408                 :            : 
     409                 :        202 :     SetInsert( sal_True );
     410                 :        202 :     XMLElementPropertyContext::EndElement();
     411                 :            : 
     412         [ +  - ]:        202 :     if( -1 != aPosProp.mnIndex )
     413                 :        202 :         rProperties.push_back( aPosProp );
     414         [ +  - ]:        202 :     if( -1 != aFilterProp.mnIndex )
     415                 :        202 :         rProperties.push_back( aFilterProp );
     416         [ -  + ]:        202 :     if( -1 != aTransparencyProp.mnIndex )
     417                 :          0 :         rProperties.push_back( aTransparencyProp );
     418                 :        202 : }
     419                 :            : 
     420                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10