diff options
author | Christian Lippka <cl@openoffice.org> | 2000-12-05 22:14:55 +0000 |
---|---|---|
committer | Christian Lippka <cl@openoffice.org> | 2000-12-05 22:14:55 +0000 |
commit | 855ff963319067df25afb5eab6e7668f690c1e54 (patch) | |
tree | d0eff9563422934e01d02016d8c666539a43251f | |
parent | 6370aa05b91c3df85c994126dcb48b094628a3f9 (diff) |
#80678# moved drawing page styles to auto styles and added styles to master pages
-rw-r--r-- | xmloff/source/draw/ximpbody.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/draw/ximpstyl.cxx | 62 |
2 files changed, 62 insertions, 6 deletions
diff --git a/xmloff/source/draw/ximpbody.cxx b/xmloff/source/draw/ximpbody.cxx index c9b5c99461ae..eab6ca47a471 100644 --- a/xmloff/source/draw/ximpbody.cxx +++ b/xmloff/source/draw/ximpbody.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ximpbody.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: cl $ $Date: 2000-11-23 18:24:00 $ + * last change: $Author: cl $ $Date: 2000-12-05 23:12:05 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -170,7 +170,7 @@ SdXMLDrawPageContext::SdXMLDrawPageContext( SdXMLImport& rImport, // set PageProperties? if(maStyleName.getLength()) { - const SvXMLImportContext* pContext = GetSdImport().GetShapeImport()->GetStylesContext(); + const SvXMLImportContext* pContext = GetSdImport().GetShapeImport()->GetAutoStylesContext(); if( pContext && pContext->ISA( SvXMLStyleContext ) ) { diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx index b27ffab8c681..cc189906ec8d 100644 --- a/xmloff/source/draw/ximpstyl.cxx +++ b/xmloff/source/draw/ximpstyl.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ximpstyl.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: aw $ $Date: 2000-12-05 15:44:41 $ + * last change: $Author: cl $ $Date: 2000-12-05 23:14:55 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -182,7 +182,7 @@ SdXMLPageMasterStyleContext::SdXMLPageMasterStyleContext( } case XML_TOK_PAGEMASTERSTYLE_PAGE_ORIENTATION: { - if(sValue.equals(OUString(RTL_CONSTASCII_USTRINGPARAM(sXML_orientation_portrait)))) + if(sValue.equals(OUString(RTL_CONSTASCII_USTRINGPARAM(sXML_portrait)))) meOrientation = view::PaperOrientation_PORTRAIT; else meOrientation = view::PaperOrientation_LANDSCAPE; @@ -593,6 +593,11 @@ SdXMLMasterPageContext::SdXMLMasterPageContext( msPageMasterName = sValue; break; } + case XML_TOK_MASTERPAGE_STYLE_NAME: + { + msStyleName = sValue; + break; + } } } @@ -663,6 +668,57 @@ SdXMLMasterPageContext::SdXMLMasterPageContext( } } + // set PageProperties? + if(msStyleName.getLength()) + { + const SvXMLImportContext* pContext = GetSdImport().GetShapeImport()->GetAutoStylesContext(); + + if( pContext && pContext->ISA( SvXMLStyleContext ) ) + { + const SdXMLStylesContext* pStyles = (SdXMLStylesContext*)pContext; + if(pStyles) + { + const SvXMLStyleContext* pStyle = pStyles->FindStyleChildContext( + XML_STYLE_FAMILY_SD_DRAWINGPAGE_ID, msStyleName); + + if(pStyle && pStyle->ISA(XMLPropStyleContext)) + { + XMLPropStyleContext* pPropStyle = (XMLPropStyleContext*)pStyle; + + uno::Reference <beans::XPropertySet> xPropSet1(rShapes, uno::UNO_QUERY); + if(xPropSet1.is()) + { + 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::Reference< lang::XMultiServiceFactory > xServiceFact(GetSdImport().GetModel(), uno::UNO_QUERY); + if(xServiceFact.is()) + { + uno::Reference< beans::XPropertySet > xTempSet( + xServiceFact->createInstance( + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.Background"))), + uno::UNO_QUERY); + + xPropSet2 = xTempSet; + } + } + + if(xPropSet2.is()) + { + pPropStyle->FillPropertySet(xPropSet2); + + uno::Any aAny; + aAny <<= xPropSet2; + xPropSet1->setPropertyValue( aBackground, aAny ); + } + } + } + } + } + } + // now delete all up-to-now contained shapes. while(rShapes->getCount()) { |