summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmloff/source/draw/sdxmlexp.cxx218
-rw-r--r--xmloff/source/draw/sdxmlexp_impl.hxx309
-rw-r--r--xmloff/source/draw/sdxmlimp.cxx22
-rw-r--r--xmloff/source/draw/sdxmlimp_impl.hxx308
-rw-r--r--xmloff/source/draw/shapeexport.cxx11
-rw-r--r--xmloff/source/draw/shapeimport.cxx21
-rw-r--r--xmloff/source/draw/ximp3dobject.hxx8
-rw-r--r--xmloff/source/draw/ximp3dscene.hxx8
-rw-r--r--xmloff/source/draw/ximpbody.hxx8
-rw-r--r--xmloff/source/draw/ximpgrp.hxx8
-rw-r--r--xmloff/source/draw/ximpnote.hxx8
-rw-r--r--xmloff/source/draw/ximpshap.hxx8
-rw-r--r--xmloff/source/draw/ximpstyl.hxx9
13 files changed, 834 insertions, 112 deletions
diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx
index 679760e4938a..f40f5f1f0ba5 100644
--- a/xmloff/source/draw/sdxmlexp.cxx
+++ b/xmloff/source/draw/sdxmlexp.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: sdxmlexp.cxx,v $
*
- * $Revision: 1.26 $
+ * $Revision: 1.27 $
*
- * last change: $Author: ka $ $Date: 2000-12-05 17:36:23 $
+ * last change: $Author: cl $ $Date: 2000-12-05 23:21:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -105,6 +105,10 @@
#include "sdxmlexp.hxx"
#endif
+#ifndef _SDXMLEXP_IMPL_HXX
+#include "sdxmlexp_impl.hxx"
+#endif
+
#ifndef _COM_SUN_STAR_DRAWING_XDRAWPAGESSUPPLIER_HPP_
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
#endif
@@ -637,6 +641,7 @@ SdXMLExport::SdXMLExport(
mpPageMasterInfoList(new ImpXMLEXPPageMasterList(1, 4, 4)),
mpPageMaterUsageList(new ImpXMLEXPPageMasterList(1, 4, 4)),
mpDrawPageInfoList(new ImpXMLDrawPageInfoList(4, 8, 8)),
+ mpMasterPageInfoList(new ImpXMLDrawPageInfoList(4, 8, 8)),
mpShapeStyleInfoList(new ImpXMLShapeStyleInfoList(16, 64, 64)),
mpAutoLayoutInfoList(new ImpXMLAutoLayoutInfoList(1, 4, 4)),
mpPropertySetMapper(0L),
@@ -665,12 +670,13 @@ SdXMLExport::SdXMLExport(
// construct PropertySetMapper
UniReference < XMLPropertySetMapper > xMapper = new XMLShapePropertySetMapper( aFactoryRef);
+
mpPropertySetMapper = new XMLShapeExportPropertyMapper( xMapper, (XMLTextListAutoStylePool*)&GetTextParagraphExport()->GetListAutoStylePool(), *this );
- if(mpPropertySetMapper)
- {
- // set lock to avoid deletion
- mpPropertySetMapper->acquire();
- }
+ // set lock to avoid deletion
+ mpPropertySetMapper->acquire();
+
+ // chain text attributes
+ mpPropertySetMapper->ChainExportMapper(XMLTextParagraphExport::CreateCharExtPropMapper(*this));
// construct PresPagePropsMapper
xMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLSDPresPageProps, aFactoryRef);
@@ -694,6 +700,11 @@ SdXMLExport::SdXMLExport(
OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_NAME)),
GetPropertySetMapper(),
OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_PRESENTATION_PREFIX)));
+ 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)));
// prepare access to styles
uno::Reference< style::XStyleFamiliesSupplier > xFamSup( GetModel(), uno::UNO_QUERY );
@@ -802,6 +813,15 @@ __EXPORT SdXMLExport::~SdXMLExport()
mpDrawPageInfoList = 0L;
}
+ // clear draw style infos
+ if(mpMasterPageInfoList)
+ {
+ while(mpMasterPageInfoList->Count())
+ delete mpMasterPageInfoList->Remove(mpMasterPageInfoList->Count() - 1L);
+ delete mpMasterPageInfoList;
+ mpMasterPageInfoList = 0L;
+ }
+
// clear shape style infos
if(mpShapeStyleInfoList)
{
@@ -1445,9 +1465,9 @@ void SdXMLExport::ImpWritePageMasterInfos()
AddAttribute(XML_NAMESPACE_FO, sXML_page_height, sString);
if(pInfo->GetOrientation() == view::PaperOrientation_PORTRAIT)
- AddAttributeASCII(XML_NAMESPACE_STYLE, sXML_print_orientation, sXML_orientation_portrait);
+ AddAttributeASCII(XML_NAMESPACE_STYLE, sXML_print_orientation, sXML_portrait);
else
- AddAttributeASCII(XML_NAMESPACE_STYLE, sXML_print_orientation, sXML_orientation_landscape);
+ AddAttributeASCII(XML_NAMESPACE_STYLE, sXML_print_orientation, sXML_landscape);
// write style:properties
SvXMLElementExport aPMF(*this, XML_NAMESPACE_STYLE, sXML_properties, sal_True, sal_True);
@@ -1494,11 +1514,51 @@ void SdXMLExport::ImpPrepDrawPageInfos()
if(aAny >>= xDrawPage)
{
// create name
- OUString sNewName = OUString(RTL_CONSTASCII_USTRINGPARAM("P"));
- sNewName += OUString::valueOf((sal_Int32)nCnt);
+ 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);
+ }
+ }
+ }
// create Info object
- ImpXMLDrawPageInfo* pInfo = new ImpXMLDrawPageInfo(sNewName);
+ ImpXMLDrawPageInfo* pInfo = new ImpXMLDrawPageInfo(sStyleName);
mpDrawPageInfoList->Insert(pInfo, LIST_APPEND);
if(IsImpress())
@@ -1518,64 +1578,64 @@ void SdXMLExport::ImpPrepDrawPageInfos()
//////////////////////////////////////////////////////////////////////////////
-void SdXMLExport::ImpWriteDrawPageInfos()
+void SdXMLExport::ImpPrepMasterPageInfos()
{
- if(mnDocDrawPageCount && mpDrawPageInfoList->Count())
+ // 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)
{
- // prepare write
- for(sal_Int32 nCnt = 0L; nCnt < mnDocDrawPageCount; nCnt++)
+ // prepare name creation
+ for(sal_Int32 nCnt = 0L; nCnt < mnDocMasterPageCount; nCnt++)
{
- uno::Any aAny(mxDocDrawPages->getByIndex(nCnt));
+ uno::Any aAny(mxDocMasterPages->getByIndex(nCnt));
uno::Reference<drawing::XDrawPage> xDrawPage;
if(aAny >>= xDrawPage)
{
- ImpXMLDrawPageInfo* pInfo = mpDrawPageInfoList->GetObject(nCnt);
- if(pInfo)
- {
- // prepare draw-style attributes, style-name
- AddAttribute(XML_NAMESPACE_STYLE, sXML_name, pInfo->GetStyleName());
-
- // style-family
- AddAttribute(XML_NAMESPACE_STYLE, sXML_family,
- OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME)));
-
- // write draw-style attributes
- SvXMLElementExport aDSE(*this, XML_NAMESPACE_STYLE, sXML_style, sal_True, sal_True);
+ // create name
+ OUString sStyleName;
- // write draw-style properites
- uno::Reference< beans::XPropertySet > xPropSet1(xDrawPage, uno::UNO_QUERY);
- if(xPropSet1.is())
+ // 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 ) )
{
- // 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;
+ uno::Any aAny( xPropSet1->getPropertyValue( aBackground ) );
+ aAny >>= xPropSet2;
+ }
+ if( xPropSet2.is() )
+ {
const UniReference< SvXMLExportPropertyMapper > aMapperRef( GetPresPagePropsMapper() );
- std::vector< XMLPropertyState > xPropStates( aMapperRef->Filter( xPropSet ) );
+ std::vector< XMLPropertyState > xPropStates( aMapperRef->Filter( xPropSet2 ) );
- if(xPropStates.size())
+ if( !xPropStates.empty() )
{
- aMapperRef->exportXML(GetDocHandler(), xPropStates,
- GetMM100UnitConverter(), GetNamespaceMap());
+ // 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);
+ }
}
}
}
+
+ // create Info object
+ ImpXMLDrawPageInfo* pInfo = new ImpXMLDrawPageInfo(sStyleName);
+ mpMasterPageInfoList->Insert(pInfo, LIST_APPEND);
}
}
}
@@ -1644,7 +1704,8 @@ void SdXMLExport::_ExportContent()
if(pInfo)
{
OUString sString = pInfo->GetStyleName();
- AddAttribute(XML_NAMESPACE_DRAW, sXML_style_name, sString);
+ if( sString.getLength() )
+ AddAttribute(XML_NAMESPACE_DRAW, sXML_style_name, sString);
}
// draw:master-page-name
@@ -3631,7 +3692,7 @@ void SdXMLExport::ImpPrepSingleShapeStyleInfo(uno::Reference< drawing::XShape >&
uno::Any aAny = xPropSet->getPropertyValue(
OUString(RTL_CONSTASCII_USTRINGPARAM("Style")));
- if(aAny >>= xStyle)
+ if((aAny >>= xStyle) && xStyle.is())
{
// get family ID
uno::Reference< beans::XPropertySet > xStylePropSet(xStyle, uno::UNO_QUERY);
@@ -3800,21 +3861,9 @@ void SdXMLExport::_ExportStyles(BOOL bUsed)
// write draw:style-name for object graphic-styles
ImpWriteObjGraphicStyleInfos();
-// #80012# PageMaster export moved to _ExportAutoStyles
-// // prepare page-master infos
-// ImpPrepPageMasterInfos();
-// // write page-master infos
-// ImpWritePageMasterInfos();
-
// write presentation styles
ImpWritePresentationStyles();
- // prepare draw:style-name for page export
- ImpPrepDrawPageInfos();
-
- // write draw:style-name for page export
- ImpWriteDrawPageInfos();
-
// write draw:auto-layout-name for page export
ImpWriteAutoLayoutInfos();
}
@@ -3832,6 +3881,19 @@ void SdXMLExport::_ExportAutoStyles()
// write page-master infos
ImpWritePageMasterInfos();
+ // prepare draw:style-name for master page export
+ ImpPrepMasterPageInfos();
+
+ // prepare draw:style-name for page export
+ ImpPrepDrawPageInfos();
+
+ // export draw-page styles
+ GetAutoStylePool()->exportXML(
+ XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID,
+ GetDocHandler(),
+ GetMM100UnitConverter(),
+ GetNamespaceMap());
+
// create auto style infos for objects on master pages
for(sal_Int32 nMPageId(0L); nMPageId < mnDocMasterPageCount; nMPageId++)
{
@@ -3961,6 +4023,15 @@ void SdXMLExport::_ExportMasterStyles()
AddAttribute(XML_NAMESPACE_STYLE, sXML_page_master_name, sString);
}
+ // draw:style-name (background attributes)
+ ImpXMLDrawPageInfo* pStyleInfo = mpMasterPageInfoList->GetObject(nMPageId);
+ if(pInfo)
+ {
+ OUString sString = pStyleInfo->GetStyleName();
+ if( sString.getLength() )
+ AddAttribute(XML_NAMESPACE_DRAW, sXML_style_name, sString);
+ }
+
// write masterpage
SvXMLElementExport aMPG(*this, XML_NAMESPACE_STYLE, sXML_master_page, sal_True, sal_True);
@@ -3995,3 +4066,14 @@ void SdXMLExport::_ExportMasterStyles()
}
+sal_uInt32 SdXMLExportDoc(
+ const com::sun::star::uno::Reference<com::sun::star::frame::XModel>& rMod,
+ const rtl::OUString& rFileName,
+ const com::sun::star::uno::Reference<com::sun::star::xml::sax::XDocumentHandler>& rHandler,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >& rGrfContainer,
+ com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator >& rStatusIndicator,
+ BOOL bShowProgr, BOOL bIsDraw )
+{
+ SdXMLExport aExp( rMod, rFileName, rHandler, rGrfContainer, bShowProgr, bIsDraw );
+ return aExp.exportDoc( bIsDraw ? sXML_drawing : sXML_presentation );
+}
diff --git a/xmloff/source/draw/sdxmlexp_impl.hxx b/xmloff/source/draw/sdxmlexp_impl.hxx
new file mode 100644
index 000000000000..77c9aa2423bf
--- /dev/null
+++ b/xmloff/source/draw/sdxmlexp_impl.hxx
@@ -0,0 +1,309 @@
+/*************************************************************************
+ *
+ * $RCSfile: sdxmlexp_impl.hxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: cl $ $Date: 2000-12-05 23:22:55 $
+ *
+ * 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): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SDXMLEXP_IMPL_HXX
+#define _SDXMLEXP_IMPL_HXX
+
+#ifndef _XMLOFF_XMLEXP_HXX
+#include "xmlexp.hxx"
+#endif
+
+#ifndef _XMLOFF_XMLITMAP_HXX
+#include "xmlitmap.hxx"
+#endif
+
+#ifndef _COM_SUN_STAR_FRAME_XMODEL_HPP_
+#include <com/sun/star/frame/XModel.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_TASK_XSTATUSINDICATOR_HPP_
+#include <com/sun/star/task/XStatusIndicator.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
+#include <com/sun/star/container/XNameAccess.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_DRAWING_XDRAWPAGE_HPP_
+#include <com/sun/star/drawing/XDrawPage.hpp>
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+class SvXMLUnitConverter;
+class SvXMLExportItemMapper;
+class SfxPoolItem;
+class SfxItemSet;
+class OUStrings_Impl;
+class OUStringsSort_Impl;
+class Rectangle;
+
+class ImpPresPageDrawStylePropMapper;
+class ImpXMLEXPPageMasterList;
+class ImpXMLEXPPageMasterInfo;
+class ImpXMLDrawPageInfoList;
+class ImpXMLShapeStyleInfoList;
+class ImpXMLAutoLayoutInfoList;
+class SvXMLAutoStylePoolP;
+class XMLSdPropHdlFactory;
+class ImpXMLShapeStyleInfo;
+class XMLShapeExportPropertyMapper;
+
+//////////////////////////////////////////////////////////////////////////////
+
+enum XmlPlaceholder
+{
+ XmlPlaceholderTitle,
+ XmlPlaceholderOutline,
+ XmlPlaceholderSubtitle,
+ XmlPlaceholderText,
+ XmlPlaceholderGraphic,
+ XmlPlaceholderObject,
+ XmlPlaceholderChart,
+ XmlPlaceholderOrgchart,
+ XmlPlaceholderTable,
+ XmlPlaceholderPage,
+ XmlPlaceholderNotes,
+ XmlPlaceholderHandout
+};
+
+//////////////////////////////////////////////////////////////////////////////
+
+enum XmlShapeType
+{
+ XmlShapeTypeUnknown, // not known
+
+ XmlShapeTypeDrawRectangleShape, // "com.sun.star.drawing.RectangleShape"
+ XmlShapeTypeDrawEllipseShape, // "com.sun.star.drawing.EllipseShape"
+ XmlShapeTypeDrawControlShape, // "com.sun.star.drawing.ControlShape"
+ XmlShapeTypeDrawConnectorShape, // "com.sun.star.drawing.ConnectorShape"
+ XmlShapeTypeDrawMeasureShape, // "com.sun.star.drawing.MeasureShape"
+ XmlShapeTypeDrawLineShape, // "com.sun.star.drawing.LineShape"
+ XmlShapeTypeDrawPolyPolygonShape, // "com.sun.star.drawing.PolyPolygonShape"
+ XmlShapeTypeDrawPolyLineShape, // "com.sun.star.drawing.PolyLineShape"
+ XmlShapeTypeDrawOpenBezierShape, // "com.sun.star.drawing.OpenBezierShape"
+ XmlShapeTypeDrawClosedBezierShape, // "com.sun.star.drawing.ClosedBezierShape"
+ XmlShapeTypeDrawGraphicObjectShape, // "com.sun.star.drawing.GraphicObjectShape"
+ XmlShapeTypeDrawGroupShape, // "com.sun.star.drawing.GroupShape"
+ XmlShapeTypeDrawTextShape, // "com.sun.star.drawing.TextShape"
+ XmlShapeTypeDrawOLE2Shape, // "com.sun.star.drawing.OLE2Shape"
+ XmlShapeTypeDrawChartShape, // embedded com.sun.star.chart
+ XmlShapeTypeDrawTableShape, // embedded com.sun.star.sheet
+ XmlShapeTypeDrawPageShape, // "com.sun.star.drawing.PageShape"
+ XmlShapeTypeDrawFrameShape, // "com.sun.star.drawing.FrameShape"
+ XmlShapeTypeDrawCaptionShape, // "com.sun.star.drawing.CaptionShape"
+
+ XmlShapeTypeDraw3DSceneObject, // "com.sun.star.drawing.Shape3DSceneObject"
+ XmlShapeTypeDraw3DCubeObject, // "com.sun.star.drawing.Shape3DCubeObject"
+ XmlShapeTypeDraw3DSphereObject, // "com.sun.star.drawing.Shape3DSphereObject"
+ XmlShapeTypeDraw3DLatheObject, // "com.sun.star.drawing.Shape3DLatheObject"
+ XmlShapeTypeDraw3DExtrudeObject, // "com.sun.star.drawing.Shape3DExtrudeObject"
+
+ XmlShapeTypePresTitleTextShape, // "com.sun.star.presentation.TitleTextShape"
+ XmlShapeTypePresOutlinerShape, // "com.sun.star.presentation.OutlinerShape"
+ XmlShapeTypePresSubtitleShape, // "com.sun.star.presentation.SubtitleShape"
+ XmlShapeTypePresGraphicObjectShape, // "com.sun.star.presentation.GraphicObjectShape"
+ XmlShapeTypePresPageShape, // "com.sun.star.presentation.PageShape"
+ XmlShapeTypePresOLE2Shape, // "com.sun.star.presentation.OLE2Shape"
+ XmlShapeTypePresChartShape, // "com.sun.star.presentation.ChartShape"
+ XmlShapeTypePresTableShape, // "com.sun.star.presentation.TableShape"
+ XmlShapeTypePresOrgChartShape, // "com.sun.star.presentation.OrgChartShape"
+ XmlShapeTypePresNotesShape, // "com.sun.star.presentation.NotesShape"
+
+ XmlShapeTypeNotYetSet
+};
+
+//////////////////////////////////////////////////////////////////////////////
+
+class SdXMLExport : public SvXMLExport
+{
+ com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > mxStatusIndicator;
+ com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > mxDocStyleFamilies;
+ com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess > mxDocMasterPages;
+ com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess > mxDocDrawPages;
+ sal_Int32 mnDocMasterPageCount;
+ sal_Int32 mnDocDrawPageCount;
+ sal_Int32 mnShapeStyleInfoIndex;
+
+ // temporary infos
+ ImpXMLEXPPageMasterList* mpPageMasterInfoList;
+ ImpXMLEXPPageMasterList* mpPageMaterUsageList;
+ ImpXMLDrawPageInfoList* mpDrawPageInfoList;
+ ImpXMLDrawPageInfoList* mpMasterPageInfoList;
+ ImpXMLShapeStyleInfoList* mpShapeStyleInfoList;
+ ImpXMLAutoLayoutInfoList* mpAutoLayoutInfoList;
+
+ XMLSdPropHdlFactory* mpSdPropHdlFactory;
+ XMLShapeExportPropertyMapper* mpPropertySetMapper;
+ ImpPresPageDrawStylePropMapper* mpPresPagePropsMapper;
+
+ sal_Bool mbIsDraw;
+ sal_Bool mbFamilyGraphicUsed;
+ sal_Bool mbFamilyPresentationUsed;
+
+ const rtl::OUString msZIndex;
+ const rtl::OUString msEmptyPres;
+ const rtl::OUString msModel;
+ const rtl::OUString msStartShape;
+ const rtl::OUString msEndShape;
+
+ virtual void _ExportStyles(BOOL bUsed);
+ virtual void _ExportAutoStyles();
+ virtual void _ExportMasterStyles();
+ virtual void _ExportContent();
+
+ void ImpPrepPageMasterInfos();
+ void ImpPrepDrawMasterInfos();
+ void ImpWritePageMasterInfos();
+ ImpXMLEXPPageMasterInfo* ImpGetPageMasterInfoByName(const rtl::OUString& rName);
+
+ void ImpPrepDrawPageInfos();
+ void ImpPrepMasterPageInfos();
+ void ImpWritePresentationStyles();
+
+ BOOL ImpPrepAutoLayoutInfo(const com::sun::star::uno::Reference< com::sun::star::drawing::XDrawPage >& xPage, rtl::OUString& rName);
+ void ImpWriteAutoLayoutInfos();
+ void ImpWriteAutoLayoutPlaceholder(XmlPlaceholder ePl, const Rectangle& rRect);
+
+ void ImpWriteObjGraphicStyleInfos();
+
+ void ImpWriteDefaultStyleInfos();
+
+ void ImpPrepSingleShapeStyleInfo(com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape,
+ const rtl::OUString& rPrefix);
+ void ImpPrepSingleShapeStyleInfos(com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess >& xShapes,
+ const rtl::OUString& rPrefix);
+ void ImpWriteSingleShapeStyleInfos(com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess >& xShapes,
+ sal_Int32 nFeatures = SEF_DEFAULT,
+ com::sun::star::awt::Point* pRefPoint = NULL
+ );
+
+ void ImpWriteSingleShapeStyleInfo(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape,
+ sal_Int32 nFeatures = SEF_DEFAULT,
+ com::sun::star::awt::Point* pRefPoint = NULL
+ );
+
+public:
+ static void ImpWriteSingleShapeStyleInfo(SvXMLExport& rExp,
+ const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape,
+ sal_uInt16 nFamily, const rtl::OUString& rStyleName, XmlShapeType eShapeType,
+ sal_Int32 nFeatures = SEF_DEFAULT,
+ com::sun::star::awt::Point* pRefPoint = NULL
+ );
+
+ static void ImpCalcShapeType(const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape,
+ XmlShapeType& eShapeType);
+
+private:
+ // single shape exporters
+ static void ImpExportRectangleShape(SvXMLExport& rExp, const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ static void ImpExportLineShape(SvXMLExport& rExp, const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ static void ImpExportEllipseShape(SvXMLExport& rExp, const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ static void ImpExportPolygonShape(SvXMLExport& rExp, const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ static void ImpExportTextBoxShape(SvXMLExport& rExp, const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ static void ImpExportGraphicObjectShape(SvXMLExport& rExp, const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ static void ImpExportChartShape(SvXMLExport& rExp, const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ static void ImpExportSpreadsheetShape(SvXMLExport& rExp, const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ static void ImpExportControlShape(SvXMLExport& rExp, const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ static void ImpExportConnectorShape(SvXMLExport& rExp, const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ static void ImpExportMeasureShape(SvXMLExport& rExp, const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ static void ImpExportOLE2Shape(SvXMLExport& rExp, const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ static void ImpExportPageShape(SvXMLExport& rExp, const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ static void ImpExportCaptionShape(SvXMLExport& rExp, const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ static void ImpExport3DShape(SvXMLExport& rExp, const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+
+ static void ImpPrepareExport3DScene(SvXMLExport& rExp, const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+ static void ImpExport3DLamps(SvXMLExport& rExp, const com::sun::star::uno::Reference< com::sun::star::drawing::XShape >& xShape, XmlShapeType eShapeType, sal_Int32 nFeatures = SEF_DEFAULT, com::sun::star::awt::Point* pRefPoint = NULL );
+
+public:
+ SdXMLExport(
+ const com::sun::star::uno::Reference<com::sun::star::frame::XModel>& rMod,
+ const rtl::OUString& rFileName,
+ const com::sun::star::uno::Reference<com::sun::star::xml::sax::XDocumentHandler>& rHandler,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >& rGrfContainer,
+ BOOL bShowProgr, BOOL bIsDraw);
+ virtual ~SdXMLExport();
+
+ void SetProgress(sal_Int32 nProg);
+
+ // get factories and mappers
+ XMLSdPropHdlFactory* GetSdPropHdlFactory() const { return mpSdPropHdlFactory; }
+ XMLShapeExportPropertyMapper* GetPropertySetMapper() const { return mpPropertySetMapper; }
+ ImpPresPageDrawStylePropMapper* GetPresPagePropsMapper() const { return mpPresPagePropsMapper; }
+
+ BOOL IsDraw() const { return mbIsDraw; }
+ BOOL IsImpress() const { return !mbIsDraw; }
+
+ BOOL IsFamilyGraphicUsed() const { return mbFamilyGraphicUsed; }
+ void SetFamilyGraphicUsed() { mbFamilyGraphicUsed = TRUE; }
+ BOOL IsFamilyPresentationUsed() const { return mbFamilyPresentationUsed; }
+ void SetFamilyPresentationUsed() { mbFamilyPresentationUsed = TRUE; }
+};
+
+sal_uInt32 SdXMLExportDoc(
+ const com::sun::star::uno::Reference<com::sun::star::frame::XModel>& rMod,
+ const rtl::OUString& rFileName,
+ const com::sun::star::uno::Reference<com::sun::star::xml::sax::XDocumentHandler>& rHandler,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexContainer >& rGrfContainer,
+ BOOL bShowProgr, BOOL bIsDraw );
+
+#endif // _SDXMLEXP_HXX
+
diff --git a/xmloff/source/draw/sdxmlimp.cxx b/xmloff/source/draw/sdxmlimp.cxx
index ba5424b4bd33..ceb00f6dd2c0 100644
--- a/xmloff/source/draw/sdxmlimp.cxx
+++ b/xmloff/source/draw/sdxmlimp.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: sdxmlimp.cxx,v $
*
- * $Revision: 1.4 $
+ * $Revision: 1.5 $
*
- * last change: $Author: aw $ $Date: 2000-12-05 11:22:40 $
+ * last change: $Author: cl $ $Date: 2000-12-05 23:21:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -65,6 +65,10 @@
#include "sdxmlimp.hxx"
#endif
+#ifndef _SDXMLIMP_IMPL_HXX
+#include "sdxmlimp_impl.hxx"
+#endif
+
#ifndef _XIMPBODY_HXX
#include "ximpbody.hxx"
#endif
@@ -164,6 +168,7 @@ static __FAR_DATA SvXMLTokenMapEntry aMasterPageAttrTokenMap[] =
{
{ XML_NAMESPACE_STYLE, sXML_name, XML_TOK_MASTERPAGE_NAME },
{ XML_NAMESPACE_STYLE, sXML_page_master_name, XML_TOK_MASTERPAGE_PAGE_MASTER_NAME },
+ { XML_NAMESPACE_DRAW, sXML_style_name, XML_TOK_MASTERPAGE_STYLE_NAME },
XML_TOKEN_MAP_END
};
@@ -622,4 +627,17 @@ void SdXMLImport::ImportPoolDefaults(const XMLPropStyleContext* pPool)
{
}
+//////////////////////////////////////////////////////////////////////////////
+uno::Reference< xml::sax::XDocumentHandler >
+ CreateSdXMLImport(
+ uno::Reference< frame::XModel >& rMod,
+ uno::Reference< container::XIndexContainer >& rGrfContainer,
+ uno::Reference< task::XStatusIndicator >& rStatusIndicator,
+ sal_Bool bLoadDoc,
+ sal_uInt16 nStyleFamMask,
+ sal_Bool bShowProgr,
+ sal_Bool bIsDraw )
+{
+ return new SdXMLImport( rMod, rGrfContainer, bLoadDoc, nStyleFamMask, bShowProgr, bIsDraw );
+} \ No newline at end of file
diff --git a/xmloff/source/draw/sdxmlimp_impl.hxx b/xmloff/source/draw/sdxmlimp_impl.hxx
new file mode 100644
index 000000000000..14879dd72217
--- /dev/null
+++ b/xmloff/source/draw/sdxmlimp_impl.hxx
@@ -0,0 +1,308 @@
+/*************************************************************************
+ *
+ * $RCSfile: sdxmlimp_impl.hxx,v $
+ *
+ * $Revision: 1.1 $
+ *
+ * last change: $Author: cl $ $Date: 2000-12-05 23:22:55 $
+ *
+ * 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): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SDXMLIMP_IMPL_HXX
+#define _SDXMLIMP_IMPL_HXX
+
+#ifndef _COM_SUN_STAR_FRAME_XMODEL_HPP_
+#include <com/sun/star/frame/XModel.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_TASK_XSTATUSINDICATOR_HPP_
+#include <com/sun/star/task/XStatusIndicator.hpp>
+#endif
+
+#ifndef _XMLOFF_XMLTKMAP_HXX
+#include "xmltkmap.hxx"
+#endif
+
+#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
+#include <com/sun/star/container/XNameAccess.hpp>
+#endif
+
+#ifndef __SGI_STL_VECTOR
+#include <stl/vector>
+#endif
+
+#ifndef _XMLOFF_XMLIMP_HXX
+#include "xmlimp.hxx"
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+
+enum SdXMLDocElemTokenMap
+{
+ XML_TOK_DOC_STYLES,
+ XML_TOK_DOC_AUTOSTYLES,
+ XML_TOK_DOC_MASTERSTYLES,
+ XML_TOK_DOC_META,
+ XML_TOK_DOC_BODY,
+ XML_TOK_OFFICE_END = XML_TOK_UNKNOWN
+};
+
+enum SdXMLBodyElemTokenMap
+{
+ XML_TOK_BODY_PAGE
+};
+
+enum SdXMLStylesElemTokenMap
+{
+ XML_TOK_STYLES_MASTER_PAGE,
+ XML_TOK_STYLES_STYLE,
+ XML_TOK_STYLES_PAGE_MASTER,
+ XML_TOK_STYLES_PRESENTATION_PAGE_LAYOUT
+};
+
+enum SdXMLAutoStylesElemTokenMap
+{
+ XML_TOK_AUTOSTYLES_STYLE
+};
+
+enum SdXMLMasterPageElemTokenMap
+{
+ XML_TOK_MASTERPAGE_STYLE,
+ XML_TOK_MASTERPAGE_NOTES
+};
+
+enum SdXMLMasterPageAttrTokenMap
+{
+ XML_TOK_MASTERPAGE_NAME,
+ XML_TOK_MASTERPAGE_PAGE_MASTER_NAME,
+ XML_TOK_MASTERPAGE_STYLE_NAME
+};
+
+enum SdXMLPageMasterAttrTokenMap
+{
+ XML_TOK_PAGEMASTER_NAME
+};
+
+enum SdXMLPageMasterStyleAttrTokenMap
+{
+ XML_TOK_PAGEMASTERSTYLE_MARGIN_TOP,
+ XML_TOK_PAGEMASTERSTYLE_MARGIN_BOTTOM,
+ XML_TOK_PAGEMASTERSTYLE_MARGIN_LEFT,
+ XML_TOK_PAGEMASTERSTYLE_MARGIN_RIGHT,
+ XML_TOK_PAGEMASTERSTYLE_PAGE_WIDTH,
+ XML_TOK_PAGEMASTERSTYLE_PAGE_HEIGHT,
+ XML_TOK_PAGEMASTERSTYLE_PAGE_ORIENTATION
+};
+
+enum SdXMLDocStyleAttrTokenMap
+{
+ XML_TOK_DOCSTYLE_NAME,
+ XML_TOK_DOCSTYLE_FAMILY,
+ XML_TOK_DOCSTYLE_PARENT_STYLE_NAME,
+ XML_TOK_DOCSTYLE_AUTOMATIC
+};
+
+enum SdXMLDocStyleElemTokenMap
+{
+ XML_TOK_DOCSTYLE_PROPERTIES,
+ XML_TOK_DOCSTYLE_PRESENTATION_PLACEHOLDER
+};
+
+enum SdXMLDrawPageAttrTokenMap
+{
+ XML_TOK_DRAWPAGE_NAME,
+ XML_TOK_DRAWPAGE_STYLE_NAME,
+ XML_TOK_DRAWPAGE_MASTER_PAGE_NAME,
+ XML_TOK_DRAWPAGE_PAGE_LAYOUT_NAME
+};
+
+enum SdXMLDrawPageElemTokenMap
+{
+ XML_TOK_DRAWPAGE_NOTES
+};
+
+enum SdXMLPresentationPlaceholderAttrTokenMap
+{
+ XML_TOK_PRESENTATIONPLACEHOLDER_OBJECTNAME,
+ XML_TOK_PRESENTATIONPLACEHOLDER_X,
+ XML_TOK_PRESENTATIONPLACEHOLDER_Y,
+ XML_TOK_PRESENTATIONPLACEHOLDER_WIDTH,
+ XML_TOK_PRESENTATIONPLACEHOLDER_HEIGHT
+};
+
+//////////////////////////////////////////////////////////////////////////////
+
+class SvXMLUnitConverter;
+class SvXMLTokenMap;
+class XMLSdPropHdlFactory;
+class XMLPropertySetMapper;
+class XMLPropStyleContext;
+class SdXMLStylesContext;
+class SdXMLMasterStylesContext;
+
+//////////////////////////////////////////////////////////////////////////////
+
+class SdXMLImport: public SvXMLImport
+{
+ com::sun::star::uno::Reference< com::sun::star::task::XStatusIndicator > mxStatusIndicator;
+ com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > mxDocStyleFamilies;
+ com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess > mxDocMasterPages;
+ com::sun::star::uno::Reference< com::sun::star::container::XIndexAccess > mxDocDrawPages;
+
+ // contexts for Style and AutoStyle import
+ SdXMLMasterStylesContext* mpMasterStylesContext;
+
+ // token map lists
+ SvXMLTokenMap* mpDocElemTokenMap;
+ SvXMLTokenMap* mpBodyElemTokenMap;
+ SvXMLTokenMap* mpStylesElemTokenMap;
+ SvXMLTokenMap* mpAutoStylesElemTokenMap;
+ SvXMLTokenMap* mpMasterPageElemTokenMap;
+ SvXMLTokenMap* mpMasterPageAttrTokenMap;
+ SvXMLTokenMap* mpPageMasterAttrTokenMap;
+ SvXMLTokenMap* mpPageMasterStyleAttrTokenMap;
+ SvXMLTokenMap* mpDocStyleAttrTokenMap;
+ SvXMLTokenMap* mpDocStyleElemTokenMap;
+ SvXMLTokenMap* mpDrawPageAttrTokenMap;
+ SvXMLTokenMap* mpDrawPageElemTokenMap;
+ SvXMLTokenMap* mpPresentationPlaceholderAttrTokenMap;
+
+ sal_uInt16 mnStyleFamilyMask;
+
+ sal_Int32 mnNewPageCount;
+ sal_Int32 mnNewMasterPageCount;
+
+ sal_Bool mbIsDraw;
+ sal_Bool mbLoadDoc;
+
+protected:
+ // This method is called after the namespace map has been updated, but
+ // before a context for the current element has been pushed.
+ virtual SvXMLImportContext *CreateContext(sal_uInt16 nPrefix,
+ const rtl::OUString& rLocalName,
+ const com::sun::star::uno::Reference<
+ com::sun::star::xml::sax::XAttributeList>& xAttrList);
+
+public:
+ SdXMLImport(
+ com::sun::star::uno::Reference< com::sun::star::frame::XModel >& rMod,
+ com::sun::star::uno::Reference< com::sun::star::container::XIndexContainer >& rGrfContainer,
+ sal_Bool bLoadDoc,
+ sal_uInt16 nStyleFamMask,
+ sal_Bool bShowProgr,
+ sal_Bool bIsDraw);
+ ~SdXMLImport();
+
+ void SetProgress(sal_Int32 nProg);
+
+ // namespace office
+ SvXMLImportContext* CreateMetaContext(const rtl::OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList);
+ SvXMLImportContext* CreateBodyContext(const rtl::OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList);
+ SvXMLStylesContext* CreateStylesContext(const rtl::OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList);
+ SvXMLStylesContext* CreateAutoStylesContext(const rtl::OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList);
+ SvXMLImportContext* CreateMasterStylesContext(const rtl::OUString& rLocalName,
+ const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttrList);
+
+ // Styles and AutoStyles contexts
+ const SdXMLMasterStylesContext* GetMasterStylesContext() const { return mpMasterStylesContext; }
+
+ sal_uInt16 GetStyleFamilyMask() const { return mnStyleFamilyMask; }
+ sal_Bool IsStylesOnlyMode() const { return !mbLoadDoc; }
+
+ const SvXMLTokenMap& GetDocElemTokenMap();
+ const SvXMLTokenMap& GetBodyElemTokenMap();
+ const SvXMLTokenMap& GetStylesElemTokenMap();
+ const SvXMLTokenMap& GetMasterPageElemTokenMap();
+ const SvXMLTokenMap& GetMasterPageAttrTokenMap();
+ const SvXMLTokenMap& GetPageMasterAttrTokenMap();
+ const SvXMLTokenMap& GetPageMasterStyleAttrTokenMap();
+ const SvXMLTokenMap& GetDrawPageAttrTokenMap();
+ const SvXMLTokenMap& GetDrawPageElemTokenMap();
+ const SvXMLTokenMap& GetPresentationPlaceholderAttrTokenMap();
+
+ // export local parameters concerning page access and similar
+ const com::sun::star::uno::Reference<
+ com::sun::star::container::XNameAccess >& GetLocalDocStyleFamilies() const { return mxDocStyleFamilies; }
+ const com::sun::star::uno::Reference<
+ com::sun::star::container::XIndexAccess >& GetLocalMasterPages() const { return mxDocMasterPages; }
+ const com::sun::star::uno::Reference<
+ com::sun::star::container::XIndexAccess >& GetLocalDrawPages() const { return mxDocDrawPages; }
+
+ sal_Int32 GetNewPageCount() const { return mnNewPageCount; }
+ void IncrementNewPageCount() { mnNewPageCount++; }
+ sal_Int32 GetNewMasterPageCount() const { return mnNewMasterPageCount; }
+ void IncrementNewMasterPageCount() { mnNewMasterPageCount++; }
+
+ sal_Bool IsDraw() const { return mbIsDraw; }
+ sal_Bool IsImpress() const { return !mbIsDraw; }
+
+ // import pool defaults. Parameter contains pool defaults read
+ // from input data. These data needs to be set at the model.
+ void ImportPoolDefaults(const XMLPropStyleContext* pPool);
+};
+
+::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler >
+ CreateSdXMLImport(
+ com::sun::star::uno::Reference< com::sun::star::frame::XModel >& rMod,
+ com::sun::star::uno::Reference< com::sun::star::container::XIndexContainer >& rGrfContainer,
+ sal_Bool bLoadDoc,
+ sal_uInt16 nStyleFamMask,
+ sal_Bool bShowProgr,
+ sal_Bool bIsDraw );
+
+#endif // _SDXMLIMP_HXX
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index e5a17b8d7255..2eb5f58518ff 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: shapeexport.cxx,v $
*
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*
- * last change: $Author: cl $ $Date: 2000-12-01 19:19:53 $
+ * last change: $Author: cl $ $Date: 2000-12-05 23:24:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -75,8 +75,8 @@
#include "sdpropls.hxx"
#endif
-#ifndef _SDXMLEXP_HXX
-#include "sdxmlexp.hxx"
+#ifndef _SDXMLEXP_IMPL_HXX
+#include "sdxmlexp_impl.hxx"
#endif
#ifndef _XMLOFF_FAMILIES_HXX_
@@ -117,6 +117,9 @@ XMLShapeExport::XMLShapeExport(SvXMLExport& rExp,
xPropertySetMapper->ChainExportMapper( xExtMapper );
}
+ // chain text attributes
+ xPropertySetMapper->ChainExportMapper(XMLTextParagraphExport::CreateCharExtPropMapper(rExp));
+
rExp.GetAutoStylePool()->AddFamily(
XML_STYLE_FAMILY_SD_GRAPHICS_ID,
OUString(RTL_CONSTASCII_USTRINGPARAM(XML_STYLE_FAMILY_SD_GRAPHICS_NAME)),
diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx
index d2ae38cbd5aa..bb170cfc8ece 100644
--- a/xmloff/source/draw/shapeimport.cxx
+++ b/xmloff/source/draw/shapeimport.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: shapeimport.cxx,v $
*
- * $Revision: 1.16 $
+ * $Revision: 1.17 $
*
- * last change: $Author: cl $ $Date: 2000-12-01 19:19:53 $
+ * last change: $Author: cl $ $Date: 2000-12-05 23:24:20 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -151,17 +151,18 @@ XMLShapeImportHelper::XMLShapeImportHelper(
// construct PropertySetMapper
UniReference < XMLPropertySetMapper > xMapper = new XMLShapePropertySetMapper(mpSdPropHdlFactory);
mpPropertySetMapper = new SvXMLImportPropertyMapper( xMapper );
- if(mpPropertySetMapper)
+ // set lock to avoid deletion
+ mpPropertySetMapper->acquire();
+
+ if( pExtMapper )
{
- // set lock to avoid deletion
- mpPropertySetMapper->acquire();
- if( pExtMapper )
- {
- UniReference < SvXMLImportPropertyMapper > xExtMapper( pExtMapper );
- mpPropertySetMapper->ChainImportMapper( xExtMapper );
- }
+ UniReference < SvXMLImportPropertyMapper > xExtMapper( pExtMapper );
+ mpPropertySetMapper->ChainImportMapper( xExtMapper );
}
+ // chain text attributes
+ mpPropertySetMapper->ChainImportMapper(XMLTextImportHelper::CreateCharExtPropMapper());
+
// construct PresPagePropsMapper
xMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLSDPresPageProps, mpSdPropHdlFactory);
mpPresPagePropsMapper = new SvXMLImportPropertyMapper( xMapper );
diff --git a/xmloff/source/draw/ximp3dobject.hxx b/xmloff/source/draw/ximp3dobject.hxx
index 70d5f17f4adc..b8e1025b0f47 100644
--- a/xmloff/source/draw/ximp3dobject.hxx
+++ b/xmloff/source/draw/ximp3dobject.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ximp3dobject.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: aw $ $Date: 2000-12-01 13:14:07 $
+ * last change: $Author: cl $ $Date: 2000-12-05 23:25:00 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -66,8 +66,8 @@
#include "xmlictxt.hxx"
#endif
-#ifndef _SDXMLIMP_HXX
-#include "sdxmlimp.hxx"
+#ifndef _SDXMLIMP_IMPL_HXX
+#include "sdxmlimp_impl.hxx"
#endif
#ifndef _XMLOFF_NMSPMAP_HXX
diff --git a/xmloff/source/draw/ximp3dscene.hxx b/xmloff/source/draw/ximp3dscene.hxx
index be27c3a8d03d..7e75838ec89c 100644
--- a/xmloff/source/draw/ximp3dscene.hxx
+++ b/xmloff/source/draw/ximp3dscene.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ximp3dscene.hxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: aw $ $Date: 2000-11-30 18:06:00 $
+ * last change: $Author: cl $ $Date: 2000-12-05 23:25:00 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -66,8 +66,8 @@
#include "xmlictxt.hxx"
#endif
-#ifndef _SDXMLIMP_HXX
-#include "sdxmlimp.hxx"
+#ifndef _SDXMLIMP_IMPL_HXX
+#include "sdxmlimp_impl.hxx"
#endif
#ifndef _XMLOFF_NMSPMAP_HXX
diff --git a/xmloff/source/draw/ximpbody.hxx b/xmloff/source/draw/ximpbody.hxx
index e8f6efcc8eeb..86e58929381a 100644
--- a/xmloff/source/draw/ximpbody.hxx
+++ b/xmloff/source/draw/ximpbody.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ximpbody.hxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 17:07:03 $
+ * last change: $Author: cl $ $Date: 2000-12-05 23:25:41 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -66,8 +66,8 @@
#include "xmlictxt.hxx"
#endif
-#ifndef _SDXMLIMP_HXX
-#include "sdxmlimp.hxx"
+#ifndef _SDXMLIMP_IMPL_HXX
+#include "sdxmlimp_impl.hxx"
#endif
#ifndef _XMLOFF_NMSPMAP_HXX
diff --git a/xmloff/source/draw/ximpgrp.hxx b/xmloff/source/draw/ximpgrp.hxx
index 5c20cfa60d0d..1d9731016ec4 100644
--- a/xmloff/source/draw/ximpgrp.hxx
+++ b/xmloff/source/draw/ximpgrp.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ximpgrp.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: cl $ $Date: 2000-11-23 18:25:49 $
+ * last change: $Author: cl $ $Date: 2000-12-05 23:25:41 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -66,8 +66,8 @@
#include "xmlictxt.hxx"
#endif
-#ifndef _SDXMLIMP_HXX
-#include "sdxmlimp.hxx"
+#ifndef _SDXMLIMP_IMPL_HXX
+#include "sdxmlimp_impl.hxx"
#endif
#ifndef _XMLOFF_NMSPMAP_HXX
diff --git a/xmloff/source/draw/ximpnote.hxx b/xmloff/source/draw/ximpnote.hxx
index 7d97319c1877..6c512a618f22 100644
--- a/xmloff/source/draw/ximpnote.hxx
+++ b/xmloff/source/draw/ximpnote.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ximpnote.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: cl $ $Date: 2000-11-23 18:27:34 $
+ * last change: $Author: cl $ $Date: 2000-12-05 23:25:41 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -66,8 +66,8 @@
#include "xmlictxt.hxx"
#endif
-#ifndef _SDXMLIMP_HXX
-#include "sdxmlimp.hxx"
+#ifndef _SDXMLIMP_IMPL_HXX
+#include "sdxmlimp_impl.hxx"
#endif
#ifndef _XMLOFF_NMSPMAP_HXX
diff --git a/xmloff/source/draw/ximpshap.hxx b/xmloff/source/draw/ximpshap.hxx
index 92b632b5f782..927bf5fa841a 100644
--- a/xmloff/source/draw/ximpshap.hxx
+++ b/xmloff/source/draw/ximpshap.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ximpshap.hxx,v $
*
- * $Revision: 1.9 $
+ * $Revision: 1.10 $
*
- * last change: $Author: cl $ $Date: 2000-11-26 19:48:02 $
+ * last change: $Author: cl $ $Date: 2000-12-05 23:26:19 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -66,8 +66,8 @@
#include "xmlictxt.hxx"
#endif
-#ifndef _SDXMLIMP_HXX
-#include "sdxmlimp.hxx"
+#ifndef _SDXMLIMP_IMPL_HXX
+#include "sdxmlimp_impl.hxx"
#endif
#ifndef _XMLOFF_NMSPMAP_HXX
diff --git a/xmloff/source/draw/ximpstyl.hxx b/xmloff/source/draw/ximpstyl.hxx
index 2577a3783467..8fd3b72d676d 100644
--- a/xmloff/source/draw/ximpstyl.hxx
+++ b/xmloff/source/draw/ximpstyl.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ximpstyl.hxx,v $
*
- * $Revision: 1.2 $
+ * $Revision: 1.3 $
*
- * last change: $Author: aw $ $Date: 2000-11-27 12:52:59 $
+ * last change: $Author: cl $ $Date: 2000-12-05 23:26:19 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -66,8 +66,8 @@
#include "xmlictxt.hxx"
#endif
-#ifndef _SDXMLIMP_HXX
-#include "sdxmlimp.hxx"
+#ifndef _SDXMLIMP_IMPL_HXX
+#include "sdxmlimp_impl.hxx"
#endif
#ifndef _XIMPGROUP_HXX
@@ -153,6 +153,7 @@ class SdXMLMasterPageContext: public SdXMLGroupShapeContext
{
rtl::OUString msPageMasterName;
rtl::OUString msName;
+ rtl::OUString msStyleName;
const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); }
SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); }