diff options
-rw-r--r-- | xmloff/inc/xmlerror.hxx | 7 | ||||
-rw-r--r-- | xmloff/source/chart/PropertyMaps.cxx | 10 | ||||
-rw-r--r-- | xmloff/source/core/xmlimp.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/core/xmltoken.cxx | 5 | ||||
-rw-r--r-- | xmloff/source/draw/shapeimport.cxx | 16 | ||||
-rw-r--r-- | xmloff/source/forms/layerimport.cxx | 9 | ||||
-rw-r--r-- | xmloff/source/style/PageMasterImportPropMapper.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/style/PageMasterStyleMap.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/style/xmlimppr.cxx | 90 | ||||
-rw-r--r-- | xmloff/source/text/XMLTextShapeImportHelper.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/text/txtimp.cxx | 166 | ||||
-rw-r--r-- | xmloff/source/text/txtimppr.cxx | 7 | ||||
-rw-r--r-- | xmloff/source/text/txtstyli.cxx | 8 |
13 files changed, 137 insertions, 205 deletions
diff --git a/xmloff/inc/xmlerror.hxx b/xmloff/inc/xmlerror.hxx index 70536390151e..1a7f93c6e4a6 100644 --- a/xmloff/inc/xmlerror.hxx +++ b/xmloff/inc/xmlerror.hxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlerror.hxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: dvo $ $Date: 2001-09-18 16:28:34 $ + * last change: $Author: dvo $ $Date: 2001-09-21 16:27:52 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -100,6 +100,9 @@ #define XMLERROR_SAX ( XMLERROR_CLASS_FORMAT | 0x00000001 ) // API errors: +#define XMLERROR_STYLE_PROP_VALUE ( XMLERROR_CLASS_API | 0x00000001 ) +#define XMLERROR_STYLE_PROP_UNKNOWN ( XMLERROR_CLASS_API | 0x00000002 ) +#define XMLERROR_STYLE_PROP_OTHER ( XMLERROR_CLASS_API | 0x00000003 ) // other errors: #define XMLERROR_CANCEL ( XMLERROR_CLASS_OTHER | 0x00000001 ) diff --git a/xmloff/source/chart/PropertyMaps.cxx b/xmloff/source/chart/PropertyMaps.cxx index a5e6b837476e..3b475d5448fa 100644 --- a/xmloff/source/chart/PropertyMaps.cxx +++ b/xmloff/source/chart/PropertyMaps.cxx @@ -2,9 +2,9 @@ * * $RCSfile: PropertyMaps.cxx,v $ * - * $Revision: 1.30 $ + * $Revision: 1.31 $ * - * last change: $Author: bm $ $Date: 2001-08-16 13:28:49 $ + * last change: $Author: dvo $ $Date: 2001-09-21 16:27:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -454,14 +454,14 @@ void XMLChartExportPropertyMapper::handleSpecialItem( XMLChartImportPropertyMapper::XMLChartImportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper, const SvXMLImport& rImport ) : - SvXMLImportPropertyMapper( rMapper ), - mrImport( SAL_CONST_CAST( SvXMLImport&, rImport )) + mrImport( SAL_CONST_CAST( SvXMLImport&, rImport )), + SvXMLImportPropertyMapper( rMapper, mrImport ) { // chain shape mapper for drawing properties // give an empty model. It is only used for numbering rules that don't exist in chart uno::Reference< frame::XModel > xEmptyModel; - ChainImportMapper( XMLShapeImportHelper::CreateShapePropMapper( xEmptyModel )); + ChainImportMapper( XMLShapeImportHelper::CreateShapePropMapper( xEmptyModel, mrImport )); // do not chain text properties: on import this is done by shape mapper // to import old documents diff --git a/xmloff/source/core/xmlimp.cxx b/xmloff/source/core/xmlimp.cxx index d338a0b7c954..c2909db66cab 100644 --- a/xmloff/source/core/xmlimp.cxx +++ b/xmloff/source/core/xmlimp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlimp.cxx,v $ * - * $Revision: 1.56 $ + * $Revision: 1.57 $ * - * last change: $Author: dvo $ $Date: 2001-09-18 16:28:34 $ + * last change: $Author: dvo $ $Date: 2001-09-21 16:27:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -788,7 +788,7 @@ uno::Sequence< OUString > SAL_CALL SvXMLImport::getSupportedServiceNames( ) XMLTextImportHelper* SvXMLImport::CreateTextImport() { - return new XMLTextImportHelper( xModel ); + return new XMLTextImportHelper( xModel, *this ); } XMLShapeImportHelper* SvXMLImport::CreateShapeImport() diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 6681f6dfab62..31ea5c6cf7d4 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmltoken.cxx,v $ * - * $Revision: 1.21 $ + * $Revision: 1.22 $ * - * last change: $Author: sab $ $Date: 2001-09-04 06:39:36 $ + * last change: $Author: dvo $ $Date: 2001-09-21 16:27:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -2072,6 +2072,7 @@ namespace xmloff { namespace token { TOKEN( "text-overlap" ), // XML_TEXT_OVERLAP TOKEN( "spline-order" ), // XML_SPLINE_ORDER TOKEN( "spline-resolution" ), // XML_SPLINE_RESOLUTION + TOKEN( "paper-tray-name" ), // XML_PAPER_TRAY_NAME { 0, NULL, NULL } // XML_TOKEN_END }; diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx index 9d5055eb8e86..131841e93184 100644 --- a/xmloff/source/draw/shapeimport.cxx +++ b/xmloff/source/draw/shapeimport.cxx @@ -2,9 +2,9 @@ * * $RCSfile: shapeimport.cxx,v $ * - * $Revision: 1.42 $ + * $Revision: 1.43 $ * - * last change: $Author: cl $ $Date: 2001-08-15 10:31:02 $ + * last change: $Author: dvo $ $Date: 2001-09-21 16:27:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -233,7 +233,7 @@ XMLShapeImportHelper::XMLShapeImportHelper( // construct PropertySetMapper UniReference < XMLPropertySetMapper > xMapper = new XMLShapePropertySetMapper(mpSdPropHdlFactory); - mpPropertySetMapper = new SvXMLImportPropertyMapper( xMapper ); + mpPropertySetMapper = new SvXMLImportPropertyMapper( xMapper, rImporter ); // set lock to avoid deletion mpPropertySetMapper->acquire(); @@ -244,7 +244,7 @@ XMLShapeImportHelper::XMLShapeImportHelper( } // chain text attributes - mpPropertySetMapper->ChainImportMapper(XMLTextImportHelper::CreateParaExtPropMapper()); + mpPropertySetMapper->ChainImportMapper(XMLTextImportHelper::CreateParaExtPropMapper(rImporter)); /* // chain form attributes @@ -254,7 +254,7 @@ XMLShapeImportHelper::XMLShapeImportHelper( // construct PresPagePropsMapper xMapper = new XMLPropertySetMapper((XMLPropertyMapEntry*)aXMLSDPresPageProps, mpSdPropHdlFactory); - mpPresPagePropsMapper = new SvXMLImportPropertyMapper( xMapper ); + mpPresPagePropsMapper = new SvXMLImportPropertyMapper( xMapper, rImporter ); if(mpPresPagePropsMapper) { // set lock to avoid deletion @@ -1175,14 +1175,14 @@ void XMLShapeImportHelper::restoreConnections() } } -SvXMLImportPropertyMapper* XMLShapeImportHelper::CreateShapePropMapper( const uno::Reference< frame::XModel>& rModel ) +SvXMLImportPropertyMapper* XMLShapeImportHelper::CreateShapePropMapper( const uno::Reference< frame::XModel>& rModel, SvXMLImport& rImport ) { UniReference< XMLPropertyHandlerFactory > xFactory = new XMLSdPropHdlFactory( rModel ); UniReference < XMLPropertySetMapper > xMapper = new XMLShapePropertySetMapper( xFactory ); - SvXMLImportPropertyMapper* pResult = new SvXMLImportPropertyMapper( xMapper ); + SvXMLImportPropertyMapper* pResult = new SvXMLImportPropertyMapper( xMapper, rImport ); // chain text attributes - pResult->ChainImportMapper( XMLTextImportHelper::CreateParaExtPropMapper() ); + pResult->ChainImportMapper( XMLTextImportHelper::CreateParaExtPropMapper( rImport ) ); return pResult; } diff --git a/xmloff/source/forms/layerimport.cxx b/xmloff/source/forms/layerimport.cxx index 17bc7c3768f5..b663f6c67bea 100644 --- a/xmloff/source/forms/layerimport.cxx +++ b/xmloff/source/forms/layerimport.cxx @@ -2,9 +2,9 @@ * * $RCSfile: layerimport.cxx,v $ * - * $Revision: 1.13 $ + * $Revision: 1.14 $ * - * last change: $Author: fs $ $Date: 2001-05-28 15:04:18 $ + * last change: $Author: dvo $ $Date: 2001-09-21 16:27:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -308,7 +308,7 @@ namespace xmloff // initialize our style map m_xPropertyHandlerFactory = new OControlPropertyHandlerFactory(); ::vos::ORef< XMLPropertySetMapper > xStylePropertiesMapper = new XMLPropertySetMapper(aControlStyleProperties, m_xPropertyHandlerFactory.getBodyPtr()); - m_xImportMapper = new SvXMLImportPropertyMapper(xStylePropertiesMapper.getBodyPtr()); + m_xImportMapper = new SvXMLImportPropertyMapper(xStylePropertiesMapper.getBodyPtr(), _rImporter); // 'initialize' m_aCurrentPageIds = m_aControlIds.end(); @@ -587,6 +587,9 @@ namespace xmloff /************************************************************************* * history: * $Log: not supported by cvs2svn $ + * Revision 1.13 2001/05/28 15:04:18 fs + * #86712# no releaseContext anymore + * * Revision 1.12 2001/05/28 14:59:18 fs * #86712# added control number style related functionality * diff --git a/xmloff/source/style/PageMasterImportPropMapper.cxx b/xmloff/source/style/PageMasterImportPropMapper.cxx index efe1a3b7f08b..5898d09b39d4 100644 --- a/xmloff/source/style/PageMasterImportPropMapper.cxx +++ b/xmloff/source/style/PageMasterImportPropMapper.cxx @@ -2,9 +2,9 @@ * * $RCSfile: PageMasterImportPropMapper.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: dvo $ $Date: 2001-01-29 14:58:16 $ + * last change: $Author: dvo $ $Date: 2001-09-21 16:27:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -96,7 +96,7 @@ using namespace ::com::sun::star::container; PageMasterImportPropertyMapper::PageMasterImportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper, SvXMLImport& rImp ) : - SvXMLImportPropertyMapper( rMapper ), + SvXMLImportPropertyMapper( rMapper, rImp ), rImport( rImp ) { } diff --git a/xmloff/source/style/PageMasterStyleMap.cxx b/xmloff/source/style/PageMasterStyleMap.cxx index 213f76fd06de..a39cc2a2a9fd 100644 --- a/xmloff/source/style/PageMasterStyleMap.cxx +++ b/xmloff/source/style/PageMasterStyleMap.cxx @@ -2,9 +2,9 @@ * * $RCSfile: PageMasterStyleMap.cxx,v $ * - * $Revision: 1.18 $ + * $Revision: 1.19 $ * - * last change: $Author: dvo $ $Date: 2001-07-13 16:08:25 $ + * last change: $Author: dvo $ $Date: 2001-09-21 16:27:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -83,7 +83,7 @@ const XMLPropertyMapEntry aXMLPageMasterStyleMap[] = MAP( "Height", XML_NAMESPACE_FO, XML_PAGE_HEIGHT, XML_TYPE_MEASURE, 0 ), MAP( "NumberingType", XML_NAMESPACE_STYLE, XML_NUM_FORMAT, XML_PM_TYPE_NUMFORMAT | MID_FLAG_MERGE_PROPERTY, 0 ), MAP( "NumberingType", XML_NAMESPACE_STYLE, XML_NUM_LETTER_SYNC, XML_PM_TYPE_NUMLETTERSYNC, 0 ), -// MAP( "PrinterPaperTray", XML_NAMESPACE_STYLE, XML_PAPER_TRAY_NUMBER, XML_PM_TYPE_PAPERTRAYNUMBER, 0 ), + MAP( "PrinterPaperTray", XML_NAMESPACE_STYLE, XML_PAPER_TRAY_NAME, XML_TYPE_STRING | MID_FLAG_PROPERTY_MAY_EXCEPT, 0 ), MAP( "IsLandscape", XML_NAMESPACE_STYLE, XML_PRINT_ORIENTATION, XML_PM_TYPE_PRINTORIENTATION, 0 ), MAP( "TopMargin", XML_NAMESPACE_FO, XML_MARGIN_TOP, XML_TYPE_MEASURE, 0 ), MAP( "BottomMargin", XML_NAMESPACE_FO, XML_MARGIN_BOTTOM, XML_TYPE_MEASURE, 0 ), diff --git a/xmloff/source/style/xmlimppr.cxx b/xmloff/source/style/xmlimppr.cxx index f54d66eed20e..4fd08d251472 100644 --- a/xmloff/source/style/xmlimppr.cxx +++ b/xmloff/source/style/xmlimppr.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xmlimppr.cxx,v $ * - * $Revision: 1.20 $ + * $Revision: 1.21 $ * - * last change: $Author: mtg $ $Date: 2001-07-10 11:32:06 $ + * last change: $Author: dvo $ $Date: 2001-09-21 16:27:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -67,6 +67,22 @@ #include <com/sun/star/beans/XMultiPropertySet.hpp> #endif +#ifndef _COM_SUN_STAR_LANG_ILLEGALARGUMENTEXCEPTION_HPP_ +#include <com/sun/star/lang/IllegalArgumentException.hpp> +#endif + +#ifndef _COM_SUN_STAR_LANG_WRAPPEDTARGETEXCEPTION_HPP_ +#include <com/sun/star/lang/WrappedTargetException.hpp> +#endif + +#ifndef _COM_SUN_STAR_BEANS_UNKNOWNPROPERTYEXCEPTION_HPP_ +#include <com/sun/star/beans/UnknownPropertyException.hpp> +#endif + +#ifndef _COM_SUN_STAR_BEANS_PROPERTYVETOEXCEPTION_HPP_ +#include <com/sun/star/beans/PropertyVetoException.hpp> +#endif + #ifndef _RTL_USTRBUF_HXX_ #include <rtl/ustrbuf.hxx> #endif @@ -82,6 +98,10 @@ #include "xmlimppr.hxx" #endif +#ifndef _XMLOFF_XMLIMP_HXX +#include "xmlimp.hxx" +#endif + #include "xmlkywd.hxx" #include "unoatrcn.hxx" #include "xmlnmspe.hxx" @@ -89,6 +109,9 @@ #ifndef _XMLOFF_XMLTOKEN_HXX #include "xmltoken.hxx" #endif +#ifndef _XMLOFF_XMLERROR_HXX +#include "xmlerror.hxx" +#endif // STL includes #include <algorithm> @@ -104,10 +127,17 @@ using namespace ::com::sun::star::xml::sax; using namespace ::rtl; using namespace ::std; using namespace ::xmloff::token; +using ::com::sun::star::lang::IllegalArgumentException; +using ::com::sun::star::lang::WrappedTargetException; +using ::com::sun::star::beans::UnknownPropertyException; +using ::com::sun::star::beans::PropertyVetoException; + SvXMLImportPropertyMapper::SvXMLImportPropertyMapper( - const UniReference< XMLPropertySetMapper >& rMapper ) : - maPropMapper ( rMapper ) + const UniReference< XMLPropertySetMapper >& rMapper, + SvXMLImport& rImp ): + maPropMapper ( rMapper ), + rImport(rImp) { } @@ -347,10 +377,11 @@ sal_Bool SvXMLImportPropertyMapper::FillPropertySet( xInfo, maPropMapper ); if ( !bSet ) bSet = _FillPropertySet( aProperties, rPropSet, - xInfo, maPropMapper ); + xInfo, maPropMapper, rImport); } else - bSet = _FillPropertySet( aProperties, rPropSet, xInfo, maPropMapper ); + bSet = _FillPropertySet( aProperties, rPropSet, xInfo, + maPropMapper, rImport ); return bSet; } @@ -360,6 +391,7 @@ sal_Bool SvXMLImportPropertyMapper::_FillPropertySet( const Reference<XPropertySet> & rPropSet, const Reference<XPropertySetInfo> & rPropSetInfo, const UniReference<XMLPropertySetMapper> & rPropMapper, + SvXMLImport& rImport, struct _ContextID_Index_Pair* pSpecialContextIds ) { OSL_ENSURE( rPropSet.is(), "need an XPropertySet" ); @@ -392,15 +424,45 @@ sal_Bool SvXMLImportPropertyMapper::_FillPropertySet( rPropSet->setPropertyValue( rPropName, rProp.maValue ); bSet = sal_True; } - catch(...) + catch ( IllegalArgumentException& e ) { -#ifndef PRODUCT - ByteString aError("Exception caught while setting property '"); - aError += ByteString( String( rPropName), - RTL_TEXTENCODING_ASCII_US ); - aError += ByteString("'; style may not be imported correctly."); - OSL_ENSURE( bSet, aError.GetBuffer() ); -#endif + // illegal value: check whether this property is + // allowed to throw this exception + if ( 0 == ( nPropFlags & MID_FLAG_PROPERTY_MAY_EXCEPT ) ) + { + Sequence<OUString> aSeq(1); + aSeq[0] = rPropName; + rImport.SetError( + XMLERROR_STYLE_PROP_VALUE | XMLERROR_FLAG_ERROR, + aSeq, e.Message, NULL ); + } + } + catch ( UnknownPropertyException& e ) + { + // unknown property: This is always an error! + Sequence<OUString> aSeq(1); + aSeq[0] = rPropName; + rImport.SetError( + XMLERROR_STYLE_PROP_UNKNOWN | XMLERROR_FLAG_ERROR, + aSeq, e.Message, NULL ); + } + catch ( PropertyVetoException& e ) + { + // property veto: this shouldn't happen + Sequence<OUString> aSeq(1); + aSeq[0] = rPropName; + rImport.SetError( + XMLERROR_STYLE_PROP_OTHER | XMLERROR_FLAG_ERROR, + aSeq, e.Message, NULL ); + } + catch ( WrappedTargetException& e ) + { + // wrapped target: this shouldn't happen either + Sequence<OUString> aSeq(1); + aSeq[0] = rPropName; + rImport.SetError( + XMLERROR_STYLE_PROP_OTHER | XMLERROR_FLAG_ERROR, + aSeq, e.Message, NULL ); } } diff --git a/xmloff/source/text/XMLTextShapeImportHelper.cxx b/xmloff/source/text/XMLTextShapeImportHelper.cxx index c71001c8a4f5..44a5ee8ca881 100644 --- a/xmloff/source/text/XMLTextShapeImportHelper.cxx +++ b/xmloff/source/text/XMLTextShapeImportHelper.cxx @@ -2,9 +2,9 @@ * * $RCSfile: XMLTextShapeImportHelper.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: dvo $ $Date: 2001-08-16 10:21:29 $ + * last change: $Author: dvo $ $Date: 2001-09-21 16:27:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -104,7 +104,7 @@ using namespace ::com::sun::star::xml::sax; XMLTextShapeImportHelper::XMLTextShapeImportHelper( SvXMLImport& rImp ) : XMLShapeImportHelper( rImp, rImp.GetModel(), - XMLTextImportHelper::CreateShapeExtPropMapper() ), + XMLTextImportHelper::CreateShapeExtPropMapper(rImp) ), rImport( rImp ), sAnchorType(RTL_CONSTASCII_USTRINGPARAM("AnchorType")), sAnchorPageNo(RTL_CONSTASCII_USTRINGPARAM("AnchorPageNo")), diff --git a/xmloff/source/text/txtimp.cxx b/xmloff/source/text/txtimp.cxx index 93443dc2c80a..1c076a283665 100644 --- a/xmloff/source/text/txtimp.cxx +++ b/xmloff/source/text/txtimp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtimp.cxx,v $ * - * $Revision: 1.84 $ + * $Revision: 1.85 $ * - * last change: $Author: mib $ $Date: 2001-09-07 06:05:34 $ + * last change: $Author: dvo $ $Date: 2001-09-21 16:27:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -539,144 +539,10 @@ static __FAR_DATA SvXMLTokenMapEntry aTextMasterPageElemTokenMap[] = // maximum allowed length of combined characters field #define MAX_COMBINED_CHARACTERS 6 -#if SUPD < 625 -XMLTextImportHelper::XMLTextImportHelper( - const Reference < XModel >& rModel, - sal_Bool bInsertM, sal_Bool bStylesOnlyM, - sal_Bool bPrg, - sal_Bool bBlockM ) : - pTextElemTokenMap( 0 ), - pTextPElemTokenMap( 0 ), - pTextPAttrTokenMap( 0 ), - pTextListBlockAttrTokenMap( 0 ), - pTextListBlockElemTokenMap( 0 ), - pTextFieldAttrTokenMap( 0 ), - pTextFrameAttrTokenMap( 0 ), -#if SUPD > 627 - pTextContourAttrTokenMap( 0 ), -#endif - pTextHyperlinkAttrTokenMap( 0 ), - pTextMasterPageElemTokenMap( 0 ), - pPrevFrmNames( 0 ), - pNextFrmNames( 0 ), - pRenameMap( 0 ), - pOutlineStyles( 0 ), - bInsertMode( bInsertM ), - bBlockMode( bBlockM ), - bStylesOnlyMode( bStylesOnlyM ), - bProgress( bPrg ), - bOrganizerMode( sal_False ), - bBodyContentStarted( sal_True ), - pFootnoteBackpatcher( NULL ), - pSequenceIdBackpatcher( NULL ), - pSequenceNameBackpatcher( NULL ), - xServiceFactory( rModel, UNO_QUERY ), - sParaStyleName(RTL_CONSTASCII_USTRINGPARAM("ParaStyleName")), - sCharStyleName(RTL_CONSTASCII_USTRINGPARAM("CharStyleName")), - sHeadingStyleName(RTL_CONSTASCII_USTRINGPARAM("HeadingStyleName")), - sNumberingLevel(RTL_CONSTASCII_USTRINGPARAM("NumberingLevel")), - sNumberingStartValue(RTL_CONSTASCII_USTRINGPARAM("NumberingStartValue")), - sParaIsNumberingRestart(RTL_CONSTASCII_USTRINGPARAM("ParaIsNumberingRestart")), - sNumberingRules(RTL_CONSTASCII_USTRINGPARAM("NumberingRules")), - sSequenceNumber(RTL_CONSTASCII_USTRINGPARAM("SequenceNumber")), - sSourceName(RTL_CONSTASCII_USTRINGPARAM("SourceName")), - sCurrentPresentation(RTL_CONSTASCII_USTRINGPARAM("CurrentPresentation")), - sNumberingIsNumber(RTL_CONSTASCII_USTRINGPARAM("NumberingIsNumber")), - sChainNextName(RTL_CONSTASCII_USTRINGPARAM("ChainNextName")), - sChainPrevName(RTL_CONSTASCII_USTRINGPARAM("ChainPrevName")), - sHyperLinkURL(RTL_CONSTASCII_USTRINGPARAM("HyperLinkURL")), - sHyperLinkName(RTL_CONSTASCII_USTRINGPARAM("HyperLinkName")), - sHyperLinkTarget(RTL_CONSTASCII_USTRINGPARAM("HyperLinkTarget")), - sUnvisitedCharStyleName(RTL_CONSTASCII_USTRINGPARAM("UnvisitedCharStyleName")), - sVisitedCharStyleName(RTL_CONSTASCII_USTRINGPARAM("VisitedCharStyleName")), - sTextFrame(RTL_CONSTASCII_USTRINGPARAM("TextFrame")), - sPageDescName(RTL_CONSTASCII_USTRINGPARAM("PageDescName")), - sServerMap(RTL_CONSTASCII_USTRINGPARAM("ServerMap")), - sHyperLinkEvents(RTL_CONSTASCII_USTRINGPARAM("HyperLinkEvents")), - sContent(RTL_CONSTASCII_USTRINGPARAM("Content")), - sServiceCombinedCharacters(RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.text.TextField.CombinedCharacters")) -{ - Reference< XChapterNumberingSupplier > xCNSupplier( rModel, UNO_QUERY ); - - if( xCNSupplier.is() ) - xChapterNumbering = xCNSupplier->getChapterNumberingRules(); - - Reference< XStyleFamiliesSupplier > xFamiliesSupp( rModel, UNO_QUERY ); - DBG_ASSERT( xFamiliesSupp.is(), "no chapter numbering supplier" ); - - if( xFamiliesSupp.is() ) - { - Reference< XNameAccess > xFamilies = xFamiliesSupp->getStyleFamilies(); - - const OUString aParaStyles(RTL_CONSTASCII_USTRINGPARAM("ParagraphStyles")); - if( xFamilies->hasByName( aParaStyles ) ) - { - Any aAny( xFamilies->getByName( aParaStyles ) ); - aAny >>= xParaStyles; - } - - const OUString aCharStyles(RTL_CONSTASCII_USTRINGPARAM("CharacterStyles")); - if( xFamilies->hasByName( aCharStyles ) ) - { - Any aAny( xFamilies->getByName( aCharStyles ) ); - aAny >>= xTextStyles; - } - - const OUString aNumStyles(RTL_CONSTASCII_USTRINGPARAM("NumberingStyles")); - if( xFamilies->hasByName( aNumStyles ) ) - { - Any aAny( xFamilies->getByName( aNumStyles ) ); - aAny >>= xNumStyles; - } - - const OUString aFrameStyles(RTL_CONSTASCII_USTRINGPARAM("FrameStyles")); - if( xFamilies->hasByName( aFrameStyles ) ) - { - Any aAny( xFamilies->getByName( aFrameStyles ) ); - aAny >>= xFrameStyles; - } - - const OUString aPageStyles(RTL_CONSTASCII_USTRINGPARAM("PageStyles")); - if( xFamilies->hasByName( aPageStyles ) ) - { - Any aAny( xFamilies->getByName( aPageStyles ) ); - aAny >>= xPageStyles; - } - } - - Reference < XTextFramesSupplier > xTFS( rModel, UNO_QUERY ); - if( xTFS.is() ) - xTextFrames = xTFS->getTextFrames(); - - Reference < XTextGraphicObjectsSupplier > xTGOS( rModel, UNO_QUERY ); - if( xTGOS.is() ) - xGraphics = xTGOS->getGraphicObjects(); - - Reference < XTextEmbeddedObjectsSupplier > xTEOS( rModel, UNO_QUERY ); - if( xTEOS.is() ) - xObjects = xTEOS->getEmbeddedObjects(); - - XMLPropertySetMapper *pPropMapper = - new XMLTextPropertySetMapper( TEXT_PROP_MAP_PARA ); - xParaImpPrMap = new XMLTextImportPropertyMapper( pPropMapper ); - - pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT ); - xTextImpPrMap = new XMLTextImportPropertyMapper( pPropMapper ); - - pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_FRAME ); - xFrameImpPrMap = new XMLTextImportPropertyMapper( pPropMapper ); - - pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_SECTION ); - xSectionImpPrMap = new XMLTextImportPropertyMapper( pPropMapper ); - - pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_RUBY ); - xRubyImpPrMap = new SvXMLImportPropertyMapper( pPropMapper ); -} -#endif XMLTextImportHelper::XMLTextImportHelper( const Reference < XModel >& rModel, + SvXMLImport& rImport, sal_Bool bInsertM, sal_Bool bStylesOnlyM, sal_Bool bPrg, sal_Bool bBlockM, @@ -688,9 +554,7 @@ XMLTextImportHelper::XMLTextImportHelper( pTextListBlockElemTokenMap( 0 ), pTextFieldAttrTokenMap( 0 ), pTextFrameAttrTokenMap( 0 ), -#if SUPD > 627 pTextContourAttrTokenMap( 0 ), -#endif pTextHyperlinkAttrTokenMap( 0 ), pTextMasterPageElemTokenMap( 0 ), pPrevFrmNames( 0 ), @@ -795,19 +659,19 @@ XMLTextImportHelper::XMLTextImportHelper( XMLPropertySetMapper *pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_PARA ); - xParaImpPrMap = new XMLTextImportPropertyMapper( pPropMapper ); + xParaImpPrMap = new XMLTextImportPropertyMapper( pPropMapper, rImport ); pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT ); - xTextImpPrMap = new XMLTextImportPropertyMapper( pPropMapper ); + xTextImpPrMap = new XMLTextImportPropertyMapper( pPropMapper, rImport ); pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_FRAME ); - xFrameImpPrMap = new XMLTextImportPropertyMapper( pPropMapper ); + xFrameImpPrMap = new XMLTextImportPropertyMapper( pPropMapper, rImport ); pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_SECTION ); - xSectionImpPrMap = new XMLTextImportPropertyMapper( pPropMapper ); + xSectionImpPrMap = new XMLTextImportPropertyMapper( pPropMapper, rImport ); pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_RUBY ); - xRubyImpPrMap = new SvXMLImportPropertyMapper( pPropMapper ); + xRubyImpPrMap = new SvXMLImportPropertyMapper( pPropMapper, rImport ); } XMLTextImportHelper::~XMLTextImportHelper() @@ -819,9 +683,7 @@ XMLTextImportHelper::~XMLTextImportHelper() delete pTextListBlockElemTokenMap; delete pTextFieldAttrTokenMap; delete pTextFrameAttrTokenMap; -#if SUPD > 627 delete pTextContourAttrTokenMap; -#endif delete pTextHyperlinkAttrTokenMap; delete pTextMasterPageElemTokenMap; @@ -834,25 +696,25 @@ XMLTextImportHelper::~XMLTextImportHelper() _FinitBackpatcher(); } -SvXMLImportPropertyMapper *XMLTextImportHelper::CreateShapeExtPropMapper() +SvXMLImportPropertyMapper *XMLTextImportHelper::CreateShapeExtPropMapper(SvXMLImport& rImport) { XMLPropertySetMapper *pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_FRAME ); - return new XMLTextImportPropertyMapper( pPropMapper ); + return new XMLTextImportPropertyMapper( pPropMapper, rImport ); } -SvXMLImportPropertyMapper *XMLTextImportHelper::CreateCharExtPropMapper(XMLFontStylesContext *pFontDecls) +SvXMLImportPropertyMapper *XMLTextImportHelper::CreateCharExtPropMapper(SvXMLImport& rImport, XMLFontStylesContext *pFontDecls) { XMLPropertySetMapper *pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_TEXT ); - return new XMLTextImportPropertyMapper( pPropMapper, pFontDecls ); + return new XMLTextImportPropertyMapper( pPropMapper, rImport, pFontDecls ); } -SvXMLImportPropertyMapper *XMLTextImportHelper::CreateParaExtPropMapper(XMLFontStylesContext *pFontDecls) +SvXMLImportPropertyMapper *XMLTextImportHelper::CreateParaExtPropMapper(SvXMLImport& rImport, XMLFontStylesContext *pFontDecls) { XMLPropertySetMapper *pPropMapper = new XMLTextPropertySetMapper( TEXT_PROP_MAP_SHAPE_PARA ); - return new XMLTextImportPropertyMapper( pPropMapper, pFontDecls ); + return new XMLTextImportPropertyMapper( pPropMapper, rImport, pFontDecls ); } void XMLTextImportHelper::SetCursor( const Reference < XTextCursor > & rCursor ) diff --git a/xmloff/source/text/txtimppr.cxx b/xmloff/source/text/txtimppr.cxx index fbd6a94f0d28..038f1ae9eb93 100644 --- a/xmloff/source/text/txtimppr.cxx +++ b/xmloff/source/text/txtimppr.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtimppr.cxx,v $ * - * $Revision: 1.7 $ + * $Revision: 1.8 $ * - * last change: $Author: dvo $ $Date: 2001-08-01 09:56:38 $ + * last change: $Author: dvo $ $Date: 2001-09-21 16:27:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -179,8 +179,9 @@ sal_Bool XMLTextImportPropertyMapper::handleSpecialItem( XMLTextImportPropertyMapper::XMLTextImportPropertyMapper( const UniReference< XMLPropertySetMapper >& rMapper, + SvXMLImport& rImport, XMLFontStylesContext *pFontDecls ) : - SvXMLImportPropertyMapper( rMapper ), + SvXMLImportPropertyMapper( rMapper, rImport ), nSizeTypeIndex( -2 ), xFontDecls( pFontDecls ) { diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx index 160ef4f3d9b8..6b6841ebc720 100644 --- a/xmloff/source/text/txtstyli.cxx +++ b/xmloff/source/text/txtstyli.cxx @@ -2,9 +2,9 @@ * * $RCSfile: txtstyli.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.17 $ * - * last change: $Author: mib $ $Date: 2001-07-25 07:09:04 $ + * last change: $Author: dvo $ $Date: 2001-09-21 16:27:53 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -416,12 +416,12 @@ void XMLTextStyleContext::FillPropertySet( if ( !bSet ) SvXMLImportPropertyMapper::_FillPropertySet( GetProperties(), rPropSet, xInfo, rPropMapper, - aContextIDs ); + GetImport(), aContextIDs ); } else SvXMLImportPropertyMapper::_FillPropertySet( GetProperties(), rPropSet, xInfo, rPropMapper, - aContextIDs ); + GetImport(), aContextIDs ); // have we found a combined characters sal_Int32 nIndex = aContextIDs[0].nIndex; |