diff options
author | Christian Lippka <cl@openoffice.org> | 2001-05-28 12:32:20 +0000 |
---|---|---|
committer | Christian Lippka <cl@openoffice.org> | 2001-05-28 12:32:20 +0000 |
commit | 39323309c1e60c8d7807d890a90afe7e2911260f (patch) | |
tree | 147f1bd3401b175caf422820134b274581aac160 /xmloff/source/draw | |
parent | dbefe139e67c1a6a8b9093e8abd24fcd437b5711 (diff) |
#86971# added style:handout-master
Diffstat (limited to 'xmloff/source/draw')
-rw-r--r-- | xmloff/source/draw/sdxmlexp.cxx | 72 | ||||
-rw-r--r-- | xmloff/source/draw/sdxmlexp_impl.hxx | 5 | ||||
-rw-r--r-- | xmloff/source/draw/sdxmlimp.cxx | 11 | ||||
-rw-r--r-- | xmloff/source/draw/sdxmlimp_impl.hxx | 7 | ||||
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 29 | ||||
-rw-r--r-- | xmloff/source/draw/ximpbody.cxx | 62 | ||||
-rw-r--r-- | xmloff/source/draw/ximpbody.hxx | 8 | ||||
-rw-r--r-- | xmloff/source/draw/ximpnote.hxx | 7 | ||||
-rw-r--r-- | xmloff/source/draw/ximppage.cxx | 84 | ||||
-rw-r--r-- | xmloff/source/draw/ximppage.hxx | 15 | ||||
-rw-r--r-- | xmloff/source/draw/ximpshap.cxx | 34 | ||||
-rw-r--r-- | xmloff/source/draw/ximpstyl.cxx | 68 | ||||
-rw-r--r-- | xmloff/source/draw/ximpstyl.hxx | 7 |
13 files changed, 270 insertions, 139 deletions
diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index 116211a09219..2a80d9bcde8d 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: sdxmlexp.cxx,v $ * - * $Revision: 1.66 $ + * $Revision: 1.67 $ * - * last change: $Author: cl $ $Date: 2001-05-22 10:25:06 $ + * last change: $Author: cl $ $Date: 2001-05-28 13:32:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -125,6 +125,10 @@ #include <com/sun/star/drawing/XMasterPagesSupplier.hpp> #endif +#ifndef _COM_SUN_STAR_PRESENTATION_XHANDOUTMASTERSUPPLIER_HPP_ +#include <com/sun/star/presentation/XHandoutMasterSupplier.hpp> +#endif + #ifndef _COM_SUN_STAR_VIEW_PAPERORIENTATION_HPP_ #include <com/sun/star/view/PaperOrientation.hpp> #endif @@ -645,7 +649,7 @@ void SAL_CALL SdXMLExport::setSourceDocument( const uno::Reference< lang::XCompo mnDocDrawPageCount = mxDocDrawPages->getCount(); maDrawPagesStyleNames.insert( maDrawPagesStyleNames.begin(), mnDocDrawPageCount, aEmpty ); if( !mbIsDraw ) - maDrawPagesAutoLayoutNames.realloc( mnDocDrawPageCount ); + maDrawPagesAutoLayoutNames.realloc( mnDocDrawPageCount + 1 ); } } @@ -860,6 +864,19 @@ void SdXMLExport::ImpPrepAutoLayoutInfos() { if(IsImpress()) { + OUString aStr; + + uno::Reference< presentation::XHandoutMasterSupplier > xHandoutSupp( GetModel(), uno::UNO_QUERY ); + if( xHandoutSupp.is() ) + { + uno::Reference< drawing::XDrawPage > xHandoutPage( xHandoutSupp->getHandoutMasterPage() ); + if( xHandoutPage.is() ) + { + if(ImpPrepAutoLayoutInfo(xHandoutPage, aStr)) + maDrawPagesAutoLayoutNames[0] = aStr; + } + } + // prepare name creation for(sal_Int32 nCnt = 0L; nCnt < mnDocDrawPageCount; nCnt++) { @@ -868,9 +885,8 @@ void SdXMLExport::ImpPrepAutoLayoutInfos() if((aAny >>= xDrawPage) && xDrawPage.is()) { - OUString aStr; if(ImpPrepAutoLayoutInfo(xDrawPage, aStr)) - maDrawPagesAutoLayoutNames[nCnt] = aStr; + maDrawPagesAutoLayoutNames[nCnt+1] = aStr; } } } @@ -1688,9 +1704,9 @@ void SdXMLExport::_ExportContent() } // presentation:page-layout-name - if( IsImpress() && maDrawPagesAutoLayoutNames[nPageInd].getLength()) + if( IsImpress() && maDrawPagesAutoLayoutNames[nPageInd+1].getLength()) { - AddAttribute(XML_NAMESPACE_PRESENTATION, sXML_presentation_page_layout_name, maDrawPagesAutoLayoutNames[nPageInd]); + AddAttribute(XML_NAMESPACE_PRESENTATION, sXML_presentation_page_layout_name, maDrawPagesAutoLayoutNames[nPageInd+1]); } // write page @@ -2017,6 +2033,22 @@ void SdXMLExport::_ExportAutoStyles() if( getExportFlags() & EXPORT_STYLES ) { + // create auto style infos for shapes on master handout page + if( IsImpress() ) + { + uno::Reference< presentation::XHandoutMasterSupplier > xHandoutSupp( GetModel(), uno::UNO_QUERY ); + if( xHandoutSupp.is() ) + { + uno::Reference< drawing::XDrawPage > xHandoutPage( xHandoutSupp->getHandoutMasterPage() ); + if( xHandoutPage.is() ) + { + uno::Reference< drawing::XShapes > xShapes(xHandoutPage, uno::UNO_QUERY); + if(xShapes.is() && xShapes->getCount()) + GetShapeExport()->collectShapesAutoStyles( xShapes ); + } + } + } + // create auto style infos for objects on master pages for(sal_Int32 nMPageId(0L); nMPageId < mnDocMasterPageCount; nMPageId++) { @@ -2143,6 +2175,32 @@ void SdXMLExport::_ExportMasterStyles() // export layer SdXMLayerExporter::exportLayer( *this ); + // export handout master page if impress + if( IsImpress() ) + { + uno::Reference< presentation::XHandoutMasterSupplier > xHandoutSupp( GetModel(), uno::UNO_QUERY ); + if( xHandoutSupp.is() ) + { + uno::Reference< drawing::XDrawPage > xHandoutPage( xHandoutSupp->getHandoutMasterPage() ); + if( xHandoutPage.is() ) + { + // presentation:page-layout-name + if( IsImpress() && maDrawPagesAutoLayoutNames[0].getLength()) + { + AddAttribute(XML_NAMESPACE_PRESENTATION, sXML_presentation_page_layout_name, maDrawPagesAutoLayoutNames[0]); + } + + // write masterpage + SvXMLElementExport aMPG(*this, XML_NAMESPACE_STYLE, sXML_handout_master, sal_True, sal_True); + + // write graphic objects on this master page (if any) + uno::Reference< drawing::XShapes > xShapes(xHandoutPage, uno::UNO_QUERY); + if(xShapes.is() && xShapes->getCount()) + GetShapeExport()->exportShapes( xShapes ); + } + } + } + // export MasterPages in master-styles section for(sal_Int32 nMPageId = 0L; nMPageId < mnDocMasterPageCount; nMPageId++) { diff --git a/xmloff/source/draw/sdxmlexp_impl.hxx b/xmloff/source/draw/sdxmlexp_impl.hxx index 9f1c3d1960f1..e62f770f867b 100644 --- a/xmloff/source/draw/sdxmlexp_impl.hxx +++ b/xmloff/source/draw/sdxmlexp_impl.hxx @@ -2,9 +2,9 @@ * * $RCSfile: sdxmlexp_impl.hxx,v $ * - * $Revision: 1.17 $ + * $Revision: 1.18 $ * - * last change: $Author: aw $ $Date: 2001-05-14 14:42:46 $ + * last change: $Author: cl $ $Date: 2001-05-28 13:32:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -145,6 +145,7 @@ class SdXMLExport : public SvXMLExport ImpXMLAutoLayoutInfoList* mpAutoLayoutInfoList; com::sun::star::uno::Sequence< ::rtl::OUString > maDrawPagesAutoLayoutNames; + ::std::vector< ::rtl::OUString > maDrawPagesStyleNames; ::std::vector< ::rtl::OUString > maMasterPagesStyleNames; diff --git a/xmloff/source/draw/sdxmlimp.cxx b/xmloff/source/draw/sdxmlimp.cxx index 3e9fe68044ea..d35f29e46087 100644 --- a/xmloff/source/draw/sdxmlimp.cxx +++ b/xmloff/source/draw/sdxmlimp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: sdxmlimp.cxx,v $ * - * $Revision: 1.19 $ + * $Revision: 1.20 $ * - * last change: $Author: cl $ $Date: 2001-05-09 14:40:42 $ + * last change: $Author: cl $ $Date: 2001-05-28 13:32:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -184,9 +184,10 @@ static __FAR_DATA SvXMLTokenMapEntry aMasterPageElemTokenMap[] = 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_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_NAMESPACE_PRESENTATION, sXML_presentation_page_layout_name, XML_TOK_MASTERPAGE_PAGE_LAYOUT_NAME }, XML_TOKEN_MAP_END }; diff --git a/xmloff/source/draw/sdxmlimp_impl.hxx b/xmloff/source/draw/sdxmlimp_impl.hxx index 4343b747c9fe..1cd456787fc8 100644 --- a/xmloff/source/draw/sdxmlimp_impl.hxx +++ b/xmloff/source/draw/sdxmlimp_impl.hxx @@ -2,9 +2,9 @@ * * $RCSfile: sdxmlimp_impl.hxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: cl $ $Date: 2001-05-09 14:40:42 $ + * last change: $Author: cl $ $Date: 2001-05-28 13:32:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -135,7 +135,8 @@ enum SdXMLMasterPageAttrTokenMap { XML_TOK_MASTERPAGE_NAME, XML_TOK_MASTERPAGE_PAGE_MASTER_NAME, - XML_TOK_MASTERPAGE_STYLE_NAME + XML_TOK_MASTERPAGE_STYLE_NAME, + XML_TOK_MASTERPAGE_PAGE_LAYOUT_NAME }; enum SdXMLPageMasterAttrTokenMap diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 52db9a4cbb0e..2cce5f95232f 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -2,9 +2,9 @@ * * $RCSfile: shapeexport.cxx,v $ * - * $Revision: 1.25 $ + * $Revision: 1.26 $ * - * last change: $Author: aw $ $Date: 2001-05-14 14:43:26 $ + * last change: $Author: cl $ $Date: 2001-05-28 13:32:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -419,17 +419,22 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape // -------------------------- if( IsLayerExportEnabled() ) { - try + // check for group or scene shape and not export layer if this is one + uno::Reference< drawing::XShapes > xShapes( xShape, uno::UNO_QUERY ); + if( !xShapes.is() ) { - uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY ); - OUString aLayerName; - xProps->getPropertyValue( OUString::createFromAscii( "LayerName" ) ) >>= aLayerName; - rExport.AddAttribute(XML_NAMESPACE_DRAW, sXML_layer, aLayerName ); + try + { + uno::Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY ); + OUString aLayerName; + xProps->getPropertyValue( OUString::createFromAscii( "LayerName" ) ) >>= aLayerName; + rExport.AddAttribute(XML_NAMESPACE_DRAW, sXML_layer, aLayerName ); - } - catch( uno::Exception e ) - { - DBG_ERROR( "could not export layer name for shape!" ); + } + catch( uno::Exception e ) + { + DBG_ERROR( "could not export layer name for shape!" ); + } } } @@ -526,6 +531,7 @@ void XMLShapeExport::exportShape(const uno::Reference< drawing::XShape >& xShape case XmlShapeTypeDrawPageShape: case XmlShapeTypePresPageShape: + case XmlShapeTypeHandoutShape: { ImpExportPageShape(xShape, aShapeInfo.meShapeType, nFeatures, pRefPoint ); break; @@ -821,6 +827,7 @@ void XMLShapeExport::ImpCalcShapeType(const uno::Reference< drawing::XShape >& x else if(aType.EqualsAscii("Table", 26, 5)) { eShapeType = XmlShapeTypePresTableShape; } else if(aType.EqualsAscii("OrgChart", 26, 8)) { eShapeType = XmlShapeTypePresOrgChartShape; } else if(aType.EqualsAscii("Notes", 26, 5)) { eShapeType = XmlShapeTypePresNotesShape; } + else if(aType.EqualsAscii("HandoutShape", 26, 12)) { eShapeType = XmlShapeTypeHandoutShape; } } } } diff --git a/xmloff/source/draw/ximpbody.cxx b/xmloff/source/draw/ximpbody.cxx index c997e3597555..fc3e02b1955b 100644 --- a/xmloff/source/draw/ximpbody.cxx +++ b/xmloff/source/draw/ximpbody.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ximpbody.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: cl $ $Date: 2001-04-18 07:48:51 $ + * last change: $Author: cl $ $Date: 2001-05-28 13:32:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -296,63 +296,9 @@ SdXMLDrawPageContext::SdXMLDrawPageContext( SdXMLImport& rImport, } } - // set PresentationPageLayout? - if(GetSdImport().IsImpress() && maPageLayoutName.getLength()) - { - sal_Int32 nType = -1; - - const SvXMLImportContext* pContext = GetSdImport().GetShapeImport()->GetStylesContext(); - - if( pContext && pContext->ISA( SvXMLStyleContext ) ) - { - const SdXMLStylesContext* pStyles = (SdXMLStylesContext*)pContext; - if(pStyles) - { - const SvXMLStyleContext* pStyle = pStyles->FindStyleChildContext( XML_STYLE_FAMILY_SD_PRESENTATIONPAGELAYOUT_ID, maPageLayoutName); + SetLayout(); - if(pStyle && pStyle->ISA(SdXMLPresentationPageLayoutContext)) - { - SdXMLPresentationPageLayoutContext* pLayout = (SdXMLPresentationPageLayoutContext*)pStyle; - nType = pLayout->GetTypeId(); - } - } - - } - if( -1 == nType ) - { - uno::Reference< container::XNameAccess > xPageLayouts( GetSdImport().getPageLayouts() ); - if( xPageLayouts.is() ) - { - if( xPageLayouts->hasByName( maPageLayoutName ) ) - xPageLayouts->getByName( maPageLayoutName ) >>= nType; - } - - } - - if( -1 != nType ) - { - uno::Reference <beans::XPropertySet> xPropSet(rShapes, uno::UNO_QUERY); - if(xPropSet.is()) - { - xPropSet->setPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("Layout")), uno::makeAny( (sal_Int16)nType ) ); - } - } - } - - // now delete all up-to-now contained shapes; they have been created - // when setting the presentation page layout. - while(rShapes->getCount()) - { - uno::Reference< drawing::XShape > xShape; - uno::Any aAny(rShapes->getByIndex(0L)); - - aAny >>= xShape; - - if(xShape.is()) - { - rShapes->remove(xShape); - } - } + DeleteAllShapes(); } ////////////////////////////////////////////////////////////////////////////// diff --git a/xmloff/source/draw/ximpbody.hxx b/xmloff/source/draw/ximpbody.hxx index 46c7af6eaa0e..6f1cedd7fa27 100644 --- a/xmloff/source/draw/ximpbody.hxx +++ b/xmloff/source/draw/ximpbody.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ximpbody.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: cl $ $Date: 2000-12-13 19:13:03 $ + * last change: $Author: cl $ $Date: 2001-05-28 13:32:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -86,10 +86,6 @@ class SdXMLDrawPageContext : public SdXMLGenericPageContext rtl::OUString maName; rtl::OUString maStyleName; rtl::OUString maMasterPageName; - rtl::OUString maPageLayoutName; - - const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); } - SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); } public: SdXMLDrawPageContext( SdXMLImport& rImport, USHORT nPrfx, diff --git a/xmloff/source/draw/ximpnote.hxx b/xmloff/source/draw/ximpnote.hxx index 798b6e07eba5..20bf7eeaae5d 100644 --- a/xmloff/source/draw/ximpnote.hxx +++ b/xmloff/source/draw/ximpnote.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ximpnote.hxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: cl $ $Date: 2001-04-18 07:48:51 $ + * last change: $Author: cl $ $Date: 2001-05-28 13:32:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,9 +83,6 @@ class SdXMLNotesContext : public SdXMLGenericPageContext { - const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); } - SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); } - public: SdXMLNotesContext( SdXMLImport& rImport, USHORT nPrfx, const rtl::OUString& rLocalName, diff --git a/xmloff/source/draw/ximppage.cxx b/xmloff/source/draw/ximppage.cxx index 01b349ed8097..cc400362132c 100644 --- a/xmloff/source/draw/ximppage.cxx +++ b/xmloff/source/draw/ximppage.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ximppage.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: thb $ $Date: 2001-04-26 18:04:11 $ + * last change: $Author: cl $ $Date: 2001-05-28 13:32:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -63,6 +63,10 @@ #include "xmlkywd.hxx" +#ifndef _XMLOFF_XMLSTYLE_HXX +#include "xmlstyle.hxx" +#endif + #ifndef _XMLOFF_XMLNMSPE_HXX #include "xmlnmspe.hxx" #endif @@ -83,6 +87,14 @@ #include "formsimp.hxx" #endif +#ifndef _XMLOFF_XMLICTXT_HXX +#include "xmlictxt.hxx" +#endif + +#ifndef _XIMPSTYLE_HXX +#include "ximpstyl.hxx" +#endif + using namespace ::rtl; using namespace ::com::sun::star; @@ -156,3 +168,71 @@ void SdXMLGenericPageContext::EndElement() if( GetImport().IsFormsSupported() ) GetImport().GetFormImport()->endPage(); } + +void SdXMLGenericPageContext::SetLayout() +{ + // set PresentationPageLayout? + if(GetSdImport().IsImpress() && maPageLayoutName.getLength()) + { + sal_Int32 nType = -1; + + const SvXMLImportContext* pContext = GetSdImport().GetShapeImport()->GetStylesContext(); + + if( pContext && pContext->ISA( SvXMLStyleContext ) ) + { + const SdXMLStylesContext* pStyles = (SdXMLStylesContext*)pContext; + if(pStyles) + { + const SvXMLStyleContext* pStyle = pStyles->FindStyleChildContext( XML_STYLE_FAMILY_SD_PRESENTATIONPAGELAYOUT_ID, maPageLayoutName); + + if(pStyle && pStyle->ISA(SdXMLPresentationPageLayoutContext)) + { + SdXMLPresentationPageLayoutContext* pLayout = (SdXMLPresentationPageLayoutContext*)pStyle; + nType = pLayout->GetTypeId(); + } + } + + } + if( -1 == nType ) + { + uno::Reference< container::XNameAccess > xPageLayouts( GetSdImport().getPageLayouts() ); + if( xPageLayouts.is() ) + { + if( xPageLayouts->hasByName( maPageLayoutName ) ) + xPageLayouts->getByName( maPageLayoutName ) >>= nType; + } + + } + + if( -1 != nType ) + { + uno::Reference <beans::XPropertySet> xPropSet(mxShapes, uno::UNO_QUERY); + if(xPropSet.is()) + { + OUString aPropName(RTL_CONSTASCII_USTRINGPARAM("Layout")); + uno::Reference< beans::XPropertySetInfo > xInfo( xPropSet->getPropertySetInfo() ); + if( xInfo.is() && xInfo->hasPropertyByName( aPropName ) ) + xPropSet->setPropertyValue(aPropName, uno::makeAny( (sal_Int16)nType ) ); + } + } + } +} + +void SdXMLGenericPageContext::DeleteAllShapes() +{ + // now delete all up-to-now contained shapes; they have been created + // when setting the presentation page layout. + while(mxShapes->getCount()) + { + uno::Reference< drawing::XShape > xShape; + uno::Any aAny(mxShapes->getByIndex(0L)); + + aAny >>= xShape; + + if(xShape.is()) + { + mxShapes->remove(xShape); + } + } +} + diff --git a/xmloff/source/draw/ximppage.hxx b/xmloff/source/draw/ximppage.hxx index 9b627ef9f089..ef5e97a6ac7a 100644 --- a/xmloff/source/draw/ximppage.hxx +++ b/xmloff/source/draw/ximppage.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ximppage.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: cl $ $Date: 2001-01-25 12:48:39 $ + * last change: $Author: cl $ $Date: 2001-05-28 13:32:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -95,9 +95,20 @@ class SdXMLGenericPageContext : public SvXMLImportContext com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > mxShapes; protected: + rtl::OUString maPageLayoutName; + void SetLocalShapesContext(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >& rNew) { mxShapes = rNew; } + /** sets the presentation layout at this page. It is used for drawing pages and for the handout master */ + void SetLayout(); + + /** deletes all shapes on this drawing page */ + void DeleteAllShapes(); + + const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); } + SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); } + public: TYPEINFO(); diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index ef25f7100112..d56bd48a4773 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ximpshap.cxx,v $ * - * $Revision: 1.46 $ + * $Revision: 1.47 $ * - * last change: $Author: aw $ $Date: 2001-05-16 10:31:58 $ + * last change: $Author: cl $ $Date: 2001-05-28 13:32:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -111,6 +111,10 @@ #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> #endif +#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_ +#include <com/sun/star/lang/XServiceInfo.hpp> +#endif + #ifndef _XEXPTRANSFORM_HXX #include "xexptran.hxx" #endif @@ -1595,19 +1599,29 @@ void SdXMLPageShapeContext::StartElement(const uno::Reference< xml::sax::XAttrib // be constructed. It's an pres shape if presentation:sXML_class == sXML_presentation_page. sal_Bool bIsPresentation(maPresentationClass.getLength() != 0); - if(bIsPresentation - && !maPresentationClass.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sXML_presentation_page))) - { - bIsPresentation = FALSE; - } + uno::Reference< lang::XServiceInfo > xInfo( mxShapes, uno::UNO_QUERY ); + const sal_Bool bIsOnHandoutPage = xInfo.is() && xInfo->supportsService( OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.presentation.HandoutMasterPage")) ); - if(bIsPresentation) + if( bIsOnHandoutPage ) { - AddShape("com.sun.star.presentation.PageShape"); + AddShape("com.sun.star.presentation.HandoutShape"); } else { - AddShape("com.sun.star.drawing.PageShape"); + if(bIsPresentation + && !maPresentationClass.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sXML_presentation_page))) + { + bIsPresentation = FALSE; + } + + if(bIsPresentation) + { + AddShape("com.sun.star.presentation.PageShape"); + } + else + { + AddShape("com.sun.star.drawing.PageShape"); + } } if(mxShape.is()) diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx index 6dd5f2a5346e..7da85554f85f 100644 --- a/xmloff/source/draw/ximpstyl.cxx +++ b/xmloff/source/draw/ximpstyl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ximpstyl.cxx,v $ * - * $Revision: 1.28 $ + * $Revision: 1.29 $ * - * last change: $Author: cl $ $Date: 2001-05-09 14:40:42 $ + * last change: $Author: cl $ $Date: 2001-05-28 13:32:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -113,6 +113,10 @@ #include <comphelper/namecontainer.hxx> #endif +#ifndef _COM_SUN_STAR_PRESENTATION_XHANDOUTMASTERSUPPLIER_HPP_ +#include <com/sun/star/presentation/XHandoutMasterSupplier.hpp> +#endif + #ifndef _XMLOFF_XMLPROPERTYSETCONTEXT_HXX #include "xmlprcon.hxx" #endif @@ -523,16 +527,23 @@ void SdXMLPresentationPageLayoutContext::EndElement() SdXMLPresentationPlaceholderContext* pObj0 = maList.GetObject(0); if(pObj0->GetName().equals(OUString(RTL_CONSTASCII_USTRINGPARAM("handout")))) { - if(maList.Count() == 1) + switch( maList.Count() ) + { + case 1: mnTypeId = 22; // AUTOLAYOUT_HANDOUT1 - if(maList.Count() == 2) + break; + case 2: mnTypeId = 23; // AUTOLAYOUT_HANDOUT2 - if(maList.Count() == 3) + break; + case 3: mnTypeId = 24; // AUTOLAYOUT_HANDOUT3 - if(maList.Count() == 4) + break; + case 4: mnTypeId = 25; // AUTOLAYOUT_HANDOUT4 - else + break; + default: mnTypeId = 26; // AUTOLAYOUT_HANDOUT6 + } } else { @@ -774,7 +785,9 @@ SdXMLMasterPageContext::SdXMLMasterPageContext( uno::Reference< drawing::XShapes >& rShapes) : SdXMLGenericPageContext( rImport, nPrfx, rLName, xAttrList, rShapes ) { - sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; + const sal_Bool bHandoutMaster = rLName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM(sXML_handout_master)); + + const sal_Int16 nAttrCount = xAttrList.is() ? xAttrList->getLength() : 0; for(sal_Int16 i=0; i < nAttrCount; i++) { OUString sAttrName = xAttrList->getNameByIndex( i ); @@ -800,11 +813,16 @@ SdXMLMasterPageContext::SdXMLMasterPageContext( msStyleName = sValue; break; } + case XML_TOK_MASTERPAGE_PAGE_LAYOUT_NAME: + { + maPageLayoutName = sValue; + break; + } } } // set page name? - if(msName.getLength() && GetLocalShapesContext().is()) + if(!bHandoutMaster && msName.getLength() && GetLocalShapesContext().is()) { uno::Reference < container::XNamed > xNamed(GetLocalShapesContext(), uno::UNO_QUERY); if(xNamed.is()) @@ -812,7 +830,7 @@ SdXMLMasterPageContext::SdXMLMasterPageContext( } // set page-master? - if(msPageMasterName.getLength() && GetSdImport().GetShapeImport()->GetStylesContext()) + if(!bHandoutMaster && msPageMasterName.getLength() && GetSdImport().GetShapeImport()->GetStylesContext()) { // look for PageMaster with this name @@ -871,7 +889,7 @@ SdXMLMasterPageContext::SdXMLMasterPageContext( } // set PageProperties? - if(msStyleName.getLength()) + if(!bHandoutMaster && msStyleName.getLength()) { const SvXMLImportContext* pContext = GetSdImport().GetShapeImport()->GetAutoStylesContext(); @@ -934,19 +952,9 @@ SdXMLMasterPageContext::SdXMLMasterPageContext( } } - // now delete all up-to-now contained shapes. - while(rShapes->getCount()) - { - uno::Reference< drawing::XShape > xShape; - uno::Any aAny(rShapes->getByIndex(0L)); - - aAny >>= xShape; + SetLayout(); - if(xShape.is()) - { - rShapes->remove(xShape); - } - } + DeleteAllShapes(); } ////////////////////////////////////////////////////////////////////////////// @@ -1539,6 +1547,20 @@ SvXMLImportContext* SdXMLMasterStylesContext::CreateChildContext( } } } + else if(nPrefix == XML_NAMESPACE_STYLE + && rLocalName.equals(OUString(RTL_CONSTASCII_USTRINGPARAM(sXML_handout_master)))) + { + uno::Reference< presentation::XHandoutMasterSupplier > xHandoutSupp( GetSdImport().GetModel(), uno::UNO_QUERY ); + if( xHandoutSupp.is() ) + { + uno::Reference< drawing::XShapes > xHandoutPage( xHandoutSupp->getHandoutMasterPage(), uno::UNO_QUERY ); + if(xHandoutPage.is() && GetSdImport().GetShapeImport()->GetStylesContext()) + { + pContext = new SdXMLMasterPageContext(GetSdImport(), + nPrefix, rLocalName, xAttrList, xHandoutPage); + } + } + } else if( nPrefix == XML_NAMESPACE_DRAW && rLocalName.equals(OUString(RTL_CONSTASCII_USTRINGPARAM(sXML_layer_set)))) { diff --git a/xmloff/source/draw/ximpstyl.hxx b/xmloff/source/draw/ximpstyl.hxx index 864f9dac75e4..62cd4bafe286 100644 --- a/xmloff/source/draw/ximpstyl.hxx +++ b/xmloff/source/draw/ximpstyl.hxx @@ -2,9 +2,9 @@ * * $RCSfile: ximpstyl.hxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: cl $ $Date: 2001-03-20 20:05:50 $ + * last change: $Author: cl $ $Date: 2001-05-28 13:32:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -155,9 +155,6 @@ class SdXMLMasterPageContext: public SdXMLGenericPageContext rtl::OUString msName; rtl::OUString msStyleName; - const SdXMLImport& GetSdImport() const { return (const SdXMLImport&)GetImport(); } - SdXMLImport& GetSdImport() { return (SdXMLImport&)GetImport(); } - public: TYPEINFO(); |