LCOV - code coverage report
Current view: top level - xmloff/inc/xmloff - txtparae.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 23 41 56.1 %
Date: 2012-08-25 Functions: 12 19 63.2 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : #ifndef _XMLOFF_TEXTPARAE_HXX_
      29                 :            : #define _XMLOFF_TEXTPARAE_HXX_
      30                 :            : 
      31                 :            : #include "sal/config.h"
      32                 :            : 
      33                 :            : #include <memory>
      34                 :            : 
      35                 :            : #include "xmloff/dllapi.h"
      36                 :            : #include <rtl/ustring.hxx>
      37                 :            : #include <com/sun/star/uno/Reference.h>
      38                 :            : #include <com/sun/star/uno/Sequence.h>
      39                 :            : #include <com/sun/star/beans/PropertyValue.hpp>
      40                 :            : #include <xmloff/uniref.hxx>
      41                 :            : #include <xmloff/xmlexppr.hxx>
      42                 :            : #include <xmloff/styleexp.hxx>
      43                 :            : #include <xmloff/xmltoken.hxx>
      44                 :            : #include <xmloff/SinglePropertySetInfoCache.hxx>
      45                 :            : #include <xmloff/XMLStringVector.hxx>
      46                 :            : #include <vector>
      47                 :            : 
      48                 :            : class XMLTextListsHelper;
      49                 :            : class SvXMLExport;
      50                 :            : class SvXMLAutoStylePoolP;
      51                 :            : class XMLTextFieldExport;
      52                 :            : class XMLTextNumRuleInfo;
      53                 :            : class XMLTextListAutoStylePool;
      54                 :            : class XMLSectionExport;
      55                 :            : class XMLIndexMarkExport;
      56                 :            : class XMLRedlineExport;
      57                 :            : struct XMLPropertyState;
      58                 :            : class MultiPropertySetHelper;
      59                 :            : 
      60                 :            : namespace com { namespace sun { namespace star
      61                 :            : {
      62                 :            :     namespace beans { class XPropertySet; class XPropertyState;
      63                 :            :                       class XPropertySetInfo; }
      64                 :            :     namespace container { class XEnumerationAccess; class XEnumeration; class XIndexAccess; }
      65                 :            :     namespace text { class XTextContent; class XTextRange; class XText;
      66                 :            :                      class XFootnote; class XTextFrame; class XTextSection;
      67                 :            :                      class XTextField;
      68                 :            :                      class XDocumentIndex; class XTextShapesSupplier; }
      69                 :            : } } }
      70                 :            : 
      71                 :            : namespace xmloff
      72                 :            : {
      73                 :            :     class OFormLayerXMLExport;
      74                 :            :     class BoundFrameSets;
      75                 :            : }
      76                 :            : 
      77                 :            : class XMLOFF_DLLPUBLIC XMLTextParagraphExport : public XMLStyleExport
      78                 :            : {
      79                 :            : 
      80                 :            : //  SvXMLExport& rExport;
      81                 :            :     SvXMLAutoStylePoolP& rAutoStylePool;
      82                 :            :     UniReference < SvXMLExportPropertyMapper > xParaPropMapper;
      83                 :            :     UniReference < SvXMLExportPropertyMapper > xTextPropMapper;
      84                 :            :     UniReference < SvXMLExportPropertyMapper > xFramePropMapper;
      85                 :            :     UniReference < SvXMLExportPropertyMapper > xAutoFramePropMapper;
      86                 :            :     UniReference < SvXMLExportPropertyMapper > xSectionPropMapper;
      87                 :            :     UniReference < SvXMLExportPropertyMapper > xRubyPropMapper;
      88                 :            : 
      89                 :            :     const ::std::auto_ptr< ::xmloff::BoundFrameSets > pBoundFrameSets;
      90                 :            :     XMLTextFieldExport          *pFieldExport;
      91                 :            :     std::vector<rtl::OUString>  *pListElements;
      92                 :            :     XMLTextListAutoStylePool    *pListAutoPool;
      93                 :            :     XMLSectionExport            *pSectionExport;
      94                 :            :     XMLIndexMarkExport          *pIndexMarkExport;
      95                 :            : 
      96                 :            :     /// may be NULL (if no redlines should be exported; e.g. in block mode)
      97                 :            :     XMLRedlineExport            *pRedlineExport;
      98                 :            :     XMLStringVector             *pHeadingStyles;
      99                 :            : 
     100                 :            :     sal_Bool                    bProgress;
     101                 :            : 
     102                 :            :     sal_Bool                    bBlock;
     103                 :            : 
     104                 :            :     // keep track of open rubies
     105                 :            :     ::rtl::OUString             sOpenRubyText;
     106                 :            :     ::rtl::OUString             sOpenRubyCharStyle;
     107                 :            :     sal_Bool                    bOpenRuby;
     108                 :            : 
     109                 :            :     XMLTextListsHelper* mpTextListsHelper;
     110                 :            :     ::std::vector< XMLTextListsHelper* > maTextListsHelperStack;
     111                 :            : 
     112                 :            :     enum FrameType { FT_TEXT, FT_GRAPHIC, FT_EMBEDDED, FT_SHAPE };
     113                 :            : public:
     114                 :            : 
     115                 :            :     enum FieldmarkType { NONE, TEXT, CHECK }; // Used for simulating fieldmarks in OpenDocument 1.n Strict (for n <= 2). CHECK currently ignored.
     116                 :            : 
     117                 :            : protected:
     118                 :            : 
     119                 :            :     const ::rtl::OUString sActualSize;
     120                 :            :     // Implement Title/Description Elements UI (#i73249#)
     121                 :            :     const ::rtl::OUString sTitle;
     122                 :            :     const ::rtl::OUString sDescription;
     123                 :            :     const ::rtl::OUString sAnchorCharStyleName;
     124                 :            :     const ::rtl::OUString sAnchorPageNo;
     125                 :            :     const ::rtl::OUString sAnchorType;
     126                 :            :     const ::rtl::OUString sBeginNotice;
     127                 :            :     const ::rtl::OUString sBookmark;
     128                 :            :     const ::rtl::OUString sCategory;
     129                 :            :     const ::rtl::OUString sChainNextName;
     130                 :            :     const ::rtl::OUString sCharStyleName;
     131                 :            :     const ::rtl::OUString sCharStyleNames;
     132                 :            :     const ::rtl::OUString sContourPolyPolygon;
     133                 :            :     const ::rtl::OUString sDocumentIndex;
     134                 :            :     const ::rtl::OUString sDocumentIndexMark;
     135                 :            :     const ::rtl::OUString sEndNotice;
     136                 :            :     const ::rtl::OUString sFootnote;
     137                 :            :     const ::rtl::OUString sFootnoteCounting;
     138                 :            :     const ::rtl::OUString sFrame;
     139                 :            :     const ::rtl::OUString sFrameHeightAbsolute;
     140                 :            :     const ::rtl::OUString sFrameHeightPercent;
     141                 :            :     const ::rtl::OUString sFrameStyleName;
     142                 :            :     const ::rtl::OUString sFrameWidthAbsolute;
     143                 :            :     const ::rtl::OUString sFrameWidthPercent;
     144                 :            :     const ::rtl::OUString sGraphicFilter;
     145                 :            :     const ::rtl::OUString sGraphicRotation;
     146                 :            :     const ::rtl::OUString sGraphicURL;
     147                 :            :     const ::rtl::OUString sHeight;
     148                 :            :     const ::rtl::OUString sHoriOrient;
     149                 :            :     const ::rtl::OUString sHoriOrientPosition;
     150                 :            :     const ::rtl::OUString sHyperLinkName;
     151                 :            :     const ::rtl::OUString sHyperLinkTarget;
     152                 :            :     const ::rtl::OUString sHyperLinkURL;
     153                 :            :     const ::rtl::OUString sIsAutomaticContour;
     154                 :            :     const ::rtl::OUString sIsCollapsed;
     155                 :            :     const ::rtl::OUString sIsPixelContour;
     156                 :            :     const ::rtl::OUString sIsStart;
     157                 :            :     const ::rtl::OUString sIsSyncHeightToWidth;
     158                 :            :     const ::rtl::OUString sIsSyncWidthToHeight;
     159                 :            :     const ::rtl::OUString sNumberingRules;
     160                 :            :     const ::rtl::OUString sNumberingType;
     161                 :            :     const ::rtl::OUString sPageDescName;
     162                 :            :     const ::rtl::OUString sPageStyleName;
     163                 :            :     const ::rtl::OUString sParaChapterNumberingLevel;
     164                 :            :     const ::rtl::OUString sParaConditionalStyleName;
     165                 :            :     const ::rtl::OUString sParagraphService;
     166                 :            :     const ::rtl::OUString sParaStyleName;
     167                 :            :     const ::rtl::OUString sPositionEndOfDoc;
     168                 :            :     const ::rtl::OUString sPrefix;
     169                 :            :     const ::rtl::OUString sRedline;
     170                 :            :     const ::rtl::OUString sReferenceId;
     171                 :            :     const ::rtl::OUString sReferenceMark;
     172                 :            :     const ::rtl::OUString sRelativeHeight;
     173                 :            :     const ::rtl::OUString sRelativeWidth;
     174                 :            :     const ::rtl::OUString sRuby;
     175                 :            :     const ::rtl::OUString sRubyAdjust;
     176                 :            :     const ::rtl::OUString sRubyCharStyleName;
     177                 :            :     const ::rtl::OUString sRubyText;
     178                 :            :     const ::rtl::OUString sServerMap;
     179                 :            :     const ::rtl::OUString sShapeService;
     180                 :            :     const ::rtl::OUString sSizeType;
     181                 :            :     const ::rtl::OUString sSoftPageBreak;
     182                 :            :     const ::rtl::OUString sStartAt;
     183                 :            :     const ::rtl::OUString sSuffix;
     184                 :            :     const ::rtl::OUString sTableService;
     185                 :            :     const ::rtl::OUString sText;
     186                 :            :     const ::rtl::OUString sTextContentService;
     187                 :            :     const ::rtl::OUString sTextEmbeddedService;
     188                 :            :     const ::rtl::OUString sTextEndnoteService;
     189                 :            :     const ::rtl::OUString sTextField;
     190                 :            :     const ::rtl::OUString sTextFieldService;
     191                 :            :     const ::rtl::OUString sTextFrameService;
     192                 :            :     const ::rtl::OUString sTextGraphicService;
     193                 :            :     const ::rtl::OUString sTextPortionType;
     194                 :            :     const ::rtl::OUString sTextSection;
     195                 :            :     const ::rtl::OUString sUnvisitedCharStyleName;
     196                 :            :     const ::rtl::OUString sVertOrient;
     197                 :            :     const ::rtl::OUString sVertOrientPosition;
     198                 :            :     const ::rtl::OUString sVisitedCharStyleName;
     199                 :            :     const ::rtl::OUString sWidth;
     200                 :            :     const ::rtl::OUString sWidthType;
     201                 :            :     const ::rtl::OUString sTextFieldStart;
     202                 :            :     const ::rtl::OUString sTextFieldEnd;
     203                 :            :     const ::rtl::OUString sTextFieldStartEnd;
     204                 :            : 
     205                 :            :     SinglePropertySetInfoCache aCharStyleNamesPropInfoCache;
     206                 :            : 
     207                 :            : //  SvXMLExport& GetExport() { return rExport; }
     208                 :            : //  const SvXMLExport& GetExport() const  { return rExport; }
     209                 :            : 
     210                 :        320 :     UniReference < SvXMLExportPropertyMapper > GetParaPropMapper() const
     211                 :            :     {
     212                 :        320 :         return xParaPropMapper;
     213                 :            :     }
     214                 :            : 
     215                 :       4155 :     UniReference < SvXMLExportPropertyMapper > GetTextPropMapper() const
     216                 :            :     {
     217                 :       4155 :         return xTextPropMapper;
     218                 :            :     }
     219                 :            : 
     220                 :         21 :     UniReference < SvXMLExportPropertyMapper > GetFramePropMapper() const
     221                 :            :     {
     222                 :         21 :         return xFramePropMapper;
     223                 :            :     }
     224                 :          0 :     UniReference < SvXMLExportPropertyMapper > GetAutoFramePropMapper() const
     225                 :            :     {
     226                 :          0 :         return xAutoFramePropMapper;
     227                 :            :     }
     228                 :         64 :     UniReference < SvXMLExportPropertyMapper > GetSectionPropMapper() const
     229                 :            :     {
     230                 :         64 :         return xSectionPropMapper;
     231                 :            :     }
     232                 :         14 :     UniReference < SvXMLExportPropertyMapper > GetRubyPropMapper() const
     233                 :            :     {
     234                 :         14 :         return xRubyPropMapper;
     235                 :            :     }
     236                 :            : 
     237                 :            : 
     238                 :        480 :     SvXMLAutoStylePoolP& GetAutoStylePool() { return rAutoStylePool; }
     239                 :        161 :     const SvXMLAutoStylePoolP& GetAutoStylePool() const { return rAutoStylePool; }
     240                 :            : 
     241                 :            : public:
     242                 :            :     ::rtl::OUString FindTextStyleAndHyperlink(
     243                 :            :             const ::com::sun::star::uno::Reference <
     244                 :            :                 ::com::sun::star::beans::XPropertySet > & rPropSet,
     245                 :            :             sal_Bool& rbHyperlink,
     246                 :            :             sal_Bool& rbHasCharStyle,
     247                 :            :             sal_Bool& rbHasAutoStyle,
     248                 :            :             const XMLPropertyState** pAddState = NULL) const;
     249                 :            :     sal_Bool addHyperlinkAttributes(
     250                 :            :         const ::com::sun::star::uno::Reference <
     251                 :            :                 ::com::sun::star::beans::XPropertySet > & rPropSet,
     252                 :            :         const ::com::sun::star::uno::Reference <
     253                 :            :                 ::com::sun::star::beans::XPropertyState > & rPropState,
     254                 :            :         const ::com::sun::star::uno::Reference <
     255                 :            :                 ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
     256                 :            : 
     257                 :            :     void exportTextRangeEnumeration(
     258                 :            :         const ::com::sun::star::uno::Reference <
     259                 :            :             ::com::sun::star::container::XEnumeration > & rRangeEnum,
     260                 :            :         sal_Bool bAutoStyles, sal_Bool bProgress,
     261                 :            :         sal_Bool bPrvChrIsSpc = sal_True );
     262                 :            : 
     263                 :            : protected:
     264                 :            : 
     265                 :            :     sal_Int32 addTextFrameAttributes(
     266                 :            :         const ::com::sun::star::uno::Reference <
     267                 :            :                 ::com::sun::star::beans::XPropertySet >& rPropSet,
     268                 :            :         sal_Bool bShape,
     269                 :            :         ::rtl::OUString *pMinHeightValue = 0,
     270                 :            :         ::rtl::OUString *pMinWidthValue = 0 );
     271                 :            : 
     272                 :            :     virtual void exportStyleAttributes(
     273                 :            :         const ::com::sun::star::uno::Reference<
     274                 :            :                 ::com::sun::star::style::XStyle > & rStyle );
     275                 :            : 
     276                 :            :     void exportPageFrames( sal_Bool bAutoStyles, sal_Bool bProgress );
     277                 :            :     void exportFrameFrames( sal_Bool bAutoStyles, sal_Bool bProgress,
     278                 :            :             const ::com::sun::star::uno::Reference <
     279                 :            :                     ::com::sun::star::text::XTextFrame > *pParentTxtFrame = 0 );
     280                 :            : 
     281                 :            :     void exportNumStyles( sal_Bool bUsed );
     282                 :            : 
     283                 :            :     void exportText(
     284                 :            :         const ::com::sun::star::uno::Reference <
     285                 :            :             ::com::sun::star::text::XText > & rText,
     286                 :            :         sal_Bool bAutoStyles, sal_Bool bProgress, sal_Bool bExportParagraph );
     287                 :            : 
     288                 :            :     void exportText(
     289                 :            :         const ::com::sun::star::uno::Reference <
     290                 :            :             ::com::sun::star::text::XText > & rText,
     291                 :            :         const ::com::sun::star::uno::Reference <
     292                 :            :             ::com::sun::star::text::XTextSection > & rBaseSection,
     293                 :            :         sal_Bool bAutoStyles, sal_Bool bProgress, sal_Bool bExportParagraph );
     294                 :            : 
     295                 :            :     sal_Bool exportTextContentEnumeration(
     296                 :            :         const ::com::sun::star::uno::Reference <
     297                 :            :             ::com::sun::star::container::XEnumeration > & rContentEnum,
     298                 :            :         sal_Bool bAutoStyles,
     299                 :            :         const ::com::sun::star::uno::Reference <
     300                 :            :             ::com::sun::star::text::XTextSection > & rBaseSection,
     301                 :            :         sal_Bool bProgress,
     302                 :            :         sal_Bool bExportParagraph = sal_True,
     303                 :            :         const ::com::sun::star::uno::Reference <
     304                 :            :             ::com::sun::star::beans::XPropertySet > *pRangePropSet = 0,
     305                 :            :         sal_Bool bExportLevels = sal_True );
     306                 :            :     void exportParagraph(
     307                 :            :         const ::com::sun::star::uno::Reference <
     308                 :            :             ::com::sun::star::text::XTextContent > & rTextContent,
     309                 :            :         sal_Bool bAutoStyles, sal_Bool bProgress,
     310                 :            :         sal_Bool bExportParagraph,
     311                 :            :         MultiPropertySetHelper& rPropSetHelper);
     312                 :            :     virtual void exportTable(
     313                 :            :         const ::com::sun::star::uno::Reference <
     314                 :            :             ::com::sun::star::text::XTextContent > & rTextContent,
     315                 :            :         sal_Bool bAutoStyles, sal_Bool bProgress );
     316                 :            : 
     317                 :            :     void exportTextField(
     318                 :            :         const ::com::sun::star::uno::Reference <
     319                 :            :             ::com::sun::star::text::XTextRange > & rTextRange,
     320                 :            :         sal_Bool bAutoStyles, sal_Bool bProgress );
     321                 :            : 
     322                 :            :     void exportTextField(
     323                 :            :         const ::com::sun::star::uno::Reference <
     324                 :            :             ::com::sun::star::text::XTextField> & xTextField,
     325                 :            :         const sal_Bool bAutoStyles, const sal_Bool bProgress,
     326                 :            :         const sal_Bool bRecursive );
     327                 :            : 
     328                 :            :     void exportAnyTextFrame(
     329                 :            :         const ::com::sun::star::uno::Reference <
     330                 :            :             ::com::sun::star::text::XTextContent > & rTextContent,
     331                 :            :         FrameType eTxpe,
     332                 :            :         sal_Bool bAutoStyles, sal_Bool bProgress, sal_Bool bExportContent,
     333                 :            :         const ::com::sun::star::uno::Reference <
     334                 :            :             ::com::sun::star::beans::XPropertySet > *pRangePropSet = 0 );
     335                 :            :     void _exportTextFrame(
     336                 :            :         const ::com::sun::star::uno::Reference <
     337                 :            :             ::com::sun::star::beans::XPropertySet > & rPropSet,
     338                 :            :         const ::com::sun::star::uno::Reference <
     339                 :            :             ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo,
     340                 :            :         sal_Bool bProgress );
     341                 :            :     inline void exportTextFrame(
     342                 :            :         const ::com::sun::star::uno::Reference <
     343                 :            :             ::com::sun::star::text::XTextContent > & rTextContent,
     344                 :            :         sal_Bool bAutoStyles, sal_Bool bProgress, sal_Bool bExportContent,
     345                 :            :         const ::com::sun::star::uno::Reference <
     346                 :            :             ::com::sun::star::beans::XPropertySet > *pRangePropSet = 0 );
     347                 :            :     inline void exportShape(
     348                 :            :         const ::com::sun::star::uno::Reference <
     349                 :            :             ::com::sun::star::text::XTextContent > & rTextContent,
     350                 :            :         sal_Bool bAutoStyles,
     351                 :            :         const ::com::sun::star::uno::Reference <
     352                 :            :             ::com::sun::star::beans::XPropertySet > *pRangePropSet = 0  );
     353                 :            : 
     354                 :            :     void exportContour(
     355                 :            :         const ::com::sun::star::uno::Reference <
     356                 :            :             ::com::sun::star::beans::XPropertySet > & rPropSet,
     357                 :            :         const ::com::sun::star::uno::Reference <
     358                 :            :             ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
     359                 :            :     void _exportTextGraphic(
     360                 :            :         const ::com::sun::star::uno::Reference <
     361                 :            :             ::com::sun::star::beans::XPropertySet > & rPropSet,
     362                 :            :         const ::com::sun::star::uno::Reference <
     363                 :            :             ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
     364                 :            :     inline void exportTextGraphic(
     365                 :            :         const ::com::sun::star::uno::Reference <
     366                 :            :             ::com::sun::star::text::XTextContent > & rTextContent,
     367                 :            :         sal_Bool bAutoStyles,
     368                 :            :         const ::com::sun::star::uno::Reference <
     369                 :            :             ::com::sun::star::beans::XPropertySet > *pRangePropSet = 0  );
     370                 :            : 
     371                 :            :     virtual void _collectTextEmbeddedAutoStyles(
     372                 :            :         const ::com::sun::star::uno::Reference <
     373                 :            :             ::com::sun::star::beans::XPropertySet > & rPropSet );
     374                 :            :     virtual void _exportTextEmbedded(
     375                 :            :         const ::com::sun::star::uno::Reference <
     376                 :            :             ::com::sun::star::beans::XPropertySet > & rPropSet,
     377                 :            :         const ::com::sun::star::uno::Reference <
     378                 :            :             ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
     379                 :            :     inline void exportTextEmbedded(
     380                 :            :         const ::com::sun::star::uno::Reference <
     381                 :            :             ::com::sun::star::text::XTextContent > & rTextContent,
     382                 :            :         sal_Bool bAutoStyles,
     383                 :            :         const ::com::sun::star::uno::Reference <
     384                 :            :             ::com::sun::star::beans::XPropertySet > *pRangePropSet = 0  );
     385                 :            :     virtual void setTextEmbeddedGraphicURL(
     386                 :            :         const ::com::sun::star::uno::Reference <
     387                 :            :                 ::com::sun::star::beans::XPropertySet >& rPropSet,
     388                 :            :         ::rtl::OUString& rStreamName ) const;
     389                 :            : 
     390                 :            :     /// export a footnote and styles
     391                 :            :     void exportTextFootnote(
     392                 :            :         const ::com::sun::star::uno::Reference<
     393                 :            :             ::com::sun::star::beans::XPropertySet > & rPropSet,
     394                 :            :         const ::rtl::OUString& sString,
     395                 :            :         sal_Bool bAutoStyles, sal_Bool bProgress );
     396                 :            : 
     397                 :            :     /// helper for exportTextFootnote
     398                 :            :     void exportTextFootnoteHelper(
     399                 :            :         const ::com::sun::star::uno::Reference<
     400                 :            :             ::com::sun::star::text::XFootnote > & rPropSet,
     401                 :            :         const ::com::sun::star::uno::Reference<
     402                 :            :             ::com::sun::star::text::XText> & rText,
     403                 :            :         const ::rtl::OUString& sString,
     404                 :            :         sal_Bool bAutoStyles,
     405                 :            :         sal_Bool bIsEndnote, sal_Bool bProgress );
     406                 :            : 
     407                 :            :     /// export footnote and endnote configuration elements
     408                 :            :     void exportTextFootnoteConfiguration();
     409                 :            : 
     410                 :            :     void exportTextFootnoteConfigurationHelper(
     411                 :            :         const ::com::sun::star::uno::Reference<
     412                 :            :             ::com::sun::star::beans::XPropertySet> & rFootnoteSupplier,
     413                 :            :         sal_Bool bIsEndnote);
     414                 :            : 
     415                 :            :     void exportTextMark(
     416                 :            :         const ::com::sun::star::uno::Reference<
     417                 :            :             ::com::sun::star::beans::XPropertySet> & xPropSet,
     418                 :            :         const ::rtl::OUString& rProperty,
     419                 :            :         const enum ::xmloff::token::XMLTokenEnum pElements[],
     420                 :            :         sal_Bool bAutoStyles);
     421                 :            : 
     422                 :            :     void exportIndexMark(
     423                 :            :         const ::com::sun::star::uno::Reference<
     424                 :            :             ::com::sun::star::beans::XPropertySet> & rPropSet,
     425                 :            :         sal_Bool bAutoStyles);
     426                 :            : 
     427                 :            :     void exportSoftPageBreak(
     428                 :            :         const ::com::sun::star::uno::Reference<
     429                 :            :             ::com::sun::star::beans::XPropertySet> & rPropSet,
     430                 :            :         sal_Bool bAutoStyles);
     431                 :            : 
     432                 :            :     void exportTextRange(
     433                 :            :         const ::com::sun::star::uno::Reference <
     434                 :            :             ::com::sun::star::text::XTextRange > & rTextRange,
     435                 :            :         sal_Bool bAutoStyles,
     436                 :            :         bool& rPrevCharWasSpace,
     437                 :            :         FieldmarkType& openFieldmarkType );
     438                 :            : 
     439                 :            :     void exportListChange( const XMLTextNumRuleInfo& rPrvInfo,
     440                 :            :                            const XMLTextNumRuleInfo& rNextInfo );
     441                 :            : 
     442                 :            :     /// check if current section or current list has changed;
     443                 :            :     /// calls exortListChange as appropriate
     444                 :            :     void exportListAndSectionChange(
     445                 :            :         ::com::sun::star::uno::Reference <
     446                 :            :             ::com::sun::star::text::XTextSection > & rOldSection,
     447                 :            :         const ::com::sun::star::uno::Reference <
     448                 :            :             ::com::sun::star::text::XTextSection > & rNewSection,
     449                 :            :         const XMLTextNumRuleInfo& rOldList,
     450                 :            :         const XMLTextNumRuleInfo& rNewList,
     451                 :            :         sal_Bool bAutoStyles );
     452                 :            : 
     453                 :            :     /// overload for exportListAndSectionChange;
     454                 :            :     /// takes new content rather than new section.
     455                 :            :     void exportListAndSectionChange(
     456                 :            :         ::com::sun::star::uno::Reference <
     457                 :            :             ::com::sun::star::text::XTextSection > & rOldSection,
     458                 :            :         const ::com::sun::star::uno::Reference <
     459                 :            :             ::com::sun::star::text::XTextContent > & rNewContent,
     460                 :            :         const XMLTextNumRuleInfo& rOldList,
     461                 :            :         const XMLTextNumRuleInfo& rNewList,
     462                 :            :         sal_Bool bAutoStyles );
     463                 :            :     void exportListAndSectionChange(
     464                 :            :         ::com::sun::star::uno::Reference <
     465                 :            :             ::com::sun::star::text::XTextSection > & rOldSection,
     466                 :            :         MultiPropertySetHelper& rPropSetHelper,
     467                 :            :         sal_Int16 nTextSectionId,
     468                 :            :         const ::com::sun::star::uno::Reference <
     469                 :            :             ::com::sun::star::text::XTextContent > & rNewContent,
     470                 :            :         const XMLTextNumRuleInfo& rOldList,
     471                 :            :         const XMLTextNumRuleInfo& rNewList,
     472                 :            :         sal_Bool bAutoStyles );
     473                 :            : 
     474                 :            :     /// export a redline text portion
     475                 :            :     void exportChange(
     476                 :            :         const ::com::sun::star::uno::Reference <
     477                 :            :             ::com::sun::star::beans::XPropertySet > & rPropSet,
     478                 :            :         sal_Bool bAutoStyle);
     479                 :            : 
     480                 :            :     /// export a ruby
     481                 :            :     void exportRuby(
     482                 :            :         const ::com::sun::star::uno::Reference<
     483                 :            :             ::com::sun::star::beans::XPropertySet> & rPortionPropSet,
     484                 :            :         sal_Bool bAutoStyles );
     485                 :            : 
     486                 :            :     /// export a text:meta
     487                 :            :     void exportMeta(
     488                 :            :         const ::com::sun::star::uno::Reference<
     489                 :            :             ::com::sun::star::beans::XPropertySet> & i_xPortion,
     490                 :            :         sal_Bool i_bAutoStyles, sal_Bool i_isProgress );
     491                 :            : 
     492                 :            : public:
     493                 :            : 
     494                 :            :     XMLTextParagraphExport(
     495                 :            :             SvXMLExport& rExp,
     496                 :            :                SvXMLAutoStylePoolP & rASP
     497                 :            :                           );
     498                 :            :     virtual ~XMLTextParagraphExport();
     499                 :            : 
     500                 :            :     /// add autostyle for specified family
     501                 :            :     void Add(
     502                 :            :         sal_uInt16 nFamily,
     503                 :            :         MultiPropertySetHelper& rPropSetHelper,
     504                 :            :         const ::com::sun::star::uno::Reference <
     505                 :            :             ::com::sun::star::beans::XPropertySet > & rPropSet,
     506                 :            :         const XMLPropertyState** pAddState = NULL );
     507                 :            :     void Add(
     508                 :            :         sal_uInt16 nFamily,
     509                 :            :         const ::com::sun::star::uno::Reference <
     510                 :            :             ::com::sun::star::beans::XPropertySet > & rPropSet,
     511                 :            :         const XMLPropertyState** pAddState = NULL, bool bDontSeek = false );
     512                 :            : 
     513                 :            :     /// find style name for specified family and parent
     514                 :            :     ::rtl::OUString Find(
     515                 :            :         sal_uInt16 nFamily,
     516                 :            :         const ::com::sun::star::uno::Reference <
     517                 :            :             ::com::sun::star::beans::XPropertySet > & rPropSet,
     518                 :            :         const ::rtl::OUString& rParent,
     519                 :            :         const XMLPropertyState** pAddState = NULL ) const;
     520                 :            : 
     521                 :            :     static SvXMLExportPropertyMapper *CreateShapeExtPropMapper(
     522                 :            :                                                 SvXMLExport& rExport );
     523                 :            :     static SvXMLExportPropertyMapper *CreateCharExtPropMapper(
     524                 :            :                                                 SvXMLExport& rExport);
     525                 :            :     static SvXMLExportPropertyMapper *CreateParaExtPropMapper(
     526                 :            :                                                 SvXMLExport& rExport);
     527                 :            :     static SvXMLExportPropertyMapper *CreateParaDefaultExtPropMapper(
     528                 :            :                                                 SvXMLExport& rExport);
     529                 :            : 
     530                 :            :     // This methods exports all (or all used) styles
     531                 :            :     void exportTextStyles( sal_Bool bUsed
     532                 :            :                            , sal_Bool bProg = sal_False
     533                 :            :                          );
     534                 :            : 
     535                 :            :     /// This method exports (text field) declarations etc.
     536                 :            :     void exportTextDeclarations();
     537                 :            : 
     538                 :            :     /// export the (text field) declarations for a particular XText
     539                 :            :     void exportTextDeclarations(
     540                 :            :         const ::com::sun::star::uno::Reference <
     541                 :            :             ::com::sun::star::text::XText > & rText );
     542                 :            : 
     543                 :            :     /// true: export only those declarations that are used;
     544                 :            :     /// false: export all declarations
     545                 :            :     void exportUsedDeclarations( sal_Bool bOnlyUsed );
     546                 :            : 
     547                 :            :     /// Export the list of change information (enclosed by <tracked-changes>)
     548                 :            :     /// (or the necessary automatic styles)
     549                 :            :     void exportTrackedChanges(sal_Bool bAutoStyle);
     550                 :            : 
     551                 :            :     /// Export the list of change information (enclosed by <tracked-changes>)
     552                 :            :     /// (or the necessary automatic styles)
     553                 :            :     void exportTrackedChanges(const ::com::sun::star::uno::Reference <
     554                 :            :                                   ::com::sun::star::text::XText > & rText,
     555                 :            :                               sal_Bool bAutoStyle );
     556                 :            : 
     557                 :            :     /// Record tracked changes for this particular XText
     558                 :            :     /// (empty reference stop recording)
     559                 :            :     /// This should be used if tracked changes for e.g. footers are to
     560                 :            :     /// be exported seperately via the exportTrackedChanges(sal_Bool,
     561                 :            :     /// Reference<XText>) method.
     562                 :            :     void recordTrackedChangesForXText(
     563                 :            :         const ::com::sun::star::uno::Reference <
     564                 :            :             ::com::sun::star::text::XText > & rText );
     565                 :            : 
     566                 :            : 
     567                 :            :     /// Stop recording tracked changes.
     568                 :            :     /// This is the same as calling recordTrackedChanges(...) with an
     569                 :            :     /// empty reference.
     570                 :            :     void recordTrackedChangesNoXText();
     571                 :            : 
     572                 :            : 
     573                 :            :     // This method exports the given OUString
     574                 :            :     void exportText(
     575                 :            :         const ::rtl::OUString& rText,
     576                 :            :         bool& rPrevCharWasSpace );
     577                 :            : 
     578                 :            :     // This method collects all automatic styles for the given XText
     579                 :         47 :     void collectTextAutoStyles(
     580                 :            :         const ::com::sun::star::uno::Reference <
     581                 :            :             ::com::sun::star::text::XText > & rText,
     582                 :            :         sal_Bool bIsProgress = sal_False,
     583                 :            :         sal_Bool bExportParagraph = sal_True )
     584                 :            :     {
     585                 :         47 :         exportText( rText, sal_True, bIsProgress, bExportParagraph );
     586                 :         47 :     }
     587                 :            : 
     588                 :            :     void collectTextAutoStyles(
     589                 :            :         const ::com::sun::star::uno::Reference <
     590                 :            :             ::com::sun::star::text::XText > & rText,
     591                 :            :         const ::com::sun::star::uno::Reference <
     592                 :            :             ::com::sun::star::text::XTextSection > & rBaseSection,
     593                 :            :         sal_Bool bIsProgress = sal_False,
     594                 :            :         sal_Bool bExportParagraph = sal_True )
     595                 :            :     {
     596                 :            :         exportText( rText, rBaseSection, sal_True, bIsProgress, bExportParagraph );
     597                 :            :     }
     598                 :            : 
     599                 :            :     // It the model implements the xAutoStylesSupplier interface, the automatic
     600                 :            :     // styles can exported without iterating over the text portions
     601                 :            :     bool collectTextAutoStylesOptimized(
     602                 :            :         sal_Bool bIsProgress = sal_False );
     603                 :            : 
     604                 :            :     // This method exports all automatic styles that have been collected.
     605                 :            :     virtual void exportTextAutoStyles();
     606                 :            : 
     607                 :            :     void exportEvents( const ::com::sun::star::uno::Reference < com::sun::star::beans::XPropertySet > & rPropSet );
     608                 :            : 
     609                 :            :     // Implement Title/Description Elements UI (#i73249#)
     610                 :            :     void exportTitleAndDescription( const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySet > & rPropSet,
     611                 :            :                                     const ::com::sun::star::uno::Reference < ::com::sun::star::beans::XPropertySetInfo > & rPropSetInfo );
     612                 :            : 
     613                 :            :     // This method exports the given XText
     614                 :         47 :     void exportText(
     615                 :            :         const ::com::sun::star::uno::Reference <
     616                 :            :             ::com::sun::star::text::XText > & rText,
     617                 :            :         sal_Bool bIsProgress = sal_False,
     618                 :            :         sal_Bool bExportParagraph = sal_True)
     619                 :            :     {
     620                 :         47 :         exportText( rText, sal_False, bIsProgress, bExportParagraph );
     621                 :         47 :     }
     622                 :            : 
     623                 :            :     void exportText(
     624                 :            :         const ::com::sun::star::uno::Reference <
     625                 :            :             ::com::sun::star::text::XText > & rText,
     626                 :            :         const ::com::sun::star::uno::Reference <
     627                 :            :             ::com::sun::star::text::XTextSection > & rBaseSection,
     628                 :            :         sal_Bool bIsProgress = sal_False,
     629                 :            :         sal_Bool bExportParagraph = sal_True)
     630                 :            :     {
     631                 :            :         exportText( rText, rBaseSection, sal_False, bIsProgress, bExportParagraph );
     632                 :            :     }
     633                 :            : 
     634                 :            :     void exportFramesBoundToPage( sal_Bool bIsProgress = sal_False )
     635                 :            :     {
     636                 :            :         exportPageFrames( sal_False, bIsProgress );
     637                 :            :     }
     638                 :          0 :     void exportFramesBoundToFrame(
     639                 :            :             const ::com::sun::star::uno::Reference <
     640                 :            :                     ::com::sun::star::text::XTextFrame >& rParentTxtFrame,
     641                 :            :             sal_Bool bIsProgress = sal_False )
     642                 :            :     {
     643                 :          0 :         exportFrameFrames( sal_False, bIsProgress, &rParentTxtFrame );
     644                 :          0 :     }
     645                 :            :     inline const XMLTextListAutoStylePool& GetListAutoStylePool() const;
     646                 :            : 
     647                 :            :     void SetBlockMode( sal_Bool bSet ) { bBlock = bSet; }
     648                 :        119 :     sal_Bool IsBlockMode() const { return bBlock; }
     649                 :            : 
     650                 :            : 
     651                 :         92 :     UniReference < SvXMLExportPropertyMapper > GetParagraphPropertyMapper() const
     652                 :            :     {
     653                 :         92 :         return xParaPropMapper;
     654                 :            :     }
     655                 :            : 
     656                 :            : 
     657                 :            :     /** exclude form controls which are in mute sections.
     658                 :            :      *
     659                 :            :      * This method is necessary to prevent the form layer export from exporting
     660                 :            :      * control models whose controls are not represented in the document.  To
     661                 :            :      * achieve this, this method iterates over all shapes, checks to see if
     662                 :            :      * they are control shapes, and if so, whether they should be exported or
     663                 :            :      * not. If not, the form layer export will be notified accordingly.
     664                 :            :      *
     665                 :            :      * The reason this method is located here is tha it needs to access the
     666                 :            :      * XMLSectionExport, which is only available here.
     667                 :            :      */
     668                 :            :     void PreventExportOfControlsInMuteSections(
     669                 :            :         const ::com::sun::star::uno::Reference<
     670                 :            :             ::com::sun::star::container::XIndexAccess> & rShapes,
     671                 :            :         UniReference<xmloff::OFormLayerXMLExport> xFormExport );
     672                 :            : 
     673                 :          0 :     SinglePropertySetInfoCache& GetCharStyleNamesPropInfoCache() { return aCharStyleNamesPropInfoCache; }
     674                 :            : 
     675                 :            :     void PushNewTextListsHelper();
     676                 :            : 
     677                 :            :     void PopTextListsHelper();
     678                 :            : 
     679                 :            : private:
     680                 :            :         XMLTextParagraphExport(XMLTextParagraphExport &); // private copy-ctor because of explicit copy-ctor of auto_ptr
     681                 :            : };
     682                 :            : 
     683                 :            : inline const XMLTextListAutoStylePool&
     684                 :        244 :     XMLTextParagraphExport::GetListAutoStylePool() const
     685                 :            : {
     686                 :        244 :     return *pListAutoPool;
     687                 :            : }
     688                 :            : 
     689                 :          0 : inline void XMLTextParagraphExport::exportTextFrame(
     690                 :            :         const ::com::sun::star::uno::Reference <
     691                 :            :             ::com::sun::star::text::XTextContent > & rTextContent,
     692                 :            :         sal_Bool bAutoStyles, sal_Bool bIsProgress, sal_Bool bExportContent,
     693                 :            :         const ::com::sun::star::uno::Reference <
     694                 :            :             ::com::sun::star::beans::XPropertySet > *pRangePropSet)
     695                 :            : {
     696                 :            :     exportAnyTextFrame( rTextContent, FT_TEXT, bAutoStyles, bIsProgress,
     697                 :          0 :                         bExportContent, pRangePropSet );
     698                 :          0 : }
     699                 :            : 
     700                 :          0 : inline void XMLTextParagraphExport::exportTextGraphic(
     701                 :            :         const ::com::sun::star::uno::Reference <
     702                 :            :             ::com::sun::star::text::XTextContent > & rTextContent,
     703                 :            :         sal_Bool bAutoStyles,
     704                 :            :         const ::com::sun::star::uno::Reference <
     705                 :            :             ::com::sun::star::beans::XPropertySet > *pRangePropSet )
     706                 :            : {
     707                 :            :     exportAnyTextFrame( rTextContent, FT_GRAPHIC, bAutoStyles, sal_False,
     708                 :          0 :                         sal_True, pRangePropSet );
     709                 :          0 : }
     710                 :            : 
     711                 :          0 : inline void XMLTextParagraphExport::exportTextEmbedded(
     712                 :            :         const ::com::sun::star::uno::Reference <
     713                 :            :             ::com::sun::star::text::XTextContent > & rTextContent,
     714                 :            :         sal_Bool bAutoStyles,
     715                 :            :         const ::com::sun::star::uno::Reference <
     716                 :            :             ::com::sun::star::beans::XPropertySet > *pRangePropSet )
     717                 :            : {
     718                 :            :     exportAnyTextFrame( rTextContent, FT_EMBEDDED, bAutoStyles, sal_False,
     719                 :          0 :                         sal_True, pRangePropSet );
     720                 :          0 : }
     721                 :            : 
     722                 :          0 : inline void XMLTextParagraphExport::exportShape(
     723                 :            :         const ::com::sun::star::uno::Reference <
     724                 :            :             ::com::sun::star::text::XTextContent > & rTextContent,
     725                 :            :         sal_Bool bAutoStyles,
     726                 :            :         const ::com::sun::star::uno::Reference <
     727                 :            :             ::com::sun::star::beans::XPropertySet > *pRangePropSet )
     728                 :            : {
     729                 :            :     exportAnyTextFrame( rTextContent, FT_SHAPE, bAutoStyles, sal_False,
     730                 :          0 :                         sal_True, pRangePropSet );
     731                 :          0 : }
     732                 :            : 
     733                 :            : #endif
     734                 :            : 
     735                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10