2000-09-18 16:07:07 +00:00
|
|
|
/*************************************************************************
|
|
|
|
*
|
|
|
|
* $RCSfile: sdxmlexp.cxx,v $
|
|
|
|
*
|
2001-05-02 09:59:52 +00:00
|
|
|
* $Revision: 1.61 $
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
2001-05-02 09:59:52 +00:00
|
|
|
* last change: $Author: cl $ $Date: 2001-05-02 10:59:52 $
|
2000-09-18 16:07:07 +00:00
|
|
|
*
|
|
|
|
* The Contents of this file are made available subject to the terms of
|
|
|
|
* either of the following licenses
|
|
|
|
*
|
|
|
|
* - GNU Lesser General Public License Version 2.1
|
|
|
|
* - Sun Industry Standards Source License Version 1.1
|
|
|
|
*
|
|
|
|
* Sun Microsystems Inc., October, 2000
|
|
|
|
*
|
|
|
|
* GNU Lesser General Public License Version 2.1
|
|
|
|
* =============================================
|
|
|
|
* Copyright 2000 by Sun Microsystems, Inc.
|
|
|
|
* 901 San Antonio Road, Palo Alto, CA 94303, USA
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License version 2.1, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
* MA 02111-1307 USA
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Sun Industry Standards Source License Version 1.1
|
|
|
|
* =================================================
|
|
|
|
* The contents of this file are subject to the Sun Industry Standards
|
|
|
|
* Source License Version 1.1 (the "License"); You may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of the
|
|
|
|
* License at http://www.openoffice.org/license.html.
|
|
|
|
*
|
|
|
|
* Software provided under this License is provided on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
|
|
|
|
* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
|
|
|
|
* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
|
|
|
|
* See the License for the specific provisions governing your rights and
|
|
|
|
* obligations concerning the Software.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
|
|
|
|
*
|
|
|
|
* Copyright: 2000 by Sun Microsystems, Inc.
|
|
|
|
*
|
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s): _______________________________________
|
|
|
|
*
|
|
|
|
*
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
#pragma hdrstop
|
|
|
|
|
|
|
|
#ifndef _XMLOFF_NMSPMAP_HXX
|
|
|
|
#include "nmspmap.hxx"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _XMLOFF_XMLNMSPE_HXX
|
|
|
|
#include "xmlnmspe.hxx"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _XMLOFF_XMLUCONV_HXX
|
|
|
|
#include "xmluconv.hxx"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _XMLOFF_XMLKYWD_HXX
|
|
|
|
#include "xmlkywd.hxx"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _LANG_HXX
|
|
|
|
#include <tools/lang.hxx>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _XMLOFF_XMLMETAE_HXX
|
|
|
|
#include "xmlmetae.hxx"
|
|
|
|
#endif
|
|
|
|
|
2001-02-15 16:35:27 +00:00
|
|
|
#ifndef _COM_SUN_STAR_PRESENTATION_XPRESENTATIONSUPPLIER_HPP_
|
|
|
|
#include <com/sun/star/presentation/XPresentationSupplier.hpp>
|
|
|
|
#endif
|
|
|
|
|
2000-12-19 15:23:48 +00:00
|
|
|
#ifndef _COM_SUN_STAR_PRESENTATION_XCUSTOMPRESENTATIONSUPPLIER_HPP_
|
|
|
|
#include <com/sun/star/presentation/XCustomPresentationSupplier.hpp>
|
|
|
|
#endif
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#ifndef _COM_SUN_STAR_DOCUMENT_XDOCUMENTINFOSUPPLIER_HPP_
|
|
|
|
#include <com/sun/star/document/XDocumentInfoSupplier.hpp>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _COM_SUN_STAR_TASK_XSTATUSINDICATORSUPPLIER_HPP_
|
|
|
|
#include <com/sun/star/task/XStatusIndicatorSupplier.hpp>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _COM_SUN_STAR_LANG_LOCALE_HPP_
|
|
|
|
#include <com/sun/star/lang/Locale.hpp>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _COM_SUN_STAR_UNO_ANY_HXX_
|
|
|
|
#include <com/sun/star/uno/Any.hxx>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _SDXMLEXP_HXX
|
|
|
|
#include "sdxmlexp.hxx"
|
|
|
|
#endif
|
|
|
|
|
2000-12-05 22:31:17 +00:00
|
|
|
#ifndef _SDXMLEXP_IMPL_HXX
|
|
|
|
#include "sdxmlexp_impl.hxx"
|
|
|
|
#endif
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#ifndef _COM_SUN_STAR_DRAWING_XDRAWPAGESSUPPLIER_HPP_
|
|
|
|
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _COM_SUN_STAR_DRAWING_XMASTERPAGESSUPPLIER_HPP_
|
|
|
|
#include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _COM_SUN_STAR_VIEW_PAPERORIENTATION_HPP_
|
|
|
|
#include <com/sun/star/view/PaperOrientation.hpp>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _COM_SUN_STAR_STYLE_XSTYLEFAMILIESSUPPLIER_HPP_
|
|
|
|
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _COM_SUN_STAR_STYLE_XSTYLE_HPP_
|
|
|
|
#include <com/sun/star/style/XStyle.hpp>
|
|
|
|
#endif
|
|
|
|
|
2001-01-18 13:53:32 +00:00
|
|
|
#ifndef _COM_SUN_STAR_FORM_XFORMSUPPLIER_HPP_
|
|
|
|
#include <com/sun/star/form/XFormsSupplier.hpp>
|
|
|
|
#endif
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#ifndef _COM_SUN_STAR_PRESENTATION_XPRESENTATIONPAGE_HPP_
|
|
|
|
#include <com/sun/star/presentation/XPresentationPage.hpp>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _COM_SUN_STAR_DRAWING_XMASTERPAGETARGET_HPP_
|
|
|
|
#include <com/sun/star/drawing/XMasterPageTarget.hpp>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _COM_SUN_STAR_TEXT_XTEXT_HPP_
|
|
|
|
#include <com/sun/star/text/XText.hpp>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _COM_SUN_STAR_CHART_XCHARTDOCUMENT_HPP_
|
|
|
|
#include <com/sun/star/chart/XChartDocument.hpp>
|
|
|
|
#endif
|
|
|
|
|
2000-11-16 15:31:37 +00:00
|
|
|
#ifndef _COM_SUN_STAR_CONTAINER_XNAMED_HPP_
|
|
|
|
#include <com/sun/star/container/XNamed.hpp>
|
|
|
|
#endif
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
#ifndef _RTL_USTRBUF_HXX_
|
|
|
|
#include <rtl/ustrbuf.hxx>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _SV_GEN_HXX
|
|
|
|
#include <tools/gen.hxx>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _TOOLS_DEBUG_HXX
|
|
|
|
#include <tools/debug.hxx>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _XMLOFF_XMLASTPLP_HXX
|
|
|
|
#include "xmlaustp.hxx"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _XMLOFF_FAMILIES_HXX_
|
|
|
|
#include "families.hxx"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _XMLOFF_STYLEEXP_HXX_
|
|
|
|
#include "styleexp.hxx"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _SDPROPLS_HXX
|
|
|
|
#include "sdpropls.hxx"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _XMLOFF_XMLEXPPR_HXX
|
|
|
|
#include "xmlexppr.hxx"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSTATE_HPP_
|
|
|
|
#include <com/sun/star/beans/XPropertyState.hpp>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _XEXPTRANSFORM_HXX
|
|
|
|
#include "xexptran.hxx"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _ISOLANG_HXX
|
|
|
|
#include <tools/isolang.hxx>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _CPPUHELPER_IMPLBASE1_HXX
|
|
|
|
#include <cppuhelper/implbase1.hxx>
|
|
|
|
#endif
|
|
|
|
|
2001-03-16 13:37:07 +00:00
|
|
|
#ifndef _COMPHELPER_EXTRACT_HXX_
|
|
|
|
#include <comphelper/extract.hxx>
|
2000-09-18 16:07:07 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
|
|
|
|
#include <com/sun/star/lang/XServiceInfo.hpp>
|
|
|
|
#endif
|
|
|
|
|
2000-11-08 11:16:21 +00:00
|
|
|
#ifndef _XMLOFF_PROPERTYSETMERGER_HXX_
|
|
|
|
#include "PropertySetMerger.hxx"
|
|
|
|
#endif
|
|
|
|
|
2001-01-19 15:25:18 +00:00
|
|
|
#ifndef _XMLOFF_LAYEREXP_HXX
|
|
|
|
#include "layerexp.hxx"
|
|
|
|
#endif
|
|
|
|
|
2001-02-21 17:04:45 +00:00
|
|
|
|
|
|
|
#ifndef _XMLOFF_VISAREAEXPORT_HXX
|
|
|
|
#include "VisAreaExport.hxx"
|
|
|
|
#endif
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
using namespace ::rtl;
|
|
|
|
using namespace ::com::sun::star;
|
2000-12-19 15:23:48 +00:00
|
|
|
using namespace ::com::sun::star::uno;
|
|
|
|
using namespace ::com::sun::star::beans;
|
|
|
|
using namespace ::com::sun::star::container;
|
|
|
|
using namespace ::com::sun::star::drawing;
|
|
|
|
using namespace ::com::sun::star::presentation;
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
class ImpXMLEXPPageMasterInfo
|
|
|
|
{
|
|
|
|
sal_Int32 mnBorderBottom;
|
|
|
|
sal_Int32 mnBorderLeft;
|
|
|
|
sal_Int32 mnBorderRight;
|
|
|
|
sal_Int32 mnBorderTop;
|
|
|
|
sal_Int32 mnWidth;
|
|
|
|
sal_Int32 mnHeight;
|
|
|
|
view::PaperOrientation meOrientation;
|
|
|
|
OUString msName;
|
|
|
|
OUString msMasterPageName;
|
|
|
|
|
|
|
|
public:
|
|
|
|
ImpXMLEXPPageMasterInfo(const SdXMLExport& rExp, const uno::Reference<drawing::XDrawPage>& xPage);
|
|
|
|
BOOL operator==(const ImpXMLEXPPageMasterInfo& rInfo) const;
|
|
|
|
void SetName(const OUString& rStr);
|
|
|
|
|
|
|
|
const OUString& GetName() const { return msName; }
|
|
|
|
const OUString& GetMasterPageName() const { return msMasterPageName; }
|
|
|
|
|
|
|
|
sal_Int32 GetBorderBottom() const { return mnBorderBottom; }
|
|
|
|
sal_Int32 GetBorderLeft() const { return mnBorderLeft; }
|
|
|
|
sal_Int32 GetBorderRight() const { return mnBorderRight; }
|
|
|
|
sal_Int32 GetBorderTop() const { return mnBorderTop; }
|
|
|
|
sal_Int32 GetWidth() const { return mnWidth; }
|
|
|
|
sal_Int32 GetHeight() const { return mnHeight; }
|
|
|
|
view::PaperOrientation GetOrientation() const { return meOrientation; }
|
|
|
|
};
|
|
|
|
|
|
|
|
ImpXMLEXPPageMasterInfo::ImpXMLEXPPageMasterInfo(
|
|
|
|
const SdXMLExport& rExp,
|
|
|
|
const uno::Reference<drawing::XDrawPage>& xPage)
|
|
|
|
: mnBorderBottom(0),
|
|
|
|
mnBorderLeft(0),
|
|
|
|
mnBorderRight(0),
|
|
|
|
mnBorderTop(0),
|
|
|
|
mnWidth(0),
|
|
|
|
mnHeight(0),
|
|
|
|
meOrientation(rExp.IsDraw() ? view::PaperOrientation_PORTRAIT : view::PaperOrientation_LANDSCAPE)
|
|
|
|
{
|
|
|
|
uno::Reference <beans::XPropertySet> xPropSet(xPage, uno::UNO_QUERY);
|
|
|
|
if(xPropSet.is())
|
|
|
|
{
|
|
|
|
uno::Any aAny;
|
|
|
|
|
|
|
|
aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderBottom")));
|
|
|
|
aAny >>= mnBorderBottom;
|
|
|
|
|
|
|
|
aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderLeft")));
|
|
|
|
aAny >>= mnBorderLeft;
|
|
|
|
|
|
|
|
aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderRight")));
|
|
|
|
aAny >>= mnBorderRight;
|
|
|
|
|
|
|
|
aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("BorderTop")));
|
|
|
|
aAny >>= mnBorderTop;
|
|
|
|
|
|
|
|
aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Width")));
|
|
|
|
aAny >>= mnWidth;
|
|
|
|
|
|
|
|
aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Height")));
|
|
|
|
aAny >>= mnHeight;
|
|
|
|
|
|
|
|
aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Orientation")));
|
|
|
|
aAny >>= meOrientation;
|
|
|
|
}
|
|
|
|
|
|
|
|
uno::Reference <container::XNamed> xMasterNamed(xPage, uno::UNO_QUERY);
|
|
|
|
if(xMasterNamed.is())
|
|
|
|
{
|
|
|
|
msMasterPageName = xMasterNamed->getName();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL ImpXMLEXPPageMasterInfo::operator==(const ImpXMLEXPPageMasterInfo& rInfo) const
|
|
|
|
{
|
|
|
|
return ((mnBorderBottom == rInfo.mnBorderBottom)
|
|
|
|
&& (mnBorderLeft == rInfo.mnBorderLeft)
|
|
|
|
&& (mnBorderRight == rInfo.mnBorderRight)
|
|
|
|
&& (mnBorderTop == rInfo.mnBorderTop)
|
|
|
|
&& (mnWidth == rInfo.mnWidth)
|
|
|
|
&& (mnHeight == rInfo.mnHeight)
|
|
|
|
&& (meOrientation == rInfo.meOrientation));
|
|
|
|
}
|
|
|
|
|
|
|
|
void ImpXMLEXPPageMasterInfo::SetName(const OUString& rStr)
|
|
|
|
{
|
|
|
|
msName = rStr;
|
|
|
|
}
|
|
|
|
|
|
|
|
DECLARE_LIST(ImpXMLEXPPageMasterList, ImpXMLEXPPageMasterInfo*);
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2001-03-09 12:28:06 +00:00
|
|
|
#define IMP_AUTOLAYOUT_INFO_MAX (31L)
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
class ImpXMLAutoLayoutInfo
|
|
|
|
{
|
|
|
|
sal_uInt16 mnType;
|
|
|
|
ImpXMLEXPPageMasterInfo* mpPageMasterInfo;
|
|
|
|
OUString msLayoutName;
|
|
|
|
Rectangle maTitleRect;
|
|
|
|
Rectangle maPresRect;
|
|
|
|
sal_Int32 mnGapX;
|
|
|
|
sal_Int32 mnGapY;
|
|
|
|
|
|
|
|
public:
|
|
|
|
ImpXMLAutoLayoutInfo(sal_uInt16 nTyp, ImpXMLEXPPageMasterInfo* pInf);
|
|
|
|
|
|
|
|
BOOL operator==(const ImpXMLAutoLayoutInfo& rInfo) const;
|
|
|
|
|
|
|
|
sal_uInt16 GetLayoutType() const { return mnType; }
|
|
|
|
sal_Int32 GetGapX() const { return mnGapX; }
|
|
|
|
sal_Int32 GetGapY() const { return mnGapY; }
|
|
|
|
|
|
|
|
const OUString& GetLayoutName() const { return msLayoutName; }
|
|
|
|
void SetLayoutName(const OUString& rNew) { msLayoutName = rNew; }
|
|
|
|
|
|
|
|
const Rectangle& GetTitleRectangle() const { return maTitleRect; }
|
|
|
|
const Rectangle& GetPresRectangle() const { return maPresRect; }
|
|
|
|
|
|
|
|
static BOOL IsCreateNecessary(sal_uInt16 nTyp);
|
|
|
|
};
|
|
|
|
|
|
|
|
BOOL ImpXMLAutoLayoutInfo::IsCreateNecessary(sal_uInt16 nTyp)
|
|
|
|
{
|
|
|
|
if(nTyp == 5 /* AUTOLAYOUT_ORG */
|
|
|
|
|| nTyp == 20 /* AUTOLAYOUT_NONE */
|
|
|
|
|| nTyp >= IMP_AUTOLAYOUT_INFO_MAX)
|
|
|
|
return FALSE;
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL ImpXMLAutoLayoutInfo::operator==(const ImpXMLAutoLayoutInfo& rInfo) const
|
|
|
|
{
|
|
|
|
return ((mnType == rInfo.mnType
|
|
|
|
&& mpPageMasterInfo == rInfo.mpPageMasterInfo));
|
|
|
|
}
|
|
|
|
|
|
|
|
ImpXMLAutoLayoutInfo::ImpXMLAutoLayoutInfo(sal_uInt16 nTyp, ImpXMLEXPPageMasterInfo* pInf)
|
|
|
|
: mnType(nTyp),
|
|
|
|
mpPageMasterInfo(pInf)
|
|
|
|
{
|
|
|
|
// create full info (initialze with typical values)
|
|
|
|
Point aPagePos(0,0);
|
|
|
|
Size aPageSize(28000, 21000);
|
|
|
|
Size aPageInnerSize(28000, 21000);
|
|
|
|
|
|
|
|
if(mpPageMasterInfo)
|
|
|
|
{
|
|
|
|
aPagePos = Point(mpPageMasterInfo->GetBorderLeft(), mpPageMasterInfo->GetBorderTop());
|
|
|
|
aPageSize = Size(mpPageMasterInfo->GetWidth(), mpPageMasterInfo->GetHeight());
|
|
|
|
aPageInnerSize = aPageSize;
|
|
|
|
aPageInnerSize.Width() -= mpPageMasterInfo->GetBorderLeft() + mpPageMasterInfo->GetBorderRight();
|
|
|
|
aPageInnerSize.Height() -= mpPageMasterInfo->GetBorderTop() + mpPageMasterInfo->GetBorderBottom();
|
|
|
|
}
|
|
|
|
|
|
|
|
// title rectangle aligning
|
|
|
|
Point aTitlePos(aPagePos);
|
|
|
|
Size aTitleSize(aPageInnerSize);
|
|
|
|
|
|
|
|
if(mnType == 21 /* AUTOLAYOUT_NOTES */)
|
|
|
|
{
|
|
|
|
aTitleSize.Height() = (long) (aTitleSize.Height() / 2.5);
|
|
|
|
Point aPos = aTitlePos;
|
|
|
|
aPos.Y() += long( aTitleSize.Height() * 0.083 );
|
|
|
|
Size aPartArea = aTitleSize;
|
|
|
|
Size aSize;
|
|
|
|
|
|
|
|
// tatsaechliche Seitengroesse in das Handout-Rechteck skalieren
|
|
|
|
double fH = (double) aPartArea.Width() / aPageSize.Width();
|
|
|
|
double fV = (double) aPartArea.Height() / aPageSize.Height();
|
|
|
|
|
|
|
|
if ( fH > fV )
|
|
|
|
fH = fV;
|
|
|
|
aSize.Width() = (long) (fH * aPageSize.Width());
|
|
|
|
aSize.Height() = (long) (fH * aPageSize.Height());
|
|
|
|
|
|
|
|
aPos.X() += (aPartArea.Width() - aSize.Width()) / 2;
|
|
|
|
aPos.Y() += (aPartArea.Height()- aSize.Height())/ 2;
|
|
|
|
|
|
|
|
aTitlePos = aPos;
|
|
|
|
aTitleSize = aSize;
|
|
|
|
}
|
2001-03-09 12:28:06 +00:00
|
|
|
else if(mnType == 27 || mnType == 28)
|
|
|
|
{
|
|
|
|
// AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART or
|
|
|
|
// AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE
|
|
|
|
Point aClassicTPos(
|
|
|
|
aTitlePos.X() + long( aTitleSize.Width() * 0.0735 ),
|
|
|
|
aTitlePos.Y() + long( aTitleSize.Height() * 0.083 ));
|
|
|
|
Size aClassicTSize(
|
|
|
|
long( aTitleSize.Width() * 0.854 ),
|
|
|
|
long( aTitleSize.Height() * 0.167 ));
|
|
|
|
Point aLPos(aPagePos);
|
|
|
|
Size aLSize(aPageInnerSize);
|
|
|
|
Point aClassicLPos(
|
|
|
|
aLPos.X() + long( aLSize.Width() * 0.0735 ),
|
|
|
|
aLPos.Y() + long( aLSize.Height() * 0.472 ));
|
|
|
|
Size aClassicLSize(
|
|
|
|
long( aLSize.Width() * 0.854 ),
|
|
|
|
long( aLSize.Height() * 0.444 ));
|
|
|
|
|
|
|
|
aTitlePos.X() = (aClassicTPos.X() + aClassicTSize.Width()) - aClassicTSize.Height();
|
|
|
|
aTitlePos.Y() = aClassicTPos.Y();
|
|
|
|
aTitleSize.Width() = aClassicTSize.Height();
|
|
|
|
aTitleSize.Height() = (aClassicLPos.Y() + aClassicLSize.Height()) - aClassicTPos.Y();
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
aTitlePos.X() += long( aTitleSize.Width() * 0.0735 );
|
|
|
|
aTitlePos.Y() += long( aTitleSize.Height() * 0.083 );
|
|
|
|
aTitleSize.Width() = long( aTitleSize.Width() * 0.854 );
|
|
|
|
aTitleSize.Height() = long( aTitleSize.Height() * 0.167 );
|
|
|
|
}
|
|
|
|
|
|
|
|
maTitleRect.SetPos(aTitlePos);
|
|
|
|
maTitleRect.SetSize(aTitleSize);
|
|
|
|
|
|
|
|
// layout rectangle aligning
|
|
|
|
Point aLayoutPos(aPagePos);
|
|
|
|
Size aLayoutSize(aPageInnerSize);
|
|
|
|
|
|
|
|
if(mnType == 21 /* AUTOLAYOUT_NOTES */)
|
|
|
|
{
|
|
|
|
aLayoutPos.X() += long( aLayoutSize.Width() * 0.0735 );
|
|
|
|
aLayoutPos.Y() += long( aLayoutSize.Height() * 0.472 );
|
|
|
|
aLayoutSize.Width() = long( aLayoutSize.Width() * 0.854 );
|
|
|
|
aLayoutSize.Height() = long( aLayoutSize.Height() * 0.444 );
|
|
|
|
}
|
|
|
|
else if(mnType >= 22 && mnType <= 26) // AUTOLAYOUT_HANDOUT
|
|
|
|
{
|
|
|
|
// keep info for inner area in maPresRect, put info for gap size
|
|
|
|
// to maTitleRect position
|
|
|
|
mnGapX = (aPageSize.Width() - aPageInnerSize.Width()) / 2;
|
|
|
|
mnGapY = (aPageSize.Height() - aPageInnerSize.Height()) / 2;
|
|
|
|
|
|
|
|
if(!mnGapX)
|
|
|
|
mnGapX = aPageSize.Width() / 10;
|
|
|
|
|
|
|
|
if(!mnGapY)
|
|
|
|
mnGapY = aPageSize.Height() / 10;
|
|
|
|
|
|
|
|
if(mnGapX < aPageInnerSize.Width() / 10)
|
|
|
|
mnGapX = aPageInnerSize.Width() / 10;
|
|
|
|
|
|
|
|
if(mnGapY < aPageInnerSize.Height() / 10)
|
|
|
|
mnGapY = aPageInnerSize.Height() / 10;
|
|
|
|
}
|
2001-03-09 12:28:06 +00:00
|
|
|
else if(mnType == 27 || mnType == 28)
|
|
|
|
{
|
|
|
|
// AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART or
|
|
|
|
// AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE
|
|
|
|
Point aClassicTPos(
|
|
|
|
aTitlePos.X() + long( aTitleSize.Width() * 0.0735 ),
|
|
|
|
aTitlePos.Y() + long( aTitleSize.Height() * 0.083 ));
|
|
|
|
Size aClassicTSize(
|
|
|
|
long( aTitleSize.Width() * 0.854 ),
|
|
|
|
long( aTitleSize.Height() * 0.167 ));
|
|
|
|
Point aClassicLPos(
|
|
|
|
aLayoutPos.X() + long( aLayoutSize.Width() * 0.0735 ),
|
|
|
|
aLayoutPos.Y() + long( aLayoutSize.Height() * 0.472 ));
|
|
|
|
Size aClassicLSize(
|
|
|
|
long( aLayoutSize.Width() * 0.854 ),
|
|
|
|
long( aLayoutSize.Height() * 0.444 ));
|
|
|
|
|
|
|
|
aLayoutPos.X() = aClassicLPos.X();
|
|
|
|
aLayoutPos.Y() = aClassicTPos.Y();
|
|
|
|
aLayoutSize.Width() = (aClassicLPos.X() + aClassicLSize.Width())
|
|
|
|
- (aClassicTSize.Height() + (aClassicLPos.Y() - (aClassicTPos.Y() + aClassicTSize.Height())));
|
|
|
|
aLayoutSize.Height() = (aClassicLPos.Y() + aClassicLSize.Height()) - aClassicTPos.Y();
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
aLayoutPos.X() += long( aLayoutSize.Width() * 0.0735 );
|
|
|
|
aLayoutPos.Y() += long( aLayoutSize.Height() * 0.278 );
|
|
|
|
aLayoutSize.Width() = long( aLayoutSize.Width() * 0.854 );
|
|
|
|
aLayoutSize.Height() = long( aLayoutSize.Height() * 0.630 );
|
|
|
|
}
|
|
|
|
|
|
|
|
maPresRect.SetPos(aLayoutPos);
|
|
|
|
maPresRect.SetSize(aLayoutSize);
|
|
|
|
}
|
|
|
|
|
|
|
|
DECLARE_LIST(ImpXMLAutoLayoutInfoList, ImpXMLAutoLayoutInfo*);
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2001-03-01 15:31:32 +00:00
|
|
|
SdXMLExport::SdXMLExport( sal_Bool bIsDraw, sal_uInt16 nExportFlags )
|
|
|
|
: SvXMLExport( MAP_CM, bIsDraw ? sXML_drawing : sXML_presentation, nExportFlags ),
|
2000-09-18 16:07:07 +00:00
|
|
|
mpPageMasterInfoList(new ImpXMLEXPPageMasterList(1, 4, 4)),
|
|
|
|
mpPageMaterUsageList(new ImpXMLEXPPageMasterList(1, 4, 4)),
|
|
|
|
mpAutoLayoutInfoList(new ImpXMLAutoLayoutInfoList(1, 4, 4)),
|
|
|
|
mpPropertySetMapper(0L),
|
|
|
|
mpPresPagePropsMapper(0L),
|
|
|
|
mnDocMasterPageCount(0L),
|
|
|
|
mnDocDrawPageCount(0L),
|
|
|
|
mnShapeStyleInfoIndex(0L),
|
|
|
|
mbIsDraw(bIsDraw),
|
|
|
|
mbFamilyGraphicUsed(FALSE),
|
2000-11-26 18:43:50 +00:00
|
|
|
mbFamilyPresentationUsed(FALSE),
|
|
|
|
msZIndex( RTL_CONSTASCII_USTRINGPARAM(sXML_zindex) ),
|
|
|
|
msEmptyPres( RTL_CONSTASCII_USTRINGPARAM("IsEmptyPresentationObject") ),
|
|
|
|
msModel( RTL_CONSTASCII_USTRINGPARAM("Model") ),
|
|
|
|
msStartShape( RTL_CONSTASCII_USTRINGPARAM("StartShape") ),
|
2001-03-20 19:08:37 +00:00
|
|
|
msEndShape( RTL_CONSTASCII_USTRINGPARAM("EndShape") ),
|
|
|
|
msPageLayoutNames( RTL_CONSTASCII_USTRINGPARAM("PageLayoutNames") )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2001-01-12 15:16:13 +00:00
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// XExporter
|
|
|
|
void SAL_CALL SdXMLExport::setSourceDocument( const uno::Reference< lang::XComponent >& xDoc )
|
|
|
|
throw(lang::IllegalArgumentException, uno::RuntimeException)
|
|
|
|
{
|
|
|
|
SvXMLExport::setSourceDocument( xDoc );
|
|
|
|
|
2000-12-06 15:53:44 +00:00
|
|
|
const OUString aEmpty;
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// prepare factory parts
|
2001-01-12 15:16:13 +00:00
|
|
|
mpSdPropHdlFactory = new XMLSdPropHdlFactory( GetModel() );
|
2000-09-18 16:07:07 +00:00
|
|
|
if(mpSdPropHdlFactory)
|
|
|
|
{
|
|
|
|
// set lock to avoid deletion
|
|
|
|
mpSdPropHdlFactory->acquire();
|
|
|
|
|
|
|
|
// build one ref
|
|
|
|
const UniReference< XMLPropertyHandlerFactory > aFactoryRef = mpSdPropHdlFactory;
|
|
|
|
|
|
|
|
// construct PropertySetMapper
|
2000-12-01 18:19:53 +00:00
|
|
|
UniReference < XMLPropertySetMapper > xMapper = new XMLShapePropertySetMapper( aFactoryRef);
|
2000-12-05 22:31:17 +00:00
|
|
|
|
2000-12-01 18:19:53 +00:00
|
|
|
mpPropertySetMapper = new XMLShapeExportPropertyMapper( xMapper, (XMLTextListAutoStylePool*)&GetTextParagraphExport()->GetListAutoStylePool(), *this );
|
2000-12-05 22:31:17 +00:00
|
|
|
// set lock to avoid deletion
|
|
|
|
mpPropertySetMapper->acquire();
|
|
|
|
|
|
|
|
// chain text attributes
|
2001-02-27 15:09:08 +00:00
|
|
|
mpPropertySetMapper->ChainExportMapper(XMLTextParagraphExport::CreateParaExtPropMapper(*this));
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// construct PresPagePropsMapper
|
2000-12-01 18:19:53 +00:00
|
|
|
xMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLSDPresPageProps, aFactoryRef);
|
2000-11-07 12:33:09 +00:00
|
|
|
|
2001-01-17 15:11:05 +00:00
|
|
|
mpPresPagePropsMapper = new XMLPageExportPropertyMapper( xMapper, *this );
|
2000-09-18 16:07:07 +00:00
|
|
|
if(mpPresPagePropsMapper)
|
|
|
|
{
|
|
|
|
// set lock to avoid deletion
|
|
|
|
mpPresPagePropsMapper->acquire();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// add family name
|
|
|
|
GetAutoStylePool()->AddFamily(
|
|
|
|
XML_STYLE_FAMILY_SD_GRAPHICS_ID,
|
|
|
|
OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)),
|
|
|
|
GetPropertySetMapper(),
|
|
|
|
OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_PREFIX)));
|
|
|
|
GetAutoStylePool()->AddFamily(
|
|
|
|
XML_STYLE_FAMILY_SD_PRESENTATION_ID,
|
|
|
|
OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_NAME)),
|
|
|
|
GetPropertySetMapper(),
|
|
|
|
OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_PREFIX)));
|
2000-12-05 22:31:17 +00:00
|
|
|
GetAutoStylePool()->AddFamily(
|
|
|
|
XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID,
|
|
|
|
OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME)),
|
|
|
|
GetPresPagePropsMapper(),
|
|
|
|
OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_DRAWINGPAGE_PREFIX)));
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// prepare access to styles
|
|
|
|
uno::Reference< style::XStyleFamiliesSupplier > xFamSup( GetModel(), uno::UNO_QUERY );
|
|
|
|
if(xFamSup.is())
|
|
|
|
{
|
|
|
|
mxDocStyleFamilies = xFamSup->getStyleFamilies();
|
|
|
|
}
|
|
|
|
|
|
|
|
// prepare access to master pages
|
|
|
|
uno::Reference < drawing::XMasterPagesSupplier > xMasterPagesSupplier(GetModel(), uno::UNO_QUERY);
|
|
|
|
if(xMasterPagesSupplier.is())
|
|
|
|
{
|
|
|
|
mxDocMasterPages = mxDocMasterPages.query( xMasterPagesSupplier->getMasterPages() );
|
|
|
|
if(mxDocMasterPages.is())
|
|
|
|
{
|
|
|
|
mnDocMasterPageCount = mxDocMasterPages->getCount();
|
2000-12-06 15:53:44 +00:00
|
|
|
maMasterPagesStyleNames.insert( maMasterPagesStyleNames.begin(), mnDocMasterPageCount, aEmpty );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// prepare access to draw pages
|
|
|
|
uno::Reference <drawing::XDrawPagesSupplier> xDrawPagesSupplier(GetModel(), uno::UNO_QUERY);
|
|
|
|
if(xDrawPagesSupplier.is())
|
|
|
|
{
|
|
|
|
mxDocDrawPages = mxDocDrawPages.query( xDrawPagesSupplier->getDrawPages() );
|
|
|
|
if(mxDocDrawPages.is())
|
|
|
|
{
|
|
|
|
mnDocDrawPageCount = mxDocDrawPages->getCount();
|
2000-12-06 15:53:44 +00:00
|
|
|
maDrawPagesStyleNames.insert( maDrawPagesStyleNames.begin(), mnDocDrawPageCount, aEmpty );
|
2001-01-12 15:16:13 +00:00
|
|
|
if( !mbIsDraw )
|
2001-03-20 19:08:37 +00:00
|
|
|
maDrawPagesAutoLayoutNames.realloc( mnDocDrawPageCount );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// add namespaces
|
|
|
|
_GetNamespaceMap().AddAtIndex(
|
|
|
|
XML_NAMESPACE_PRESENTATION, sXML_np_presentation, sXML_n_presentation, XML_NAMESPACE_PRESENTATION);
|
2001-01-19 15:25:18 +00:00
|
|
|
|
|
|
|
GetShapeExport()->enableLayerExport();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
__EXPORT SdXMLExport::~SdXMLExport()
|
|
|
|
{
|
|
|
|
// cleanup factory, decrease refcount. Should lead to destruction.
|
|
|
|
if(mpSdPropHdlFactory)
|
|
|
|
{
|
|
|
|
mpSdPropHdlFactory->release();
|
|
|
|
mpSdPropHdlFactory = 0L;
|
|
|
|
}
|
|
|
|
|
|
|
|
// cleanup mapper, decrease refcount. Should lead to destruction.
|
|
|
|
if(mpPropertySetMapper)
|
|
|
|
{
|
|
|
|
mpPropertySetMapper->release();
|
|
|
|
mpPropertySetMapper = 0L;
|
|
|
|
}
|
|
|
|
|
|
|
|
// cleanup presPage mapper, decrease refcount. Should lead to destruction.
|
|
|
|
if(mpPresPagePropsMapper)
|
|
|
|
{
|
|
|
|
mpPresPagePropsMapper->release();
|
|
|
|
mpPresPagePropsMapper = 0L;
|
|
|
|
}
|
|
|
|
|
|
|
|
// clear evtl. temporary page master infos
|
|
|
|
if(mpPageMasterInfoList)
|
|
|
|
{
|
|
|
|
while(mpPageMasterInfoList->Count())
|
|
|
|
delete mpPageMasterInfoList->Remove(mpPageMasterInfoList->Count() - 1L);
|
|
|
|
delete mpPageMasterInfoList;
|
|
|
|
mpPageMasterInfoList = 0L;
|
|
|
|
}
|
|
|
|
if(mpPageMaterUsageList)
|
|
|
|
{
|
|
|
|
delete mpPageMaterUsageList;
|
|
|
|
mpPageMaterUsageList = 0L;
|
|
|
|
}
|
|
|
|
|
|
|
|
// clear auto-layout infos
|
|
|
|
if(mpAutoLayoutInfoList)
|
|
|
|
{
|
|
|
|
while(mpAutoLayoutInfoList->Count())
|
|
|
|
delete mpAutoLayoutInfoList->Remove(mpAutoLayoutInfoList->Count() - 1L);
|
|
|
|
delete mpAutoLayoutInfoList;
|
|
|
|
mpAutoLayoutInfoList = 0L;
|
|
|
|
}
|
|
|
|
|
|
|
|
// stop progress view
|
2001-01-12 15:16:13 +00:00
|
|
|
if(GetStatusIndicator().is())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2001-01-12 15:16:13 +00:00
|
|
|
GetStatusIndicator()->end();
|
|
|
|
GetStatusIndicator()->reset();
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// to get default values in XPropertySet use this wrapper class
|
|
|
|
|
|
|
|
class ImpDefaultMapper : public ::cppu::WeakAggImplHelper1< beans::XPropertySet >
|
|
|
|
{
|
|
|
|
uno::Reference< beans::XPropertyState > mxState;
|
|
|
|
uno::Reference< beans::XPropertySet > mxSet;
|
|
|
|
|
|
|
|
public:
|
|
|
|
ImpDefaultMapper( uno::Reference< beans::XPropertyState >& rxState );
|
|
|
|
|
|
|
|
// Methods
|
|
|
|
virtual uno::Reference< beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() throw(uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue ) throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException);
|
|
|
|
virtual uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
|
|
|
|
|
|
|
|
// empty implementations
|
|
|
|
virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException);
|
|
|
|
};
|
|
|
|
|
|
|
|
ImpDefaultMapper::ImpDefaultMapper( uno::Reference< beans::XPropertyState >& rxState )
|
|
|
|
: mxState( rxState ),
|
|
|
|
mxSet( rxState, uno::UNO_QUERY )
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
uno::Reference< beans::XPropertySetInfo > SAL_CALL ImpDefaultMapper::getPropertySetInfo() throw(uno::RuntimeException)
|
|
|
|
{
|
|
|
|
return mxSet->getPropertySetInfo();
|
|
|
|
}
|
|
|
|
|
|
|
|
void SAL_CALL ImpDefaultMapper::setPropertyValue( const OUString& aPropertyName, const uno::Any& aValue ) throw(beans::UnknownPropertyException, beans::PropertyVetoException, lang::IllegalArgumentException, lang::WrappedTargetException, uno::RuntimeException)
|
|
|
|
{
|
|
|
|
mxState->setPropertyToDefault( aPropertyName /*, aValue */ );
|
|
|
|
}
|
|
|
|
|
|
|
|
uno::Any SAL_CALL ImpDefaultMapper::getPropertyValue( const OUString& PropertyName ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
|
|
|
|
{
|
|
|
|
return mxState->getPropertyDefault( PropertyName );
|
|
|
|
}
|
|
|
|
|
|
|
|
// empty implementations
|
|
|
|
void SAL_CALL ImpDefaultMapper::addPropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& xListener ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) {}
|
|
|
|
void SAL_CALL ImpDefaultMapper::removePropertyChangeListener( const OUString& aPropertyName, const uno::Reference< beans::XPropertyChangeListener >& aListener ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) {}
|
|
|
|
void SAL_CALL ImpDefaultMapper::addVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) {}
|
|
|
|
void SAL_CALL ImpDefaultMapper::removeVetoableChangeListener( const OUString& PropertyName, const uno::Reference< beans::XVetoableChangeListener >& aListener ) throw(beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) {}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2001-03-04 22:07:53 +00:00
|
|
|
void SdXMLExport::ImpWriteObjGraphicStyleInfos()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2001-03-04 22:07:53 +00:00
|
|
|
XMLStyleExport aStEx(*this, OUString(), GetAutoStylePool().get());
|
|
|
|
const UniReference< SvXMLExportPropertyMapper > aMapperRef( GetPropertySetMapper() );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-03-04 22:07:53 +00:00
|
|
|
// write graphic family default style
|
|
|
|
uno::Reference< lang::XMultiServiceFactory > xFact( GetModel(), uno::UNO_QUERY );
|
|
|
|
if( !xFact.is() )
|
|
|
|
return;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-03-04 22:07:53 +00:00
|
|
|
uno::Reference< beans::XPropertySet > xDefaults( xFact->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Defaults") ) ), uno::UNO_QUERY );
|
|
|
|
if( !xDefaults.is() )
|
|
|
|
return;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-03-04 22:07:53 +00:00
|
|
|
aStEx.exportDefaultStyle( xDefaults, XML_STYLE_FAMILY_SD_GRAPHICS_NAME, aMapperRef );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-03-04 22:07:53 +00:00
|
|
|
// write graphic family styles
|
|
|
|
aStEx.exportStyleFamily(XML_STYLE_FAMILY_SD_GRAPHICS_NAME, XML_STYLE_FAMILY_SD_GRAPHICS_NAME, aMapperRef, FALSE, XML_STYLE_FAMILY_SD_GRAPHICS_ID);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2000-12-06 15:53:44 +00:00
|
|
|
void SdXMLExport::ImpPrepAutoLayoutInfos()
|
|
|
|
{
|
|
|
|
if(IsImpress())
|
|
|
|
{
|
|
|
|
// prepare name creation
|
|
|
|
for(sal_Int32 nCnt = 0L; nCnt < mnDocDrawPageCount; nCnt++)
|
|
|
|
{
|
|
|
|
uno::Any aAny(mxDocDrawPages->getByIndex(nCnt));
|
|
|
|
uno::Reference<drawing::XDrawPage> xDrawPage;
|
|
|
|
|
|
|
|
if((aAny >>= xDrawPage) && xDrawPage.is())
|
|
|
|
{
|
|
|
|
OUString aStr;
|
|
|
|
if(ImpPrepAutoLayoutInfo(xDrawPage, aStr))
|
|
|
|
maDrawPagesAutoLayoutNames[nCnt] = aStr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
BOOL SdXMLExport::ImpPrepAutoLayoutInfo(const uno::Reference<drawing::XDrawPage>& xPage, OUString& rName)
|
|
|
|
{
|
|
|
|
rName = OUString();
|
|
|
|
BOOL bRetval(FALSE);
|
|
|
|
|
|
|
|
uno::Reference <beans::XPropertySet> xPropSet(xPage, uno::UNO_QUERY);
|
|
|
|
if(xPropSet.is())
|
|
|
|
{
|
|
|
|
sal_uInt16 nType;
|
|
|
|
uno::Any aAny;
|
|
|
|
|
|
|
|
aAny = xPropSet->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Layout")));
|
|
|
|
if(aAny >>= nType)
|
|
|
|
{
|
|
|
|
if(ImpXMLAutoLayoutInfo::IsCreateNecessary(nType))
|
|
|
|
{
|
|
|
|
ImpXMLEXPPageMasterInfo* pInfo = 0L;
|
|
|
|
|
|
|
|
// get master-page info
|
|
|
|
uno::Reference < drawing::XMasterPageTarget > xMasterPageInt(xPage, uno::UNO_QUERY);
|
|
|
|
if(xMasterPageInt.is())
|
|
|
|
{
|
|
|
|
uno::Reference<drawing::XDrawPage> xUsedMasterPage(xMasterPageInt->getMasterPage());
|
|
|
|
if(xUsedMasterPage.is())
|
|
|
|
{
|
|
|
|
uno::Reference < container::XNamed > xMasterNamed(xUsedMasterPage, uno::UNO_QUERY);
|
|
|
|
if(xMasterNamed.is())
|
|
|
|
{
|
|
|
|
OUString sMasterPageName = xMasterNamed->getName();
|
|
|
|
pInfo = ImpGetPageMasterInfoByName(sMasterPageName);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// create entry and look for existance
|
|
|
|
ImpXMLAutoLayoutInfo* pNew = new ImpXMLAutoLayoutInfo(nType, pInfo);
|
|
|
|
BOOL bDidExist(FALSE);
|
|
|
|
|
|
|
|
for(sal_uInt32 nCnt = 0L; !bDidExist && nCnt < mpAutoLayoutInfoList->Count(); nCnt++)
|
|
|
|
{
|
|
|
|
if(*mpAutoLayoutInfoList->GetObject(nCnt) == *pNew)
|
|
|
|
{
|
|
|
|
delete pNew;
|
|
|
|
pNew = mpAutoLayoutInfoList->GetObject(nCnt);
|
|
|
|
bDidExist = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!bDidExist)
|
|
|
|
{
|
|
|
|
mpAutoLayoutInfoList->Insert(pNew, LIST_APPEND);
|
|
|
|
OUString sNewName = OUString(RTL_CONSTASCII_USTRINGPARAM("AL"));
|
|
|
|
sNewName += OUString::valueOf(sal_Int32(mpAutoLayoutInfoList->Count() - 1));
|
|
|
|
sNewName += OUString(RTL_CONSTASCII_USTRINGPARAM("T"));
|
|
|
|
sNewName += OUString::valueOf(sal_Int32(nType));
|
|
|
|
pNew->SetLayoutName(sNewName);
|
|
|
|
}
|
|
|
|
|
|
|
|
rName = pNew->GetLayoutName();
|
|
|
|
bRetval = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return bRetval;
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void SdXMLExport::ImpWriteAutoLayoutInfos()
|
|
|
|
{
|
|
|
|
if(mpAutoLayoutInfoList->Count())
|
|
|
|
{
|
|
|
|
for(sal_uInt32 nCnt = 0L; nCnt < mpAutoLayoutInfoList->Count(); nCnt++)
|
|
|
|
{
|
|
|
|
ImpXMLAutoLayoutInfo* pInfo = mpAutoLayoutInfoList->GetObject(nCnt);
|
|
|
|
if(pInfo)
|
|
|
|
{
|
|
|
|
// prepare presentation-page layout attributes, style-name
|
|
|
|
AddAttribute(XML_NAMESPACE_STYLE, sXML_name, pInfo->GetLayoutName());
|
|
|
|
|
|
|
|
// write draw-style attributes
|
|
|
|
SvXMLElementExport aDSE(*this, XML_NAMESPACE_STYLE, sXML_presentation_page_layout, sal_True, sal_True);
|
|
|
|
|
|
|
|
// write presentation placeholders
|
|
|
|
switch(pInfo->GetLayoutType())
|
|
|
|
{
|
|
|
|
case 0 : // AUTOLAYOUT_TITLE
|
|
|
|
{
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderSubtitle, pInfo->GetPresRectangle());
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 1 : // AUTOLAYOUT_ENUM
|
|
|
|
{
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, pInfo->GetPresRectangle());
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 2 : // AUTOLAYOUT_CHART
|
|
|
|
{
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart, pInfo->GetPresRectangle());
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 3 : // AUTOLAYOUT_2TEXT
|
|
|
|
{
|
|
|
|
Rectangle aLeft(pInfo->GetPresRectangle());
|
|
|
|
aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
|
|
|
|
Rectangle aRight(aLeft);
|
|
|
|
aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
|
|
|
|
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aLeft);
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aRight);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 4 : // AUTOLAYOUT_TEXTCHART
|
|
|
|
{
|
|
|
|
Rectangle aLeft(pInfo->GetPresRectangle());
|
|
|
|
aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
|
|
|
|
Rectangle aRight(aLeft);
|
|
|
|
aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
|
|
|
|
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aLeft);
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart, aRight);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 6 : // AUTOLAYOUT_TEXTCLIP
|
|
|
|
{
|
|
|
|
Rectangle aLeft(pInfo->GetPresRectangle());
|
|
|
|
aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
|
|
|
|
Rectangle aRight(aLeft);
|
|
|
|
aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
|
|
|
|
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aLeft);
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aRight);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 7 : // AUTOLAYOUT_CHARTTEXT
|
|
|
|
{
|
|
|
|
Rectangle aLeft(pInfo->GetPresRectangle());
|
|
|
|
aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
|
|
|
|
Rectangle aRight(aLeft);
|
|
|
|
aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
|
|
|
|
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart, aLeft);
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aRight);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 8 : // AUTOLAYOUT_TAB
|
|
|
|
{
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTable, pInfo->GetPresRectangle());
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 9 : // AUTOLAYOUT_CLIPTEXT
|
|
|
|
{
|
|
|
|
Rectangle aLeft(pInfo->GetPresRectangle());
|
|
|
|
aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
|
|
|
|
Rectangle aRight(aLeft);
|
|
|
|
aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
|
|
|
|
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aLeft);
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aRight);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 10 : // AUTOLAYOUT_TEXTOBJ
|
|
|
|
{
|
|
|
|
Rectangle aLeft(pInfo->GetPresRectangle());
|
|
|
|
aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
|
|
|
|
Rectangle aRight(aLeft);
|
|
|
|
aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
|
|
|
|
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aLeft);
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aRight);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 11 : // AUTOLAYOUT_OBJ
|
|
|
|
{
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, pInfo->GetPresRectangle());
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 12 : // AUTOLAYOUT_TEXT2OBJ
|
|
|
|
{
|
|
|
|
Rectangle aLeft(pInfo->GetPresRectangle());
|
|
|
|
aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
|
|
|
|
Rectangle aRightTop(aLeft);
|
|
|
|
aRightTop.Left() = long(aRightTop.Left() + aRightTop.GetWidth() * 1.05);
|
|
|
|
aRightTop.setHeight(long(aRightTop.GetHeight() * 0.477));
|
|
|
|
Rectangle aRightBottom(aRightTop);
|
|
|
|
aRightBottom.Top() = long(aRightBottom.Top() + aRightBottom.GetHeight() * 1.095);
|
|
|
|
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aLeft);
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aRightTop);
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aRightBottom);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 13 : // AUTOLAYOUT_OBJTEXT
|
|
|
|
{
|
|
|
|
Rectangle aLeft(pInfo->GetPresRectangle());
|
|
|
|
aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
|
|
|
|
Rectangle aRight(aLeft);
|
|
|
|
aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
|
|
|
|
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aLeft);
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aRight);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 14 : // AUTOLAYOUT_OBJOVERTEXT
|
|
|
|
{
|
|
|
|
Rectangle aTop(pInfo->GetPresRectangle());
|
|
|
|
aTop.setHeight(long(aTop.GetHeight() * 0.477));
|
|
|
|
Rectangle aBottom(aTop);
|
|
|
|
aBottom.Top() = long(aBottom.Top() + aBottom.GetHeight() * 1.095);
|
|
|
|
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aTop);
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aBottom);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 15 : // AUTOLAYOUT_2OBJTEXT
|
|
|
|
{
|
|
|
|
Rectangle aLeftTop(pInfo->GetPresRectangle());
|
|
|
|
aLeftTop.setWidth(long(aLeftTop.GetWidth() * 0.488));
|
|
|
|
Rectangle aRight(aLeftTop);
|
|
|
|
aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
|
|
|
|
aLeftTop.setHeight(long(aLeftTop.GetHeight() * 0.477));
|
|
|
|
Rectangle aLeftBottom(aLeftTop);
|
|
|
|
aLeftBottom.Top() = long(aLeftBottom.Top() + aLeftBottom.GetHeight() * 1.095);
|
|
|
|
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aLeftTop);
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aLeftBottom);
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aRight);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 16 : // AUTOLAYOUT_2OBJOVERTEXT
|
|
|
|
{
|
|
|
|
Rectangle aTopLeft(pInfo->GetPresRectangle());
|
|
|
|
aTopLeft.setHeight(long(aTopLeft.GetHeight() * 0.477));
|
|
|
|
Rectangle aBottom(aTopLeft);
|
|
|
|
aBottom.Top() = long(aBottom.Top() + aBottom.GetHeight() * 1.095);
|
|
|
|
aTopLeft.setWidth(long(aTopLeft.GetWidth() * 0.488));
|
|
|
|
Rectangle aTopRight(aTopLeft);
|
|
|
|
aTopRight.Left() = long(aTopRight.Left() + aTopRight.GetWidth() * 1.05);
|
|
|
|
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aTopLeft);
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aTopRight);
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aBottom);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 17 : // AUTOLAYOUT_TEXTOVEROBJ
|
|
|
|
{
|
|
|
|
Rectangle aTop(pInfo->GetPresRectangle());
|
|
|
|
aTop.setHeight(long(aTop.GetHeight() * 0.477));
|
|
|
|
Rectangle aBottom(aTop);
|
|
|
|
aBottom.Top() = long(aBottom.Top() + aBottom.GetHeight() * 1.095);
|
|
|
|
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderOutline, aTop);
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aBottom);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 18 : // AUTOLAYOUT_4OBJ
|
|
|
|
{
|
|
|
|
Rectangle aTopLeft(pInfo->GetPresRectangle());
|
|
|
|
aTopLeft.setHeight(long(aTopLeft.GetHeight() * 0.477));
|
|
|
|
aTopLeft.setWidth(long(aTopLeft.GetWidth() * 0.488));
|
|
|
|
Rectangle aBottomLeft(aTopLeft);
|
|
|
|
aBottomLeft.Top() = long(aBottomLeft.Top() + aBottomLeft.GetHeight() * 1.095);
|
|
|
|
Rectangle aTopRight(aTopLeft);
|
|
|
|
aTopRight.Left() = long(aTopRight.Left() + aTopRight.GetWidth() * 1.05);
|
|
|
|
Rectangle aBottomRight(aTopRight);
|
|
|
|
aBottomRight.Top() = long(aBottomRight.Top() + aBottomRight.GetHeight() * 1.095);
|
|
|
|
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aTopLeft);
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aTopRight);
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aBottomLeft);
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderObject, aBottomRight);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 19 : // AUTOLAYOUT_ONLY_TITLE
|
|
|
|
{
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 21 : // AUTOLAYOUT_NOTES
|
|
|
|
{
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderPage, pInfo->GetTitleRectangle());
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderNotes, pInfo->GetPresRectangle());
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 22 : // AUTOLAYOUT_HANDOUT1
|
|
|
|
case 23 : // AUTOLAYOUT_HANDOUT2
|
|
|
|
case 24 : // AUTOLAYOUT_HANDOUT3
|
|
|
|
case 25 : // AUTOLAYOUT_HANDOUT4
|
|
|
|
case 26 : // AUTOLAYOUT_HANDOUT6
|
|
|
|
{
|
|
|
|
sal_Int32 nColCnt, nRowCnt;
|
|
|
|
sal_Int32 nGapX = pInfo->GetGapX();
|
|
|
|
sal_Int32 nGapY = pInfo->GetGapY();
|
|
|
|
|
|
|
|
switch(pInfo->GetLayoutType())
|
|
|
|
{
|
|
|
|
case 22 : nColCnt = 1; nRowCnt = 1; break;
|
|
|
|
case 23 : nColCnt = 1; nRowCnt = 2; break;
|
|
|
|
case 24 : nColCnt = 1; nRowCnt = 3; break;
|
|
|
|
case 25 : nColCnt = 2; nRowCnt = 2; break;
|
|
|
|
case 26 : nColCnt = 3; nRowCnt = 3; break;
|
|
|
|
}
|
|
|
|
|
|
|
|
Size aPartSize(pInfo->GetTitleRectangle().GetSize());
|
|
|
|
Point aPartPos(pInfo->GetTitleRectangle().TopLeft());
|
|
|
|
|
|
|
|
if(aPartSize.Width() > aPartSize.Height())
|
|
|
|
{
|
|
|
|
sal_Int32 nZwi(nColCnt);
|
|
|
|
nColCnt = nRowCnt;
|
|
|
|
nRowCnt = nZwi;
|
|
|
|
}
|
|
|
|
|
|
|
|
aPartSize.Width() = (aPartSize.Width() - ((nColCnt - 1) * nGapX)) / nColCnt;
|
|
|
|
aPartSize.Height() = (aPartSize.Height() - ((nRowCnt - 1) * nGapY)) / nRowCnt;
|
|
|
|
|
|
|
|
Point aTmpPos(aPartPos);
|
|
|
|
|
|
|
|
for(sal_Int32 a = 0L; a < nRowCnt; a++)
|
|
|
|
{
|
|
|
|
aTmpPos.X() = aPartPos.X();
|
|
|
|
|
|
|
|
for(sal_Int32 b = 0L; b < nColCnt; b++)
|
|
|
|
{
|
|
|
|
Rectangle aTmpRect(aTmpPos, aPartSize);
|
|
|
|
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderHandout, aTmpRect);
|
|
|
|
aTmpPos.X() += aPartSize.Width() + nGapX;
|
|
|
|
}
|
|
|
|
|
|
|
|
aTmpPos.Y() += aPartSize.Height() + nGapY;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2001-03-09 13:17:40 +00:00
|
|
|
case 27 : // AUTOLAYOUT_VERTICAL_TITLE_TEXT_CHART
|
|
|
|
{
|
|
|
|
Rectangle aTop(pInfo->GetPresRectangle());
|
|
|
|
aTop.setHeight(long(aTop.GetHeight() * 0.488));
|
|
|
|
Rectangle aBottom(aTop);
|
|
|
|
aBottom.Top() = long(aBottom.Top() + aBottom.GetHeight() * 1.05);
|
|
|
|
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalTitle, pInfo->GetTitleRectangle());
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline, aTop);
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderChart, aBottom);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 28 : // AUTOLAYOUT_VERTICAL_TITLE_VERTICAL_OUTLINE
|
|
|
|
{
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalTitle, pInfo->GetTitleRectangle());
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline, pInfo->GetPresRectangle());
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 29 : // AUTOLAYOUT_TITLE_VERTICAL_OUTLINE
|
|
|
|
{
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline, pInfo->GetPresRectangle());
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 30 : // AUTOLAYOUT_TITLE_VERTICAL_OUTLINE_CLIPART
|
|
|
|
{
|
|
|
|
Rectangle aLeft(pInfo->GetPresRectangle());
|
|
|
|
aLeft.setWidth(long(aLeft.GetWidth() * 0.488));
|
|
|
|
Rectangle aRight(aLeft);
|
|
|
|
aRight.Left() = long(aRight.Left() + aRight.GetWidth() * 1.05);
|
|
|
|
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderTitle, pInfo->GetTitleRectangle());
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderGraphic, aLeft);
|
|
|
|
ImpWriteAutoLayoutPlaceholder(XmlPlaceholderVerticalOutline, aRight);
|
|
|
|
break;
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
default:
|
|
|
|
{
|
|
|
|
DBG_ERROR("XMLEXP: unknown autolayout export");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void SdXMLExport::ImpWriteAutoLayoutPlaceholder(XmlPlaceholder ePl, const Rectangle& rRect)
|
|
|
|
{
|
|
|
|
OUString aStr;
|
|
|
|
OUStringBuffer sStringBuffer;
|
|
|
|
|
|
|
|
// prepare presentation-placeholder attributes, presentation:object
|
|
|
|
switch(ePl)
|
|
|
|
{
|
|
|
|
case XmlPlaceholderTitle: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("title")); break;
|
|
|
|
case XmlPlaceholderOutline: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("outline")); break;
|
|
|
|
case XmlPlaceholderSubtitle: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("subtitle")); break;
|
|
|
|
case XmlPlaceholderText: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("text")); break;
|
|
|
|
case XmlPlaceholderGraphic: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("graphic")); break;
|
|
|
|
case XmlPlaceholderObject: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("object")); break;
|
|
|
|
case XmlPlaceholderChart: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("chart")); break;
|
|
|
|
case XmlPlaceholderOrgchart: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("orgchart")); break;
|
|
|
|
case XmlPlaceholderTable: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("table")); break;
|
|
|
|
case XmlPlaceholderPage: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("page")); break;
|
|
|
|
case XmlPlaceholderNotes: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("notes")); break;
|
|
|
|
case XmlPlaceholderHandout: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("handout")); break;
|
2001-03-09 13:17:40 +00:00
|
|
|
case XmlPlaceholderVerticalTitle: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("vertical_title")); break;
|
|
|
|
case XmlPlaceholderVerticalOutline: aStr = OUString(RTL_CONSTASCII_USTRINGPARAM("vertical_outline")); break;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
AddAttribute(XML_NAMESPACE_PRESENTATION, sXML_object, aStr);
|
|
|
|
|
|
|
|
// svg:x,y,width,height
|
|
|
|
GetMM100UnitConverter().convertMeasure(sStringBuffer, rRect.Left());
|
|
|
|
aStr = sStringBuffer.makeStringAndClear();
|
|
|
|
AddAttribute(XML_NAMESPACE_SVG, sXML_x, aStr);
|
|
|
|
|
|
|
|
GetMM100UnitConverter().convertMeasure(sStringBuffer, rRect.Top());
|
|
|
|
aStr = sStringBuffer.makeStringAndClear();
|
|
|
|
AddAttribute(XML_NAMESPACE_SVG, sXML_y, aStr);
|
|
|
|
|
|
|
|
GetMM100UnitConverter().convertMeasure(sStringBuffer, rRect.GetWidth());
|
|
|
|
aStr = sStringBuffer.makeStringAndClear();
|
|
|
|
AddAttribute(XML_NAMESPACE_SVG, sXML_width, aStr);
|
|
|
|
|
|
|
|
GetMM100UnitConverter().convertMeasure(sStringBuffer, rRect.GetHeight());
|
|
|
|
aStr = sStringBuffer.makeStringAndClear();
|
|
|
|
AddAttribute(XML_NAMESPACE_SVG, sXML_height, aStr);
|
|
|
|
|
|
|
|
// write presentation-placeholder
|
|
|
|
SvXMLElementExport aPPL(*this, XML_NAMESPACE_PRESENTATION, sXML_placeholder, sal_True, sal_True);
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void SdXMLExport::ImpPrepPageMasterInfos()
|
|
|
|
{
|
|
|
|
if(mnDocMasterPageCount)
|
|
|
|
{
|
|
|
|
// look for needed page-masters, create these
|
|
|
|
for(sal_Int32 nMPageId = 0L; nMPageId < mnDocMasterPageCount; nMPageId++)
|
|
|
|
{
|
|
|
|
uno::Any aAny(mxDocMasterPages->getByIndex(nMPageId));
|
|
|
|
uno::Reference< drawing::XDrawPage > xMasterPage;
|
|
|
|
ImpXMLEXPPageMasterInfo* pNewInfo = 0L;
|
|
|
|
BOOL bDoesExist(FALSE);
|
|
|
|
|
|
|
|
if(aAny >>= xMasterPage)
|
|
|
|
{
|
|
|
|
pNewInfo = new ImpXMLEXPPageMasterInfo(*this, xMasterPage);
|
|
|
|
|
|
|
|
// compare with prev page-master infos
|
|
|
|
for(sal_uInt32 a = 0; !bDoesExist && a < mpPageMasterInfoList->Count(); a++)
|
|
|
|
{
|
|
|
|
if(mpPageMasterInfoList->GetObject(a)
|
|
|
|
&& *mpPageMasterInfoList->GetObject(a) == *pNewInfo)
|
|
|
|
{
|
|
|
|
delete pNewInfo;
|
|
|
|
pNewInfo = mpPageMasterInfoList->GetObject(a);
|
|
|
|
bDoesExist = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// add entry when not found same page-master infos
|
|
|
|
if(!bDoesExist)
|
|
|
|
mpPageMasterInfoList->Insert(pNewInfo, LIST_APPEND);
|
|
|
|
mpPageMaterUsageList->Insert(pNewInfo, LIST_APPEND);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void SdXMLExport::ImpWritePageMasterInfos()
|
|
|
|
{
|
|
|
|
// write created page-masters, create names for these
|
|
|
|
for(sal_uInt32 nCnt = 0L; nCnt < mpPageMasterInfoList->Count(); nCnt++)
|
|
|
|
{
|
|
|
|
ImpXMLEXPPageMasterInfo* pInfo = mpPageMasterInfoList->GetObject(nCnt);
|
|
|
|
if(pInfo)
|
|
|
|
{
|
|
|
|
// create name
|
|
|
|
OUString sNewName = OUString(RTL_CONSTASCII_USTRINGPARAM("PM"));
|
|
|
|
|
|
|
|
sNewName += OUString::valueOf((sal_Int32)nCnt);
|
|
|
|
pInfo->SetName(sNewName);
|
|
|
|
|
|
|
|
// prepare page-master attributes
|
|
|
|
OUString sString;
|
|
|
|
OUStringBuffer sStringBuffer;
|
|
|
|
|
|
|
|
sString = sNewName;
|
|
|
|
AddAttribute(XML_NAMESPACE_STYLE, sXML_name, sString);
|
|
|
|
|
2000-11-27 11:52:59 +00:00
|
|
|
// write page-master
|
|
|
|
SvXMLElementExport aPME(*this, XML_NAMESPACE_STYLE, sXML_page_master, sal_True, sal_True);
|
|
|
|
|
|
|
|
// prepare style:properties inside page-master
|
2000-09-18 16:07:07 +00:00
|
|
|
GetMM100UnitConverter().convertMeasure(sStringBuffer, pInfo->GetBorderTop());
|
|
|
|
sString = sStringBuffer.makeStringAndClear();
|
|
|
|
AddAttribute(XML_NAMESPACE_FO, sXML_margin_top, sString);
|
|
|
|
|
|
|
|
GetMM100UnitConverter().convertMeasure(sStringBuffer, pInfo->GetBorderBottom());
|
|
|
|
sString = sStringBuffer.makeStringAndClear();
|
|
|
|
AddAttribute(XML_NAMESPACE_FO, sXML_margin_bottom, sString);
|
|
|
|
|
|
|
|
GetMM100UnitConverter().convertMeasure(sStringBuffer, pInfo->GetBorderLeft());
|
|
|
|
sString = sStringBuffer.makeStringAndClear();
|
|
|
|
AddAttribute(XML_NAMESPACE_FO, sXML_margin_left, sString);
|
|
|
|
|
|
|
|
GetMM100UnitConverter().convertMeasure(sStringBuffer, pInfo->GetBorderRight());
|
|
|
|
sString = sStringBuffer.makeStringAndClear();
|
|
|
|
AddAttribute(XML_NAMESPACE_FO, sXML_margin_right, sString);
|
|
|
|
|
|
|
|
GetMM100UnitConverter().convertMeasure(sStringBuffer, pInfo->GetWidth());
|
|
|
|
sString = sStringBuffer.makeStringAndClear();
|
|
|
|
AddAttribute(XML_NAMESPACE_FO, sXML_page_width, sString);
|
|
|
|
|
|
|
|
GetMM100UnitConverter().convertMeasure(sStringBuffer, pInfo->GetHeight());
|
|
|
|
sString = sStringBuffer.makeStringAndClear();
|
|
|
|
AddAttribute(XML_NAMESPACE_FO, sXML_page_height, sString);
|
|
|
|
|
|
|
|
if(pInfo->GetOrientation() == view::PaperOrientation_PORTRAIT)
|
2000-12-05 22:31:17 +00:00
|
|
|
AddAttributeASCII(XML_NAMESPACE_STYLE, sXML_print_orientation, sXML_portrait);
|
2000-09-18 16:07:07 +00:00
|
|
|
else
|
2000-12-05 22:31:17 +00:00
|
|
|
AddAttributeASCII(XML_NAMESPACE_STYLE, sXML_print_orientation, sXML_landscape);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2000-11-27 11:52:59 +00:00
|
|
|
// write style:properties
|
|
|
|
SvXMLElementExport aPMF(*this, XML_NAMESPACE_STYLE, sXML_properties, sal_True, sal_True);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
ImpXMLEXPPageMasterInfo* SdXMLExport::ImpGetPageMasterInfoByName(const OUString& rName)
|
|
|
|
{
|
|
|
|
if(rName.getLength() && mpPageMasterInfoList->Count())
|
|
|
|
{
|
|
|
|
for(sal_uInt32 nCnt = 0L; nCnt < mpPageMasterInfoList->Count(); nCnt++)
|
|
|
|
{
|
|
|
|
ImpXMLEXPPageMasterInfo* pInfo = mpPageMasterInfoList->GetObject(nCnt);
|
|
|
|
if(pInfo)
|
|
|
|
{
|
|
|
|
if(pInfo->GetMasterPageName().getLength() && rName.equals(pInfo->GetMasterPageName()))
|
|
|
|
{
|
|
|
|
return pInfo;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0L;
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void SdXMLExport::ImpPrepDrawPageInfos()
|
|
|
|
{
|
|
|
|
// create draw:style-name entries for page export
|
|
|
|
// containing presentation page attributes AND background attributes
|
|
|
|
// fixed family for page-styles is "drawing-page" (XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME)
|
|
|
|
if(mnDocDrawPageCount)
|
|
|
|
{
|
|
|
|
// prepare name creation
|
2000-11-26 18:43:50 +00:00
|
|
|
for(sal_Int32 nCnt = 0L; nCnt < mnDocDrawPageCount; nCnt++)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
uno::Any aAny(mxDocDrawPages->getByIndex(nCnt));
|
|
|
|
uno::Reference<drawing::XDrawPage> xDrawPage;
|
|
|
|
|
|
|
|
if(aAny >>= xDrawPage)
|
|
|
|
{
|
|
|
|
// create name
|
2000-12-05 22:31:17 +00:00
|
|
|
OUString sStyleName;
|
|
|
|
|
|
|
|
// create style for this page and add to auto style pool
|
|
|
|
|
|
|
|
uno::Reference< beans::XPropertySet > xPropSet1(xDrawPage, uno::UNO_QUERY);
|
|
|
|
if(xPropSet1.is())
|
|
|
|
{
|
|
|
|
// since the background items are in a different propertyset
|
|
|
|
// which itself is a property of the pages property set
|
|
|
|
// we now merge these two propertysets if possible to simulate
|
|
|
|
// a single propertyset with all draw page properties
|
|
|
|
const OUString aBackground(RTL_CONSTASCII_USTRINGPARAM("Background"));
|
|
|
|
uno::Reference< beans::XPropertySet > xPropSet2;
|
|
|
|
uno::Reference< beans::XPropertySetInfo > xInfo( xPropSet1->getPropertySetInfo() );
|
|
|
|
if( xInfo.is() && xInfo->hasPropertyByName( aBackground ) )
|
|
|
|
{
|
|
|
|
uno::Any aAny( xPropSet1->getPropertyValue( aBackground ) );
|
|
|
|
aAny >>= xPropSet2;
|
|
|
|
}
|
|
|
|
|
|
|
|
uno::Reference< beans::XPropertySet > xPropSet;
|
|
|
|
if( xPropSet2.is() )
|
|
|
|
xPropSet = PropertySetMerger_CreateInstance( xPropSet1, xPropSet2 );
|
|
|
|
else
|
|
|
|
xPropSet = xPropSet1;
|
|
|
|
|
|
|
|
const UniReference< SvXMLExportPropertyMapper > aMapperRef( GetPresPagePropsMapper() );
|
|
|
|
std::vector< XMLPropertyState > xPropStates( aMapperRef->Filter( xPropSet ) );
|
|
|
|
|
|
|
|
if( !xPropStates.empty() )
|
|
|
|
{
|
|
|
|
// there are filtered properties -> hard attributes
|
|
|
|
// try to find this style in AutoStylePool
|
|
|
|
sStyleName = GetAutoStylePool()->Find(XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID, sStyleName, xPropStates);
|
|
|
|
|
|
|
|
if(!sStyleName.getLength())
|
|
|
|
{
|
|
|
|
// Style did not exist, add it to AutoStalePool
|
|
|
|
sStyleName = GetAutoStylePool()->Add(XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID, sStyleName, xPropStates);
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2000-12-06 15:53:44 +00:00
|
|
|
maDrawPagesStyleNames[nCnt] = sStyleName;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2000-12-05 22:31:17 +00:00
|
|
|
void SdXMLExport::ImpPrepMasterPageInfos()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2000-12-05 22:31:17 +00:00
|
|
|
// create draw:style-name entries for master page export
|
|
|
|
// containing only background attributes
|
|
|
|
// fixed family for page-styles is "drawing-page" (XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME)
|
|
|
|
if(mnDocMasterPageCount)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2000-12-05 22:31:17 +00:00
|
|
|
// prepare name creation
|
|
|
|
for(sal_Int32 nCnt = 0L; nCnt < mnDocMasterPageCount; nCnt++)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2000-12-05 22:31:17 +00:00
|
|
|
uno::Any aAny(mxDocMasterPages->getByIndex(nCnt));
|
2000-09-18 16:07:07 +00:00
|
|
|
uno::Reference<drawing::XDrawPage> xDrawPage;
|
|
|
|
|
|
|
|
if(aAny >>= xDrawPage)
|
|
|
|
{
|
2000-12-05 22:31:17 +00:00
|
|
|
// create name
|
|
|
|
OUString sStyleName;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2000-12-05 22:31:17 +00:00
|
|
|
// create style for this page and add to auto style pool
|
|
|
|
uno::Reference< beans::XPropertySet > xPropSet1(xDrawPage, uno::UNO_QUERY);
|
|
|
|
if(xPropSet1.is())
|
|
|
|
{
|
|
|
|
// since the background items are in a different propertyset
|
|
|
|
// which itself is a property of the pages property set
|
|
|
|
// we now merge these two propertysets if possible to simulate
|
|
|
|
// a single propertyset with all draw page properties
|
|
|
|
const OUString aBackground(RTL_CONSTASCII_USTRINGPARAM("Background"));
|
|
|
|
uno::Reference< beans::XPropertySet > xPropSet2;
|
|
|
|
uno::Reference< beans::XPropertySetInfo > xInfo( xPropSet1->getPropertySetInfo() );
|
|
|
|
if( xInfo.is() && xInfo->hasPropertyByName( aBackground ) )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2000-12-05 22:31:17 +00:00
|
|
|
uno::Any aAny( xPropSet1->getPropertyValue( aBackground ) );
|
|
|
|
aAny >>= xPropSet2;
|
|
|
|
}
|
2000-11-08 11:16:21 +00:00
|
|
|
|
2001-01-17 21:03:48 +00:00
|
|
|
uno::Reference< beans::XPropertySet > xPropSet;
|
2000-12-05 22:31:17 +00:00
|
|
|
if( xPropSet2.is() )
|
2001-01-17 21:03:48 +00:00
|
|
|
xPropSet = PropertySetMerger_CreateInstance( xPropSet1, xPropSet2 );
|
|
|
|
else
|
|
|
|
xPropSet = xPropSet1;
|
|
|
|
|
|
|
|
if( xPropSet.is() )
|
2000-12-05 22:31:17 +00:00
|
|
|
{
|
2000-11-08 15:30:49 +00:00
|
|
|
const UniReference< SvXMLExportPropertyMapper > aMapperRef( GetPresPagePropsMapper() );
|
2001-01-17 21:03:48 +00:00
|
|
|
std::vector< XMLPropertyState > xPropStates( aMapperRef->Filter( xPropSet ) );
|
2000-11-08 11:16:21 +00:00
|
|
|
|
2000-12-05 22:31:17 +00:00
|
|
|
if( !xPropStates.empty() )
|
2000-11-08 11:16:21 +00:00
|
|
|
{
|
2000-12-05 22:31:17 +00:00
|
|
|
// there are filtered properties -> hard attributes
|
|
|
|
// try to find this style in AutoStylePool
|
|
|
|
sStyleName = GetAutoStylePool()->Find(XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID, sStyleName, xPropStates);
|
|
|
|
|
|
|
|
if(!sStyleName.getLength())
|
|
|
|
{
|
|
|
|
// Style did not exist, add it to AutoStalePool
|
|
|
|
sStyleName = GetAutoStylePool()->Add(XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID, sStyleName, xPropStates);
|
|
|
|
}
|
2000-12-06 15:53:44 +00:00
|
|
|
|
|
|
|
maMasterPagesStyleNames[nCnt] = sStyleName;
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-11-08 11:16:21 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
void SdXMLExport::ImpWritePresentationStyles()
|
|
|
|
{
|
|
|
|
if(IsImpress())
|
|
|
|
{
|
2000-11-26 18:43:50 +00:00
|
|
|
for(sal_Int32 nCnt = 0L; nCnt < mnDocMasterPageCount; nCnt++)
|
2000-11-08 11:16:21 +00:00
|
|
|
{
|
|
|
|
uno::Any aAny(mxDocMasterPages->getByIndex(nCnt));
|
|
|
|
uno::Reference<container::XNamed> xNamed;
|
|
|
|
|
|
|
|
if(aAny >>= xNamed)
|
|
|
|
{
|
|
|
|
// write presentation styles (ONLY if presentation)
|
|
|
|
if(IsImpress() && mxDocStyleFamilies.is() && xNamed.is())
|
|
|
|
{
|
2001-03-04 22:07:53 +00:00
|
|
|
XMLStyleExport aStEx(*this, OUString(), GetAutoStylePool().get());
|
2000-11-08 15:30:49 +00:00
|
|
|
const UniReference< SvXMLExportPropertyMapper > aMapperRef( GetPropertySetMapper() );
|
2000-11-08 11:16:21 +00:00
|
|
|
|
|
|
|
OUString aPrefix = xNamed->getName();
|
|
|
|
aPrefix += OUString(RTL_CONSTASCII_USTRINGPARAM("-"));
|
|
|
|
aStEx.exportStyleFamily(xNamed->getName(),
|
|
|
|
XML_STYLE_FAMILY_SD_PRESENTATION_NAME, aMapperRef, FALSE,
|
|
|
|
XML_STYLE_FAMILY_SD_PRESENTATION_ID, &aPrefix);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void SdXMLExport::SetProgress(sal_Int32 nProg)
|
|
|
|
{
|
|
|
|
// set progress view
|
2001-01-12 15:16:13 +00:00
|
|
|
if(GetStatusIndicator().is())
|
|
|
|
GetStatusIndicator()->setValue(nProg);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void SdXMLExport::_ExportContent()
|
|
|
|
{
|
|
|
|
// page export
|
|
|
|
for(sal_Int32 nPageInd(0); nPageInd < mnDocDrawPageCount; nPageInd++)
|
|
|
|
{
|
|
|
|
uno::Any aAny(mxDocDrawPages->getByIndex(nPageInd));
|
|
|
|
uno::Reference<drawing::XDrawPage> xDrawPage;
|
|
|
|
|
|
|
|
SetProgress(((nPageInd + 1) * 100) / mnDocDrawPageCount);
|
|
|
|
|
|
|
|
if(aAny >>= xDrawPage)
|
|
|
|
{
|
|
|
|
// prepare page attributes, name of page
|
|
|
|
uno::Reference < container::XNamed > xNamed(xDrawPage, uno::UNO_QUERY);
|
|
|
|
if(xNamed.is())
|
|
|
|
AddAttribute(XML_NAMESPACE_DRAW, sXML_name, xNamed->getName());
|
|
|
|
|
|
|
|
// draw:style-name (presentation page attributes AND background attributes)
|
2000-12-06 15:53:44 +00:00
|
|
|
if( maDrawPagesStyleNames[nPageInd].getLength() )
|
|
|
|
AddAttribute(XML_NAMESPACE_DRAW, sXML_style_name, maDrawPagesStyleNames[nPageInd]);
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2000-12-19 15:23:48 +00:00
|
|
|
if( IsImpress() )
|
|
|
|
AddAttribute(XML_NAMESPACE_DRAW, sXML_id, OUString::valueOf( sal_Int32( nPageInd + 1 ) ) );
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// draw:master-page-name
|
|
|
|
uno::Reference < drawing::XMasterPageTarget > xMasterPageInt(xDrawPage, uno::UNO_QUERY);
|
|
|
|
if(xMasterPageInt.is())
|
|
|
|
{
|
|
|
|
uno::Reference<drawing::XDrawPage> xUsedMasterPage(xMasterPageInt->getMasterPage());
|
|
|
|
if(xUsedMasterPage.is())
|
|
|
|
{
|
|
|
|
uno::Reference < container::XNamed > xMasterNamed(xUsedMasterPage, uno::UNO_QUERY);
|
|
|
|
if(xMasterNamed.is())
|
|
|
|
{
|
|
|
|
AddAttribute(XML_NAMESPACE_DRAW, sXML_master_page_name, xMasterNamed->getName());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// presentation:page-layout-name
|
2000-12-06 15:53:44 +00:00
|
|
|
if( IsImpress() && maDrawPagesAutoLayoutNames[nPageInd].getLength())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2000-12-06 15:53:44 +00:00
|
|
|
AddAttribute(XML_NAMESPACE_PRESENTATION, sXML_presentation_page_layout_name, maDrawPagesAutoLayoutNames[nPageInd]);
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// write page
|
|
|
|
SvXMLElementExport aDPG(*this, XML_NAMESPACE_DRAW, sXML_page, sal_True, sal_True);
|
|
|
|
|
2001-01-18 13:53:32 +00:00
|
|
|
// write optional office:forms
|
|
|
|
exportFormsElement( xDrawPage );
|
|
|
|
|
2000-12-19 15:23:48 +00:00
|
|
|
// prepare animations exporter if impress
|
|
|
|
if(IsImpress())
|
|
|
|
{
|
|
|
|
UniReference< XMLAnimationsExporter > xAnimExport = new XMLAnimationsExporter( GetShapeExport().get() );
|
|
|
|
GetShapeExport()->setAnimationsExporter( xAnimExport );
|
|
|
|
}
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// write graphic objects on this page (if any)
|
2001-02-02 10:14:37 +00:00
|
|
|
uno::Reference< drawing::XShapes > xShapes(xDrawPage, uno::UNO_QUERY);
|
2000-09-18 16:07:07 +00:00
|
|
|
if(xShapes.is() && xShapes->getCount())
|
2001-02-02 10:14:37 +00:00
|
|
|
GetShapeExport()->exportShapes( xShapes );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2000-12-19 15:23:48 +00:00
|
|
|
// write animations and presentation notes (ONLY if presentation)
|
2000-09-18 16:07:07 +00:00
|
|
|
if(IsImpress())
|
|
|
|
{
|
2000-12-19 15:23:48 +00:00
|
|
|
// animations
|
|
|
|
UniReference< XMLAnimationsExporter > xAnimExport( GetShapeExport()->getAnimationsExporter() );
|
|
|
|
if( xAnimExport.is() )
|
2000-12-21 17:36:35 +00:00
|
|
|
xAnimExport->exportAnimations( *this );
|
2000-12-19 15:23:48 +00:00
|
|
|
|
|
|
|
xAnimExport = NULL;
|
|
|
|
GetShapeExport()->setAnimationsExporter( xAnimExport );
|
|
|
|
|
|
|
|
// presentations
|
2000-09-18 16:07:07 +00:00
|
|
|
uno::Reference< presentation::XPresentationPage > xPresPage(xDrawPage, uno::UNO_QUERY);
|
|
|
|
if(xPresPage.is())
|
|
|
|
{
|
|
|
|
uno::Reference< drawing::XDrawPage > xNotesPage(xPresPage->getNotesPage());
|
|
|
|
if(xNotesPage.is())
|
|
|
|
{
|
2001-02-02 10:14:37 +00:00
|
|
|
uno::Reference< drawing::XShapes > xShapes(xNotesPage, uno::UNO_QUERY);
|
2000-09-18 16:07:07 +00:00
|
|
|
if(xShapes.is() && xShapes->getCount())
|
|
|
|
{
|
|
|
|
// write presentation notes
|
|
|
|
SvXMLElementExport aPSY(*this, XML_NAMESPACE_PRESENTATION, sXML_notes, sal_True, sal_True);
|
|
|
|
|
2001-01-18 13:53:32 +00:00
|
|
|
// write optional office:forms
|
|
|
|
exportFormsElement( xNotesPage );
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// write shapes per se
|
2001-02-02 10:14:37 +00:00
|
|
|
GetShapeExport()->exportShapes( xShapes );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2000-12-19 15:23:48 +00:00
|
|
|
|
|
|
|
if( IsImpress() )
|
2001-02-15 16:35:27 +00:00
|
|
|
exportPresentationSettings();
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void SdXMLExport::exportPresentationSettings()
|
|
|
|
{
|
|
|
|
try
|
2000-12-19 15:23:48 +00:00
|
|
|
{
|
2001-02-15 16:35:27 +00:00
|
|
|
Reference< XPresentationSupplier > xPresSupplier( GetModel(), UNO_QUERY );
|
|
|
|
if( !xPresSupplier.is() )
|
|
|
|
return;
|
|
|
|
|
|
|
|
Reference< XPropertySet > xPresProps( xPresSupplier->getPresentation(), UNO_QUERY );
|
|
|
|
if( !xPresProps.is() )
|
|
|
|
return;
|
|
|
|
|
|
|
|
sal_Bool bHasAttr = sal_False;
|
|
|
|
|
|
|
|
sal_Bool bTemp;
|
|
|
|
|
|
|
|
// export range
|
|
|
|
xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsShowAll" ) ) ) >>= bTemp;
|
|
|
|
if( !bTemp )
|
|
|
|
{
|
|
|
|
OUString aFirstPage;
|
|
|
|
xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "FirstPage" ) ) ) >>= aFirstPage;
|
|
|
|
if( aFirstPage.getLength() )
|
|
|
|
{
|
|
|
|
AddAttribute(XML_NAMESPACE_PRESENTATION, sXML_start_page, aFirstPage );
|
|
|
|
bHasAttr = sal_True;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
OUString aCustomShow;
|
|
|
|
xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "CustomShow" ) ) ) >>= aCustomShow;
|
|
|
|
if( aCustomShow.getLength() )
|
|
|
|
{
|
|
|
|
AddAttribute(XML_NAMESPACE_PRESENTATION, sXML_show, aCustomShow );
|
|
|
|
bHasAttr = sal_True;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsEndless" ) ) ) >>= bTemp;
|
|
|
|
if( bTemp )
|
|
|
|
{
|
|
|
|
AddAttributeASCII(XML_NAMESPACE_PRESENTATION, sXML_endless, sXML_true );
|
|
|
|
bHasAttr = sal_True;
|
|
|
|
|
|
|
|
sal_Int32 nPause;
|
|
|
|
xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "Pause" ) ) ) >>= nPause;
|
|
|
|
|
2001-05-02 09:59:52 +00:00
|
|
|
util::DateTime aTime( 0, (sal_uInt16)nPause, 0, 0, 0, 0, 0 );
|
|
|
|
|
|
|
|
OUStringBuffer aOut;
|
|
|
|
SvXMLUnitConverter::convertTime( aOut, aTime );
|
|
|
|
AddAttribute(XML_NAMESPACE_PRESENTATION, sXML_pause, aOut.makeStringAndClear() );
|
2001-02-15 16:35:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "AllowAnimations" ) ) ) >>= bTemp;
|
|
|
|
if( !bTemp )
|
|
|
|
{
|
|
|
|
AddAttributeASCII(XML_NAMESPACE_PRESENTATION, sXML_animations, sXML_disabled );
|
|
|
|
bHasAttr = sal_True;
|
|
|
|
}
|
|
|
|
|
|
|
|
xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsAlwaysOnTop" ) ) ) >>= bTemp;
|
|
|
|
if( bTemp )
|
|
|
|
{
|
|
|
|
AddAttributeASCII(XML_NAMESPACE_PRESENTATION, sXML_stay_on_top, sXML_true );
|
|
|
|
bHasAttr = sal_True;
|
|
|
|
}
|
|
|
|
|
|
|
|
xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsAutomatic" ) ) ) >>= bTemp;
|
|
|
|
if( bTemp )
|
|
|
|
{
|
|
|
|
AddAttributeASCII(XML_NAMESPACE_PRESENTATION, sXML_force_manual, sXML_true );
|
|
|
|
bHasAttr = sal_True;
|
|
|
|
}
|
|
|
|
|
|
|
|
xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsFullScreen" ) ) ) >>= bTemp;
|
|
|
|
if( !bTemp )
|
|
|
|
{
|
|
|
|
AddAttributeASCII(XML_NAMESPACE_PRESENTATION, sXML_full_screen, sXML_false );
|
|
|
|
bHasAttr = sal_True;
|
|
|
|
}
|
|
|
|
|
|
|
|
xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsMouseVisible" ) ) ) >>= bTemp;
|
|
|
|
if( !bTemp )
|
|
|
|
{
|
|
|
|
AddAttributeASCII(XML_NAMESPACE_PRESENTATION, sXML_mouse_visible, sXML_false );
|
|
|
|
bHasAttr = sal_True;
|
|
|
|
}
|
|
|
|
|
|
|
|
xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "StartWithNavigator" ) ) ) >>= bTemp;
|
|
|
|
if( bTemp )
|
|
|
|
{
|
|
|
|
AddAttributeASCII(XML_NAMESPACE_PRESENTATION, sXML_start_with_navigator, sXML_true );
|
|
|
|
bHasAttr = sal_True;
|
|
|
|
}
|
|
|
|
|
|
|
|
xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "UsePen" ) ) ) >>= bTemp;
|
|
|
|
if( bTemp )
|
|
|
|
{
|
|
|
|
AddAttributeASCII(XML_NAMESPACE_PRESENTATION, sXML_mouse_as_pen, sXML_true );
|
|
|
|
bHasAttr = sal_True;
|
|
|
|
}
|
|
|
|
|
|
|
|
xPresProps->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "IsTransitionOnClick" ) ) ) >>= bTemp;
|
|
|
|
if( !bTemp )
|
|
|
|
{
|
|
|
|
AddAttributeASCII(XML_NAMESPACE_PRESENTATION, sXML_transition_on_click, sXML_disabled );
|
|
|
|
bHasAttr = sal_True;
|
|
|
|
}
|
|
|
|
|
|
|
|
Reference< container::XNameContainer > xShows;
|
|
|
|
Sequence< OUString > aShowNames;
|
|
|
|
const OUString* pShowNames = NULL;
|
|
|
|
sal_Int32 nShowCount = 0;
|
|
|
|
|
2000-12-19 15:23:48 +00:00
|
|
|
Reference< XCustomPresentationSupplier > xSup( GetModel(), UNO_QUERY );
|
|
|
|
if( xSup.is() )
|
|
|
|
{
|
2001-02-15 16:35:27 +00:00
|
|
|
xShows = xSup->getCustomPresentations();
|
2000-12-19 15:23:48 +00:00
|
|
|
if( xShows.is() )
|
|
|
|
{
|
2001-02-15 16:35:27 +00:00
|
|
|
aShowNames = xShows->getElementNames();
|
|
|
|
pShowNames = aShowNames.getArray();
|
|
|
|
nShowCount = aShowNames.getLength();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if( bHasAttr || nShowCount != 0 )
|
|
|
|
{
|
|
|
|
SvXMLElementExport aSettings(*this, XML_NAMESPACE_PRESENTATION, sXML_settings, sal_True, sal_True);
|
|
|
|
|
|
|
|
if( nShowCount == 0 )
|
|
|
|
return;
|
|
|
|
|
|
|
|
Reference< XIndexContainer > xShow;
|
|
|
|
Reference< XNamed > xPageName;
|
2000-12-19 15:23:48 +00:00
|
|
|
|
2001-02-15 16:35:27 +00:00
|
|
|
OUStringBuffer sTmp;
|
2000-12-19 15:23:48 +00:00
|
|
|
|
2001-02-15 16:35:27 +00:00
|
|
|
for( sal_Int32 nIndex = 0; nIndex < nShowCount; nIndex++, pShowNames++ )
|
|
|
|
{
|
|
|
|
AddAttribute(XML_NAMESPACE_PRESENTATION, sXML_name, *pShowNames );
|
2000-12-19 15:23:48 +00:00
|
|
|
|
2001-02-15 16:35:27 +00:00
|
|
|
xShows->getByName( *pShowNames ) >>= xShow;
|
|
|
|
DBG_ASSERT( xShow.is(), "invalid custom show!" );
|
|
|
|
if( !xShow.is() )
|
|
|
|
continue;
|
2000-12-19 15:23:48 +00:00
|
|
|
|
2001-02-15 16:35:27 +00:00
|
|
|
const sal_Int32 nPageCount = xShow->getCount();
|
|
|
|
for( sal_Int32 nPage = 0; nPage < nPageCount; nPage++ )
|
2000-12-19 15:23:48 +00:00
|
|
|
{
|
2001-02-15 16:35:27 +00:00
|
|
|
xShow->getByIndex( nPage ) >>= xPageName;
|
2000-12-19 15:23:48 +00:00
|
|
|
|
2001-02-15 16:35:27 +00:00
|
|
|
if( !xPageName.is() )
|
2000-12-19 15:23:48 +00:00
|
|
|
continue;
|
|
|
|
|
2001-02-15 16:35:27 +00:00
|
|
|
if( sTmp.getLength() != 0 )
|
|
|
|
sTmp.append( sal_Unicode( ',' ) );
|
|
|
|
sTmp.append( xPageName->getName() );
|
2000-12-19 15:23:48 +00:00
|
|
|
|
2001-02-15 16:35:27 +00:00
|
|
|
}
|
2000-12-19 15:23:48 +00:00
|
|
|
|
2001-02-15 16:35:27 +00:00
|
|
|
if( sTmp.getLength() )
|
2000-12-19 15:23:48 +00:00
|
|
|
AddAttribute(XML_NAMESPACE_PRESENTATION, sXML_pages, sTmp.makeStringAndClear() );
|
|
|
|
|
2001-02-15 16:35:27 +00:00
|
|
|
SvXMLElementExport aShows(*this, XML_NAMESPACE_PRESENTATION, sXML_show, sal_True, sal_True);
|
2000-12-19 15:23:48 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2001-02-15 16:35:27 +00:00
|
|
|
catch( uno::Exception )
|
|
|
|
{
|
|
|
|
DBG_ERROR( "uno::Exception while exporting <presentation:settings>" );
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
2001-02-02 10:14:37 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-02-02 10:14:37 +00:00
|
|
|
void SdXMLExport::_ExportStyles(BOOL bUsed)
|
|
|
|
{
|
|
|
|
GetPropertySetMapper()->SetAutoStyles( sal_False );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-02-02 10:14:37 +00:00
|
|
|
// export fill styles
|
|
|
|
SvXMLExport::_ExportStyles( bUsed );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-02-02 10:14:37 +00:00
|
|
|
// write draw:style-name for object graphic-styles
|
|
|
|
ImpWriteObjGraphicStyleInfos();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-02-02 10:14:37 +00:00
|
|
|
// write presentation styles
|
|
|
|
ImpWritePresentationStyles();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-02-02 10:14:37 +00:00
|
|
|
// prepare draw:auto-layout-name for page export
|
|
|
|
ImpPrepAutoLayoutInfos();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-02-02 10:14:37 +00:00
|
|
|
// write draw:auto-layout-name for page export
|
|
|
|
ImpWriteAutoLayoutInfos();
|
2001-03-20 19:08:37 +00:00
|
|
|
|
|
|
|
uno::Reference< beans::XPropertySet > xInfoSet( getExportInfo() );
|
|
|
|
if( xInfoSet.is() )
|
|
|
|
{
|
|
|
|
uno::Reference< beans::XPropertySetInfo > xInfoSetInfo( xInfoSet->getPropertySetInfo() );
|
|
|
|
|
|
|
|
uno::Any aAny;
|
|
|
|
|
|
|
|
if( xInfoSetInfo->hasPropertyByName( msPageLayoutNames ) )
|
|
|
|
{
|
|
|
|
aAny <<= maDrawPagesAutoLayoutNames;
|
|
|
|
xInfoSet->setPropertyValue( msPageLayoutNames, aAny );
|
|
|
|
}
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2001-02-02 10:14:37 +00:00
|
|
|
void SdXMLExport::_ExportAutoStyles()
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2001-03-20 19:08:37 +00:00
|
|
|
uno::Reference< beans::XPropertySet > xInfoSet( getExportInfo() );
|
|
|
|
if( xInfoSet.is() )
|
|
|
|
{
|
|
|
|
uno::Reference< beans::XPropertySetInfo > xInfoSetInfo( xInfoSet->getPropertySetInfo() );
|
|
|
|
|
|
|
|
if( xInfoSetInfo->hasPropertyByName( msPageLayoutNames ) )
|
|
|
|
{
|
|
|
|
xInfoSet->getPropertyValue( msPageLayoutNames ) >>= maDrawPagesAutoLayoutNames;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-02-02 10:14:37 +00:00
|
|
|
GetPropertySetMapper()->SetAutoStyles( sal_True );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-03-01 15:31:32 +00:00
|
|
|
if( getExportFlags() & EXPORT_STYLES )
|
|
|
|
{
|
|
|
|
// #80012# PageMaster export moved from _ExportStyles
|
|
|
|
// prepare page-master infos
|
|
|
|
ImpPrepPageMasterInfos();
|
2000-11-06 11:58:31 +00:00
|
|
|
|
2001-03-01 15:31:32 +00:00
|
|
|
// write page-master infos
|
|
|
|
ImpWritePageMasterInfos();
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-03-01 15:31:32 +00:00
|
|
|
// prepare draw:style-name for master page export
|
|
|
|
ImpPrepMasterPageInfos();
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-03-01 15:31:32 +00:00
|
|
|
if( getExportFlags() & EXPORT_CONTENT )
|
|
|
|
{
|
|
|
|
// prepare draw:style-name for page export
|
|
|
|
ImpPrepDrawPageInfos();
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-02-02 10:14:37 +00:00
|
|
|
// export draw-page styles
|
|
|
|
GetAutoStylePool()->exportXML(
|
|
|
|
XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID,
|
|
|
|
GetDocHandler(),
|
|
|
|
GetMM100UnitConverter(),
|
|
|
|
GetNamespaceMap());
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-03-01 15:31:32 +00:00
|
|
|
if( getExportFlags() & EXPORT_STYLES )
|
2001-02-02 10:14:37 +00:00
|
|
|
{
|
2001-03-01 15:31:32 +00:00
|
|
|
// create auto style infos for objects on master pages
|
|
|
|
for(sal_Int32 nMPageId(0L); nMPageId < mnDocMasterPageCount; nMPageId++)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2001-03-01 15:31:32 +00:00
|
|
|
uno::Any aAny(mxDocMasterPages->getByIndex(nMPageId));
|
|
|
|
uno::Reference< drawing::XDrawPage > xMasterPage;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-03-01 15:31:32 +00:00
|
|
|
if((aAny >>= xMasterPage) && xMasterPage.is() )
|
2001-02-02 10:14:37 +00:00
|
|
|
{
|
2001-03-01 15:31:32 +00:00
|
|
|
// collect layer information
|
|
|
|
GetFormExport()->examineForms( xMasterPage );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-03-01 15:31:32 +00:00
|
|
|
// get MasterPage Name
|
|
|
|
OUString aMasterPageNamePrefix;
|
|
|
|
uno::Reference < container::XNamed > xNamed(xMasterPage, uno::UNO_QUERY);
|
|
|
|
if(xNamed.is())
|
|
|
|
{
|
|
|
|
aMasterPageNamePrefix = xNamed->getName();
|
|
|
|
}
|
|
|
|
if(aMasterPageNamePrefix.getLength())
|
|
|
|
{
|
|
|
|
aMasterPageNamePrefix += OUString(RTL_CONSTASCII_USTRINGPARAM("-"));
|
|
|
|
}
|
|
|
|
GetShapeExport()->setPresentationStylePrefix( aMasterPageNamePrefix );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-03-01 15:31:32 +00:00
|
|
|
uno::Reference< drawing::XShapes > xShapes(xMasterPage, uno::UNO_QUERY);
|
|
|
|
if(xShapes.is() && xShapes->getCount())
|
|
|
|
GetShapeExport()->collectShapesAutoStyles( xShapes );
|
|
|
|
|
|
|
|
if(IsImpress())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2001-03-01 15:31:32 +00:00
|
|
|
uno::Reference< presentation::XPresentationPage > xPresPage(xMasterPage, uno::UNO_QUERY);
|
|
|
|
if(xPresPage.is())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2001-03-01 15:31:32 +00:00
|
|
|
uno::Reference< drawing::XDrawPage > xNotesPage(xPresPage->getNotesPage());
|
|
|
|
if(xNotesPage.is())
|
|
|
|
{
|
|
|
|
// collect layer information
|
|
|
|
GetFormExport()->examineForms( xNotesPage );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-03-01 15:31:32 +00:00
|
|
|
uno::Reference< drawing::XShapes > xShapes(xNotesPage, uno::UNO_QUERY);
|
|
|
|
if(xShapes.is() && xShapes->getCount())
|
|
|
|
GetShapeExport()->collectShapesAutoStyles( xShapes );
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-03-01 15:31:32 +00:00
|
|
|
if( getExportFlags() & EXPORT_CONTENT )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2001-03-01 15:31:32 +00:00
|
|
|
// create auto style infos for objects on pages
|
|
|
|
for(sal_Int32 nPageInd(0); nPageInd < mnDocDrawPageCount; nPageInd++)
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2001-03-01 15:31:32 +00:00
|
|
|
uno::Any aAny(mxDocDrawPages->getByIndex(nPageInd));
|
|
|
|
uno::Reference<drawing::XDrawPage> xDrawPage;
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-03-01 15:31:32 +00:00
|
|
|
if((aAny >>= xDrawPage) && xDrawPage.is() )
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2001-03-01 15:31:32 +00:00
|
|
|
// collect layer information
|
|
|
|
GetFormExport()->examineForms( xDrawPage );
|
|
|
|
|
|
|
|
// get MasterPage Name
|
|
|
|
OUString aMasterPageNamePrefix;
|
|
|
|
uno::Reference < drawing::XMasterPageTarget > xMasterPageInt(xDrawPage, uno::UNO_QUERY);
|
|
|
|
if(xMasterPageInt.is())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2001-03-01 15:31:32 +00:00
|
|
|
uno::Reference<drawing::XDrawPage> xUsedMasterPage(xMasterPageInt->getMasterPage());
|
|
|
|
if(xUsedMasterPage.is())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2001-03-01 15:31:32 +00:00
|
|
|
uno::Reference < container::XNamed > xMasterNamed(xUsedMasterPage, uno::UNO_QUERY);
|
|
|
|
if(xMasterNamed.is())
|
|
|
|
{
|
|
|
|
aMasterPageNamePrefix = xMasterNamed->getName();
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
2001-03-01 15:31:32 +00:00
|
|
|
if(aMasterPageNamePrefix.getLength())
|
|
|
|
{
|
|
|
|
aMasterPageNamePrefix += OUString(RTL_CONSTASCII_USTRINGPARAM("-"));
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-03-01 15:31:32 +00:00
|
|
|
GetShapeExport()->setPresentationStylePrefix( aMasterPageNamePrefix );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-03-01 15:31:32 +00:00
|
|
|
// prepare object infos
|
|
|
|
uno::Reference< drawing::XShapes > xShapes(xDrawPage, uno::UNO_QUERY);
|
|
|
|
if(xShapes.is() && xShapes->getCount())
|
|
|
|
GetShapeExport()->collectShapesAutoStyles( xShapes );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-03-01 15:31:32 +00:00
|
|
|
// prepare presentation notes page object infos (ONLY if presentation)
|
|
|
|
if(IsImpress())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2001-03-01 15:31:32 +00:00
|
|
|
uno::Reference< presentation::XPresentationPage > xPresPage(xDrawPage, uno::UNO_QUERY);
|
|
|
|
if(xPresPage.is())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
2001-03-01 15:31:32 +00:00
|
|
|
uno::Reference< drawing::XDrawPage > xNotesPage(xPresPage->getNotesPage());
|
|
|
|
if(xNotesPage.is())
|
|
|
|
{
|
|
|
|
// collect layer information
|
|
|
|
GetFormExport()->examineForms( xNotesPage );
|
2001-01-18 13:53:32 +00:00
|
|
|
|
2001-03-01 15:31:32 +00:00
|
|
|
uno::Reference< drawing::XShapes > xShapes(xNotesPage, uno::UNO_QUERY);
|
|
|
|
if(xShapes.is() && xShapes->getCount())
|
|
|
|
GetShapeExport()->collectShapesAutoStyles( xShapes );
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GetShapeExport()->exportAutoStyles();
|
|
|
|
|
|
|
|
// ...for text
|
|
|
|
GetTextParagraphExport()->exportTextAutoStyles();
|
|
|
|
|
|
|
|
// ...for chart
|
|
|
|
GetChartExport()->exportAutoStyles();
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
void SdXMLExport::_ExportMasterStyles()
|
|
|
|
{
|
2001-01-19 15:25:18 +00:00
|
|
|
// export layer
|
|
|
|
SdXMLayerExporter::exportLayer( *this );
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// export MasterPages in master-styles section
|
|
|
|
for(sal_Int32 nMPageId = 0L; nMPageId < mnDocMasterPageCount; nMPageId++)
|
|
|
|
{
|
|
|
|
uno::Any aAny(mxDocMasterPages->getByIndex(nMPageId));
|
|
|
|
uno::Reference< drawing::XDrawPage > xMasterPage;
|
|
|
|
|
2001-01-18 13:53:32 +00:00
|
|
|
if((aAny >>= xMasterPage) && xMasterPage.is())
|
2000-09-18 16:07:07 +00:00
|
|
|
{
|
|
|
|
// prepare masterpage attributes
|
|
|
|
OUString sMasterPageName;
|
|
|
|
uno::Reference < container::XNamed > xNamed(xMasterPage, uno::UNO_QUERY);
|
|
|
|
if(xNamed.is())
|
|
|
|
{
|
|
|
|
sMasterPageName = xNamed->getName();
|
|
|
|
AddAttribute(XML_NAMESPACE_STYLE, sXML_name, sMasterPageName);
|
|
|
|
}
|
|
|
|
|
|
|
|
ImpXMLEXPPageMasterInfo* pInfo = mpPageMaterUsageList->GetObject(nMPageId);
|
|
|
|
if(pInfo)
|
|
|
|
{
|
|
|
|
OUString sString = pInfo->GetName();
|
|
|
|
AddAttribute(XML_NAMESPACE_STYLE, sXML_page_master_name, sString);
|
|
|
|
}
|
|
|
|
|
2000-12-05 22:31:17 +00:00
|
|
|
// draw:style-name (background attributes)
|
2000-12-06 15:53:44 +00:00
|
|
|
if( maMasterPagesStyleNames[nMPageId].getLength() )
|
|
|
|
AddAttribute(XML_NAMESPACE_DRAW, sXML_style_name, maMasterPagesStyleNames[nMPageId]);
|
2000-12-05 22:31:17 +00:00
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// write masterpage
|
|
|
|
SvXMLElementExport aMPG(*this, XML_NAMESPACE_STYLE, sXML_master_page, sal_True, sal_True);
|
|
|
|
|
2001-01-18 13:53:32 +00:00
|
|
|
// write optional office:forms
|
|
|
|
exportFormsElement( xMasterPage );
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// write graphic objects on this master page (if any)
|
2001-02-02 10:14:37 +00:00
|
|
|
uno::Reference< drawing::XShapes > xShapes(xMasterPage, uno::UNO_QUERY);
|
2000-09-18 16:07:07 +00:00
|
|
|
if(xShapes.is() && xShapes->getCount())
|
2001-02-02 10:14:37 +00:00
|
|
|
GetShapeExport()->exportShapes( xShapes );
|
2000-09-18 16:07:07 +00:00
|
|
|
|
|
|
|
// write presentation notes (ONLY if presentation)
|
|
|
|
if(IsImpress())
|
|
|
|
{
|
|
|
|
uno::Reference< presentation::XPresentationPage > xPresPage(xMasterPage, uno::UNO_QUERY);
|
|
|
|
if(xPresPage.is())
|
|
|
|
{
|
|
|
|
uno::Reference< drawing::XDrawPage > xNotesPage(xPresPage->getNotesPage());
|
|
|
|
if(xNotesPage.is())
|
|
|
|
{
|
2001-02-02 10:14:37 +00:00
|
|
|
uno::Reference< drawing::XShapes > xShapes(xNotesPage, uno::UNO_QUERY);
|
2000-09-18 16:07:07 +00:00
|
|
|
if(xShapes.is() && xShapes->getCount())
|
|
|
|
{
|
|
|
|
// write presentation notes
|
|
|
|
SvXMLElementExport aPSY(*this, XML_NAMESPACE_PRESENTATION, sXML_notes, sal_True, sal_True);
|
|
|
|
|
2001-01-18 13:53:32 +00:00
|
|
|
// write optional office:forms
|
|
|
|
exportFormsElement( xNotesPage );
|
|
|
|
|
2000-09-18 16:07:07 +00:00
|
|
|
// write shapes per se
|
2001-02-02 10:14:37 +00:00
|
|
|
GetShapeExport()->exportShapes( xShapes );
|
2000-09-18 16:07:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-01-18 13:53:32 +00:00
|
|
|
void SdXMLExport::exportFormsElement( uno::Reference< drawing::XDrawPage > xDrawPage )
|
|
|
|
{
|
|
|
|
if( xDrawPage.is() )
|
|
|
|
{
|
|
|
|
uno::Reference< form::XFormsSupplier > xFormsSupplier( xDrawPage, uno::UNO_QUERY );
|
|
|
|
if( xFormsSupplier.is() )
|
|
|
|
{
|
|
|
|
uno::Reference< container::XNameContainer > xForms( xFormsSupplier->getForms() );
|
|
|
|
if( xForms.is() && xForms->hasElements() )
|
|
|
|
{
|
|
|
|
// write masterpage
|
2001-03-20 14:12:17 +00:00
|
|
|
::xmloff::OOfficeFormsExport aForms(*this);
|
2001-01-18 13:53:32 +00:00
|
|
|
GetFormExport()->exportForms( xDrawPage );
|
|
|
|
}
|
|
|
|
}
|
2000-09-18 16:07:07 +00:00
|
|
|
|
2001-01-18 13:53:32 +00:00
|
|
|
sal_Bool bRet = GetFormExport()->seekPage( xDrawPage );
|
|
|
|
DBG_ASSERT( bRet, "OFormLayerXMLExport::seekPage failed!" );
|
|
|
|
}
|
|
|
|
}
|
2001-03-27 21:03:08 +00:00
|
|
|
|
|
|
|
void SdXMLExport::GetViewSettings(uno::Sequence<beans::PropertyValue>& rProps)
|
|
|
|
{
|
|
|
|
rProps.realloc(4);
|
|
|
|
beans::PropertyValue* pProps = rProps.getArray();
|
|
|
|
if(pProps)
|
|
|
|
{
|
2001-04-26 09:52:45 +00:00
|
|
|
// SvXMLElementExport aViewSettingsElem(*this, XML_NAMESPACE_DRAW, sXML_view_settings, sal_True, sal_True);
|
2001-03-27 21:03:08 +00:00
|
|
|
|
|
|
|
uno::Reference< beans::XPropertySet > xPropSet( GetModel(), uno::UNO_QUERY );
|
|
|
|
if( !xPropSet.is() )
|
|
|
|
return;
|
|
|
|
|
|
|
|
awt::Rectangle aVisArea;
|
|
|
|
xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "VisibleArea" ) ) ) >>= aVisArea;
|
|
|
|
/*
|
|
|
|
sal_Int16 nMapUnit;
|
|
|
|
xPropSet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "MapUnit" ) ) ) >>= nMapUnit;
|
|
|
|
*/
|
|
|
|
|
|
|
|
sal_uInt16 i = 0;
|
2001-04-26 09:52:45 +00:00
|
|
|
pProps[i].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaTop"));
|
2001-03-27 21:03:08 +00:00
|
|
|
pProps[i++].Value <<= aVisArea.Y;
|
2001-04-26 09:52:45 +00:00
|
|
|
pProps[i].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaLeft"));
|
2001-03-27 21:03:08 +00:00
|
|
|
pProps[i++].Value <<= aVisArea.X;
|
2001-04-26 09:52:45 +00:00
|
|
|
pProps[i].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaWidth"));
|
2001-03-27 21:03:08 +00:00
|
|
|
pProps[i++].Value <<= aVisArea.Width;
|
2001-04-26 09:52:45 +00:00
|
|
|
pProps[i].Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("VisibleAreaHeight"));
|
2001-03-27 21:03:08 +00:00
|
|
|
pProps[i++].Value <<= aVisArea.Height;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void SdXMLExport::GetConfigurationSettings(uno::Sequence<beans::PropertyValue>& rProps)
|
|
|
|
{
|
|
|
|
uno::Reference< lang::XMultiServiceFactory > xFac( GetModel(), uno::UNO_QUERY );
|
|
|
|
if( xFac.is() )
|
|
|
|
{
|
|
|
|
uno::Reference< beans::XPropertySet > xProps( xFac->createInstance( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.Settings" ) ) ), uno::UNO_QUERY );
|
|
|
|
if( xProps.is() )
|
2001-04-06 13:27:54 +00:00
|
|
|
SvXMLUnitConverter::convertPropertySet( rProps, xProps );
|
2001-03-27 21:03:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-01-12 15:16:13 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
uno::Sequence< OUString > SAL_CALL SdImpressXMLExport_getSupportedServiceNames() throw()
|
|
|
|
{
|
2001-03-04 15:10:26 +00:00
|
|
|
const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Impress.XMLExporter" ) );
|
2001-01-12 15:16:13 +00:00
|
|
|
const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
|
|
|
|
return aSeq;
|
|
|
|
}
|
|
|
|
|
|
|
|
OUString SAL_CALL SdImpressXMLExport_getImplementationName() throw()
|
|
|
|
{
|
|
|
|
return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLExport.Impress" ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
uno::Reference< uno::XInterface > SAL_CALL SdImpressXMLExport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
|
|
|
|
{
|
|
|
|
return (cppu::OWeakObject*)new SdXMLExport( sal_False );
|
|
|
|
}
|
|
|
|
|
|
|
|
uno::Sequence< OUString > SAL_CALL SdDrawXMLExport_getSupportedServiceNames() throw()
|
|
|
|
{
|
2001-03-04 15:10:26 +00:00
|
|
|
const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Draw.XMLExporter" ) );
|
2001-01-12 15:16:13 +00:00
|
|
|
const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
|
|
|
|
return aSeq;
|
|
|
|
}
|
|
|
|
|
|
|
|
OUString SAL_CALL SdDrawXMLExport_getImplementationName() throw()
|
|
|
|
{
|
|
|
|
return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLExport.Draw" ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
uno::Reference< uno::XInterface > SAL_CALL SdDrawXMLExport_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
|
2000-12-05 22:31:17 +00:00
|
|
|
{
|
2001-01-12 15:16:13 +00:00
|
|
|
return (cppu::OWeakObject*)new SdXMLExport( sal_True );
|
2000-12-05 22:31:17 +00:00
|
|
|
}
|
2001-03-01 15:31:32 +00:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
uno::Sequence< OUString > SAL_CALL SdImpressXMLExport_Style_getSupportedServiceNames() throw()
|
|
|
|
{
|
2001-03-04 15:10:26 +00:00
|
|
|
const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Impress.XMLStylesExporter" ) );
|
2001-03-01 15:31:32 +00:00
|
|
|
const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
|
|
|
|
return aSeq;
|
|
|
|
}
|
|
|
|
|
|
|
|
OUString SAL_CALL SdImpressXMLExport_Style_getImplementationName() throw()
|
|
|
|
{
|
|
|
|
return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLExport.Impress.Styles" ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
uno::Reference< uno::XInterface > SAL_CALL SdImpressXMLExport_Style_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
|
|
|
|
{
|
|
|
|
return (cppu::OWeakObject*)new SdXMLExport( sal_False, EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES );
|
|
|
|
}
|
|
|
|
|
|
|
|
uno::Sequence< OUString > SAL_CALL SdDrawXMLExport_Style_getSupportedServiceNames() throw()
|
|
|
|
{
|
2001-03-04 15:10:26 +00:00
|
|
|
const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Draw.XMLStylesExporter" ) );
|
2001-03-01 15:31:32 +00:00
|
|
|
const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
|
|
|
|
return aSeq;
|
|
|
|
}
|
|
|
|
|
|
|
|
OUString SAL_CALL SdDrawXMLExport_Style_getImplementationName() throw()
|
|
|
|
{
|
|
|
|
return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLExport.Draw.Styles" ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
uno::Reference< uno::XInterface > SAL_CALL SdDrawXMLExport_Style_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
|
|
|
|
{
|
|
|
|
return (cppu::OWeakObject*)new SdXMLExport( sal_True, EXPORT_STYLES|EXPORT_MASTERSTYLES|EXPORT_AUTOSTYLES );
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2001-03-04 15:10:26 +00:00
|
|
|
uno::Sequence< OUString > SAL_CALL SdImpressXMLExport_Meta_getSupportedServiceNames() throw()
|
|
|
|
{
|
|
|
|
const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Impress.XMLMetaExporter" ) );
|
|
|
|
const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
|
|
|
|
return aSeq;
|
|
|
|
}
|
|
|
|
|
|
|
|
OUString SAL_CALL SdImpressXMLExport_Meta_getImplementationName() throw()
|
|
|
|
{
|
|
|
|
return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLExport.Impress.Meta" ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
uno::Reference< uno::XInterface > SAL_CALL SdImpressXMLExport_Meta_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
|
|
|
|
{
|
|
|
|
return (cppu::OWeakObject*)new SdXMLExport( sal_False, EXPORT_META );
|
|
|
|
}
|
|
|
|
|
|
|
|
uno::Sequence< OUString > SAL_CALL SdDrawXMLExport_Meta_getSupportedServiceNames() throw()
|
|
|
|
{
|
|
|
|
const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Draw.XMLMetaExporter" ) );
|
|
|
|
const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
|
|
|
|
return aSeq;
|
|
|
|
}
|
|
|
|
|
|
|
|
OUString SAL_CALL SdDrawXMLExport_Meta_getImplementationName() throw()
|
|
|
|
{
|
|
|
|
return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLExport.Draw.Meta" ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
uno::Reference< uno::XInterface > SAL_CALL SdDrawXMLExport_Meta_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
|
|
|
|
{
|
|
|
|
return (cppu::OWeakObject*)new SdXMLExport( sal_True, EXPORT_META );
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2001-03-27 21:03:08 +00:00
|
|
|
uno::Sequence< OUString > SAL_CALL SdImpressXMLExport_Settings_getSupportedServiceNames() throw()
|
|
|
|
{
|
|
|
|
const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Impress.XMLSettingsExporter" ) );
|
|
|
|
const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
|
|
|
|
return aSeq;
|
|
|
|
}
|
|
|
|
|
|
|
|
OUString SAL_CALL SdImpressXMLExport_Settings_getImplementationName() throw()
|
|
|
|
{
|
|
|
|
return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLExport.Impress.Settings" ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
uno::Reference< uno::XInterface > SAL_CALL SdImpressXMLExport_Settings_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
|
|
|
|
{
|
|
|
|
return (cppu::OWeakObject*)new SdXMLExport( sal_False, EXPORT_SETTINGS );
|
|
|
|
}
|
|
|
|
|
|
|
|
uno::Sequence< OUString > SAL_CALL SdDrawXMLExport_Settings_getSupportedServiceNames() throw()
|
|
|
|
{
|
|
|
|
const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Draw.XMLSettingsExporter" ) );
|
|
|
|
const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
|
|
|
|
return aSeq;
|
|
|
|
}
|
|
|
|
|
|
|
|
OUString SAL_CALL SdDrawXMLExport_Settings_getImplementationName() throw()
|
|
|
|
{
|
|
|
|
return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLExport.Draw.Settings" ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
uno::Reference< uno::XInterface > SAL_CALL SdDrawXMLExport_Settings_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
|
|
|
|
{
|
|
|
|
return (cppu::OWeakObject*)new SdXMLExport( sal_True, EXPORT_SETTINGS );
|
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2001-03-01 15:31:32 +00:00
|
|
|
uno::Sequence< OUString > SAL_CALL SdImpressXMLExport_Content_getSupportedServiceNames() throw()
|
|
|
|
{
|
2001-03-04 15:10:26 +00:00
|
|
|
const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Impress.XMLContentExporter" ) );
|
2001-03-01 15:31:32 +00:00
|
|
|
const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
|
|
|
|
return aSeq;
|
|
|
|
}
|
|
|
|
|
|
|
|
OUString SAL_CALL SdImpressXMLExport_Content_getImplementationName() throw()
|
|
|
|
{
|
|
|
|
return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLExport.Impress.Content" ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
uno::Reference< uno::XInterface > SAL_CALL SdImpressXMLExport_Content_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
|
|
|
|
{
|
2001-03-27 21:03:08 +00:00
|
|
|
return (cppu::OWeakObject*)new SdXMLExport( sal_False, EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS );
|
2001-03-01 15:31:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
uno::Sequence< OUString > SAL_CALL SdDrawXMLExport_Content_getSupportedServiceNames() throw()
|
|
|
|
{
|
2001-03-04 15:10:26 +00:00
|
|
|
const OUString aServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.Draw.XMLContentExporter" ) );
|
2001-03-01 15:31:32 +00:00
|
|
|
const uno::Sequence< OUString > aSeq( &aServiceName, 1 );
|
|
|
|
return aSeq;
|
|
|
|
}
|
|
|
|
|
|
|
|
OUString SAL_CALL SdDrawXMLExport_Content_getImplementationName() throw()
|
|
|
|
{
|
|
|
|
return OUString( RTL_CONSTASCII_USTRINGPARAM( "SdXMLExport.Draw.Content" ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
uno::Reference< uno::XInterface > SAL_CALL SdDrawXMLExport_Content_createInstance(const uno::Reference< lang::XMultiServiceFactory > & rSMgr) throw( uno::Exception )
|
|
|
|
{
|
2001-03-27 21:03:08 +00:00
|
|
|
return (cppu::OWeakObject*)new SdXMLExport( sal_True, EXPORT_AUTOSTYLES|EXPORT_CONTENT|EXPORT_SCRIPTS|EXPORT_FONTDECLS );
|
2001-03-01 15:31:32 +00:00
|
|
|
}
|