diff options
author | Daniel Rentz <dr@openoffice.org> | 2000-10-23 08:57:51 +0000 |
---|---|---|
committer | Daniel Rentz <dr@openoffice.org> | 2000-10-23 08:57:51 +0000 |
commit | 791deca16049774f9ff18ec37146597c76e62339 (patch) | |
tree | 05eb577ab6a3b5f70e5d9487345357c407de00f8 /xmloff/source/style | |
parent | ce9caa96ecb1b36d53b039d855bcee55a04e0985 (diff) |
add: calc specific page-master attributes
Diffstat (limited to 'xmloff/source/style')
-rw-r--r-- | xmloff/source/style/PageMasterPropHdlFactory.cxx | 20 | ||||
-rw-r--r-- | xmloff/source/style/PageMasterPropMapper.cxx | 34 | ||||
-rw-r--r-- | xmloff/source/style/PageMasterStyleMap.cxx | 10 |
3 files changed, 47 insertions, 17 deletions
diff --git a/xmloff/source/style/PageMasterPropHdlFactory.cxx b/xmloff/source/style/PageMasterPropHdlFactory.cxx index 0d6b88dc8e90..bb303cf6af99 100644 --- a/xmloff/source/style/PageMasterPropHdlFactory.cxx +++ b/xmloff/source/style/PageMasterPropHdlFactory.cxx @@ -2,9 +2,9 @@ * * $RCSfile: PageMasterPropHdlFactory.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: dr $ $Date: 2000-10-20 16:30:27 $ + * last change: $Author: dr $ $Date: 2000-10-23 09:53:27 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -72,6 +72,9 @@ #ifndef _XMLOFF_PROPERTYHANDLER_BASICTYPES_HXX #include "xmlbahdl.hxx" #endif +#ifndef _XMLOFF_NAMEDBOOLPROPERTYHANDLER_HXX +#include "NamedBoolPropertyHdl.hxx" +#endif #ifndef _XMLOFF_PAGEMASTERPROPHDL_HXX_ #include "PageMasterPropHdl.hxx" @@ -81,6 +84,8 @@ #endif +using namespace ::rtl; + //______________________________________________________________________________ XMLPageMasterPropHdlFactory::XMLPageMasterPropHdlFactory() : @@ -114,7 +119,9 @@ const XMLPropertyHandler* XMLPageMasterPropHdlFactory::GetPropertyHandler( sal_I pHdl = new XMLPMPropHdl_PaperTrayNumber(); break; case XML_PM_TYPE_PRINTORIENTATION: - pHdl = new XMLBoolValuesPropHdl( sXML_landscape, sXML_portrait ); + pHdl = new XMLNamedBoolPropertyHdl( + OUString( RTL_CONSTASCII_USTRINGPARAM( sXML_landscape ) ), + OUString( RTL_CONSTASCII_USTRINGPARAM( sXML_portrait ) ) ); break; case XML_PM_TYPE_PRINTANNOTATIONS: pHdl = new XMLPMPropHdl_Print( sXML_annotations ); @@ -141,7 +148,12 @@ const XMLPropertyHandler* XMLPageMasterPropHdlFactory::GetPropertyHandler( sal_I pHdl = new XMLPMPropHdl_Print( sXML_zero_values ); break; case XML_PM_TYPE_PRINTPAGEORDER: - pHdl = new XMLBoolValuesPropHdl( sXML_ttb, sXML_ltr ); + pHdl = new XMLNamedBoolPropertyHdl( + OUString( RTL_CONSTASCII_USTRINGPARAM( sXML_ttb ) ), + OUString( RTL_CONSTASCII_USTRINGPARAM( sXML_ltr ) ) ); + break; + case XML_PM_TYPE_FIRSTPAGENUMBER: + pHdl = new XMLNumberNonePropHdl( sXML_continue, 2 ); break; } diff --git a/xmloff/source/style/PageMasterPropMapper.cxx b/xmloff/source/style/PageMasterPropMapper.cxx index ff6fb53032e5..a1f2fbd84515 100644 --- a/xmloff/source/style/PageMasterPropMapper.cxx +++ b/xmloff/source/style/PageMasterPropMapper.cxx @@ -2,9 +2,9 @@ * * $RCSfile: PageMasterPropMapper.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: dr $ $Date: 2000-10-20 16:30:27 $ + * last change: $Author: dr $ $Date: 2000-10-23 09:57:51 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -78,12 +78,6 @@ using namespace ::com::sun::star::beans; //______________________________________________________________________________ -inline void lcl_RemoveState( XMLPropertyState* pState ) -{ - pState->mnIndex = -1; - pState->maValue.clear(); -} - inline sal_Bool lcl_HasSameLineWidth( const table::BorderLine& rLine1, const table::BorderLine& rLine2 ) { return (rLine1.InnerLineWidth == rLine2.InnerLineWidth) && @@ -97,6 +91,20 @@ inline sal_Bool operator==( const table::BorderLine& rLine1, const table::Border lcl_HasSameLineWidth( rLine1, rLine2 ); } +inline void lcl_RemoveState( XMLPropertyState* pState ) +{ + pState->mnIndex = -1; + pState->maValue.clear(); +} + +void lcl_RemoveStateIfZero16( XMLPropertyState* pState ) +{ + sal_Int16 nValue; + if( (pState->maValue >>= nValue) && !nValue ) + lcl_RemoveState( pState ); +} + + //______________________________________________________________________________ // helper struct to handle equal XMLPropertyState's for page, header and footer @@ -254,6 +262,9 @@ void XMLPageMasterPropSetMapper::ContextFilter( XMLPropertyState* pPMFooterMinHeight = NULL; XMLPropertyState* pPMFooterDynamic = NULL; + XMLPropertyState* pPMScaleTo = NULL; + XMLPropertyState* pPMScaleToPages = NULL; + for( ::std::vector< XMLPropertyState >::iterator pProp = rPropState.begin(); pProp != rPropState.end(); pProp++ ) { sal_Int16 nContextId = GetEntryContextId( pProp->mnIndex ); @@ -295,6 +306,8 @@ void XMLPageMasterPropSetMapper::ContextFilter( case CTF_PM_FOOTERHEIGHT: pPMFooterHeight = pProp; break; case CTF_PM_FOOTERMINHEIGHT: pPMFooterMinHeight = pProp; break; case CTF_PM_FOOTERDYNAMIC: pPMFooterDynamic = pProp; break; + case CTF_PM_SCALETO: pPMScaleTo = pProp; break; + case CTF_PM_SCALETOPAGES: pPMScaleToPages = pProp; break; } } @@ -323,5 +336,10 @@ void XMLPageMasterPropSetMapper::ContextFilter( } if( pPMFooterDynamic ) lcl_RemoveState( pPMFooterDynamic ); + + if( pPMScaleTo ) + lcl_RemoveStateIfZero16( pPMScaleTo ); + if( pPMScaleToPages ) + lcl_RemoveStateIfZero16( pPMScaleToPages ); } diff --git a/xmloff/source/style/PageMasterStyleMap.cxx b/xmloff/source/style/PageMasterStyleMap.cxx index 8f0c02c5409e..509e3b034f94 100644 --- a/xmloff/source/style/PageMasterStyleMap.cxx +++ b/xmloff/source/style/PageMasterStyleMap.cxx @@ -2,9 +2,9 @@ * * $RCSfile: PageMasterStyleMap.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: dr $ $Date: 2000-10-20 16:30:27 $ + * last change: $Author: dr $ $Date: 2000-10-23 09:53:27 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -117,9 +117,9 @@ const XMLPropertyMapEntry aXMLPageMasterStyleMap[] = { "PrintObjects", XML_NAMESPACE_STYLE, sXML_print, XML_PM_TYPE_PRINTOBJECTS | MID_FLAG_MULTI_PROPERTY | MID_FLAG_MERGE_ATTRIBUTE, 0 }, { "PrintZeroValues", XML_NAMESPACE_STYLE, sXML_print, XML_PM_TYPE_PRINTZEROVALUES | MID_FLAG_MERGE_ATTRIBUTE, 0 }, { "PrintDownFirst", XML_NAMESPACE_STYLE, sXML_print_page_order, XML_PM_TYPE_PRINTPAGEORDER, 0 }, - { "FirstPageNumber", XML_NAMESPACE_STYLE, sXML_first_page_number, XML_TYPE_NUMBER16, 0 }, - { "PageScale", XML_NAMESPACE_STYLE, sXML_scale_to, XML_TYPE_NUMBER16, 0 }, - { "ScaleToPages", XML_NAMESPACE_STYLE, sXML_scale_to_pages, XML_TYPE_NUMBER16, 0 }, + { "FirstPageNumber", XML_NAMESPACE_STYLE, sXML_first_page_number, XML_PM_TYPE_FIRSTPAGENUMBER, 0 }, + { "PageScale", XML_NAMESPACE_STYLE, sXML_scale_to, XML_TYPE_NUMBER16, CTF_PM_SCALETO }, + { "ScaleToPages", XML_NAMESPACE_STYLE, sXML_scale_to_pages, XML_TYPE_NUMBER16, CTF_PM_SCALETOPAGES }, // header { "HeaderHeight", XML_NAMESPACE_SVG, sXML_height, XML_TYPE_MEASURE | MID_FLAG_SPECIAL_ITEM_EXPORT, CTF_PM_HEADERHEIGHT }, { "HeaderHeight", XML_NAMESPACE_FO, sXML_min_height, XML_TYPE_MEASURE | MID_FLAG_SPECIAL_ITEM_EXPORT, CTF_PM_HEADERMINHEIGHT }, |