LCOV - code coverage report
Current view: top level - libreoffice/sdext/source/pdfimport/tree - pdfiprocessor.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 376 879 42.8 %
Date: 2012-12-27 Functions: 37 50 74.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : 
      21             : #include "pdfiprocessor.hxx"
      22             : #include "xmlemitter.hxx"
      23             : #include "pdfihelper.hxx"
      24             : #include "imagecontainer.hxx"
      25             : #include "genericelements.hxx"
      26             : #include "style.hxx"
      27             : #include "treevisiting.hxx"
      28             : 
      29             : #include <rtl/string.hxx>
      30             : #include <rtl/strbuf.hxx>
      31             : 
      32             : #include <comphelper/sequence.hxx>
      33             : #include <basegfx/polygon/b2dpolypolygontools.hxx>
      34             : #include <basegfx/polygon/b2dpolygonclipper.hxx>
      35             : #include <basegfx/polygon/b2dpolygontools.hxx>
      36             : #include <basegfx/tools/canvastools.hxx>
      37             : #include <basegfx/matrix/b2dhommatrix.hxx>
      38             : #include <basegfx/range/b2irange.hxx>
      39             : #include <basegfx/range/b2drectangle.hxx>
      40             : #include <basegfx/matrix/b2dhommatrixtools.hxx>
      41             : 
      42             : #include <com/sun/star/rendering/XVolatileBitmap.hpp>
      43             : #include <com/sun/star/geometry/RealSize2D.hpp>
      44             : #include <com/sun/star/geometry/RealPoint2D.hpp>
      45             : #include <com/sun/star/geometry/RealRectangle2D.hpp>
      46             : 
      47             : 
      48             : using namespace com::sun::star;
      49             : 
      50             : 
      51             : namespace pdfi
      52             : {
      53             : 
      54           2 :  PDFIProcessor::PDFIProcessor( const uno::Reference< task::XStatusIndicator >& xStat ,
      55             :             com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >  xContext) :
      56             : 
      57             :     m_xContext(xContext),
      58             :     fYPrevTextPosition(-10000.0),
      59             :     fPrevTextHeight(0.0),
      60             :     fXPrevTextPosition(0.0),
      61             :     fPrevTextWidth(0.0),
      62             :     m_pElFactory( new ElementFactory() ),
      63           2 :     m_pDocument( m_pElFactory->createDocumentElement() ),
      64             :     m_pCurPage(0),
      65             :     m_pCurElement(0),
      66             :     m_nNextFontId( 1 ),
      67             :     m_aIdToFont(),
      68             :     m_aFontToId(),
      69             :     m_aGCStack(),
      70             :     m_nNextGCId( 1 ),
      71             :     m_aIdToGC(),
      72             :     m_aGCToId(),
      73             :     m_aImages(),
      74             :     m_eTextDirection( LrTb ),
      75             :     m_nPages(0),
      76             :     m_nNextZOrder( 1 ),
      77             :     m_bIsWhiteSpaceInLine( false ),
      78             :     m_xStatusIndicator( xStat ),
      79             :     m_bHaveTextOnDocLevel(false),
      80           4 :     m_bMirrorMapperTried(false)
      81             : {
      82           2 :     FontAttributes aDefFont;
      83           2 :     aDefFont.familyName = USTR("Helvetica");
      84           2 :     aDefFont.isBold     = false;
      85           2 :     aDefFont.isItalic   = false;
      86           2 :     aDefFont.size       = 10*PDFI_OUTDEV_RESOLUTION/72;
      87           2 :     m_aIdToFont[ 0 ]    = aDefFont;
      88           2 :     m_aFontToId[ aDefFont ] = 0;
      89             : 
      90           2 :     GraphicsContext aDefGC;
      91           2 :     m_aGCStack.push_back( aDefGC );
      92           2 :     m_aIdToGC[ 0 ] = aDefGC;
      93           2 :     m_aGCToId[ aDefGC ] = 0;
      94           2 : }
      95             : 
      96           0 : void PDFIProcessor::enableToplevelText()
      97             : {
      98           0 :     m_bHaveTextOnDocLevel = true;
      99           0 : }
     100             : 
     101           2 : void PDFIProcessor::setPageNum( sal_Int32 nPages )
     102             : {
     103           2 :     m_nPages = nPages;
     104           2 : }
     105             : 
     106             : 
     107          32 : void PDFIProcessor::pushState()
     108             : {
     109          32 :     GraphicsContextStack::value_type const a(m_aGCStack.back());
     110          32 :     m_aGCStack.push_back(a);
     111          32 : }
     112             : 
     113          32 : void PDFIProcessor::popState()
     114             : {
     115          32 :     m_aGCStack.pop_back();
     116          32 : }
     117             : 
     118           2 : void PDFIProcessor::setFlatness( double value )
     119             : {
     120           2 :     getCurrentContext().Flatness = value;
     121           2 : }
     122             : 
     123           4 : void PDFIProcessor::setTransformation( const geometry::AffineMatrix2D& rMatrix )
     124             : {
     125             :     basegfx::unotools::homMatrixFromAffineMatrix(
     126           4 :         getCurrentContext().Transformation,
     127           4 :         rMatrix );
     128           4 : }
     129             : 
     130           4 : void PDFIProcessor::setLineDash( const uno::Sequence<double>& dashes,
     131             :                                  double                       /*start*/ )
     132             : {
     133             :     // TODO(F2): factor in start offset
     134           4 :     GraphicsContext& rContext( getCurrentContext() );
     135           4 :     comphelper::sequenceToContainer(rContext.DashArray,dashes);
     136           4 : }
     137             : 
     138           6 : void PDFIProcessor::setLineJoin(sal_Int8 nJoin)
     139             : {
     140           6 :     getCurrentContext().LineJoin = nJoin;
     141           6 : }
     142             : 
     143           6 : void PDFIProcessor::setLineCap(sal_Int8 nCap)
     144             : {
     145           6 :     getCurrentContext().LineCap = nCap;
     146           6 : }
     147             : 
     148           2 : void PDFIProcessor::setMiterLimit(double)
     149             : {
     150             :     OSL_TRACE("PDFIProcessor::setMiterLimit(): not supported by ODF");
     151           2 : }
     152             : 
     153           8 : void PDFIProcessor::setLineWidth(double nWidth)
     154             : {
     155           8 :     getCurrentContext().LineWidth = nWidth;
     156           8 : }
     157             : 
     158          28 : void PDFIProcessor::setFillColor( const rendering::ARGBColor& rColor )
     159             : {
     160          28 :     getCurrentContext().FillColor = rColor;
     161          28 : }
     162             : 
     163           8 : void PDFIProcessor::setStrokeColor( const rendering::ARGBColor& rColor )
     164             : {
     165           8 :     getCurrentContext().LineColor = rColor;
     166           8 : }
     167             : 
     168           0 : void PDFIProcessor::setBlendMode(sal_Int8)
     169             : {
     170             :     OSL_TRACE("PDFIProcessor::setBlendMode(): not supported by ODF");
     171           0 : }
     172             : 
     173          22 : void PDFIProcessor::setFont( const FontAttributes& i_rFont )
     174             : {
     175          22 :     FontAttributes aChangedFont( i_rFont );
     176          22 :     GraphicsContext& rGC=getCurrentContext();
     177             :     // for text render modes, please see PDF reference manual
     178          22 :     aChangedFont.isOutline = ( (rGC.TextRenderMode == 1) || (rGC. TextRenderMode == 2) );
     179          22 :     FontToIdMap::const_iterator it = m_aFontToId.find( aChangedFont );
     180          22 :     if( it != m_aFontToId.end() )
     181          14 :         rGC.FontId = it->second;
     182             :     else
     183             :     {
     184           8 :         m_aFontToId[ aChangedFont ] = m_nNextFontId;
     185           8 :         m_aIdToFont[ m_nNextFontId ] = aChangedFont;
     186           8 :         rGC.FontId = m_nNextFontId;
     187           8 :         m_nNextFontId++;
     188          22 :     }
     189          22 : }
     190             : 
     191           0 : void PDFIProcessor::setTextRenderMode( sal_Int32 i_nMode )
     192             : {
     193           0 :     GraphicsContext& rGC=getCurrentContext();
     194           0 :     rGC.TextRenderMode = i_nMode;
     195           0 :     IdToFontMap::iterator it = m_aIdToFont.find( rGC.FontId );
     196           0 :     if( it != m_aIdToFont.end() )
     197           0 :         setFont( it->second );
     198           0 : }
     199             : 
     200           0 : sal_Int32 PDFIProcessor::getFontId( const FontAttributes& rAttr ) const
     201             : {
     202           0 :     const sal_Int32 nCurFont = getCurrentContext().FontId;
     203           0 :     const_cast<PDFIProcessor*>(this)->setFont( rAttr );
     204           0 :     const sal_Int32 nFont = getCurrentContext().FontId;
     205           0 :     const_cast<PDFIProcessor*>(this)->getCurrentContext().FontId = nCurFont;
     206             : 
     207           0 :     return nFont;
     208             : }
     209             : 
     210             : // line diagnose block - start
     211          22 : void PDFIProcessor::processGlyphLine()
     212             : {
     213          22 :     if( m_GlyphsList.size()<1 )
     214          22 :         return;
     215             : 
     216          22 :     double fPreAvarageSpaceValue= 0.0;
     217          22 :     double fAvarageDiffCharSpaceValue= 0.0;
     218          22 :     double fMinPreSpaceValue= 0.0;
     219          22 :     double fMaxPreSpaceValue= 0.0;
     220          22 :     double fNullSpaceBreakerAvaregeSpaceValue = 0.0;
     221             : 
     222          22 :     unsigned int    nSpaceCount( 0 );
     223          22 :     unsigned int    nDiffSpaceCount( 0 );
     224          22 :     unsigned int    nNullSpaceBreakerCount=0;
     225          22 :     bool preSpaceNull(true);
     226             : 
     227         208 :     for ( unsigned int i=0; i<m_GlyphsList.size()-1; i++ ) // i=1 because the first glyph doesn't have a prevGlyphSpace value
     228             :     {
     229         186 :         if( m_GlyphsList[i].getPrevGlyphsSpace()>0.0 )
     230             :         {
     231          58 :            if( fMinPreSpaceValue>m_GlyphsList[i].getPrevGlyphsSpace() )
     232           0 :                fMinPreSpaceValue=m_GlyphsList[i].getPrevGlyphsSpace();
     233             : 
     234          58 :            if( fMaxPreSpaceValue<m_GlyphsList[i].getPrevGlyphsSpace() )
     235          14 :                fMaxPreSpaceValue=m_GlyphsList[i].getPrevGlyphsSpace();
     236             : 
     237          58 :            fPreAvarageSpaceValue+= m_GlyphsList[i].getPrevGlyphsSpace();
     238          58 :            nSpaceCount++;
     239             :         }
     240             :     }
     241             : 
     242          22 :     if( nSpaceCount!=0 )
     243          14 :      fPreAvarageSpaceValue= fPreAvarageSpaceValue/( nSpaceCount );
     244             : 
     245         208 :     for ( unsigned int i=0; i<m_GlyphsList.size()-1; i++ ) // i=1 because the first glyph doesn't have a prevGlyphSpace value
     246             :     {
     247         186 :        if ( m_GlyphsList[i].getPrevGlyphsSpace()==0.0 )
     248             :        {
     249         168 :             if (
     250         128 :                  ( m_GlyphsList[i+1].getPrevGlyphsSpace()>0.0)&&
     251          40 :                  ( fPreAvarageSpaceValue>m_GlyphsList[i+1].getPrevGlyphsSpace())
     252             :                )
     253             :             {
     254          26 :               fNullSpaceBreakerAvaregeSpaceValue+=m_GlyphsList[i+1].getPrevGlyphsSpace();
     255          26 :               nNullSpaceBreakerCount++;
     256             :             }
     257             :         }
     258             :     }
     259             : 
     260          22 :     if( ( fNullSpaceBreakerAvaregeSpaceValue!= 0.0 )&&
     261             :         ( fNullSpaceBreakerAvaregeSpaceValue < fPreAvarageSpaceValue )
     262             :       )
     263             :     {
     264          10 :         fPreAvarageSpaceValue = fNullSpaceBreakerAvaregeSpaceValue;
     265             :     }
     266             : 
     267         208 :     for ( unsigned int i=0; i<m_GlyphsList.size()-1; i++ ) // i=1 cose the first Glypth dont have prevGlyphSpace value
     268             :     {
     269         186 :         if  ( ( m_GlyphsList[i].getPrevGlyphsSpace()>0.0 )
     270             :             )
     271             :         {
     272         100 :           if (
     273          58 :               ( m_GlyphsList[i].getPrevGlyphsSpace()  <= fPreAvarageSpaceValue )&&
     274          42 :               ( m_GlyphsList[i+1].getPrevGlyphsSpace()<= fPreAvarageSpaceValue )
     275             :              )
     276             :           {
     277          40 :                double temp= m_GlyphsList[i].getPrevGlyphsSpace()-m_GlyphsList[i+1].getPrevGlyphsSpace();
     278             : 
     279          40 :                if(temp!=0.0)
     280             :                {
     281          38 :                  if( temp< 0.0)
     282           0 :                   temp= temp* -1.0;
     283             : 
     284          38 :                  fAvarageDiffCharSpaceValue+=temp;
     285          38 :                  nDiffSpaceCount++;
     286             :                }
     287             :           }
     288             :         }
     289             : 
     290             :     }
     291             : 
     292          22 :     if (
     293             :          ( nNullSpaceBreakerCount>0 )
     294             :        )
     295             :     {
     296          10 :        fNullSpaceBreakerAvaregeSpaceValue=fNullSpaceBreakerAvaregeSpaceValue/nNullSpaceBreakerCount;
     297             :     }
     298             : 
     299          22 :     if (
     300             :          ( nDiffSpaceCount>0 )&&(fAvarageDiffCharSpaceValue>0)
     301             :        )
     302             :     {
     303          14 :         fAvarageDiffCharSpaceValue= fAvarageDiffCharSpaceValue/ nDiffSpaceCount;
     304             :     }
     305             : 
     306          22 :     ParagraphElement* pPara= NULL ;
     307          22 :     FrameElement* pFrame= NULL ;
     308             : 
     309          22 :     if(!m_GlyphsList.empty())
     310             :     {
     311          22 :         pFrame = m_pElFactory->createFrameElement( m_GlyphsList[0].getCurElement(), getGCId( getTransformGlyphContext( m_GlyphsList[0])) );
     312          22 :         pFrame->ZOrder = m_nNextZOrder++;
     313          22 :         pPara = m_pElFactory->createParagraphElement( pFrame );
     314             : 
     315             :         processGlyph( 0,
     316          22 :                   m_GlyphsList[0],
     317             :                   pPara,
     318             :                   pFrame,
     319          44 :                   m_bIsWhiteSpaceInLine );
     320             :     }
     321             : 
     322             : 
     323          22 :     preSpaceNull=false;
     324             : 
     325         194 :     for ( unsigned int i=1; i<m_GlyphsList.size()-1; i++ )
     326             :     {
     327         172 :         double fPrevDiffCharSpace= m_GlyphsList[i].getPrevGlyphsSpace()-m_GlyphsList[i-1].getPrevGlyphsSpace();
     328         172 :         double fPostDiffCharSpace= m_GlyphsList[i].getPrevGlyphsSpace()-m_GlyphsList[i+1].getPrevGlyphsSpace();
     329             : 
     330             : 
     331         286 :          if(
     332         114 :              preSpaceNull && (m_GlyphsList[i].getPrevGlyphsSpace()!= 0.0)
     333             :             )
     334             :          {
     335          38 :                preSpaceNull=false;
     336          38 :               if( fNullSpaceBreakerAvaregeSpaceValue > m_GlyphsList[i].getPrevGlyphsSpace() )
     337             :               {
     338             :                 processGlyph( 0,
     339           8 :                                       m_GlyphsList[i],
     340             :                               pPara,
     341             :                               pFrame,
     342          16 :                               m_bIsWhiteSpaceInLine );
     343             : 
     344             :               }
     345             :               else
     346             :               {
     347             :                 processGlyph( 1,
     348          30 :                               m_GlyphsList[i],
     349             :                               pPara,
     350             :                               pFrame,
     351          60 :                               m_bIsWhiteSpaceInLine );
     352             : 
     353             :               }
     354             : 
     355             :          }
     356             :          else
     357             :          {
     358         142 :             if (
     359         134 :                 ( ( m_GlyphsList[i].getPrevGlyphsSpace()<= fPreAvarageSpaceValue )&&
     360             :                   ( fPrevDiffCharSpace<=fAvarageDiffCharSpaceValue )&&
     361             :                   ( fPostDiffCharSpace<=fAvarageDiffCharSpaceValue )
     362             :                 ) ||
     363           8 :                 ( m_GlyphsList[i].getPrevGlyphsSpace() == 0.0 )
     364             :             )
     365             :             {
     366         126 :                 preSpaceNull=true;
     367             : 
     368             :             processGlyph( 0,
     369         126 :                         m_GlyphsList[i],
     370             :                         pPara,
     371             :                         pFrame,
     372         252 :                         m_bIsWhiteSpaceInLine );
     373             : 
     374             :             }
     375             :             else
     376             :             {
     377             :                 processGlyph( 1,
     378           8 :                         m_GlyphsList[i],
     379             :                         pPara,
     380             :                         pFrame,
     381          16 :                         m_bIsWhiteSpaceInLine );
     382             : 
     383             :             }
     384             : 
     385             :          }
     386             : 
     387             :     }
     388             : 
     389          22 :     if(m_GlyphsList.size()>1)
     390             :      processGlyph( 0,
     391          14 :                   m_GlyphsList[m_GlyphsList.size()-1],
     392             :                   pPara,
     393             :                   pFrame,
     394          28 :                   m_bIsWhiteSpaceInLine );
     395             : 
     396          22 :     m_GlyphsList.clear();
     397             : }
     398             : 
     399         208 : void PDFIProcessor::processGlyph( double       fPreAvarageSpaceValue,
     400             :                                   CharGlyph&   aGlyph,
     401             :                                   ParagraphElement* pPara,
     402             :                                   FrameElement* pFrame,
     403             :                                   bool         bIsWhiteSpaceInLine
     404             :                                       )
     405             : {
     406         208 :     if( !bIsWhiteSpaceInLine )
     407             :     {
     408           0 :         bool flag=( 0 < fPreAvarageSpaceValue );
     409             : 
     410           0 :         drawCharGlyphs(  aGlyph.getGlyph(),
     411           0 :                          aGlyph.getRect(),
     412           0 :                          aGlyph.getGC(),
     413             :                          pPara,
     414             :                          pFrame,
     415           0 :                          flag);
     416             :     }
     417             :     else
     418             :     {
     419         208 :         drawCharGlyphs( aGlyph.getGlyph(),
     420         208 :                         aGlyph.getRect(),
     421         208 :                         aGlyph.getGC(),
     422             :                         pPara,
     423             :                         pFrame,
     424         416 :                         false );
     425             :     }
     426         208 : }
     427             : 
     428         208 : void PDFIProcessor::drawGlyphLine( const rtl::OUString&             rGlyphs,
     429             :                                    const geometry::RealRectangle2D& rRect,
     430             :                                    const geometry::Matrix2D&        rFontMatrix )
     431             : {
     432         208 :     double isFirstLine= fYPrevTextPosition+ fXPrevTextPosition+ fPrevTextHeight+ fPrevTextWidth ;
     433         208 :     if(
     434             :         (  ( ( fYPrevTextPosition!= rRect.Y1 ) ) ||
     435             :            ( ( fXPrevTextPosition > rRect.X2 ) ) ||
     436             :            ( ( fXPrevTextPosition+fPrevTextWidth*1.3)<rRect.X1 )
     437             :         )  && ( isFirstLine> 0.0 )
     438             :     )
     439             :     {
     440          20 :         processGlyphLine();
     441             :     }
     442             : 
     443         208 :     CharGlyph aGlyph;
     444             : 
     445         208 :     aGlyph.setGlyph ( rGlyphs );
     446         208 :     aGlyph.setRect  ( rRect );
     447         208 :     aGlyph.setFontMatrix ( rFontMatrix );
     448         208 :     aGlyph.setGraphicsContext ( getCurrentContext() );
     449         208 :     getGCId(getCurrentContext());
     450         208 :     aGlyph.setCurElement( m_pCurElement );
     451             : 
     452         208 :     aGlyph.setYPrevGlyphPosition( fYPrevTextPosition );
     453         208 :     aGlyph.setXPrevGlyphPosition( fXPrevTextPosition );
     454         208 :     aGlyph.setPrevGlyphHeight  ( fPrevTextHeight );
     455         208 :     aGlyph.setPrevGlyphWidth   ( fPrevTextWidth );
     456             : 
     457         208 :     m_GlyphsList.push_back( aGlyph );
     458             : 
     459         208 :     fYPrevTextPosition  = rRect.Y1;
     460         208 :     fXPrevTextPosition  = rRect.X2;
     461         208 :     fPrevTextHeight     = rRect.Y2-rRect.Y1;
     462         208 :     fPrevTextWidth      = rRect.X2-rRect.X1;
     463             : 
     464         208 :     if( !m_bIsWhiteSpaceInLine )
     465             :     {
     466           2 :         static rtl::OUString tempWhiteSpaceStr( 0x20 );
     467           2 :         static rtl::OUString tempWhiteSpaceNonBreakingStr( 0xa0 );
     468           2 :         m_bIsWhiteSpaceInLine=(rGlyphs.equals( tempWhiteSpaceStr ) || rGlyphs.equals( tempWhiteSpaceNonBreakingStr ));
     469         208 :     }
     470         208 : }
     471             : 
     472          22 : GraphicsContext& PDFIProcessor::getTransformGlyphContext( CharGlyph& rGlyph )
     473             : {
     474          22 :     geometry::RealRectangle2D   rRect = rGlyph.getRect();
     475          22 :     geometry::Matrix2D          rFontMatrix = rGlyph.getFontMatrix();
     476             : 
     477          22 :     rtl::OUString tempStr( 32 );
     478             : 
     479          22 :     basegfx::B2DHomMatrix aFontMatrix;
     480             :     basegfx::unotools::homMatrixFromMatrix(
     481             :         aFontMatrix,
     482          22 :         rFontMatrix );
     483             : 
     484          22 :     FontAttributes aFontAttrs = m_aIdToFont[ rGlyph.getGC().FontId ];
     485             : 
     486             :     // add transformation to GC
     487          22 :     basegfx::B2DHomMatrix aFontTransform(basegfx::tools::createTranslateB2DHomMatrix(-rRect.X1, -rRect.Y1));
     488          22 :     aFontTransform *= aFontMatrix;
     489          22 :     aFontTransform.translate( rRect.X1, rRect.Y1 );
     490             : 
     491             : 
     492          22 :     rGlyph.getGC().Transformation = rGlyph.getGC().Transformation * aFontTransform;
     493          22 :     getGCId(rGlyph.getGC());
     494             : 
     495          22 :   return rGlyph.getGC();
     496             : }
     497         208 : void PDFIProcessor::drawCharGlyphs( rtl::OUString&             rGlyphs,
     498             :                                     geometry::RealRectangle2D& rRect,
     499             :                                     GraphicsContext aGC,
     500             :                                     ParagraphElement* pPara,
     501             :                                     FrameElement* pFrame,
     502             :                                     bool bSpaceFlag )
     503             : {
     504             : 
     505             : 
     506         208 :     rtl::OUString tempStr( 32 );
     507         208 :     geometry::RealRectangle2D aRect(rRect);
     508             : 
     509         208 :     ::basegfx::B2DRange aRect2;
     510             :     calcTransformedRectBounds( aRect2,
     511             :                                               ::basegfx::unotools::b2DRectangleFromRealRectangle2D(aRect),
     512         208 :                                               aGC.Transformation );
     513             :    // check whether there was a previous draw frame
     514             : 
     515         208 :     TextElement* pText = m_pElFactory->createTextElement( pPara,
     516             :                                                           getGCId(aGC),
     517         208 :                                                           aGC.FontId );
     518         208 :     if( bSpaceFlag )
     519           0 :         pText->Text.append( tempStr );
     520             : 
     521         208 :     pText->Text.append( rGlyphs );
     522             : 
     523         208 :     pText->x = aRect2.getMinX() ;
     524         208 :     pText->y = aRect2.getMinY() ;
     525         208 :     pText->w = 0.0;  // ToDO P2: 1.1 is a hack for solving of size auto-grow problem
     526         208 :     pText->h = aRect2.getHeight(); // ToDO P2: 1.1 is a hack for solving of size auto-grow problem
     527             : 
     528         208 :     pPara->updateGeometryWith( pText );
     529             : 
     530         208 :     if( pFrame )
     531         208 :       pFrame->updateGeometryWith( pPara );
     532             : 
     533         208 : }
     534         208 : void PDFIProcessor::drawGlyphs( const rtl::OUString&             rGlyphs,
     535             :                                 const geometry::RealRectangle2D& rRect,
     536             :                                 const geometry::Matrix2D&        rFontMatrix )
     537             : {
     538         208 :      drawGlyphLine( rGlyphs, rRect, rFontMatrix );
     539         208 : }
     540             : 
     541          22 : void PDFIProcessor::endText()
     542             : {
     543          22 :     TextElement* pText = dynamic_cast<TextElement*>(m_pCurElement);
     544          22 :     if( pText )
     545           0 :         m_pCurElement = pText->Parent;
     546          22 : }
     547             : 
     548           0 : void PDFIProcessor::setupImage(ImageId nImage)
     549             : {
     550           0 :     const GraphicsContext& rGC( getCurrentContext() );
     551             : 
     552           0 :     basegfx::B2DHomMatrix aTrans( rGC.Transformation );
     553             : 
     554             :     // check for rotation, which is the other way around in ODF
     555           0 :     basegfx::B2DTuple aScale, aTranslation;
     556             :     double fRotate, fShearX;
     557           0 :     rGC.Transformation.decompose( aScale, aTranslation, fRotate, fShearX );
     558             :     // TODDO(F4): correcting rotation when fShearX != 0 ?
     559           0 :     if( fRotate != 0.0 )
     560             :     {
     561             : 
     562             :         // try to create a Transformation that corrects for the wrong rotation
     563           0 :         aTrans.identity();
     564           0 :         aTrans.scale( aScale.getX(), aScale.getY() );
     565           0 :         aTrans.rotate( -fRotate );
     566             : 
     567           0 :         basegfx::B2DRange aRect( 0, 0, 1, 1 );
     568           0 :         aRect.transform( aTrans );
     569             : 
     570             :         // TODO(F3) treat translation correctly
     571             :         // the corrections below work for multiples of 90 degree
     572             :         // which is a common case (landscape/portrait/seascape)
     573             :         // we need a general solution here; however this needs to
     574             :         // work in sync with DrawXmlEmitter::fillFrameProps and WriterXmlEmitter::fillFrameProps
     575             :         // admittedly this is a lame workaround and fails for arbitrary rotation
     576           0 :         double fQuadrant = fmod( fRotate, 2.0*M_PI ) / M_PI_2;
     577           0 :         int nQuadrant = (int)fQuadrant;
     578           0 :         if( nQuadrant < 0 )
     579           0 :             nQuadrant += 4;
     580           0 :         if( nQuadrant == 1 )
     581             :         {
     582           0 :             aTranslation.setX( aTranslation.getX() + aRect.getHeight() + aRect.getWidth());
     583           0 :             aTranslation.setY( aTranslation.getY() + aRect.getHeight() );
     584             :         }
     585           0 :         if( nQuadrant == 3 )
     586           0 :             aTranslation.setX( aTranslation.getX() - aRect.getHeight() );
     587             : 
     588             :         aTrans.translate( aTranslation.getX(),
     589           0 :                           aTranslation.getY() );
     590             :     }
     591             : 
     592           0 :     bool bMirrorVertical = aScale.getY() > 0;
     593             : 
     594             :     // transform unit rect to determine view box
     595           0 :     basegfx::B2DRange aRect( 0, 0, 1, 1 );
     596           0 :     aRect.transform( aTrans );
     597             : 
     598             :     // TODO(F3): Handle clip
     599           0 :     const sal_Int32 nGCId = getGCId(rGC);
     600           0 :     FrameElement* pFrame = m_pElFactory->createFrameElement( m_pCurElement, nGCId );
     601           0 :     ImageElement* pImageElement = m_pElFactory->createImageElement( pFrame, nGCId, nImage );
     602           0 :     pFrame->x = pImageElement->x = aRect.getMinX();
     603           0 :     pFrame->y = pImageElement->y = aRect.getMinY();
     604           0 :     pFrame->w = pImageElement->w = aRect.getWidth();
     605           0 :     pFrame->h = pImageElement->h = aRect.getHeight();
     606           0 :     pFrame->ZOrder = m_nNextZOrder++;
     607             : 
     608           0 :     if( bMirrorVertical )
     609             :     {
     610           0 :         pFrame->MirrorVertical = pImageElement->MirrorVertical = true;
     611           0 :         pFrame->x        += aRect.getWidth();
     612           0 :         pImageElement->x += aRect.getWidth();
     613           0 :         pFrame->y        += aRect.getHeight();
     614           0 :         pImageElement->y += aRect.getHeight();
     615           0 :     }
     616           0 : }
     617             : 
     618           0 : void PDFIProcessor::drawMask(const uno::Sequence<beans::PropertyValue>& xBitmap,
     619             :                              bool                                       /*bInvert*/ )
     620             : {
     621             :     // TODO(F3): Handle mask and inversion
     622           0 :     setupImage( m_aImages.addImage(xBitmap) );
     623           0 : }
     624             : 
     625           0 : void PDFIProcessor::drawImage(const uno::Sequence<beans::PropertyValue>& xBitmap )
     626             : {
     627           0 :     setupImage( m_aImages.addImage(xBitmap) );
     628           0 : }
     629             : 
     630           0 : void PDFIProcessor::drawColorMaskedImage(const uno::Sequence<beans::PropertyValue>& xBitmap,
     631             :                                          const uno::Sequence<uno::Any>&             /*xMaskColors*/ )
     632             : {
     633             :     // TODO(F3): Handle mask colors
     634           0 :     setupImage( m_aImages.addImage(xBitmap) );
     635           0 : }
     636             : 
     637           0 : void PDFIProcessor::drawMaskedImage(const uno::Sequence<beans::PropertyValue>& xBitmap,
     638             :                                     const uno::Sequence<beans::PropertyValue>& /*xMask*/,
     639             :                                     bool                                       /*bInvertMask*/)
     640             : {
     641             :     // TODO(F3): Handle mask and inversion
     642           0 :     setupImage( m_aImages.addImage(xBitmap) );
     643           0 : }
     644             : 
     645           0 : void PDFIProcessor::drawAlphaMaskedImage(const uno::Sequence<beans::PropertyValue>& xBitmap,
     646             :                                          const uno::Sequence<beans::PropertyValue>& /*xMask*/)
     647             : {
     648             :     // TODO(F3): Handle mask
     649             : 
     650           0 :     setupImage( m_aImages.addImage(xBitmap) );
     651             : 
     652           0 : }
     653             : 
     654           4 : void PDFIProcessor::strokePath( const uno::Reference< rendering::XPolyPolygon2D >& rPath )
     655             : {
     656           4 :     basegfx::B2DPolyPolygon aPoly=basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(rPath);
     657           4 :     aPoly.transform(getCurrentContext().Transformation);
     658             : 
     659           4 :     PolyPolyElement* pPoly = m_pElFactory->createPolyPolyElement(
     660             :         m_pCurElement,
     661           4 :         getGCId(getCurrentContext()),
     662             :         aPoly,
     663           8 :         PATH_STROKE );
     664           4 :     pPoly->updateGeometry();
     665           4 :     pPoly->ZOrder = m_nNextZOrder++;
     666           4 : }
     667             : 
     668           0 : void PDFIProcessor::fillPath( const uno::Reference< rendering::XPolyPolygon2D >& rPath )
     669             : {
     670           0 :     basegfx::B2DPolyPolygon aPoly=basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(rPath);
     671           0 :     aPoly.transform(getCurrentContext().Transformation);
     672             : 
     673           0 :     PolyPolyElement* pPoly = m_pElFactory->createPolyPolyElement(
     674             :         m_pCurElement,
     675           0 :         getGCId(getCurrentContext()),
     676             :         aPoly,
     677           0 :         PATH_FILL );
     678           0 :     pPoly->updateGeometry();
     679           0 :     pPoly->ZOrder = m_nNextZOrder++;
     680           0 : }
     681             : 
     682           2 : void PDFIProcessor::eoFillPath( const uno::Reference< rendering::XPolyPolygon2D >& rPath )
     683             : {
     684           2 :     basegfx::B2DPolyPolygon aPoly=basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(rPath);
     685           2 :     aPoly.transform(getCurrentContext().Transformation);
     686             : 
     687           2 :     PolyPolyElement* pPoly = m_pElFactory->createPolyPolyElement(
     688             :         m_pCurElement,
     689           2 :         getGCId(getCurrentContext()),
     690             :         aPoly,
     691           4 :         PATH_EOFILL );
     692           2 :     pPoly->updateGeometry();
     693           2 :     pPoly->ZOrder = m_nNextZOrder++;
     694           2 : }
     695             : 
     696           2 : void PDFIProcessor::intersectClip(const uno::Reference< rendering::XPolyPolygon2D >& rPath)
     697             : {
     698             :     // TODO(F3): interpret fill mode
     699           2 :     basegfx::B2DPolyPolygon aNewClip = basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(rPath);
     700           2 :     aNewClip.transform(getCurrentContext().Transformation);
     701           2 :     basegfx::B2DPolyPolygon aCurClip = getCurrentContext().Clip;
     702             : 
     703           2 :     if( aCurClip.count() )  // #i92985# adapted API from (..., false, false) to (..., true, false)
     704           2 :         aNewClip = basegfx::tools::clipPolyPolygonOnPolyPolygon( aCurClip, aNewClip, true, false );
     705             : 
     706           2 :     getCurrentContext().Clip = aNewClip;
     707           2 : }
     708             : 
     709           2 : void PDFIProcessor::intersectEoClip(const uno::Reference< rendering::XPolyPolygon2D >& rPath)
     710             : {
     711             :     // TODO(F3): interpret fill mode
     712           2 :     basegfx::B2DPolyPolygon aNewClip = basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(rPath);
     713           2 :     aNewClip.transform(getCurrentContext().Transformation);
     714           2 :     basegfx::B2DPolyPolygon aCurClip = getCurrentContext().Clip;
     715             : 
     716           2 :     if( aCurClip.count() )  // #i92985# adapted API from (..., false, false) to (..., true, false)
     717           2 :         aNewClip = basegfx::tools::clipPolyPolygonOnPolyPolygon( aCurClip, aNewClip, true, false );
     718             : 
     719           2 :     getCurrentContext().Clip = aNewClip;
     720           2 : }
     721             : 
     722           2 : void PDFIProcessor::hyperLink( const geometry::RealRectangle2D& rBounds,
     723             :                                const ::rtl::OUString&           rURI )
     724             : {
     725           2 :     if( !rURI.isEmpty() )
     726             :     {
     727           2 :         HyperlinkElement* pLink = m_pElFactory->createHyperlinkElement(
     728             :             &m_pCurPage->Hyperlinks,
     729           2 :             rURI );
     730           2 :         pLink->x = rBounds.X1;
     731           2 :         pLink->y = rBounds.Y1;
     732           2 :         pLink->w = rBounds.X2-rBounds.X1;
     733           2 :         pLink->h = rBounds.Y2-rBounds.Y1;
     734             :     }
     735           2 : }
     736             : 
     737          22 : const FontAttributes& PDFIProcessor::getFont( sal_Int32 nFontId ) const
     738             : {
     739          22 :     IdToFontMap::const_iterator it = m_aIdToFont.find( nFontId );
     740          22 :     if( it == m_aIdToFont.end() )
     741           0 :         it = m_aIdToFont.find( 0 );
     742          22 :     return it->second;
     743             : }
     744             : 
     745         466 : sal_Int32 PDFIProcessor::getGCId( const GraphicsContext& rGC )
     746             : {
     747         466 :     sal_Int32 nGCId = 0;
     748         466 :     GCToIdMap::const_iterator it = m_aGCToId.find( rGC );
     749         466 :     if( it != m_aGCToId.end() )
     750         450 :         nGCId = it->second;
     751             :     else
     752             :     {
     753          16 :         m_aGCToId[ rGC ] = m_nNextGCId;
     754          16 :         m_aIdToGC[ m_nNextGCId ] = rGC;
     755          16 :         nGCId = m_nNextGCId;
     756          16 :         m_nNextGCId++;
     757             :     }
     758             : 
     759         466 :     return nGCId;
     760             : }
     761             : 
     762         453 : const GraphicsContext& PDFIProcessor::getGraphicsContext( sal_Int32 nGCId ) const
     763             : {
     764         453 :     IdToGCMap::const_iterator it = m_aIdToGC.find( nGCId );
     765         453 :     if( it == m_aIdToGC.end() )
     766           0 :         it = m_aIdToGC.find( 0 );
     767         453 :     return it->second;
     768             : }
     769             : 
     770           2 : void PDFIProcessor::endPage()
     771             : {
     772           2 :     processGlyphLine(); // draw last line
     773           2 :     if( m_xStatusIndicator.is()
     774             :         && m_pCurPage
     775             :         && m_pCurPage->PageNumber == m_nPages
     776             :     )
     777           0 :         m_xStatusIndicator->end();
     778           2 : }
     779             : 
     780           2 : void PDFIProcessor::startPage( const geometry::RealSize2D& rSize )
     781             : {
     782             :     // initial clip is to page bounds
     783           2 :     getCurrentContext().Clip = basegfx::B2DPolyPolygon(
     784             :         basegfx::tools::createPolygonFromRect(
     785           4 :             basegfx::B2DRange( 0, 0, rSize.Width, rSize.Height )));
     786             : 
     787           2 :     sal_Int32 nNextPageNr = m_pCurPage ? m_pCurPage->PageNumber+1 : 1;
     788           2 :     if( m_xStatusIndicator.is() )
     789             :     {
     790           0 :         if( nNextPageNr == 1 )
     791           0 :             startIndicator( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " " ) ) );
     792           0 :         m_xStatusIndicator->setValue( nNextPageNr );
     793             :     }
     794           2 :     m_pCurPage = m_pElFactory->createPageElement(m_pDocument.get(), nNextPageNr);
     795           2 :     m_pCurElement = m_pCurPage;
     796           2 :     m_pCurPage->w = rSize.Width;
     797           2 :     m_pCurPage->h = rSize.Height;
     798           2 :     m_nNextZOrder = 1;
     799             : 
     800             : 
     801           2 : }
     802             : 
     803           2 : void PDFIProcessor::emit( XmlEmitter&               rEmitter,
     804             :                           const TreeVisitorFactory& rVisitorFactory )
     805             : {
     806             : #if OSL_DEBUG_LEVEL > 1
     807             :     m_pDocument->emitStructure( 0 );
     808             : #endif
     809             : 
     810             :     ElementTreeVisitorSharedPtr optimizingVisitor(
     811           2 :         rVisitorFactory.createOptimizingVisitor(*this));
     812             :     // FIXME: localization
     813           2 :     startIndicator( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( " " ) ) );
     814           2 :     m_pDocument->visitedBy( *optimizingVisitor, std::list<Element*>::const_iterator());
     815             : 
     816             : #if OSL_DEBUG_LEVEL > 1
     817             :     m_pDocument->emitStructure( 0 );
     818             : #endif
     819             : 
     820             :     // get styles
     821           2 :     StyleContainer aStyles;
     822             :     ElementTreeVisitorSharedPtr finalizingVisitor(
     823           2 :         rVisitorFactory.createStyleCollectingVisitor(aStyles,*this));
     824             :     // FIXME: localization
     825             : 
     826           2 :     m_pDocument->visitedBy( *finalizingVisitor, std::list<Element*>::const_iterator() );
     827             : 
     828           2 :     EmitContext aContext( rEmitter, aStyles, m_aImages, *this, m_xStatusIndicator, m_xContext );
     829             :     ElementTreeVisitorSharedPtr aEmittingVisitor(
     830           2 :         rVisitorFactory.createEmittingVisitor(aContext, *this));
     831             : 
     832           2 :     PropertyMap aProps;
     833             :     // document prolog
     834             :     #define OASIS_STR "urn:oasis:names:tc:opendocument:xmlns:"
     835           2 :     aProps[ USTR( "xmlns:office" ) ]      = USTR( OASIS_STR "office:1.0" );
     836           2 :     aProps[ USTR( "xmlns:style" ) ]       = USTR( OASIS_STR "style:1.0" );
     837           2 :     aProps[ USTR( "xmlns:text" ) ]        = USTR( OASIS_STR "text:1.0" );
     838           2 :     aProps[ USTR( "xmlns:svg" ) ]         = USTR( OASIS_STR "svg-compatible:1.0" );
     839           2 :     aProps[ USTR( "xmlns:table" ) ]       = USTR( OASIS_STR "table:1.0" );
     840           2 :     aProps[ USTR( "xmlns:draw" ) ]        = USTR( OASIS_STR "drawing:1.0" );
     841           2 :     aProps[ USTR( "xmlns:fo" ) ]          = USTR( OASIS_STR "xsl-fo-compatible:1.0" );
     842           2 :     aProps[ USTR( "xmlns:xlink" )]        = USTR( "http://www.w3.org/1999/xlink" );
     843           2 :     aProps[ USTR( "xmlns:dc" )]           = USTR( "http://purl.org/dc/elements/1.1/" );
     844           2 :     aProps[ USTR( "xmlns:number" )]       = USTR( OASIS_STR "datastyle:1.0" );
     845           2 :     aProps[ USTR( "xmlns:presentation" )] = USTR( OASIS_STR "presentation:1.0" );
     846           2 :     aProps[ USTR( "xmlns:math" )]         = USTR( "http://www.w3.org/1998/Math/MathML" );
     847           2 :     aProps[ USTR( "xmlns:form" )]         = USTR( OASIS_STR "form:1.0" );
     848           2 :     aProps[ USTR( "xmlns:script" )]       = USTR( OASIS_STR "script:1.0" );
     849           2 :     aProps[ USTR( "xmlns:dom" )]          = USTR( "http://www.w3.org/2001/xml-events" );
     850           2 :     aProps[ USTR( "xmlns:xforms" )]       = USTR( "http://www.w3.org/2002/xforms" );
     851           2 :     aProps[ USTR( "xmlns:xsd" )]          = USTR( "http://www.w3.org/2001/XMLSchema" );
     852           2 :     aProps[ USTR( "xmlns:xsi" )]          = USTR( "http://www.w3.org/2001/XMLSchema-instance" );
     853           2 :     aProps[ USTR( "office:version" ) ]    = USTR( "1.0" );
     854           2 :     aProps[ USTR( "office:version" ) ]    = USTR( "1.0" );
     855             : 
     856           2 :     aContext.rEmitter.beginTag( "office:document", aProps );
     857             : 
     858             :     // emit style list
     859           2 :     aStyles.emit( aContext, *aEmittingVisitor );
     860             : 
     861           2 :     m_pDocument->visitedBy( *aEmittingVisitor, std::list<Element*>::const_iterator() );
     862           2 :     aContext.rEmitter.endTag( "office:document" );
     863           2 :     endIndicator();
     864           2 : }
     865             : 
     866           2 : void PDFIProcessor::startIndicator( const rtl::OUString& rText, sal_Int32 nElements )
     867             : {
     868           2 :     if( nElements == -1 )
     869           2 :         nElements = m_nPages;
     870           2 :     if( m_xStatusIndicator.is() )
     871             :     {
     872           0 :         sal_Int32 nUnicodes = rText.getLength();
     873           0 :         rtl::OUStringBuffer aStr( nUnicodes*2 );
     874           0 :         const sal_Unicode* pText = rText.getStr();
     875           0 :         for( int i = 0; i < nUnicodes; i++ )
     876             :         {
     877           0 :             if( nUnicodes-i > 1&&
     878           0 :                 pText[i]   == '%' &&
     879           0 :                 pText[i+1] == 'd'
     880             :             )
     881             :             {
     882           0 :                 aStr.append( nElements );
     883           0 :                 i++;
     884             :             }
     885             :             else
     886           0 :                 aStr.append( pText[i] );
     887             :         }
     888           0 :         m_xStatusIndicator->start( aStr.makeStringAndClear(), nElements );
     889             :     }
     890           2 : }
     891             : 
     892           2 : void PDFIProcessor::endIndicator()
     893             : {
     894           2 :     if( m_xStatusIndicator.is() )
     895           0 :         m_xStatusIndicator->end();
     896           2 : }
     897             : 
     898          82 : static bool lr_tb_sort( Element* pLeft, Element* pRight )
     899             : {
     900             :     // first: top-bottom sorting
     901             : 
     902             :     // Note: allow for 10% overlap on text lines since text lines are usually
     903             :     // of the same order as font height whereas the real paint area
     904             :     // of text is usually smaller
     905          82 :     double fudge_factor = 1.0;
     906          82 :     if( dynamic_cast< TextElement* >(pLeft) || dynamic_cast< TextElement* >(pRight) )
     907           0 :         fudge_factor = 0.9;
     908             : 
     909             :     // if left's lower boundary is above right's upper boundary
     910             :     // then left is smaller
     911          82 :     if( pLeft->y+pLeft->h*fudge_factor < pRight->y )
     912          30 :         return true;
     913             :     // if right's lower boundary is above left's upper boundary
     914             :     // then left is definitely not smaller
     915          52 :     if( pRight->y+pRight->h*fudge_factor < pLeft->y )
     916          24 :         return false;
     917             : 
     918             :     // by now we have established that left and right are inside
     919             :     // a "line", that is they have vertical overlap
     920             :     // second: left-right sorting
     921             :     // if left's right boundary is left to right's left boundary
     922             :     // then left is smaller
     923          28 :     if( pLeft->x+pLeft->w < pRight->x )
     924           4 :         return true;
     925             :     // if right's right boundary is left to left's left boundary
     926             :     // then left is definitely not smaller
     927          24 :     if( pRight->x+pRight->w < pLeft->x )
     928          16 :         return false;
     929             : 
     930             :     // here we have established vertical and horizontal overlap
     931             :     // so sort left first, top second
     932           8 :     if( pLeft->x < pRight->x )
     933           6 :         return true;
     934           2 :     if( pRight->x < pLeft->x )
     935           2 :         return false;
     936           0 :     if( pLeft->y < pRight->y )
     937           0 :         return true;
     938             : 
     939           0 :     return false;
     940             : }
     941             : 
     942           2 : void PDFIProcessor::sortElements( Element* pEle, bool bDeep )
     943             : {
     944           2 :     if( pEle->Children.empty() )
     945           2 :         return;
     946             : 
     947           2 :     if( bDeep )
     948             :     {
     949           0 :         for( std::list< Element* >::iterator it = pEle->Children.begin();
     950           0 :              it != pEle->Children.end(); ++it )
     951             :         {
     952           0 :             sortElements( *it, bDeep );
     953             :         }
     954             :     }
     955             :     // HACK: the stable sort member on std::list that takes a
     956             :     // strict weak ordering requires member templates - which we
     957             :     // do not have on all compilers. so we need to use std::stable_sort
     958             :     // here - which does need random access iterators which the
     959             :     // list iterators are not.
     960             :     // so we need to copy the Element* to an array, stable sort that and
     961             :     // copy them back.
     962           2 :     std::vector<Element*> aChildren;
     963          32 :     while( ! pEle->Children.empty() )
     964             :     {
     965          28 :         aChildren.push_back( pEle->Children.front() );
     966          28 :         pEle->Children.pop_front();
     967             :     }
     968           2 :     switch( m_eTextDirection )
     969             :     {
     970             :         case LrTb:
     971             :         default:
     972           2 :         std::stable_sort( aChildren.begin(), aChildren.end(), lr_tb_sort );
     973           2 :         break;
     974             :     }
     975           2 :     int nChildren = aChildren.size();
     976          30 :     for( int i = 0; i < nChildren; i++ )
     977          30 :         pEle->Children.push_back( aChildren[i] );
     978             : }
     979             : 
     980             : 
     981         208 : ::basegfx::B2DRange& PDFIProcessor::calcTransformedRectBounds( ::basegfx::B2DRange&         outRect,
     982             :                                                         const ::basegfx::B2DRange&      inRect,
     983             :                                                         const ::basegfx::B2DHomMatrix&  transformation )
     984             :         {
     985         208 :             outRect.reset();
     986             : 
     987         208 :             if( inRect.isEmpty() )
     988           0 :                 return outRect;
     989             : 
     990             :             // transform all four extremal points of the rectangle,
     991             :             // take bounding rect of those.
     992             : 
     993             :             // transform left-top point
     994         208 :             outRect.expand( transformation * inRect.getMinimum() );
     995             : 
     996             :             // transform bottom-right point
     997         208 :             outRect.expand( transformation * inRect.getMaximum() );
     998             : 
     999         208 :             ::basegfx::B2DPoint aPoint;
    1000             : 
    1001             :             // transform top-right point
    1002         208 :             aPoint.setX( inRect.getMaxX() );
    1003         208 :             aPoint.setY( inRect.getMinY() );
    1004             : 
    1005         208 :             aPoint *= transformation;
    1006         208 :             outRect.expand( aPoint );
    1007             : 
    1008             :             // transform bottom-left point
    1009         208 :             aPoint.setX( inRect.getMinX() );
    1010         208 :             aPoint.setY( inRect.getMaxY() );
    1011             : 
    1012         208 :             aPoint *= transformation;
    1013         208 :             outRect.expand( aPoint );
    1014             : 
    1015             :             // over and out.
    1016         208 :             return outRect;
    1017             :         }
    1018             : 
    1019             : // helper method: get a mirrored string
    1020           0 : rtl::OUString PDFIProcessor::mirrorString( const rtl::OUString& i_rString )
    1021             : {
    1022           0 :     if( ! m_xMirrorMapper.is() && ! m_bMirrorMapperTried )
    1023             :     {
    1024           0 :         m_bMirrorMapperTried = true;
    1025           0 :         uno::Reference< lang::XMultiComponentFactory > xMSF(  m_xContext->getServiceManager(), uno::UNO_SET_THROW );
    1026           0 :         uno::Reference < uno::XInterface > xInterface = xMSF->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.StringMirror")), m_xContext);
    1027           0 :         m_xMirrorMapper = uno::Reference< util::XStringMapping >( xInterface, uno::UNO_QUERY );
    1028             :         #if OSL_DEBUG_LEVEL > 1
    1029             :         if( m_xMirrorMapper.is() )
    1030             :             fprintf( stderr, "using mirror mapper service\n" );
    1031             :         #endif
    1032             :     }
    1033           0 :     if( m_xMirrorMapper.is() )
    1034             :     {
    1035           0 :         uno::Sequence< rtl::OUString > aSeq( 1 );
    1036           0 :         aSeq.getArray()[0] = i_rString;
    1037           0 :         m_xMirrorMapper->mapStrings( aSeq );
    1038           0 :         return  aSeq[0];
    1039             :     }
    1040             : 
    1041           0 :     prepareMirrorMap();
    1042           0 :     sal_Int32 nLen = i_rString.getLength();
    1043           0 :     rtl::OUStringBuffer aRet( nLen );
    1044           0 :     for(int i = nLen - 1; i >= 0; i--)
    1045             :     {
    1046           0 :         sal_Unicode cChar = i_rString[ i ];
    1047           0 :         aRet.append( m_aMirrorMap[cChar] );
    1048             :     }
    1049           0 :     return aRet.makeStringAndClear();
    1050             : }
    1051             : 
    1052           0 : void PDFIProcessor::prepareMirrorMap()
    1053             : {
    1054           0 :     if( m_aMirrorMap.empty() )
    1055             :     {
    1056             :         #if OSL_DEBUG_LEVEL > 1
    1057             :         fprintf( stderr, "falling back to static mirror list\n" );
    1058             :         #endif
    1059             : 
    1060           0 :         m_aMirrorMap.reserve( 0x10000 );
    1061           0 :         for( int i = 0; i < 0x10000; i++ )
    1062           0 :             m_aMirrorMap.push_back( sal_Unicode(i) );
    1063             : 
    1064           0 :         m_aMirrorMap[ 0x0028 ] = 0x0029; // LEFT PARENTHESIS
    1065           0 :         m_aMirrorMap[ 0x0029 ] = 0x0028; // RIGHT PARENTHESIS
    1066           0 :         m_aMirrorMap[ 0x003C ] = 0x003E; // LESS-THAN SIGN
    1067           0 :         m_aMirrorMap[ 0x003E ] = 0x003C; // GREATER-THAN SIGN
    1068           0 :         m_aMirrorMap[ 0x005B ] = 0x005D; // LEFT SQUARE BRACKET
    1069           0 :         m_aMirrorMap[ 0x005D ] = 0x005B; // RIGHT SQUARE BRACKET
    1070           0 :         m_aMirrorMap[ 0x007B ] = 0x007D; // LEFT CURLY BRACKET
    1071           0 :         m_aMirrorMap[ 0x007D ] = 0x007B; // RIGHT CURLY BRACKET
    1072           0 :         m_aMirrorMap[ 0x00AB ] = 0x00BB; // LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
    1073           0 :         m_aMirrorMap[ 0x00BB ] = 0x00AB; // RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
    1074           0 :         m_aMirrorMap[ 0x0F3A ] = 0x0F3B; // TIBETAN MARK GUG RTAGS GYON
    1075           0 :         m_aMirrorMap[ 0x0F3B ] = 0x0F3A; // TIBETAN MARK GUG RTAGS GYAS
    1076           0 :         m_aMirrorMap[ 0x0F3C ] = 0x0F3D; // TIBETAN MARK ANG KHANG GYON
    1077           0 :         m_aMirrorMap[ 0x0F3D ] = 0x0F3C; // TIBETAN MARK ANG KHANG GYAS
    1078           0 :         m_aMirrorMap[ 0x169B ] = 0x169C; // OGHAM FEATHER MARK
    1079           0 :         m_aMirrorMap[ 0x169C ] = 0x169B; // OGHAM REVERSED FEATHER MARK
    1080           0 :         m_aMirrorMap[ 0x2039 ] = 0x203A; // SINGLE LEFT-POINTING ANGLE QUOTATION MARK
    1081           0 :         m_aMirrorMap[ 0x203A ] = 0x2039; // SINGLE RIGHT-POINTING ANGLE QUOTATION MARK
    1082           0 :         m_aMirrorMap[ 0x2045 ] = 0x2046; // LEFT SQUARE BRACKET WITH QUILL
    1083           0 :         m_aMirrorMap[ 0x2046 ] = 0x2045; // RIGHT SQUARE BRACKET WITH QUILL
    1084           0 :         m_aMirrorMap[ 0x207D ] = 0x207E; // SUPERSCRIPT LEFT PARENTHESIS
    1085           0 :         m_aMirrorMap[ 0x207E ] = 0x207D; // SUPERSCRIPT RIGHT PARENTHESIS
    1086           0 :         m_aMirrorMap[ 0x208D ] = 0x208E; // SUBSCRIPT LEFT PARENTHESIS
    1087           0 :         m_aMirrorMap[ 0x208E ] = 0x208D; // SUBSCRIPT RIGHT PARENTHESIS
    1088           0 :         m_aMirrorMap[ 0x2208 ] = 0x220B; // ELEMENT OF
    1089           0 :         m_aMirrorMap[ 0x2209 ] = 0x220C; // NOT AN ELEMENT OF
    1090           0 :         m_aMirrorMap[ 0x220A ] = 0x220D; // SMALL ELEMENT OF
    1091           0 :         m_aMirrorMap[ 0x220B ] = 0x2208; // CONTAINS AS MEMBER
    1092           0 :         m_aMirrorMap[ 0x220C ] = 0x2209; // DOES NOT CONTAIN AS MEMBER
    1093           0 :         m_aMirrorMap[ 0x220D ] = 0x220A; // SMALL CONTAINS AS MEMBER
    1094           0 :         m_aMirrorMap[ 0x2215 ] = 0x29F5; // DIVISION SLASH
    1095           0 :         m_aMirrorMap[ 0x223C ] = 0x223D; // TILDE OPERATOR
    1096           0 :         m_aMirrorMap[ 0x223D ] = 0x223C; // REVERSED TILDE
    1097           0 :         m_aMirrorMap[ 0x2243 ] = 0x22CD; // ASYMPTOTICALLY EQUAL TO
    1098           0 :         m_aMirrorMap[ 0x2252 ] = 0x2253; // APPROXIMATELY EQUAL TO OR THE IMAGE OF
    1099           0 :         m_aMirrorMap[ 0x2253 ] = 0x2252; // IMAGE OF OR APPROXIMATELY EQUAL TO
    1100           0 :         m_aMirrorMap[ 0x2254 ] = 0x2255; // COLON EQUALS
    1101           0 :         m_aMirrorMap[ 0x2255 ] = 0x2254; // EQUALS COLON
    1102           0 :         m_aMirrorMap[ 0x2264 ] = 0x2265; // LESS-THAN OR EQUAL TO
    1103           0 :         m_aMirrorMap[ 0x2265 ] = 0x2264; // GREATER-THAN OR EQUAL TO
    1104           0 :         m_aMirrorMap[ 0x2266 ] = 0x2267; // LESS-THAN OVER EQUAL TO
    1105           0 :         m_aMirrorMap[ 0x2267 ] = 0x2266; // GREATER-THAN OVER EQUAL TO
    1106           0 :         m_aMirrorMap[ 0x2268 ] = 0x2269; // [BEST FIT] LESS-THAN BUT NOT EQUAL TO
    1107           0 :         m_aMirrorMap[ 0x2269 ] = 0x2268; // [BEST FIT] GREATER-THAN BUT NOT EQUAL TO
    1108           0 :         m_aMirrorMap[ 0x226A ] = 0x226B; // MUCH LESS-THAN
    1109           0 :         m_aMirrorMap[ 0x226B ] = 0x226A; // MUCH GREATER-THAN
    1110           0 :         m_aMirrorMap[ 0x226E ] = 0x226F; // [BEST FIT] NOT LESS-THAN
    1111           0 :         m_aMirrorMap[ 0x226F ] = 0x226E; // [BEST FIT] NOT GREATER-THAN
    1112           0 :         m_aMirrorMap[ 0x2270 ] = 0x2271; // [BEST FIT] NEITHER LESS-THAN NOR EQUAL TO
    1113           0 :         m_aMirrorMap[ 0x2271 ] = 0x2270; // [BEST FIT] NEITHER GREATER-THAN NOR EQUAL TO
    1114           0 :         m_aMirrorMap[ 0x2272 ] = 0x2273; // [BEST FIT] LESS-THAN OR EQUIVALENT TO
    1115           0 :         m_aMirrorMap[ 0x2273 ] = 0x2272; // [BEST FIT] GREATER-THAN OR EQUIVALENT TO
    1116           0 :         m_aMirrorMap[ 0x2274 ] = 0x2275; // [BEST FIT] NEITHER LESS-THAN NOR EQUIVALENT TO
    1117           0 :         m_aMirrorMap[ 0x2275 ] = 0x2274; // [BEST FIT] NEITHER GREATER-THAN NOR EQUIVALENT TO
    1118           0 :         m_aMirrorMap[ 0x2276 ] = 0x2277; // LESS-THAN OR GREATER-THAN
    1119           0 :         m_aMirrorMap[ 0x2277 ] = 0x2276; // GREATER-THAN OR LESS-THAN
    1120           0 :         m_aMirrorMap[ 0x2278 ] = 0x2279; // [BEST FIT] NEITHER LESS-THAN NOR GREATER-THAN
    1121           0 :         m_aMirrorMap[ 0x2279 ] = 0x2278; // [BEST FIT] NEITHER GREATER-THAN NOR LESS-THAN
    1122           0 :         m_aMirrorMap[ 0x227A ] = 0x227B; // PRECEDES
    1123           0 :         m_aMirrorMap[ 0x227B ] = 0x227A; // SUCCEEDS
    1124           0 :         m_aMirrorMap[ 0x227C ] = 0x227D; // PRECEDES OR EQUAL TO
    1125           0 :         m_aMirrorMap[ 0x227D ] = 0x227C; // SUCCEEDS OR EQUAL TO
    1126           0 :         m_aMirrorMap[ 0x227E ] = 0x227F; // [BEST FIT] PRECEDES OR EQUIVALENT TO
    1127           0 :         m_aMirrorMap[ 0x227F ] = 0x227E; // [BEST FIT] SUCCEEDS OR EQUIVALENT TO
    1128           0 :         m_aMirrorMap[ 0x2280 ] = 0x2281; // [BEST FIT] DOES NOT PRECEDE
    1129           0 :         m_aMirrorMap[ 0x2281 ] = 0x2280; // [BEST FIT] DOES NOT SUCCEED
    1130           0 :         m_aMirrorMap[ 0x2282 ] = 0x2283; // SUBSET OF
    1131           0 :         m_aMirrorMap[ 0x2283 ] = 0x2282; // SUPERSET OF
    1132           0 :         m_aMirrorMap[ 0x2284 ] = 0x2285; // [BEST FIT] NOT A SUBSET OF
    1133           0 :         m_aMirrorMap[ 0x2285 ] = 0x2284; // [BEST FIT] NOT A SUPERSET OF
    1134           0 :         m_aMirrorMap[ 0x2286 ] = 0x2287; // SUBSET OF OR EQUAL TO
    1135           0 :         m_aMirrorMap[ 0x2287 ] = 0x2286; // SUPERSET OF OR EQUAL TO
    1136           0 :         m_aMirrorMap[ 0x2288 ] = 0x2289; // [BEST FIT] NEITHER A SUBSET OF NOR EQUAL TO
    1137           0 :         m_aMirrorMap[ 0x2289 ] = 0x2288; // [BEST FIT] NEITHER A SUPERSET OF NOR EQUAL TO
    1138           0 :         m_aMirrorMap[ 0x228A ] = 0x228B; // [BEST FIT] SUBSET OF WITH NOT EQUAL TO
    1139           0 :         m_aMirrorMap[ 0x228B ] = 0x228A; // [BEST FIT] SUPERSET OF WITH NOT EQUAL TO
    1140           0 :         m_aMirrorMap[ 0x228F ] = 0x2290; // SQUARE IMAGE OF
    1141           0 :         m_aMirrorMap[ 0x2290 ] = 0x228F; // SQUARE ORIGINAL OF
    1142           0 :         m_aMirrorMap[ 0x2291 ] = 0x2292; // SQUARE IMAGE OF OR EQUAL TO
    1143           0 :         m_aMirrorMap[ 0x2292 ] = 0x2291; // SQUARE ORIGINAL OF OR EQUAL TO
    1144           0 :         m_aMirrorMap[ 0x2298 ] = 0x29B8; // CIRCLED DIVISION SLASH
    1145           0 :         m_aMirrorMap[ 0x22A2 ] = 0x22A3; // RIGHT TACK
    1146           0 :         m_aMirrorMap[ 0x22A3 ] = 0x22A2; // LEFT TACK
    1147           0 :         m_aMirrorMap[ 0x22A6 ] = 0x2ADE; // ASSERTION
    1148           0 :         m_aMirrorMap[ 0x22A8 ] = 0x2AE4; // TRUE
    1149           0 :         m_aMirrorMap[ 0x22A9 ] = 0x2AE3; // FORCES
    1150           0 :         m_aMirrorMap[ 0x22AB ] = 0x2AE5; // DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE
    1151           0 :         m_aMirrorMap[ 0x22B0 ] = 0x22B1; // PRECEDES UNDER RELATION
    1152           0 :         m_aMirrorMap[ 0x22B1 ] = 0x22B0; // SUCCEEDS UNDER RELATION
    1153           0 :         m_aMirrorMap[ 0x22B2 ] = 0x22B3; // NORMAL SUBGROUP OF
    1154           0 :         m_aMirrorMap[ 0x22B3 ] = 0x22B2; // CONTAINS AS NORMAL SUBGROUP
    1155           0 :         m_aMirrorMap[ 0x22B4 ] = 0x22B5; // NORMAL SUBGROUP OF OR EQUAL TO
    1156           0 :         m_aMirrorMap[ 0x22B5 ] = 0x22B4; // CONTAINS AS NORMAL SUBGROUP OR EQUAL TO
    1157           0 :         m_aMirrorMap[ 0x22B6 ] = 0x22B7; // ORIGINAL OF
    1158           0 :         m_aMirrorMap[ 0x22B7 ] = 0x22B6; // IMAGE OF
    1159           0 :         m_aMirrorMap[ 0x22C9 ] = 0x22CA; // LEFT NORMAL FACTOR SEMIDIRECT PRODUCT
    1160           0 :         m_aMirrorMap[ 0x22CA ] = 0x22C9; // RIGHT NORMAL FACTOR SEMIDIRECT PRODUCT
    1161           0 :         m_aMirrorMap[ 0x22CB ] = 0x22CC; // LEFT SEMIDIRECT PRODUCT
    1162           0 :         m_aMirrorMap[ 0x22CC ] = 0x22CB; // RIGHT SEMIDIRECT PRODUCT
    1163           0 :         m_aMirrorMap[ 0x22CD ] = 0x2243; // REVERSED TILDE EQUALS
    1164           0 :         m_aMirrorMap[ 0x22D0 ] = 0x22D1; // DOUBLE SUBSET
    1165           0 :         m_aMirrorMap[ 0x22D1 ] = 0x22D0; // DOUBLE SUPERSET
    1166           0 :         m_aMirrorMap[ 0x22D6 ] = 0x22D7; // LESS-THAN WITH DOT
    1167           0 :         m_aMirrorMap[ 0x22D7 ] = 0x22D6; // GREATER-THAN WITH DOT
    1168           0 :         m_aMirrorMap[ 0x22D8 ] = 0x22D9; // VERY MUCH LESS-THAN
    1169           0 :         m_aMirrorMap[ 0x22D9 ] = 0x22D8; // VERY MUCH GREATER-THAN
    1170           0 :         m_aMirrorMap[ 0x22DA ] = 0x22DB; // LESS-THAN EQUAL TO OR GREATER-THAN
    1171           0 :         m_aMirrorMap[ 0x22DB ] = 0x22DA; // GREATER-THAN EQUAL TO OR LESS-THAN
    1172           0 :         m_aMirrorMap[ 0x22DC ] = 0x22DD; // EQUAL TO OR LESS-THAN
    1173           0 :         m_aMirrorMap[ 0x22DD ] = 0x22DC; // EQUAL TO OR GREATER-THAN
    1174           0 :         m_aMirrorMap[ 0x22DE ] = 0x22DF; // EQUAL TO OR PRECEDES
    1175           0 :         m_aMirrorMap[ 0x22DF ] = 0x22DE; // EQUAL TO OR SUCCEEDS
    1176           0 :         m_aMirrorMap[ 0x22E0 ] = 0x22E1; // [BEST FIT] DOES NOT PRECEDE OR EQUAL
    1177           0 :         m_aMirrorMap[ 0x22E1 ] = 0x22E0; // [BEST FIT] DOES NOT SUCCEED OR EQUAL
    1178           0 :         m_aMirrorMap[ 0x22E2 ] = 0x22E3; // [BEST FIT] NOT SQUARE IMAGE OF OR EQUAL TO
    1179           0 :         m_aMirrorMap[ 0x22E3 ] = 0x22E2; // [BEST FIT] NOT SQUARE ORIGINAL OF OR EQUAL TO
    1180           0 :         m_aMirrorMap[ 0x22E4 ] = 0x22E5; // [BEST FIT] SQUARE IMAGE OF OR NOT EQUAL TO
    1181           0 :         m_aMirrorMap[ 0x22E5 ] = 0x22E4; // [BEST FIT] SQUARE ORIGINAL OF OR NOT EQUAL TO
    1182           0 :         m_aMirrorMap[ 0x22E6 ] = 0x22E7; // [BEST FIT] LESS-THAN BUT NOT EQUIVALENT TO
    1183           0 :         m_aMirrorMap[ 0x22E7 ] = 0x22E6; // [BEST FIT] GREATER-THAN BUT NOT EQUIVALENT TO
    1184           0 :         m_aMirrorMap[ 0x22E8 ] = 0x22E9; // [BEST FIT] PRECEDES BUT NOT EQUIVALENT TO
    1185           0 :         m_aMirrorMap[ 0x22E9 ] = 0x22E8; // [BEST FIT] SUCCEEDS BUT NOT EQUIVALENT TO
    1186           0 :         m_aMirrorMap[ 0x22EA ] = 0x22EB; // [BEST FIT] NOT NORMAL SUBGROUP OF
    1187           0 :         m_aMirrorMap[ 0x22EB ] = 0x22EA; // [BEST FIT] DOES NOT CONTAIN AS NORMAL SUBGROUP
    1188           0 :         m_aMirrorMap[ 0x22EC ] = 0x22ED; // [BEST FIT] NOT NORMAL SUBGROUP OF OR EQUAL TO
    1189           0 :         m_aMirrorMap[ 0x22ED ] = 0x22EC; // [BEST FIT] DOES NOT CONTAIN AS NORMAL SUBGROUP OR EQUAL
    1190           0 :         m_aMirrorMap[ 0x22F0 ] = 0x22F1; // UP RIGHT DIAGONAL ELLIPSIS
    1191           0 :         m_aMirrorMap[ 0x22F1 ] = 0x22F0; // DOWN RIGHT DIAGONAL ELLIPSIS
    1192           0 :         m_aMirrorMap[ 0x22F2 ] = 0x22FA; // ELEMENT OF WITH LONG HORIZONTAL STROKE
    1193           0 :         m_aMirrorMap[ 0x22F3 ] = 0x22FB; // ELEMENT OF WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
    1194           0 :         m_aMirrorMap[ 0x22F4 ] = 0x22FC; // SMALL ELEMENT OF WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
    1195           0 :         m_aMirrorMap[ 0x22F6 ] = 0x22FD; // ELEMENT OF WITH OVERBAR
    1196           0 :         m_aMirrorMap[ 0x22F7 ] = 0x22FE; // SMALL ELEMENT OF WITH OVERBAR
    1197           0 :         m_aMirrorMap[ 0x22FA ] = 0x22F2; // CONTAINS WITH LONG HORIZONTAL STROKE
    1198           0 :         m_aMirrorMap[ 0x22FB ] = 0x22F3; // CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
    1199           0 :         m_aMirrorMap[ 0x22FC ] = 0x22F4; // SMALL CONTAINS WITH VERTICAL BAR AT END OF HORIZONTAL STROKE
    1200           0 :         m_aMirrorMap[ 0x22FD ] = 0x22F6; // CONTAINS WITH OVERBAR
    1201           0 :         m_aMirrorMap[ 0x22FE ] = 0x22F7; // SMALL CONTAINS WITH OVERBAR
    1202           0 :         m_aMirrorMap[ 0x2308 ] = 0x2309; // LEFT CEILING
    1203           0 :         m_aMirrorMap[ 0x2309 ] = 0x2308; // RIGHT CEILING
    1204           0 :         m_aMirrorMap[ 0x230A ] = 0x230B; // LEFT FLOOR
    1205           0 :         m_aMirrorMap[ 0x230B ] = 0x230A; // RIGHT FLOOR
    1206           0 :         m_aMirrorMap[ 0x2329 ] = 0x232A; // LEFT-POINTING ANGLE BRACKET
    1207           0 :         m_aMirrorMap[ 0x232A ] = 0x2329; // RIGHT-POINTING ANGLE BRACKET
    1208           0 :         m_aMirrorMap[ 0x2768 ] = 0x2769; // MEDIUM LEFT PARENTHESIS ORNAMENT
    1209           0 :         m_aMirrorMap[ 0x2769 ] = 0x2768; // MEDIUM RIGHT PARENTHESIS ORNAMENT
    1210           0 :         m_aMirrorMap[ 0x276A ] = 0x276B; // MEDIUM FLATTENED LEFT PARENTHESIS ORNAMENT
    1211           0 :         m_aMirrorMap[ 0x276B ] = 0x276A; // MEDIUM FLATTENED RIGHT PARENTHESIS ORNAMENT
    1212           0 :         m_aMirrorMap[ 0x276C ] = 0x276D; // MEDIUM LEFT-POINTING ANGLE BRACKET ORNAMENT
    1213           0 :         m_aMirrorMap[ 0x276D ] = 0x276C; // MEDIUM RIGHT-POINTING ANGLE BRACKET ORNAMENT
    1214           0 :         m_aMirrorMap[ 0x276E ] = 0x276F; // HEAVY LEFT-POINTING ANGLE QUOTATION MARK ORNAMENT
    1215           0 :         m_aMirrorMap[ 0x276F ] = 0x276E; // HEAVY RIGHT-POINTING ANGLE QUOTATION MARK ORNAMENT
    1216           0 :         m_aMirrorMap[ 0x2770 ] = 0x2771; // HEAVY LEFT-POINTING ANGLE BRACKET ORNAMENT
    1217           0 :         m_aMirrorMap[ 0x2771 ] = 0x2770; // HEAVY RIGHT-POINTING ANGLE BRACKET ORNAMENT
    1218           0 :         m_aMirrorMap[ 0x2772 ] = 0x2773; // LIGHT LEFT TORTOISE SHELL BRACKET
    1219           0 :         m_aMirrorMap[ 0x2773 ] = 0x2772; // LIGHT RIGHT TORTOISE SHELL BRACKET
    1220           0 :         m_aMirrorMap[ 0x2774 ] = 0x2775; // MEDIUM LEFT CURLY BRACKET ORNAMENT
    1221           0 :         m_aMirrorMap[ 0x2775 ] = 0x2774; // MEDIUM RIGHT CURLY BRACKET ORNAMENT
    1222           0 :         m_aMirrorMap[ 0x27C3 ] = 0x27C4; // OPEN SUBSET
    1223           0 :         m_aMirrorMap[ 0x27C4 ] = 0x27C3; // OPEN SUPERSET
    1224           0 :         m_aMirrorMap[ 0x27C5 ] = 0x27C6; // LEFT S-SHAPED BAG DELIMITER
    1225           0 :         m_aMirrorMap[ 0x27C6 ] = 0x27C5; // RIGHT S-SHAPED BAG DELIMITER
    1226           0 :         m_aMirrorMap[ 0x27C8 ] = 0x27C9; // REVERSE SOLIDUS PRECEDING SUBSET
    1227           0 :         m_aMirrorMap[ 0x27C9 ] = 0x27C8; // SUPERSET PRECEDING SOLIDUS
    1228           0 :         m_aMirrorMap[ 0x27D5 ] = 0x27D6; // LEFT OUTER JOIN
    1229           0 :         m_aMirrorMap[ 0x27D6 ] = 0x27D5; // RIGHT OUTER JOIN
    1230           0 :         m_aMirrorMap[ 0x27DD ] = 0x27DE; // LONG RIGHT TACK
    1231           0 :         m_aMirrorMap[ 0x27DE ] = 0x27DD; // LONG LEFT TACK
    1232           0 :         m_aMirrorMap[ 0x27E2 ] = 0x27E3; // WHITE CONCAVE-SIDED DIAMOND WITH LEFTWARDS TICK
    1233           0 :         m_aMirrorMap[ 0x27E3 ] = 0x27E2; // WHITE CONCAVE-SIDED DIAMOND WITH RIGHTWARDS TICK
    1234           0 :         m_aMirrorMap[ 0x27E4 ] = 0x27E5; // WHITE SQUARE WITH LEFTWARDS TICK
    1235           0 :         m_aMirrorMap[ 0x27E5 ] = 0x27E4; // WHITE SQUARE WITH RIGHTWARDS TICK
    1236           0 :         m_aMirrorMap[ 0x27E6 ] = 0x27E7; // MATHEMATICAL LEFT WHITE SQUARE BRACKET
    1237           0 :         m_aMirrorMap[ 0x27E7 ] = 0x27E6; // MATHEMATICAL RIGHT WHITE SQUARE BRACKET
    1238           0 :         m_aMirrorMap[ 0x27E8 ] = 0x27E9; // MATHEMATICAL LEFT ANGLE BRACKET
    1239           0 :         m_aMirrorMap[ 0x27E9 ] = 0x27E8; // MATHEMATICAL RIGHT ANGLE BRACKET
    1240           0 :         m_aMirrorMap[ 0x27EA ] = 0x27EB; // MATHEMATICAL LEFT DOUBLE ANGLE BRACKET
    1241           0 :         m_aMirrorMap[ 0x27EB ] = 0x27EA; // MATHEMATICAL RIGHT DOUBLE ANGLE BRACKET
    1242           0 :         m_aMirrorMap[ 0x27EC ] = 0x27ED; // MATHEMATICAL LEFT WHITE TORTOISE SHELL BRACKET
    1243           0 :         m_aMirrorMap[ 0x27ED ] = 0x27EC; // MATHEMATICAL RIGHT WHITE TORTOISE SHELL BRACKET
    1244           0 :         m_aMirrorMap[ 0x27EE ] = 0x27EF; // MATHEMATICAL LEFT FLATTENED PARENTHESIS
    1245           0 :         m_aMirrorMap[ 0x27EF ] = 0x27EE; // MATHEMATICAL RIGHT FLATTENED PARENTHESIS
    1246           0 :         m_aMirrorMap[ 0x2983 ] = 0x2984; // LEFT WHITE CURLY BRACKET
    1247           0 :         m_aMirrorMap[ 0x2984 ] = 0x2983; // RIGHT WHITE CURLY BRACKET
    1248           0 :         m_aMirrorMap[ 0x2985 ] = 0x2986; // LEFT WHITE PARENTHESIS
    1249           0 :         m_aMirrorMap[ 0x2986 ] = 0x2985; // RIGHT WHITE PARENTHESIS
    1250           0 :         m_aMirrorMap[ 0x2987 ] = 0x2988; // Z NOTATION LEFT IMAGE BRACKET
    1251           0 :         m_aMirrorMap[ 0x2988 ] = 0x2987; // Z NOTATION RIGHT IMAGE BRACKET
    1252           0 :         m_aMirrorMap[ 0x2989 ] = 0x298A; // Z NOTATION LEFT BINDING BRACKET
    1253           0 :         m_aMirrorMap[ 0x298A ] = 0x2989; // Z NOTATION RIGHT BINDING BRACKET
    1254           0 :         m_aMirrorMap[ 0x298B ] = 0x298C; // LEFT SQUARE BRACKET WITH UNDERBAR
    1255           0 :         m_aMirrorMap[ 0x298C ] = 0x298B; // RIGHT SQUARE BRACKET WITH UNDERBAR
    1256           0 :         m_aMirrorMap[ 0x298D ] = 0x2990; // LEFT SQUARE BRACKET WITH TICK IN TOP CORNER
    1257           0 :         m_aMirrorMap[ 0x298E ] = 0x298F; // RIGHT SQUARE BRACKET WITH TICK IN BOTTOM CORNER
    1258           0 :         m_aMirrorMap[ 0x298F ] = 0x298E; // LEFT SQUARE BRACKET WITH TICK IN BOTTOM CORNER
    1259           0 :         m_aMirrorMap[ 0x2990 ] = 0x298D; // RIGHT SQUARE BRACKET WITH TICK IN TOP CORNER
    1260           0 :         m_aMirrorMap[ 0x2991 ] = 0x2992; // LEFT ANGLE BRACKET WITH DOT
    1261           0 :         m_aMirrorMap[ 0x2992 ] = 0x2991; // RIGHT ANGLE BRACKET WITH DOT
    1262           0 :         m_aMirrorMap[ 0x2993 ] = 0x2994; // LEFT ARC LESS-THAN BRACKET
    1263           0 :         m_aMirrorMap[ 0x2994 ] = 0x2993; // RIGHT ARC GREATER-THAN BRACKET
    1264           0 :         m_aMirrorMap[ 0x2995 ] = 0x2996; // DOUBLE LEFT ARC GREATER-THAN BRACKET
    1265           0 :         m_aMirrorMap[ 0x2996 ] = 0x2995; // DOUBLE RIGHT ARC LESS-THAN BRACKET
    1266           0 :         m_aMirrorMap[ 0x2997 ] = 0x2998; // LEFT BLACK TORTOISE SHELL BRACKET
    1267           0 :         m_aMirrorMap[ 0x2998 ] = 0x2997; // RIGHT BLACK TORTOISE SHELL BRACKET
    1268           0 :         m_aMirrorMap[ 0x29B8 ] = 0x2298; // CIRCLED REVERSE SOLIDUS
    1269           0 :         m_aMirrorMap[ 0x29C0 ] = 0x29C1; // CIRCLED LESS-THAN
    1270           0 :         m_aMirrorMap[ 0x29C1 ] = 0x29C0; // CIRCLED GREATER-THAN
    1271           0 :         m_aMirrorMap[ 0x29C4 ] = 0x29C5; // SQUARED RISING DIAGONAL SLASH
    1272           0 :         m_aMirrorMap[ 0x29C5 ] = 0x29C4; // SQUARED FALLING DIAGONAL SLASH
    1273           0 :         m_aMirrorMap[ 0x29CF ] = 0x29D0; // LEFT TRIANGLE BESIDE VERTICAL BAR
    1274           0 :         m_aMirrorMap[ 0x29D0 ] = 0x29CF; // VERTICAL BAR BESIDE RIGHT TRIANGLE
    1275           0 :         m_aMirrorMap[ 0x29D1 ] = 0x29D2; // BOWTIE WITH LEFT HALF BLACK
    1276           0 :         m_aMirrorMap[ 0x29D2 ] = 0x29D1; // BOWTIE WITH RIGHT HALF BLACK
    1277           0 :         m_aMirrorMap[ 0x29D4 ] = 0x29D5; // TIMES WITH LEFT HALF BLACK
    1278           0 :         m_aMirrorMap[ 0x29D5 ] = 0x29D4; // TIMES WITH RIGHT HALF BLACK
    1279           0 :         m_aMirrorMap[ 0x29D8 ] = 0x29D9; // LEFT WIGGLY FENCE
    1280           0 :         m_aMirrorMap[ 0x29D9 ] = 0x29D8; // RIGHT WIGGLY FENCE
    1281           0 :         m_aMirrorMap[ 0x29DA ] = 0x29DB; // LEFT DOUBLE WIGGLY FENCE
    1282           0 :         m_aMirrorMap[ 0x29DB ] = 0x29DA; // RIGHT DOUBLE WIGGLY FENCE
    1283           0 :         m_aMirrorMap[ 0x29F5 ] = 0x2215; // REVERSE SOLIDUS OPERATOR
    1284           0 :         m_aMirrorMap[ 0x29F8 ] = 0x29F9; // BIG SOLIDUS
    1285           0 :         m_aMirrorMap[ 0x29F9 ] = 0x29F8; // BIG REVERSE SOLIDUS
    1286           0 :         m_aMirrorMap[ 0x29FC ] = 0x29FD; // LEFT-POINTING CURVED ANGLE BRACKET
    1287           0 :         m_aMirrorMap[ 0x29FD ] = 0x29FC; // RIGHT-POINTING CURVED ANGLE BRACKET
    1288           0 :         m_aMirrorMap[ 0x2A2B ] = 0x2A2C; // MINUS SIGN WITH FALLING DOTS
    1289           0 :         m_aMirrorMap[ 0x2A2C ] = 0x2A2B; // MINUS SIGN WITH RISING DOTS
    1290           0 :         m_aMirrorMap[ 0x2A2D ] = 0x2A2E; // PLUS SIGN IN LEFT HALF CIRCLE
    1291           0 :         m_aMirrorMap[ 0x2A2E ] = 0x2A2D; // PLUS SIGN IN RIGHT HALF CIRCLE
    1292           0 :         m_aMirrorMap[ 0x2A34 ] = 0x2A35; // MULTIPLICATION SIGN IN LEFT HALF CIRCLE
    1293           0 :         m_aMirrorMap[ 0x2A35 ] = 0x2A34; // MULTIPLICATION SIGN IN RIGHT HALF CIRCLE
    1294           0 :         m_aMirrorMap[ 0x2A3C ] = 0x2A3D; // INTERIOR PRODUCT
    1295           0 :         m_aMirrorMap[ 0x2A3D ] = 0x2A3C; // RIGHTHAND INTERIOR PRODUCT
    1296           0 :         m_aMirrorMap[ 0x2A64 ] = 0x2A65; // Z NOTATION DOMAIN ANTIRESTRICTION
    1297           0 :         m_aMirrorMap[ 0x2A65 ] = 0x2A64; // Z NOTATION RANGE ANTIRESTRICTION
    1298           0 :         m_aMirrorMap[ 0x2A79 ] = 0x2A7A; // LESS-THAN WITH CIRCLE INSIDE
    1299           0 :         m_aMirrorMap[ 0x2A7A ] = 0x2A79; // GREATER-THAN WITH CIRCLE INSIDE
    1300           0 :         m_aMirrorMap[ 0x2A7D ] = 0x2A7E; // LESS-THAN OR SLANTED EQUAL TO
    1301           0 :         m_aMirrorMap[ 0x2A7E ] = 0x2A7D; // GREATER-THAN OR SLANTED EQUAL TO
    1302           0 :         m_aMirrorMap[ 0x2A7F ] = 0x2A80; // LESS-THAN OR SLANTED EQUAL TO WITH DOT INSIDE
    1303           0 :         m_aMirrorMap[ 0x2A80 ] = 0x2A7F; // GREATER-THAN OR SLANTED EQUAL TO WITH DOT INSIDE
    1304           0 :         m_aMirrorMap[ 0x2A81 ] = 0x2A82; // LESS-THAN OR SLANTED EQUAL TO WITH DOT ABOVE
    1305           0 :         m_aMirrorMap[ 0x2A82 ] = 0x2A81; // GREATER-THAN OR SLANTED EQUAL TO WITH DOT ABOVE
    1306           0 :         m_aMirrorMap[ 0x2A83 ] = 0x2A84; // LESS-THAN OR SLANTED EQUAL TO WITH DOT ABOVE RIGHT
    1307           0 :         m_aMirrorMap[ 0x2A84 ] = 0x2A83; // GREATER-THAN OR SLANTED EQUAL TO WITH DOT ABOVE LEFT
    1308           0 :         m_aMirrorMap[ 0x2A8B ] = 0x2A8C; // LESS-THAN ABOVE DOUBLE-LINE EQUAL ABOVE GREATER-THAN
    1309           0 :         m_aMirrorMap[ 0x2A8C ] = 0x2A8B; // GREATER-THAN ABOVE DOUBLE-LINE EQUAL ABOVE LESS-THAN
    1310           0 :         m_aMirrorMap[ 0x2A91 ] = 0x2A92; // LESS-THAN ABOVE GREATER-THAN ABOVE DOUBLE-LINE EQUAL
    1311           0 :         m_aMirrorMap[ 0x2A92 ] = 0x2A91; // GREATER-THAN ABOVE LESS-THAN ABOVE DOUBLE-LINE EQUAL
    1312           0 :         m_aMirrorMap[ 0x2A93 ] = 0x2A94; // LESS-THAN ABOVE SLANTED EQUAL ABOVE GREATER-THAN ABOVE SLANTED EQUAL
    1313           0 :         m_aMirrorMap[ 0x2A94 ] = 0x2A93; // GREATER-THAN ABOVE SLANTED EQUAL ABOVE LESS-THAN ABOVE SLANTED EQUAL
    1314           0 :         m_aMirrorMap[ 0x2A95 ] = 0x2A96; // SLANTED EQUAL TO OR LESS-THAN
    1315           0 :         m_aMirrorMap[ 0x2A96 ] = 0x2A95; // SLANTED EQUAL TO OR GREATER-THAN
    1316           0 :         m_aMirrorMap[ 0x2A97 ] = 0x2A98; // SLANTED EQUAL TO OR LESS-THAN WITH DOT INSIDE
    1317           0 :         m_aMirrorMap[ 0x2A98 ] = 0x2A97; // SLANTED EQUAL TO OR GREATER-THAN WITH DOT INSIDE
    1318           0 :         m_aMirrorMap[ 0x2A99 ] = 0x2A9A; // DOUBLE-LINE EQUAL TO OR LESS-THAN
    1319           0 :         m_aMirrorMap[ 0x2A9A ] = 0x2A99; // DOUBLE-LINE EQUAL TO OR GREATER-THAN
    1320           0 :         m_aMirrorMap[ 0x2A9B ] = 0x2A9C; // DOUBLE-LINE SLANTED EQUAL TO OR LESS-THAN
    1321           0 :         m_aMirrorMap[ 0x2A9C ] = 0x2A9B; // DOUBLE-LINE SLANTED EQUAL TO OR GREATER-THAN
    1322           0 :         m_aMirrorMap[ 0x2AA1 ] = 0x2AA2; // DOUBLE NESTED LESS-THAN
    1323           0 :         m_aMirrorMap[ 0x2AA2 ] = 0x2AA1; // DOUBLE NESTED GREATER-THAN
    1324           0 :         m_aMirrorMap[ 0x2AA6 ] = 0x2AA7; // LESS-THAN CLOSED BY CURVE
    1325           0 :         m_aMirrorMap[ 0x2AA7 ] = 0x2AA6; // GREATER-THAN CLOSED BY CURVE
    1326           0 :         m_aMirrorMap[ 0x2AA8 ] = 0x2AA9; // LESS-THAN CLOSED BY CURVE ABOVE SLANTED EQUAL
    1327           0 :         m_aMirrorMap[ 0x2AA9 ] = 0x2AA8; // GREATER-THAN CLOSED BY CURVE ABOVE SLANTED EQUAL
    1328           0 :         m_aMirrorMap[ 0x2AAA ] = 0x2AAB; // SMALLER THAN
    1329           0 :         m_aMirrorMap[ 0x2AAB ] = 0x2AAA; // LARGER THAN
    1330           0 :         m_aMirrorMap[ 0x2AAC ] = 0x2AAD; // SMALLER THAN OR EQUAL TO
    1331           0 :         m_aMirrorMap[ 0x2AAD ] = 0x2AAC; // LARGER THAN OR EQUAL TO
    1332           0 :         m_aMirrorMap[ 0x2AAF ] = 0x2AB0; // PRECEDES ABOVE SINGLE-LINE EQUALS SIGN
    1333           0 :         m_aMirrorMap[ 0x2AB0 ] = 0x2AAF; // SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN
    1334           0 :         m_aMirrorMap[ 0x2AB3 ] = 0x2AB4; // PRECEDES ABOVE EQUALS SIGN
    1335           0 :         m_aMirrorMap[ 0x2AB4 ] = 0x2AB3; // SUCCEEDS ABOVE EQUALS SIGN
    1336           0 :         m_aMirrorMap[ 0x2ABB ] = 0x2ABC; // DOUBLE PRECEDES
    1337           0 :         m_aMirrorMap[ 0x2ABC ] = 0x2ABB; // DOUBLE SUCCEEDS
    1338           0 :         m_aMirrorMap[ 0x2ABD ] = 0x2ABE; // SUBSET WITH DOT
    1339           0 :         m_aMirrorMap[ 0x2ABE ] = 0x2ABD; // SUPERSET WITH DOT
    1340           0 :         m_aMirrorMap[ 0x2ABF ] = 0x2AC0; // SUBSET WITH PLUS SIGN BELOW
    1341           0 :         m_aMirrorMap[ 0x2AC0 ] = 0x2ABF; // SUPERSET WITH PLUS SIGN BELOW
    1342           0 :         m_aMirrorMap[ 0x2AC1 ] = 0x2AC2; // SUBSET WITH MULTIPLICATION SIGN BELOW
    1343           0 :         m_aMirrorMap[ 0x2AC2 ] = 0x2AC1; // SUPERSET WITH MULTIPLICATION SIGN BELOW
    1344           0 :         m_aMirrorMap[ 0x2AC3 ] = 0x2AC4; // SUBSET OF OR EQUAL TO WITH DOT ABOVE
    1345           0 :         m_aMirrorMap[ 0x2AC4 ] = 0x2AC3; // SUPERSET OF OR EQUAL TO WITH DOT ABOVE
    1346           0 :         m_aMirrorMap[ 0x2AC5 ] = 0x2AC6; // SUBSET OF ABOVE EQUALS SIGN
    1347           0 :         m_aMirrorMap[ 0x2AC6 ] = 0x2AC5; // SUPERSET OF ABOVE EQUALS SIGN
    1348           0 :         m_aMirrorMap[ 0x2ACD ] = 0x2ACE; // SQUARE LEFT OPEN BOX OPERATOR
    1349           0 :         m_aMirrorMap[ 0x2ACE ] = 0x2ACD; // SQUARE RIGHT OPEN BOX OPERATOR
    1350           0 :         m_aMirrorMap[ 0x2ACF ] = 0x2AD0; // CLOSED SUBSET
    1351           0 :         m_aMirrorMap[ 0x2AD0 ] = 0x2ACF; // CLOSED SUPERSET
    1352           0 :         m_aMirrorMap[ 0x2AD1 ] = 0x2AD2; // CLOSED SUBSET OR EQUAL TO
    1353           0 :         m_aMirrorMap[ 0x2AD2 ] = 0x2AD1; // CLOSED SUPERSET OR EQUAL TO
    1354           0 :         m_aMirrorMap[ 0x2AD3 ] = 0x2AD4; // SUBSET ABOVE SUPERSET
    1355           0 :         m_aMirrorMap[ 0x2AD4 ] = 0x2AD3; // SUPERSET ABOVE SUBSET
    1356           0 :         m_aMirrorMap[ 0x2AD5 ] = 0x2AD6; // SUBSET ABOVE SUBSET
    1357           0 :         m_aMirrorMap[ 0x2AD6 ] = 0x2AD5; // SUPERSET ABOVE SUPERSET
    1358           0 :         m_aMirrorMap[ 0x2ADE ] = 0x22A6; // SHORT LEFT TACK
    1359           0 :         m_aMirrorMap[ 0x2AE3 ] = 0x22A9; // DOUBLE VERTICAL BAR LEFT TURNSTILE
    1360           0 :         m_aMirrorMap[ 0x2AE4 ] = 0x22A8; // VERTICAL BAR DOUBLE LEFT TURNSTILE
    1361           0 :         m_aMirrorMap[ 0x2AE5 ] = 0x22AB; // DOUBLE VERTICAL BAR DOUBLE LEFT TURNSTILE
    1362           0 :         m_aMirrorMap[ 0x2AEC ] = 0x2AED; // DOUBLE STROKE NOT SIGN
    1363           0 :         m_aMirrorMap[ 0x2AED ] = 0x2AEC; // REVERSED DOUBLE STROKE NOT SIGN
    1364           0 :         m_aMirrorMap[ 0x2AF7 ] = 0x2AF8; // TRIPLE NESTED LESS-THAN
    1365           0 :         m_aMirrorMap[ 0x2AF8 ] = 0x2AF7; // TRIPLE NESTED GREATER-THAN
    1366           0 :         m_aMirrorMap[ 0x2AF9 ] = 0x2AFA; // DOUBLE-LINE SLANTED LESS-THAN OR EQUAL TO
    1367           0 :         m_aMirrorMap[ 0x2AFA ] = 0x2AF9; // DOUBLE-LINE SLANTED GREATER-THAN OR EQUAL TO
    1368           0 :         m_aMirrorMap[ 0x2E02 ] = 0x2E03; // LEFT SUBSTITUTION BRACKET
    1369           0 :         m_aMirrorMap[ 0x2E03 ] = 0x2E02; // RIGHT SUBSTITUTION BRACKET
    1370           0 :         m_aMirrorMap[ 0x2E04 ] = 0x2E05; // LEFT DOTTED SUBSTITUTION BRACKET
    1371           0 :         m_aMirrorMap[ 0x2E05 ] = 0x2E04; // RIGHT DOTTED SUBSTITUTION BRACKET
    1372           0 :         m_aMirrorMap[ 0x2E09 ] = 0x2E0A; // LEFT TRANSPOSITION BRACKET
    1373           0 :         m_aMirrorMap[ 0x2E0A ] = 0x2E09; // RIGHT TRANSPOSITION BRACKET
    1374           0 :         m_aMirrorMap[ 0x2E0C ] = 0x2E0D; // LEFT RAISED OMISSION BRACKET
    1375           0 :         m_aMirrorMap[ 0x2E0D ] = 0x2E0C; // RIGHT RAISED OMISSION BRACKET
    1376           0 :         m_aMirrorMap[ 0x2E1C ] = 0x2E1D; // LEFT LOW PARAPHRASE BRACKET
    1377           0 :         m_aMirrorMap[ 0x2E1D ] = 0x2E1C; // RIGHT LOW PARAPHRASE BRACKET
    1378           0 :         m_aMirrorMap[ 0x2E20 ] = 0x2E21; // LEFT VERTICAL BAR WITH QUILL
    1379           0 :         m_aMirrorMap[ 0x2E21 ] = 0x2E20; // RIGHT VERTICAL BAR WITH QUILL
    1380           0 :         m_aMirrorMap[ 0x2E22 ] = 0x2E23; // TOP LEFT HALF BRACKET
    1381           0 :         m_aMirrorMap[ 0x2E23 ] = 0x2E22; // TOP RIGHT HALF BRACKET
    1382           0 :         m_aMirrorMap[ 0x2E24 ] = 0x2E25; // BOTTOM LEFT HALF BRACKET
    1383           0 :         m_aMirrorMap[ 0x2E25 ] = 0x2E24; // BOTTOM RIGHT HALF BRACKET
    1384           0 :         m_aMirrorMap[ 0x2E26 ] = 0x2E27; // LEFT SIDEWAYS U BRACKET
    1385           0 :         m_aMirrorMap[ 0x2E27 ] = 0x2E26; // RIGHT SIDEWAYS U BRACKET
    1386           0 :         m_aMirrorMap[ 0x2E28 ] = 0x2E29; // LEFT DOUBLE PARENTHESIS
    1387           0 :         m_aMirrorMap[ 0x2E29 ] = 0x2E28; // RIGHT DOUBLE PARENTHESIS
    1388           0 :         m_aMirrorMap[ 0x3008 ] = 0x3009; // LEFT ANGLE BRACKET
    1389           0 :         m_aMirrorMap[ 0x3009 ] = 0x3008; // RIGHT ANGLE BRACKET
    1390           0 :         m_aMirrorMap[ 0x300A ] = 0x300B; // LEFT DOUBLE ANGLE BRACKET
    1391           0 :         m_aMirrorMap[ 0x300B ] = 0x300A; // RIGHT DOUBLE ANGLE BRACKET
    1392           0 :         m_aMirrorMap[ 0x300C ] = 0x300D; // [BEST FIT] LEFT CORNER BRACKET
    1393           0 :         m_aMirrorMap[ 0x300D ] = 0x300C; // [BEST FIT] RIGHT CORNER BRACKET
    1394           0 :         m_aMirrorMap[ 0x300E ] = 0x300F; // [BEST FIT] LEFT WHITE CORNER BRACKET
    1395           0 :         m_aMirrorMap[ 0x300F ] = 0x300E; // [BEST FIT] RIGHT WHITE CORNER BRACKET
    1396           0 :         m_aMirrorMap[ 0x3010 ] = 0x3011; // LEFT BLACK LENTICULAR BRACKET
    1397           0 :         m_aMirrorMap[ 0x3011 ] = 0x3010; // RIGHT BLACK LENTICULAR BRACKET
    1398           0 :         m_aMirrorMap[ 0x3014 ] = 0x3015; // LEFT TORTOISE SHELL BRACKET
    1399           0 :         m_aMirrorMap[ 0x3015 ] = 0x3014; // RIGHT TORTOISE SHELL BRACKET
    1400           0 :         m_aMirrorMap[ 0x3016 ] = 0x3017; // LEFT WHITE LENTICULAR BRACKET
    1401           0 :         m_aMirrorMap[ 0x3017 ] = 0x3016; // RIGHT WHITE LENTICULAR BRACKET
    1402           0 :         m_aMirrorMap[ 0x3018 ] = 0x3019; // LEFT WHITE TORTOISE SHELL BRACKET
    1403           0 :         m_aMirrorMap[ 0x3019 ] = 0x3018; // RIGHT WHITE TORTOISE SHELL BRACKET
    1404           0 :         m_aMirrorMap[ 0x301A ] = 0x301B; // LEFT WHITE SQUARE BRACKET
    1405           0 :         m_aMirrorMap[ 0x301B ] = 0x301A; // RIGHT WHITE SQUARE BRACKET
    1406           0 :         m_aMirrorMap[ 0xFE59 ] = 0xFE5A; // SMALL LEFT PARENTHESIS
    1407           0 :         m_aMirrorMap[ 0xFE5A ] = 0xFE59; // SMALL RIGHT PARENTHESIS
    1408           0 :         m_aMirrorMap[ 0xFE5B ] = 0xFE5C; // SMALL LEFT CURLY BRACKET
    1409           0 :         m_aMirrorMap[ 0xFE5C ] = 0xFE5B; // SMALL RIGHT CURLY BRACKET
    1410           0 :         m_aMirrorMap[ 0xFE5D ] = 0xFE5E; // SMALL LEFT TORTOISE SHELL BRACKET
    1411           0 :         m_aMirrorMap[ 0xFE5E ] = 0xFE5D; // SMALL RIGHT TORTOISE SHELL BRACKET
    1412           0 :         m_aMirrorMap[ 0xFE64 ] = 0xFE65; // SMALL LESS-THAN SIGN
    1413           0 :         m_aMirrorMap[ 0xFE65 ] = 0xFE64; // SMALL GREATER-THAN SIGN
    1414           0 :         m_aMirrorMap[ 0xFF08 ] = 0xFF09; // FULLWIDTH LEFT PARENTHESIS
    1415           0 :         m_aMirrorMap[ 0xFF09 ] = 0xFF08; // FULLWIDTH RIGHT PARENTHESIS
    1416           0 :         m_aMirrorMap[ 0xFF1C ] = 0xFF1E; // FULLWIDTH LESS-THAN SIGN
    1417           0 :         m_aMirrorMap[ 0xFF1E ] = 0xFF1C; // FULLWIDTH GREATER-THAN SIGN
    1418           0 :         m_aMirrorMap[ 0xFF3B ] = 0xFF3D; // FULLWIDTH LEFT SQUARE BRACKET
    1419           0 :         m_aMirrorMap[ 0xFF3D ] = 0xFF3B; // FULLWIDTH RIGHT SQUARE BRACKET
    1420           0 :         m_aMirrorMap[ 0xFF5B ] = 0xFF5D; // FULLWIDTH LEFT CURLY BRACKET
    1421           0 :         m_aMirrorMap[ 0xFF5D ] = 0xFF5B; // FULLWIDTH RIGHT CURLY BRACKET
    1422           0 :         m_aMirrorMap[ 0xFF5F ] = 0xFF60; // FULLWIDTH LEFT WHITE PARENTHESIS
    1423           0 :         m_aMirrorMap[ 0xFF60 ] = 0xFF5F; // FULLWIDTH RIGHT WHITE PARENTHESIS
    1424           0 :         m_aMirrorMap[ 0xFF62 ] = 0xFF63; // [BEST FIT] HALFWIDTH LEFT CORNER BRACKET
    1425           0 :         m_aMirrorMap[ 0xFF63 ] = 0xFF62; // [BEST FIT] HALFWIDTH RIGHT CORNER BRACKET
    1426             :     }
    1427           0 : }
    1428             : 
    1429             : }
    1430             : 
    1431             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10