LCOV - code coverage report
Current view: top level - sw/source/filter/ww8 - docxattributeoutput.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 24 25 96.0 %
Date: 2014-11-03 Functions: 24 27 88.9 %
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             : #ifndef INCLUDED_SW_SOURCE_FILTER_WW8_DOCXATTRIBUTEOUTPUT_HXX
      21             : #define INCLUDED_SW_SOURCE_FILTER_WW8_DOCXATTRIBUTEOUTPUT_HXX
      22             : 
      23             : #include "attributeoutputbase.hxx"
      24             : #include "fields.hxx"
      25             : #include "IMark.hxx"
      26             : #include "docxexport.hxx"
      27             : 
      28             : #include <sax/fshelper.hxx>
      29             : #include <sax/fastattribs.hxx>
      30             : #include <vcl/vclenum.hxx>
      31             : #include <svx/xenum.hxx>
      32             : 
      33             : #include <fldbas.hxx>
      34             : 
      35             : #include <vector>
      36             : #include <boost/scoped_ptr.hpp>
      37             : #include <boost/optional.hpp>
      38             : #include <oox/export/vmlexport.hxx>
      39             : #include <oox/export/drawingml.hxx>
      40             : #include <docxtablestyleexport.hxx>
      41             : 
      42             : #include <com/sun/star/table/BorderLine2.hpp>
      43             : #include <com/sun/star/drawing/FillStyle.hpp>
      44             : 
      45             : class SwGrfNode;
      46             : class SdrObject;
      47             : 
      48             : namespace docx { class FootnotesList; }
      49             : namespace oox { namespace drawingml { class DrawingML; } }
      50             : 
      51        1958 : struct FieldInfos
      52             : {
      53             :     const SwField*    pField;
      54             :     const ::sw::mark::IFieldmark* pFieldmark;
      55             :     ww::eField  eType;
      56             :     bool        bOpen;
      57             :     bool        bClose;
      58             :     OUString    sCmd;
      59         608 :     FieldInfos() : pField(NULL), pFieldmark(NULL), eType(ww::eUNKNOWN), bOpen(false), bClose(false){}
      60             : };
      61             : 
      62             : enum DocxColBreakStatus
      63             : {
      64             :     COLBRK_NONE,
      65             :     COLBRK_POSTPONE,
      66             :     COLBRK_WRITE
      67             : };
      68             : 
      69             : /**
      70             :  * A structure that holds information about the options selected
      71             :  * when outputting a border to DOCX.
      72             :  *
      73             :  * There are 3 functions that initialize this structure:
      74             :  * - lcl_getTableDefaultBorderOptions - retrieves the options for when outputting table default borders
      75             :  * - lcl_getTableCellBorderOptions    - retrieves the options for when outputting table cell borders
      76             :  * - lcl_getBoxBorderOptions          - retrieves the options for when outputting box borders
      77             :  *
      78             :  */
      79             : struct OutputBorderOptions
      80             : {
      81             :     sal_Int32           tag;
      82             :     bool                bUseStartEnd;
      83             :     bool                bWriteTag;
      84             :     bool                bWriteInsideHV;
      85             :     bool                bWriteDistance;
      86             :     SvxShadowLocation   aShadowLocation;
      87             :     bool                bCheckDistanceSize;
      88             : 
      89        3530 :     OutputBorderOptions() : tag(0), bUseStartEnd(false), bWriteTag(true), bWriteInsideHV(false), bWriteDistance(false), aShadowLocation(SVX_SHADOW_NONE), bCheckDistanceSize(false) {}
      90             : };
      91             : 
      92             : /**
      93             :  * A structure that holds information about the page margins.
      94             :  *
      95             :  */
      96             : struct PageMargins
      97             : {
      98             :     sal_uInt16 nPageMarginLeft;
      99             :     sal_uInt16 nPageMarginRight;
     100             :     sal_uInt16 nPageMarginTop;
     101             :     sal_uInt16 nPageMarginBottom;
     102             : 
     103         860 :     PageMargins() : nPageMarginLeft(0), nPageMarginRight(0), nPageMarginTop(0), nPageMarginBottom(0) {}
     104             : };
     105             : 
     106             : /**
     107             :  * All the information that should be stashed away when we're in the middle of
     108             :  * of a table export and still have to do something else, e.g. export a shape.
     109             :  */
     110        2232 : struct DocxTableExportContext
     111             : {
     112             :     ww8::WW8TableInfo::Pointer_t m_pTableInfo;
     113             :     bool m_bTableCellOpen;
     114             :     sal_uInt32 m_nTableDepth;
     115             : };
     116             : 
     117             : /**
     118             :  * A structure that holds flags for the table export.
     119             :  */
     120         860 : struct TableReference
     121             : {
     122             :     /// Remember if we are in an open cell, or not.
     123             :     bool m_bTableCellOpen;
     124             : 
     125             :     /// If paragraph sdt got opened in this table cell.
     126             :     bool m_bTableCellParaSdtOpen;
     127             : 
     128             :     /// Remember the current table depth.
     129             :     sal_uInt32 m_nTableDepth;
     130             : 
     131             :     ww8::WW8TableNodeInfoInner::Pointer_t m_pOldTablepInner;
     132             : 
     133         860 :     TableReference()
     134             :         : m_bTableCellOpen(false),
     135             :         m_bTableCellParaSdtOpen(false),
     136         860 :         m_nTableDepth(0)
     137             :     {
     138         860 :     }
     139             : };
     140             : 
     141             : /// The class that has handlers for various resource types when exporting as DOCX.
     142             : class DocxAttributeOutput : public AttributeOutputBase, public oox::vml::VMLTextExport, public oox::drawingml::DMLTextExport
     143             : {
     144             : public:
     145             :     /// Export the state of RTL/CJK.
     146             :     virtual void RTLAndCJKState( bool bIsRTL, sal_uInt16 nScript ) SAL_OVERRIDE;
     147             : 
     148             :     /// Start of the paragraph.
     149             :     virtual void StartParagraph( ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo ) SAL_OVERRIDE;
     150             : 
     151             :     /// End of the paragraph.
     152             :     virtual void EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner ) SAL_OVERRIDE;
     153             : 
     154             :     /// Empty paragraph.
     155             :     virtual void EmptyParagraph() SAL_OVERRIDE;
     156             : 
     157             :     /// Called in order to output section breaks.
     158             :     virtual void SectionBreaks(const SwTxtNode& rNode) SAL_OVERRIDE;
     159             : 
     160             :     /// Called before we start outputting the attributes.
     161             :     virtual void StartParagraphProperties() SAL_OVERRIDE;
     162             : 
     163             :     /// Called after we end outputting the attributes.
     164             :     virtual void EndParagraphProperties(const SfxItemSet& rParagraphMarkerProperties, const SwRedlineData* pRedlineData, const SwRedlineData* pRedlineParagraphMarkerDeleted, const SwRedlineData* pRedlineParagraphMarkerInserted) SAL_OVERRIDE;
     165             : 
     166             :     /// Start of the text run.
     167             :     virtual void StartRun( const SwRedlineData* pRedlineData, bool bSingleEmptyRun = false ) SAL_OVERRIDE;
     168             : 
     169             :     /// End of the text run.
     170             :     virtual void EndRun() SAL_OVERRIDE;
     171             : 
     172             :     /// Called before we start outputting the attributes.
     173             :     virtual void StartRunProperties() SAL_OVERRIDE;
     174             : 
     175             :     /// Called after we end outputting the attributes.
     176             :     virtual void EndRunProperties( const SwRedlineData* pRedlineData ) SAL_OVERRIDE;
     177             : 
     178             :     virtual void FootnoteEndnoteRefTag() SAL_OVERRIDE;
     179             : 
     180             :     virtual void SectFootnoteEndnotePr() SAL_OVERRIDE;
     181             : 
     182             :     virtual void WritePostitFieldReference() SAL_OVERRIDE;
     183             : 
     184             :     /// Output text (inside a run).
     185             :     virtual void RunText( const OUString& rText, rtl_TextEncoding eCharSet = RTL_TEXTENCODING_UTF8 ) SAL_OVERRIDE;
     186             : 
     187             :     /// Output text (without markup).
     188             :     virtual void RawText( const OUString& rText, bool bForceUnicode, rtl_TextEncoding eCharSet ) SAL_OVERRIDE;
     189             : 
     190             :     /// Output ruby start.
     191             :     virtual void StartRuby( const SwTxtNode& rNode, sal_Int32 nPos, const SwFmtRuby& rRuby ) SAL_OVERRIDE;
     192             : 
     193             :     /// Output ruby end.
     194             :     virtual void EndRuby() SAL_OVERRIDE;
     195             : 
     196             :     /// Output URL start.
     197             :     virtual bool StartURL( const OUString& rUrl, const OUString& rTarget ) SAL_OVERRIDE;
     198             : 
     199             :     /// Output URL end.
     200             :     virtual bool EndURL(bool) SAL_OVERRIDE;
     201             : 
     202             :     virtual void FieldVanish( const OUString& rTxt, ww::eField eType ) SAL_OVERRIDE;
     203             : 
     204             :     /// Output redlining.
     205             :     ///
     206             :     /// The common attribute that can be among the run properties.
     207             :     virtual void Redline( const SwRedlineData* pRedline ) SAL_OVERRIDE;
     208             : 
     209             :     /// Output redlining.
     210             :     ///
     211             :     /// Start of the tag that encloses the run, fills the info according to
     212             :     /// the value of pRedlineData.
     213             :     void StartRedline( const SwRedlineData * pRedlineData );
     214             : 
     215             :     /// Output redlining.
     216             :     ///
     217             :     /// End of the tag that encloses the run.
     218             :     void EndRedline( const SwRedlineData * pRedlineData );
     219             : 
     220             :     virtual void SetStateOfFlyFrame( FlyProcessingState nStateOfFlyFrame ) SAL_OVERRIDE;
     221             :     virtual void SetAnchorIsLinkedToNode( bool bAnchorLinkedToNode = false ) SAL_OVERRIDE;
     222             :     virtual bool IsFlyProcessingPostponed() SAL_OVERRIDE;
     223             :     virtual void ResetFlyProcessingFlag() SAL_OVERRIDE;
     224             : 
     225             :     virtual void FormatDrop( const SwTxtNode& rNode, const SwFmtDrop& rSwFmtDrop, sal_uInt16 nStyle, ww8::WW8TableNodeInfo::Pointer_t pTextNodeInfo, ww8::WW8TableNodeInfoInner::Pointer_t pTextNodeInfoInner ) SAL_OVERRIDE;
     226             : 
     227             :     /// Output style.
     228             :     virtual void ParagraphStyle( sal_uInt16 nStyle ) SAL_OVERRIDE;
     229             : 
     230             :     virtual void TableInfoCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) SAL_OVERRIDE;
     231             :     virtual void TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) SAL_OVERRIDE;
     232             :     virtual void TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) SAL_OVERRIDE;
     233             :     virtual void TableDefaultBorders( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) SAL_OVERRIDE;
     234             :     virtual void TableDefaultCellMargins( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
     235             :     virtual void TableBackgrounds( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) SAL_OVERRIDE;
     236             :     virtual void TableRowRedline( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) SAL_OVERRIDE;
     237             :     virtual void TableCellRedline( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) SAL_OVERRIDE;
     238             :     virtual void TableHeight( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) SAL_OVERRIDE;
     239             :     virtual void TableCanSplit( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) SAL_OVERRIDE;
     240             :     virtual void TableBidi( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) SAL_OVERRIDE;
     241             :     virtual void TableVerticalCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) SAL_OVERRIDE;
     242             :     virtual void TableNodeInfo( ww8::WW8TableNodeInfo::Pointer_t pNodeInfo ) SAL_OVERRIDE;
     243             :     virtual void TableNodeInfoInner( ww8::WW8TableNodeInfoInner::Pointer_t pNodeInfoInner ) SAL_OVERRIDE;
     244             :     virtual void TableOrientation( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) SAL_OVERRIDE;
     245             :     virtual void TableSpacing( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner ) SAL_OVERRIDE;
     246             :     virtual void TableRowEnd( sal_uInt32 nDepth = 1 ) SAL_OVERRIDE;
     247             : 
     248             :     /// Start of the styles table.
     249             :     virtual void StartStyles() SAL_OVERRIDE;
     250             : 
     251             :     /// End of the styles table.
     252             :     virtual void EndStyles( sal_uInt16 nNumberOfStyles ) SAL_OVERRIDE;
     253             : 
     254             :     /// Write default style.
     255             :     virtual void DefaultStyle( sal_uInt16 nStyle ) SAL_OVERRIDE;
     256             : 
     257             :     /// Write Doc Defaults
     258             :     void DocDefaults( );
     259             : 
     260             :     /// Write latent styles.
     261             :     void LatentStyles();
     262             : 
     263             :     /** Similar to OutputItem(), but write something only if it is not the default.
     264             : 
     265             :         This is to output the docDefaults, and we should write something out
     266             :         only in case it is not what MSO already uses for the document by default.
     267             :     */
     268             :     void OutputDefaultItem(const SfxPoolItem& rHt);
     269             : 
     270             :     /// Start of a style in the styles table.
     271             :     virtual void StartStyle( const OUString& rName, StyleType eType,
     272             :             sal_uInt16 nBase, sal_uInt16 nNext, sal_uInt16 nWwId, sal_uInt16 nId,
     273             :             bool bAutoUpdate ) SAL_OVERRIDE;
     274             : 
     275             :     /// End of a style in the styles table.
     276             :     virtual void EndStyle() SAL_OVERRIDE;
     277             : 
     278             :     /// Start of (paragraph or run) properties of a style.
     279             :     virtual void StartStyleProperties( bool bParProp, sal_uInt16 nStyle ) SAL_OVERRIDE;
     280             : 
     281             :     /// End of (paragraph or run) properties of a style.
     282             :     virtual void EndStyleProperties( bool bParProp ) SAL_OVERRIDE;
     283             : 
     284             :     /// Numbering rule and Id.
     285             :     virtual void OutlineNumbering( sal_uInt8 nLvl, const SwNumFmt &rNFmt, const SwFmt &rFmt ) SAL_OVERRIDE;
     286             : 
     287             :     /// Page break
     288             :     /// As a paragraph property - the paragraph should be on the next page.
     289             :     virtual void PageBreakBefore( bool bBreak ) SAL_OVERRIDE;
     290             : 
     291             :     /// Write a section break
     292             :     /// msword::ColumnBreak or msword::PageBreak
     293             :     virtual void SectionBreak( sal_uInt8 nC, const WW8_SepInfo* pSectionInfo = NULL ) SAL_OVERRIDE;
     294             : 
     295             :     /// Start of the section properties.
     296             :     virtual void StartSection() SAL_OVERRIDE;
     297             : 
     298             :     /// End of the section properties.
     299             :     virtual void EndSection() SAL_OVERRIDE;
     300             : 
     301             :     /// Protection of forms.
     302             :     virtual void SectionFormProtection( bool bProtected ) SAL_OVERRIDE;
     303             : 
     304             :     /// Numbering of the lines in the document.
     305             :     virtual void SectionLineNumbering( sal_uLong nRestartNo, const SwLineNumberInfo& rLnNumInfo ) SAL_OVERRIDE;
     306             : 
     307             :     /// Has different headers/footers for the title page.
     308             :     virtual void SectionTitlePage() SAL_OVERRIDE;
     309             : 
     310             :     /// Description of the page borders.
     311             :     virtual void SectionPageBorders( const SwFrmFmt* pFmt, const SwFrmFmt* pFirstPageFmt ) SAL_OVERRIDE;
     312             : 
     313             :     /// Columns populated from right/numbers on the right side?
     314             :     virtual void SectionBiDi( bool bBiDi ) SAL_OVERRIDE;
     315             : 
     316             :     /// The style of the page numbers.
     317             :     ///
     318             :     virtual void SectionPageNumbering( sal_uInt16 nNumType, ::boost::optional<sal_uInt16> oPageRestartNumber ) SAL_OVERRIDE;
     319             : 
     320             :     /// The type of breaking.
     321             :     virtual void SectionType( sal_uInt8 nBreakCode ) SAL_OVERRIDE;
     322             : 
     323             :     /// Start the font.
     324             :     void StartFont( const OUString& rFamilyName ) const;
     325             : 
     326             :     /// End the font.
     327             :     void EndFont() const;
     328             : 
     329             :     /// Alternate name for the font.
     330             :     void FontAlternateName( const OUString& rName ) const;
     331             : 
     332             :     /// Font charset.
     333             :     void FontCharset( sal_uInt8 nCharSet, rtl_TextEncoding nEncoding ) const;
     334             : 
     335             :     /// Font family.
     336             :     void FontFamilyType( FontFamily eFamily ) const;
     337             : 
     338             :     /// Font pitch.
     339             :     void FontPitchType( FontPitch ePitch ) const;
     340             : 
     341             :     /// Write out the font into the document, if it's an embedded font.
     342             :     void EmbedFont( const OUString& name, FontFamily family, FontPitch pitch, rtl_TextEncoding encoding );
     343             : 
     344             :     /// Definition of a numbering instance.
     345             :     virtual void NumberingDefinition( sal_uInt16 nId, const SwNumRule &rRule ) SAL_OVERRIDE;
     346             : 
     347             :     /// Start of the abstract numbering definition instance.
     348             :     virtual void StartAbstractNumbering( sal_uInt16 nId ) SAL_OVERRIDE;
     349             : 
     350             :     /// End of the abstract numbering definition instance.
     351             :     virtual void EndAbstractNumbering() SAL_OVERRIDE;
     352             : 
     353             :     /// All the numbering level information.
     354             :     virtual void NumberingLevel( sal_uInt8 nLevel,
     355             :         sal_uInt16 nStart,
     356             :         sal_uInt16 nNumberingType,
     357             :         SvxAdjust eAdjust,
     358             :         const sal_uInt8 *pNumLvlPos,
     359             :         sal_uInt8 nFollow,
     360             :         const wwFont *pFont,
     361             :         const SfxItemSet *pOutSet,
     362             :         sal_Int16 nIndentAt,
     363             :         sal_Int16 nFirstLineIndex,
     364             :         sal_Int16 nListTabPos,
     365             :         const OUString &rNumberingString,
     366             :         const SvxBrushItem* pBrush = 0 ) SAL_OVERRIDE;
     367             : 
     368             :     void WriteField_Impl( const SwField* pFld, ww::eField eType, const OUString& rFldCmd, sal_uInt8 nMode );
     369             :     void WriteFormData_Impl( const ::sw::mark::IFieldmark& rFieldmark );
     370             : 
     371             :     void WriteBookmarks_Impl( std::vector< OUString >& rStarts, std::vector< OUString >& rEnds );
     372             :     void WriteAnnotationMarks_Impl( std::vector< OUString >& rStarts, std::vector< OUString >& rEnds );
     373             :     void ClearRelIdCache();
     374             :     /// End possibly opened paragraph sdt block.
     375             :     void EndParaSdtBlock();
     376             : 
     377             : private:
     378             :     /// Initialize the structures where we are going to collect some of the paragraph properties.
     379             :     ///
     380             :     /// Some of the properties have to be collected from more sources, and are
     381             :     /// actually not written between StartParagraphProperties and
     382             :     /// EndParagraphProperties.  They are output in this method, which is
     383             :     /// supposed to be called just before outputting </rPr> whenever it is done.
     384             :     void InitCollectedParagraphProperties();
     385             : 
     386             :     /// Output what we collected during the run properties output.
     387             :     ///
     388             :     /// @see WriteCollectedParagrapProperties().
     389             :     void WriteCollectedParagraphProperties();
     390             : 
     391             :     /// Initialize the structures where we are going to collect some of the run properties.
     392             :     ///
     393             :     /// This is an equivalent of InitCollectedParagraphProperties(), resp.
     394             :     /// WriteCollectectedParagraphProperties().
     395             :     ///
     396             :     /// @see InitCollectedParagraphProperties().
     397             :     void InitCollectedRunProperties();
     398             : 
     399             :     /// Output what we collected during the run properties output.
     400             :     ///
     401             :     /// @see InitCollectedRunProperies(), WriteCollectedParagraphProperties()
     402             :     void WriteCollectedRunProperties();
     403             : 
     404             :     /// Output graphic fly frames or replacement graphics for OLE nodes.
     405             :     ///
     406             :     /// For graphic frames, just use the first two parameters, for OLE
     407             :     /// replacement graphics, set the first as 0, and pass the remaining three.
     408             :     ///
     409             :     /// @see WriteOLE2Obj()
     410             :     void FlyFrameGraphic( const SwGrfNode* pGrfNode, const Size& rSize, const SwFlyFrmFmt* pOLEFrmFmt = 0, SwOLENode* pOLENode = 0, const SdrObject* pSdrObj = 0);
     411             :     void WriteSrcRect( const SdrObject* pSdrObj );
     412             :     void WriteOLE2Obj( const SdrObject* pSdrObj, SwOLENode& rNode, const Size& rSize, const SwFlyFrmFmt* pFlyFrmFmt);
     413             :     bool WriteOLEChart( const SdrObject* pSdrObj, const Size& rSize );
     414             :     bool WriteOLEMath( const SdrObject* pSdrObj, const SwOLENode& rNode, const Size& rSize );
     415             :     bool PostponeOLE( const SdrObject* pSdrObj, SwOLENode& rNode, const Size& rSize, const SwFlyFrmFmt* pFlyFrmFmt );
     416             :     void WriteOLE( SwOLENode& rNode, const Size& rSize, const SwFlyFrmFmt* rFlyFrmFmt );
     417             : 
     418             :     /// checks whether the current component is a diagram
     419             :     bool IsDiagram (const SdrObject* sdrObject);
     420             : 
     421             :     void InitTableHelper( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
     422             :     void StartTable( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
     423             :     void StartTableRow( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
     424             :     void StartTableCell( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
     425             :     void TableCellProperties( ww8::WW8TableNodeInfoInner::Pointer_t pTableTextNodeInfoInner );
     426             :     void EndTableCell( );
     427             :     void EndTableRow( );
     428             :     void EndTable();
     429             :     void PopulateFrameProperties(const SwFrmFmt* pFrmFmt, const Size& rSize);
     430             :     bool TextBoxIsFramePr(const SwFrmFmt& rFrmFmt);
     431             :     /// End cell, row, and even the entire table if necessary.
     432             :     void FinishTableRowCell( ww8::WW8TableNodeInfoInner::Pointer_t pInner, bool bForceEmptyParagraph = false );
     433             : 
     434             :     void WriteFFData( const FieldInfos& rInfos );
     435             :     void WritePendingPlaceholder();
     436             : 
     437             :     void EmbedFontStyle( const OUString& name, int tag, FontFamily family, FontItalic italic, FontWeight weight,
     438             :         FontPitch pitch, rtl_TextEncoding encoding );
     439             : 
     440             :     /**
     441             :      * Translate a color object to the corresponding HighlightColorValues enumaration item
     442             :      *
     443             :      * @param[in]   rColor      a color object to translate
     444             :      * @return      color name (e.g. "red"), if color is inside the enumeration's range
     445             :      *              empty string, otherwise
     446             :     **/
     447             :     OString TransHighlightColor( const Color& rColor );
     448             : protected:
     449             : 
     450             :     /// Output frames - the implementation.
     451             :     virtual void OutputFlyFrame_Impl( const sw::Frame& rFmt, const Point& rNdTopLeft ) SAL_OVERRIDE;
     452             : 
     453             :     /// Sfx item Sfx item RES_CHRATR_CASEMAP
     454             :     virtual void CharCaseMap( const SvxCaseMapItem& rCaseMap ) SAL_OVERRIDE;
     455             : 
     456             :     /// Sfx item Sfx item RES_CHRATR_COLOR
     457             :     virtual void CharColor( const SvxColorItem& rColor) SAL_OVERRIDE;
     458             : 
     459             :     /// Sfx item Sfx item RES_CHRATR_CONTOUR
     460             :     virtual void CharContour( const SvxContourItem& rContour ) SAL_OVERRIDE;
     461             : 
     462             :     /// Sfx item RES_CHRATR_CROSSEDOUT
     463             :     virtual void CharCrossedOut( const SvxCrossedOutItem& rCrossedOut ) SAL_OVERRIDE;
     464             : 
     465             :     /// Sfx item RES_CHRATR_ESCAPEMENT
     466             :     virtual void CharEscapement( const SvxEscapementItem& rEscapement ) SAL_OVERRIDE;
     467             : 
     468             :     /// Sfx item RES_CHRATR_FONT
     469             :     virtual void CharFont( const SvxFontItem& rFont ) SAL_OVERRIDE;
     470             : 
     471             :     /// Sfx item RES_CHRATR_FONTSIZE
     472             :     virtual void CharFontSize( const SvxFontHeightItem& rFontSize ) SAL_OVERRIDE;
     473             : 
     474             :     /// Sfx item RES_CHRATR_KERNING
     475             :     virtual void CharKerning( const SvxKerningItem& rKerning ) SAL_OVERRIDE;
     476             : 
     477             :     /// Sfx item RES_CHRATR_LANGUAGE
     478             :     virtual void CharLanguage( const SvxLanguageItem& rLanguage ) SAL_OVERRIDE;
     479             : 
     480             :     /// Sfx item RES_CHRATR_POSTURE
     481             :     virtual void CharPosture( const SvxPostureItem& rPosture ) SAL_OVERRIDE;
     482             : 
     483             :     /// Sfx item RES_CHRATR_SHADOWED
     484             :     virtual void CharShadow( const SvxShadowedItem& rShadow ) SAL_OVERRIDE;
     485             : 
     486             :     /// Sfx item RES_CHRATR_UNDERLINE
     487             :     virtual void CharUnderline( const SvxUnderlineItem& rUnderline ) SAL_OVERRIDE;
     488             : 
     489             :     /// Sfx item RES_CHRATR_WEIGHT
     490             :     virtual void CharWeight( const SvxWeightItem& rWeight ) SAL_OVERRIDE;
     491             : 
     492             :     /// Sfx item RES_CHRATR_AUTOKERN
     493             :     virtual void CharAutoKern( const SvxAutoKernItem& ) SAL_OVERRIDE;
     494             : 
     495             :     /// Sfx item RES_CHRATR_BLINK
     496             :     virtual void CharAnimatedText( const SvxBlinkItem& rBlink ) SAL_OVERRIDE;
     497             : 
     498             :     /// Sfx item RES_CHRATR_BACKGROUND
     499             :     virtual void CharBackground( const SvxBrushItem& rBrush ) SAL_OVERRIDE;
     500             : 
     501             :     /// Sfx item RES_CHRATR_CJK_FONT
     502             :     virtual void CharFontCJK( const SvxFontItem& rFont ) SAL_OVERRIDE;
     503             : 
     504             :     /// Sfx item RES_CHRATR_CJK_FONTSIZE
     505           6 :     virtual void CharFontSizeCJK( const SvxFontHeightItem& rFontSize ) SAL_OVERRIDE { CharFontSize( rFontSize ); }
     506             : 
     507             :     /// Sfx item RES_CHRATR_CJK_LANGUAGE
     508        3946 :     virtual void CharLanguageCJK( const SvxLanguageItem& rLanguageItem ) SAL_OVERRIDE { CharLanguage( rLanguageItem ); }
     509             : 
     510             :     /// Sfx item RES_CHRATR_CJK_POSTURE
     511             :     virtual void CharPostureCJK( const SvxPostureItem& rPosture ) SAL_OVERRIDE;
     512             : 
     513             :     /// Sfx item RES_CHRATR_CJK_WEIGHT
     514             :     virtual void CharWeightCJK( const SvxWeightItem& rWeight ) SAL_OVERRIDE;
     515             : 
     516             :     /// Sfx item RES_CHRATR_CTL_FONT
     517             :     virtual void CharFontCTL( const SvxFontItem& rFont ) SAL_OVERRIDE;
     518             : 
     519             :     /// Sfx item RES_CHRATR_CTL_FONTSIZE
     520       16348 :     virtual void CharFontSizeCTL( const SvxFontHeightItem& rFontSize ) SAL_OVERRIDE { CharFontSize( rFontSize ); }
     521             : 
     522             :     /// Sfx item RES_CHRATR_CTL_LANGUAGE
     523        3386 :     virtual void CharLanguageCTL( const SvxLanguageItem& rLanguageItem ) SAL_OVERRIDE { CharLanguage( rLanguageItem); }
     524             : 
     525             :     /// Sfx item RES_CHRATR_CTL_POSTURE
     526             :     virtual void CharPostureCTL( const SvxPostureItem& rWeight ) SAL_OVERRIDE;
     527             : 
     528             :     /// Sfx item RES_CHRATR_CTL_WEIGHT
     529             :     virtual void CharWeightCTL( const SvxWeightItem& rWeight ) SAL_OVERRIDE;
     530             : 
     531             :     /// Sfx item RES_CHRATR_BidiRTL
     532             :     virtual void CharBidiRTL( const SfxPoolItem& ) SAL_OVERRIDE;
     533             : 
     534             :     /// Sfx item RES_CHRATR_IdctHint
     535             :     virtual void CharIdctHint( const SfxPoolItem& ) SAL_OVERRIDE;
     536             : 
     537             :     /// Sfx item RES_CHRATR_ROTATE
     538             :     virtual void CharRotate( const SvxCharRotateItem& rRotate ) SAL_OVERRIDE;
     539             : 
     540             :     /// Sfx item RES_CHRATR_EMPHASIS_MARK
     541             :     virtual void CharEmphasisMark( const SvxEmphasisMarkItem& rEmphasisMark ) SAL_OVERRIDE;
     542             : 
     543             :     /// Sfx item RES_CHRATR_TWO_LINES
     544             :     virtual void CharTwoLines( const SvxTwoLinesItem& rTwoLines ) SAL_OVERRIDE;
     545             : 
     546             :     /// Sfx item RES_CHRATR_SCALEW
     547             :     virtual void CharScaleWidth( const SvxCharScaleWidthItem& rScaleWidth ) SAL_OVERRIDE;
     548             : 
     549             :     /// Sfx item RES_CHRATR_RELIEF
     550             :     virtual void CharRelief( const SvxCharReliefItem& rRelief) SAL_OVERRIDE;
     551             : 
     552             :     /// Sfx item RES_CHRATR_HIDDEN
     553             :     virtual void CharHidden( const SvxCharHiddenItem& rHidden ) SAL_OVERRIDE;
     554             : 
     555             :     /// Sfx item RES_CHRATR_BOX
     556             :     virtual void CharBorder( const ::editeng::SvxBorderLine* pAllBorder, const sal_uInt16 nDist, const bool bShadow ) SAL_OVERRIDE;
     557             : 
     558             :     /// Sfx item RES_CHRATR_HIGHLIGHT
     559             :     virtual void CharHighlight( const SvxBrushItem& rHighlight ) SAL_OVERRIDE;
     560             : 
     561             :     /// Sfx item RES_TXTATR_INETFMT
     562             :     virtual void TextINetFormat( const SwFmtINetFmt& ) SAL_OVERRIDE;
     563             : 
     564             :     /// Sfx item RES_TXTATR_CHARFMT
     565             :     virtual void TextCharFormat( const SwFmtCharFmt& ) SAL_OVERRIDE;
     566             : 
     567             :     /// Sfx item RES_TXTATR_FTN
     568             :     virtual void TextFootnote_Impl( const SwFmtFtn& ) SAL_OVERRIDE;
     569             : 
     570             :     /// Output the footnote/endnote reference (if there's one to output).
     571             :     void FootnoteEndnoteReference();
     572             : 
     573             :     /// Sfx item RES_PARATR_LINESPACING
     574             :     virtual void ParaLineSpacing_Impl( short nSpace, short nMulti ) SAL_OVERRIDE;
     575             : 
     576             :     /// Sfx item RES_PARATR_ADJUST
     577             :     virtual void ParaAdjust( const SvxAdjustItem& rAdjust ) SAL_OVERRIDE;
     578             : 
     579             :     /// Sfx item RES_PARATR_SPLIT
     580             :     virtual void ParaSplit( const SvxFmtSplitItem& rSplit ) SAL_OVERRIDE;
     581             : 
     582             :     /// Sfx item RES_PARATR_WIDOWS
     583             :     virtual void ParaWidows( const SvxWidowsItem& rWidows ) SAL_OVERRIDE;
     584             : 
     585             :     /// Sfx item RES_PARATR_TABSTOP
     586             :     virtual void ParaTabStop( const SvxTabStopItem& rTabStop ) SAL_OVERRIDE;
     587             : 
     588             :     /// Sfx item RES_PARATR_HYPHENZONE
     589             :     virtual void ParaHyphenZone( const SvxHyphenZoneItem& ) SAL_OVERRIDE;
     590             : 
     591             :     /// Sfx item RES_PARATR_NUMRULE
     592             :     virtual void ParaNumRule_Impl( const SwTxtNode *pTxtNd, sal_Int32 nLvl, sal_Int32 nNumId ) SAL_OVERRIDE;
     593             : 
     594             :     /// Sfx item RES_PARATR_SCRIPTSPACE
     595             :     virtual void ParaScriptSpace( const SfxBoolItem& ) SAL_OVERRIDE;
     596             : 
     597             :     /// Sfx item RES_PARATR_HANGINGPUNCTUATION
     598             :     virtual void ParaHangingPunctuation( const SfxBoolItem& ) SAL_OVERRIDE;
     599             : 
     600             :     /// Sfx item RES_PARATR_FORBIDDEN_RULES
     601             :     virtual void ParaForbiddenRules( const SfxBoolItem& ) SAL_OVERRIDE;
     602             : 
     603             :     /// Sfx item RES_PARATR_VERTALIGN
     604             :     virtual void ParaVerticalAlign( const SvxParaVertAlignItem& rAlign ) SAL_OVERRIDE;
     605             : 
     606             :     /// Sfx item RES_PARATR_SNAPTOGRID
     607             :     virtual void ParaSnapToGrid( const SvxParaGridItem& ) SAL_OVERRIDE;
     608             : 
     609             :     /// Sfx item RES_FRM_SIZE
     610             :     virtual void FormatFrameSize( const SwFmtFrmSize& ) SAL_OVERRIDE;
     611             : 
     612             :     /// Sfx item RES_PAPER_BIN
     613             :     virtual void FormatPaperBin( const SvxPaperBinItem& ) SAL_OVERRIDE;
     614             : 
     615             :     /// Sfx item RES_LR_SPACE
     616             :     virtual void FormatLRSpace( const SvxLRSpaceItem& rLRSpace ) SAL_OVERRIDE;
     617             : 
     618             :     /// Sfx item RES_UL_SPACE
     619             :     virtual void FormatULSpace( const SvxULSpaceItem& rULSpace ) SAL_OVERRIDE;
     620             : 
     621             :     /// Sfx item RES_SURROUND
     622             :     virtual void FormatSurround( const SwFmtSurround& ) SAL_OVERRIDE;
     623             : 
     624             :     /// Sfx item RES_VERT_ORIENT
     625             :     virtual void FormatVertOrientation( const SwFmtVertOrient& ) SAL_OVERRIDE;
     626             : 
     627             :     /// Sfx item RES_HORI_ORIENT
     628             :     virtual void FormatHorizOrientation( const SwFmtHoriOrient& ) SAL_OVERRIDE;
     629             : 
     630             :     /// Sfx item RES_ANCHOR
     631             :     virtual void FormatAnchor( const SwFmtAnchor& ) SAL_OVERRIDE;
     632             : 
     633             :     /// Sfx item RES_BACKGROUND
     634             :     virtual void FormatBackground( const SvxBrushItem& ) SAL_OVERRIDE;
     635             : 
     636             :     /// Sfx item RES_FILL_STYLE
     637             :     virtual void FormatFillStyle( const XFillStyleItem& ) SAL_OVERRIDE;
     638             : 
     639             :     /// Sfx item RES_FILL_GRADIENT
     640             :     virtual void FormatFillGradient( const XFillGradientItem& ) SAL_OVERRIDE;
     641             : 
     642             :     /// Sfx item RES_BOX
     643             :     virtual void FormatBox( const SvxBoxItem& ) SAL_OVERRIDE;
     644             : 
     645             :     /// Sfx item RES_COL
     646             :     virtual void FormatColumns_Impl( sal_uInt16 nCols, const SwFmtCol & rCol, bool bEven, SwTwips nPageSize ) SAL_OVERRIDE;
     647             : 
     648             :     /// Sfx item RES_KEEP
     649             :     virtual void FormatKeep( const SvxFmtKeepItem& ) SAL_OVERRIDE;
     650             : 
     651             :     /// Sfx item RES_TEXTGRID
     652             :     virtual void FormatTextGrid( const SwTextGridItem& ) SAL_OVERRIDE;
     653             : 
     654             :     /// Sfx item RES_LINENUMBER
     655             :     virtual void FormatLineNumbering( const SwFmtLineNumber& ) SAL_OVERRIDE;
     656             : 
     657             :     /// Sfx item RES_FRAMEDIR
     658             :     virtual void FormatFrameDirection( const SvxFrameDirectionItem& ) SAL_OVERRIDE;
     659             : 
     660             :     /// Sfx item RES_PARATR_GRABBAG
     661             :     virtual void ParaGrabBag( const SfxGrabBagItem& ) SAL_OVERRIDE;
     662             : 
     663             :     /// Sfx item RES_CHRATR_GRABBAG
     664             :     virtual void CharGrabBag( const SfxGrabBagItem& ) SAL_OVERRIDE;
     665             : 
     666             :     // Sfx item RES_PARATR_OUTLINELEVEL
     667             :     virtual void ParaOutlineLevel( const SfxUInt16Item& ) SAL_OVERRIDE;
     668             : 
     669             :     /// Write the expanded field
     670             :     virtual void WriteExpand( const SwField* pFld ) SAL_OVERRIDE;
     671             : 
     672             :     virtual void RefField( const SwField& rFld, const OUString& rRef ) SAL_OVERRIDE;
     673             :     virtual void HiddenField( const SwField& rFld ) SAL_OVERRIDE;
     674             :     virtual void SetField( const SwField& rFld, ww::eField eType, const OUString& rCmd ) SAL_OVERRIDE;
     675             :     virtual void PostitField( const SwField* pFld ) SAL_OVERRIDE;
     676             :     virtual bool DropdownField( const SwField* pFld ) SAL_OVERRIDE;
     677             :     virtual bool PlaceholderField( const SwField* pFld ) SAL_OVERRIDE;
     678             : 
     679             :     virtual bool AnalyzeURL( const OUString& rURL, const OUString& rTarget, OUString* pLinkURL, OUString* pMark ) SAL_OVERRIDE;
     680             : 
     681             :     /// Reference to the export, where to get the data from
     682             :     DocxExport &m_rExport;
     683             : 
     684             :     /// Fast serializer to output the data
     685             :     ::sax_fastparser::FSHelperPtr m_pSerializer;
     686             : 
     687             :     /// DrawingML access
     688             :     oox::drawingml::DrawingML &m_rDrawingML;
     689             : 
     690             : private:
     691             : 
     692             :     void DoWriteBookmarks( );
     693             :     void DoWriteAnnotationMarks( );
     694             :     void WritePostponedGraphic();
     695             :     void WritePostponedMath();
     696             :     void WritePostponedFormControl(const SdrObject* pObject);
     697             :     void WritePostponedDiagram();
     698             :     void WritePostponedChart();
     699             :     void WritePostponedOLE();
     700             :     void WritePostponedVMLDrawing();
     701             :     void WritePostponedDMLDrawing();
     702             :     void WritePostponedCustomShape();
     703             : 
     704             :     void WriteSdtBlock(sal_Int32& nSdtPrToken,
     705             :                        ::sax_fastparser::FastAttributeList*& pSdtPrTokenChildren,
     706             :                        ::sax_fastparser::FastAttributeList*& pSdtPrTokenAttributes,
     707             :                        ::sax_fastparser::FastAttributeList*& pSdtPrDataBindingAttrs,
     708             :                        OUString& rSdtPrAlias,
     709             :                        bool bPara);
     710             :     /// Closes a currently open SDT block.
     711             :     void EndSdtBlock();
     712             : 
     713             :     void StartField_Impl( FieldInfos& rInfos, bool bWriteRun = false );
     714             :     void DoWriteCmd( const OUString& rCmd );
     715             :     void CmdField_Impl( FieldInfos& rInfos );
     716             :     void EndField_Impl( FieldInfos& rInfos );
     717             : 
     718             :     void AddToAttrList( ::sax_fastparser::FastAttributeList* &pAttrList, sal_Int32 nAttrName, const sal_Char* sAttrValue );
     719             :     void AddToAttrList( ::sax_fastparser::FastAttributeList* &pAttrList, sal_Int32 nArgs, ... );
     720             : 
     721             :     ::sax_fastparser::FastAttributeList *m_pFontsAttrList, *m_pEastAsianLayoutAttrList;
     722             :     ::sax_fastparser::FastAttributeList *m_pCharLangAttrList;
     723             :     ::sax_fastparser::FastAttributeList *m_pSectionSpacingAttrList;
     724             :     ::sax_fastparser::FastAttributeList *m_pParagraphSpacingAttrList;
     725             :     ::sax_fastparser::FastAttributeList *m_pHyperlinkAttrList;
     726             :     /// If the current SDT around runs should be ended before the current run.
     727             :     bool m_bEndCharSdt;
     728             :     /// If an SDT around runs is currently open.
     729             :     bool m_bStartedCharSdt;
     730             :     /// If an SDT around paragraphs is currently open.
     731             :     bool m_bStartedParaSdt;
     732             :     /// Attributes of the run color
     733             :     ::sax_fastparser::FastAttributeList *m_pColorAttrList;
     734             :     /// Attributes of the paragraph background
     735             :     ::sax_fastparser::FastAttributeList *m_pBackgroundAttrList;
     736             :     OUString m_sOriginalBackgroundColor;
     737             :     OUString m_hyperLinkAnchor;
     738             :     bool m_endPageRef;
     739             :     ::docx::FootnotesList *m_pFootnotesList;
     740             :     ::docx::FootnotesList *m_pEndnotesList;
     741             :     int m_footnoteEndnoteRefTag;
     742             :     boost::scoped_ptr< const WW8_SepInfo > m_pSectionInfo;
     743             : 
     744             :     /// Redline data to remember in the text run.
     745             :     const SwRedlineData *m_pRedlineData;
     746             : 
     747             :     /// Id of the redline
     748             :     sal_Int32 m_nRedlineId;
     749             : 
     750             :     /// Flag indicating that the section properties are being written
     751             :     bool m_bOpenedSectPr;
     752             :     /// Did we have a section break in this paragraph? Set by StartSection(), reset by the next StartParagraph().
     753             :     bool m_bHadSectPr;
     754             : 
     755             :     /// Flag indicating that the Run Text is being written
     756             :     bool m_bRunTextIsOn;
     757             : 
     758             :     /// Flag indicating that the header \ footer are being written
     759             :     bool m_bWritingHeaderFooter;
     760             :     bool m_bAnchorLinkedToNode;
     761             : 
     762             :     /// Field data to remember in the text run
     763             :     std::vector< FieldInfos > m_Fields;
     764             :     OUString m_sFieldBkm;
     765             :     sal_Int32 m_nNextBookmarkId;
     766             :     sal_Int32 m_nNextAnnotationMarkId;
     767             : 
     768             :     /// Bookmarks to output
     769             :     std::vector<OString> m_rBookmarksStart;
     770             :     std::vector<OString> m_rBookmarksEnd;
     771             : 
     772             :     /// Annotation marks to output
     773             :     std::vector<OString> m_rAnnotationMarksStart;
     774             :     std::vector<OString> m_rAnnotationMarksEnd;
     775             : 
     776             :     /// Maps of the bookmarks ids
     777             :     std::map<OString, sal_uInt16> m_rOpenedBookmarksIds;
     778             : 
     779             :     /// Name of the last opened bookmark.
     780             :     OString m_sLastOpenedBookmark;
     781             : 
     782             :     /// Maps of the annotation marks ids
     783             :     std::map<OString, sal_uInt16> m_rOpenedAnnotationMarksIds;
     784             : 
     785             :     /// Name of the last opened annotation mark.
     786             :     OString m_sLastOpenedAnnotationMark;
     787             : 
     788             :     /// If there are bookmarks around sequence fields, this map contains the
     789             :     /// names of these bookmarks for each sequence.
     790             :     std::map<OUString, std::vector<OString> > m_aSeqBookmarksNames;
     791             : 
     792             :     /// GrabBag for text effexts like glow, shadow, ...
     793             :     std::vector<css::beans::PropertyValue> m_aTextEffectsGrabBag;
     794             : 
     795             :     /// The current table helper
     796             :     SwWriteTable *m_pTableWrt;
     797             : 
     798             :     sw::Frame* m_pCurrentFrame;
     799             : 
     800             :     bool m_bParagraphOpened;
     801             :     bool m_bParagraphFrameOpen;
     802             :     bool m_bIsFirstParagraph;
     803             :     bool m_bAlternateContentChoiceOpen;
     804             :     bool m_bPostponedProcessingFly;
     805             : 
     806             :     // Remember that a column break has to be opened at the
     807             :     // beginning of the next paragraph
     808             :     DocxColBreakStatus m_nColBreakStatus;
     809             : 
     810             :     std::vector<sw::Frame> m_aFramesOfParagraph;
     811             :     sal_Int32 m_nTextFrameLevel;
     812             : 
     813             :     // close of hyperlink needed
     814             :     bool m_closeHyperlinkInThisRun;
     815             :     bool m_closeHyperlinkInPreviousRun;
     816             :     bool m_startedHyperlink;
     817             :     // Count nested HyperLinks
     818             :     sal_Int32 m_nHyperLinkCount;
     819             :     sal_Int16 m_nFieldsInHyperlink;
     820             : 
     821             :     struct PostponedGraphic
     822             :     {
     823          82 :         PostponedGraphic( const SwGrfNode* n, Size s, const SwFlyFrmFmt* pOLEFrmFmt, SwOLENode* pOLENode, const SdrObject* sObj )
     824          82 :             : grfNode( n ), size( s ), mOLEFrmFmt( pOLEFrmFmt ), mOLENode( pOLENode ), pSdrObj(sObj) {};
     825             : 
     826             :         const SwGrfNode* grfNode;
     827             :         Size size;
     828             :         const SwFlyFrmFmt* mOLEFrmFmt;
     829             :         SwOLENode* mOLENode;
     830             :         const SdrObject* pSdrObj;
     831             :     };
     832             :     std::list< PostponedGraphic >* m_postponedGraphic;
     833             :     struct PostponedDiagram
     834             :     {
     835          12 :         PostponedDiagram( const SdrObject* o, const SwFrmFmt* frm ) : object( o ), frame( frm ) {};
     836             :         const SdrObject* object;
     837             :         const SwFrmFmt* frame;
     838             :     };
     839             :     std::list< PostponedDiagram >* m_postponedDiagram;
     840             : 
     841             :     struct PostponedDrawing
     842             :     {
     843         130 :         PostponedDrawing( const SdrObject* sdrObj, const SwFrmFmt* frm, const Point* pt ) : object( sdrObj ), frame( frm ), point( pt ) {};
     844             :         const SdrObject* object;
     845             :         const SwFrmFmt* frame;
     846             :         const Point* point;
     847             :     };
     848             :     std::list< PostponedDrawing >* m_postponedVMLDrawing;
     849             :     std::list< PostponedDrawing >* m_postponedDMLDrawing;
     850             :     std::list< PostponedDrawing >* m_postponedCustomShape;
     851             : 
     852             :     struct PostponedOLE
     853             :     {
     854          30 :         PostponedOLE( SwOLENode* rObject, const Size& rSize, const SwFlyFrmFmt* rFrame ) : object( rObject ), size( rSize ), frame( rFrame ) {};
     855             :         SwOLENode* object;
     856             :         const Size size;
     857             :         const SwFlyFrmFmt* frame;
     858             :     };
     859             :     std::list< PostponedOLE >* m_postponedOLE;
     860             : 
     861             :     const SwOLENode* m_postponedMath;
     862             :     const SdrObject* m_postponedChart;
     863             :     Size m_postponedChartSize;
     864             :     std::vector<const SdrObject*> m_aPostponedFormControls;
     865             :     const SwField* pendingPlaceholder;
     866             :     /// Maps postit fields to ID's, used in commentRangeStart/End, commentReference and comment.xml.
     867             :     std::vector< std::pair<const SwPostItField*, sal_Int32> > m_postitFields;
     868             :     /// Number of postit fields which already have a commentReference written.
     869             :     unsigned int m_postitFieldsMaxId;
     870             :     int m_anchorId;
     871             :     int m_nextFontId;
     872           0 :     struct EmbeddedFontRef
     873             :     {
     874             :         OString relId;
     875             :         OString fontKey;
     876             :     };
     877             : 
     878             :     boost::scoped_ptr<TableReference> m_tableReference;
     879             : 
     880             :     std::map< OUString, EmbeddedFontRef > fontFilesMap; // font file url to data
     881             : 
     882             :     // Remember first cell (used for for default borders/margins) of each table
     883             :     std::vector<ww8::WW8TableNodeInfoInner::Pointer_t> tableFirstCells;
     884             : 
     885             :     boost::optional<css::drawing::FillStyle> m_oFillStyle;
     886             :     /// If FormatBox() already handled fill style / gradient.
     887             :     bool m_bIgnoreNextFill;
     888             : 
     889             :     /// Is fake rotation detected, so rotation with 90 degrees should be ignored in this cell?
     890             :     bool m_bBtLr;
     891             : 
     892             :     PageMargins m_pageMargins;
     893             : 
     894             :     boost::shared_ptr<DocxTableStyleExport> m_pTableStyleExport;
     895             :     // flag to check if auto spacing was set in original file
     896             :     bool m_bParaBeforeAutoSpacing,m_bParaAfterAutoSpacing;
     897             :     // store hardcoded value which was set during import.
     898             :     sal_Int32 m_nParaBeforeSpacing,m_nParaAfterSpacing;
     899             : 
     900             :     bool m_setFootnote;
     901             : 
     902             :     /// RelId <-> Graphic* cache, so that in case of alternate content, the same graphic only gets written once.
     903             :     std::map<const Graphic*, OString> m_aRelIdCache;
     904             : 
     905             :     /// members to control the existence of grabbagged SDT properties in the paragraph
     906             :     sal_Int32 m_nParagraphSdtPrToken;
     907             :     ::sax_fastparser::FastAttributeList *m_pParagraphSdtPrTokenChildren;
     908             :     ::sax_fastparser::FastAttributeList *m_pParagraphSdtPrTokenAttributes;
     909             :     ::sax_fastparser::FastAttributeList *m_pParagraphSdtPrDataBindingAttrs;
     910             :     /// members to control the existence of grabbagged SDT properties in the text run
     911             :     sal_Int32 m_nRunSdtPrToken;
     912             :     /// State of the Fly at current position
     913             :     FlyProcessingState m_nStateOfFlyFrame;
     914             :     ::sax_fastparser::FastAttributeList *m_pRunSdtPrTokenChildren;
     915             :     ::sax_fastparser::FastAttributeList *m_pRunSdtPrDataBindingAttrs;
     916             :     /// Value of the <w:alias> paragraph SDT element.
     917             :     OUString m_aParagraphSdtPrAlias;
     918             :     /// Same as m_aParagraphSdtPrAlias, but its content is aviailable till the SDT is closed.
     919             :     OUString m_aStartedParagraphSdtPrAlias;
     920             :     OUString m_aRunSdtPrAlias;
     921             :     /// Currently paragraph SDT has a <w:id> child element.
     922             :     bool m_bParagraphSdtHasId;
     923             : 
     924             :     std::map<sal_uInt16, css::table::BorderLine2> m_aTableStyleConf;
     925             : 
     926             : public:
     927             :     DocxAttributeOutput( DocxExport &rExport, ::sax_fastparser::FSHelperPtr pSerializer, oox::drawingml::DrawingML* pDrawingML );
     928             : 
     929             :     virtual ~DocxAttributeOutput();
     930             : 
     931             :     /// Return the right export class.
     932             :     virtual DocxExport& GetExport() SAL_OVERRIDE;
     933        6496 :     const DocxExport& GetExport() const { return const_cast< DocxAttributeOutput* >( this )->GetExport(); }
     934             : 
     935             :     /// For eg. the output of the styles, we need to switch the serializer to an other one.
     936             :     void SetSerializer( ::sax_fastparser::FSHelperPtr pSerializer );
     937             : 
     938             :     /// Occasionnaly need to use this serializer from the outside
     939         640 :     ::sax_fastparser::FSHelperPtr GetSerializer( ) { return m_pSerializer; }
     940             : 
     941             :     /// Do we have any footnotes?
     942             :     bool HasFootnotes() const;
     943             : 
     944             :     /// Do we have any endnotes?
     945             :     bool HasEndnotes() const;
     946             : 
     947             :     /// Output the content of the footnotes.xml resp. endnotes.xml
     948             :     void FootnotesEndnotes( bool bFootnotes );
     949             : 
     950             :     /// writes the footnotePr/endnotePr (depending on tag) section
     951             :     void WriteFootnoteEndnotePr( ::sax_fastparser::FSHelperPtr fs, int tag, const SwEndNoteInfo& info, int listtag );
     952             : 
     953             :     bool HasPostitFields() const;
     954             :     void WritePostitFields();
     955             : 
     956             :     /// VMLTextExport
     957             :     virtual void WriteOutliner(const OutlinerParaObject& rParaObj) SAL_OVERRIDE;
     958             :     virtual void WriteVMLTextBox(css::uno::Reference<css::drawing::XShape> xShape) SAL_OVERRIDE;
     959             :     /// DMLTextExport
     960             :     virtual void WriteTextBox(css::uno::Reference<css::drawing::XShape> xShape) SAL_OVERRIDE;
     961             :     virtual oox::drawingml::DrawingML& GetDrawingML() SAL_OVERRIDE;
     962             : 
     963             :     void BulletDefinition(int nId, const Graphic& rGraphic, Size aSize) SAL_OVERRIDE;
     964             : 
     965        1860 :     void SetWritingHeaderFooter( bool bWritingHeaderFooter )    {   m_bWritingHeaderFooter = bWritingHeaderFooter;   }
     966          98 :     bool GetWritingHeaderFooter( )  {   return m_bWritingHeaderFooter;  }
     967         240 :     void SetAlternateContentChoiceOpen( bool bAltContentChoiceOpen ) { m_bAlternateContentChoiceOpen = bAltContentChoiceOpen; }
     968         802 :     bool IsAlternateContentChoiceOpen( ) { return m_bAlternateContentChoiceOpen; }
     969             :     void GetSdtEndBefore(const SdrObject* pSdrObj);
     970             :     void SetStartedParaSdt(bool bStartedParaSdt);
     971             :     bool IsStartedParaSdt();
     972             : 
     973             :     /// Stores the table export state to the passed context and resets own state.
     974             :     void pushToTableExportContext(DocxTableExportContext& rContext);
     975             :     /// Restores from the remembered state.
     976             :     void popFromTableExportContext(DocxTableExportContext& rContext);
     977             : };
     978             : 
     979             : #endif // INCLUDED_SW_SOURCE_FILTER_WW8_DOCXATTRIBUTEOUTPUT_HXX
     980             : 
     981             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10