summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2004-03-30 15:17:06 +0000
committerRüdiger Timm <rt@openoffice.org>2004-03-30 15:17:06 +0000
commit4aa4f461a58bc71f2a39608a46970484e902e82a (patch)
tree8b9cdc0abaa017f308937612a817171670441119 /xmloff
parent142997752bb6b58dcd4c5700dd3c4ac59061697e (diff)
INTEGRATION: CWS interop12 (1.37.82); FILE MERGED
2004/03/05 14:21:51 cl 1.37.82.2: #i26079# save header&footer also for handout and notes 2003/10/30 11:00:22 cl 1.37.82.1: #i20949# added header&footer support for impress
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/draw/ximpstyl.cxx109
1 files changed, 44 insertions, 65 deletions
diff --git a/xmloff/source/draw/ximpstyl.cxx b/xmloff/source/draw/ximpstyl.cxx
index e5e80df4ac34..9327a4aa774e 100644
--- a/xmloff/source/draw/ximpstyl.cxx
+++ b/xmloff/source/draw/ximpstyl.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ximpstyl.cxx,v $
*
- * $Revision: 1.37 $
+ * $Revision: 1.38 $
*
- * last change: $Author: hr $ $Date: 2003-03-27 18:20:18 $
+ * last change: $Author: rt $ $Date: 2004-03-30 16:17:06 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -266,6 +266,8 @@ public:
sal_uInt16 nPrefix,
const ::rtl::OUString& rLocalName,
const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
+
+ virtual void Finish( sal_Bool bOverwrite );
};
TYPEINIT1( SdXMLDrawingPageStyleContext, XMLPropStyleContext );
@@ -311,6 +313,45 @@ SvXMLImportContext *SdXMLDrawingPageStyleContext::CreateChildContext(
return pContext;
}
+void SdXMLDrawingPageStyleContext::Finish( sal_Bool bOverwrite )
+{
+ XMLPropStyleContext::Finish( bOverwrite );
+
+ ::std::vector< XMLPropertyState > &rProperties = GetProperties();
+
+ const UniReference< XMLPropertySetMapper >& rImpPrMap = GetStyles()->GetImportPropertyMapper( GetFamily() )->getPropertySetMapper();
+
+ ::std::vector< XMLPropertyState >::iterator property = rProperties.begin();
+ for (property; property != rProperties.end(); property++)
+ {
+ if( property->mnIndex == -1 )
+ continue;
+
+ sal_Int16 nContextID = rImpPrMap->GetEntryContextId(property->mnIndex);
+ switch( nContextID )
+ {
+ case CTF_DATE_TIME_FORMAT:
+ {
+ OUString sStyleName;
+ (*property).maValue >>= sStyleName;
+
+ sal_Int32 nStyle = 0;
+
+ SdXMLNumberFormatImportContext* pSdNumStyle =
+ PTR_CAST( SdXMLNumberFormatImportContext,
+ GetStyles()->FindStyleChildContext( XML_STYLE_FAMILY_DATA_STYLE, sStyleName, sal_True ) );
+
+ if( pSdNumStyle )
+ nStyle = pSdNumStyle->GetDrawKey();
+
+ (*property).maValue <<= nStyle;
+ }
+ break;
+ }
+ }
+
+}
+
//////////////////////////////////////////////////////////////////////////////
TYPEINIT1( SdXMLPageMasterStyleContext, SvXMLStyleContext );
@@ -850,69 +891,7 @@ SdXMLMasterPageContext::SdXMLMasterPageContext(
SetPageMaster( msPageMasterName );
}
- // set PageProperties?
- if(!bHandoutMaster && 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;
- }
- }
-
- uno::Reference< beans::XPropertySet > xPropSet;
- if( xPropSet2.is() )
- xPropSet = PropertySetMerger_CreateInstance( xPropSet1, xPropSet2 );
- else
- xPropSet = xPropSet1;
-
- if(xPropSet.is())
- {
- try
- {
- pPropStyle->FillPropertySet(xPropSet);
-
- uno::Any aAny;
- aAny <<= xPropSet2;
- xPropSet1->setPropertyValue( aBackground, aAny );
- }
- catch( uno::Exception )
- {
- DBG_ERROR( "uno::Exception catched!" );
- }
- }
- }
- }
- }
- }
- }
+ SetStyle( msStyleName );
SetLayout();