LCOV - code coverage report
Current view: top level - libreoffice/xmloff/source/draw - sdxmlexp.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 22 1467 1.5 %
Date: 2012-12-27 Functions: 22 130 16.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             : #include <xmloff/unointerfacetouniqueidentifiermapper.hxx>
      21             : #include <xmloff/nmspmap.hxx>
      22             : #include "xmloff/xmlnmspe.hxx"
      23             : #include <xmloff/xmluconv.hxx>
      24             : #include <xmloff/xmltoken.hxx>
      25             : #include <xmloff/xmlmetae.hxx>
      26             : #include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
      27             : #include <com/sun/star/presentation/XPresentationSupplier.hpp>
      28             : #include <com/sun/star/presentation/XCustomPresentationSupplier.hpp>
      29             : #include <com/sun/star/geometry/RealPoint2D.hpp>
      30             : #include <com/sun/star/task/XStatusIndicatorSupplier.hpp>
      31             : #include <com/sun/star/office/XAnnotationAccess.hpp>
      32             : #include <com/sun/star/lang/Locale.hpp>
      33             : #include <com/sun/star/uno/Any.hxx>
      34             : #include "sdxmlexp_impl.hxx"
      35             : #include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
      36             : #include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
      37             : #include <com/sun/star/presentation/XHandoutMasterSupplier.hpp>
      38             : #include <com/sun/star/container/XIndexContainer.hpp>
      39             : #include <com/sun/star/view/PaperOrientation.hpp>
      40             : #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
      41             : #include <com/sun/star/style/XStyle.hpp>
      42             : 
      43             : #include <com/sun/star/form/XFormsSupplier2.hpp>
      44             : #include <com/sun/star/presentation/XPresentationPage.hpp>
      45             : #include <com/sun/star/drawing/XMasterPageTarget.hpp>
      46             : #include <com/sun/star/text/XText.hpp>
      47             : #include <com/sun/star/chart/XChartDocument.hpp>
      48             : #include <com/sun/star/animations/XAnimationNodeSupplier.hpp>
      49             : #include <com/sun/star/container/XNamed.hpp>
      50             : #include <com/sun/star/util/Duration.hpp>
      51             : #include <com/sun/star/util/MeasureUnit.hpp>
      52             : #include <rtl/ustrbuf.hxx>
      53             : #include <tools/gen.hxx>
      54             : #include <tools/debug.hxx>
      55             : #include <sax/tools/converter.hxx>
      56             : #include <xmloff/xmlaustp.hxx>
      57             : #include <xmloff/families.hxx>
      58             : #include <xmloff/styleexp.hxx>
      59             : #include <xmloff/settingsstore.hxx>
      60             : #include "sdpropls.hxx"
      61             : #include <xmloff/xmlexppr.hxx>
      62             : #include <com/sun/star/beans/XPropertyState.hpp>
      63             : #include "xexptran.hxx"
      64             : 
      65             : #include <cppuhelper/implbase1.hxx>
      66             : #include <comphelper/extract.hxx>
      67             : #include <com/sun/star/lang/XServiceInfo.hpp>
      68             : #include "PropertySetMerger.hxx"
      69             : #include "layerexp.hxx"
      70             : 
      71             : #include "XMLNumberStylesExport.hxx"
      72             : 
      73             : #include <xmloff/animationexport.hxx>
      74             : 
      75             : #include <com/sun/star/document/XDocumentProperties.hpp>
      76             : #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
      77             : 
      78             : using ::rtl::OUString;
      79             : using ::rtl::OUStringBuffer;
      80             : 
      81             : using namespace ::com::sun::star;
      82             : using namespace ::com::sun::star::uno;
      83             : using namespace ::com::sun::star::beans;
      84             : using namespace ::com::sun::star::util;
      85             : using namespace ::com::sun::star::container;
      86             : using namespace ::com::sun::star::drawing;
      87             : using namespace ::com::sun::star::office;
      88             : using namespace ::com::sun::star::presentation;
      89             : using namespace ::com::sun::star::geometry;
      90             : using namespace ::com::sun::star::text;
      91             : using namespace ::xmloff::token;
      92             : 
      93             : 
      94             : //////////////////////////////////////////////////////////////////////////////
      95             : 
      96           0 : class ImpXMLEXPPageMasterInfo
      97             : {
      98             :     sal_Int32                   mnBorderBottom;
      99             :     sal_Int32                   mnBorderLeft;
     100             :     sal_Int32                   mnBorderRight;
     101             :     sal_Int32                   mnBorderTop;
     102             :     sal_Int32                   mnWidth;
     103             :     sal_Int32                   mnHeight;
     104             :     view::PaperOrientation      meOrientation;
     105             :     OUString                    msName;
     106             :     OUString                    msMasterPageName;
     107             : 
     108             : public:
     109             :     ImpXMLEXPPageMasterInfo(const SdXMLExport& rExp, const Reference<XDrawPage>& xPage);
     110             :     sal_Bool operator==(const ImpXMLEXPPageMasterInfo& rInfo) const;
     111             :     void SetName(const OUString& rStr);
     112             : 
     113           0 :     const OUString& GetName() const { return msName; }
     114           0 :     const OUString& GetMasterPageName() const { return msMasterPageName; }
     115             : 
     116           0 :     sal_Int32 GetBorderBottom() const { return mnBorderBottom; }
     117           0 :     sal_Int32 GetBorderLeft() const { return mnBorderLeft; }
     118           0 :     sal_Int32 GetBorderRight() const { return mnBorderRight; }
     119           0 :     sal_Int32 GetBorderTop() const { return mnBorderTop; }
     120           0 :     sal_Int32 GetWidth() const { return mnWidth; }
     121           0 :     sal_Int32 GetHeight() const { return mnHeight; }
     122           0 :     view::PaperOrientation GetOrientation() const { return meOrientation; }
     123             : };
     124             : 
     125           0 : ImpXMLEXPPageMasterInfo::ImpXMLEXPPageMasterInfo(
     126             :     const SdXMLExport& rExp,
     127             :     const Reference<XDrawPage>& xPage)
     128             : :   mnBorderBottom(0),
     129             :     mnBorderLeft(0),
     130             :     mnBorderRight(0),
     131             :     mnBorderTop(0),
     132             :     mnWidth(0),
     133             :     mnHeight(0),
     134           0 :     meOrientation(rExp.IsDraw() ? view::PaperOrientation_PORTRAIT : view::PaperOrientation_LANDSCAPE)
     135             : {
     136           0 :     Reference <beans::XPropertySet> xPropSet(xPage, UNO_QUERY);
     137           0 :     if(xPropSet.is())
     138             :     {
     139           0 :         Any aAny;
     140             : 
     141           0 :         Reference< beans::XPropertySetInfo > xPropsInfo( xPropSet->getPropertySetInfo() );
     142           0 :         if( xPropsInfo.is() && xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderBottom") )))
     143             :         {
     144           0 :             aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderBottom")));
     145           0 :             aAny >>= mnBorderBottom;
     146             : 
     147           0 :             aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderLeft")));
     148           0 :             aAny >>= mnBorderLeft;
     149             : 
     150           0 :             aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderRight")));
     151           0 :             aAny >>= mnBorderRight;
     152             : 
     153           0 :             aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderTop")));
     154           0 :             aAny >>= mnBorderTop;
     155             :         }
     156             : 
     157           0 :         if( xPropsInfo.is() && xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("Width") )))
     158             :         {
     159           0 :             aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Width")));
     160           0 :             aAny >>= mnWidth;
     161             : 
     162           0 :             aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Height")));
     163           0 :             aAny >>= mnHeight;
     164             :         }
     165             : 
     166           0 :         if( xPropsInfo.is() && xPropsInfo->hasPropertyByName(OUString(RTL_CONSTASCII_USTRINGPARAM("Orientation") )))
     167             :         {
     168           0 :             aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Orientation")));
     169           0 :             aAny >>= meOrientation;
     170           0 :         }
     171             :     }
     172             : 
     173           0 :     Reference <container::XNamed> xMasterNamed(xPage, UNO_QUERY);
     174           0 :     if(xMasterNamed.is())
     175             :     {
     176           0 :         msMasterPageName = xMasterNamed->getName();
     177           0 :     }
     178           0 : }
     179             : 
     180           0 : sal_Bool ImpXMLEXPPageMasterInfo::operator==(const ImpXMLEXPPageMasterInfo& rInfo) const
     181             : {
     182             :     return ((mnBorderBottom == rInfo.mnBorderBottom)
     183             :         && (mnBorderLeft == rInfo.mnBorderLeft)
     184             :         && (mnBorderRight == rInfo.mnBorderRight)
     185             :         && (mnBorderTop == rInfo.mnBorderTop)
     186             :         && (mnWidth == rInfo.mnWidth)
     187             :         && (mnHeight == rInfo.mnHeight)
     188           0 :         && (meOrientation == rInfo.meOrientation));
     189             : }
     190             : 
     191           0 : void ImpXMLEXPPageMasterInfo::SetName(const OUString& rStr)
     192             : {
     193           0 :     msName = rStr;
     194           0 : }
     195             : 
     196             : //////////////////////////////////////////////////////////////////////////////
     197             : 
     198             : #define IMP_AUTOLAYOUT_INFO_MAX         (35L)
     199             : 
     200           0 : class ImpXMLAutoLayoutInfo
     201             : {
     202             :     sal_uInt16                  mnType;
     203             :     ImpXMLEXPPageMasterInfo*    mpPageMasterInfo;
     204             :     OUString                    msLayoutName;
     205             :     Rectangle                   maTitleRect;
     206             :     Rectangle                   maPresRect;
     207             :     sal_Int32                   mnGapX;
     208             :     sal_Int32                   mnGapY;
     209             : 
     210             : public:
     211             :     ImpXMLAutoLayoutInfo(sal_uInt16 nTyp, ImpXMLEXPPageMasterInfo* pInf);
     212             : 
     213             :     sal_Bool operator==(const ImpXMLAutoLayoutInfo& rInfo) const;
     214             : 
     215           0 :     sal_uInt16 GetLayoutType() const { return mnType; }
     216           0 :     sal_Int32 GetGapX() const { return mnGapX; }
     217           0 :     sal_Int32 GetGapY() const { return mnGapY; }
     218             : 
     219           0 :     const OUString& GetLayoutName() const { return msLayoutName; }
     220           0 :     void SetLayoutName(const OUString& rNew) { msLayoutName = rNew; }
     221             : 
     222           0 :     const Rectangle& GetTitleRectangle() const { return maTitleRect; }
     223           0 :     const Rectangle& GetPresRectangle() const { return maPresRect; }
     224             : 
     225             :     static sal_Bool IsCreateNecessary(sal_uInt16 nTyp);
     226             : };
     227             : 
     228           0 : sal_Bool ImpXMLAutoLayoutInfo::IsCreateNecessary(sal_uInt16 nTyp)
     229             : {
     230           0 :     if(nTyp == 5 /* AUTOLAYOUT_ORG */
     231             :         || nTyp == 20 /* AUTOLAYOUT_NONE */
     232             :         || nTyp >= IMP_AUTOLAYOUT_INFO_MAX)
     233           0 :         return sal_False;
     234           0 :     return sal_True;
     235             : }
     236             : 
     237           0 : sal_Bool ImpXMLAutoLayoutInfo::operator==(const ImpXMLAutoLayoutInfo& rInfo) const
     238             : {
     239             :     return ((mnType == rInfo.mnType
     240           0 :         && mpPageMasterInfo == rInfo.mpPageMasterInfo));
     241             : }
     242             : 
     243           0 : ImpXMLAutoLayoutInfo::ImpXMLAutoLayoutInfo(sal_uInt16 nTyp, ImpXMLEXPPageMasterInfo* pInf)
     244             : :   mnType(nTyp),
     245           0 :     mpPageMasterInfo(pInf)
     246             : {
     247             :     // create full info (initialze with typical values)
     248           0 :     Point aPagePos(0,0);
     249           0 :     Size aPageSize(28000, 21000);
     250           0 :     Size aPageInnerSize(28000, 21000);
     251             : 
     252           0 :     if(mpPageMasterInfo)
     253             :     {
     254           0 :         aPagePos = Point(mpPageMasterInfo->GetBorderLeft(), mpPageMasterInfo->GetBorderTop());
     255           0 :         aPageSize = Size(mpPageMasterInfo->GetWidth(), mpPageMasterInfo->GetHeight());
     256           0 :         aPageInnerSize = aPageSize;
     257           0 :         aPageInnerSize.Width() -= mpPageMasterInfo->GetBorderLeft() + mpPageMasterInfo->GetBorderRight();
     258           0 :         aPageInnerSize.Height() -= mpPageMasterInfo->GetBorderTop() + mpPageMasterInfo->GetBorderBottom();
     259             :     }
     260             : 
     261             :     // title rectangle aligning
     262           0 :     Point aTitlePos(aPagePos);
     263           0 :     Size aTitleSize(aPageInnerSize);
     264             : 
     265           0 :     if(mnType == 21 /* AUTOLAYOUT_NOTES */)
     266             :     {
     267           0 :         aTitleSize.Height() = (long) (aTitleSize.Height() / 2.5);
     268           0 :         Point aPos = aTitlePos;
     269           0 :         aPos.Y() += long( aTitleSize.Height() * 0.083 );
     270           0 :         Size aPartArea = aTitleSize;
     271           0 :         Size aSize;
     272             : 
     273             :         // scale handout rectangle using actual page size
     274           0 :         double fH = (double) aPartArea.Width()  / aPageSize.Width();
     275           0 :         double fV = (double) aPartArea.Height() / aPageSize.Height();
     276             : 
     277           0 :         if ( fH > fV )
     278           0 :             fH = fV;
     279           0 :         aSize.Width()  = (long) (fH * aPageSize.Width());
     280           0 :         aSize.Height() = (long) (fH * aPageSize.Height());
     281             : 
     282           0 :         aPos.X() += (aPartArea.Width() - aSize.Width()) / 2;
     283           0 :         aPos.Y() += (aPartArea.Height()- aSize.Height())/ 2;
     284             : 
     285           0 :         aTitlePos = aPos;
     286           0 :         aTitleSize = aSize;
     287             :     }
     288           0 :     else if(mnType == 27 || mnType == 28)
     289             :     {
     290             :         // AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART or
     291             :         // AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE
     292             :         Point aClassicTPos(
     293           0 :             aTitlePos.X() + long( aTitleSize.Width() * 0.0735 ),
     294           0 :             aTitlePos.Y() + long( aTitleSize.Height() * 0.083 ));
     295             :         Size aClassicTSize(
     296           0 :             long( aTitleSize.Width() * 0.854 ),
     297           0 :             long( aTitleSize.Height() * 0.167 ));
     298           0 :         Point aLPos(aPagePos);
     299           0 :         Size aLSize(aPageInnerSize);
     300             :         Point aClassicLPos(
     301           0 :             aLPos.X() + long( aLSize.Width() * 0.0735 ),
     302           0 :             aLPos.Y() + long( aLSize.Height() * 0.472 ));
     303             :         Size aClassicLSize(
     304           0 :             long( aLSize.Width() * 0.854 ),
     305           0 :             long( aLSize.Height() * 0.444 ));
     306             : 
     307           0 :         aTitlePos.X() = (aClassicTPos.X() + aClassicTSize.Width()) - aClassicTSize.Height();
     308           0 :         aTitlePos.Y() = aClassicTPos.Y();
     309           0 :         aTitleSize.Width() = aClassicTSize.Height();
     310           0 :         aTitleSize.Height() = (aClassicLPos.Y() + aClassicLSize.Height()) - aClassicTPos.Y();
     311             :     }
     312             :     else
     313             :     {
     314           0 :         aTitlePos.X() += long( aTitleSize.Width() * 0.0735 );
     315           0 :         aTitlePos.Y() += long( aTitleSize.Height() * 0.083 );
     316           0 :         aTitleSize.Width() = long( aTitleSize.Width() * 0.854 );
     317           0 :         aTitleSize.Height() = long( aTitleSize.Height() * 0.167 );
     318             :     }
     319             : 
     320           0 :     maTitleRect.SetPos(aTitlePos);
     321           0 :     maTitleRect.SetSize(aTitleSize);
     322             : 
     323             :     // layout rectangle aligning
     324           0 :     Point aLayoutPos(aPagePos);
     325           0 :     Size aLayoutSize(aPageInnerSize);
     326             : 
     327           0 :     if(mnType == 21 /* AUTOLAYOUT_NOTES */)
     328             :     {
     329           0 :         aLayoutPos.X() += long( aLayoutSize.Width() * 0.0735 );
     330           0 :         aLayoutPos.Y() += long( aLayoutSize.Height() * 0.472 );
     331           0 :         aLayoutSize.Width() = long( aLayoutSize.Width() * 0.854 );
     332           0 :         aLayoutSize.Height() = long( aLayoutSize.Height() * 0.444 );
     333             :     }
     334           0 :     else if((mnType >= 22 && mnType <= 26) || (mnType == 31)) // AUTOLAYOUT_HANDOUT
     335             :     {
     336             :         // keep info for inner area in maPresRect, put info for gap size
     337             :         // to maTitleRect position
     338           0 :         mnGapX = (aPageSize.Width() - aPageInnerSize.Width()) / 2;
     339           0 :         mnGapY = (aPageSize.Height() - aPageInnerSize.Height()) / 2;
     340             : 
     341           0 :         if(!mnGapX)
     342           0 :             mnGapX = aPageSize.Width() / 10;
     343             : 
     344           0 :         if(!mnGapY)
     345           0 :             mnGapY = aPageSize.Height() / 10;
     346             : 
     347           0 :         if(mnGapX < aPageInnerSize.Width() / 10)
     348           0 :             mnGapX = aPageInnerSize.Width() / 10;
     349             : 
     350           0 :         if(mnGapY < aPageInnerSize.Height() / 10)
     351           0 :             mnGapY = aPageInnerSize.Height() / 10;
     352             :     }
     353           0 :     else if(mnType == 27 || mnType == 28)
     354             :     {
     355             :         // AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART or
     356             :         // AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE
     357             :         Point aClassicTPos(
     358           0 :             aTitlePos.X() + long( aTitleSize.Width() * 0.0735 ),
     359           0 :             aTitlePos.Y() + long( aTitleSize.Height() * 0.083 ));
     360             :         Size aClassicTSize(
     361           0 :             long( aTitleSize.Width() * 0.854 ),
     362           0 :             long( aTitleSize.Height() * 0.167 ));
     363             :         Point aClassicLPos(
     364           0 :             aLayoutPos.X() + long( aLayoutSize.Width() * 0.0735 ),
     365           0 :             aLayoutPos.Y() + long( aLayoutSize.Height() * 0.472 ));
     366             :         Size aClassicLSize(
     367           0 :             long( aLayoutSize.Width() * 0.854 ),
     368           0 :             long( aLayoutSize.Height() * 0.444 ));
     369             : 
     370           0 :         aLayoutPos.X() = aClassicLPos.X();
     371           0 :         aLayoutPos.Y() = aClassicTPos.Y();
     372           0 :         aLayoutSize.Width() = (aClassicLPos.X() + aClassicLSize.Width())
     373           0 :             - (aClassicTSize.Height() + (aClassicLPos.Y() - (aClassicTPos.Y() + aClassicTSize.Height())));
     374           0 :         aLayoutSize.Height() = (aClassicLPos.Y() + aClassicLSize.Height()) - aClassicTPos.Y();
     375             :     }
     376           0 :     else if( mnType == 32 )
     377             :     {
     378             :         // AUTOLAYOUT_ONLY_TEXT
     379           0 :         aLayoutPos = aTitlePos;
     380           0 :         aLayoutSize.Width() = aTitleSize.Width();
     381           0 :         aLayoutSize.Height() = long( aLayoutSize.Height() * 0.825 );
     382             :     }
     383             :     else
     384             :     {
     385           0 :         aLayoutPos.X() += long( aLayoutSize.Width() * 0.0735 );
     386           0 :         aLayoutPos.Y() += long( aLayoutSize.Height() * 0.278 );
     387           0 :         aLayoutSize.Width() = long( aLayoutSize.Width() * 0.854 );
     388           0 :         aLayoutSize.Height() = long( aLayoutSize.Height() * 0.630 );
     389             :     }
     390             : 
     391           0 :     maPresRect.SetPos(aLayoutPos);
     392           0 :     maPresRect.SetSize(aLayoutSize);
     393           0 : }
     394             : 
     395             : //////////////////////////////////////////////////////////////////////////////
     396             : 
     397             : // #110680#
     398           0 : SdXMLExport::SdXMLExport(
     399             :     const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
     400             :     sal_Bool bIsDraw, sal_uInt16 nExportFlags )
     401             : :   SvXMLExport( util::MeasureUnit::CM, xServiceFactory,
     402             :         (bIsDraw) ? XML_GRAPHICS : XML_PRESENTATION, nExportFlags ),
     403             :     mnDocMasterPageCount(0L),
     404             :     mnDocDrawPageCount(0L),
     405             :     mnShapeStyleInfoIndex(0L),
     406             :     mnObjectCount(0L),
     407           0 :     mpPageMasterInfoList(new ImpXMLEXPPageMasterList()),
     408           0 :     mpPageMasterUsageList(new ImpXMLEXPPageMasterList()),
     409           0 :     mpNotesPageMasterUsageList(new ImpXMLEXPPageMasterList()),
     410             :     mpHandoutPageMaster(NULL),
     411           0 :     mpAutoLayoutInfoList(new ImpXMLAutoLayoutInfoList()),
     412             :     mpSdPropHdlFactory(0L),
     413             :     mpPropertySetMapper(0L),
     414             :     mpPresPagePropsMapper(0L),
     415             :     mbIsDraw(bIsDraw),
     416             :     mbFamilyGraphicUsed(sal_False),
     417             :     mbFamilyPresentationUsed(sal_False),
     418           0 :     msZIndex( GetXMLToken(XML_ZINDEX) ),
     419             :     msEmptyPres( RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") ),
     420             :     msModel( RTL_CONSTASCII_USTRINGPARAM("Model") ),
     421             :     msStartShape( RTL_CONSTASCII_USTRINGPARAM("StartShape") ),
     422             :     msEndShape( RTL_CONSTASCII_USTRINGPARAM("EndShape") ),
     423           0 :     msPageLayoutNames( RTL_CONSTASCII_USTRINGPARAM("PageLayoutNames") )
     424             : {
     425             : 
     426             : 
     427           0 : }
     428             : 
     429             : // XExporter
     430           0 : void SAL_CALL SdXMLExport::setSourceDocument( const Reference< lang::XComponent >& xDoc )
     431             :     throw(lang::IllegalArgumentException, uno::RuntimeException)
     432             : {
     433           0 :     SvXMLExport::setSourceDocument( xDoc );
     434             : 
     435           0 :     const OUString aEmpty;
     436             : 
     437             :     // prepare factory parts
     438           0 :     mpSdPropHdlFactory = new XMLSdPropHdlFactory( GetModel(), *this );
     439           0 :     if(mpSdPropHdlFactory)
     440             :     {
     441             :         // set lock to avoid deletion
     442           0 :         mpSdPropHdlFactory->acquire();
     443             : 
     444             :         // build one ref
     445           0 :         const UniReference< XMLPropertyHandlerFactory > aFactoryRef = mpSdPropHdlFactory;
     446             : 
     447             :         // construct PropertySetMapper
     448           0 :         UniReference < XMLPropertySetMapper > xMapper = new XMLShapePropertySetMapper( aFactoryRef);
     449             : 
     450           0 :         mpPropertySetMapper = new XMLShapeExportPropertyMapper( xMapper, *this );
     451             :         // set lock to avoid deletion
     452           0 :         mpPropertySetMapper->acquire();
     453             : 
     454             :         // chain text attributes
     455           0 :         mpPropertySetMapper->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(*this));
     456             : 
     457             :         // construct PresPagePropsMapper
     458           0 :         xMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLSDPresPageProps, aFactoryRef);
     459             : 
     460           0 :         mpPresPagePropsMapper = new XMLPageExportPropertyMapper( xMapper, *this  );
     461           0 :         if(mpPresPagePropsMapper)
     462             :         {
     463             :             // set lock to avoid deletion
     464           0 :             mpPresPagePropsMapper->acquire();
     465           0 :         }
     466             :     }
     467             : 
     468             :     // add family name
     469             :       GetAutoStylePool()->AddFamily(
     470             :         XML_STYLE_FAMILY_SD_GRAPHICS_ID,
     471             :         OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)),
     472           0 :           GetPropertySetMapper(),
     473           0 :           OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_PREFIX)));
     474             :     GetAutoStylePool()->AddFamily(
     475             :         XML_STYLE_FAMILY_SD_PRESENTATION_ID,
     476             :         OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_NAME)),
     477           0 :           GetPropertySetMapper(),
     478           0 :           OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_PREFIX)));
     479             :     GetAutoStylePool()->AddFamily(
     480             :         XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID,
     481             :         OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME)),
     482           0 :           GetPresPagePropsMapper(),
     483           0 :           OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_DRAWINGPAGE_PREFIX)));
     484             :     // prepare access to styles
     485           0 :     Reference< style::XStyleFamiliesSupplier > xFamSup( GetModel(), UNO_QUERY );
     486           0 :     if(xFamSup.is())
     487             :     {
     488           0 :         mxDocStyleFamilies = xFamSup->getStyleFamilies();
     489             :     }
     490             : 
     491             :     // prepare access to master pages
     492           0 :     Reference < drawing::XMasterPagesSupplier > xMasterPagesSupplier(GetModel(), UNO_QUERY);
     493           0 :     if(xMasterPagesSupplier.is())
     494             :     {
     495           0 :         mxDocMasterPages = mxDocMasterPages.query( xMasterPagesSupplier->getMasterPages() );
     496           0 :         if(mxDocMasterPages.is())
     497             :         {
     498           0 :             mnDocMasterPageCount = mxDocMasterPages->getCount();
     499           0 :             maMasterPagesStyleNames.insert( maMasterPagesStyleNames.begin(), mnDocMasterPageCount, aEmpty );
     500             :         }
     501             :     }
     502             : 
     503             :     // prepare access to draw pages
     504           0 :     Reference <XDrawPagesSupplier> xDrawPagesSupplier(GetModel(), UNO_QUERY);
     505           0 :     if(xDrawPagesSupplier.is())
     506             :     {
     507           0 :         mxDocDrawPages = mxDocDrawPages.query( xDrawPagesSupplier->getDrawPages() );
     508           0 :         if(mxDocDrawPages.is())
     509             :         {
     510           0 :             mnDocDrawPageCount = mxDocDrawPages->getCount();
     511           0 :             maDrawPagesStyleNames.insert( maDrawPagesStyleNames.begin(), mnDocDrawPageCount, aEmpty );
     512           0 :             maDrawNotesPagesStyleNames.insert( maDrawNotesPagesStyleNames.begin(), mnDocDrawPageCount, aEmpty );
     513           0 :             if( !mbIsDraw )
     514           0 :                 maDrawPagesAutoLayoutNames.realloc( mnDocDrawPageCount + 1 );
     515             : 
     516           0 :             HeaderFooterPageSettingsImpl aEmptySettings;
     517           0 :             maDrawPagesHeaderFooterSettings.insert( maDrawPagesHeaderFooterSettings.begin(), mnDocDrawPageCount, aEmptySettings );
     518           0 :             maDrawNotesPagesHeaderFooterSettings.insert( maDrawNotesPagesHeaderFooterSettings.begin(), mnDocDrawPageCount, aEmptySettings );
     519             :         }
     520             :     }
     521             : 
     522             :     // #82003# count all draw objects for use with progress bar.
     523             :     // #88245# init mnObjectCount once, use counter itself as flag. It
     524             :     // is initialized to 0.
     525           0 :     if(!mnObjectCount)
     526             :     {
     527           0 :         if( IsImpress() )
     528             :         {
     529             :              // #91587# add handout master count
     530           0 :             Reference<presentation::XHandoutMasterSupplier> xHandoutSupp(GetModel(), UNO_QUERY);
     531           0 :             if(xHandoutSupp.is())
     532             :             {
     533           0 :                 Reference<XDrawPage> xHandoutPage(xHandoutSupp->getHandoutMasterPage());
     534           0 :                 if(xHandoutPage.is())
     535             :                 {
     536           0 :                     Reference<drawing::XShapes> xShapes(xHandoutPage, UNO_QUERY);
     537           0 :                     if(xShapes.is() && xShapes->getCount())
     538             :                     {
     539           0 :                         mnObjectCount += ImpRecursiveObjectCount(xShapes);
     540           0 :                     }
     541           0 :                 }
     542           0 :             }
     543             :         }
     544             : 
     545           0 :         if(mxDocMasterPages.is())
     546             :         {
     547           0 :             for(sal_Int32 a(0); a < mnDocMasterPageCount; a++)
     548             :             {
     549           0 :                 Any aAny(mxDocMasterPages->getByIndex(a));
     550           0 :                 Reference< drawing::XShapes > xMasterPage;
     551             : 
     552           0 :                 if((aAny >>= xMasterPage) && xMasterPage.is())
     553             :                 {
     554           0 :                     mnObjectCount += ImpRecursiveObjectCount(xMasterPage);
     555             :                 }
     556             : 
     557           0 :                 if( IsImpress() )
     558             :                 {
     559             :                     // #91587# take notes pages from master pages into account
     560           0 :                     Reference<presentation::XPresentationPage> xPresPage;
     561           0 :                     if((aAny >>= xPresPage) && xPresPage.is())
     562             :                     {
     563           0 :                         Reference<XDrawPage> xNotesPage(xPresPage->getNotesPage());
     564           0 :                         if(xNotesPage.is())
     565             :                         {
     566           0 :                             Reference<drawing::XShapes> xShapes(xNotesPage, UNO_QUERY);
     567           0 :                             if(xShapes.is() && xShapes->getCount())
     568             :                             {
     569           0 :                                 mnObjectCount += ImpRecursiveObjectCount(xShapes);
     570           0 :                             }
     571           0 :                         }
     572           0 :                     }
     573             :                 }
     574           0 :             }
     575             :         }
     576             : 
     577           0 :         if(mxDocDrawPages.is())
     578             :         {
     579           0 :             for(sal_Int32 a(0); a < mnDocDrawPageCount; a++)
     580             :             {
     581           0 :                 Any aAny(mxDocDrawPages->getByIndex(a));
     582           0 :                 Reference< drawing::XShapes > xPage;
     583             : 
     584           0 :                 if((aAny >>= xPage) && xPage.is())
     585             :                 {
     586           0 :                     mnObjectCount += ImpRecursiveObjectCount(xPage);
     587             :                 }
     588             : 
     589           0 :                 if( IsImpress() )
     590             :                 {
     591             :                     // #91587# take notes pages from draw pages into account
     592           0 :                     Reference<presentation::XPresentationPage> xPresPage;
     593           0 :                     if((aAny >>= xPresPage) && xPresPage.is())
     594             :                     {
     595           0 :                         Reference<XDrawPage> xNotesPage(xPresPage->getNotesPage());
     596           0 :                         if(xNotesPage.is())
     597             :                         {
     598           0 :                             Reference<drawing::XShapes> xShapes(xNotesPage, UNO_QUERY);
     599           0 :                             if(xShapes.is() && xShapes->getCount())
     600             :                             {
     601           0 :                                 mnObjectCount += ImpRecursiveObjectCount(xShapes);
     602           0 :                             }
     603           0 :                         }
     604           0 :                     }
     605             :                 }
     606           0 :             }
     607             :         }
     608             : 
     609             :         // #82003# init progress bar
     610           0 :         GetProgressBarHelper()->SetReference(mnObjectCount);
     611             :     }
     612             : 
     613             :     // add namespaces
     614           0 :     _GetNamespaceMap().Add(
     615           0 :         GetXMLToken(XML_NP_PRESENTATION),
     616           0 :         GetXMLToken(XML_N_PRESENTATION),
     617           0 :         XML_NAMESPACE_PRESENTATION);
     618             : 
     619           0 :     _GetNamespaceMap().Add(
     620           0 :         GetXMLToken(XML_NP_SMIL),
     621           0 :         GetXMLToken(XML_N_SMIL_COMPAT),
     622           0 :         XML_NAMESPACE_SMIL);
     623             : 
     624           0 :     _GetNamespaceMap().Add(
     625           0 :         GetXMLToken(XML_NP_ANIMATION),
     626           0 :         GetXMLToken(XML_N_ANIMATION),
     627           0 :         XML_NAMESPACE_ANIMATION);
     628             : 
     629           0 :     if( getDefaultVersion() > SvtSaveOptions::ODFVER_012 )
     630             :     {
     631           0 :         _GetNamespaceMap().Add(
     632           0 :             GetXMLToken(XML_NP_OFFICE_EXT),
     633           0 :             GetXMLToken(XML_N_OFFICE_EXT),
     634           0 :             XML_NAMESPACE_OFFICE_EXT);
     635             :     }
     636             : 
     637           0 :     GetShapeExport()->enableLayerExport();
     638             : 
     639             :     // #88546# enable progress bar increments
     640           0 :     GetShapeExport()->enableHandleProgressBar();
     641           0 : }
     642             : 
     643             : //////////////////////////////////////////////////////////////////////////////
     644             : // #82003# helper function for recursive object count
     645           0 : sal_uInt32 SdXMLExport::ImpRecursiveObjectCount(Reference< drawing::XShapes > xShapes)
     646             : {
     647           0 :     sal_uInt32 nRetval(0L);
     648             : 
     649           0 :     if(xShapes.is())
     650             :     {
     651           0 :         sal_Int32 nCount = xShapes->getCount();
     652             : 
     653           0 :         for(sal_Int32 a(0L); a < nCount; a++)
     654             :         {
     655           0 :             Any aAny(xShapes->getByIndex(a));
     656           0 :             Reference< drawing::XShapes > xGroup;
     657             : 
     658           0 :             if((aAny >>= xGroup) && xGroup.is())
     659             :             {
     660             :                 // #93180# count group objects, too.
     661           0 :                 nRetval += 1 + ImpRecursiveObjectCount(xGroup);
     662             :             }
     663             :             else
     664             :             {
     665           0 :                 nRetval++;
     666             :             }
     667           0 :         }
     668             :     }
     669             : 
     670           0 :     return nRetval;
     671             : }
     672             : 
     673             : //////////////////////////////////////////////////////////////////////////////
     674             : 
     675           0 : SdXMLExport::~SdXMLExport()
     676             : {
     677             :     // cleanup factory, decrease refcount. Should lead to destruction.
     678           0 :     if(mpSdPropHdlFactory)
     679             :     {
     680           0 :         mpSdPropHdlFactory->release();
     681           0 :         mpSdPropHdlFactory = 0L;
     682             :     }
     683             : 
     684             :     // cleanup mapper, decrease refcount. Should lead to destruction.
     685           0 :     if(mpPropertySetMapper)
     686             :     {
     687           0 :         mpPropertySetMapper->release();
     688           0 :         mpPropertySetMapper = 0L;
     689             :     }
     690             : 
     691             :     // cleanup presPage mapper, decrease refcount. Should lead to destruction.
     692           0 :     if(mpPresPagePropsMapper)
     693             :     {
     694           0 :         mpPresPagePropsMapper->release();
     695           0 :         mpPresPagePropsMapper = 0L;
     696             :     }
     697             : 
     698             :     // clear evtl. temporary page master infos
     699           0 :     if(mpPageMasterUsageList)
     700             :     {
     701             :         // note: all items in this list are also in mpPageMasterInfoList
     702           0 :         delete mpPageMasterUsageList;
     703           0 :         mpPageMasterUsageList = 0L;
     704             :     }
     705             : 
     706           0 :     if(mpNotesPageMasterUsageList)
     707             :     {
     708             :         // note: all items in this list are also in mpPageMasterInfoList
     709           0 :         delete mpNotesPageMasterUsageList;
     710           0 :         mpNotesPageMasterUsageList = 0L;
     711             :     }
     712             : 
     713           0 :     if(mpPageMasterInfoList)
     714             :     {
     715           0 :         for ( size_t i = 0, n = mpPageMasterInfoList->size(); i < n; ++i )
     716           0 :             delete mpPageMasterInfoList->at( i );
     717           0 :         mpPageMasterInfoList->clear();
     718           0 :         delete mpPageMasterInfoList;
     719           0 :         mpPageMasterInfoList = 0L;
     720             :     }
     721             : 
     722             :     // clear auto-layout infos
     723           0 :     if(mpAutoLayoutInfoList)
     724             :     {
     725           0 :         for ( size_t i = 0, n = mpAutoLayoutInfoList->size(); i < n; ++i )
     726           0 :             delete mpAutoLayoutInfoList->at( i );
     727           0 :         mpAutoLayoutInfoList->clear();
     728           0 :         delete mpAutoLayoutInfoList;
     729           0 :         mpAutoLayoutInfoList = 0L;
     730             :     }
     731           0 : }
     732             : 
     733             : //////////////////////////////////////////////////////////////////////////////
     734             : 
     735           0 : void SdXMLExport::ImpPrepAutoLayoutInfos()
     736             : {
     737           0 :     if(IsImpress())
     738             :     {
     739           0 :         OUString aStr;
     740             : 
     741           0 :         Reference< presentation::XHandoutMasterSupplier > xHandoutSupp( GetModel(), UNO_QUERY );
     742           0 :         if( xHandoutSupp.is() )
     743             :         {
     744           0 :             Reference< XDrawPage > xHandoutPage( xHandoutSupp->getHandoutMasterPage() );
     745           0 :             if( xHandoutPage.is() )
     746             :             {
     747           0 :                 if(ImpPrepAutoLayoutInfo(xHandoutPage, aStr))
     748           0 :                     maDrawPagesAutoLayoutNames[0] = aStr;
     749           0 :             }
     750             :         }
     751             : 
     752             :         // prepare name creation
     753           0 :         for (sal_Int32 nCnt = 0; nCnt < mnDocDrawPageCount; nCnt++)
     754             :         {
     755           0 :             Any aAny(mxDocDrawPages->getByIndex(nCnt));
     756           0 :             Reference<XDrawPage> xDrawPage;
     757             : 
     758           0 :             if((aAny >>= xDrawPage) && xDrawPage.is())
     759             :             {
     760           0 :                 if(ImpPrepAutoLayoutInfo(xDrawPage, aStr))
     761           0 :                     maDrawPagesAutoLayoutNames[nCnt+1] = aStr;
     762             :             }
     763           0 :         }
     764             :     }
     765           0 : }
     766             : 
     767           0 : sal_Bool SdXMLExport::ImpPrepAutoLayoutInfo(const Reference<XDrawPage>& xPage, OUString& rName)
     768             : {
     769           0 :     rName = OUString();
     770           0 :     sal_Bool bRetval(sal_False);
     771             : 
     772           0 :     Reference <beans::XPropertySet> xPropSet(xPage, UNO_QUERY);
     773           0 :     if(xPropSet.is())
     774             :     {
     775           0 :         sal_uInt16 nType = sal_uInt16();
     776           0 :         Any aAny;
     777             : 
     778           0 :         aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Layout")));
     779           0 :         if(aAny >>= nType)
     780             :         {
     781           0 :             if(ImpXMLAutoLayoutInfo::IsCreateNecessary(nType))
     782             :             {
     783           0 :                 ImpXMLEXPPageMasterInfo* pInfo = 0L;
     784             : 
     785             :                 // get master-page info
     786           0 :                 Reference < drawing::XMasterPageTarget > xMasterPageInt(xPage, UNO_QUERY);
     787           0 :                 if(xMasterPageInt.is())
     788             :                 {
     789           0 :                     Reference<XDrawPage> xUsedMasterPage(xMasterPageInt->getMasterPage());
     790           0 :                     if(xUsedMasterPage.is())
     791             :                     {
     792           0 :                         Reference < container::XNamed > xMasterNamed(xUsedMasterPage, UNO_QUERY);
     793           0 :                         if(xMasterNamed.is())
     794             :                         {
     795           0 :                             OUString sMasterPageName = xMasterNamed->getName();
     796           0 :                             pInfo = ImpGetPageMasterInfoByName(sMasterPageName);
     797           0 :                         }
     798           0 :                     }
     799             :                 }
     800             : 
     801             :                 // create entry and look for existance
     802           0 :                 ImpXMLAutoLayoutInfo* pNew = new ImpXMLAutoLayoutInfo(nType, pInfo);
     803           0 :                 sal_Bool bDidExist(sal_False);
     804             : 
     805           0 :                 for( size_t nCnt = 0; !bDidExist && nCnt < mpAutoLayoutInfoList->size(); nCnt++)
     806             :                 {
     807           0 :                     if( *mpAutoLayoutInfoList->at( nCnt ) == *pNew)
     808             :                     {
     809           0 :                         delete pNew;
     810           0 :                         pNew = mpAutoLayoutInfoList->at( nCnt );
     811           0 :                         bDidExist = sal_True;
     812             :                     }
     813             :                 }
     814             : 
     815           0 :                 if(!bDidExist)
     816             :                 {
     817           0 :                     mpAutoLayoutInfoList->push_back( pNew );
     818           0 :                     OUString sNewName = OUString(RTL_CONSTASCII_USTRINGPARAM("AL"));
     819           0 :                     sNewName += OUString::valueOf(sal_Int32( mpAutoLayoutInfoList->size() - 1 ));
     820           0 :                     sNewName += OUString(RTL_CONSTASCII_USTRINGPARAM("T"));
     821           0 :                     sNewName += OUString::valueOf(sal_Int32(nType));
     822           0 :                     pNew->SetLayoutName(sNewName);
     823             :                 }
     824             : 
     825           0 :                 rName = pNew->GetLayoutName();
     826           0 :                 bRetval = sal_True;
     827             :             }
     828           0 :         }
     829             :     }
     830             : 
     831           0 :     return bRetval;
     832             : }
     833             : 
     834             : //////////////////////////////////////////////////////////////////////////////
     835             : 
     836           0 : void SdXMLExport::ImpWriteAutoLayoutInfos()
     837             : {
     838           0 :     if( !mpAutoLayoutInfoList->empty() )
     839             :     {
     840           0 :         for(size_t nCnt = 0; nCnt < mpAutoLayoutInfoList->size(); nCnt++)
     841             :         {
     842           0 :             ImpXMLAutoLayoutInfo* pInfo = mpAutoLayoutInfoList->at( nCnt );
     843           0 :             if(pInfo)
     844             :             {
     845             :                 // prepare presentation-page layout attributes, style-name
     846           0 :                 AddAttribute(XML_NAMESPACE_STYLE, XML_NAME, pInfo->GetLayoutName());
     847             : 
     848             :                 // write draw-style attributes
     849           0 :                 SvXMLElementExport aDSE(*this, XML_NAMESPACE_STYLE, XML_PRESENTATION_PAGE_LAYOUT, sal_True, sal_True);
     850             : 
     851             :                 // write presentation placeholders
     852           0 :                 switch(pInfo->GetLayoutType())
     853             :                 {
     854             :                     case 0 : // AUTOLAYOUT_TITLE
     855             :                     {
     856           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
     857           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderSubtitle, pInfo->GetPresRectangle());
     858           0 :                         break;
     859             :                     }
     860             :                     case 1 : // AUTOLAYOUT_ENUM
     861             :                     {
     862           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
     863           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, pInfo->GetPresRectangle());
     864           0 :                         break;
     865             :                     }
     866             :                     case 2 : // AUTOLAYOUT_CHART
     867             :                     {
     868           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
     869           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart, pInfo->GetPresRectangle());
     870           0 :                         break;
     871             :                     }
     872             :                     case 3 : // AUTOLAYOUT_2TEXT
     873             :                     {
     874           0 :                         Rectangle aLeft(pInfo->GetPresRectangle());
     875           0 :                         aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
     876           0 :                         Rectangle aRight(aLeft);
     877           0 :                         aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
     878             : 
     879           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
     880           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aLeft);
     881           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aRight);
     882             :                         break;
     883             :                     }
     884             :                     case 4 : // AUTOLAYOUT_TEXTCHART
     885             :                     {
     886           0 :                         Rectangle aLeft(pInfo->GetPresRectangle());
     887           0 :                         aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
     888           0 :                         Rectangle aRight(aLeft);
     889           0 :                         aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
     890             : 
     891           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
     892           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aLeft);
     893           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart, aRight);
     894             :                         break;
     895             :                     }
     896             :                     case 6 : // AUTOLAYOUT_TEXTCLIP
     897             :                     {
     898           0 :                         Rectangle aLeft(pInfo->GetPresRectangle());
     899           0 :                         aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
     900           0 :                         Rectangle aRight(aLeft);
     901           0 :                         aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
     902             : 
     903           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
     904           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aLeft);
     905           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aRight);
     906             :                         break;
     907             :                     }
     908             :                     case 7 : // AUTOLAYOUT_CHARTTEXT
     909             :                     {
     910           0 :                         Rectangle aLeft(pInfo->GetPresRectangle());
     911           0 :                         aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
     912           0 :                         Rectangle aRight(aLeft);
     913           0 :                         aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
     914             : 
     915           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
     916           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart, aLeft);
     917           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aRight);
     918             :                         break;
     919             :                     }
     920             :                     case 8 : // AUTOLAYOUT_TAB
     921             :                     {
     922           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
     923           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTable, pInfo->GetPresRectangle());
     924           0 :                         break;
     925             :                     }
     926             :                     case 9 : // AUTOLAYOUT_CLIPTEXT
     927             :                     {
     928           0 :                         Rectangle aLeft(pInfo->GetPresRectangle());
     929           0 :                         aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
     930           0 :                         Rectangle aRight(aLeft);
     931           0 :                         aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
     932             : 
     933           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
     934           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aLeft);
     935           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aRight);
     936             :                         break;
     937             :                     }
     938             :                     case 10 : // AUTOLAYOUT_TEXTOBJ
     939             :                     {
     940           0 :                         Rectangle aLeft(pInfo->GetPresRectangle());
     941           0 :                         aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
     942           0 :                         Rectangle aRight(aLeft);
     943           0 :                         aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
     944             : 
     945           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
     946           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aLeft);
     947           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aRight);
     948             :                         break;
     949             :                     }
     950             :                     case 11 : // AUTOLAYOUT_OBJ
     951             :                     {
     952           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
     953           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, pInfo->GetPresRectangle());
     954           0 :                         break;
     955             :                     }
     956             :                     case 12 : // AUTOLAYOUT_TEXT2OBJ
     957             :                     {
     958           0 :                         Rectangle aLeft(pInfo->GetPresRectangle());
     959           0 :                         aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
     960           0 :                         Rectangle aRightTop(aLeft);
     961           0 :                         aRightTop.Left() = long(aRightTop.Left() + aRightTop.GetWidth() * 1.05);
     962           0 :                         aRightTop.setHeight(long(aRightTop.GetHeight() * 0.477));
     963           0 :                         Rectangle aRightBottom(aRightTop);
     964           0 :                         aRightBottom.Top() = long(aRightBottom.Top() + aRightBottom.GetHeight() * 1.095);
     965             : 
     966           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
     967           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aLeft);
     968           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aRightTop);
     969           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aRightBottom);
     970             :                         break;
     971             :                     }
     972             :                     case 13 : // AUTOLAYOUT_OBJTEXT
     973             :                     {
     974           0 :                         Rectangle aLeft(pInfo->GetPresRectangle());
     975           0 :                         aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
     976           0 :                         Rectangle aRight(aLeft);
     977           0 :                         aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
     978             : 
     979           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
     980           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aLeft);
     981           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aRight);
     982             :                         break;
     983             :                     }
     984             :                     case 14 : // AUTOLAYOUT_OBJOVERTEXT
     985             :                     {
     986           0 :                         Rectangle aTop(pInfo->GetPresRectangle());
     987           0 :                         aTop.setHeight(long(aTop.GetHeight() * 0.477));
     988           0 :                         Rectangle aBottom(aTop);
     989           0 :                         aBottom.Top() = long(aBottom.Top() + aBottom.GetHeight() * 1.095);
     990             : 
     991           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
     992           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aTop);
     993           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aBottom);
     994             :                         break;
     995             :                     }
     996             :                     case 15 : // AUTOLAYOUT_2OBJTEXT
     997             :                     {
     998           0 :                         Rectangle aLeftTop(pInfo->GetPresRectangle());
     999           0 :                         aLeftTop.setWidth(long(aLeftTop.GetWidth() * 0.488));
    1000           0 :                         Rectangle aRight(aLeftTop);
    1001           0 :                         aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
    1002           0 :                         aLeftTop.setHeight(long(aLeftTop.GetHeight() * 0.477));
    1003           0 :                         Rectangle aLeftBottom(aLeftTop);
    1004           0 :                         aLeftBottom.Top() = long(aLeftBottom.Top() + aLeftBottom.GetHeight() * 1.095);
    1005             : 
    1006           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
    1007           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aLeftTop);
    1008           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aLeftBottom);
    1009           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aRight);
    1010             :                         break;
    1011             :                     }
    1012             :                     case 16 : // AUTOLAYOUT_2OBJOVERTEXT
    1013             :                     {
    1014           0 :                         Rectangle aTopLeft(pInfo->GetPresRectangle());
    1015           0 :                         aTopLeft.setHeight(long(aTopLeft.GetHeight() * 0.477));
    1016           0 :                         Rectangle aBottom(aTopLeft);
    1017           0 :                         aBottom.Top() = long(aBottom.Top() + aBottom.GetHeight() * 1.095);
    1018           0 :                         aTopLeft.setWidth(long(aTopLeft.GetWidth() * 0.488));
    1019           0 :                         Rectangle aTopRight(aTopLeft);
    1020           0 :                         aTopRight.Left() = long(aTopRight.Left() + aTopRight.GetWidth() * 1.05);
    1021             : 
    1022           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
    1023           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aTopLeft);
    1024           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aTopRight);
    1025           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aBottom);
    1026             :                         break;
    1027             :                     }
    1028             :                     case 17 : // AUTOLAYOUT_TEXTOVEROBJ
    1029             :                     {
    1030           0 :                         Rectangle aTop(pInfo->GetPresRectangle());
    1031           0 :                         aTop.setHeight(long(aTop.GetHeight() * 0.477));
    1032           0 :                         Rectangle aBottom(aTop);
    1033           0 :                         aBottom.Top() = long(aBottom.Top() + aBottom.GetHeight() * 1.095);
    1034             : 
    1035           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
    1036           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aTop);
    1037           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aBottom);
    1038             :                         break;
    1039             :                     }
    1040             :                     case 18 : // AUTOLAYOUT_4OBJ
    1041             :                     {
    1042           0 :                         Rectangle aTopLeft(pInfo->GetPresRectangle());
    1043           0 :                         aTopLeft.setHeight(long(aTopLeft.GetHeight() * 0.477));
    1044           0 :                         aTopLeft.setWidth(long(aTopLeft.GetWidth() * 0.488));
    1045           0 :                         Rectangle aBottomLeft(aTopLeft);
    1046           0 :                         aBottomLeft.Top() = long(aBottomLeft.Top() + aBottomLeft.GetHeight() * 1.095);
    1047           0 :                         Rectangle aTopRight(aTopLeft);
    1048           0 :                         aTopRight.Left() = long(aTopRight.Left() + aTopRight.GetWidth() * 1.05);
    1049           0 :                         Rectangle aBottomRight(aTopRight);
    1050           0 :                         aBottomRight.Top() = long(aBottomRight.Top() + aBottomRight.GetHeight() * 1.095);
    1051             : 
    1052           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
    1053           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aTopLeft);
    1054           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aTopRight);
    1055           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aBottomLeft);
    1056           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aBottomRight);
    1057             :                         break;
    1058             :                     }
    1059             :                     case 19 : // AUTOLAYOUT_ONLY_TITLE
    1060             :                     {
    1061           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
    1062           0 :                         break;
    1063             :                     }
    1064             :                     case 21 : // AUTOLAYOUT_NOTES
    1065             :                     {
    1066           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderPage, pInfo->GetTitleRectangle());
    1067           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderNotes, pInfo->GetPresRectangle());
    1068           0 :                         break;
    1069             :                     }
    1070             :                     case 22 : // AUTOLAYOUT_HANDOUT1
    1071             :                     case 23 : // AUTOLAYOUT_HANDOUT2
    1072             :                     case 24 : // AUTOLAYOUT_HANDOUT3
    1073             :                     case 25 : // AUTOLAYOUT_HANDOUT4
    1074             :                     case 26 : // AUTOLAYOUT_HANDOUT6
    1075             :                     case 31 : // AUTOLAYOUT_HANDOUT9
    1076             :                     {
    1077             :                         sal_Int32 nColCnt, nRowCnt;
    1078           0 :                         sal_Int32 nGapX = pInfo->GetGapX();
    1079           0 :                         sal_Int32 nGapY = pInfo->GetGapY();
    1080             : 
    1081           0 :                         switch(pInfo->GetLayoutType())
    1082             :                         {
    1083           0 :                             case 22 : nColCnt = 1; nRowCnt = 1; break;
    1084           0 :                             case 23 : nColCnt = 1; nRowCnt = 2; break;
    1085           0 :                             case 24 : nColCnt = 1; nRowCnt = 3; break;
    1086           0 :                             case 25 : nColCnt = 2; nRowCnt = 2; break;
    1087           0 :                             case 26 : nColCnt = 3; nRowCnt = 2; break;
    1088           0 :                             case 31 : nColCnt = 3; nRowCnt = 3; break;
    1089           0 :                             default:  nColCnt = 0; nRowCnt = 0; break;  // FIXME - What is correct values?
    1090             :                         }
    1091             : 
    1092           0 :                         Size aPartSize(pInfo->GetTitleRectangle().GetSize());
    1093           0 :                         Point aPartPos(pInfo->GetTitleRectangle().TopLeft());
    1094             : 
    1095           0 :                         if(aPartSize.Width() > aPartSize.Height())
    1096             :                         {
    1097           0 :                             sal_Int32 nZwi(nColCnt);
    1098           0 :                             nColCnt = nRowCnt;
    1099           0 :                             nRowCnt = nZwi;
    1100             :                         }
    1101             : 
    1102           0 :                         aPartSize.Width() = (aPartSize.Width() - ((nColCnt - 1) * nGapX)) / nColCnt;
    1103           0 :                         aPartSize.Height() = (aPartSize.Height() - ((nRowCnt - 1) * nGapY)) / nRowCnt;
    1104             : 
    1105           0 :                         Point aTmpPos(aPartPos);
    1106             : 
    1107           0 :                         for (sal_Int32 a = 0; a < nRowCnt; a++)
    1108             :                         {
    1109           0 :                             aTmpPos.X() = aPartPos.X();
    1110             : 
    1111           0 :                             for (sal_Int32 b = 0; b < nColCnt; b++)
    1112             :                             {
    1113           0 :                                 Rectangle aTmpRect(aTmpPos, aPartSize);
    1114             : 
    1115           0 :                                 ImpWriteAutoLayoutPlaceholder(XmlPlaceholderHandout, aTmpRect);
    1116           0 :                                 aTmpPos.X() += aPartSize.Width() + nGapX;
    1117             :                             }
    1118             : 
    1119           0 :                             aTmpPos.Y() += aPartSize.Height() + nGapY;
    1120             :                         }
    1121             :                         break;
    1122             :                     }
    1123             :                     case 27 : // AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART
    1124             :                     {
    1125           0 :                         Rectangle aTop(pInfo->GetPresRectangle());
    1126           0 :                         aTop.setHeight(long(aTop.GetHeight() * 0.488));
    1127           0 :                         Rectangle aBottom(aTop);
    1128           0 :                         aBottom.Top() = long(aBottom.Top() + aBottom.GetHeight() * 1.05);
    1129             : 
    1130           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalTitle, pInfo->GetTitleRectangle());
    1131           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline, aTop);
    1132           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart, aBottom);
    1133             :                         break;
    1134             :                     }
    1135             :                     case 28 : // AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE
    1136             :                     {
    1137           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalTitle, pInfo->GetTitleRectangle());
    1138           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline, pInfo->GetPresRectangle());
    1139           0 :                         break;
    1140             :                     }
    1141             :                     case 29 : // AUTOLAYOUT_TITLE_VERTICAL_OUTLINE
    1142             :                     {
    1143           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
    1144           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline, pInfo->GetPresRectangle());
    1145           0 :                         break;
    1146             :                     }
    1147             :                     case 30 : // AUTOLAYOUT_TITLE_VERTICAL_OUTLINE_CLIPART
    1148             :                     {
    1149           0 :                         Rectangle aLeft(pInfo->GetPresRectangle());
    1150           0 :                         aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
    1151           0 :                         Rectangle aRight(aLeft);
    1152           0 :                         aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
    1153             : 
    1154           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
    1155           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aLeft);
    1156           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline, aRight);
    1157             :                         break;
    1158             :                     }
    1159             :                     case 32 : // AUTOLAYOUT_TITLE
    1160             :                     {
    1161           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderSubtitle, pInfo->GetPresRectangle());
    1162           0 :                         break;
    1163             :                     }
    1164             : 
    1165             :                     case 33 : // AUTOLAYOUT_4CLIPART
    1166             :                     {
    1167           0 :                         Rectangle aTopLeft(pInfo->GetPresRectangle());
    1168           0 :                         aTopLeft.setHeight(long(aTopLeft.GetHeight() * 0.477));
    1169           0 :                         aTopLeft.setWidth(long(aTopLeft.GetWidth() * 0.488));
    1170           0 :                         Rectangle aBottomLeft(aTopLeft);
    1171           0 :                         aBottomLeft.Top() = long(aBottomLeft.Top() + aBottomLeft.GetHeight() * 1.095);
    1172           0 :                         Rectangle aTopRight(aTopLeft);
    1173           0 :                         aTopRight.Left() = long(aTopRight.Left() + aTopRight.GetWidth() * 1.05);
    1174           0 :                         Rectangle aBottomRight(aTopRight);
    1175           0 :                         aBottomRight.Top() = long(aBottomRight.Top() + aBottomRight.GetHeight() * 1.095);
    1176             : 
    1177           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
    1178           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aTopLeft);
    1179           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aTopRight);
    1180           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aBottomLeft);
    1181           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aBottomRight);
    1182             :                         break;
    1183             :                     }
    1184             : 
    1185             :                     case 34 : // AUTOLAYOUT_6CLIPART
    1186             :                     {
    1187           0 :                         Rectangle aTopLeft(pInfo->GetPresRectangle());
    1188           0 :                         aTopLeft.setHeight(long(aTopLeft.GetHeight() * 0.477));
    1189           0 :                         aTopLeft.setWidth(long(aTopLeft.GetWidth() * 0.322));
    1190           0 :                         Rectangle aTopCenter(aTopLeft);
    1191           0 :                         aTopCenter.Left() = long(aTopCenter.Left() + aTopCenter.GetWidth() * 1.05);
    1192           0 :                         Rectangle aTopRight(aTopLeft);
    1193           0 :                         aTopRight.Left() = long(aTopRight.Left() + aTopRight.GetWidth() * 2 * 1.05);
    1194             : 
    1195           0 :                         Rectangle aBottomLeft(aTopLeft);
    1196           0 :                         aBottomLeft.Top() = long(aBottomLeft.Top() + aBottomLeft.GetHeight() * 1.095);
    1197           0 :                         Rectangle aBottomCenter(aTopCenter);
    1198           0 :                         aBottomCenter.Top() = long(aBottomCenter.Top() + aBottomCenter.GetHeight() * 1.095);
    1199           0 :                         Rectangle aBottomRight(aTopRight);
    1200           0 :                         aBottomRight.Top() = long(aBottomRight.Top() + aBottomRight.GetHeight() * 1.095);
    1201             : 
    1202           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
    1203           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aTopLeft);
    1204           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aTopCenter);
    1205           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aTopRight);
    1206           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aBottomLeft);
    1207           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aBottomCenter);
    1208           0 :                         ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aBottomRight);
    1209             :                         break;
    1210             :                     }
    1211             :                     default:
    1212             :                     {
    1213             :                         OSL_FAIL("XMLEXP: unknown autolayout export");
    1214           0 :                         break;
    1215             :                     }
    1216           0 :                 }
    1217             :             }
    1218             :         }
    1219             :     }
    1220           0 : }
    1221             : 
    1222             : //////////////////////////////////////////////////////////////////////////////
    1223             : 
    1224           0 : void SdXMLExport::ImpWriteAutoLayoutPlaceholder(XmlPlaceholder ePl, const Rectangle& rRect)
    1225             : {
    1226           0 :     OUString aStr;
    1227           0 :     OUStringBuffer sStringBuffer;
    1228             : 
    1229             :     // prepare presentation-placeholder attributes, presentation:object
    1230           0 :     switch(ePl)
    1231             :     {
    1232           0 :         case XmlPlaceholderTitle: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("title")); break;
    1233           0 :         case XmlPlaceholderOutline: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("outline")); break;
    1234           0 :         case XmlPlaceholderSubtitle: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("subtitle")); break;
    1235           0 :         case XmlPlaceholderText: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("text")); break;
    1236           0 :         case XmlPlaceholderGraphic: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("graphic")); break;
    1237           0 :         case XmlPlaceholderObject: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("object")); break;
    1238           0 :         case XmlPlaceholderChart: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("chart")); break;
    1239           0 :         case XmlPlaceholderOrgchart: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("orgchart")); break;
    1240           0 :         case XmlPlaceholderTable: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("table")); break;
    1241           0 :         case XmlPlaceholderPage: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("page")); break;
    1242           0 :         case XmlPlaceholderNotes: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("notes")); break;
    1243           0 :         case XmlPlaceholderHandout: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("handout")); break;
    1244           0 :         case XmlPlaceholderVerticalTitle: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("vertical_title")); break;
    1245           0 :         case XmlPlaceholderVerticalOutline: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("vertical_outline")); break;
    1246             :     }
    1247             : 
    1248           0 :     AddAttribute(XML_NAMESPACE_PRESENTATION, XML_OBJECT, aStr);
    1249             : 
    1250             :     // svg:x,y,width,height
    1251           0 :     GetMM100UnitConverter().convertMeasureToXML(sStringBuffer, rRect.Left());
    1252           0 :     aStr = sStringBuffer.makeStringAndClear();
    1253           0 :     AddAttribute(XML_NAMESPACE_SVG, XML_X, aStr);
    1254             : 
    1255           0 :     GetMM100UnitConverter().convertMeasureToXML(sStringBuffer, rRect.Top());
    1256           0 :     aStr = sStringBuffer.makeStringAndClear();
    1257           0 :     AddAttribute(XML_NAMESPACE_SVG, XML_Y, aStr);
    1258             : 
    1259           0 :     GetMM100UnitConverter().convertMeasureToXML(sStringBuffer,
    1260           0 :             rRect.GetWidth());
    1261           0 :     aStr = sStringBuffer.makeStringAndClear();
    1262           0 :     AddAttribute(XML_NAMESPACE_SVG, XML_WIDTH, aStr);
    1263             : 
    1264           0 :     GetMM100UnitConverter().convertMeasureToXML(sStringBuffer,
    1265           0 :             rRect.GetHeight());
    1266           0 :     aStr = sStringBuffer.makeStringAndClear();
    1267           0 :     AddAttribute(XML_NAMESPACE_SVG, XML_HEIGHT, aStr);
    1268             : 
    1269             :     // write presentation-placeholder
    1270           0 :     SvXMLElementExport aPPL(*this, XML_NAMESPACE_PRESENTATION, XML_PLACEHOLDER, sal_True, sal_True);
    1271           0 : }
    1272             : 
    1273             : //////////////////////////////////////////////////////////////////////////////
    1274             : 
    1275           0 : ImpXMLEXPPageMasterInfo* SdXMLExport::ImpGetOrCreatePageMasterInfo( Reference< XDrawPage > xMasterPage )
    1276             : {
    1277           0 :     bool bDoesExist = false;
    1278             : 
    1279           0 :     ImpXMLEXPPageMasterInfo* pNewInfo = new ImpXMLEXPPageMasterInfo(*this, xMasterPage);
    1280             : 
    1281             :     // compare with prev page-master infos
    1282           0 :     for( size_t a = 0; !bDoesExist && a < mpPageMasterInfoList->size(); a++)
    1283             :     {
    1284           0 :         if (   mpPageMasterInfoList->at(a)
    1285           0 :            && *mpPageMasterInfoList->at(a) == *pNewInfo
    1286             :            )
    1287             :         {
    1288           0 :             delete pNewInfo;
    1289           0 :             pNewInfo = mpPageMasterInfoList->at(a);
    1290           0 :             bDoesExist = true;
    1291             :         }
    1292             :     }
    1293             :     // add entry when not found same page-master infos
    1294           0 :     if(!bDoesExist)
    1295           0 :         mpPageMasterInfoList->push_back( pNewInfo );
    1296             : 
    1297           0 :     return pNewInfo;
    1298             : }
    1299             : 
    1300           0 : void SdXMLExport::ImpPrepPageMasterInfos()
    1301             : {
    1302           0 :     if( IsImpress() )
    1303             :     {
    1304             :         // create page master info for handout master page
    1305             : 
    1306           0 :         Reference< XHandoutMasterSupplier > xHMS( GetModel(), UNO_QUERY );
    1307           0 :         if( xHMS.is() )
    1308             :         {
    1309           0 :             Reference< XDrawPage > xMasterPage( xHMS->getHandoutMasterPage() );
    1310           0 :             if( xMasterPage.is() )
    1311           0 :                 mpHandoutPageMaster = ImpGetOrCreatePageMasterInfo(xMasterPage);
    1312           0 :         }
    1313             :     }
    1314             : 
    1315             :     // create page master infos for master pages
    1316           0 :     if(mnDocMasterPageCount)
    1317             :     {
    1318             :         // look for needed page-masters, create these
    1319           0 :         for (sal_Int32 nMPageId = 0; nMPageId < mnDocMasterPageCount; nMPageId++)
    1320             :         {
    1321           0 :             Reference< XDrawPage > xMasterPage( mxDocMasterPages->getByIndex(nMPageId), UNO_QUERY );
    1322           0 :             ImpXMLEXPPageMasterInfo* pNewInfo = 0L;
    1323             : 
    1324           0 :             if(xMasterPage.is())
    1325           0 :                 pNewInfo = ImpGetOrCreatePageMasterInfo(xMasterPage);
    1326             : 
    1327           0 :             mpPageMasterUsageList->push_back( pNewInfo );
    1328             : 
    1329             :             // look for page master of handout page
    1330           0 :             if(IsImpress())
    1331             :             {
    1332           0 :                 pNewInfo = NULL;
    1333           0 :                 Reference< presentation::XPresentationPage > xPresPage(xMasterPage, UNO_QUERY);
    1334           0 :                 if(xPresPage.is())
    1335             :                 {
    1336           0 :                     Reference< XDrawPage > xNotesPage(xPresPage->getNotesPage());
    1337           0 :                     if(xNotesPage.is())
    1338             :                     {
    1339           0 :                         pNewInfo = ImpGetOrCreatePageMasterInfo(xNotesPage);
    1340           0 :                     }
    1341             :                 }
    1342           0 :                 mpNotesPageMasterUsageList->push_back( pNewInfo );
    1343             :             }
    1344           0 :         }
    1345             :     }
    1346           0 : }
    1347             : 
    1348             : //////////////////////////////////////////////////////////////////////////////
    1349             : 
    1350           0 : void SdXMLExport::ImpWritePageMasterInfos()
    1351             : {
    1352             :     // write created page-masters, create names for these
    1353           0 :     for( size_t nCnt = 0; nCnt < mpPageMasterInfoList->size(); nCnt++)
    1354             :     {
    1355           0 :         ImpXMLEXPPageMasterInfo* pInfo = mpPageMasterInfoList->at(nCnt);
    1356           0 :         if(pInfo)
    1357             :         {
    1358             :             // create name
    1359           0 :             OUString sNewName = OUString(RTL_CONSTASCII_USTRINGPARAM("PM"));
    1360             : 
    1361           0 :             sNewName += OUString::valueOf((sal_Int32)nCnt);
    1362           0 :             pInfo->SetName(sNewName);
    1363             : 
    1364             :             // prepare page-master attributes
    1365           0 :             OUString sString;
    1366           0 :             OUStringBuffer sStringBuffer;
    1367             : 
    1368           0 :             sString = sNewName;
    1369           0 :             AddAttribute(XML_NAMESPACE_STYLE, XML_NAME, sString);
    1370             : 
    1371             :             // write page-layout
    1372           0 :             SvXMLElementExport aPME(*this, XML_NAMESPACE_STYLE, XML_PAGE_LAYOUT, sal_True, sal_True);
    1373             : 
    1374             :             // prepare style:properties inside page-master
    1375           0 :             GetMM100UnitConverter().convertMeasureToXML(sStringBuffer,
    1376           0 :                     pInfo->GetBorderTop());
    1377           0 :             sString = sStringBuffer.makeStringAndClear();
    1378           0 :             AddAttribute(XML_NAMESPACE_FO, XML_MARGIN_TOP, sString);
    1379             : 
    1380           0 :             GetMM100UnitConverter().convertMeasureToXML(sStringBuffer,
    1381           0 :                     pInfo->GetBorderBottom());
    1382           0 :             sString = sStringBuffer.makeStringAndClear();
    1383           0 :             AddAttribute(XML_NAMESPACE_FO, XML_MARGIN_BOTTOM, sString);
    1384             : 
    1385           0 :             GetMM100UnitConverter().convertMeasureToXML(sStringBuffer,
    1386           0 :                     pInfo->GetBorderLeft());
    1387           0 :             sString = sStringBuffer.makeStringAndClear();
    1388           0 :             AddAttribute(XML_NAMESPACE_FO, XML_MARGIN_LEFT, sString);
    1389             : 
    1390           0 :             GetMM100UnitConverter().convertMeasureToXML(sStringBuffer,
    1391           0 :                     pInfo->GetBorderRight());
    1392           0 :             sString = sStringBuffer.makeStringAndClear();
    1393           0 :             AddAttribute(XML_NAMESPACE_FO, XML_MARGIN_RIGHT, sString);
    1394             : 
    1395           0 :             GetMM100UnitConverter().convertMeasureToXML(sStringBuffer,
    1396           0 :                     pInfo->GetWidth());
    1397           0 :             sString = sStringBuffer.makeStringAndClear();
    1398           0 :             AddAttribute(XML_NAMESPACE_FO, XML_PAGE_WIDTH, sString);
    1399             : 
    1400           0 :             GetMM100UnitConverter().convertMeasureToXML(sStringBuffer,
    1401           0 :                     pInfo->GetHeight());
    1402           0 :             sString = sStringBuffer.makeStringAndClear();
    1403           0 :             AddAttribute(XML_NAMESPACE_FO, XML_PAGE_HEIGHT, sString);
    1404             : 
    1405           0 :             if(pInfo->GetOrientation() == view::PaperOrientation_PORTRAIT)
    1406           0 :                 AddAttribute(XML_NAMESPACE_STYLE, XML_PRINT_ORIENTATION, XML_PORTRAIT);
    1407             :             else
    1408           0 :                 AddAttribute(XML_NAMESPACE_STYLE, XML_PRINT_ORIENTATION, XML_LANDSCAPE);
    1409             : 
    1410             :             // write style:properties
    1411           0 :             SvXMLElementExport aPMF(*this, XML_NAMESPACE_STYLE, XML_PAGE_LAYOUT_PROPERTIES, sal_True, sal_True);
    1412             :         }
    1413             :     }
    1414           0 : }
    1415             : 
    1416             : //////////////////////////////////////////////////////////////////////////////
    1417             : 
    1418           0 : ImpXMLEXPPageMasterInfo* SdXMLExport::ImpGetPageMasterInfoByName(const OUString& rName)
    1419             : {
    1420           0 :     if(!rName.isEmpty() && !mpPageMasterInfoList->empty())
    1421             :     {
    1422           0 :         for( size_t nCnt = 0; nCnt < mpPageMasterInfoList->size(); nCnt++)
    1423             :         {
    1424           0 :             ImpXMLEXPPageMasterInfo* pInfo = mpPageMasterInfoList->at(nCnt);
    1425           0 :             if(pInfo)
    1426             :             {
    1427           0 :                 if(!pInfo->GetMasterPageName().isEmpty() && rName.equals(pInfo->GetMasterPageName()))
    1428             :                 {
    1429           0 :                     return pInfo;
    1430             :                 }
    1431             :             }
    1432             :         }
    1433             :     }
    1434           0 :     return 0L;
    1435             : }
    1436             : 
    1437             : //////////////////////////////////////////////////////////////////////////////
    1438             : 
    1439           0 : void SdXMLExport::ImpPrepDrawPageInfos()
    1440             : {
    1441             :     // create draw:style-name entries for page export
    1442             :     // containing presentation page attributes AND background attributes
    1443             :     // fixed family for page-styles is "drawing-page" (XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME)
    1444             : 
    1445             :     sal_Int32 nCnt;
    1446           0 :     for(nCnt = 0; nCnt < mnDocDrawPageCount; nCnt++)
    1447             :     {
    1448           0 :         Reference<XDrawPage> xDrawPage;
    1449           0 :         mxDocDrawPages->getByIndex(nCnt) >>= xDrawPage;
    1450           0 :         maDrawPagesStyleNames[nCnt] = ImpCreatePresPageStyleName( xDrawPage );
    1451             : 
    1452           0 :         Reference< presentation::XPresentationPage > xPresPage(xDrawPage, UNO_QUERY);
    1453           0 :         if(xPresPage.is())
    1454             :         {
    1455           0 :             maDrawNotesPagesStyleNames[nCnt] = ImpCreatePresPageStyleName( xPresPage->getNotesPage(), false );
    1456             : 
    1457           0 :             maDrawPagesHeaderFooterSettings[nCnt] = ImpPrepDrawPageHeaderFooterDecls( xDrawPage );
    1458           0 :             maDrawNotesPagesHeaderFooterSettings[nCnt] = ImpPrepDrawPageHeaderFooterDecls( xPresPage->getNotesPage() );
    1459             :         }
    1460           0 :     }
    1461           0 : }
    1462             : 
    1463             : //////////////////////////////////////////////////////////////////////////////
    1464             : 
    1465           0 : static OUString findOrAppendImpl( std::vector< OUString >& rVector, const OUString& rText, const sal_Char* pPrefix )
    1466             : {
    1467             :     // search rVector if there is already a string that equals rText
    1468           0 :     std::vector< OUString >::iterator aIter;
    1469             :     sal_Int32 nIndex;
    1470           0 :     for( nIndex = 1, aIter = rVector.begin(); aIter != rVector.end(); ++aIter, ++nIndex )
    1471             :     {
    1472           0 :         if( (*aIter) == rText )
    1473           0 :             break;
    1474             :     }
    1475             : 
    1476             :     // if nothing is found, append the string at the end of rVector
    1477           0 :     if( aIter == rVector.end() )
    1478           0 :         rVector.push_back( rText );
    1479             : 
    1480             :     // create a reference string with pPrefix and the index of the
    1481             :     // found or created rText
    1482           0 :     OUString aStr( OUString::createFromAscii( pPrefix ) );
    1483           0 :     aStr += OUString::valueOf( nIndex );
    1484           0 :     return aStr;
    1485             : }
    1486             : 
    1487           0 : static OUString findOrAppendImpl( std::vector< DateTimeDeclImpl >& rVector, const OUString& rText, sal_Bool bFixed, sal_Int32 nFormat, const sal_Char* pPrefix )
    1488             : {
    1489             :     // search rVector if there is already a DateTimeDeclImpl with rText,bFixed and nFormat
    1490           0 :     std::vector< DateTimeDeclImpl >::iterator aIter;
    1491             :     sal_Int32 nIndex;
    1492           0 :     for( nIndex = 1, aIter = rVector.begin(); aIter != rVector.end(); ++aIter, ++nIndex )
    1493             :     {
    1494           0 :         const DateTimeDeclImpl& rDecl = (*aIter);
    1495           0 :         if( (rDecl.mbFixed == bFixed ) &&
    1496           0 :             (!bFixed || rDecl.maStrText == rText) &&
    1497             :             (bFixed || (rDecl.mnFormat == nFormat) ) )
    1498           0 :             break;
    1499             :     }
    1500             : 
    1501             :     // if nothing is found, append a new DateTimeDeclImpl
    1502           0 :     if( aIter == rVector.end() )
    1503             :     {
    1504           0 :         DateTimeDeclImpl aDecl;
    1505           0 :         aDecl.maStrText = rText;
    1506           0 :         aDecl.mbFixed = bFixed;
    1507           0 :         aDecl.mnFormat = nFormat;
    1508           0 :         rVector.push_back( aDecl );
    1509             :     }
    1510             : 
    1511             :     // create a reference string with pPrefix and the index of the
    1512             :     // found or created DateTimeDeclImpl
    1513           0 :     OUString aStr( OUString::createFromAscii( pPrefix ) );
    1514           0 :     aStr += OUString::valueOf( nIndex );
    1515           0 :     return aStr;
    1516             : 
    1517             : }
    1518             : 
    1519             : static const sal_Char* gpStrHeaderTextPrefix = "hdr";
    1520             : static const sal_Char* gpStrFooterTextPrefix = "ftr";
    1521             : static const sal_Char* gpStrDateTimeTextPrefix = "dtd";
    1522             : 
    1523           0 : HeaderFooterPageSettingsImpl SdXMLExport::ImpPrepDrawPageHeaderFooterDecls( const Reference<XDrawPage>& xDrawPage )
    1524             : {
    1525           0 :     HeaderFooterPageSettingsImpl aSettings;
    1526             : 
    1527           0 :     if( xDrawPage.is() ) try
    1528             :     {
    1529           0 :         Reference< XPropertySet > xSet( xDrawPage, UNO_QUERY_THROW );
    1530           0 :         Reference< XPropertySetInfo > xInfo( xSet->getPropertySetInfo() );
    1531             : 
    1532           0 :         OUString aStrText;
    1533             : 
    1534           0 :         const OUString aStrHeaderTextProp( RTL_CONSTASCII_USTRINGPARAM( "HeaderText" ) );
    1535           0 :         if( xInfo->hasPropertyByName( aStrHeaderTextProp ) )
    1536             :         {
    1537           0 :             xSet->getPropertyValue( aStrHeaderTextProp  ) >>= aStrText;
    1538           0 :             if( !aStrText.isEmpty() )
    1539           0 :                 aSettings.maStrHeaderDeclName = findOrAppendImpl( maHeaderDeclsVector, aStrText, gpStrHeaderTextPrefix );
    1540             :         }
    1541             : 
    1542           0 :         const OUString aStrFooterTextProp( RTL_CONSTASCII_USTRINGPARAM( "FooterText" ) );
    1543           0 :         if( xInfo->hasPropertyByName( aStrFooterTextProp ) )
    1544             :         {
    1545           0 :             xSet->getPropertyValue( aStrFooterTextProp ) >>= aStrText;
    1546           0 :             if( !aStrText.isEmpty() )
    1547           0 :                 aSettings.maStrFooterDeclName = findOrAppendImpl( maFooterDeclsVector, aStrText, gpStrFooterTextPrefix );
    1548             :         }
    1549             : 
    1550           0 :         const OUString aStrDateTimeTextProp( RTL_CONSTASCII_USTRINGPARAM( "DateTimeText" ) );
    1551           0 :         if( xInfo->hasPropertyByName( aStrDateTimeTextProp ) )
    1552             :         {
    1553           0 :             sal_Bool bFixed = false;
    1554           0 :             sal_Int32 nFormat = 0;
    1555           0 :             xSet->getPropertyValue( aStrDateTimeTextProp ) >>= aStrText;
    1556           0 :             xSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsDateTimeFixed" ) ) ) >>= bFixed;
    1557           0 :             xSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "DateTimeFormat" ) ) ) >>= nFormat;
    1558             : 
    1559           0 :             if( !bFixed || !aStrText.isEmpty() )
    1560             :             {
    1561           0 :                 aSettings.maStrDateTimeDeclName = findOrAppendImpl( maDateTimeDeclsVector, aStrText, bFixed, nFormat, gpStrDateTimeTextPrefix );
    1562           0 :                 if( !bFixed )
    1563           0 :                     addDataStyle( nFormat );
    1564             :             }
    1565           0 :         }
    1566             :     }
    1567           0 :     catch(const Exception&)
    1568             :     {
    1569             :         OSL_FAIL( "SdXMLExport::ImpPrepDrawPageHeaderFooterDecls(), unexpected exception cought!" );
    1570             :     }
    1571             : 
    1572           0 :     return aSettings;
    1573             : }
    1574             : 
    1575             : //////////////////////////////////////////////////////////////////////////////
    1576             : 
    1577           0 : void SdXMLExport::ImpWriteHeaderFooterDecls()
    1578             : {
    1579           0 :     OUStringBuffer sBuffer;
    1580             : 
    1581           0 :     if( !maHeaderDeclsVector.empty() )
    1582             :     {
    1583             :         // export header decls
    1584           0 :         const OUString aPrefix( OUString::createFromAscii( gpStrHeaderTextPrefix ) );
    1585           0 :         std::vector< OUString >::iterator aIter;
    1586             :         sal_Int32 nIndex;
    1587           0 :         for( nIndex = 1, aIter = maHeaderDeclsVector.begin(); aIter != maHeaderDeclsVector.end(); ++aIter, ++nIndex )
    1588             :         {
    1589           0 :             sBuffer.append( aPrefix );
    1590           0 :             sBuffer.append( nIndex );
    1591           0 :             AddAttribute(XML_NAMESPACE_PRESENTATION, XML_NAME, sBuffer.makeStringAndClear());
    1592             : 
    1593           0 :             SvXMLElementExport aElem(*this, XML_NAMESPACE_PRESENTATION, XML_HEADER_DECL, sal_True, sal_True);
    1594           0 :             Characters((*aIter));
    1595           0 :         }
    1596             :     }
    1597             : 
    1598           0 :     if( !maFooterDeclsVector.empty() )
    1599             :     {
    1600             :         // export footer decls
    1601           0 :         const OUString aPrefix( OUString::createFromAscii( gpStrFooterTextPrefix ) );
    1602           0 :         std::vector< OUString >::iterator aIter;
    1603             :         sal_Int32 nIndex;
    1604           0 :         for( nIndex = 1, aIter = maFooterDeclsVector.begin(); aIter != maFooterDeclsVector.end(); ++aIter, ++nIndex )
    1605             :         {
    1606           0 :             sBuffer.append( aPrefix );
    1607           0 :             sBuffer.append( nIndex );
    1608           0 :             AddAttribute(XML_NAMESPACE_PRESENTATION, XML_NAME, sBuffer.makeStringAndClear());
    1609             : 
    1610           0 :             SvXMLElementExport aElem(*this, XML_NAMESPACE_PRESENTATION, XML_FOOTER_DECL, sal_False, sal_False);
    1611           0 :             Characters((*aIter));
    1612           0 :         }
    1613             :     }
    1614             : 
    1615           0 :     if( !maDateTimeDeclsVector.empty() )
    1616             :     {
    1617             :         // export footer decls
    1618           0 :         const OUString aPrefix( OUString::createFromAscii( gpStrDateTimeTextPrefix ) );
    1619           0 :         std::vector< DateTimeDeclImpl >::iterator aIter;
    1620             :         sal_Int32 nIndex;
    1621           0 :         for( nIndex = 1, aIter = maDateTimeDeclsVector.begin(); aIter != maDateTimeDeclsVector.end(); ++aIter, ++nIndex )
    1622             :         {
    1623           0 :             const DateTimeDeclImpl& rDecl = (*aIter);
    1624             : 
    1625           0 :             sBuffer.append( aPrefix );
    1626           0 :             sBuffer.append( nIndex );
    1627           0 :             AddAttribute( XML_NAMESPACE_PRESENTATION, XML_NAME, sBuffer.makeStringAndClear());
    1628             : 
    1629           0 :             AddAttribute( XML_NAMESPACE_PRESENTATION, XML_SOURCE, rDecl.mbFixed ? XML_FIXED : XML_CURRENT_DATE );
    1630             : 
    1631           0 :             if( !rDecl.mbFixed )
    1632           0 :                 AddAttribute( XML_NAMESPACE_STYLE, XML_DATA_STYLE_NAME, getDataStyleName( rDecl.mnFormat ) );
    1633             : 
    1634           0 :             SvXMLElementExport aElem(*this, XML_NAMESPACE_PRESENTATION, XML_DATE_TIME_DECL, sal_False, sal_False);
    1635           0 :             if( rDecl.mbFixed )
    1636           0 :                 Characters(rDecl.maStrText);
    1637           0 :         }
    1638           0 :     }
    1639           0 : }
    1640             : 
    1641           0 : void SdXMLExport::ImplExportHeaderFooterDeclAttributes( const HeaderFooterPageSettingsImpl& aSettings )
    1642             : {
    1643           0 :     if( !aSettings.maStrHeaderDeclName.isEmpty() )
    1644           0 :         AddAttribute( XML_NAMESPACE_PRESENTATION, XML_USE_HEADER_NAME, aSettings.maStrHeaderDeclName );
    1645             : 
    1646           0 :     if( !aSettings.maStrFooterDeclName.isEmpty() )
    1647           0 :         AddAttribute( XML_NAMESPACE_PRESENTATION, XML_USE_FOOTER_NAME, aSettings.maStrFooterDeclName );
    1648             : 
    1649           0 :     if( !aSettings.maStrDateTimeDeclName.isEmpty() )
    1650           0 :         AddAttribute( XML_NAMESPACE_PRESENTATION, XML_USE_DATE_TIME_NAME, aSettings.maStrDateTimeDeclName );
    1651           0 : }
    1652             : 
    1653             : //////////////////////////////////////////////////////////////////////////////
    1654             : 
    1655           0 : OUString SdXMLExport::ImpCreatePresPageStyleName( Reference<XDrawPage> xDrawPage, bool bExportBackground /* = true */ )
    1656             : {
    1657             :     // create name
    1658           0 :     OUString sStyleName;
    1659             : 
    1660             :     // create style for this page and add to auto style pool
    1661             : 
    1662           0 :     Reference< beans::XPropertySet > xPropSet1(xDrawPage, UNO_QUERY);
    1663           0 :     if(xPropSet1.is())
    1664             :     {
    1665           0 :         Reference< beans::XPropertySet > xPropSet;
    1666             : 
    1667           0 :         if( bExportBackground )
    1668             :         {
    1669             :             // since the background items are in a different propertyset
    1670             :             // which itself is a property of the pages property set
    1671             :             // we now merge these two propertysets if possible to simulate
    1672             :             // a single propertyset with all draw page properties
    1673           0 :             const OUString aBackground(RTL_CONSTASCII_USTRINGPARAM("Background"));
    1674           0 :             Reference< beans::XPropertySet > xPropSet2;
    1675           0 :             Reference< beans::XPropertySetInfo > xInfo( xPropSet1->getPropertySetInfo() );
    1676           0 :             if( xInfo.is() && xInfo->hasPropertyByName( aBackground ) )
    1677             :             {
    1678           0 :                 Any aAny( xPropSet1->getPropertyValue( aBackground ) );
    1679           0 :                 aAny >>= xPropSet2;
    1680             :             }
    1681             : 
    1682           0 :             if( xPropSet2.is() )
    1683           0 :                 xPropSet = PropertySetMerger_CreateInstance( xPropSet1, xPropSet2 );
    1684             :             else
    1685           0 :                 xPropSet = xPropSet1;
    1686             :         }
    1687             :         else
    1688             :         {
    1689           0 :             xPropSet = xPropSet1;
    1690             :         }
    1691             : 
    1692           0 :         const UniReference< SvXMLExportPropertyMapper > aMapperRef( GetPresPagePropsMapper() );
    1693             : 
    1694           0 :         std::vector< XMLPropertyState > xPropStates( aMapperRef->Filter( xPropSet ) );
    1695             : 
    1696           0 :         if( !xPropStates.empty() )
    1697             :         {
    1698             :             // there are filtered properties -> hard attributes
    1699             :             // try to find this style in AutoStylePool
    1700           0 :             sStyleName = GetAutoStylePool()->Find(XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID, sStyleName, xPropStates);
    1701             : 
    1702           0 :             if(sStyleName.isEmpty())
    1703             :             {
    1704             :                 // Style did not exist, add it to AutoStalePool
    1705           0 :                 sStyleName = GetAutoStylePool()->Add(XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID, sStyleName, xPropStates);
    1706             :             }
    1707           0 :         }
    1708             :     }
    1709             : 
    1710           0 :     return sStyleName;
    1711             : }
    1712             : 
    1713             : //////////////////////////////////////////////////////////////////////////////
    1714             : 
    1715           0 : void SdXMLExport::ImpPrepMasterPageInfos()
    1716             : {
    1717             :     // create draw:style-name entries for master page export
    1718             :     // containing only background attributes
    1719             :     // fixed family for page-styles is "drawing-page" (XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME)
    1720             : 
    1721             :     sal_Int32 nCnt;
    1722           0 :     for( nCnt = 0; nCnt < mnDocMasterPageCount; nCnt++)
    1723             :     {
    1724           0 :         Reference<XDrawPage> xDrawPage;
    1725           0 :         mxDocMasterPages->getByIndex(nCnt) >>= xDrawPage;
    1726           0 :         maMasterPagesStyleNames[nCnt] = ImpCreatePresPageStyleName( xDrawPage );
    1727           0 :     }
    1728             : 
    1729           0 :     if( IsImpress() )
    1730             :     {
    1731           0 :         Reference< presentation::XHandoutMasterSupplier > xHandoutSupp( GetModel(), UNO_QUERY );
    1732           0 :         if( xHandoutSupp.is() )
    1733             :         {
    1734           0 :             Reference< XDrawPage > xHandoutPage( xHandoutSupp->getHandoutMasterPage() );
    1735           0 :             if( xHandoutPage.is() )
    1736             :             {
    1737           0 :                 maHandoutPageHeaderFooterSettings = ImpPrepDrawPageHeaderFooterDecls( xHandoutPage );
    1738           0 :                 maHandoutMasterStyleName = ImpCreatePresPageStyleName( xHandoutPage, false );
    1739           0 :             }
    1740           0 :         }
    1741             :     }
    1742           0 : }
    1743             : 
    1744             : //////////////////////////////////////////////////////////////////////////////
    1745           0 : void SdXMLExport::ImpWritePresentationStyles()
    1746             : {
    1747           0 :     if(IsImpress())
    1748             :     {
    1749           0 :         for (sal_Int32 nCnt = 0; nCnt < mnDocMasterPageCount; nCnt++)
    1750             :         {
    1751           0 :             Any aAny(mxDocMasterPages->getByIndex(nCnt));
    1752           0 :             Reference<container::XNamed> xNamed;
    1753             : 
    1754           0 :             if(aAny >>= xNamed)
    1755             :             {
    1756             :                 // write presentation styles (ONLY if presentation)
    1757           0 :                 if(IsImpress() && mxDocStyleFamilies.is() && xNamed.is())
    1758             :                 {
    1759           0 :                     XMLStyleExport aStEx(*this, OUString(), GetAutoStylePool().get());
    1760           0 :                     const UniReference< SvXMLExportPropertyMapper > aMapperRef( GetPropertySetMapper() );
    1761             : 
    1762           0 :                     OUString aPrefix( xNamed->getName() );
    1763             : 
    1764           0 :                     aPrefix += OUString(RTL_CONSTASCII_USTRINGPARAM("-"));
    1765           0 :                     aStEx.exportStyleFamily(xNamed->getName(),
    1766             :                         OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_NAME)),
    1767             :                         aMapperRef, sal_False,
    1768           0 :                         XML_STYLE_FAMILY_SD_PRESENTATION_ID, &aPrefix);
    1769             :                 }
    1770             :             }
    1771           0 :         }
    1772             :     }
    1773           0 : }
    1774             : 
    1775             : //////////////////////////////////////////////////////////////////////////////
    1776             : 
    1777           0 : void SdXMLExport::SetProgress(sal_Int32 nProg)
    1778             : {
    1779             :     // set progress view
    1780           0 :     if(GetStatusIndicator().is())
    1781           0 :         GetStatusIndicator()->setValue(nProg);
    1782           0 : }
    1783             : 
    1784             : //////////////////////////////////////////////////////////////////////////////
    1785             : // #82003#
    1786             : 
    1787           0 : void SdXMLExport::_ExportMeta()
    1788             : {
    1789           0 :     uno::Sequence<beans::NamedValue> stats(1);
    1790           0 :     stats[0] = beans::NamedValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "ObjectCount" )),
    1791           0 :                 uno::makeAny(mnObjectCount));
    1792             : 
    1793             :     // update document statistics at the model
    1794           0 :     uno::Reference<document::XDocumentPropertiesSupplier> xPropSup(GetModel(),
    1795           0 :         uno::UNO_QUERY_THROW);
    1796             :     uno::Reference<document::XDocumentProperties> xDocProps(
    1797           0 :         xPropSup->getDocumentProperties());
    1798           0 :     if (xDocProps.is()) {
    1799           0 :         xDocProps->setDocumentStatistics(stats);
    1800             :     }
    1801             : 
    1802             :     // call parent
    1803           0 :     SvXMLExport::_ExportMeta();
    1804           0 : }
    1805             : 
    1806             : //////////////////////////////////////////////////////////////////////////////
    1807             : 
    1808           0 : void SdXMLExport::_ExportContent()
    1809             : {
    1810             :     // export <pres:header-decl>, <pres:footer-decl> and <pres:date-time-decl> elements
    1811           0 :     ImpWriteHeaderFooterDecls();
    1812             : 
    1813             :     // page export
    1814           0 :     for(sal_Int32 nPageInd(0); nPageInd < mnDocDrawPageCount; nPageInd++)
    1815             :     {
    1816           0 :         uno::Reference<drawing::XDrawPage> xDrawPage( mxDocDrawPages->getByIndex(nPageInd), uno::UNO_QUERY );
    1817             : 
    1818           0 :         SetProgress(((nPageInd + 1) * 100) / mnDocDrawPageCount);
    1819             : 
    1820           0 :         if(xDrawPage.is())
    1821             :         {
    1822             :             // prepare page attributes, name of page
    1823           0 :             Reference < container::XNamed > xNamed(xDrawPage, UNO_QUERY);
    1824           0 :             if(xNamed.is())
    1825           0 :                 AddAttribute(XML_NAMESPACE_DRAW, XML_NAME, xNamed->getName());
    1826             : 
    1827             :             // draw:style-name (presentation page attributes AND background attributes)
    1828           0 :             if( !maDrawPagesStyleNames[nPageInd].isEmpty() )
    1829             :                 AddAttribute(XML_NAMESPACE_DRAW, XML_STYLE_NAME,
    1830           0 :                         maDrawPagesStyleNames[nPageInd]);
    1831             : 
    1832             :             // draw:master-page-name
    1833           0 :             Reference < drawing::XMasterPageTarget > xMasterPageInt(xDrawPage, UNO_QUERY);
    1834           0 :             if(xMasterPageInt.is())
    1835             :             {
    1836           0 :                 Reference<XDrawPage> xUsedMasterPage(xMasterPageInt->getMasterPage());
    1837           0 :                 if(xUsedMasterPage.is())
    1838             :                 {
    1839           0 :                     Reference < container::XNamed > xMasterNamed(xUsedMasterPage, UNO_QUERY);
    1840           0 :                     if(xMasterNamed.is())
    1841             :                     {
    1842             :                         AddAttribute(XML_NAMESPACE_DRAW, XML_MASTER_PAGE_NAME,
    1843           0 :                             EncodeStyleName( xMasterNamed->getName()) );
    1844           0 :                     }
    1845           0 :                 }
    1846             :             }
    1847             : 
    1848             :             // presentation:page-layout-name
    1849           0 :             if( IsImpress() && !maDrawPagesAutoLayoutNames[nPageInd+1].isEmpty())
    1850             :             {
    1851           0 :                 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_PRESENTATION_PAGE_LAYOUT_NAME, maDrawPagesAutoLayoutNames[nPageInd+1] );
    1852             :             }
    1853             : 
    1854           0 :             Reference< beans::XPropertySet > xProps( xDrawPage, UNO_QUERY );
    1855           0 :             if( xProps.is() )
    1856             :             {
    1857             :                 try
    1858             :                 {
    1859           0 :                     OUString aBookmarkURL;
    1860           0 :                     xProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "BookmarkURL" ) ) ) >>= aBookmarkURL;
    1861             : 
    1862           0 :                     if( !aBookmarkURL.isEmpty() )
    1863             :                     {
    1864           0 :                         sal_Int32 nIndex = aBookmarkURL.lastIndexOf( (sal_Unicode)'#' );
    1865           0 :                         if( nIndex != -1 )
    1866             :                         {
    1867           0 :                             OUString aFileName( aBookmarkURL.copy( 0, nIndex ) );
    1868           0 :                             OUString aBookmarkName( aBookmarkURL.copy( nIndex+1 ) );
    1869             : 
    1870           0 :                             aBookmarkURL = GetRelativeReference( aFileName );
    1871           0 :                             aBookmarkURL += rtl::OUString(static_cast<sal_Unicode>('#'));
    1872           0 :                             aBookmarkURL += aBookmarkName;
    1873             :                         }
    1874             : 
    1875           0 :                         AddAttribute ( XML_NAMESPACE_XLINK, XML_HREF, aBookmarkURL);
    1876           0 :                         AddAttribute ( XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE );
    1877           0 :                         AddAttribute ( XML_NAMESPACE_XLINK, XML_SHOW, XML_REPLACE );
    1878           0 :                         AddAttribute ( XML_NAMESPACE_XLINK, XML_ACTUATE, XML_ONREQUEST );
    1879           0 :                     }
    1880             :                 }
    1881           0 :                 catch(const Exception&)
    1882             :                 {
    1883             :                     OSL_FAIL(" no \"BookmarkURL\" property at page?" );
    1884             :                 }
    1885             :             }
    1886             : 
    1887           0 :             if( IsImpress() )
    1888           0 :                 ImplExportHeaderFooterDeclAttributes( maDrawPagesHeaderFooterSettings[nPageInd] );
    1889             : 
    1890             : 
    1891           0 :             OUString sNavigationOrder( getNavigationOrder( xDrawPage ) );
    1892           0 :             if( !sNavigationOrder.isEmpty() )
    1893           0 :                 AddAttribute ( XML_NAMESPACE_DRAW, XML_NAV_ORDER, sNavigationOrder );
    1894             : 
    1895           0 :             UniReference< xmloff::AnimationsExporter >  xAnimationsExporter;
    1896           0 :             uno::Reference< ::com::sun::star::animations::XAnimationNodeSupplier > xAnimNodeSupplier;
    1897             : 
    1898             :             // prepare animation export
    1899           0 :             if(IsImpress())
    1900             :             {
    1901           0 :                 if( getExportFlags() & EXPORT_OASIS )
    1902             :                 {
    1903             :                     // export new animations for oasis format
    1904           0 :                     xAnimNodeSupplier.set( xDrawPage, UNO_QUERY );
    1905             : 
    1906             :                     // prepare animations exporter if impress
    1907           0 :                     if(xAnimNodeSupplier.is())
    1908             :                     {
    1909           0 :                         xAnimationsExporter = new xmloff::AnimationsExporter( *this, xProps );
    1910           0 :                         xAnimationsExporter->prepare( xAnimNodeSupplier->getAnimationNode() );
    1911             :                     }
    1912             :                 }
    1913             :                 else
    1914             :                 {
    1915             :                     // export old animations for ooo format
    1916           0 :                     UniReference< XMLAnimationsExporter > xAnimExport = new XMLAnimationsExporter( GetShapeExport().get() );
    1917           0 :                     GetShapeExport()->setAnimationsExporter( xAnimExport );
    1918             :                 }
    1919             :             }
    1920             : 
    1921             :             // write draw:id
    1922           0 :             const OUString aPageId = getInterfaceToIdentifierMapper().getIdentifier( xDrawPage );
    1923           0 :             if( !aPageId.isEmpty() )
    1924             :             {
    1925           0 :                 AddAttributeIdLegacy(XML_NAMESPACE_DRAW, aPageId);
    1926             :             }
    1927             : 
    1928             :             // write page
    1929           0 :             SvXMLElementExport aDPG(*this, XML_NAMESPACE_DRAW, XML_PAGE, sal_True, sal_True);
    1930             : 
    1931             :             // write optional office:forms
    1932           0 :             exportFormsElement( xDrawPage );
    1933             : 
    1934             :             // write graphic objects on this page (if any)
    1935           0 :             Reference< drawing::XShapes > xExportShapes(xDrawPage, UNO_QUERY);
    1936           0 :             if(xExportShapes.is() && xExportShapes->getCount())
    1937           0 :                 GetShapeExport()->exportShapes( xExportShapes );
    1938             : 
    1939             :             // write animations and presentation notes (ONLY if presentation)
    1940           0 :             if(IsImpress())
    1941             :             {
    1942           0 :                 if(xAnimNodeSupplier.is())
    1943             :                 {
    1944           0 :                     xAnimationsExporter->exportAnimations( xAnimNodeSupplier->getAnimationNode() );
    1945             :                 }
    1946             :                 else
    1947             :                 {
    1948             :                     // animations
    1949           0 :                     UniReference< XMLAnimationsExporter > xAnimExport( GetShapeExport()->getAnimationsExporter() );
    1950           0 :                     if( xAnimExport.is() )
    1951           0 :                         xAnimExport->exportAnimations( *this );
    1952             : 
    1953           0 :                     xAnimExport = NULL;
    1954           0 :                     GetShapeExport()->setAnimationsExporter( xAnimExport );
    1955             :                 }
    1956             : 
    1957             :                 // presentations
    1958           0 :                 Reference< presentation::XPresentationPage > xPresPage(xDrawPage, UNO_QUERY);
    1959           0 :                 if(xPresPage.is())
    1960             :                 {
    1961           0 :                     Reference< XDrawPage > xNotesPage(xPresPage->getNotesPage());
    1962           0 :                     if(xNotesPage.is())
    1963             :                     {
    1964           0 :                         Reference< drawing::XShapes > xShapes(xNotesPage, UNO_QUERY);
    1965           0 :                         if(xShapes.is())
    1966             :                         {
    1967           0 :                             if( !maDrawNotesPagesStyleNames[nPageInd].isEmpty() )
    1968           0 :                                 AddAttribute(XML_NAMESPACE_DRAW, XML_STYLE_NAME, maDrawNotesPagesStyleNames[nPageInd]);
    1969             : 
    1970           0 :                             ImplExportHeaderFooterDeclAttributes( maDrawNotesPagesHeaderFooterSettings[nPageInd] );
    1971             : 
    1972             :                             // write presentation notes
    1973           0 :                             SvXMLElementExport aPSY(*this, XML_NAMESPACE_PRESENTATION, XML_NOTES, sal_True, sal_True);
    1974             : 
    1975             :                             // write optional office:forms
    1976           0 :                             exportFormsElement( xNotesPage );
    1977             : 
    1978             :                             // write shapes per se
    1979           0 :                             GetShapeExport()->exportShapes( xShapes );
    1980           0 :                         }
    1981           0 :                     }
    1982           0 :                 }
    1983             :             }
    1984             : 
    1985           0 :             exportAnnotations( xDrawPage );
    1986             :         }
    1987           0 :     }
    1988             : 
    1989           0 :     if( IsImpress() )
    1990           0 :         exportPresentationSettings();
    1991           0 : }
    1992             : 
    1993             : //////////////////////////////////////////////////////////////////////////////
    1994             : 
    1995           0 : void SdXMLExport::exportPresentationSettings()
    1996             : {
    1997             :     try
    1998             :     {
    1999           0 :         Reference< XPresentationSupplier > xPresSupplier( GetModel(), UNO_QUERY );
    2000           0 :         if( !xPresSupplier.is() )
    2001             :             return;
    2002             : 
    2003           0 :         Reference< XPropertySet > xPresProps( xPresSupplier->getPresentation(), UNO_QUERY );
    2004           0 :         if( !xPresProps.is() )
    2005             :             return;
    2006             : 
    2007           0 :         sal_Bool bHasAttr = sal_False;
    2008             : 
    2009           0 :         sal_Bool bTemp = false;
    2010             : 
    2011             :         // export range
    2012           0 :         xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsShowAll" ) ) ) >>= bTemp;
    2013           0 :         if( !bTemp )
    2014             :         {
    2015           0 :             OUString aFirstPage;
    2016           0 :             xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "FirstPage" ) ) ) >>= aFirstPage;
    2017           0 :             if( !aFirstPage.isEmpty() )
    2018             :             {
    2019           0 :                 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_START_PAGE, aFirstPage );
    2020           0 :                 bHasAttr = sal_True;
    2021             :             }
    2022             :             else
    2023             :             {
    2024           0 :                 OUString aCustomShow;
    2025           0 :                 xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "CustomShow" ) ) ) >>= aCustomShow;
    2026           0 :                 if( !aCustomShow.isEmpty() )
    2027             :                 {
    2028           0 :                     AddAttribute(XML_NAMESPACE_PRESENTATION, XML_SHOW, aCustomShow );
    2029           0 :                     bHasAttr = sal_True;
    2030           0 :                 }
    2031           0 :             }
    2032             :         }
    2033             : 
    2034           0 :         xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsEndless" ) ) ) >>= bTemp;
    2035           0 :         if( bTemp )
    2036             :         {
    2037           0 :             AddAttribute(XML_NAMESPACE_PRESENTATION, XML_ENDLESS, XML_TRUE );
    2038           0 :             bHasAttr = sal_True;
    2039             : 
    2040           0 :             sal_Int32 nPause = 0;
    2041           0 :             xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Pause" ) ) ) >>= nPause;
    2042             : 
    2043           0 :             util::Duration aDuration;
    2044           0 :             aDuration.Seconds = static_cast<sal_uInt16>(nPause);
    2045             : 
    2046           0 :             OUStringBuffer aOut;
    2047           0 :             ::sax::Converter::convertDuration(aOut, aDuration);
    2048           0 :             AddAttribute(XML_NAMESPACE_PRESENTATION, XML_PAUSE, aOut.makeStringAndClear() );
    2049             :         }
    2050             : 
    2051           0 :         xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AllowAnimations" ) ) ) >>= bTemp;
    2052           0 :         if( !bTemp )
    2053             :         {
    2054           0 :             AddAttribute(XML_NAMESPACE_PRESENTATION, XML_ANIMATIONS, XML_DISABLED );
    2055           0 :             bHasAttr = sal_True;
    2056             :         }
    2057             : 
    2058           0 :         xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsAlwaysOnTop" ) ) ) >>= bTemp;
    2059           0 :         if( bTemp )
    2060             :         {
    2061           0 :             AddAttribute(XML_NAMESPACE_PRESENTATION, XML_STAY_ON_TOP, XML_TRUE );
    2062           0 :             bHasAttr = sal_True;
    2063             :         }
    2064             : 
    2065           0 :         xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsAutomatic" ) ) ) >>= bTemp;
    2066           0 :         if( bTemp )
    2067             :         {
    2068           0 :             AddAttribute(XML_NAMESPACE_PRESENTATION, XML_FORCE_MANUAL, XML_TRUE );
    2069           0 :             bHasAttr = sal_True;
    2070             :         }
    2071             : 
    2072           0 :         xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFullScreen" ) ) ) >>= bTemp;
    2073           0 :         if( !bTemp )
    2074             :         {
    2075           0 :             AddAttribute(XML_NAMESPACE_PRESENTATION, XML_FULL_SCREEN, XML_FALSE );
    2076           0 :             bHasAttr = sal_True;
    2077             :         }
    2078             : 
    2079           0 :         xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsMouseVisible" ) ) ) >>= bTemp;
    2080           0 :         if( !bTemp )
    2081             :         {
    2082           0 :             AddAttribute(XML_NAMESPACE_PRESENTATION, XML_MOUSE_VISIBLE, XML_FALSE );
    2083           0 :             bHasAttr = sal_True;
    2084             :         }
    2085             : 
    2086           0 :         xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "StartWithNavigator" ) ) ) >>= bTemp;
    2087           0 :         if( bTemp )
    2088             :         {
    2089           0 :             AddAttribute(XML_NAMESPACE_PRESENTATION, XML_START_WITH_NAVIGATOR, XML_TRUE );
    2090           0 :             bHasAttr = sal_True;
    2091             :         }
    2092             : 
    2093           0 :         xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "UsePen" ) ) ) >>= bTemp;
    2094           0 :         if( bTemp )
    2095             :         {
    2096           0 :             AddAttribute(XML_NAMESPACE_PRESENTATION, XML_MOUSE_AS_PEN, XML_TRUE );
    2097           0 :             bHasAttr = sal_True;
    2098             :         }
    2099             : 
    2100           0 :         xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsTransitionOnClick" ) ) ) >>= bTemp;
    2101           0 :         if( !bTemp )
    2102             :         {
    2103           0 :             AddAttribute(XML_NAMESPACE_PRESENTATION, XML_TRANSITION_ON_CLICK, XML_DISABLED );
    2104           0 :             bHasAttr = sal_True;
    2105             :         }
    2106             : 
    2107           0 :         xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsShowLogo" ) ) ) >>= bTemp;
    2108           0 :         if( bTemp )
    2109             :         {
    2110           0 :             AddAttribute(XML_NAMESPACE_PRESENTATION, XML_SHOW_LOGO, XML_TRUE );
    2111           0 :             bHasAttr = sal_True;
    2112             :         }
    2113             : 
    2114           0 :         Reference< container::XNameContainer > xShows;
    2115           0 :         Sequence< OUString > aShowNames;
    2116           0 :         const OUString* pShowNames = NULL;
    2117           0 :         sal_Int32 nShowCount = 0;
    2118             : 
    2119           0 :         Reference< XCustomPresentationSupplier > xSup( GetModel(), UNO_QUERY );
    2120           0 :         if( xSup.is() )
    2121             :         {
    2122           0 :             xShows = xSup->getCustomPresentations();
    2123           0 :             if( xShows.is() )
    2124             :             {
    2125           0 :                 aShowNames = xShows->getElementNames();
    2126           0 :                 pShowNames = aShowNames.getArray();
    2127           0 :                 nShowCount = aShowNames.getLength();
    2128             :             }
    2129             :         }
    2130             : 
    2131           0 :         if( bHasAttr || nShowCount != 0 )
    2132             :         {
    2133           0 :             SvXMLElementExport aSettings(*this, XML_NAMESPACE_PRESENTATION, XML_SETTINGS, sal_True, sal_True);
    2134             : 
    2135           0 :             if( nShowCount == 0 )
    2136             :                 return;
    2137             : 
    2138           0 :             Reference< XIndexContainer > xShow;
    2139           0 :             Reference< XNamed > xPageName;
    2140             : 
    2141           0 :             OUStringBuffer sTmp;
    2142             : 
    2143           0 :             for( sal_Int32 nIndex = 0; nIndex < nShowCount; nIndex++, pShowNames++ )
    2144             :             {
    2145           0 :                 AddAttribute(XML_NAMESPACE_PRESENTATION, XML_NAME, *pShowNames );
    2146             : 
    2147           0 :                 xShows->getByName( *pShowNames ) >>= xShow;
    2148             :                 DBG_ASSERT( xShow.is(), "invalid custom show!" );
    2149           0 :                 if( !xShow.is() )
    2150           0 :                     continue;
    2151             : 
    2152           0 :                 const sal_Int32 nPageCount = xShow->getCount();
    2153           0 :                 for( sal_Int32 nPage = 0; nPage < nPageCount; nPage++ )
    2154             :                 {
    2155           0 :                     xShow->getByIndex( nPage ) >>= xPageName;
    2156             : 
    2157           0 :                     if( !xPageName.is() )
    2158           0 :                         continue;
    2159             : 
    2160           0 :                     if( sTmp.getLength() != 0 )
    2161           0 :                         sTmp.append( sal_Unicode( ',' ) );
    2162           0 :                     sTmp.append( xPageName->getName() );
    2163             : 
    2164             :                 }
    2165             : 
    2166           0 :                 if( sTmp.getLength() )
    2167           0 :                     AddAttribute(XML_NAMESPACE_PRESENTATION, XML_PAGES, sTmp.makeStringAndClear() );
    2168             : 
    2169           0 :                 SvXMLElementExport aShows(*this, XML_NAMESPACE_PRESENTATION, XML_SHOW, sal_True, sal_True);
    2170           0 :             }
    2171           0 :         }
    2172             :     }
    2173           0 :     catch(const uno::Exception&)
    2174             :     {
    2175             :         OSL_FAIL( "uno::Exception while exporting <presentation:settings>" );
    2176             :     }
    2177             : }
    2178             : 
    2179             : //////////////////////////////////////////////////////////////////////////////
    2180             : 
    2181           0 : void SdXMLExport::_ExportStyles(sal_Bool bUsed)
    2182             : {
    2183           0 :     GetPropertySetMapper()->SetAutoStyles( sal_False );
    2184             : 
    2185             :     // export fill styles
    2186           0 :     SvXMLExport::_ExportStyles( bUsed );
    2187             : 
    2188             :     // write draw:style-name for object graphic-styles
    2189           0 :     GetShapeExport()->ExportGraphicDefaults();
    2190             : 
    2191             :     // do not export in ODF 1.1 or older
    2192           0 :     if( getDefaultVersion() >= SvtSaveOptions::ODFVER_012 )
    2193           0 :         GetShapeExport()->GetShapeTableExport()->exportTableStyles();
    2194             : 
    2195             :     // write presentation styles
    2196           0 :     ImpWritePresentationStyles();
    2197             : 
    2198             :     // prepare draw:auto-layout-name for page export
    2199           0 :     ImpPrepAutoLayoutInfos();
    2200             : 
    2201             :     // write draw:auto-layout-name for page export
    2202           0 :     ImpWriteAutoLayoutInfos();
    2203             : 
    2204           0 :     Reference< beans::XPropertySet > xInfoSet( getExportInfo() );
    2205           0 :     if( xInfoSet.is() )
    2206             :     {
    2207           0 :         Reference< beans::XPropertySetInfo > xInfoSetInfo( xInfoSet->getPropertySetInfo() );
    2208             : 
    2209           0 :         Any aAny;
    2210             : 
    2211           0 :         if( xInfoSetInfo->hasPropertyByName( msPageLayoutNames ) )
    2212             :         {
    2213           0 :             aAny <<= maDrawPagesAutoLayoutNames;
    2214           0 :             xInfoSet->setPropertyValue( msPageLayoutNames, aAny );
    2215           0 :         }
    2216           0 :     }
    2217           0 : }
    2218             : 
    2219             : //////////////////////////////////////////////////////////////////////////////
    2220             : 
    2221           0 : void SdXMLExport::_ExportAutoStyles()
    2222             : {
    2223           0 :     Reference< beans::XPropertySet > xInfoSet( getExportInfo() );
    2224           0 :     if( xInfoSet.is() )
    2225             :     {
    2226           0 :         Reference< beans::XPropertySetInfo > xInfoSetInfo( xInfoSet->getPropertySetInfo() );
    2227             : 
    2228           0 :         if( xInfoSetInfo->hasPropertyByName( msPageLayoutNames ) )
    2229             :         {
    2230           0 :             xInfoSet->getPropertyValue( msPageLayoutNames ) >>= maDrawPagesAutoLayoutNames;
    2231           0 :         }
    2232             :     }
    2233             : 
    2234           0 :     GetPropertySetMapper()->SetAutoStyles( sal_True );
    2235             : 
    2236           0 :     if( getExportFlags() & EXPORT_STYLES )
    2237             :     {
    2238             :         // #80012# PageMaster export moved from _ExportStyles
    2239             :         // prepare page-master infos
    2240           0 :         ImpPrepPageMasterInfos();
    2241             : 
    2242             :         // write page-master infos
    2243           0 :         ImpWritePageMasterInfos();
    2244             : 
    2245             :         // prepare draw:style-name for master page export
    2246           0 :         ImpPrepMasterPageInfos();
    2247             :     }
    2248             : 
    2249           0 :     if( getExportFlags() & EXPORT_CONTENT )
    2250             :     {
    2251             :         // prepare draw:style-name for page export
    2252           0 :         ImpPrepDrawPageInfos();
    2253             :     }
    2254             : 
    2255             :     // export draw-page styles
    2256             :     GetAutoStylePool()->exportXML(
    2257             :         XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID
    2258           0 :         , GetDocHandler(),
    2259           0 :         GetMM100UnitConverter(),
    2260           0 :         GetNamespaceMap()
    2261           0 :         );
    2262             : 
    2263           0 :     if( getExportFlags() & EXPORT_STYLES )
    2264             :     {
    2265             :         // create auto style infos for shapes on master handout page
    2266           0 :         if( IsImpress() )
    2267             :         {
    2268           0 :             Reference< presentation::XHandoutMasterSupplier > xHandoutSupp( GetModel(), UNO_QUERY );
    2269           0 :             if( xHandoutSupp.is() )
    2270             :             {
    2271           0 :                 Reference< XDrawPage > xHandoutPage( xHandoutSupp->getHandoutMasterPage() );
    2272           0 :                 if( xHandoutPage.is() )
    2273             :                 {
    2274           0 :                     Reference< drawing::XShapes > xShapes(xHandoutPage, UNO_QUERY);
    2275           0 :                     if(xShapes.is() && xShapes->getCount())
    2276           0 :                         GetShapeExport()->collectShapesAutoStyles( xShapes );
    2277           0 :                 }
    2278           0 :             }
    2279             :         }
    2280             : 
    2281             :         // create auto style infos for objects on master pages
    2282           0 :         for(sal_Int32 nMPageId(0L); nMPageId < mnDocMasterPageCount; nMPageId++)
    2283             :         {
    2284           0 :             Reference< XDrawPage > xMasterPage(mxDocMasterPages->getByIndex(nMPageId), UNO_QUERY );
    2285             : 
    2286           0 :             if( xMasterPage.is() )
    2287             :             {
    2288             :                 // collect layer information
    2289           0 :                 GetFormExport()->examineForms( xMasterPage );
    2290             : 
    2291             :                 // get MasterPage Name
    2292           0 :                 OUString aMasterPageNamePrefix;
    2293           0 :                 Reference < container::XNamed > xNamed(xMasterPage, UNO_QUERY);
    2294           0 :                 if(xNamed.is())
    2295             :                 {
    2296           0 :                     aMasterPageNamePrefix = xNamed->getName();
    2297             :                 }
    2298           0 :                 if(!aMasterPageNamePrefix.isEmpty())
    2299             :                 {
    2300           0 :                     aMasterPageNamePrefix += OUString(RTL_CONSTASCII_USTRINGPARAM("-"));
    2301             :                 }
    2302           0 :                 GetShapeExport()->setPresentationStylePrefix( aMasterPageNamePrefix );
    2303             : 
    2304           0 :                 Reference< drawing::XShapes > xMasterShapes(xMasterPage, UNO_QUERY);
    2305           0 :                 if(xMasterShapes.is() && xMasterShapes->getCount())
    2306           0 :                     GetShapeExport()->collectShapesAutoStyles( xMasterShapes );
    2307             : 
    2308           0 :                 if(IsImpress())
    2309             :                 {
    2310           0 :                     Reference< presentation::XPresentationPage > xPresPage(xMasterPage, UNO_QUERY);
    2311           0 :                     if(xPresPage.is())
    2312             :                     {
    2313           0 :                         Reference< XDrawPage > xNotesPage(xPresPage->getNotesPage());
    2314           0 :                         if(xNotesPage.is())
    2315             :                         {
    2316             :                             // collect layer information
    2317           0 :                             GetFormExport()->examineForms( xNotesPage );
    2318             : 
    2319           0 :                             Reference< drawing::XShapes > xShapes(xNotesPage, UNO_QUERY);
    2320           0 :                             if(xShapes.is() && xShapes->getCount())
    2321           0 :                                 GetShapeExport()->collectShapesAutoStyles( xShapes );
    2322           0 :                         }
    2323           0 :                     }
    2324             :                 }
    2325           0 :                 collectAnnotationAutoStyles(xMasterPage);
    2326             :             }
    2327           0 :         }
    2328             :     }
    2329             : 
    2330           0 :     if( getExportFlags() & EXPORT_CONTENT )
    2331             :     {
    2332             :         // prepare animations exporter if impress
    2333           0 :         if(IsImpress() && ((getExportFlags() & EXPORT_OASIS) == 0) )
    2334             :         {
    2335           0 :             UniReference< XMLAnimationsExporter > xAnimExport = new XMLAnimationsExporter( GetShapeExport().get() );
    2336           0 :             GetShapeExport()->setAnimationsExporter( xAnimExport );
    2337             :         }
    2338             : 
    2339             :         // create auto style infos for objects on pages
    2340           0 :         for(sal_Int32 nPageInd(0); nPageInd < mnDocDrawPageCount; nPageInd++)
    2341             :         {
    2342           0 :             Reference<XDrawPage> xDrawPage( mxDocDrawPages->getByIndex(nPageInd), UNO_QUERY );
    2343           0 :             if( xDrawPage.is() )
    2344             :             {
    2345             :                 // collect layer information
    2346           0 :                 GetFormExport()->examineForms( xDrawPage );
    2347             : 
    2348             :                 // get MasterPage Name
    2349           0 :                 OUString aMasterPageNamePrefix;
    2350           0 :                 Reference < drawing::XMasterPageTarget > xMasterPageInt(xDrawPage, UNO_QUERY);
    2351           0 :                 if(xMasterPageInt.is())
    2352             :                 {
    2353           0 :                     Reference<XDrawPage> xUsedMasterPage(xMasterPageInt->getMasterPage());
    2354           0 :                     if(xUsedMasterPage.is())
    2355             :                     {
    2356           0 :                         Reference < container::XNamed > xMasterNamed(xUsedMasterPage, UNO_QUERY);
    2357           0 :                         if(xMasterNamed.is())
    2358             :                         {
    2359           0 :                             aMasterPageNamePrefix = xMasterNamed->getName();
    2360           0 :                         }
    2361           0 :                     }
    2362             :                 }
    2363           0 :                 if(!aMasterPageNamePrefix.isEmpty())
    2364             :                 {
    2365           0 :                     aMasterPageNamePrefix += OUString(RTL_CONSTASCII_USTRINGPARAM("-"));
    2366             :                 }
    2367             : 
    2368           0 :                 GetShapeExport()->setPresentationStylePrefix( aMasterPageNamePrefix );
    2369             : 
    2370             :                 // prepare object infos
    2371           0 :                 Reference< drawing::XShapes > xDrawShapes(xDrawPage, UNO_QUERY);
    2372           0 :                 if(xDrawShapes.is() && xDrawShapes->getCount())
    2373           0 :                     GetShapeExport()->collectShapesAutoStyles( xDrawShapes );
    2374             : 
    2375             :                 // prepare presentation notes page object infos (ONLY if presentation)
    2376           0 :                 if(IsImpress())
    2377             :                 {
    2378           0 :                     Reference< presentation::XPresentationPage > xPresPage(xDrawPage, UNO_QUERY);
    2379           0 :                     if(xPresPage.is())
    2380             :                     {
    2381           0 :                         Reference< XDrawPage > xNotesPage(xPresPage->getNotesPage());
    2382           0 :                         if(xNotesPage.is())
    2383             :                         {
    2384             :                             // collect layer information
    2385           0 :                             GetFormExport()->examineForms( xNotesPage );
    2386             : 
    2387           0 :                             Reference< drawing::XShapes > xShapes(xNotesPage, UNO_QUERY);
    2388           0 :                             if(xShapes.is() && xShapes->getCount())
    2389           0 :                                 GetShapeExport()->collectShapesAutoStyles( xShapes );
    2390           0 :                         }
    2391           0 :                     }
    2392             :                 }
    2393             : 
    2394           0 :                 collectAnnotationAutoStyles( xDrawPage );
    2395             :             }
    2396           0 :         }
    2397           0 :         if(IsImpress())
    2398             :         {
    2399           0 :             UniReference< XMLAnimationsExporter > xAnimExport;
    2400           0 :             GetShapeExport()->setAnimationsExporter( xAnimExport );
    2401             :         }
    2402             :     }
    2403             : 
    2404           0 :     exportAutoDataStyles();
    2405             : 
    2406           0 :     GetShapeExport()->exportAutoStyles();
    2407             : 
    2408           0 :     sal_uInt16 nContentAutostyles = EXPORT_CONTENT | EXPORT_AUTOSTYLES;
    2409           0 :     if ( ( getExportFlags() & nContentAutostyles ) == nContentAutostyles )
    2410           0 :         GetFormExport()->exportAutoStyles( );
    2411             : 
    2412             :     // ...for text
    2413           0 :     GetTextParagraphExport()->exportTextAutoStyles();
    2414           0 : }
    2415             : 
    2416             : //////////////////////////////////////////////////////////////////////////////
    2417             : 
    2418           0 : void SdXMLExport::_ExportMasterStyles()
    2419             : {
    2420             :     // export layer
    2421           0 :     SdXMLayerExporter::exportLayer( *this );
    2422             : 
    2423             :     // export handout master page if impress
    2424           0 :     if( IsImpress() )
    2425             :     {
    2426           0 :         Reference< presentation::XHandoutMasterSupplier > xHandoutSupp( GetModel(), UNO_QUERY );
    2427           0 :         if( xHandoutSupp.is() )
    2428             :         {
    2429           0 :             Reference< XDrawPage > xHandoutPage( xHandoutSupp->getHandoutMasterPage() );
    2430           0 :             if( xHandoutPage.is() )
    2431             :             {
    2432             :                 // presentation:page-layout-name
    2433           0 :                 if( IsImpress() && !maDrawPagesAutoLayoutNames[0].isEmpty())
    2434             :                 {
    2435           0 :                     AddAttribute(XML_NAMESPACE_PRESENTATION, XML_PRESENTATION_PAGE_LAYOUT_NAME, EncodeStyleName( maDrawPagesAutoLayoutNames[0] ));
    2436             :                 }
    2437             : 
    2438           0 :                 ImpXMLEXPPageMasterInfo* pInfo = mpHandoutPageMaster;
    2439           0 :                 if(pInfo)
    2440             :                 {
    2441           0 :                     OUString sString = pInfo->GetName();
    2442           0 :                     AddAttribute(XML_NAMESPACE_STYLE, XML_PAGE_LAYOUT_NAME, sString );
    2443             :                 }
    2444             : 
    2445             :                 // draw:style-name
    2446           0 :                 if( !maHandoutMasterStyleName.isEmpty() )
    2447           0 :                     AddAttribute(XML_NAMESPACE_DRAW, XML_STYLE_NAME, maHandoutMasterStyleName);
    2448             : 
    2449           0 :                 ImplExportHeaderFooterDeclAttributes( maHandoutPageHeaderFooterSettings );
    2450             : 
    2451             :                 // write masterpage
    2452           0 :                 SvXMLElementExport aMPG(*this, XML_NAMESPACE_STYLE, XML_HANDOUT_MASTER, sal_True, sal_True);
    2453             : 
    2454             :                 // write graphic objects on this master page (if any)
    2455           0 :                 Reference< drawing::XShapes > xShapes(xHandoutPage, UNO_QUERY);
    2456           0 :                 if(xShapes.is() && xShapes->getCount())
    2457           0 :                     GetShapeExport()->exportShapes( xShapes );
    2458           0 :             }
    2459           0 :         }
    2460             :     }
    2461             : 
    2462             :     // export MasterPages in master-styles section
    2463           0 :     for (sal_Int32 nMPageId = 0; nMPageId < mnDocMasterPageCount; nMPageId++)
    2464             :     {
    2465           0 :         Reference< XDrawPage > xMasterPage( mxDocMasterPages->getByIndex(nMPageId), UNO_QUERY );
    2466           0 :         if(xMasterPage.is())
    2467             :         {
    2468             :             // prepare masterpage attributes
    2469           0 :             OUString sMasterPageName;
    2470           0 :             Reference < container::XNamed > xNamed(xMasterPage, UNO_QUERY);
    2471           0 :             if(xNamed.is())
    2472             :             {
    2473           0 :                 sal_Bool bEncoded = sal_False;
    2474           0 :                 sMasterPageName = xNamed->getName();
    2475             :                 AddAttribute(XML_NAMESPACE_STYLE, XML_NAME,
    2476           0 :                     EncodeStyleName( sMasterPageName, &bEncoded ));
    2477           0 :                 if( bEncoded )
    2478             :                     AddAttribute(
    2479             :                         XML_NAMESPACE_STYLE, XML_DISPLAY_NAME,
    2480           0 :                         sMasterPageName );
    2481             :             }
    2482             : 
    2483           0 :             ImpXMLEXPPageMasterInfo* pInfo = mpPageMasterUsageList->at( nMPageId );
    2484           0 :             if(pInfo)
    2485             :             {
    2486           0 :                 OUString sString = pInfo->GetName();
    2487           0 :                 AddAttribute(XML_NAMESPACE_STYLE, XML_PAGE_LAYOUT_NAME, sString );
    2488             :             }
    2489             : 
    2490             :             // draw:style-name (background attributes)
    2491           0 :             if( !maMasterPagesStyleNames[nMPageId].isEmpty() )
    2492             :                 AddAttribute(XML_NAMESPACE_DRAW, XML_STYLE_NAME,
    2493           0 :                         maMasterPagesStyleNames[nMPageId]);
    2494             : 
    2495             :             // write masterpage
    2496           0 :             SvXMLElementExport aMPG(*this, XML_NAMESPACE_STYLE, XML_MASTER_PAGE, sal_True, sal_True);
    2497             : 
    2498             :             // write optional office:forms
    2499           0 :             exportFormsElement( xMasterPage );
    2500             : 
    2501             :             // write graphic objects on this master page (if any)
    2502           0 :             Reference< drawing::XShapes > xMasterShapes(xMasterPage, UNO_QUERY);
    2503           0 :             if(xMasterShapes.is() && xMasterShapes->getCount())
    2504           0 :                 GetShapeExport()->exportShapes( xMasterShapes );
    2505             : 
    2506             :             // write presentation notes (ONLY if presentation)
    2507           0 :             if(IsImpress())
    2508             :             {
    2509           0 :                 Reference< presentation::XPresentationPage > xPresPage(xMasterPage, UNO_QUERY);
    2510           0 :                 if(xPresPage.is())
    2511             :                 {
    2512           0 :                     Reference< XDrawPage > xNotesPage(xPresPage->getNotesPage());
    2513           0 :                     if(xNotesPage.is())
    2514             :                     {
    2515           0 :                         Reference< drawing::XShapes > xShapes(xNotesPage, UNO_QUERY);
    2516           0 :                         if(xShapes.is())
    2517             :                         {
    2518           0 :                             ImpXMLEXPPageMasterInfo* pMasterInfo = mpNotesPageMasterUsageList->at( nMPageId );
    2519           0 :                             if(pMasterInfo)
    2520             :                             {
    2521           0 :                                 OUString sString = pMasterInfo->GetName();
    2522           0 :                                 AddAttribute(XML_NAMESPACE_STYLE, XML_PAGE_LAYOUT_NAME, sString);
    2523             :                             }
    2524             : 
    2525             :                             // write presentation notes
    2526           0 :                             SvXMLElementExport aPSY(*this, XML_NAMESPACE_PRESENTATION, XML_NOTES, sal_True, sal_True);
    2527             : 
    2528             :                             // write optional office:forms
    2529           0 :                             exportFormsElement( xNotesPage );
    2530             : 
    2531             :                             // write shapes per se
    2532           0 :                             GetShapeExport()->exportShapes( xShapes );
    2533           0 :                         }
    2534           0 :                     }
    2535           0 :                 }
    2536             :             }
    2537           0 :             exportAnnotations( xMasterPage );
    2538             :         }
    2539           0 :     }
    2540           0 : }
    2541             : 
    2542           0 : void SdXMLExport::exportFormsElement( Reference< XDrawPage > xDrawPage )
    2543             : {
    2544           0 :     if( xDrawPage.is() )
    2545             :     {
    2546           0 :         Reference< form::XFormsSupplier2 > xFormsSupplier( xDrawPage, UNO_QUERY );
    2547           0 :         if ( xFormsSupplier.is() && xFormsSupplier->hasForms() )
    2548             :         {
    2549             :             // write masterpage
    2550           0 :             ::xmloff::OOfficeFormsExport aForms(*this);
    2551           0 :             GetFormExport()->exportForms( xDrawPage );
    2552             :         }
    2553             : 
    2554           0 :         if(! GetFormExport()->seekPage( xDrawPage ) )
    2555             :         {
    2556             :             OSL_FAIL( "OFormLayerXMLExport::seekPage failed!" );
    2557           0 :         }
    2558             :     }
    2559           0 : }
    2560             : 
    2561           0 : void SdXMLExport::GetViewSettings(uno::Sequence<beans::PropertyValue>& rProps)
    2562             : {
    2563           0 :     rProps.realloc(4);
    2564           0 :     beans::PropertyValue* pProps = rProps.getArray();
    2565           0 :     if(pProps)
    2566             :     {
    2567           0 :         Reference< beans::XPropertySet > xPropSet( GetModel(), UNO_QUERY );
    2568           0 :         if( !xPropSet.is() )
    2569           0 :             return;
    2570             : 
    2571           0 :         awt::Rectangle aVisArea;
    2572           0 :         xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "VisibleArea" ) ) ) >>= aVisArea;
    2573             : 
    2574           0 :         sal_uInt16 i = 0;
    2575           0 :         pProps[i].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaTop"));
    2576           0 :         pProps[i++].Value <<= aVisArea.Y;
    2577           0 :         pProps[i].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaLeft"));
    2578           0 :         pProps[i++].Value <<= aVisArea.X;
    2579           0 :         pProps[i].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaWidth"));
    2580           0 :         pProps[i++].Value <<= aVisArea.Width;
    2581           0 :         pProps[i].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaHeight"));
    2582           0 :         pProps[i++].Value <<= aVisArea.Height;
    2583             :     }
    2584             : }
    2585             : 
    2586           0 : void SdXMLExport::GetConfigurationSettings(uno::Sequence<beans::PropertyValue>& rProps)
    2587             : {
    2588           0 :     Reference< lang::XMultiServiceFactory > xFac( GetModel(), UNO_QUERY );
    2589           0 :     if( xFac.is() )
    2590             :     {
    2591           0 :         Reference< beans::XPropertySet > xProps( xFac->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.Settings" ) ) ), UNO_QUERY );
    2592           0 :         if( xProps.is() )
    2593           0 :             SvXMLUnitConverter::convertPropertySet( rProps, xProps );
    2594             :         DocumentSettingsSerializer *pFilter;
    2595           0 :         pFilter = dynamic_cast<DocumentSettingsSerializer *>(xProps.get());
    2596           0 :         if( pFilter )
    2597           0 :             rProps = pFilter->filterStreamsToStorage( GetTargetStorage(), rProps );
    2598           0 :     }
    2599           0 : }
    2600             : 
    2601             : //////////////////////////////////////////////////////////////////////////////
    2602             : 
    2603           0 : void SdXMLExport::addDataStyle(const sal_Int32 nNumberFormat, sal_Bool bTimeFormat )
    2604             : {
    2605           0 :     sal_Int32 nFormat = nNumberFormat;
    2606           0 :     if( (nNumberFormat > 1) && (nNumberFormat <= 0x0f) )
    2607           0 :         nFormat -= 2;
    2608             : 
    2609           0 :     if( bTimeFormat )
    2610             :     {
    2611           0 :         if( maUsedTimeStyles.count( nFormat ) == 0 )
    2612           0 :             maUsedTimeStyles.insert( nFormat );
    2613             :     }
    2614             :     else
    2615             :     {
    2616           0 :         if( maUsedDateStyles.count( nFormat ) == 0 )
    2617           0 :             maUsedDateStyles.insert( nFormat );
    2618             :     }
    2619           0 : }
    2620             : 
    2621             : //////////////////////////////////////////////////////////////////////////////
    2622             : 
    2623           0 : void SdXMLExport::exportDataStyles()
    2624             : {
    2625             :     // there are no data styles to export in draw/impress yet
    2626           0 : }
    2627             : 
    2628             : //////////////////////////////////////////////////////////////////////////////
    2629             : 
    2630           0 : void SdXMLExport::exportAutoDataStyles()
    2631             : {
    2632           0 :     SdXMLFormatMap::iterator aIter( maUsedDateStyles.begin() );
    2633           0 :     SdXMLFormatMap::iterator aEnd( maUsedDateStyles.end() );
    2634             : 
    2635           0 :     while( aIter != aEnd )
    2636           0 :         SdXMLNumberStylesExporter::exportDateStyle( *this, (*aIter++) );
    2637             : 
    2638           0 :     aIter = maUsedTimeStyles.begin();
    2639           0 :     aEnd = maUsedTimeStyles.end();
    2640           0 :     while( aIter != aEnd )
    2641           0 :         SdXMLNumberStylesExporter::exportTimeStyle( *this, (*aIter++) );
    2642             : 
    2643           0 :     if(HasFormExport())
    2644           0 :         GetFormExport()->exportAutoControlNumberStyles();
    2645           0 : }
    2646             : 
    2647             : //////////////////////////////////////////////////////////////////////////////
    2648             : 
    2649           0 : OUString SdXMLExport::getDataStyleName(const sal_Int32 nNumberFormat, sal_Bool bTimeFormat ) const
    2650             : {
    2651           0 :     if( bTimeFormat )
    2652             :     {
    2653           0 :         return SdXMLNumberStylesExporter::getTimeStyleName( nNumberFormat );
    2654             :     }
    2655             :     else
    2656             :     {
    2657           0 :         return SdXMLNumberStylesExporter::getDateStyleName( nNumberFormat );
    2658             :     }
    2659             : }
    2660             : 
    2661           0 : OUString SdXMLExport::getNavigationOrder( const Reference< XDrawPage >& xDrawPage )
    2662             : {
    2663           0 :     OUStringBuffer sNavOrder;
    2664             :     try
    2665             :     {
    2666           0 :         Reference< XPropertySet > xSet( xDrawPage, UNO_QUERY_THROW );
    2667           0 :         Reference< XIndexAccess > xNavOrder( xSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "NavigationOrder" ) ) ), UNO_QUERY_THROW );
    2668             : 
    2669           0 :         Reference< XIndexAccess > xZOrderAccess( xDrawPage, UNO_QUERY );
    2670             : 
    2671             :         // only export navigation order if it is different from the z-order
    2672           0 :         if( (xNavOrder.get() != xZOrderAccess.get()) && (xNavOrder->getCount() == xDrawPage->getCount())  )
    2673             :         {
    2674             :             sal_Int32 nIndex;
    2675           0 :             const sal_Int32 nCount = xNavOrder->getCount();
    2676           0 :             for( nIndex = 0; nIndex < nCount; ++nIndex )
    2677             :             {
    2678           0 :                 OUString sId( getInterfaceToIdentifierMapper().registerReference( Reference< XInterface >( xNavOrder->getByIndex( nIndex ), UNO_QUERY ) ) );
    2679           0 :                 if( !sId.isEmpty() )
    2680             :                 {
    2681           0 :                     if( sNavOrder.getLength() != 0 )
    2682           0 :                         sNavOrder.append( (sal_Unicode)' ' );
    2683           0 :                     sNavOrder.append( sId );
    2684             :                 }
    2685           0 :             }
    2686           0 :         }
    2687             :     }
    2688           0 :     catch(const Exception&)
    2689             :     {
    2690             :     }
    2691           0 :     return sNavOrder.makeStringAndClear();
    2692             : }
    2693             : 
    2694             : //////////////////////////////////////////////////////////////////////////////
    2695             : 
    2696           0 : void SdXMLExport::collectAnnotationAutoStyles( const Reference<XDrawPage>& xDrawPage )
    2697             : {
    2698           0 :     Reference< XAnnotationAccess > xAnnotationAccess( xDrawPage, UNO_QUERY );
    2699           0 :     if( xAnnotationAccess.is() ) try
    2700             :     {
    2701           0 :         Reference< XAnnotationEnumeration > xAnnotationEnumeration( xAnnotationAccess->createAnnotationEnumeration() );
    2702           0 :         if( xAnnotationEnumeration.is() )
    2703             :         {
    2704           0 :             while( xAnnotationEnumeration->hasMoreElements() )
    2705             :             {
    2706           0 :                 Reference< XAnnotation > xAnnotation( xAnnotationEnumeration->nextElement(), UNO_QUERY_THROW );
    2707           0 :                 Reference< XText > xText( xAnnotation->getTextRange() );
    2708           0 :                 if(xText.is() && !xText->getString().isEmpty())
    2709           0 :                     GetTextParagraphExport()->collectTextAutoStyles( xText );
    2710           0 :             }
    2711           0 :         }
    2712             :     }
    2713           0 :     catch(const Exception&)
    2714             :     {
    2715             :         OSL_FAIL("SdXMLExport::collectAnnotationAutoStyles(), exception caught during export of annotation auto styles");
    2716           0 :     }
    2717           0 : }
    2718             : 
    2719           0 : void SdXMLExport::exportAnnotations( const Reference<XDrawPage>& xDrawPage )
    2720             : {
    2721             :     // do not export in ODF 1.2 or older
    2722           0 :     if( getDefaultVersion() <= SvtSaveOptions::ODFVER_012 )
    2723           0 :         return;
    2724             : 
    2725           0 :     Reference< XAnnotationAccess > xAnnotationAccess( xDrawPage, UNO_QUERY );
    2726           0 :     if( xAnnotationAccess.is() ) try
    2727             :     {
    2728           0 :         Reference< XAnnotationEnumeration > xAnnotationEnumeration( xAnnotationAccess->createAnnotationEnumeration() );
    2729           0 :         if( xAnnotationEnumeration.is() && xAnnotationEnumeration->hasMoreElements() )
    2730             :         {
    2731           0 :             OUStringBuffer sStringBuffer;
    2732           0 :             do
    2733             :             {
    2734           0 :                 Reference< XAnnotation > xAnnotation( xAnnotationEnumeration->nextElement(), UNO_QUERY_THROW );
    2735             : 
    2736           0 :                 RealPoint2D aPosition( xAnnotation->getPosition() );
    2737             : 
    2738           0 :                 GetMM100UnitConverter().convertMeasureToXML(sStringBuffer,
    2739           0 :                         static_cast<sal_Int32>( aPosition.X * 100 ) );
    2740           0 :                 AddAttribute(XML_NAMESPACE_SVG, XML_X, sStringBuffer.makeStringAndClear());
    2741             : 
    2742           0 :                 GetMM100UnitConverter().convertMeasureToXML(sStringBuffer,
    2743           0 :                         static_cast<sal_Int32>( aPosition.Y * 100 ) );
    2744           0 :                 AddAttribute(XML_NAMESPACE_SVG, XML_Y, sStringBuffer.makeStringAndClear());
    2745             : 
    2746           0 :                 RealSize2D aSize( xAnnotation->getSize() );
    2747             : 
    2748           0 :                 if( aSize.Width || aSize.Height )
    2749             :                 {
    2750           0 :                     GetMM100UnitConverter().convertMeasureToXML(sStringBuffer,
    2751           0 :                             static_cast<sal_Int32>( aSize.Width * 100 ) );
    2752           0 :                     AddAttribute(XML_NAMESPACE_SVG, XML_WIDTH, sStringBuffer.makeStringAndClear());
    2753           0 :                     GetMM100UnitConverter().convertMeasureToXML(sStringBuffer,
    2754           0 :                             static_cast<sal_Int32>( aSize.Height * 100 ) );
    2755           0 :                     AddAttribute(XML_NAMESPACE_SVG, XML_HEIGHT, sStringBuffer.makeStringAndClear());
    2756             :                 }
    2757             : 
    2758             :                 // annotation element + content
    2759           0 :                 SvXMLElementExport aElem(*this, XML_NAMESPACE_OFFICE_EXT, XML_ANNOTATION, sal_False, sal_True);
    2760             : 
    2761             :                 // author
    2762           0 :                 OUString aAuthor( xAnnotation->getAuthor() );
    2763           0 :                 if( !aAuthor.isEmpty() )
    2764             :                 {
    2765           0 :                     SvXMLElementExport aCreatorElem( *this, XML_NAMESPACE_DC, XML_CREATOR, sal_True, sal_False );
    2766           0 :                     this->Characters(aAuthor);
    2767             :                 }
    2768             : 
    2769             :                 {
    2770             :                     // date time
    2771           0 :                     com::sun::star::util::DateTime aDate( xAnnotation->getDateTime() );
    2772           0 :                     ::sax::Converter::convertDateTime(sStringBuffer, aDate, true);
    2773           0 :                     SvXMLElementExport aDateElem( *this, XML_NAMESPACE_DC, XML_DATE, sal_True, sal_False );
    2774           0 :                     Characters(sStringBuffer.makeStringAndClear());
    2775             :                 }
    2776             : 
    2777           0 :                 com::sun::star::uno::Reference < com::sun::star::text::XText > xText( xAnnotation->getTextRange() );
    2778           0 :                 if( xText.is() )
    2779           0 :                     this->GetTextParagraphExport()->exportText( xText );
    2780             :             }
    2781           0 :             while( xAnnotationEnumeration->hasMoreElements() );
    2782           0 :         }
    2783             :     }
    2784           0 :     catch(const Exception&)
    2785             :     {
    2786             :         OSL_FAIL("SdXMLExport::exportAnnotations(), exception caught during export of annotations");
    2787           0 :     }
    2788             : }
    2789             : 
    2790             : //////////////////////////////////////////////////////////////////////////////
    2791             : 
    2792             : #define SERVICE( classname, servicename, implementationname, draw, flags )\
    2793             : uno::Sequence< OUString > SAL_CALL classname##_getSupportedServiceNames() throw()\
    2794             : {\
    2795             :     const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( servicename ) );\
    2796             :     const uno::Sequence< OUString > aSeq( &aServiceName, 1 );\
    2797             :     return aSeq;\
    2798             : }\
    2799             : OUString SAL_CALL classname##_getImplementationName() throw()\
    2800             : {\
    2801             :     return OUString( RTL_CONSTASCII_USTRINGPARAM( implementationname ) );\
    2802             : }\
    2803             : uno::Reference< uno::XInterface > SAL_CALL classname##_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )\
    2804             : {\
    2805             :     return (cppu::OWeakObject*)new SdXMLExport( rSMgr, draw, flags );\
    2806             : }
    2807             : 
    2808           3 : SERVICE( XMLImpressExportOasis, "com.sun.star.comp.Impress.XMLOasisExporter", "XMLImpressExportOasis", sal_False, EXPORT_OASIS|EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED );
    2809           3 : SERVICE( XMLImpressStylesExportOasis, "com.sun.star.comp.Impress.XMLOasisStylesExporter", "XMLImpressStylesExportOasis", sal_False, EXPORT_OASIS|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES );
    2810           3 : SERVICE( XMLImpressContentExportOasis, "com.sun.star.comp.Impress.XMLOasisContentExporter", "XMLImpressContentExportOasis", sal_False, EXPORT_OASIS|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS );
    2811           3 : SERVICE( XMLImpressMetaExportOasis, "com.sun.star.comp.Impress.XMLOasisMetaExporter", "XMLImpressMetaExportOasis", sal_False, EXPORT_OASIS|EXPORT_META );
    2812           3 : SERVICE( XMLImpressSettingsExportOasis, "com.sun.star.comp.Impress.XMLOasisSettingsExporter", "XMLImpressSettingsExportOasis", sal_False, EXPORT_OASIS|EXPORT_SETTINGS );
    2813             : 
    2814           2 : SERVICE( XMLImpressExportOOO, "com.sun.star.comp.Impress.XMLExporter", "XMLImpressExportOOO", sal_False, EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED );
    2815           2 : SERVICE( XMLImpressStylesExportOOO, "com.sun.star.comp.Impress.XMLStylesExporter", "XMLImpressStylesExportOOO", sal_False, EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES );
    2816           2 : SERVICE( XMLImpressContentExportOOO, "com.sun.star.comp.Impress.XMLContentExporter", "XMLImpressContentExportOOO", sal_False, EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS );
    2817           2 : SERVICE( XMLImpressMetaExportOOO, "com.sun.star.comp.Impress.XMLMetaExporter", "XMLImpressMetaExportOOO", sal_False, EXPORT_META );
    2818           2 : SERVICE( XMLImpressSettingsExportOOO, "com.sun.star.comp.Impress.XMLSettingsExporter", "XMLImpressSettingsExportOOO", sal_False, EXPORT_SETTINGS );
    2819             : 
    2820           2 : SERVICE( XMLDrawExportOasis, "com.sun.star.comp.Draw.XMLOasisExporter", "XMLDrawExportOasis", sal_True, EXPORT_OASIS|EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED );
    2821           2 : SERVICE( XMLDrawStylesExportOasis, "com.sun.star.comp.Draw.XMLOasisStylesExporter", "XMLDrawStylesExportOasis", sal_True, EXPORT_OASIS|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES );
    2822           2 : SERVICE( XMLDrawContentExportOasis, "com.sun.star.comp.Draw.XMLOasisContentExporter", "XMLDrawContentExportOasis", sal_True, EXPORT_OASIS|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS );
    2823           2 : SERVICE( XMLDrawMetaExportOasis, "com.sun.star.comp.Draw.XMLOasisMetaExporter", "XMLDrawMetaExportOasis", sal_True, EXPORT_OASIS|EXPORT_META );
    2824           2 : SERVICE( XMLDrawSettingsExportOasis, "com.sun.star.comp.Draw.XMLOasisSettingsExporter", "XMLDrawSettingsExportOasis", sal_True, EXPORT_OASIS|EXPORT_SETTINGS );
    2825             : 
    2826           2 : SERVICE( XMLDrawExportOOO, "com.sun.star.comp.Draw.XMLExporter", "XMLDrawExportOOO", sal_True, EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED );
    2827           2 : SERVICE( XMLDrawStylesExportOOO, "com.sun.star.comp.Draw.XMLStylesExporter", "XMLDrawStylesExportOOO", sal_True, EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES );
    2828           2 : SERVICE( XMLDrawContentExportOOO, "com.sun.star.comp.Draw.XMLContentExporter", "XMLDrawContentExportOOO", sal_True, EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS );
    2829           2 : SERVICE( XMLDrawMetaExportOOO, "com.sun.star.comp.Draw.XMLMetaExporter", "XMLDrawMetaExportOOO", sal_True, EXPORT_META );
    2830           2 : SERVICE( XMLDrawSettingsExportOOO, "com.sun.star.comp.Draw.XMLSettingsExporter", "XMLDrawSettingsExportOOO", sal_True, EXPORT_SETTINGS );
    2831             : 
    2832           2 : SERVICE( XMLDrawingLayerExport, "com.sun.star.comp.DrawingLayer.XMLExporter", "XMLDrawingLayerExport", sal_True, EXPORT_OASIS|EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_FONTDECLS|EXPORT_EMBEDDED );
    2833           2 : SERVICE( XMLImpressClipboardExport, "com.sun.star.comp.Impress.XMLClipboardExporter", "XMLImpressClipboardExport", sal_False, EXPORT_OASIS|EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_FONTDECLS|EXPORT_EMBEDDED );
    2834             : 
    2835             : // XServiceInfo
    2836           0 : OUString SAL_CALL SdXMLExport::getImplementationName() throw( uno::RuntimeException )
    2837             : {
    2838           0 :     if( IsDraw())
    2839             :     {
    2840             :         // Draw
    2841             : 
    2842           0 :         switch( getExportFlags())
    2843             :         {
    2844             :             case EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED:
    2845           0 :                 return XMLDrawExportOOO_getImplementationName();
    2846             :             case EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES:
    2847           0 :                 return XMLDrawStylesExportOOO_getImplementationName();
    2848             :             case EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS:
    2849           0 :                 return XMLDrawContentExportOOO_getImplementationName();
    2850             :             case EXPORT_META:
    2851           0 :                 return XMLDrawMetaExportOOO_getImplementationName();
    2852             :             case EXPORT_SETTINGS:
    2853           0 :                 return XMLDrawSettingsExportOOO_getImplementationName();
    2854             : 
    2855             :             case EXPORT_OASIS|EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED:
    2856           0 :                 return XMLDrawExportOasis_getImplementationName();
    2857             :             case EXPORT_OASIS|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES:
    2858           0 :                 return XMLDrawStylesExportOasis_getImplementationName();
    2859             :             case EXPORT_OASIS|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS:
    2860           0 :                 return XMLDrawContentExportOasis_getImplementationName();
    2861             :             case EXPORT_OASIS|EXPORT_META:
    2862           0 :                 return XMLDrawMetaExportOasis_getImplementationName();
    2863             :             case EXPORT_OASIS|EXPORT_SETTINGS:
    2864           0 :                 return XMLDrawSettingsExportOasis_getImplementationName();
    2865             : 
    2866             :             default:
    2867           0 :                 return XMLDrawExportOOO_getImplementationName();
    2868             :         }
    2869             :     }
    2870             :     else
    2871             :     {
    2872             :         // Impress
    2873             : 
    2874           0 :         switch( getExportFlags())
    2875             :         {
    2876             :             case EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED:
    2877           0 :                 return XMLImpressExportOOO_getImplementationName();
    2878             :             case EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES:
    2879           0 :                 return XMLImpressStylesExportOOO_getImplementationName();
    2880             :             case EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS:
    2881           0 :                 return XMLImpressContentExportOOO_getImplementationName();
    2882             :             case EXPORT_META:
    2883           0 :                 return XMLImpressMetaExportOOO_getImplementationName();
    2884             :             case EXPORT_SETTINGS:
    2885           0 :                 return XMLImpressSettingsExportOOO_getImplementationName();
    2886             :             case EXPORT_OASIS|EXPORT_META|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_SETTINGS|EXPORT_FONTDECLS|EXPORT_EMBEDDED:
    2887           0 :                 return XMLImpressExportOasis_getImplementationName();
    2888             :             case EXPORT_OASIS|EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES:
    2889           0 :                 return XMLImpressStylesExportOasis_getImplementationName();
    2890             :             case EXPORT_OASIS|EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS:
    2891           0 :                 return XMLImpressContentExportOasis_getImplementationName();
    2892             :             case EXPORT_OASIS|EXPORT_META:
    2893           0 :                 return XMLImpressMetaExportOasis_getImplementationName();
    2894             :             case EXPORT_OASIS|EXPORT_SETTINGS:
    2895           0 :                 return XMLImpressSettingsExportOasis_getImplementationName();
    2896             : 
    2897             :             default:
    2898           0 :                 return XMLImpressExportOOO_getImplementationName();
    2899             :         }
    2900             :     }
    2901             : }
    2902             : 
    2903             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10